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>
Fri, 21 Aug 2009 07:58:17 +0000 (09:58 +0200)
metze

lib/talloc/talloc.c

index 8e91b60c99b9d64d24ca62ae399ac0788b69a8d5..a65a69b4e21942d378a8ccb360a5c2bc0235edb8 100644 (file)
@@ -1211,7 +1211,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));
        }