delete: Deleted helper utility funcitons

This commit is contained in:
2026-04-11 21:17:38 -06:00
parent 15b5cc382f
commit 54522fece5
2 changed files with 0 additions and 28 deletions

View File

@@ -64,10 +64,4 @@ SizeResult arena_get_align_padding(Arena *arena, size_t alignment);
// I shouldn't cover. // I shouldn't cover.
ArenaErr arena_ensure_capacity(Arena *arena, size_t size, size_t alignment); 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 #endif // !ARENA_H

View File

@@ -200,26 +200,4 @@ void *arena_unwrap_pointer(ArenaPointer p) {
return p.arena->buffer + p.offset; 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;
}