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

Function zslFree

src/t_zset.cpp:106–116  ·  view source on GitHub ↗

Free a whole skiplist. */

Source from the content-addressed store, hash-verified

104
105/* Free a whole skiplist. */
106void zslFree(zskiplist *zsl) {
107 zskiplistNode *node = zsl->header->level(0)->forward, *next;
108
109 zfree(zsl->header);
110 while(node) {
111 next = node->level(0)->forward;
112 zslFreeNode(node);
113 node = next;
114 }
115 zfree(zsl);
116}
117
118/* Returns a random level for the new skiplist node we are going to create.
119 * The return value of this function is between 1 and ZSKIPLIST_MAXLEVEL

Callers 1

freeZsetObjectFunction · 0.85

Calls 3

zfreeFunction · 0.85
zslFreeNodeFunction · 0.85
levelMethod · 0.80

Tested by

no test coverage detected