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

Function defragQuicklist

src/defrag.cpp:571–583  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

569}
570
571long defragQuicklist(redisDb *db, dictEntry *kde) {
572 robj *ob = (robj*)dictGetVal(kde);
573 long defragged = 0;
574 quicklist *ql = (quicklist*)ptrFromObj(ob), *newql;
575 serverAssert(ob->type == OBJ_LIST && ob->encoding == OBJ_ENCODING_QUICKLIST);
576 if ((newql = (quicklist*)activeDefragAlloc(ql)))
577 defragged++, ob->m_ptr = ql = newql;
578 if (ql->len > cserver.active_defrag_max_scan_fields)
579 defragLater(db, kde);
580 else
581 defragged += activeDefragQuickListNodes(ql);
582 return defragged;
583}
584
585long defragZsetSkiplist(redisDb *db, dictEntry *kde) {
586 robj *ob = (robj*)dictGetVal(kde);

Callers 1

defragKeyFunction · 0.85

Calls 4

ptrFromObjFunction · 0.85
activeDefragAllocFunction · 0.85
defragLaterFunction · 0.85

Tested by

no test coverage detected