Browse Source

memleak: explicitly exclude ccan/io allocation.

It's a single, full-lifetime allocation; make sure we only exclude that
one, though this is fragile: tests will break if it moves.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 7 years ago
committed by Christian Decker
parent
commit
19b1b35d31
  1. 14
      common/memleak.c

14
common/memleak.c

@ -47,13 +47,21 @@ static void children_into_htable(const void *exclude,
const tal_t *i;
for (i = tal_first(p); i; i = tal_next(i)) {
const char *name = tal_name(i);
if (p == exclude)
continue;
/* Don't add backtrace objects. */
if (tal_name(i) && streq(tal_name(i), "backtrace"))
continue;
if (name) {
/* Don't add backtrace objects. */
if (streq(name, "backtrace"))
continue;
/* ccan/io allocates pollfd array. */
if (streq(name,
"ccan/ccan/io/poll.c:40:struct pollfd[]"))
continue;
}
htable_add(memtable, hash_ptr(i, NULL), i);
children_into_htable(exclude, memtable, i);
}

Loading…
Cancel
Save