From 97713275dc87ea1d0afa4fd6bc49f695ad40efc0 Mon Sep 17 00:00:00 2001 From: "@syxhe" Date: Fri, 28 Mar 2025 17:23:55 -0500 Subject: Create xalloc function and wrappers, fix XALLOC_EXIT usages to comply with ISO C99 --- src/arena.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/arena.c') diff --git a/src/arena.c b/src/arena.c index 36a9ce7..62dbbf8 100644 --- a/src/arena.c +++ b/src/arena.c @@ -23,6 +23,7 @@ typedef struct arena { arenanode *current; // For keeping track of the largest possible thing that can be allocated to one node + // I don't know if I care to keep this or remove it. I'll see if it becomes a problem / is useful size_t node_memspace; } arena; @@ -49,7 +50,7 @@ arenanode * arenanode_init(size_t bytes) { arena * arena_init(size_t bytes) { if(!ISPOWOF2(MEM_ALIGN_BYTES)) - XALLOC_EXIT(" \"MEM_ALIGN_BYTES\" is not a power of 2. Refusing to create a new arena"); + XALLOC_EXIT(" \"MEM_ALIGN_BYTES\" is not a power of 2. Refusing to create a new arena", ); arena *a = VALLOC(1, sizeof(arena)); if(!a) @@ -73,7 +74,7 @@ arena * arena_init(size_t bytes) { void * arena_alloc(arena * const arena, size_t bytes) { if(!ISPOWOF2(MEM_ALIGN_BYTES)) - XALLOC_EXIT(" \"MEM_ALIGN_BYTES\" is not a power of 2. Refusing to allocate any memory"); + XALLOC_EXIT(" \"MEM_ALIGN_BYTES\" is not a power of 2. Refusing to allocate any memory", ); if(!arena) RETURNWERR(EINVAL, NULL); if(bytes > arena->node_memspace) -- cgit v1.2.3