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

Function handle_dev_memleak

openingd/dualopend.c:886–904  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

884 */
885#if DEVELOPER
886static void handle_dev_memleak(struct state *state, const u8 *msg)
887{
888 struct htable *memtable;
889 bool found_leak;
890
891 /* Populate a hash table with all our allocations (except msg, which
892 * is in use right now). */
893 memtable = memleak_start(tmpctx);
894 memleak_ptr(memtable, msg);
895
896 /* Now delete state and things it has pointers to. */
897 memleak_scan_obj(memtable, state);
898
899 /* If there's anything left, dump it to logs, and return true. */
900 found_leak = dump_memleak(memtable, memleak_status_broken);
901 wire_sync_write(REQ_FD,
902 take(towire_dualopend_dev_memleak_reply(NULL,
903 found_leak)));
904}
905#endif /* DEVELOPER */
906
907static u8 *psbt_to_tx_sigs_msg(const tal_t *ctx,

Callers 3

fetch_psbt_changesFunction · 0.70
rbf_wrap_upFunction · 0.70
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