From 86abefc17260387b6b68c71ad5587ef0212162c0 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Thu, 3 Jan 2002 05:52:27 +0000 Subject: Cope nicely with pools with no name. --- source/lib/talloc.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'source/lib') diff --git a/source/lib/talloc.c b/source/lib/talloc.c index 01a6e19bb23..bd9080dc342 100644 --- a/source/lib/talloc.c +++ b/source/lib/talloc.c @@ -371,10 +371,19 @@ char *talloc_describe_all(TALLOC_CTX *rt) for (it = list_head; it; it = it->next_ctx) { size_t bytes; int n_chunks; + fstring what; + n_pools++; + talloc_get_allocation(it, &bytes, &n_chunks); + + if (it->name) + fstrcpy(what, it->name); + else + slprintf(what, sizeof what, "@%p", it); + s = talloc_asprintf_append(rt, s, "%-40s %8u %8u\n", - it->name, + what, (unsigned) n_chunks, (unsigned) bytes); total_bytes += bytes; -- cgit