MCPcopy Create free account
hub / github.com/F-Stack/f-stack / emptyDbAsync

Function emptyDbAsync

app/redis-6.2.6/src/lazyfree.c:203–209  ·  view source on GitHub ↗

Empty a Redis DB asynchronously. What the function does actually is to * create a new empty set of hash tables and scheduling the old ones for * lazy freeing. */

Source from the content-addressed store, hash-verified

201 * create a new empty set of hash tables and scheduling the old ones for
202 * lazy freeing. */
203void emptyDbAsync(redisDb *db) {
204 dict *oldht1 = db->dict, *oldht2 = db->expires;
205 db->dict = dictCreate(&dbDictType,NULL);
206 db->expires = dictCreate(&dbExpiresDictType,NULL);
207 atomicIncr(lazyfree_objects,dictSize(oldht1));
208 bioCreateLazyFreeJob(lazyfreeFreeDatabase,2,oldht1,oldht2);
209}
210
211/* Release the radix tree mapping Redis Cluster keys to slots asynchronously. */
212void freeSlotsToKeysMapAsync(rax *rt) {

Callers 1

emptyDbStructureFunction · 0.85

Calls 2

bioCreateLazyFreeJobFunction · 0.85
dictCreateFunction · 0.70

Tested by

no test coverage detected