refactor: move Arena and ArenaMem to memory_defs.h (#26240)

This commit is contained in:
zeertzjq
2023-11-27 17:21:58 +08:00
committed by GitHub
parent 84bbe4b0ca
commit 574d25642f
109 changed files with 274 additions and 309 deletions

View File

@@ -577,7 +577,9 @@ void alloc_block(Arena *arena)
static size_t arena_align_offset(uint64_t off)
{
#define ARENA_ALIGN MAX(sizeof(void *), sizeof(double))
return ((off + (ARENA_ALIGN - 1)) & ~(ARENA_ALIGN - 1));
#undef ARENA_ALIGN
}
/// @param arena if NULL, do a global allocation. caller must then free the value!