diff options
author | Vijay Bellur <vijay@gluster.com> | 2010-04-22 13:33:09 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2010-04-23 06:32:52 -0700 |
commit | 582de0677da4be19fc6f873625c58c45d069ab1c (patch) | |
tree | f10cb3e26e1f92f6ea91034e6f7bb925790dd9bc /libglusterfs/src/stack.h | |
parent | 72baa17282f5cf749fa743fd601c7b728ece4fa2 (diff) |
Memory accounting changes
Memory accounting Changes. Thanks to Vinayak Hegde and Csaba Henk for their
contributions.
Signed-off-by: Vijay Bellur <vijay@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 329 (Replacing memory allocation functions with mem-type functions)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=329
Diffstat (limited to 'libglusterfs/src/stack.h')
-rw-r--r-- | libglusterfs/src/stack.h | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/libglusterfs/src/stack.h b/libglusterfs/src/stack.h index 25925f7a6..645f633f5 100644 --- a/libglusterfs/src/stack.h +++ b/libglusterfs/src/stack.h @@ -137,9 +137,9 @@ FRAME_DESTROY (call_frame_t *frame) if (frame->prev) frame->prev->next = frame->next; if (frame->local) - FREE (frame->local); + GF_FREE (frame->local); LOCK_DESTROY (&frame->lock); - FREE (frame); + GF_FREE (frame); } @@ -161,7 +161,7 @@ STACK_DESTROY (call_stack_t *stack) UNLOCK (&stack->pool->lock); if (stack->frames.local) - FREE (stack->frames.local); + GF_FREE (stack->frames.local); LOCK_DESTROY (&stack->frames.lock); @@ -172,7 +172,7 @@ STACK_DESTROY (call_stack_t *stack) FRAME_DESTROY (stack->frames.next); } - FREE (stack); + GF_FREE (stack); } @@ -185,7 +185,8 @@ STACK_DESTROY (call_stack_t *stack) call_frame_t *_new = NULL; \ xlator_t *old_THIS = NULL; \ \ - _new = CALLOC (1, sizeof (call_frame_t)); \ + _new = GF_CALLOC (1, sizeof (call_frame_t), \ + gf_common_mt_call_frame_t); \ ERR_ABORT (_new); \ typeof(fn##_cbk) tmp_cbk = rfn; \ _new->root = frame->root; \ @@ -219,7 +220,8 @@ STACK_DESTROY (call_stack_t *stack) call_frame_t *_new = NULL; \ xlator_t *old_THIS = NULL; \ \ - _new = CALLOC (1, sizeof (call_frame_t)); \ + _new = GF_CALLOC (1, sizeof (call_frame_t), \ + gf_common_mt_call_frame_t); \ ERR_ABORT (_new); \ typeof(fn##_cbk) tmp_cbk = rfn; \ _new->root = frame->root; \ @@ -304,7 +306,8 @@ copy_frame (call_frame_t *frame) return NULL; } - newstack = (void *) CALLOC (1, sizeof (*newstack)); + newstack = (void *) GF_CALLOC (1, sizeof (*newstack), + gf_common_mt_call_stack_t); if (newstack == NULL) { return NULL; } @@ -347,7 +350,7 @@ create_frame (xlator_t *xl, call_pool_t *pool) return NULL; } - stack = CALLOC (1, sizeof (*stack)); + stack = GF_CALLOC (1, sizeof (*stack),gf_common_mt_call_stack_t); if (!stack) return NULL; |