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

Function handle_dev_memleak

openingd/openingd.c:1338–1356  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1336}
1337
1338static void handle_dev_memleak(struct state *state, const u8 *msg)
1339{
1340 struct htable *memtable;
1341 bool found_leak;
1342
1343 /* Populate a hash table with all our allocations (except msg, which
1344 * is in use right now). */
1345 memtable = memleak_start(tmpctx);
1346 memleak_ptr(memtable, msg);
1347
1348 /* Now delete state and things it has pointers to. */
1349 memleak_scan_obj(memtable, state);
1350
1351 /* If there's anything left, dump it to logs, and return true. */
1352 found_leak = dump_memleak(memtable, memleak_status_broken, NULL);
1353 wire_sync_write(REQ_FD,
1354 take(towire_openingd_dev_memleak_reply(NULL,
1355 found_leak)));
1356}
1357
1358/* Standard lightningd-fd-is-ready-to-read demux code. Again, we could hang
1359 * here, but if we can't trust our parent, who can we trust? */

Callers 1

handle_master_inFunction · 0.70

Calls 4

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

Tested by

no test coverage detected