mirror of
https://github.com/fluencelabs/redis
synced 2025-06-13 17:21:20 +00:00
Fix incorrect memory usage accounting in zrealloc
When HAVE_MALLOC_SIZE is false, each call to zrealloc causes used_memory to increase by PREFIX_SIZE more than it should, due to mis-matched accounting between the original zmalloc (which includes PREFIX size in its increment) and zrealloc (which misses it from its decrement). I've also supplied a command-line test to easily demonstrate the problem. It's not wired into the test framework, because I don't know TCL so I'm not sure how to automate it.
This commit is contained in:
@ -4015,6 +4015,8 @@ int main(int argc, char **argv) {
|
||||
return endianconvTest(argc, argv);
|
||||
} else if (!strcasecmp(argv[2], "crc64")) {
|
||||
return crc64Test(argc, argv);
|
||||
} else if (!strcasecmp(argv[2], "zmalloc")) {
|
||||
return zmalloc_test(argc, argv);
|
||||
}
|
||||
|
||||
return -1; /* test not found */
|
||||
|
Reference in New Issue
Block a user