mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-12-27 09:04:40 +01:00
00bb6f07d7
Instead of doing this weird chaining, just call them all at once and use a reference counter. To make it simpler, we return the subd_req so we can hang a destructor off it which decrements after the request is complete. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
23 lines
579 B
C
23 lines
579 B
C
#ifndef LIGHTNING_LIGHTNINGD_MEMDUMP_H
|
|
#define LIGHTNING_LIGHTNINGD_MEMDUMP_H
|
|
#include "config.h"
|
|
|
|
struct command;
|
|
struct subd;
|
|
struct subd_req;
|
|
|
|
struct leak_detect {
|
|
struct command *cmd;
|
|
size_t num_outstanding_requests;
|
|
const char **leakers;
|
|
};
|
|
|
|
/* Start a leak request: decrements num_outstanding_requests when freed. */
|
|
void start_leak_request(const struct subd_req *req,
|
|
struct leak_detect *leak_detect);
|
|
|
|
/* Yep, found a leak in this subd. */
|
|
void report_subd_memleak(struct leak_detect *leak_detect, struct subd *leaker);
|
|
|
|
#endif /* LIGHTNING_LIGHTNINGD_MEMDUMP_H */
|