diff options
author | Oran Agra <oran@redislabs.com> | 2020-10-02 08:19:44 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-02 08:19:44 +0300 |
commit | 3945a321779a0be52e556aa11babb3fe15883a78 (patch) | |
tree | f2c139db1d966b75db62373340abf1e81926f364 /src/sdsalloc.h | |
parent | eb6241a3dd3ee27610922e6bccd44603a9b845e8 (diff) | |
download | redis-3945a321779a0be52e556aa11babb3fe15883a78.tar.gz |
performance and memory reporting improvement - sds take control of it's internal frag (#7875)
This commit has two aspects:
1) improve memory reporting for all the places that use sdsAllocSize to compute
memory used by a string, in this case it'll include the internal fragmentation.
2) reduce the need for realloc calls by making the sds implicitly take over
the internal fragmentation of the block it allocated.
Diffstat (limited to 'src/sdsalloc.h')
-rw-r--r-- | src/sdsalloc.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/sdsalloc.h b/src/sdsalloc.h index c04ff2a0a..725ad79e3 100644 --- a/src/sdsalloc.h +++ b/src/sdsalloc.h @@ -43,5 +43,8 @@ #define s_malloc zmalloc #define s_realloc zrealloc #define s_free zfree +#define s_malloc_usable zmalloc_usable +#define s_realloc_usable zrealloc_usable +#define s_free_usable zfree_usable #endif |