Merge pull request #4579 from gnuhpc/fix-memoryusage-list

Fix memory usage list bug
This commit is contained in:
Salvatore Sanfilippo 2018-01-05 11:53:11 +01:00 committed by GitHub
commit e509fbb8d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -739,7 +739,7 @@ size_t objectComputeSize(robj *o, size_t sample_size) {
elesize += sizeof(quicklistNode)+ziplistBlobLen(node->zl); elesize += sizeof(quicklistNode)+ziplistBlobLen(node->zl);
samples++; samples++;
} while ((node = node->next) && samples < sample_size); } while ((node = node->next) && samples < sample_size);
asize += (double)elesize/samples*listTypeLength(o); asize += (double)elesize/samples*ql->len;
} else if (o->encoding == OBJ_ENCODING_ZIPLIST) { } else if (o->encoding == OBJ_ENCODING_ZIPLIST) {
asize = sizeof(*o)+ziplistBlobLen(o->ptr); asize = sizeof(*o)+ziplistBlobLen(o->ptr);
} else { } else {