|
1 | | -diff --git a/absl/base/attributes.h b/absl/base/attributes.h |
2 | | -index 5ea5ee3e..f4949898 100644 |
3 | | ---- a/absl/base/attributes.h |
4 | | -+++ b/absl/base/attributes.h |
5 | | -@@ -559,7 +559,7 @@ |
6 | | - #undef ABSL_ATTRIBUTE_UNUSED |
7 | | - #define ABSL_ATTRIBUTE_UNUSED __attribute__((__unused__)) |
8 | | - #else |
9 | | --#define ABSL_ATTRIBUTE_UNUSED |
10 | | -+#define ABSL_ATTRIBUTE_UNUSED [[maybe_unused]] |
11 | | - #endif |
12 | | - |
13 | | - // ABSL_ATTRIBUTE_INITIAL_EXEC |
14 | 1 | diff --git a/absl/container/internal/raw_hash_set.h b/absl/container/internal/raw_hash_set.h |
15 | | -index d4fe8f5c..27418d13 100644 |
| 2 | +index 3effc441..c339e269 100644 |
16 | 3 | --- a/absl/container/internal/raw_hash_set.h |
17 | 4 | +++ b/absl/container/internal/raw_hash_set.h |
18 | | -@@ -1924,7 +1924,7 @@ HashtablezInfoHandle SampleHashtablezInfo(size_t sizeof_slot, size_t sizeof_key, |
19 | | - // In SOO, we sample on the first insertion so if this is an empty SOO case |
20 | | - // (e.g. when reserve is called), then we still need to sample. |
21 | | - if (kSooEnabled && was_soo && c.size() == 0) { |
22 | | -- return Sample(sizeof_slot, sizeof_key, sizeof_value, SooCapacity()); |
23 | | -+ return Sample(sizeof_slot, sizeof_key, sizeof_value, (int16_t)SooCapacity()); |
24 | | - } |
25 | | - // For non-SOO cases, we sample whenever the capacity is increasing from zero |
26 | | - // to non-zero. |
27 | | -@@ -3525,7 +3525,7 @@ class raw_hash_set { |
28 | | - assert(is_soo()); |
29 | | - if (!ShouldSampleHashtablezInfo<CharAlloc>()) return HashtablezInfoHandle{}; |
30 | | - return Sample(sizeof(slot_type), sizeof(key_type), sizeof(value_type), |
31 | | -- SooCapacity()); |
32 | | -+ (int16_t)SooCapacity()); |
| 5 | +@@ -1121,11 +1121,12 @@ class CommonFields : public CommonFieldsGenerationInfo { |
| 6 | + #ifdef NDEBUG |
| 7 | + f(); |
| 8 | + return; |
| 9 | +-#endif |
| 10 | ++#else |
| 11 | + const size_t cap = capacity(); |
| 12 | + set_capacity(InvalidCapacity::kReentrance); |
| 13 | + f(); |
| 14 | + set_capacity(cap); |
| 15 | ++#endif |
33 | 16 | } |
34 | 17 |
|
35 | | - inline void destroy_slots() { |
36 | | -diff --git a/absl/copts/GENERATED_AbseilCopts.cmake b/absl/copts/GENERATED_AbseilCopts.cmake |
37 | | -index da2282fe..4c7fc26f 100644 |
38 | | ---- a/absl/copts/GENERATED_AbseilCopts.cmake |
39 | | -+++ b/absl/copts/GENERATED_AbseilCopts.cmake |
40 | | -@@ -181,8 +181,6 @@ list(APPEND ABSL_MSVC_FLAGS |
41 | | - "/wd4005" |
42 | | - "/wd4068" |
43 | | - "/wd4180" |
44 | | -- "/wd4244" |
45 | | -- "/wd4267" |
46 | | - "/wd4503" |
47 | | - "/wd4800" |
48 | | - "/DNOMINMAX" |
49 | | -diff --git a/absl/copts/GENERATED_copts.bzl b/absl/copts/GENERATED_copts.bzl |
50 | | -index b9e0071e..dd8410ec 100644 |
51 | | ---- a/absl/copts/GENERATED_copts.bzl |
52 | | -+++ b/absl/copts/GENERATED_copts.bzl |
53 | | -@@ -182,8 +182,6 @@ ABSL_MSVC_FLAGS = [ |
54 | | - "/wd4005", |
55 | | - "/wd4068", |
56 | | - "/wd4180", |
57 | | -- "/wd4244", |
58 | | -- "/wd4267", |
59 | | - "/wd4503", |
60 | | - "/wd4800", |
61 | | - "/DNOMINMAX", |
62 | | -diff --git a/absl/copts/copts.py b/absl/copts/copts.py |
63 | | -index 2d85ac74..4875d668 100644 |
64 | | ---- a/absl/copts/copts.py |
65 | | -+++ b/absl/copts/copts.py |
66 | | -@@ -118,10 +118,6 @@ MSVC_WARNING_FLAGS = [ |
67 | | - "/wd4068", # unknown pragma |
68 | | - # qualifier applied to function type has no meaning; ignored |
69 | | - "/wd4180", |
70 | | -- # conversion from 'type1' to 'type2', possible loss of data |
71 | | -- "/wd4244", |
72 | | -- # conversion from 'size_t' to 'type', possible loss of data |
73 | | -- "/wd4267", |
74 | | - # The decorated name was longer than the compiler limit |
75 | | - "/wd4503", |
76 | | - # forcing value to bool 'true' or 'false' (performance warning) |
77 | | -diff --git a/absl/debugging/symbolize.cc b/absl/debugging/symbolize.cc |
78 | | -index 638d3954..6b817075 100644 |
79 | | ---- a/absl/debugging/symbolize.cc |
80 | | -+++ b/absl/debugging/symbolize.cc |
81 | | -@@ -14,7 +14,7 @@ |
82 | | - |
83 | | - #include "absl/debugging/symbolize.h" |
84 | | - |
85 | | --#ifdef _WIN32 |
86 | | -+#if defined(_WIN32) && !defined(NDEBUG) |
87 | | - #include <winapifamily.h> |
88 | | - #if !(WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)) || \ |
89 | | - WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) |
90 | | -diff --git a/absl/debugging/symbolize_win32.inc b/absl/debugging/symbolize_win32.inc |
91 | | -index 53a099a1..34d210d6 100644 |
92 | | ---- a/absl/debugging/symbolize_win32.inc |
93 | | -+++ b/absl/debugging/symbolize_win32.inc |
94 | | -@@ -35,15 +35,15 @@ ABSL_NAMESPACE_BEGIN |
95 | | - |
96 | | - static HANDLE process = NULL; |
97 | | - |
98 | | --void InitializeSymbolizer(const char*) { |
99 | | -- if (process != nullptr) { |
100 | | -- return; |
101 | | -- } |
102 | | -+namespace { |
103 | | -+void InitializeSymbolizerImpl() { |
104 | | -+ |
105 | | - process = GetCurrentProcess(); |
106 | | - |
107 | | - // Symbols are not loaded until a reference is made requiring the |
108 | | - // symbols be loaded. This is the fastest, most efficient way to use |
109 | | - // the symbol handler. |
110 | | -+ |
111 | | - SymSetOptions(SYMOPT_DEFERRED_LOADS | SYMOPT_UNDNAME); |
112 | | - if (!SymInitialize(process, nullptr, true)) { |
113 | | - // GetLastError() returns a Win32 DWORD, but we assign to |
114 | | -@@ -54,6 +54,36 @@ void InitializeSymbolizer(const char*) { |
115 | | - } |
116 | | - } |
117 | | - |
118 | | -+bool LookupAndInitialize(const void* pc, SYMBOL_INFO* symbol) { |
119 | | -+ auto hProcess = (process != NULL) ? process : GetCurrentProcess(); |
120 | | -+ if (SymFromAddr(hProcess, reinterpret_cast<DWORD64>(pc), nullptr, symbol) != TRUE) { |
121 | | -+ if (GetLastError() == ERROR_INVALID_HANDLE && process == NULL) { |
122 | | -+ InitializeSymbolizerImpl(); |
123 | | -+ if (SymFromAddr(process, reinterpret_cast<DWORD64>(pc), nullptr, symbol) != TRUE) { |
124 | | -+ return false; |
125 | | -+ } |
126 | | -+ } else { |
127 | | -+ return false; |
128 | | -+ } |
129 | | -+ return false; |
| 18 | + private: |
| 19 | +@@ -3344,11 +3345,14 @@ class raw_hash_set { |
| 20 | + |
| 21 | + // Asserts that hash and equal functors provided by the user are consistent, |
| 22 | + // meaning that `eq(k1, k2)` implies `hash(k1)==hash(k2)`. |
| 23 | +- template <class K> |
| 24 | +- void AssertHashEqConsistent(const K& key) { |
| 25 | + #ifdef NDEBUG |
| 26 | ++ template <class K> |
| 27 | ++ void AssertHashEqConsistent(const K&) { |
| 28 | + return; |
| 29 | +-#endif |
130 | 30 | + } |
131 | | -+ return true; |
132 | | -+} |
133 | | -+} |
134 | | -+ |
135 | | -+void InitializeSymbolizer(const char*) { |
136 | | -+ if (process != nullptr) { |
137 | | -+ return; |
138 | | -+ } |
139 | | -+ |
140 | | -+ alignas(SYMBOL_INFO) char buf[sizeof(SYMBOL_INFO) + MAX_SYM_NAME]; |
141 | | -+ SYMBOL_INFO* symbol = reinterpret_cast<SYMBOL_INFO*>(buf); |
142 | | -+ symbol->SizeOfStruct = sizeof(SYMBOL_INFO); |
143 | | -+ symbol->MaxNameLen = MAX_SYM_NAME; |
144 | | -+ |
145 | | -+ static_cast<void>(LookupAndInitialize(reinterpret_cast<const void*>(&InitializeSymbolizer), symbol)); |
146 | | -+} |
147 | | -+ |
148 | | - bool Symbolize(const void* pc, char* out, int out_size) { |
149 | | - if (out_size <= 0) { |
150 | | - return false; |
151 | | -@@ -62,9 +92,11 @@ bool Symbolize(const void* pc, char* out, int out_size) { |
152 | | - SYMBOL_INFO* symbol = reinterpret_cast<SYMBOL_INFO*>(buf); |
153 | | - symbol->SizeOfStruct = sizeof(SYMBOL_INFO); |
154 | | - symbol->MaxNameLen = MAX_SYM_NAME; |
155 | | -- if (!SymFromAddr(process, reinterpret_cast<DWORD64>(pc), nullptr, symbol)) { |
156 | | -+ |
157 | | -+ if(!LookupAndInitialize(pc, symbol)) { |
158 | | - return false; |
| 31 | ++#else |
| 32 | ++ template <class K> |
| 33 | ++ void AssertHashEqConsistent(const K& key) { |
| 34 | + // If the hash/eq functors are known to be consistent, then skip validation. |
| 35 | + if (std::is_same<hasher, absl::container_internal::StringHash>::value && |
| 36 | + std::is_same<key_equal, absl::container_internal::StringEq>::value) { |
| 37 | +@@ -3386,6 +3390,7 @@ class raw_hash_set { |
| 38 | + if (capacity() > 16) return; |
| 39 | + IterateOverFullSlots(common(), sizeof(slot_type), assert_consistent); |
159 | 40 | } |
160 | | -+ |
161 | | - const size_t out_size_t = static_cast<size_t>(out_size); |
162 | | - strncpy(out, symbol->Name, out_size_t); |
163 | | - if (out[out_size_t - 1] != '\0') { |
| 41 | ++#endif |
| 42 | + |
| 43 | + // Attempts to find `key` in the table; if it isn't found, returns an iterator |
| 44 | + // where the value can be inserted into, with the control byte already set to |
0 commit comments