Skip to content

Commit 8c0b94e

Browse files
authored
Switch time_state to explicit default initialization instead of value initialization. (#1261)
It looks to me like the language rules treat these the same for this type, but evidently GCC feels differently. This only matters under TSAN where SpinLock has a non-trivial destructor, and under C++20 where ABSL_CONST_INIT is implemented (as constinit) by gcc. Fixes #1253 PiperOrigin-RevId: 469806751 Change-Id: Ic01b0142101f361bc19c95f9f9474e635669c58d
1 parent 273292d commit 8c0b94e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

absl/base/config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
// LTS releases can be obtained from
113113
// https://github.com/abseil/abseil-cpp/releases.
114114
#define ABSL_LTS_RELEASE_VERSION 20220623
115-
#define ABSL_LTS_RELEASE_PATCH_LEVEL 0
115+
#define ABSL_LTS_RELEASE_PATCH_LEVEL 1
116116

117117
// Helper macro to convert a CPP variable to a string literal.
118118
#define ABSL_INTERNAL_DO_TOKEN_STR(x) #x

absl/time/clock.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ struct ABSL_CACHELINE_ALIGNED TimeState {
196196
absl::base_internal::SpinLock lock{absl::kConstInit,
197197
base_internal::SCHEDULE_KERNEL_ONLY};
198198
};
199-
ABSL_CONST_INIT static TimeState time_state{};
199+
ABSL_CONST_INIT static TimeState time_state;
200200

201201
// Return the time in ns as told by the kernel interface. Place in *cycleclock
202202
// the value of the cycleclock at about the time of the syscall.

0 commit comments

Comments
 (0)