summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/mem-pool.c
diff options
context:
space:
mode:
Diffstat (limited to 'libglusterfs/src/mem-pool.c')
-rw-r--r--libglusterfs/src/mem-pool.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libglusterfs/src/mem-pool.c b/libglusterfs/src/mem-pool.c
index 356cfdb78ca..093592ec056 100644
--- a/libglusterfs/src/mem-pool.c
+++ b/libglusterfs/src/mem-pool.c
@@ -24,17 +24,24 @@
#define GLUSTERFS_ENV_MEM_ACCT_STR "GLUSTERFS_DISABLE_MEM_ACCT"
+#include <cmockery/pbc.h>
+#include <cmockery/cmockery_override.h>
+
void
gf_mem_acct_enable_set (void *data)
{
glusterfs_ctx_t *ctx = NULL;
+ REQUIRE(data != NULL);
+
ctx = data;
GF_ASSERT (ctx != NULL);
ctx->mem_acct_enable = 1;
+ ENSURE(1 == ctx->mem_acct_enable);
+
return;
}
@@ -151,6 +158,8 @@ __gf_realloc (void *ptr, size_t size)
if (!THIS->ctx->mem_acct_enable)
return REALLOC (ptr, size);
+ REQUIRE(NULL != ptr);
+
tot_size = size + GF_MEM_HEADER_SIZE + GF_MEM_TRAILER_SIZE;
orig_ptr = (char *)ptr - 8 - 4;