summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/mem-pool.c
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@gluster.com>2009-05-21 01:37:05 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-05-21 02:58:22 -0700
commitc7fd9f1df36a01ac9a1509d1001b0d259005b0f9 (patch)
tree4ed27b1cddb973536313fc1817dd32828a37c87f /libglusterfs/src/mem-pool.c
parentef7fcc0d7c2695ab3b10477b3e1290e43831da99 (diff)
mem-pool,io-threads: Destroy mem-pool on deallocation
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
Diffstat (limited to 'libglusterfs/src/mem-pool.c')
-rw-r--r--libglusterfs/src/mem-pool.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/libglusterfs/src/mem-pool.c b/libglusterfs/src/mem-pool.c
index 56a4a1dc2..90df2f39e 100644
--- a/libglusterfs/src/mem-pool.c
+++ b/libglusterfs/src/mem-pool.c
@@ -197,3 +197,17 @@ mem_put (struct mem_pool *pool, void *ptr)
}
UNLOCK (&pool->lock);
}
+
+
+void
+mem_pool_destroy (struct mem_pool *pool)
+{
+ if (!pool)
+ return;
+
+ LOCK_DESTROY (&pool->lock);
+ FREE (pool->pool);
+ FREE (pool);
+
+ return;
+}