Working on simplifying configurable allocation scheme

This commit is contained in:
Krzosa Karol
2023-01-01 12:40:58 +01:00
parent 8c0a8bf72b
commit c5539276ae
18 changed files with 169 additions and 347 deletions

View File

@@ -8,8 +8,7 @@ enum CmpRes
CMP_EQ,
};
#define count_bigint_alloc() (bigint_allocator != thread_ctx.scratch ? bigint_allocation_count++ : 0)
#define malloc_arena(x) (count_bigint_alloc(), allocate_size(bigint_allocator, x))
#define malloc_arena(x) allocate_size(bigint_allocator, x)
#define ALLOC_DIGITS(_digits) (uint64_t *)((_digits) ? malloc_arena(sizeof(uint64_t) * (_digits)) : NULL)
#define FATAL_ERROR(x) compiler_error(0, x)