]> git.bts.cx Git - benzene.git/blob - src/bz/memory/arena_internal.h
Fixed Aseprite rendering system
[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 #include <bz/types/identifier.h>
7
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11
12 #define MAX_WATERMARKS 16
13
14 struct BZMemoryArena {
15 char *identifier[kBZMaxIdentifierLength];
16
17 size_t maxSize;
18 uint8_t *memory;
19 bool zeroOut;
20
21 size_t allocationOffsetBottom;
22 size_t allocationOffsetTop;
23
24 size_t numWatermarks;
25 size_t watermarks[MAX_WATERMARKS];
26 };
27
28 extern BZMemoryArenaID bzMemoryArenaSetup(BZMemoryArena *arenaOut, void *memory, size_t size, bool zeroOut);
29 extern BZMemoryArenaID bzMemoryArenaAllocate(BZMemoryArena *arenaOut, BZMemoryArenaID arenaFrom, size_t size);
30
31 //extern void bzMemoryFree(void *p);
32
33 extern void *bzSystemAllocate(size_t size);
34 extern void *bzSystemAllocateStack(size_t size);
35
36 #ifdef __cplusplus
37 }
38 #endif
39
40 #endif