From 4d566e5d5d41d6e760bd70a296651926d46eec3e Mon Sep 17 00:00:00 2001 From: Sylvain Date: Mon, 22 Nov 2021 16:39:22 +0100 Subject: [PATCH] VITA, PSP: use SDL_malloc --- src/thread/psp/SDL_syssem.c | 6 +++--- src/thread/vita/SDL_syssem.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/thread/psp/SDL_syssem.c b/src/thread/psp/SDL_syssem.c index 3b7988b84..fd83260f6 100644 --- a/src/thread/psp/SDL_syssem.c +++ b/src/thread/psp/SDL_syssem.c @@ -43,13 +43,13 @@ SDL_sem *SDL_CreateSemaphore(Uint32 initial_value) { SDL_sem *sem; - sem = (SDL_sem *) malloc(sizeof(*sem)); + sem = (SDL_sem *) SDL_malloc(sizeof(*sem)); if (sem != NULL) { /* TODO: Figure out the limit on the maximum value. */ sem->semid = sceKernelCreateSema("SDL sema", 0, initial_value, 255, NULL); if (sem->semid < 0) { SDL_SetError("Couldn't create semaphore"); - free(sem); + SDL_free(sem); sem = NULL; } } else { @@ -68,7 +68,7 @@ void SDL_DestroySemaphore(SDL_sem *sem) sem->semid = 0; } - free(sem); + SDL_free(sem); } } diff --git a/src/thread/vita/SDL_syssem.c b/src/thread/vita/SDL_syssem.c index e41946578..49656230c 100644 --- a/src/thread/vita/SDL_syssem.c +++ b/src/thread/vita/SDL_syssem.c @@ -44,13 +44,13 @@ SDL_sem *SDL_CreateSemaphore(Uint32 initial_value) { SDL_sem *sem; - sem = (SDL_sem *) malloc(sizeof(*sem)); + sem = (SDL_sem *) SDL_malloc(sizeof(*sem)); if (sem != NULL) { /* TODO: Figure out the limit on the maximum value. */ sem->semid = sceKernelCreateSema("SDL sema", 0, initial_value, 255, NULL); if (sem->semid < 0) { SDL_SetError("Couldn't create semaphore"); - free(sem); + SDL_free(sem); sem = NULL; } } else { @@ -69,7 +69,7 @@ void SDL_DestroySemaphore(SDL_sem *sem) sem->semid = 0; } - free(sem); + SDL_free(sem); } }