From b315753c0b8b4aa4e3e1479375eddb518393bab6 Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Wed, 17 Feb 2021 09:48:49 -0800 Subject: Export of internal Abseil changes -- 2247e59ee5696e61c7cb24dce479db572980032d by Derek Mauro : Ensure ThreadIdentity::WaiterState data has the correct alignment PiperOrigin-RevId: 357969866 -- 79bb81a2e6723b186536ad4b4f25cd7ee83f3e72 by Laramie Leavitt : Rework absl::MockingBitGen internal mock registry. Use a virtual base class with template-specialized derived classes to implement match method rather than taking the address of a function specialization and using casts everywhere. This combines several of the previously type-erased pointers into a single object, eliminates the separate cleanup container previously used, and eliminates some gratuitous static_cast<>s. PiperOrigin-RevId: 357827438 -- a2eb53d002c9b376360a70b2b0f6a18a1de1e16f by Todd Lipcon : Reduce runtime of sequence_lock_test PiperOrigin-RevId: 357785571 -- dd1175ff13b560f01c4aaa64bc6759a5300e391c by Abseil Team : Don't assume that compiling for Windows means that MSVC or clang-cl is being used. PiperOrigin-RevId: 357760052 -- 251a9cbede52e729b3a25911b6e225b779c285a8 by Andy Getzendanner : Internal change. PiperOrigin-RevId: 357702979 GitOrigin-RevId: 2247e59ee5696e61c7cb24dce479db572980032d Change-Id: Icd366d3775d88d623695209b5f328dbd69f01d27 --- absl/flags/BUILD.bazel | 2 +- absl/flags/internal/sequence_lock_test.cc | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'absl/flags') diff --git a/absl/flags/BUILD.bazel b/absl/flags/BUILD.bazel index 1937609a..147249ed 100644 --- a/absl/flags/BUILD.bazel +++ b/absl/flags/BUILD.bazel @@ -488,7 +488,7 @@ cc_test( ], copts = ABSL_TEST_COPTS, linkopts = ABSL_DEFAULT_LINKOPTS, - shard_count = 32, + shard_count = 31, deps = [ ":flag_internal", "//absl/base", diff --git a/absl/flags/internal/sequence_lock_test.cc b/absl/flags/internal/sequence_lock_test.cc index ff8b476b..c3ec372e 100644 --- a/absl/flags/internal/sequence_lock_test.cc +++ b/absl/flags/internal/sequence_lock_test.cc @@ -121,11 +121,25 @@ const int kMaxThreads = absl::base_internal::NumCPUs(); const int kMaxThreads = std::min(absl::base_internal::NumCPUs(), 4); #endif +// Return all of the interesting buffer sizes worth testing: +// powers of two and adjacent values. +std::vector InterestingBufferSizes() { + std::vector ret; + for (int v : MultiplicativeRange(1, 128, 2)) { + ret.push_back(v); + if (v > 1) { + ret.push_back(v - 1); + } + ret.push_back(v + 1); + } + return ret; +} + INSTANTIATE_TEST_SUITE_P( TestManyByteSizes, ConcurrentSequenceLockTest, testing::Combine( // Buffer size (bytes). - testing::Range(1, 128), + testing::ValuesIn(InterestingBufferSizes()), // Number of reader threads. testing::ValuesIn(MultiplicativeRange(1, kMaxThreads, 2)))); -- cgit v1.2.3