summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2022-01-05 10:31:06 +0000
committer Vladimir Marko <vmarko@google.com> 2022-01-05 12:30:47 +0000
commit9f057d6ef844c8ce32b8fe0ac9010b2a0f01b434 (patch)
tree0b76e540ce87a3a66726a11b18e73920d6ae0e75
parent1bad13fe74494465237d0effa3104dd4af4519de (diff)
Add HashSet<> ctor with initial buffer...
... and explicit hash and predicate functions, allowing these to hold state. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 181943478 Change-Id: If3b3c86effed77a6aa5216c526d645e64598f48f
-rw-r--r--libartbase/base/hash_set.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/libartbase/base/hash_set.h b/libartbase/base/hash_set.h
index 97e27f330b..568d9f450f 100644
--- a/libartbase/base/hash_set.h
+++ b/libartbase/base/hash_set.h
@@ -286,7 +286,17 @@ class HashSet {
value_type* buffer,
size_t buffer_size,
const allocator_type& alloc)
+ : HashSet(min_load_factor, max_load_factor, HashFn(), Pred(), buffer, buffer_size, alloc) {}
+ HashSet(double min_load_factor,
+ double max_load_factor,
+ const HashFn& hashfn,
+ const Pred& pred,
+ value_type* buffer,
+ size_t buffer_size,
+ const allocator_type& alloc)
: allocfn_(alloc),
+ hashfn_(hashfn),
+ pred_(pred),
num_elements_(0u),
num_buckets_(buffer_size),
elements_until_expand_(buffer_size * max_load_factor),