mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-23 09:04:22 +01:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user