common/memleak: add dynamic hooks for assisting memleak.

Rather than reaching into data structures, let them register their own
callbacks.  This avoids us having to expose "memleak_remove_xxx"
functions, and call them manually.

Under the hood, this is done by having a specially-named tal child of
the thing we want to assist, containing the callback.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2019-09-06 14:12:05 +09:30
committed by Christian Decker
parent 17541e22a3
commit aca2e4f722
20 changed files with 137 additions and 67 deletions

View File

@@ -17,6 +17,7 @@ DEVTOOLS_COMMON_OBJS := \
common/decode_short_channel_ids.o \
common/features.o \
common/hash_u5.o \
common/memleak.o \
common/node_id.o \
common/per_peer_state.o \
common/json.o \