| 117 | } |
| 118 | |
| 119 | void ObjectPool_DeleteItem(ObjectPool *pool, void *item) { |
| 120 | ASSERT(pool != NULL); |
| 121 | // Get item ID. |
| 122 | ObjectID idx = ITEM_ID(item); |
| 123 | |
| 124 | // Call item destructor. |
| 125 | if(pool->destructor) pool->destructor(item); |
| 126 | |
| 127 | // Add ID to deleted list. |
| 128 | array_append(pool->deletedIdx, idx); |
| 129 | pool->itemCount--; |
| 130 | } |
| 131 | |
| 132 | void ObjectPool_Free(ObjectPool *pool) { |
| 133 | for(uint i = 0; i < pool->blockCount; i++) Block_Free(pool->blocks[i]); |
no outgoing calls