diff options
author | Martin Pool <mbp@samba.org> | 2002-01-03 05:52:27 +0000 |
---|---|---|
committer | Martin Pool <mbp@samba.org> | 2002-01-03 05:52:27 +0000 |
commit | 86abefc17260387b6b68c71ad5587ef0212162c0 (patch) | |
tree | 427097ca3608fadbaf085d426852e0613d7f254f /source/lib/talloc.c | |
parent | 27143900e76033026ecd5a7b4525c0150f3a535d (diff) | |
download | samba-86abefc17260387b6b68c71ad5587ef0212162c0.tar.gz samba-86abefc17260387b6b68c71ad5587ef0212162c0.tar.xz samba-86abefc17260387b6b68c71ad5587ef0212162c0.zip |
Cope nicely with pools with no name.
Diffstat (limited to 'source/lib/talloc.c')
-rw-r--r-- | source/lib/talloc.c | 11 |
1 files changed, 10 insertions, 1 deletions
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; |