talloc: report the size of reference handles as 0
authorStefan Metzmacher <metze@samba.org>
Mon, 13 Jul 2009 18:32:50 +0000 (20:32 +0200)
committerStefan Metzmacher <metze@samba.org>
Mon, 13 Jul 2009 18:54:29 +0000 (20:54 +0200)
metze

lib/talloc/talloc.c

index a48cc8a44e1e1f70ee7ceae19d604a721bc3757e..a1b158a42cd129674d1d0854ce43a96638853edb 100644 (file)
@@ -1113,7 +1113,9 @@ size_t talloc_total_size(const void *ptr)
 
        tc->flags |= TALLOC_FLAG_LOOP;
 
-       total = tc->size;
+       if (likely(tc->name != TALLOC_MAGIC_REFERENCE)) {
+               total = tc->size;
+       }
        for (c=tc->child;c;c=c->next) {
                total += talloc_total_size(TC_PTR_FROM_CHUNK(c));
        }