Fix MALLOC=memkind build issues

This commit is contained in:
John Sully 2022-03-06 20:38:00 -05:00
parent e0d08c62e5
commit 9dad9f6ef4
5 changed files with 5 additions and 2 deletions

View File

@ -32,6 +32,7 @@ $TCLSH tests/test_helper.tcl \
--single unit/moduleapi/blockedclient \
--single unit/moduleapi/moduleloadsave \
--single unit/moduleapi/getkeys \
--single unit/moduleapi/timers \
--single unit/moduleapi/test_lazyfree \
--single unit/moduleapi/defrag \
--single unit/moduleapi/hash \

View File

@ -138,7 +138,7 @@ robj *createEmbeddedStringObject(const char *ptr, size_t len) {
*
* The current limit of 52 is chosen so that the biggest string object
* we allocate as EMBSTR will still fit into the 64 byte arena of jemalloc. */
#define OBJ_ENCODING_EMBSTR_SIZE_LIMIT 52
size_t OBJ_ENCODING_EMBSTR_SIZE_LIMIT = 52;
robj *createStringObject(const char *ptr, size_t len) {
if (len <= OBJ_ENCODING_EMBSTR_SIZE_LIMIT)

View File

@ -118,6 +118,7 @@ void pool_free(struct alloc_pool *ppool, void *pv)
return;
}
extern size_t OBJ_ENCODING_EMBSTR_SIZE_LIMIT;
#define EMBSTR_ROBJ_SIZE (sizeof(robj)+sizeof(struct sdshdr8)+OBJ_ENCODING_EMBSTR_SIZE_LIMIT+1)
struct alloc_pool poolobj;
struct alloc_pool poolembstrobj;

View File

@ -243,7 +243,7 @@ void *ztryrealloc_usable(void *ptr, size_t size, size_t *usable) {
#else
realptr = (char*)ptr-PREFIX_SIZE;
oldsize = *((size_t*)realptr);
newptr = realloc(realptr,size+PREFIX_SIZE);
newptr = realloc(realptr,size+PREFIX_SIZE, MALLOC_LOCAL);
if (newptr == NULL) {
if (usable) *usable = 0;
return NULL;

View File

@ -32,6 +32,7 @@ TEST_MODULES = \
auth.so \
keyspace_events.so \
blockedclient.so \
timers.so \
getkeys.so \
test_lazyfree.so \
timer.so \