diff options
author | Jeff Darcy <jdarcy@fb.com> | 2017-06-27 07:21:28 -0700 |
---|---|---|
committer | Jeff Darcy <jeff@pl.atyp.us> | 2017-06-28 23:27:15 +0000 |
commit | e9c5b61861299add8bf4b61382611cda68ebb68c (patch) | |
tree | a90ab4726025eba89b8b039407e41f8a1f0e7bee /libglusterfs | |
parent | 91db0d47ca267aecfc6124a3f337a4e2f2c9f1e2 (diff) |
libglusterfs: fix disable-mempool
Change-Id: I55f707ae1e7c3ad7fc0545f7aa657584cead58f9
BUG: 1465214
Signed-off-by: Jeff Darcy <jdarcy@fb.com>
Reviewed-on: https://review.gluster.org/17636
Smoke: Gluster Build System <jenkins@build.gluster.org>
Tested-by: Jeff Darcy <jeff@pl.atyp.us>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Ji-Hyeon Gim
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Diffstat (limited to 'libglusterfs')
-rw-r--r-- | libglusterfs/src/mem-pool.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libglusterfs/src/mem-pool.c b/libglusterfs/src/mem-pool.c index fc07a1e25e6..8bed0a558b8 100644 --- a/libglusterfs/src/mem-pool.c +++ b/libglusterfs/src/mem-pool.c @@ -515,7 +515,6 @@ pool_destructor (void *arg) static __attribute__((constructor)) void mem_pools_preinit (void) { -#if !defined(GF_DISABLE_MEMPOOL) unsigned int i; /* Use a pthread_key destructor to clean up when a thread exits. */ @@ -538,16 +537,17 @@ mem_pools_preinit (void) pool_list_size = sizeof (per_thread_pool_list_t) + sizeof (per_thread_pool_t) * (NPOOLS - 1); -#endif } void mem_pools_init (void) { +#if !defined(GF_DISABLE_MEMPOOL) pthread_t kid; (void) pthread_create (&kid, NULL, pool_sweeper, NULL); (void) pthread_detach (kid); +#endif } struct mem_pool * @@ -667,7 +667,7 @@ void * mem_get (struct mem_pool *mem_pool) { #if defined(GF_DISABLE_MEMPOOL) - return GF_CALLOC (1, mem_pool->real_sizeof_type, + return GF_CALLOC (1, AVAILABLE_SIZE (mem_pool->power_of_two), gf_common_mt_mem_pool); #else per_thread_pool_list_t *pool_list; |