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

Function dictFreeUnlinkedEntry

src/dict.cpp:787–800  ·  view source on GitHub ↗

You need to call this function to really free the entry after a call * to dictUnlink(). It's safe to call this function with 'he' = NULL. */

Source from the content-addressed store, hash-verified

785/* You need to call this function to really free the entry after a call
786 * to dictUnlink(). It's safe to call this function with 'he' = NULL. */
787void dictFreeUnlinkedEntry(dict *d, dictEntry *he) {
788 if (he == NULL) return;
789
790 if (d->asyncdata) {
791 dictFreeVal(d, he);
792 he->v.val = nullptr;
793 he->next = d->asyncdata->deGCList;
794 d->asyncdata->deGCList = he;
795 } else {
796 dictFreeKey(d, he);
797 dictFreeVal(d, he);
798 zfree(he);
799 }
800}
801
802/* Destroy an entire dictionary */
803int _dictClear(dict *d, dictht *ht, void(callback)(void *)) {

Callers 9

syncDeleteMethod · 0.85
~FreeMemoryLazyFreeMethod · 0.85
asyncDeleteMethod · 0.85
freeTombstoneObjectsMethod · 0.85
endSnapshotMethod · 0.85
zsetRemoveFromSkiplistFunction · 0.85

Calls 1

zfreeFunction · 0.85

Tested by

no test coverage detected