MCPcopy Create free account
hub / github.com/ElementsProject/lightning / call_memleak_helpers

Function call_memleak_helpers

common/memleak.c:278–303  ·  view source on GitHub ↗

Handle allocations marked with helpers or notleak() */

Source from the content-addressed store, hash-verified

276
277/* Handle allocations marked with helpers or notleak() */
278static void call_memleak_helpers(struct htable *memtable, const tal_t *p)
279{
280 const tal_t *i;
281
282 for (i = tal_first(p); i; i = tal_next(i)) {
283 const char *name = tal_name(i);
284
285 if (name) {
286 if (strends(name, "struct memleak_helper")) {
287 const struct memleak_helper *mh = i;
288 mh->cb(memtable, p);
289 } else if (strends(name, " **NOTLEAK**")
290 || strends(name, "_notleak")) {
291 memleak_ptr(memtable, i);
292 memleak_scan_obj(memtable, i);
293 } else if (strends(name,
294 " **NOTLEAK_IGNORE_CHILDREN**")) {
295 remove_with_children(memtable, i);
296 memleak_scan_obj(memtable, i);
297 }
298 }
299
300 /* Recurse down looking for "notleak" children */
301 call_memleak_helpers(memtable, i);
302 }
303}
304
305struct htable *memleak_start(const tal_t *ctx)
306{

Callers 1

memleak_startFunction · 0.85

Calls 7

tal_firstFunction · 0.85
tal_nextFunction · 0.85
tal_nameFunction · 0.85
strendsFunction · 0.85
remove_with_childrenFunction · 0.85
memleak_ptrFunction · 0.70
memleak_scan_objFunction · 0.70

Tested by

no test coverage detected