question about resize_delta

7 views
Skip to first unread message

Keith Rarick

unread,
May 28, 2009, 5:43:19 AM5/28/09
to google-sparsehash
On trunk/src/google/sparsehash/sparsehashtable.h line 556, I see "if
(needed_size > bucket_count())" then resize, else do nothing. This
leads me to believe that the hashtable will grow only if the number of
full buckets (including deleted items and prospective new items)
exceeds the actual capacity of the current hashtable.

So it seems like the hashtable will fail to grow if enlarge_threshold
< needed_size < bucket_count(). Is this intended? If so then what is
the point of enlarge_threshold? I feel like I'm just missing
something.

kr

Keith Rarick

unread,
May 28, 2009, 5:58:28 AM5/28/09
to google-sparsehash
Ah, never mind. I got it. needed_size (which comes from min_size) has
already considered the 0.8 occupancy ratio.

kr

Reply all
Reply to author
Forward
0 new messages