diff options
author | Raghavendra G <raghavendra@gluster.com> | 2009-09-30 14:51:28 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-10-06 06:53:07 -0700 |
commit | 86338b253e095f54997d43349959cbabe1612691 (patch) | |
tree | bda8772e99b596d2404b2341accdeaae96b8ab9f /libglusterfs | |
parent | c1fd29003e68268cf81a72b83865f473a21d0d2f (diff) |
mem-pool: add mem_pool_destroy.
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 284 (performance actually decreases for 'ls -l' on a directory containing large number of files with stat-prefetch loaded)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=284
Diffstat (limited to 'libglusterfs')
-rw-r--r-- | libglusterfs/src/mem-pool.c | 13 | ||||
-rw-r--r-- | libglusterfs/src/mem-pool.h | 3 |
2 files changed, 16 insertions, 0 deletions
diff --git a/libglusterfs/src/mem-pool.c b/libglusterfs/src/mem-pool.c index 56a4a1dc29f..cdc275e1c4f 100644 --- a/libglusterfs/src/mem-pool.c +++ b/libglusterfs/src/mem-pool.c @@ -197,3 +197,16 @@ 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; +} diff --git a/libglusterfs/src/mem-pool.h b/libglusterfs/src/mem-pool.h index 627945e1fe6..1b03d495454 100644 --- a/libglusterfs/src/mem-pool.h +++ b/libglusterfs/src/mem-pool.h @@ -51,5 +51,8 @@ mem_pool_new_fn (unsigned long sizeof_type, unsigned long count); void mem_put (struct mem_pool *pool, void *ptr); void *mem_get (struct mem_pool *pool); +void +mem_pool_destroy (struct mem_pool *pool); + #endif /* _MEM_POOL_H */ |