Fix bug with arena allocation on Windows

This commit is contained in:
Abdelrahman Said 2025-02-16 14:52:31 +00:00
parent a4a1e82c40
commit f60442bfcf

View File

@ -73,14 +73,14 @@ void *wapp_mem_arena_alloc_aligned(Arena *arena, u64 size, u64 alignment) {
#ifdef WAPP_PLATFORM_WINDOWS #ifdef WAPP_PLATFORM_WINDOWS
if (!(arena->committed)) { if (!(arena->committed)) {
output = (u8 *)wapp_mem_util_alloc(alloc_start, (uptr)(arena->offset) - (uptr)(alloc_start), wapp_mem_util_alloc(alloc_start, (uptr)(arena->offset) - (uptr)(alloc_start),
WAPP_MEM_ACCESS_READ_WRITE, WAPP_MEM_ALLOC_COMMIT, WAPP_MEM_ACCESS_READ_WRITE, WAPP_MEM_ALLOC_COMMIT,
WAPP_MEM_INIT_INITIALISED); WAPP_MEM_INIT_UNINITIALISED);
} }
#else
memset(output, 0, size);
#endif // ifdef WAPP_PLATFORM_WINDOWS #endif // ifdef WAPP_PLATFORM_WINDOWS
memset(output, 0, size);
return (void *)output; return (void *)output;
} }