diff options
author | Abseil Team <absl-team@google.com> | 2023-12-26 21:22:51 -0800 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2023-12-26 21:23:47 -0800 |
commit | f9228ec834edef9b623d4824dd006890c203adc3 (patch) | |
tree | c41a1f543553fb5c8416005bfdb55048b2902d10 /absl/container/internal/container_memory_test.cc | |
parent | bd47468324e0db12aac9a57128d40fc23c233fb4 (diff) |
Migrate static objects to NoDestructor in tests, testing libraries and benchmarks.
PiperOrigin-RevId: 593918110
Change-Id: Ide100c69b10e28011af17c7f82bb10eea072cad4
Diffstat (limited to 'absl/container/internal/container_memory_test.cc')
-rw-r--r-- | absl/container/internal/container_memory_test.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/absl/container/internal/container_memory_test.cc b/absl/container/internal/container_memory_test.cc index c1e57834..90d64bf5 100644 --- a/absl/container/internal/container_memory_test.cc +++ b/absl/container/internal/container_memory_test.cc @@ -25,6 +25,7 @@ #include "gmock/gmock.h" #include "gtest/gtest.h" +#include "absl/base/no_destructor.h" #include "absl/container/internal/test_instance_tracker.h" #include "absl/meta/type_traits.h" #include "absl/strings/string_view.h" @@ -58,7 +59,7 @@ TEST(Memory, AlignmentSmallerThanBase) { } std::map<std::type_index, int>& AllocationMap() { - static auto* map = new std::map<std::type_index, int>; + static absl::NoDestructor<std::map<std::type_index, int>> map; return *map; } |