summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/iobuf.c
diff options
context:
space:
mode:
authorVijay Bellur <vijay@gluster.com>2010-04-22 13:33:09 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-04-23 06:32:52 -0700
commit582de0677da4be19fc6f873625c58c45d069ab1c (patch)
treef10cb3e26e1f92f6ea91034e6f7bb925790dd9bc /libglusterfs/src/iobuf.c
parent72baa17282f5cf749fa743fd601c7b728ece4fa2 (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/iobuf.c')
-rw-r--r--libglusterfs/src/iobuf.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/libglusterfs/src/iobuf.c b/libglusterfs/src/iobuf.c
index 227b46fe8..e39976945 100644
--- a/libglusterfs/src/iobuf.c
+++ b/libglusterfs/src/iobuf.c
@@ -41,7 +41,8 @@ __iobuf_arena_init_iobufs (struct iobuf_arena *iobuf_arena)
page_size = iobuf_arena->iobuf_pool->page_size;
iobuf_cnt = arena_size / page_size;
- iobuf_arena->iobufs = CALLOC (sizeof (*iobuf), iobuf_cnt);
+ iobuf_arena->iobufs = GF_CALLOC (sizeof (*iobuf), iobuf_cnt,
+ gf_common_mt_iobuf);
if (!iobuf_arena->iobufs)
return;
@@ -87,7 +88,7 @@ __iobuf_arena_destroy_iobufs (struct iobuf_arena *iobuf_arena)
iobuf++;
}
- FREE (iobuf_arena->iobufs);
+ GF_FREE (iobuf_arena->iobufs);
}
@@ -107,7 +108,7 @@ __iobuf_arena_destroy (struct iobuf_arena *iobuf_arena)
&& iobuf_arena->mem_base != MAP_FAILED)
munmap (iobuf_arena->mem_base, iobuf_pool->arena_size);
- FREE (iobuf_arena);
+ GF_FREE (iobuf_arena);
}
@@ -117,7 +118,8 @@ __iobuf_arena_alloc (struct iobuf_pool *iobuf_pool)
struct iobuf_arena *iobuf_arena = NULL;
size_t arena_size = 0;
- iobuf_arena = CALLOC (sizeof (*iobuf_arena), 1);
+ iobuf_arena = GF_CALLOC (sizeof (*iobuf_arena), 1,
+ gf_common_mt_iobuf_arena);
if (!iobuf_arena)
goto err;
@@ -224,7 +226,8 @@ iobuf_pool_new (size_t arena_size, size_t page_size)
if (arena_size < page_size)
return NULL;
- iobuf_pool = CALLOC (sizeof (*iobuf_pool), 1);
+ iobuf_pool = GF_CALLOC (sizeof (*iobuf_pool), 1,
+ gf_common_mt_iobuf_pool);
if (!iobuf_pool)
return NULL;
@@ -463,7 +466,8 @@ iobref_new ()
{
struct iobref *iobref = NULL;
- iobref = CALLOC (sizeof (*iobref), 1);
+ iobref = GF_CALLOC (sizeof (*iobref), 1,
+ gf_common_mt_iobref);
if (!iobref)
return NULL;
@@ -508,7 +512,7 @@ iobref_destroy (struct iobref *iobref)
iobuf_unref (iobuf);
}
- FREE (iobref);
+ GF_FREE (iobref);
}