diff options
-rw-r--r-- | gfx/src/scene/scene_memory.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/gfx/src/scene/scene_memory.c b/gfx/src/scene/scene_memory.c index 3030a8a..85c27e7 100644 --- a/gfx/src/scene/scene_memory.c +++ b/gfx/src/scene/scene_memory.c | |||
@@ -125,9 +125,8 @@ void scene_mem_destroy() { | |||
125 | /* void mem_free_xyz(xyz**); */ \ | 125 | /* void mem_free_xyz(xyz**); */ \ |
126 | void mem_free_##name(type** obj) { mempool_free(&MEM_FIELD(name), obj); } \ | 126 | void mem_free_##name(type** obj) { mempool_free(&MEM_FIELD(name), obj); } \ |
127 | /* xyz* mem_get_xyz(xyz_idx); */ \ | 127 | /* xyz* mem_get_xyz(xyz_idx); */ \ |
128 | /* TODO: Check for 0 index and return nullptr? Otherwise this can \ | ||
129 | * accidentally return a pointer to the dummy objects. */ \ | ||
130 | type* mem_get_##name(NAMED_INDEX(name) index) { \ | 128 | type* mem_get_##name(NAMED_INDEX(name) index) { \ |
129 | assert(index.val != 0); /* 0 is the dummy allocation. */ \ | ||
131 | return mempool_get_block(&MEM_FIELD(name), index.val); \ | 130 | return mempool_get_block(&MEM_FIELD(name), index.val); \ |
132 | } \ | 131 | } \ |
133 | /* xyz_idx mem_get_xyz_index(const xyz*); */ \ | 132 | /* xyz_idx mem_get_xyz_index(const xyz*); */ \ |