| 1360 | * it has significant overhead. */ |
| 1361 | #if DEVELOPER |
| 1362 | static 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 |
no test coverage detected