Skip to content

Commit

Permalink
arena return null on zero-size allocation
Browse files Browse the repository at this point in the history
  • Loading branch information
martinfouilleul committed Oct 4, 2024
1 parent d7f4cbb commit ed100e3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/util/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ void* oc_arena_push(oc_arena* arena, u64 size)

void* oc_arena_push_aligned(oc_arena* arena, u64 size, u32 alignment)
{
if(!size)
{
return (0);
}

oc_arena_chunk* chunk = arena->currentChunk;
OC_ASSERT(chunk);

Expand Down

0 comments on commit ed100e3

Please sign in to comment.