MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / ObjectPool_DeleteItem

Function ObjectPool_DeleteItem

src/util/object_pool/object_pool.c:119–130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117}
118
119void 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
132void ObjectPool_Free(ObjectPool *pool) {
133 for(uint i = 0; i < pool->blockCount; i++) Block_Free(pool->blocks[i]);

Callers 2

Calls

no outgoing calls

Tested by 1