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

Function dump_memleak

common/memleak.c:358–380  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

356}
357
358bool dump_memleak(struct htable *memtable,
359 void PRINTF_FMT(1,2) (*print)(const char *fmt, ...))
360{
361 const tal_t *i;
362 const uintptr_t *backtrace;
363 bool found_leak = false;
364
365 while ((i = memleak_get(memtable, &backtrace)) != NULL) {
366 print("MEMLEAK: %p", i);
367 if (tal_name(i))
368 print(" label=%s", tal_name(i));
369
370 dump_leak_backtrace(backtrace, print);
371 print(" parents:");
372 for (tal_t *p = tal_parent(i); p; p = tal_parent(p)) {
373 print(" %s", tal_name(p));
374 p = tal_parent(p);
375 }
376 found_leak = true;
377 }
378
379 return found_leak;
380}
381#else /* !DEVELOPER */
382void *notleak_(void *ptr, bool plus_children UNNEEDED)
383{

Callers 6

dev_connect_memleakFunction · 0.50
dev_gossip_memleakFunction · 0.50
closing_dev_memleakFunction · 0.50
handle_memleakFunction · 0.50
handle_dev_memleakFunction · 0.50
PRINTF_FMTFunction · 0.50

Calls 4

memleak_getFunction · 0.85
tal_nameFunction · 0.85
dump_leak_backtraceFunction · 0.85
tal_parentFunction · 0.85

Tested by

no test coverage detected