diff options
Diffstat (limited to 'libglusterfs')
-rw-r--r-- | libglusterfs/src/mem-pool.c | 4 | ||||
-rw-r--r-- | libglusterfs/src/statedump.c | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/libglusterfs/src/mem-pool.c b/libglusterfs/src/mem-pool.c index 9533a733959..93a1415a75a 100644 --- a/libglusterfs/src/mem-pool.c +++ b/libglusterfs/src/mem-pool.c @@ -318,6 +318,10 @@ __gf_free (void *free_ptr) { mem_acct->rec[header->type].size -= header->size; mem_acct->rec[header->type].num_allocs--; + /* If all the instances are freed up then ensure typestr is set + * to NULL */ + if (!mem_acct->rec[header->type].num_allocs) + mem_acct->rec[header->type].typestr = NULL; } UNLOCK (&mem_acct->rec[header->type].lock); diff --git a/libglusterfs/src/statedump.c b/libglusterfs/src/statedump.c index d4e7dbb3836..a292857fd10 100644 --- a/libglusterfs/src/statedump.c +++ b/libglusterfs/src/statedump.c @@ -234,7 +234,7 @@ gf_proc_dump_xlator_mem_info (xlator_t *xl) gf_proc_dump_write ("num_types", "%d", xl->mem_acct->num_types); for (i = 0; i < xl->mem_acct->num_types; i++) { - if (xl->mem_acct->rec[i].total_allocs == 0) + if (xl->mem_acct->rec[i].num_allocs == 0) continue; gf_proc_dump_add_section ("%s.%s - usage-type %s memusage", |