summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author3gg <3gg@shellblade.net>2024-02-11 08:41:51 -0800
committer3gg <3gg@shellblade.net>2024-02-11 08:41:51 -0800
commitef55b40db3cd5cb77f7c017df48fbbcbf07d58d3 (patch)
treea22d2df21cfb5fc7ac31585e2830b21660f0b581
parent562aba4f9c71356c4242fdd031948640350aea47 (diff)
Prevent dummy scene object allocations from getting compiled out.
-rw-r--r--gfx/src/scene/scene_memory.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gfx/src/scene/scene_memory.c b/gfx/src/scene/scene_memory.c
index ecd9434..cace654 100644
--- a/gfx/src/scene/scene_memory.c
+++ b/gfx/src/scene/scene_memory.c
@@ -46,8 +46,11 @@ typedef struct SceneMemory {
46 46
47static SceneMemory mem; 47static SceneMemory mem;
48 48
49#define ALLOC_DUMMY(POOL) \ 49#define ALLOC_DUMMY(POOL) \
50 assert(mempool_get_block_index(POOL, mempool_alloc(POOL)) == 0) 50 { \
51 const void* object = mempool_alloc(POOL); \
52 assert(mempool_get_block_index(POOL, object) == 0); \
53 }
51 54
52#define PLURAL(name) name##s 55#define PLURAL(name) name##s
53#define MEM_FIELD(name) mem.PLURAL(name) 56#define MEM_FIELD(name) mem.PLURAL(name)