]> git.bts.cx Git - benzene.git/blob - src/bz/memory/arena_internal.h
8eab3ba249f4d89632ec3284d338b4b025519880
[benzene.git] / src / bz / memory / arena_internal.h
1 #ifndef BZ_MEMORY_STADIUM_INTERNAL_H
2 #define BZ_MEMORY_STADIUM_INTERNAL_H
3
4 #include <bz/memory/arena.h>
5
6 #ifdef __cplusplus
7 extern "C" {
8 #endif
9
10 #define MAX_WATERMARKS 16
11
12 struct BZMemoryArena {
13 size_t maxSize;
14 uint8_t *memory;
15 bool zeroOut;
16
17 size_t allocationOffsetBottom;
18 size_t allocationOffsetTop;
19
20 size_t numWatermarks;
21 size_t watermarks[MAX_WATERMARKS];
22 };
23
24 extern BZMemoryArenaID bzMemoryArenaSetup(BZMemoryArena *arenaOut, void *memory, size_t size, bool zeroOut);
25 extern BZMemoryArenaID bzMemoryArenaAllocate(BZMemoryArena *arenaOut, BZMemoryArenaID arenaFrom, size_t size);
26
27 //extern void bzMemoryFree(void *p);
28
29 extern void *bzSystemAllocate(size_t size);
30 extern void *bzSystemAllocateStack(size_t size);
31
32 #ifdef __cplusplus
33 }
34 #endif
35
36 #endif