From ef55b40db3cd5cb77f7c017df48fbbcbf07d58d3 Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Sun, 11 Feb 2024 08:41:51 -0800 Subject: Prevent dummy scene object allocations from getting compiled out. --- gfx/src/scene/scene_memory.c | 7 +++++-- 1 file 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 { static SceneMemory mem; -#define ALLOC_DUMMY(POOL) \ - assert(mempool_get_block_index(POOL, mempool_alloc(POOL)) == 0) +#define ALLOC_DUMMY(POOL) \ + { \ + const void* object = mempool_alloc(POOL); \ + assert(mempool_get_block_index(POOL, object) == 0); \ + } #define PLURAL(name) name##s #define MEM_FIELD(name) mem.PLURAL(name) -- cgit v1.2.3