|
memory_arena
|
Math utility functions for memory alignment and overflow-safe arithmetic. More...
#include <stdbool.h>#include <stddef.h>#include <stdint.h>
Include dependency graph for arena_math.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Functions | |
| static size_t | align_up (size_t value, size_t alignment) |
Align a value upwards to the nearest multiple of alignment. | |
| static size_t | next_power_of_two (size_t x) |
Return the next power of two greater than or equal to x. | |
| static bool | would_overflow_mul (size_t a, size_t b, size_t *result) |
Perform a checked multiplication of two size_t values. | |
Math utility functions for memory alignment and overflow-safe arithmetic.
This header defines a small collection of inline utility functions used internally in the arena allocator for:
align_up)would_overflow_mul)next_power_of_two)These helpers are optimized for performance and portability across platforms.
Definition in file arena_math.h.