Skip to content

Commit 1abce16

Browse files
goldvitalycopybara-github
authored andcommitted
Fast growing to the next capacity based on carbon hash table ideas.
"Classical" growth is type erased and may become slower than before. Such growth is only used for usecases reserve/rehash non empty tables. PiperOrigin-RevId: 744049527 Change-Id: I13e89b324f3bdcfdbb7a433c45fbfc17ade7f8de
1 parent d97663e commit 1abce16

File tree

8 files changed

+793
-88
lines changed

8 files changed

+793
-88
lines changed

CMake/AbseilDll.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ set(ABSL_INTERNAL_DLL_FILES
9494
"container/internal/raw_hash_map.h"
9595
"container/internal/raw_hash_set.cc"
9696
"container/internal/raw_hash_set.h"
97+
"container/internal/raw_hash_set_resize_impl.h"
9798
"container/internal/tracked.h"
9899
"container/node_hash_map.h"
99100
"container/node_hash_set.h"

absl/container/BUILD.bazel

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,27 @@ cc_library(
693693
],
694694
)
695695

696+
cc_library(
697+
name = "raw_hash_set_resize_impl",
698+
hdrs = ["internal/raw_hash_set_resize_impl.h"],
699+
copts = ABSL_DEFAULT_COPTS,
700+
linkopts = ABSL_DEFAULT_LINKOPTS,
701+
deps = ["//absl/base:config"],
702+
)
703+
704+
cc_test(
705+
name = "raw_hash_set_resize_impl_test",
706+
srcs = ["internal/raw_hash_set_resize_impl_test.cc"],
707+
copts = ABSL_TEST_COPTS,
708+
linkopts = ABSL_DEFAULT_LINKOPTS,
709+
deps = [
710+
":raw_hash_set_resize_impl",
711+
"//absl/base:config",
712+
"@googletest//:gtest",
713+
"@googletest//:gtest_main",
714+
],
715+
)
716+
696717
cc_library(
697718
name = "raw_hash_set",
698719
srcs = ["internal/raw_hash_set.cc"],
@@ -709,6 +730,7 @@ cc_library(
709730
":hashtable_control_bytes",
710731
":hashtable_debug_hooks",
711732
":hashtablez_sampler",
733+
":raw_hash_set_resize_impl",
712734
"//absl/base:config",
713735
"//absl/base:core_headers",
714736
"//absl/base:dynamic_annotations",
@@ -746,6 +768,7 @@ cc_test(
746768
":hashtablez_sampler",
747769
":node_hash_set",
748770
":raw_hash_set",
771+
":raw_hash_set_resize_impl",
749772
":test_allocator",
750773
":test_instance_tracker",
751774
"//absl/base",

absl/container/CMakeLists.txt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -828,6 +828,32 @@ absl_cc_test(
828828
GTest::gmock_main
829829
)
830830

831+
# Internal-only target, do not depend on directly.
832+
absl_cc_library(
833+
NAME
834+
raw_hash_set_resize_impl
835+
HDRS
836+
"internal/raw_hash_set_resize_impl.h"
837+
COPTS
838+
${ABSL_DEFAULT_COPTS}
839+
DEPS
840+
absl::config
841+
PUBLIC
842+
)
843+
844+
absl_cc_test(
845+
NAME
846+
raw_hash_set_resize_impl_test
847+
SRCS
848+
"internal/raw_hash_set_resize_impl_test.cc"
849+
COPTS
850+
${ABSL_TEST_COPTS}
851+
DEPS
852+
absl::config
853+
absl::raw_hash_set_resize_impl
854+
GTest::gmock_main
855+
)
856+
831857
absl_cc_test(
832858
NAME
833859
raw_hash_set_allocator_test

0 commit comments

Comments
 (0)