diff options
Diffstat (limited to 'memory.c')
-rw-r--r-- | memory.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -38,8 +38,11 @@ void* imp_arena_alloc( Arena* a, int size ) { + char* r; assert(a->ptr + size < a->size); - return &a->buf[a->ptr += size]; + r = &a->buf[a->ptr]; + a->ptr += size; + return r; } void* arena_alloc( @@ -61,7 +64,7 @@ void* arena_alloc_aligned( void* p; p = imp_arena_alloc( a, - size + size + align + 1 ); return (void*)align_address((uintptr_t)p, align); } |