From 582de0677da4be19fc6f873625c58c45d069ab1c Mon Sep 17 00:00:00 2001 From: Vijay Bellur Date: Thu, 22 Apr 2010 13:33:09 +0000 Subject: Memory accounting changes Memory accounting Changes. Thanks to Vinayak Hegde and Csaba Henk for their contributions. Signed-off-by: Vijay Bellur Signed-off-by: Anand V. Avati BUG: 329 (Replacing memory allocation functions with mem-type functions) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=329 --- xlators/protocol/client/src/saved-frames.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'xlators/protocol/client/src/saved-frames.c') diff --git a/xlators/protocol/client/src/saved-frames.c b/xlators/protocol/client/src/saved-frames.c index cd5349e21f..770de19ad7 100644 --- a/xlators/protocol/client/src/saved-frames.c +++ b/xlators/protocol/client/src/saved-frames.c @@ -22,6 +22,7 @@ #include "common-utils.h" #include "protocol.h" #include "xlator.h" +#include "client-mem-types.h" @@ -30,7 +31,8 @@ saved_frames_new (void) { struct saved_frames *saved_frames = NULL; - saved_frames = CALLOC (sizeof (*saved_frames), 1); + saved_frames = GF_CALLOC (sizeof (*saved_frames), 1, + gf_client_mt_saved_frames); if (!saved_frames) { return NULL; } @@ -76,7 +78,8 @@ saved_frames_put (struct saved_frames *frames, call_frame_t *frame, head_frame = get_head_frame_for_type (frames, type); - saved_frame = CALLOC (sizeof (*saved_frame), 1); + saved_frame = GF_CALLOC (sizeof (*saved_frame), 1, + gf_client_mt_saved_frame); if (!saved_frame) { return -ENOMEM; } @@ -119,7 +122,7 @@ saved_frames_get (struct saved_frames *frames, int32_t op, if (saved_frame) frame = saved_frame->frame; - FREE (saved_frame); + GF_FREE (saved_frame); return frame; } @@ -174,7 +177,7 @@ saved_frames_unwind (xlator_t *this, struct saved_frames *saved_frames, gf_ops[trav->op] (frame, &hdr, sizeof (hdr), NULL); list_del_init (&trav->list); - FREE (trav); + GF_FREE (trav); } } @@ -187,5 +190,5 @@ saved_frames_destroy (xlator_t *this, struct saved_frames *frames, saved_frames_unwind (this, frames, &frames->mops, gf_mops, gf_mop_list); saved_frames_unwind (this, frames, &frames->cbks, gf_cbks, gf_cbk_list); - FREE (frames); + GF_FREE (frames); } -- cgit