mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 23:24:27 +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:
@@ -122,6 +122,9 @@ static void parse_include(const char *filename, bool must_exist, bool early,
|
|||||||
/* Only valid forms are "foo" and "foo=bar" */
|
/* Only valid forms are "foo" and "foo=bar" */
|
||||||
all_args[i] = tal_fmt(all_args, "--%s", lines[i]);
|
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))
|
if (strends(name, "struct io_plan *[]") && !tal_parent(i))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* Other notleak internals. */
|
|
||||||
if (strends(name, "_notleak"))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
/* Don't add tmpctx. */
|
/* Don't add tmpctx. */
|
||||||
if (streq(name, "tmpctx"))
|
if (streq(name, "tmpctx"))
|
||||||
continue;
|
continue;
|
||||||
@@ -244,6 +240,9 @@ static void call_memleak_helpers(struct htable *memtable, const tal_t *p)
|
|||||||
else
|
else
|
||||||
pointer_referenced(memtable, p);
|
pointer_referenced(memtable, p);
|
||||||
memleak_scan_region(memtable, p, tal_bytelen(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 {
|
} else {
|
||||||
call_memleak_helpers(memtable, i);
|
call_memleak_helpers(memtable, i);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user