Skip to content

Commit 29f8307

Browse files
Abseil Teamsuertreus
authored andcommitted
Export of internal Abseil changes
-- d56207f5535c3aad1624e33d20777ea6e66f51a7 by Abseil Team <[email protected]>: Internal change PiperOrigin-RevId: 397830482 -- 7f7ff3e88e0d3cd61d63da477b2a08e61a1aeea2 by Evan Brown <[email protected]>: Update implementation details comment in raw_hash_set to include information about the heap allocation's layout. PiperOrigin-RevId: 397786239 -- fde783b12a79ae8d587d1027bc8736dff6844897 by Abseil Team <[email protected]>: Add comments on #endif to make nesting clearer PiperOrigin-RevId: 397684219 GitOrigin-RevId: d56207f5535c3aad1624e33d20777ea6e66f51a7 Change-Id: I43dc2b5c982f1ef2b21f82b6133c49c428baf223
1 parent de71511 commit 29f8307

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

absl/container/internal/raw_hash_set.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,17 @@
8787
//
8888
// This probing function guarantees that after N probes, all the groups of the
8989
// table will be probed exactly once.
90+
//
91+
// The control state and slot array are stored contiguously in a shared heap
92+
// allocation. The layout of this allocation is: `capacity()` control bytes,
93+
// one sentinel control byte, `Group::kWidth - 1` cloned control bytes,
94+
// <possible padding>, `capacity()` slots. The sentinel control byte is used in
95+
// iteration so we know when we reach the end of the table. The cloned control
96+
// bytes at the end of the table are cloned from the beginning of the table so
97+
// groups that begin near the end of the table can see a full group. In cases in
98+
// which there are more than `capacity()` cloned control bytes, the extra bytes
99+
// are `kEmpty`, and these ensure that we always see at least one empty slot and
100+
// can stop an unsuccessful search.
90101

91102
#ifndef ABSL_CONTAINER_INTERNAL_RAW_HASH_SET_H_
92103
#define ABSL_CONTAINER_INTERNAL_RAW_HASH_SET_H_

absl/debugging/internal/stacktrace_config.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
// Thread local support required for UnwindImpl.
3636
#define ABSL_STACKTRACE_INL_HEADER \
3737
"absl/debugging/internal/stacktrace_generic-inl.inc"
38-
#endif
38+
#endif // defined(ABSL_HAVE_THREAD_LOCAL)
3939

4040
#elif defined(__EMSCRIPTEN__)
4141
#define ABSL_STACKTRACE_INL_HEADER \
@@ -55,7 +55,7 @@
5555
// Note: When using glibc this may require -funwind-tables to function properly.
5656
#define ABSL_STACKTRACE_INL_HEADER \
5757
"absl/debugging/internal/stacktrace_generic-inl.inc"
58-
#endif
58+
#endif // __has_include(<execinfo.h>)
5959
#elif defined(__i386__) || defined(__x86_64__)
6060
#define ABSL_STACKTRACE_INL_HEADER \
6161
"absl/debugging/internal/stacktrace_x86-inl.inc"
@@ -73,9 +73,10 @@
7373
// Note: When using glibc this may require -funwind-tables to function properly.
7474
#define ABSL_STACKTRACE_INL_HEADER \
7575
"absl/debugging/internal/stacktrace_generic-inl.inc"
76-
#endif
77-
#endif
78-
#endif
76+
#endif // __has_include(<execinfo.h>)
77+
#endif // defined(__has_include)
78+
79+
#endif // defined(__linux__) && !defined(__ANDROID__)
7980

8081
// Fallback to the empty implementation.
8182
#if !defined(ABSL_STACKTRACE_INL_HEADER)

absl/profiling/BUILD.bazel

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ cc_library(
2727
hdrs = ["internal/sample_recorder.h"],
2828
copts = ABSL_DEFAULT_COPTS,
2929
linkopts = ABSL_DEFAULT_LINKOPTS,
30-
visibility = ["//absl:__subpackages__"],
30+
visibility = [
31+
"//absl:__subpackages__",
32+
],
3133
deps = [
3234
"//absl/base:config",
3335
"//absl/base:core_headers",

0 commit comments

Comments
 (0)