Skip to content

Commit 1f0679d

Browse files
committed
Fix MALLOC=memkind build issues
1 parent 2ae3dd6 commit 1f0679d

5 files changed

Lines changed: 5 additions & 2 deletions

File tree

runtest-moduleapi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ $TCLSH tests/test_helper.tcl \
3232
--single unit/moduleapi/blockedclient \
3333
--single unit/moduleapi/moduleloadsave \
3434
--single unit/moduleapi/getkeys \
35+
--single unit/moduleapi/timers \
3536
--single unit/moduleapi/test_lazyfree \
3637
--single unit/moduleapi/defrag \
3738
--single unit/moduleapi/hash \

src/object.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ robj *createEmbeddedStringObject(const char *ptr, size_t len) {
136136
*
137137
* The current limit of 52 is chosen so that the biggest string object
138138
* we allocate as EMBSTR will still fit into the 64 byte arena of jemalloc. */
139-
#define OBJ_ENCODING_EMBSTR_SIZE_LIMIT 52
139+
size_t OBJ_ENCODING_EMBSTR_SIZE_LIMIT = 52;
140140

141141
//static_assert((sizeof(redisObject)+OBJ_ENCODING_EMBSTR_SIZE_LIMIT-8) == 64, "Max EMBSTR obj should be 64 bytes total");
142142
robj *createStringObject(const char *ptr, size_t len) {

src/storage.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ void pool_free(struct alloc_pool *ppool, void *pv)
114114
return;
115115
}
116116

117+
extern size_t OBJ_ENCODING_EMBSTR_SIZE_LIMIT;
117118
#define EMBSTR_ROBJ_SIZE (sizeof(robj)+sizeof(struct sdshdr8)+OBJ_ENCODING_EMBSTR_SIZE_LIMIT+1)
118119
struct alloc_pool poolobj;
119120
struct alloc_pool poolembstrobj;

src/zmalloc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ void *ztryrealloc_usable(void *ptr, size_t size, size_t *usable) {
243243
#else
244244
realptr = (char*)ptr-PREFIX_SIZE;
245245
oldsize = *((size_t*)realptr);
246-
newptr = realloc(realptr,size+PREFIX_SIZE);
246+
newptr = realloc(realptr,size+PREFIX_SIZE, MALLOC_LOCAL);
247247
if (newptr == NULL) {
248248
if (usable) *usable = 0;
249249
return NULL;

tests/modules/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ TEST_MODULES = \
3232
auth.so \
3333
keyspace_events.so \
3434
blockedclient.so \
35+
timers.so \
3536
getkeys.so \
3637
test_lazyfree.so \
3738
timer.so \

0 commit comments

Comments
 (0)