mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 18:11:28 +01:00
ef2a063169
I did a brief audit of tmpctx uses, and we do leak them in various corner cases. Fortunely, all our daemons are based on some kind of I/O loop, so it's fairly easy to clean a global tmpctx at that point. This makes things a bit neater, and slightly more efficient, but also clearer: I avoided creating a tmpctx in a few places because I didn't want to add another allocation. With that penalty removed, I can use it more freely and hopefully write clearer code. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
18 lines
319 B
C
18 lines
319 B
C
#include <ccan/err/err.h>
|
|
#include <ccan/take/take.h>
|
|
#include <common/io_debug.h>
|
|
#include <common/utils.h>
|
|
|
|
int debug_poll(struct pollfd *fds, nfds_t nfds, int timeout)
|
|
{
|
|
const char *t;
|
|
|
|
t = taken_any();
|
|
if (t)
|
|
errx(1, "Outstanding taken pointers: %s", t);
|
|
|
|
clean_tmpctx();
|
|
|
|
return poll(fds, nfds, timeout);
|
|
}
|