From cd567c063ec25b280d3fb5686a69b068c2d6d6df Mon Sep 17 00:00:00 2001 From: shishir gowda Date: Wed, 10 Aug 2011 16:58:38 +0530 Subject: mem-pool: Make mem-pool ptr avialable in ptr The header of the ptr returned from mem-pool will now store the mem-pool ptr it belongs to. mem_put will now take only the pointer to be freed. Also, changing MALLOC call to GF_CALLOC in mem_get when we run out of entries in mem-pool. This also will have the header information saved. Change-Id: I3de182663a7f5b49c9e9425e9531775b70bdff67 BUG: 3390 Reviewed-on: http://review.gluster.com/205 Reviewed-by: Amar Tumballi Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- libglusterfs/src/rbthash.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libglusterfs/src/rbthash.c') diff --git a/libglusterfs/src/rbthash.c b/libglusterfs/src/rbthash.c index c134c3a0012..beda672d0f7 100644 --- a/libglusterfs/src/rbthash.c +++ b/libglusterfs/src/rbthash.c @@ -201,7 +201,7 @@ rbthash_init_entry (rbthash_table_t *tbl, void *data, void *key, int keylen) ret = 0; free_entry: if (ret == -1) { - mem_put (tbl->entrypool, entry); + mem_put (entry); entry = NULL; } @@ -230,7 +230,7 @@ rbthash_deinit_entry (rbthash_table_t *tbl, rbthash_entry_t *entry) } UNLOCK (&tbl->tablelock); - mem_put (tbl->entrypool, entry); + mem_put (entry); } return; @@ -398,7 +398,7 @@ rbthash_remove (rbthash_table_t *tbl, void *key, int keylen) } UNLOCK (&tbl->tablelock); - mem_put (tbl->entrypool, entry); + mem_put (entry); return dataref; } -- cgit