From f60442bfcf18684143774006241a01a53378a44f Mon Sep 17 00:00:00 2001 From: Abdelrahman Said Date: Sun, 16 Feb 2025 14:52:31 +0000 Subject: [PATCH] Fix bug with arena allocation on Windows --- src/core/mem/arena/mem_arena.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/core/mem/arena/mem_arena.c b/src/core/mem/arena/mem_arena.c index 5e6da30..4d30bd9 100644 --- a/src/core/mem/arena/mem_arena.c +++ b/src/core/mem/arena/mem_arena.c @@ -73,14 +73,14 @@ void *wapp_mem_arena_alloc_aligned(Arena *arena, u64 size, u64 alignment) { #ifdef WAPP_PLATFORM_WINDOWS if (!(arena->committed)) { - output = (u8 *)wapp_mem_util_alloc(alloc_start, (uptr)(arena->offset) - (uptr)(alloc_start), - WAPP_MEM_ACCESS_READ_WRITE, WAPP_MEM_ALLOC_COMMIT, - WAPP_MEM_INIT_INITIALISED); + wapp_mem_util_alloc(alloc_start, (uptr)(arena->offset) - (uptr)(alloc_start), + WAPP_MEM_ACCESS_READ_WRITE, WAPP_MEM_ALLOC_COMMIT, + WAPP_MEM_INIT_UNINITIALISED); } -#else - memset(output, 0, size); #endif // ifdef WAPP_PLATFORM_WINDOWS + memset(output, 0, size); + return (void *)output; }