diff options
| author | @syxhe <https://t.me/syxhe> | 2025-03-24 22:55:45 -0500 |
|---|---|---|
| committer | @syxhe <https://t.me/syxhe> | 2025-03-24 22:55:45 -0500 |
| commit | 277e3b7dd1bc85cd190c6e4c451c7bfab71ee07e (patch) | |
| tree | 4fe47beba815786bfe2a1fa1e0d7a7f912d3ef64 /src/arena.h | |
| parent | a3fdf44e42b988185d1bedd9521b17b34969e75e (diff) | |
Fix MEM_ALIGN_BYTES not being static
Diffstat (limited to 'src/arena.h')
| -rw-r--r-- | src/arena.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/arena.h b/src/arena.h index a94001b..e656f9a 100644 --- a/src/arena.h +++ b/src/arena.h | |||
| @@ -11,7 +11,7 @@ typedef struct arena arena; | |||
| 11 | typedef arena simplearena; | 11 | typedef arena simplearena; |
| 12 | 12 | ||
| 13 | #define ISPOWOF2(x) (((x) & ((x) - 1)) == 0) | 13 | #define ISPOWOF2(x) (((x) & ((x) - 1)) == 0) |
| 14 | const size_t MEM_ALIGN_BYTES = (2 * sizeof(void*)); | 14 | static const size_t MEM_ALIGN_BYTES = (2 * sizeof(void*)); // Hey, the static keyword did something for once! |
| 15 | #define MEM_ALIGN(x) ((x) + (((x) & (MEM_ALIGN_BYTES - 1)) != 0) * (MEM_ALIGN_BYTES - ((x) & (MEM_ALIGN_BYTES - 1)))) | 15 | #define MEM_ALIGN(x) ((x) + (((x) & (MEM_ALIGN_BYTES - 1)) != 0) * (MEM_ALIGN_BYTES - ((x) & (MEM_ALIGN_BYTES - 1)))) |
| 16 | 16 | ||
| 17 | int arena_init(arena **a, size_t bytes); | 17 | int arena_init(arena **a, size_t bytes); |
