diff options
author | 3gg <3gg@shellblade.net> | 2024-02-19 17:22:24 -0800 |
---|---|---|
committer | 3gg <3gg@shellblade.net> | 2024-02-19 17:22:24 -0800 |
commit | 0192616bc757232c354932d2e62df5aa37c3e9ce (patch) | |
tree | 5f6d357defffd2e90fbcd315658d7e1a731114f0 | |
parent | 90d9d72530a893872e2413139410f5fcd48cb387 (diff) |
Address TODO.
-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*); */ \ |