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

Function _quicklistNodeSizeMeetsOptimizationRequirement

src/quicklist.c:408–424  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

406}
407
408REDIS_STATIC int
409_quicklistNodeSizeMeetsOptimizationRequirement(const size_t sz,
410 const int fill) {
411 if (fill >= 0)
412 return 0;
413
414 size_t offset = (-fill) - 1;
415 if (offset < (sizeof(optimization_level) / sizeof(*optimization_level))) {
416 if (sz <= optimization_level[offset]) {
417 return 1;
418 } else {
419 return 0;
420 }
421 } else {
422 return 0;
423 }
424}
425
426#define sizeMeetsSafetyLimit(sz) ((sz) <= SIZE_SAFETY_LIMIT)
427

Callers 2

_quicklistNodeAllowMergeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected