VITA, PSP: use SDL_malloc
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
diff --git a/src/thread/psp/SDL_syssem.c b/src/thread/psp/SDL_syssem.c
index 3b7988b..fd83260 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 e419465..4965623 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);
}
}