diff options
author | guybe7 <guy.benoish@redislabs.com> | 2022-04-17 07:31:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-17 08:31:57 +0300 |
commit | fe1c096b1849b633f41f69f432c4236428035950 (patch) | |
tree | 1c698865eabc25e86045e7d19a2653ad84015e7e /src/object.c | |
parent | effa707e9db3e9d00fff06d45e2a5a81d3d55fa9 (diff) | |
download | redis-fe1c096b1849b633f41f69f432c4236428035950.tar.gz |
Add RM_MallocSizeString, RM_MallocSizeDict (#10542)
Add APIs to allow modules to compute the memory consumption of opaque objects owned by redis.
Without these, the mem_usage callbacks of module data types are useless in many cases.
Other changes:
Fix streamRadixTreeMemoryUsage to include the size of the rax structure itself
Diffstat (limited to 'src/object.c')
-rw-r--r-- | src/object.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/object.c b/src/object.c index a60a27e90..093e2619e 100644 --- a/src/object.c +++ b/src/object.c @@ -958,7 +958,7 @@ char *strEncoding(int encoding) { * on the insertion speed and thus the ability of the radix tree * to compress prefixes. */ size_t streamRadixTreeMemoryUsage(rax *rax) { - size_t size; + size_t size = sizeof(*rax); size = rax->numele * sizeof(streamID); size += rax->numnodes * sizeof(raxNode); /* Add a fixed overhead due to the aux data pointer, children, ... */ |