MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / poolAllocRelease

Function poolAllocRelease

src/module.cpp:479–488  ·  view source on GitHub ↗

Release the chain of blocks used for pool allocations. */

Source from the content-addressed store, hash-verified

477
478/* Release the chain of blocks used for pool allocations. */
479void poolAllocRelease(RedisModuleCtx *ctx) {
480 RedisModulePoolAllocBlock *head = ctx->pa_head, *next;
481
482 while(head != NULL) {
483 next = head->next;
484 zfree(head);
485 head = next;
486 }
487 ctx->pa_head = NULL;
488}
489
490/* Return heap allocated memory that will be freed automatically when the
491 * module callback function returns. Mostly suitable for small allocations

Callers 1

moduleFreeContextFunction · 0.85

Calls 1

zfreeFunction · 0.85

Tested by

no test coverage detected