gossipd: use explicit destructor for struct chan.

Each destructor2 costs 40 bytes, and struct chan is only 120 bytes.  So
this drops our memory usage quite a bit:

MCP bench results change:
   -vsz_kb:580004-580016(580006+/-4.8)
   +vsz_kb:533148

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2019-05-21 16:43:28 +09:30
parent 59e75f1b2c
commit d1f43d993a
8 changed files with 57 additions and 16 deletions

View File

@@ -54,6 +54,9 @@ struct chan {
struct amount_sat sat;
};
/* Use this instead of tal_free(chan)! */
void free_chan(struct routing_state *rstate, struct chan *chan);
/* A local channel can exist which isn't announced; normal channels are only
* created once we have both an announcement *and* an update. */
static inline bool is_chan_public(const struct chan *chan)