delete: Deleted helper utility funcitons
This commit is contained in:
22
src/arena.c
22
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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user