diff --git a/common/memleak.c b/common/memleak.c index 74de106dd..c436cdc7d 100644 --- a/common/memleak.c +++ b/common/memleak.c @@ -25,31 +25,37 @@ #include #include #include +#include #include +#include struct backtrace_state *backtrace_state; #if DEVELOPER static bool memleak_track; -struct memleak_notleak { - bool plus_children; -}; - struct memleak_helper { void (*cb)(struct htable *memtable, const tal_t *); }; -void *notleak_(const void *ptr, bool plus_children) +void *notleak_(void *ptr, bool plus_children) { - struct memleak_notleak *notleak; - + const char *name; /* If we're not tracking, don't do anything. */ if (!memleak_track) return cast_const(void *, ptr); - notleak = tal(ptr, struct memleak_notleak); - notleak->plus_children = plus_children; + /* We use special tal names to mark notleak */ + name = tal_name(ptr); + if (!name) + name = ""; + if (plus_children) + name = tal_fmt(tmpctx, "%s **NOTLEAK_IGNORE_CHILDREN**", + name); + else + name = tal_fmt(tmpctx, "%s **NOTLEAK**", name); + tal_set_name(ptr, name); + return cast_const(void *, ptr); } @@ -80,9 +86,8 @@ static void children_into_htable(const void *exclude1, const void *exclude2, if (streq(name, "backtrace")) continue; - /* Don't add our own memleak_helpers or notleak() */ - if (strends(name, "struct memleak_helper") - || strends(name, "struct memleak_notleak")) + /* Don't add our own memleak_helpers */ + if (strends(name, "struct memleak_helper")) continue; /* Don't add tal_link objects */ @@ -101,7 +106,6 @@ static void children_into_htable(const void *exclude1, const void *exclude2, if (streq(name, "tmpctx")) continue; } - htable_add(memtable, hash_ptr(i, NULL), i); children_into_htable(exclude1, exclude2, memtable, i); } } @@ -265,12 +269,11 @@ static void call_memleak_helpers(struct htable *memtable, const tal_t *p) if (name && strends(name, "struct memleak_helper")) { const struct memleak_helper *mh = i; mh->cb(memtable, p); - } else if (name && strends(name, "struct memleak_notleak")) { - const struct memleak_notleak *notleak = i; - if (notleak->plus_children) - remove_with_children(memtable, p); - else - pointer_referenced(memtable, p); + } else if (name && strends(name, " **NOTLEAK**")) { + pointer_referenced(memtable, p); + memleak_remove_region(memtable, p, tal_bytelen(p)); + } else if (name && strends(name, " **NOTLEAK_IGNORE_CHILDREN**")) { + remove_with_children(memtable, p); memleak_remove_region(memtable, p, tal_bytelen(p)); } else if (name && strends(name, "_notleak")) { pointer_referenced(memtable, i); @@ -360,8 +363,8 @@ bool dump_memleak(struct htable *memtable, return found_leak; } #else /* !DEVELOPER */ -void *notleak_(const void *ptr, bool plus_children UNNEEDED) +void *notleak_(void *ptr, bool plus_children UNNEEDED) { - return cast_const(void *, ptr); + return ptr; } #endif /* !DEVELOPER */ diff --git a/common/memleak.h b/common/memleak.h index 3460988cf..aa72ba581 100644 --- a/common/memleak.h +++ b/common/memleak.h @@ -35,7 +35,7 @@ void memleak_init(void); #define memleak_typeof(var) void * #endif /* !HAVE_TYPEOF */ -void *notleak_(const void *ptr, bool plus_children); +void *notleak_(void *ptr, bool plus_children); #if DEVELOPER /** diff --git a/common/test/run-bolt12_merkle-json.c b/common/test/run-bolt12_merkle-json.c index 1fb1b9916..eb62379cb 100644 --- a/common/test/run-bolt12_merkle-json.c +++ b/common/test/run-bolt12_merkle-json.c @@ -22,9 +22,6 @@ void fromwire_channel_id(const u8 **cursor UNNEEDED, size_t *max UNNEEDED, struct channel_id *channel_id UNNEEDED) { fprintf(stderr, "fromwire_channel_id called!\n"); abort(); } -/* Generated stub for fromwire_channel_type */ -struct channel_type *fromwire_channel_type(const tal_t *ctx UNNEEDED, const u8 **cursor UNNEEDED, size_t *plen UNNEEDED) -{ fprintf(stderr, "fromwire_channel_type called!\n"); abort(); } /* Generated stub for fromwire_node_id */ void fromwire_node_id(const u8 **cursor UNNEEDED, size_t *max UNNEEDED, struct node_id *id UNNEEDED) { fprintf(stderr, "fromwire_node_id called!\n"); abort(); } @@ -50,9 +47,6 @@ void towire_bool(u8 **pptr UNNEEDED, bool v UNNEEDED) /* Generated stub for towire_channel_id */ void towire_channel_id(u8 **pptr UNNEEDED, const struct channel_id *channel_id UNNEEDED) { fprintf(stderr, "towire_channel_id called!\n"); abort(); } -/* Generated stub for towire_channel_type */ -void towire_channel_type(u8 **p UNNEEDED, const struct channel_type *channel_type UNNEEDED) -{ fprintf(stderr, "towire_channel_type called!\n"); abort(); } /* Generated stub for towire_node_id */ void towire_node_id(u8 **pptr UNNEEDED, const struct node_id *id UNNEEDED) { fprintf(stderr, "towire_node_id called!\n"); abort(); } diff --git a/common/test/run-bolt12_merkle.c b/common/test/run-bolt12_merkle.c index f40336190..4799255fc 100644 --- a/common/test/run-bolt12_merkle.c +++ b/common/test/run-bolt12_merkle.c @@ -24,18 +24,12 @@ int features_unsupported(const struct feature_set *our_features UNNEEDED, void fromwire_channel_id(const u8 **cursor UNNEEDED, size_t *max UNNEEDED, struct channel_id *channel_id UNNEEDED) { fprintf(stderr, "fromwire_channel_id called!\n"); abort(); } -/* Generated stub for fromwire_channel_type */ -struct channel_type *fromwire_channel_type(const tal_t *ctx UNNEEDED, const u8 **cursor UNNEEDED, size_t *plen UNNEEDED) -{ fprintf(stderr, "fromwire_channel_type called!\n"); abort(); } /* Generated stub for fromwire_onionmsg_path */ struct onionmsg_path *fromwire_onionmsg_path(const tal_t *ctx UNNEEDED, const u8 **cursor UNNEEDED, size_t *plen UNNEEDED) { fprintf(stderr, "fromwire_onionmsg_path called!\n"); abort(); } /* Generated stub for towire_channel_id */ void towire_channel_id(u8 **pptr UNNEEDED, const struct channel_id *channel_id UNNEEDED) { fprintf(stderr, "towire_channel_id called!\n"); abort(); } -/* Generated stub for towire_channel_type */ -void towire_channel_type(u8 **p UNNEEDED, const struct channel_type *channel_type UNNEEDED) -{ fprintf(stderr, "towire_channel_type called!\n"); abort(); } /* Generated stub for towire_onionmsg_path */ void towire_onionmsg_path(u8 **p UNNEEDED, const struct onionmsg_path *onionmsg_path UNNEEDED) { fprintf(stderr, "towire_onionmsg_path called!\n"); abort(); } diff --git a/common/test/run-gossmap_local.c b/common/test/run-gossmap_local.c index 4dcedc6b0..e2a198f54 100644 --- a/common/test/run-gossmap_local.c +++ b/common/test/run-gossmap_local.c @@ -17,18 +17,12 @@ bigsize_t fromwire_bigsize(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) void fromwire_channel_id(const u8 **cursor UNNEEDED, size_t *max UNNEEDED, struct channel_id *channel_id UNNEEDED) { fprintf(stderr, "fromwire_channel_id called!\n"); abort(); } -/* Generated stub for fromwire_channel_type */ -struct channel_type *fromwire_channel_type(const tal_t *ctx UNNEEDED, const u8 **cursor UNNEEDED, size_t *plen UNNEEDED) -{ fprintf(stderr, "fromwire_channel_type called!\n"); abort(); } /* Generated stub for towire_bigsize */ void towire_bigsize(u8 **pptr UNNEEDED, const bigsize_t val UNNEEDED) { fprintf(stderr, "towire_bigsize called!\n"); abort(); } /* Generated stub for towire_channel_id */ void towire_channel_id(u8 **pptr UNNEEDED, const struct channel_id *channel_id UNNEEDED) { fprintf(stderr, "towire_channel_id called!\n"); abort(); } -/* Generated stub for towire_channel_type */ -void towire_channel_type(u8 **p UNNEEDED, const struct channel_type *channel_type UNNEEDED) -{ fprintf(stderr, "towire_channel_type called!\n"); abort(); } /* Generated stub for type_to_string_ */ const char *type_to_string_(const tal_t *ctx UNNEEDED, const char *typename UNNEEDED, union printable_types u UNNEEDED) diff --git a/common/test/run-json.c b/common/test/run-json.c index 3434b5a02..c1e51ba2f 100644 --- a/common/test/run-json.c +++ b/common/test/run-json.c @@ -7,9 +7,6 @@ #include /* AUTOGENERATED MOCKS START */ -/* Generated stub for fromwire_channel_type */ -struct channel_type *fromwire_channel_type(const tal_t *ctx UNNEEDED, const u8 **cursor UNNEEDED, size_t *plen UNNEEDED) -{ fprintf(stderr, "fromwire_channel_type called!\n"); abort(); } /* Generated stub for fromwire_tlv */ bool fromwire_tlv(const u8 **cursor UNNEEDED, size_t *max UNNEEDED, const struct tlv_record_type *types UNNEEDED, size_t num_types UNNEEDED, @@ -19,9 +16,6 @@ bool fromwire_tlv(const u8 **cursor UNNEEDED, size_t *max UNNEEDED, bool tlv_fields_valid(const struct tlv_field *fields UNNEEDED, u64 *allow_extra UNNEEDED, size_t *err_index UNNEEDED) { fprintf(stderr, "tlv_fields_valid called!\n"); abort(); } -/* Generated stub for towire_channel_type */ -void towire_channel_type(u8 **p UNNEEDED, const struct channel_type *channel_type UNNEEDED) -{ fprintf(stderr, "towire_channel_type called!\n"); abort(); } /* Generated stub for towire_tlv */ void towire_tlv(u8 **pptr UNNEEDED, const struct tlv_record_type *types UNNEEDED, size_t num_types UNNEEDED, diff --git a/common/test/run-param.c b/common/test/run-param.c index b74a5a86c..71bdd277d 100644 --- a/common/test/run-param.c +++ b/common/test/run-param.c @@ -34,9 +34,6 @@ struct command_result *command_fail(struct command *cmd, } /* AUTOGENERATED MOCKS START */ -/* Generated stub for fromwire_channel_type */ -struct channel_type *fromwire_channel_type(const tal_t *ctx UNNEEDED, const u8 **cursor UNNEEDED, size_t *plen UNNEEDED) -{ fprintf(stderr, "fromwire_channel_type called!\n"); abort(); } /* Generated stub for fromwire_tlv */ bool fromwire_tlv(const u8 **cursor UNNEEDED, size_t *max UNNEEDED, const struct tlv_record_type *types UNNEEDED, size_t num_types UNNEEDED, @@ -83,9 +80,6 @@ int segwit_addr_decode( bool tlv_fields_valid(const struct tlv_field *fields UNNEEDED, u64 *allow_extra UNNEEDED, size_t *err_index UNNEEDED) { fprintf(stderr, "tlv_fields_valid called!\n"); abort(); } -/* Generated stub for towire_channel_type */ -void towire_channel_type(u8 **p UNNEEDED, const struct channel_type *channel_type UNNEEDED) -{ fprintf(stderr, "towire_channel_type called!\n"); abort(); } /* Generated stub for towire_tlv */ void towire_tlv(u8 **pptr UNNEEDED, const struct tlv_record_type *types UNNEEDED, size_t num_types UNNEEDED, diff --git a/common/test/run-route-specific.c b/common/test/run-route-specific.c index b0e80ba30..4451e51ae 100644 --- a/common/test/run-route-specific.c +++ b/common/test/run-route-specific.c @@ -26,9 +26,6 @@ bigsize_t fromwire_bigsize(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) void fromwire_channel_id(const u8 **cursor UNNEEDED, size_t *max UNNEEDED, struct channel_id *channel_id UNNEEDED) { fprintf(stderr, "fromwire_channel_id called!\n"); abort(); } -/* Generated stub for fromwire_channel_type */ -struct channel_type *fromwire_channel_type(const tal_t *ctx UNNEEDED, const u8 **cursor UNNEEDED, size_t *plen UNNEEDED) -{ fprintf(stderr, "fromwire_channel_type called!\n"); abort(); } /* Generated stub for fromwire_tlv */ bool fromwire_tlv(const u8 **cursor UNNEEDED, size_t *max UNNEEDED, const struct tlv_record_type *types UNNEEDED, size_t num_types UNNEEDED, @@ -44,9 +41,6 @@ void towire_bigsize(u8 **pptr UNNEEDED, const bigsize_t val UNNEEDED) /* Generated stub for towire_channel_id */ void towire_channel_id(u8 **pptr UNNEEDED, const struct channel_id *channel_id UNNEEDED) { fprintf(stderr, "towire_channel_id called!\n"); abort(); } -/* Generated stub for towire_channel_type */ -void towire_channel_type(u8 **p UNNEEDED, const struct channel_type *channel_type UNNEEDED) -{ fprintf(stderr, "towire_channel_type called!\n"); abort(); } /* Generated stub for towire_tlv */ void towire_tlv(u8 **pptr UNNEEDED, const struct tlv_record_type *types UNNEEDED, size_t num_types UNNEEDED, diff --git a/common/test/run-route.c b/common/test/run-route.c index 53dd81a93..07dd66e3d 100644 --- a/common/test/run-route.c +++ b/common/test/run-route.c @@ -19,9 +19,6 @@ bigsize_t fromwire_bigsize(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) void fromwire_channel_id(const u8 **cursor UNNEEDED, size_t *max UNNEEDED, struct channel_id *channel_id UNNEEDED) { fprintf(stderr, "fromwire_channel_id called!\n"); abort(); } -/* Generated stub for fromwire_channel_type */ -struct channel_type *fromwire_channel_type(const tal_t *ctx UNNEEDED, const u8 **cursor UNNEEDED, size_t *plen UNNEEDED) -{ fprintf(stderr, "fromwire_channel_type called!\n"); abort(); } /* Generated stub for fromwire_tlv */ bool fromwire_tlv(const u8 **cursor UNNEEDED, size_t *max UNNEEDED, const struct tlv_record_type *types UNNEEDED, size_t num_types UNNEEDED, @@ -37,9 +34,6 @@ void towire_bigsize(u8 **pptr UNNEEDED, const bigsize_t val UNNEEDED) /* Generated stub for towire_channel_id */ void towire_channel_id(u8 **pptr UNNEEDED, const struct channel_id *channel_id UNNEEDED) { fprintf(stderr, "towire_channel_id called!\n"); abort(); } -/* Generated stub for towire_channel_type */ -void towire_channel_type(u8 **p UNNEEDED, const struct channel_type *channel_type UNNEEDED) -{ fprintf(stderr, "towire_channel_type called!\n"); abort(); } /* Generated stub for towire_tlv */ void towire_tlv(u8 **pptr UNNEEDED, const struct tlv_record_type *types UNNEEDED, size_t num_types UNNEEDED, diff --git a/connectd/test/run-initiator-success.c b/connectd/test/run-initiator-success.c index 926fa7c8a..627e0e241 100644 --- a/connectd/test/run-initiator-success.c +++ b/connectd/test/run-initiator-success.c @@ -83,9 +83,6 @@ u8 fromwire_u8(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) /* Generated stub for fromwire_u8_array */ void fromwire_u8_array(const u8 **cursor UNNEEDED, size_t *max UNNEEDED, u8 *arr UNNEEDED, size_t num UNNEEDED) { fprintf(stderr, "fromwire_u8_array called!\n"); abort(); } -/* Generated stub for notleak_ */ -void *notleak_(const void *ptr UNNEEDED, bool plus_children UNNEEDED) -{ fprintf(stderr, "notleak_ called!\n"); abort(); } /* Generated stub for towire */ void towire(u8 **pptr UNNEEDED, const void *data UNNEEDED, size_t len UNNEEDED) { fprintf(stderr, "towire called!\n"); abort(); } diff --git a/connectd/test/run-responder-success.c b/connectd/test/run-responder-success.c index 0a24a1009..a531f19ca 100644 --- a/connectd/test/run-responder-success.c +++ b/connectd/test/run-responder-success.c @@ -83,9 +83,6 @@ u8 fromwire_u8(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) /* Generated stub for fromwire_u8_array */ void fromwire_u8_array(const u8 **cursor UNNEEDED, size_t *max UNNEEDED, u8 *arr UNNEEDED, size_t num UNNEEDED) { fprintf(stderr, "fromwire_u8_array called!\n"); abort(); } -/* Generated stub for notleak_ */ -void *notleak_(const void *ptr UNNEEDED, bool plus_children UNNEEDED) -{ fprintf(stderr, "notleak_ called!\n"); abort(); } /* Generated stub for towire */ void towire(u8 **pptr UNNEEDED, const void *data UNNEEDED, size_t len UNNEEDED) { fprintf(stderr, "towire called!\n"); abort(); } diff --git a/gossipd/test/run-check_channel_announcement.c b/gossipd/test/run-check_channel_announcement.c index 58e489332..20ef9b419 100644 --- a/gossipd/test/run-check_channel_announcement.c +++ b/gossipd/test/run-check_channel_announcement.c @@ -43,9 +43,6 @@ bool cupdate_different(struct gossip_store *gs UNNEEDED, /* Generated stub for fmt_wireaddr_without_port */ char *fmt_wireaddr_without_port(const tal_t *ctx UNNEEDED, const struct wireaddr *a UNNEEDED) { fprintf(stderr, "fmt_wireaddr_without_port called!\n"); abort(); } -/* Generated stub for fromwire_channel_type */ -struct channel_type *fromwire_channel_type(const tal_t *ctx UNNEEDED, const u8 **cursor UNNEEDED, size_t *plen UNNEEDED) -{ fprintf(stderr, "fromwire_channel_type called!\n"); abort(); } /* Generated stub for fromwire_wireaddr_array */ struct wireaddr *fromwire_wireaddr_array(const tal_t *ctx UNNEEDED, const u8 *ser UNNEEDED) { fprintf(stderr, "fromwire_wireaddr_array called!\n"); abort(); } @@ -117,7 +114,7 @@ struct oneshot *new_reltimer_(struct timers *timers UNNEEDED, void (*cb)(void *) UNNEEDED, void *arg UNNEEDED) { fprintf(stderr, "new_reltimer_ called!\n"); abort(); } /* Generated stub for notleak_ */ -void *notleak_(const void *ptr UNNEEDED, bool plus_children UNNEEDED) +void *notleak_(void *ptr UNNEEDED, bool plus_children UNNEEDED) { fprintf(stderr, "notleak_ called!\n"); abort(); } /* Generated stub for peer_supplied_good_gossip */ void peer_supplied_good_gossip(struct peer *peer UNNEEDED, size_t amount UNNEEDED) @@ -128,9 +125,6 @@ void status_fmt(enum log_level level UNNEEDED, const char *fmt UNNEEDED, ...) { fprintf(stderr, "status_fmt called!\n"); abort(); } -/* Generated stub for towire_channel_type */ -void towire_channel_type(u8 **p UNNEEDED, const struct channel_type *channel_type UNNEEDED) -{ fprintf(stderr, "towire_channel_type called!\n"); abort(); } /* AUTOGENERATED MOCKS END */ int main(int argc, char *argv[]) diff --git a/gossipd/test/run-check_node_announcement.c b/gossipd/test/run-check_node_announcement.c index c4a9818ec..3c637a685 100644 --- a/gossipd/test/run-check_node_announcement.c +++ b/gossipd/test/run-check_node_announcement.c @@ -11,9 +11,6 @@ struct peer *find_peer(struct daemon *daemon UNNEEDED, const struct node_id *id /* Generated stub for fmt_wireaddr_without_port */ char *fmt_wireaddr_without_port(const tal_t *ctx UNNEEDED, const struct wireaddr *a UNNEEDED) { fprintf(stderr, "fmt_wireaddr_without_port called!\n"); abort(); } -/* Generated stub for fromwire_channel_type */ -struct channel_type *fromwire_channel_type(const tal_t *ctx UNNEEDED, const u8 **cursor UNNEEDED, size_t *plen UNNEEDED) -{ fprintf(stderr, "fromwire_channel_type called!\n"); abort(); } /* Generated stub for fromwire_gossipd_local_channel_update */ bool fromwire_gossipd_local_channel_update(const void *p UNNEEDED, struct short_channel_id *short_channel_id UNNEEDED, bool *disable UNNEEDED, u16 *cltv_expiry_delta UNNEEDED, struct amount_msat *htlc_minimum_msat UNNEEDED, u32 *fee_base_msat UNNEEDED, u32 *fee_proportional_millionths UNNEEDED, struct amount_msat *htlc_maximum_msat UNNEEDED) { fprintf(stderr, "fromwire_gossipd_local_channel_update called!\n"); abort(); } @@ -63,7 +60,7 @@ struct oneshot *new_reltimer_(struct timers *timers UNNEEDED, void (*cb)(void *) UNNEEDED, void *arg UNNEEDED) { fprintf(stderr, "new_reltimer_ called!\n"); abort(); } /* Generated stub for notleak_ */ -void *notleak_(const void *ptr UNNEEDED, bool plus_children UNNEEDED) +void *notleak_(void *ptr UNNEEDED, bool plus_children UNNEEDED) { fprintf(stderr, "notleak_ called!\n"); abort(); } /* Generated stub for queue_peer_msg */ void queue_peer_msg(struct peer *peer UNNEEDED, const u8 *msg TAKES UNNEEDED) @@ -81,9 +78,6 @@ void status_fmt(enum log_level level UNNEEDED, const char *fmt UNNEEDED, ...) { fprintf(stderr, "status_fmt called!\n"); abort(); } -/* Generated stub for towire_channel_type */ -void towire_channel_type(u8 **p UNNEEDED, const struct channel_type *channel_type UNNEEDED) -{ fprintf(stderr, "towire_channel_type called!\n"); abort(); } /* Generated stub for towire_hsmd_cupdate_sig_req */ u8 *towire_hsmd_cupdate_sig_req(const tal_t *ctx UNNEEDED, const u8 *cu UNNEEDED) { fprintf(stderr, "towire_hsmd_cupdate_sig_req called!\n"); abort(); } diff --git a/gossipd/test/run-crc32_of_update.c b/gossipd/test/run-crc32_of_update.c index 2d59a9ca0..1dbf50df0 100644 --- a/gossipd/test/run-crc32_of_update.c +++ b/gossipd/test/run-crc32_of_update.c @@ -33,9 +33,6 @@ struct peer *find_peer(struct daemon *daemon UNNEEDED, const struct node_id *id /* Generated stub for fmt_wireaddr_without_port */ char *fmt_wireaddr_without_port(const tal_t *ctx UNNEEDED, const struct wireaddr *a UNNEEDED) { fprintf(stderr, "fmt_wireaddr_without_port called!\n"); abort(); } -/* Generated stub for fromwire_channel_type */ -struct channel_type *fromwire_channel_type(const tal_t *ctx UNNEEDED, const u8 **cursor UNNEEDED, size_t *plen UNNEEDED) -{ fprintf(stderr, "fromwire_channel_type called!\n"); abort(); } /* Generated stub for fromwire_gossipd_dev_set_max_scids_encode_size */ bool fromwire_gossipd_dev_set_max_scids_encode_size(const void *p UNNEEDED, u32 *max UNNEEDED) { fprintf(stderr, "fromwire_gossipd_dev_set_max_scids_encode_size called!\n"); abort(); } @@ -96,7 +93,7 @@ struct oneshot *new_reltimer_(struct timers *timers UNNEEDED, void (*cb)(void *) UNNEEDED, void *arg UNNEEDED) { fprintf(stderr, "new_reltimer_ called!\n"); abort(); } /* Generated stub for notleak_ */ -void *notleak_(const void *ptr UNNEEDED, bool plus_children UNNEEDED) +void *notleak_(void *ptr UNNEEDED, bool plus_children UNNEEDED) { fprintf(stderr, "notleak_ called!\n"); abort(); } /* Generated stub for peer_supplied_good_gossip */ void peer_supplied_good_gossip(struct peer *peer UNNEEDED, size_t amount UNNEEDED) @@ -121,9 +118,6 @@ void status_fmt(enum log_level level UNNEEDED, const char *fmt UNNEEDED, ...) { fprintf(stderr, "status_fmt called!\n"); abort(); } -/* Generated stub for towire_channel_type */ -void towire_channel_type(u8 **p UNNEEDED, const struct channel_type *channel_type UNNEEDED) -{ fprintf(stderr, "towire_channel_type called!\n"); abort(); } /* Generated stub for towire_hsmd_cupdate_sig_req */ u8 *towire_hsmd_cupdate_sig_req(const tal_t *ctx UNNEEDED, const u8 *cu UNNEEDED) { fprintf(stderr, "towire_hsmd_cupdate_sig_req called!\n"); abort(); } diff --git a/gossipd/test/run-extended-info.c b/gossipd/test/run-extended-info.c index 276caf655..935dca7c3 100644 --- a/gossipd/test/run-extended-info.c +++ b/gossipd/test/run-extended-info.c @@ -36,9 +36,6 @@ struct short_channel_id *decode_short_ids(const tal_t *ctx UNNEEDED, const u8 *e /* Generated stub for fmt_wireaddr_without_port */ char *fmt_wireaddr_without_port(const tal_t *ctx UNNEEDED, const struct wireaddr *a UNNEEDED) { fprintf(stderr, "fmt_wireaddr_without_port called!\n"); abort(); } -/* Generated stub for fromwire_channel_type */ -struct channel_type *fromwire_channel_type(const tal_t *ctx UNNEEDED, const u8 **cursor UNNEEDED, size_t *plen UNNEEDED) -{ fprintf(stderr, "fromwire_channel_type called!\n"); abort(); } /* Generated stub for fromwire_gossipd_dev_set_max_scids_encode_size */ bool fromwire_gossipd_dev_set_max_scids_encode_size(const void *p UNNEEDED, u32 *max UNNEEDED) { fprintf(stderr, "fromwire_gossipd_dev_set_max_scids_encode_size called!\n"); abort(); } @@ -85,9 +82,6 @@ void queue_peer_from_store(struct peer *peer UNNEEDED, /* Generated stub for queue_peer_msg */ void queue_peer_msg(struct peer *peer UNNEEDED, const u8 *msg TAKES UNNEEDED) { fprintf(stderr, "queue_peer_msg called!\n"); abort(); } -/* Generated stub for towire_channel_type */ -void towire_channel_type(u8 **p UNNEEDED, const struct channel_type *channel_type UNNEEDED) -{ fprintf(stderr, "towire_channel_type called!\n"); abort(); } /* Generated stub for towire_warningfmt */ u8 *towire_warningfmt(const tal_t *ctx UNNEEDED, const struct channel_id *channel UNNEEDED, diff --git a/gossipd/test/run-next_block_range.c b/gossipd/test/run-next_block_range.c index c57081c1f..aad6a3969 100644 --- a/gossipd/test/run-next_block_range.c +++ b/gossipd/test/run-next_block_range.c @@ -10,9 +10,6 @@ /* Generated stub for fmt_wireaddr_without_port */ char *fmt_wireaddr_without_port(const tal_t *ctx UNNEEDED, const struct wireaddr *a UNNEEDED) { fprintf(stderr, "fmt_wireaddr_without_port called!\n"); abort(); } -/* Generated stub for fromwire_channel_type */ -struct channel_type *fromwire_channel_type(const tal_t *ctx UNNEEDED, const u8 **cursor UNNEEDED, size_t *plen UNNEEDED) -{ fprintf(stderr, "fromwire_channel_type called!\n"); abort(); } /* Generated stub for json_add_member */ void json_add_member(struct json_stream *js UNNEEDED, const char *fieldname UNNEEDED, @@ -71,9 +68,6 @@ void status_fmt(enum log_level level UNNEEDED, const char *fmt UNNEEDED, ...) { fprintf(stderr, "status_fmt called!\n"); abort(); } -/* Generated stub for towire_channel_type */ -void towire_channel_type(u8 **p UNNEEDED, const struct channel_type *channel_type UNNEEDED) -{ fprintf(stderr, "towire_channel_type called!\n"); abort(); } /* Generated stub for would_ratelimit_cupdate */ bool would_ratelimit_cupdate(struct routing_state *rstate UNNEEDED, const struct half_chan *hc UNNEEDED, diff --git a/gossipd/test/run-txout_failure.c b/gossipd/test/run-txout_failure.c index a196f90f8..e07e6d461 100644 --- a/gossipd/test/run-txout_failure.c +++ b/gossipd/test/run-txout_failure.c @@ -14,9 +14,6 @@ bool cupdate_different(struct gossip_store *gs UNNEEDED, /* Generated stub for fmt_wireaddr_without_port */ char *fmt_wireaddr_without_port(const tal_t *ctx UNNEEDED, const struct wireaddr *a UNNEEDED) { fprintf(stderr, "fmt_wireaddr_without_port called!\n"); abort(); } -/* Generated stub for fromwire_channel_type */ -struct channel_type *fromwire_channel_type(const tal_t *ctx UNNEEDED, const u8 **cursor UNNEEDED, size_t *plen UNNEEDED) -{ fprintf(stderr, "fromwire_channel_type called!\n"); abort(); } /* Generated stub for fromwire_wireaddr_array */ struct wireaddr *fromwire_wireaddr_array(const tal_t *ctx UNNEEDED, const u8 *ser UNNEEDED) { fprintf(stderr, "fromwire_wireaddr_array called!\n"); abort(); } @@ -78,7 +75,7 @@ bool nannounce_different(struct gossip_store *gs UNNEEDED, bool *only_missing_tlv UNNEEDED) { fprintf(stderr, "nannounce_different called!\n"); abort(); } /* Generated stub for notleak_ */ -void *notleak_(const void *ptr UNNEEDED, bool plus_children UNNEEDED) +void *notleak_(void *ptr UNNEEDED, bool plus_children UNNEEDED) { fprintf(stderr, "notleak_ called!\n"); abort(); } /* Generated stub for peer_supplied_good_gossip */ void peer_supplied_good_gossip(struct peer *peer UNNEEDED, size_t amount UNNEEDED) @@ -93,9 +90,6 @@ void status_fmt(enum log_level level UNNEEDED, const char *fmt UNNEEDED, ...) { fprintf(stderr, "status_fmt called!\n"); abort(); } -/* Generated stub for towire_channel_type */ -void towire_channel_type(u8 **p UNNEEDED, const struct channel_type *channel_type UNNEEDED) -{ fprintf(stderr, "towire_channel_type called!\n"); abort(); } /* Generated stub for towire_warningfmt */ u8 *towire_warningfmt(const tal_t *ctx UNNEEDED, const struct channel_id *channel UNNEEDED, diff --git a/lightningd/lightningd.h b/lightningd/lightningd.h index 772de8392..8fabc6150 100644 --- a/lightningd/lightningd.h +++ b/lightningd/lightningd.h @@ -226,9 +226,6 @@ struct lightningd { bool dev_fast_gossip; bool dev_fast_gossip_prune; - /* Things we've marked as not leaking. */ - const void **notleaks; - /* This is the forced private key for the node. */ struct privkey *dev_force_privkey; diff --git a/onchaind/test/run-grind_feerate-bug.c b/onchaind/test/run-grind_feerate-bug.c index 1798dc456..87268cbba 100644 --- a/onchaind/test/run-grind_feerate-bug.c +++ b/onchaind/test/run-grind_feerate-bug.c @@ -170,7 +170,7 @@ struct chain_coin_mvt *new_coin_withdrawal_sat(const tal_t *ctx UNNEEDED, struct amount_sat amount UNNEEDED) { fprintf(stderr, "new_coin_withdrawal_sat called!\n"); abort(); } /* Generated stub for notleak_ */ -void *notleak_(const void *ptr UNNEEDED, bool plus_children UNNEEDED) +void *notleak_(void *ptr UNNEEDED, bool plus_children UNNEEDED) { fprintf(stderr, "notleak_ called!\n"); abort(); } /* Generated stub for onchaind_wire_name */ const char *onchaind_wire_name(int e UNNEEDED) diff --git a/onchaind/test/run-grind_feerate.c b/onchaind/test/run-grind_feerate.c index 5f5f8495a..d15c6afc9 100644 --- a/onchaind/test/run-grind_feerate.c +++ b/onchaind/test/run-grind_feerate.c @@ -193,7 +193,7 @@ struct chain_coin_mvt *new_coin_withdrawal_sat(const tal_t *ctx UNNEEDED, struct amount_sat amount UNNEEDED) { fprintf(stderr, "new_coin_withdrawal_sat called!\n"); abort(); } /* Generated stub for notleak_ */ -void *notleak_(const void *ptr UNNEEDED, bool plus_children UNNEEDED) +void *notleak_(void *ptr UNNEEDED, bool plus_children UNNEEDED) { fprintf(stderr, "notleak_ called!\n"); abort(); } /* Generated stub for peer_billboard */ void peer_billboard(bool perm UNNEEDED, const char *fmt UNNEEDED, ...) diff --git a/plugins/test/run-route-overlong.c b/plugins/test/run-route-overlong.c index 3b4159ce2..c4abb47e5 100644 --- a/plugins/test/run-route-overlong.c +++ b/plugins/test/run-route-overlong.c @@ -193,7 +193,7 @@ struct json_stream *jsonrpc_stream_fail(struct command *cmd UNNEEDED, struct json_stream *jsonrpc_stream_success(struct command *cmd UNNEEDED) { fprintf(stderr, "jsonrpc_stream_success called!\n"); abort(); } /* Generated stub for notleak_ */ -void *notleak_(const void *ptr UNNEEDED, bool plus_children UNNEEDED) +void *notleak_(void *ptr UNNEEDED, bool plus_children UNNEEDED) { fprintf(stderr, "notleak_ called!\n"); abort(); } /* Generated stub for plugin_err */ void plugin_err(struct plugin *p UNNEEDED, const char *fmt UNNEEDED, ...) diff --git a/wallet/test/run-wallet.c b/wallet/test/run-wallet.c index 533fd19ae..e5b170ccd 100644 --- a/wallet/test/run-wallet.c +++ b/wallet/test/run-wallet.c @@ -280,10 +280,6 @@ void json_add_channel_id(struct json_stream *response UNNEEDED, const char *fieldname UNNEEDED, const struct channel_id *cid UNNEEDED) { fprintf(stderr, "json_add_channel_id called!\n"); abort(); } -/* Generated stub for json_add_hex */ -void json_add_hex(struct json_stream *result UNNEEDED, const char *fieldname UNNEEDED, - const void *data UNNEEDED, size_t len UNNEEDED) -{ fprintf(stderr, "json_add_hex called!\n"); abort(); } /* Generated stub for json_add_hex_talarr */ void json_add_hex_talarr(struct json_stream *result UNNEEDED, const char *fieldname UNNEEDED, diff --git a/wire/test/run-peer-wire.c b/wire/test/run-peer-wire.c index 327a0c59c..91a641da4 100644 --- a/wire/test/run-peer-wire.c +++ b/wire/test/run-peer-wire.c @@ -16,12 +16,6 @@ extern secp256k1_context *secp256k1_ctx; /* AUTOGENERATED MOCKS START */ -/* Generated stub for fromwire_channel_type */ -struct channel_type *fromwire_channel_type(const tal_t *ctx UNNEEDED, const u8 **cursor UNNEEDED, size_t *plen UNNEEDED) -{ fprintf(stderr, "fromwire_channel_type called!\n"); abort(); } -/* Generated stub for towire_channel_type */ -void towire_channel_type(u8 **p UNNEEDED, const struct channel_type *channel_type UNNEEDED) -{ fprintf(stderr, "towire_channel_type called!\n"); abort(); } /* AUTOGENERATED MOCKS END */ /* memsetting pubkeys doesn't work */ diff --git a/wire/test/run-tlvstream.c b/wire/test/run-tlvstream.c index c0e280ab0..3c06a7e9f 100644 --- a/wire/test/run-tlvstream.c +++ b/wire/test/run-tlvstream.c @@ -25,15 +25,9 @@ static const char *reason; void fromwire_channel_id(const u8 **cursor UNNEEDED, size_t *max UNNEEDED, struct channel_id *channel_id UNNEEDED) { fprintf(stderr, "fromwire_channel_id called!\n"); abort(); } -/* Generated stub for fromwire_channel_type */ -struct channel_type *fromwire_channel_type(const tal_t *ctx UNNEEDED, const u8 **cursor UNNEEDED, size_t *plen UNNEEDED) -{ fprintf(stderr, "fromwire_channel_type called!\n"); abort(); } /* Generated stub for towire_channel_id */ void towire_channel_id(u8 **pptr UNNEEDED, const struct channel_id *channel_id UNNEEDED) { fprintf(stderr, "towire_channel_id called!\n"); abort(); } -/* Generated stub for towire_channel_type */ -void towire_channel_type(u8 **p UNNEEDED, const struct channel_type *channel_type UNNEEDED) -{ fprintf(stderr, "towire_channel_type called!\n"); abort(); } /* AUTOGENERATED MOCKS END */