summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorShreyas Siravara <sshreyas@fb.com>2016-12-15 09:06:00 -0800
committerShreyas Siravara <sshreyas@fb.com>2016-12-15 14:54:52 -0800
commit2e1414c7d05bdff0f0750c6024cf867e51de37cb (patch)
tree1d5f000abf433f47d9fbe51dda8801fcad69b230 /libglusterfs
parentbbceb48f0fe8b1fc2604fd3fcd347e143cab600a (diff)
core: Disable the memory pooler in Gluster via a build flag
Summary: Passing --disable-mempool to configure will disable the mempool. Signed-off-by: Shreyas Siravara <sshreyas@fb.com> Change-Id: I748d5afd67811ba9fdee6d651dbdb9d57e9d9123 Reviewed-on: http://review.gluster.org/16145 NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Kevin Vigor <kvigor@fb.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/mem-pool.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libglusterfs/src/mem-pool.c b/libglusterfs/src/mem-pool.c
index 78fecec4b0f..40e80d5c33e 100644
--- a/libglusterfs/src/mem-pool.c
+++ b/libglusterfs/src/mem-pool.c
@@ -450,6 +450,10 @@ mem_get0 (struct mem_pool *mem_pool)
void *
mem_get (struct mem_pool *mem_pool)
{
+#ifdef DISABLE_MEMPOOL
+ return GF_CALLOC (1, mem_pool->real_sizeof_type,
+ gf_common_mt_mem_pool);
+#else
struct list_head *list = NULL;
void *ptr = NULL;
int *in_use = NULL;
@@ -521,6 +525,7 @@ fwd_addr_out:
UNLOCK (&mem_pool->lock);
return ptr;
+#endif /* DISABLE_MEMPOOL */
}
@@ -547,6 +552,10 @@ __is_member (struct mem_pool *pool, void *ptr)
void
mem_put (void *ptr)
{
+#ifdef DISABLE_MEMPOOL
+ GF_FREE (ptr);
+ return;
+#else
struct list_head *list = NULL;
int *in_use = NULL;
void *head = NULL;
@@ -624,6 +633,7 @@ mem_put (void *ptr)
}
}
UNLOCK (&pool->lock);
+#endif /* DISABLE_MEMPOOL */
}
void