diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2014-09-05 00:22:21 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2014-09-05 00:22:21 +0200 |
commit | 5f898aa52f81671cbc54beea19211c8a75e0962f (patch) | |
tree | f413f1ec0159a5072e826d9e3fca3079afa9517a /src/fastd.h | |
parent | 95c81c5d77398517c5d84c4eb2704732a3fb9a41 (diff) | |
download | fastd-5f898aa52f81671cbc54beea19211c8a75e0962f.tar fastd-5f898aa52f81671cbc54beea19211c8a75e0962f.zip |
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.
Diffstat (limited to 'src/fastd.h')
-rw-r--r-- | src/fastd.h | 2 |
1 files changed, 2 insertions, 0 deletions
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) */ |