mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 09:54:16 +01:00
memleak: make "_notleak" names less powerful.
They previously prevented any child from being detected as leaks, now they just mark the tal allocation itself as not being a leak. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
7b55d6cfe2
commit
161cc3e840
@ -122,6 +122,9 @@ static void parse_include(const char *filename, bool must_exist, bool early,
|
||||
/* Only valid forms are "foo" and "foo=bar" */
|
||||
all_args[i] = tal_fmt(all_args, "--%s", lines[i]);
|
||||
}
|
||||
/* This isn't a leak either */
|
||||
if (all_args[i])
|
||||
tal_set_name(all_args[i], TAL_LABEL(config_notleak, ""));
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -77,10 +77,6 @@ static void children_into_htable(const void *exclude1, const void *exclude2,
|
||||
if (strends(name, "struct io_plan *[]") && !tal_parent(i))
|
||||
continue;
|
||||
|
||||
/* Other notleak internals. */
|
||||
if (strends(name, "_notleak"))
|
||||
continue;
|
||||
|
||||
/* Don't add tmpctx. */
|
||||
if (streq(name, "tmpctx"))
|
||||
continue;
|
||||
@ -244,6 +240,9 @@ static void call_memleak_helpers(struct htable *memtable, const tal_t *p)
|
||||
else
|
||||
pointer_referenced(memtable, p);
|
||||
memleak_scan_region(memtable, p, tal_bytelen(p));
|
||||
} else if (name && strends(name, "_notleak")) {
|
||||
pointer_referenced(memtable, i);
|
||||
call_memleak_helpers(memtable, i);
|
||||
} else {
|
||||
call_memleak_helpers(memtable, i);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user