summaryrefslogtreecommitdiff
path: root/lib/memory_vty.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/memory_vty.c')
-rw-r--r--lib/memory_vty.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/memory_vty.c b/lib/memory_vty.c
index 388273128e..9ee2e52ec7 100644
--- a/lib/memory_vty.c
+++ b/lib/memory_vty.c
@@ -79,12 +79,21 @@ static int qmem_walker(void *arg, struct memgroup *mg, struct memtype *mt)
if (mt->n_alloc != 0) {
char size[32];
snprintf(size, sizeof(size), "%6zu", mt->size);
- vty_out(vty, "%-30s: %10zu %s\n", mt->name,
+
+#ifdef HAVE_MALLOC_USABLE_SIZE
+#define TSTR " %9zu"
+#define TARG , mt->total
+#else
+#define TSTR ""
+#define TARG
+#endif
+ vty_out(vty, "%-30s: %10zu %-16s"TSTR"\n", mt->name,
mt->n_alloc,
mt->size == 0 ? ""
: mt->size == SIZE_VAR
? "(variably sized)"
- : size);
+ : size
+ TARG);
}
}
return 0;