diff options
| author | steven-na <noreply.github@stvnc.dev> | 2026-08-14 16:31:44 -0700 |
|---|---|---|
| committer | steven-na <noreply.github@stvnc.dev> | 2026-08-14 16:31:44 -0700 |
| commit | f10afce9821a81c8dd138b84a4f1ab56116af20b (patch) | |
| tree | 0233ed16ced2a3e36793ff48a2ff5384dcacf74f /src/ez_arena.c | |
| parent | d3e8a2361f78ef505c8cae2e30faefbfae5c88e1 (diff) | |
Add log messages, can be disabled. Made return values more consistent
Diffstat (limited to 'src/ez_arena.c')
| -rw-r--r-- | src/ez_arena.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/ez_arena.c b/src/ez_arena.c index e37766e..a814289 100644 --- a/src/ez_arena.c +++ b/src/ez_arena.c @@ -1,4 +1,5 @@ #include "ez_arena.h" +#include "log.h" #include <stdlib.h> #include <string.h> @@ -7,6 +8,7 @@ ez_arena_t *ez_arena_create(u64 size, b32 zero_out) { ez_arena_t *alloc = malloc(size + sizeof(ez_arena_t)); if (!alloc) { + log_error("Failed to malloc arena memory"); return NULL; } @@ -16,6 +18,10 @@ ez_arena_t *ez_arena_create(u64 size, b32 zero_out) { *alloc = (ez_arena_t){ .alloc_size = size, .pos = EZ_ARENA_BASE_POS }; + #ifndef NLOG_TRACE + log_trace("Created ez_arena; size %lu", size); + #endif /* ifndef NLOG_TRACE */ + return alloc; } @@ -55,4 +61,8 @@ void ez_arena_clear(ez_arena_t *arena, b32 zero_out) { void ez_arena_destroy(ez_arena_t *arena) { free(arena); + + #ifndef NLOG_TRACE + log_trace("Destroyed ez_arena"); + #endif /* ifndef NLOG_TRACE */ } |