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

Function handle_dev_memleak

openingd/openingd.c:1362–1380  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1360 * it has significant overhead. */
1361#if DEVELOPER
1362static void handle_dev_memleak(struct state *state, const u8 *msg)
1363{
1364 struct htable *memtable;
1365 bool found_leak;
1366
1367 /* Populate a hash table with all our allocations (except msg, which
1368 * is in use right now). */
1369 memtable = memleak_start(tmpctx);
1370 memleak_ptr(memtable, msg);
1371
1372 /* Now delete state and things it has pointers to. */
1373 memleak_scan_obj(memtable, state);
1374
1375 /* If there's anything left, dump it to logs, and return true. */
1376 found_leak = dump_memleak(memtable, memleak_status_broken);
1377 wire_sync_write(REQ_FD,
1378 take(towire_openingd_dev_memleak_reply(NULL,
1379 found_leak)));
1380}
1381#endif /* DEVELOPER */
1382
1383/* Standard lightningd-fd-is-ready-to-read demux code. Again, we could hang

Callers 1

handle_master_inFunction · 0.70

Calls 5

memleak_startFunction · 0.50
memleak_ptrFunction · 0.50
memleak_scan_objFunction · 0.50
dump_memleakFunction · 0.50
wire_sync_writeFunction · 0.50

Tested by

no test coverage detected