From 4c19cdcc37c48b36eb5e665251e41a7b7c126ec1 Mon Sep 17 00:00:00 2001 From: Binbin Date: Mon, 12 Aug 2024 17:57:08 +0800 Subject: [PATCH] Change skiplist maxlevel from 64 to 32 This change follows https://github.com/redis/redis/pull/6818, which can save a lot of memory under certain cases. --- dep/skiplist.h | 2 +- dep/tairhash_skiplist.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dep/skiplist.h b/dep/skiplist.h index 4f41af2..b647437 100644 --- a/dep/skiplist.h +++ b/dep/skiplist.h @@ -2,7 +2,7 @@ #include "../src/redismodule.h" -#define ZSKIPLIST_MAXLEVEL 64 /* Should be enough for 2^64 elements */ +#define ZSKIPLIST_MAXLEVEL 32 /* Should be enough for 2^64 elements */ #define ZSKIPLIST_P 0.25 /* Skiplist P = 1/4 */ typedef struct { diff --git a/dep/tairhash_skiplist.h b/dep/tairhash_skiplist.h index 2ffc53c..932cd77 100644 --- a/dep/tairhash_skiplist.h +++ b/dep/tairhash_skiplist.h @@ -6,7 +6,7 @@ #include "redismodule.h" #include "slab.h" -#define TAIRHASH_ZSKIPLIST_MAXLEVEL 64 /* Should be enough for 2^64 elements */ +#define TAIRHASH_ZSKIPLIST_MAXLEVEL 32 /* Should be enough for 2^64 elements */ #define TAIRHASH_ZSKIPLIST_P 0.25 /* Skiplist P = 1/4 */ typedef struct tairhash_zskiplistNode { Slab *slab;