Fix marena macros

This commit is contained in:
Nils O. Selåsdal
2026-06-22 00:22:05 +02:00
parent 530777fe8c
commit 368225ad66
2 changed files with 14 additions and 11 deletions
+6 -6
View File
@@ -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;