From 32d0b3141a9c26fcc5cd4e1046a970ae2d38cad8 Mon Sep 17 00:00:00 2001 From: John Sully Date: Sun, 10 Feb 2019 19:33:07 -0500 Subject: [PATCH] Keep pool allocator up to date (even though we aren't enabling it) --- src/storage.c | 5 ++--- src/storage.h | 5 +++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/storage.c b/src/storage.c index 584bbec27..1987ac4f3 100644 --- a/src/storage.c +++ b/src/storage.c @@ -134,6 +134,8 @@ void storage_init(const char *tmpfilePath, size_t cbFileReserve) { serverAssert(mkdisk == NULL); mkdisk = MEMKIND_DEFAULT; + pool_initialize(&poolobj, sizeof(robj)); + pool_initialize(&poolembstrobj, EMBSTR_ROBJ_SIZE); } else { @@ -169,9 +171,6 @@ void storage_init(const char *tmpfilePath, size_t cbFileReserve) cbFileReserve = 1*1024*1024*1024; // 1 GB (enough to be interesting) posix_fallocate64(memkind_fd(mkdisk), 0, cbFileReserve); - pool_initialize(&poolobj, sizeof(robj)); - pool_initialize(&poolembstrobj, EMBSTR_ROBJ_SIZE); - pthread_atfork(handle_prefork, handle_postfork_parent, handle_postfork_child); } } diff --git a/src/storage.h b/src/storage.h index 8b21cd204..fa3cd5b8c 100644 --- a/src/storage.h +++ b/src/storage.h @@ -17,4 +17,9 @@ void sfree(void*); void *srealloc(void *pv, size_t cb, enum MALLOC_CLASS mclass); size_t salloc_usable_size(void *ptr); +struct redisObject *salloc_objembstr(); +void sfree_objembstr(struct redisObject *obj); +struct redisObject *salloc_obj(); +void sfree_obj(struct redisObject *obj); + #endif