Unverified Commit 6debeb37 authored by FutabaRio's avatar FutabaRio Committed by GitHub
Browse files

fix the size of variable merge_sz in quicklist.c (#11285)

11 was the size of header/trailer in the old structure Ziplist,
but now the size of header/trailer in the new structure Listpack should be 7.
parent b57fd010
...@@ -502,9 +502,9 @@ REDIS_STATIC int _quicklistNodeAllowMerge(const quicklistNode *a, ...@@ -502,9 +502,9 @@ REDIS_STATIC int _quicklistNodeAllowMerge(const quicklistNode *a,
if (unlikely(QL_NODE_IS_PLAIN(a) || QL_NODE_IS_PLAIN(b))) if (unlikely(QL_NODE_IS_PLAIN(a) || QL_NODE_IS_PLAIN(b)))
return 0; return 0;
/* approximate merged listpack size (- 11 to remove one listpack /* approximate merged listpack size (- 7 to remove one listpack
* header/trailer) */ * header/trailer, see LP_HDR_SIZE and LP_EOF) */
unsigned int merge_sz = a->sz + b->sz - 11; unsigned int merge_sz = a->sz + b->sz - 7;
if (likely(_quicklistNodeSizeMeetsOptimizationRequirement(merge_sz, fill))) if (likely(_quicklistNodeSizeMeetsOptimizationRequirement(merge_sz, fill)))
return 1; return 1;
/* when we return 1 above we know that the limit is a size limit (which is /* when we return 1 above we know that the limit is a size limit (which is
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment