REVIEWED: Prioritize calloc() calls than malloc() on some cases

This commit is contained in:
Ray
2025-09-10 21:03:06 +02:00
parent 8a1468c0c7
commit 5a54fc12a2
4 changed files with 19 additions and 19 deletions

View File

@ -148,8 +148,8 @@ static void CursorEnterCallback(GLFWwindow *window, int enter);
static void JoystickCallback(int jid, int event); // GLFW3 Joystick Connected/Disconnected Callback
// Wrappers used by glfwInitAllocator
static void *AllocateWrapper(size_t size, void *user); // GLFW3 GLFWallocatefun, wrapps around RL_MALLOC macro
static void *ReallocateWrapper(void *block, size_t size, void *user); // GLFW3 GLFWreallocatefun, wrapps around RL_MALLOC macro
static void *AllocateWrapper(size_t size, void *user); // GLFW3 GLFWallocatefun, wrapps around RL_CALLOC macro
static void *ReallocateWrapper(void *block, size_t size, void *user); // GLFW3 GLFWreallocatefun, wrapps around RL_REALLOC macro
static void DeallocateWrapper(void *block, void *user); // GLFW3 GLFWdeallocatefun, wraps around RL_FREE macro
//----------------------------------------------------------------------------------
@ -1342,7 +1342,7 @@ static void SetDimensionsFromMonitor(GLFWmonitor *monitor)
static void *AllocateWrapper(size_t size, void *user)
{
(void)user;
return RL_MALLOC(size);
return RL_CALLOC(size, 1);
}
static void *ReallocateWrapper(void *block, size_t size, void *user)
{