test/refactor: changed things for working with more edge cases

This commit is contained in:
2026-04-11 21:15:31 -06:00
parent d069a108ce
commit 15b5cc382f
3 changed files with 141 additions and 18 deletions

View File

@@ -58,10 +58,16 @@ ArenaErr arena_realloc(Arena *arena, size_t new_capacity);
void *arena_unwrap_pointer(ArenaPointer p);
SizeResult arena_get_align_padding(Arena *arena, size_t alignment);
// can take big sizes but of sourse there is a limit,
// its protected against SIZE_MAX but anything that
// is big may break it, still, is an edge case that
// 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
bool mul_size_t_safe(size_t a, size_t b, size_t *out);
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