From 5f898aa52f81671cbc54beea19211c8a75e0962f Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 5 Sep 2014 00:22:21 +0200 Subject: Dynamically grow hashtable when there are more than twice as many entries as buckets This allows us to start with a much smaller hashtable and scale much higher. --- src/fastd.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/fastd.h') diff --git a/src/fastd.h b/src/fastd.h index 79d72e1..17689cd 100644 --- a/src/fastd.h +++ b/src/fastd.h @@ -253,6 +253,8 @@ struct fastd_context { bool has_floating; /**< Specifies if any of the configured peers have floating remotes */ uint32_t peer_addr_ht_seed; /**< The hash seed used for peer_addr_ht */ + size_t peer_addr_ht_size; /**< The number of hash buckets in the peer address hashtable */ + size_t peer_addr_ht_used; /**< The current number of entries in the peer address hashtable */ VECTOR(fastd_peer_t *) *peer_addr_ht; /**< An array of hash buckets for the peer hash table */ fastd_dlist_head_t handshake_queue; /**< A doubly linked list of the peers currently queued for handshakes (ordered by the time of the next handshake) */ -- cgit v1.2.3