diff options
author | Abseil Team <absl-team@google.com> | 2021-09-20 13:35:36 -0700 |
---|---|---|
committer | Andy Getz <durandal@google.com> | 2021-09-20 18:35:23 -0400 |
commit | 29f8307d8e629e989bf26a84ab1a49a0738a5470 (patch) | |
tree | 03bfcefb121ad943cb6d89134e8696859c966fb9 /absl/container/internal/raw_hash_set.h | |
parent | de71511109d967000e68baedb75de104adb2b778 (diff) |
Export of internal Abseil changes
--
d56207f5535c3aad1624e33d20777ea6e66f51a7 by Abseil Team <absl-team@google.com>:
Internal change
PiperOrigin-RevId: 397830482
--
7f7ff3e88e0d3cd61d63da477b2a08e61a1aeea2 by Evan Brown <ezb@google.com>:
Update implementation details comment in raw_hash_set to include information about the heap allocation's layout.
PiperOrigin-RevId: 397786239
--
fde783b12a79ae8d587d1027bc8736dff6844897 by Abseil Team <absl-team@google.com>:
Add comments on #endif to make nesting clearer
PiperOrigin-RevId: 397684219
GitOrigin-RevId: d56207f5535c3aad1624e33d20777ea6e66f51a7
Change-Id: I43dc2b5c982f1ef2b21f82b6133c49c428baf223
Diffstat (limited to 'absl/container/internal/raw_hash_set.h')
-rw-r--r-- | absl/container/internal/raw_hash_set.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/absl/container/internal/raw_hash_set.h b/absl/container/internal/raw_hash_set.h index 212052ea..5c5db12e 100644 --- a/absl/container/internal/raw_hash_set.h +++ b/absl/container/internal/raw_hash_set.h @@ -87,6 +87,17 @@ // // This probing function guarantees that after N probes, all the groups of the // table will be probed exactly once. +// +// The control state and slot array are stored contiguously in a shared heap +// allocation. The layout of this allocation is: `capacity()` control bytes, +// one sentinel control byte, `Group::kWidth - 1` cloned control bytes, +// <possible padding>, `capacity()` slots. The sentinel control byte is used in +// iteration so we know when we reach the end of the table. The cloned control +// bytes at the end of the table are cloned from the beginning of the table so +// groups that begin near the end of the table can see a full group. In cases in +// which there are more than `capacity()` cloned control bytes, the extra bytes +// are `kEmpty`, and these ensure that we always see at least one empty slot and +// can stop an unsuccessful search. #ifndef ABSL_CONTAINER_INTERNAL_RAW_HASH_SET_H_ #define ABSL_CONTAINER_INTERNAL_RAW_HASH_SET_H_ |