summaryrefslogtreecommitdiff
path: root/tests/modules/datatype2.c
diff options
context:
space:
mode:
authorHanna Fadida <hanna.fadida@redislabs.com>2021-10-17 17:31:06 +0300
committerGitHub <noreply@github.com>2021-10-17 17:31:06 +0300
commit61bb04415614f4b99002cc6c6a31ef5019881b07 (patch)
tree5d1cfd2cd8e1ec594fed762795bf6126bd1b91a3 /tests/modules/datatype2.c
parente7864a2b7022a3738a6829cf61a6c3dd5ba62c71 (diff)
downloadredis-61bb04415614f4b99002cc6c6a31ef5019881b07.tar.gz
Modify mem_usage2 module callback to enable to take sample_size argument (#9612)
This is useful for approximating size computation of complex module types. Note that the mem_usage2 callback is new and has not been released yet, which is why we can modify it.
Diffstat (limited to 'tests/modules/datatype2.c')
-rw-r--r--tests/modules/datatype2.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/modules/datatype2.c b/tests/modules/datatype2.c
index 0c4279ae5..8ab1b2629 100644
--- a/tests/modules/datatype2.c
+++ b/tests/modules/datatype2.c
@@ -657,8 +657,9 @@ void *MemAllocCopy2(RedisModuleKeyOptCtx *ctx, const void *value) {
return new;
}
-size_t MemAllocMemUsage2(RedisModuleKeyOptCtx *ctx, const void *value) {
+size_t MemAllocMemUsage2(RedisModuleKeyOptCtx *ctx, const void *value, size_t sample_size) {
REDISMODULE_NOT_USED(ctx);
+ REDISMODULE_NOT_USED(sample_size);
uint64_t size = 0;
MemAllocObject *o = (MemAllocObject *)value;