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 --- libglusterfs/src/gf-dirent.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'libglusterfs/src/gf-dirent.c') diff --git a/libglusterfs/src/gf-dirent.c b/libglusterfs/src/gf-dirent.c index 4a7220d96..e3c1f1b90 100644 --- a/libglusterfs/src/gf-dirent.c +++ b/libglusterfs/src/gf-dirent.c @@ -75,7 +75,8 @@ gf_dirent_for_name (const char *name) gf_dirent_t *gf_dirent = NULL; /* TODO: use mem-pool */ - gf_dirent = CALLOC (gf_dirent_size (name), 1); + gf_dirent = GF_CALLOC (gf_dirent_size (name), 1, + gf_common_mt_gf_dirent_t); if (!gf_dirent) return NULL; @@ -105,7 +106,7 @@ gf_dirent_free (gf_dirent_t *entries) list_for_each_entry_safe (entry, tmp, &entries->list, list) { list_del (&entry->list); - FREE (entry); + GF_FREE (entry); } } @@ -165,7 +166,7 @@ gf_dirent_unserialize (gf_dirent_t *entries, const char *buf, size_t buf_size) } entry_len = sizeof (gf_dirent_t) + entry_strlen + 1; - entry = CALLOC (1, entry_len); + entry = GF_CALLOC (1, entry_len, gf_common_mt_gf_dirent_t); if (!entry) { break; } -- cgit