From 4d566e5d5d41d6e760bd70a296651926d46eec3e Mon Sep 17 00:00:00 2001
From: Sylvain <[EMAIL REDACTED]>
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 3b7988b84d5..fd83260f6f8 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 e4194657885..49656230c16 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);
}
}