From: Igor Putovny Date: Fri, 15 Sep 2023 09:04:37 +0000 (+0200) Subject: Move trie initialization to aggregator_start() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=812e646625e5be2dc19255ead17abe005d81a759;p=thirdparty%2Fbird.git Move trie initialization to aggregator_start() --- diff --git a/proto/aggregator/aggregator.c b/proto/aggregator/aggregator.c index acd33e4e3..254a9e802 100644 --- a/proto/aggregator/aggregator.c +++ b/proto/aggregator/aggregator.c @@ -109,13 +109,7 @@ remove_node(struct trie_node *node) } static void -trie_init(struct aggregator_proto *p) { - static int inits = 0; - p->trie_slab = sl_new(p->p.pool, sizeof(struct trie_node)); - p->root = new_node(p->trie_slab); - inits++; - log("Trie inits: %d", inits); } /* @@ -1161,8 +1155,6 @@ aggregator_rt_notify(struct proto *P, struct channel *src_ch, net *net, rte *new sl_free(old_route); } - trie_init(p); - HASH_WALK(p->buckets, next_hash, bucket) { for (const struct rte *rte = bucket->rte; rte; rte = rte->next) @@ -1307,6 +1299,9 @@ aggregator_start(struct proto *P) .data = p, }; + p->trie_slab = sl_new(p->p.pool, sizeof(struct trie_node)); + p->root = new_node(p->trie_slab); + return PS_UP; }