Fix marena macros
This commit is contained in:
+6
-6
@@ -54,12 +54,6 @@ static INLINE void marena_temp_end(MTemp *state)
|
||||
arena->temp_level--;
|
||||
}
|
||||
|
||||
#define marena_push_type(allocator, type_)\
|
||||
marenaalloc_aligned((allocator), sizeof(type_), _Alignof(type_))
|
||||
#define marena_push_array(allocator, type_, nr_elements_)\
|
||||
marenaalloc_aligned((allocator), (nr_elements_) * (U32)sizeof(type_), _Alignof(type_))
|
||||
|
||||
|
||||
static INLINE void *marena_push(MArena *arena, U32 size)
|
||||
{
|
||||
if (size > arena->size - arena->first_free) {
|
||||
@@ -90,6 +84,12 @@ static INLINE void *marena_push_aligned(MArena *arena, U32 size, U32 align)
|
||||
return base;
|
||||
}
|
||||
|
||||
#define marena_push_type(arena, type_)\
|
||||
marena_push_aligned((arena), sizeof(type_), _Alignof(type_))
|
||||
#define marena_push_array(arena, type_, nr_elements_)\
|
||||
marena_push_aligned((arena), (nr_elements_) * (U32)sizeof(type_), _Alignof(type_))
|
||||
|
||||
|
||||
static INLINE void marena_reset(MArena *arena)
|
||||
{
|
||||
arena->first_free = 0;
|
||||
|
||||
Reference in New Issue
Block a user