From 54522fece58b8d1e1833de9a24782261369ba0fa Mon Sep 17 00:00:00 2001 From: laentropia Date: Sat, 11 Apr 2026 21:17:38 -0600 Subject: [PATCH] delete: Deleted helper utility funcitons --- include/arena.h | 6 ------ src/arena.c | 22 ---------------------- 2 files changed, 28 deletions(-) diff --git a/include/arena.h b/include/arena.h index b90b98f..297f054 100644 --- a/include/arena.h +++ b/include/arena.h @@ -64,10 +64,4 @@ SizeResult arena_get_align_padding(Arena *arena, size_t alignment); // I shouldn't cover. ArenaErr arena_ensure_capacity(Arena *arena, size_t size, size_t alignment); -// Should be moved to something like general utilities, -// i should make one for all my c projects -static inline bool mul_size_t_safe(size_t a, size_t b, size_t *out); -static inline bool add_size_t_safe(size_t a, size_t b, size_t *out); -static inline bool is_power_of_two(size_t x); - #endif // !ARENA_H diff --git a/src/arena.c b/src/arena.c index 0a86219..94db160 100644 --- a/src/arena.c +++ b/src/arena.c @@ -200,26 +200,4 @@ void *arena_unwrap_pointer(ArenaPointer p) { return p.arena->buffer + p.offset; } -static inline bool is_power_of_two(size_t x) { - return x != 0 && (x & (x - 1)) == 0; -} - -static inline bool add_size_t_safe(size_t a, size_t b, size_t *out) { - if (a > SIZE_MAX - b) return true; - *out = a + b; - return false; -} - -static inline bool mul_size_t_safe(size_t a, size_t b, size_t *out) { - if (out == NULL) { - return true; - } - - if (a != 0 && b > SIZE_MAX / a) { - return true; - } - - *out = a * b; - return false; -}