You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

dynamic_annotations.h 20 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487
  1. // Copyright 2017 The Abseil Authors.
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // https://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. // This file defines dynamic annotations for use with dynamic analysis tool
  15. // such as valgrind, PIN, etc.
  16. //
  17. // Dynamic annotation is a source code annotation that affects the generated
  18. // code (that is, the annotation is not a comment). Each such annotation is
  19. // attached to a particular instruction and/or to a particular object (address)
  20. // in the program.
  21. //
  22. // The annotations that should be used by users are macros in all upper-case
  23. // (e.g., ABSL_ANNOTATE_THREAD_NAME).
  24. //
  25. // Actual implementation of these macros may differ depending on the dynamic
  26. // analysis tool being used.
  27. //
  28. // This file supports the following configurations:
  29. // - Dynamic Annotations enabled (with static thread-safety warnings disabled).
  30. // In this case, macros expand to functions implemented by Thread Sanitizer,
  31. // when building with TSan. When not provided an external implementation,
  32. // dynamic_annotations.cc provides no-op implementations.
  33. //
  34. // - Static Clang thread-safety warnings enabled.
  35. // When building with a Clang compiler that supports thread-safety warnings,
  36. // a subset of annotations can be statically-checked at compile-time. We
  37. // expand these macros to static-inline functions that can be analyzed for
  38. // thread-safety, but afterwards elided when building the final binary.
  39. //
  40. // - All annotations are disabled.
  41. // If neither Dynamic Annotations nor Clang thread-safety warnings are
  42. // enabled, then all annotation-macros expand to empty.
  43. #ifndef ABSL_BASE_DYNAMIC_ANNOTATIONS_H_
  44. #define ABSL_BASE_DYNAMIC_ANNOTATIONS_H_
  45. #include <stddef.h>
  46. #include "absl/base/attributes.h"
  47. #include "absl/base/config.h"
  48. #ifdef __cplusplus
  49. #include "absl/base/macros.h"
  50. #endif
  51. // TODO(rogeeff): Remove after the backward compatibility period.
  52. #include "absl/base/internal/dynamic_annotations.h" // IWYU pragma: export
  53. // -------------------------------------------------------------------------
  54. // Decide which features are enabled.
  55. #ifdef ABSL_HAVE_THREAD_SANITIZER
  56. #define ABSL_INTERNAL_RACE_ANNOTATIONS_ENABLED 1
  57. #define ABSL_INTERNAL_READS_ANNOTATIONS_ENABLED 1
  58. #define ABSL_INTERNAL_WRITES_ANNOTATIONS_ENABLED 1
  59. #define ABSL_INTERNAL_ANNOTALYSIS_ENABLED 0
  60. #define ABSL_INTERNAL_READS_WRITES_ANNOTATIONS_ENABLED 1
  61. #else
  62. #define ABSL_INTERNAL_RACE_ANNOTATIONS_ENABLED 0
  63. #define ABSL_INTERNAL_READS_ANNOTATIONS_ENABLED 0
  64. #define ABSL_INTERNAL_WRITES_ANNOTATIONS_ENABLED 0
  65. // Clang provides limited support for static thread-safety analysis through a
  66. // feature called Annotalysis. We configure macro-definitions according to
  67. // whether Annotalysis support is available. When running in opt-mode, GCC
  68. // will issue a warning, if these attributes are compiled. Only include them
  69. // when compiling using Clang.
  70. #if defined(__clang__)
  71. #define ABSL_INTERNAL_ANNOTALYSIS_ENABLED 1
  72. #if !defined(SWIG)
  73. #define ABSL_INTERNAL_IGNORE_READS_ATTRIBUTE_ENABLED 1
  74. #endif
  75. #else
  76. #define ABSL_INTERNAL_ANNOTALYSIS_ENABLED 0
  77. #endif
  78. // Read/write annotations are enabled in Annotalysis mode; disabled otherwise.
  79. #define ABSL_INTERNAL_READS_WRITES_ANNOTATIONS_ENABLED \
  80. ABSL_INTERNAL_ANNOTALYSIS_ENABLED
  81. #endif // ABSL_HAVE_THREAD_SANITIZER
  82. #ifdef __cplusplus
  83. #define ABSL_INTERNAL_BEGIN_EXTERN_C \
  84. extern "C" \
  85. {
  86. #define ABSL_INTERNAL_END_EXTERN_C } // extern "C"
  87. #define ABSL_INTERNAL_GLOBAL_SCOPED(F) ::F
  88. #define ABSL_INTERNAL_STATIC_INLINE inline
  89. #else
  90. #define ABSL_INTERNAL_BEGIN_EXTERN_C // empty
  91. #define ABSL_INTERNAL_END_EXTERN_C // empty
  92. #define ABSL_INTERNAL_GLOBAL_SCOPED(F) F
  93. #define ABSL_INTERNAL_STATIC_INLINE static inline
  94. #endif
  95. // -------------------------------------------------------------------------
  96. // Define race annotations.
  97. #if ABSL_INTERNAL_RACE_ANNOTATIONS_ENABLED == 1
  98. // Some of the symbols used in this section (e.g. AnnotateBenignRaceSized) are
  99. // defined by the compiler-based santizer implementation, not by the Abseil
  100. // library. Therefore they do not use ABSL_INTERNAL_C_SYMBOL.
  101. // -------------------------------------------------------------
  102. // Annotations that suppress errors. It is usually better to express the
  103. // program's synchronization using the other annotations, but these can be used
  104. // when all else fails.
  105. // Report that we may have a benign race at `pointer`, with size
  106. // "sizeof(*(pointer))". `pointer` must be a non-void* pointer. Insert at the
  107. // point where `pointer` has been allocated, preferably close to the point
  108. // where the race happens. See also ABSL_ANNOTATE_BENIGN_RACE_STATIC.
  109. #define ABSL_ANNOTATE_BENIGN_RACE(pointer, description) \
  110. ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateBenignRaceSized) \
  111. (__FILE__, __LINE__, pointer, sizeof(*(pointer)), description)
  112. // Same as ABSL_ANNOTATE_BENIGN_RACE(`address`, `description`), but applies to
  113. // the memory range [`address`, `address`+`size`).
  114. #define ABSL_ANNOTATE_BENIGN_RACE_SIZED(address, size, description) \
  115. ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateBenignRaceSized) \
  116. (__FILE__, __LINE__, address, size, description)
  117. // Enable (`enable`!=0) or disable (`enable`==0) race detection for all threads.
  118. // This annotation could be useful if you want to skip expensive race analysis
  119. // during some period of program execution, e.g. during initialization.
  120. #define ABSL_ANNOTATE_ENABLE_RACE_DETECTION(enable) \
  121. ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateEnableRaceDetection) \
  122. (__FILE__, __LINE__, enable)
  123. // -------------------------------------------------------------
  124. // Annotations useful for debugging.
  125. // Report the current thread `name` to a race detector.
  126. #define ABSL_ANNOTATE_THREAD_NAME(name) \
  127. ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateThreadName) \
  128. (__FILE__, __LINE__, name)
  129. // -------------------------------------------------------------
  130. // Annotations useful when implementing locks. They are not normally needed by
  131. // modules that merely use locks. The `lock` argument is a pointer to the lock
  132. // object.
  133. // Report that a lock has been created at address `lock`.
  134. #define ABSL_ANNOTATE_RWLOCK_CREATE(lock) \
  135. ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateRWLockCreate) \
  136. (__FILE__, __LINE__, lock)
  137. // Report that a linker initialized lock has been created at address `lock`.
  138. #ifdef ABSL_HAVE_THREAD_SANITIZER
  139. #define ABSL_ANNOTATE_RWLOCK_CREATE_STATIC(lock) \
  140. ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateRWLockCreateStatic) \
  141. (__FILE__, __LINE__, lock)
  142. #else
  143. #define ABSL_ANNOTATE_RWLOCK_CREATE_STATIC(lock) \
  144. ABSL_ANNOTATE_RWLOCK_CREATE(lock)
  145. #endif
  146. // Report that the lock at address `lock` is about to be destroyed.
  147. #define ABSL_ANNOTATE_RWLOCK_DESTROY(lock) \
  148. ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateRWLockDestroy) \
  149. (__FILE__, __LINE__, lock)
  150. // Report that the lock at address `lock` has been acquired.
  151. // `is_w`=1 for writer lock, `is_w`=0 for reader lock.
  152. #define ABSL_ANNOTATE_RWLOCK_ACQUIRED(lock, is_w) \
  153. ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateRWLockAcquired) \
  154. (__FILE__, __LINE__, lock, is_w)
  155. // Report that the lock at address `lock` is about to be released.
  156. // `is_w`=1 for writer lock, `is_w`=0 for reader lock.
  157. #define ABSL_ANNOTATE_RWLOCK_RELEASED(lock, is_w) \
  158. ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateRWLockReleased) \
  159. (__FILE__, __LINE__, lock, is_w)
  160. // Apply ABSL_ANNOTATE_BENIGN_RACE_SIZED to a static variable `static_var`.
  161. #define ABSL_ANNOTATE_BENIGN_RACE_STATIC(static_var, description) \
  162. namespace \
  163. { \
  164. class static_var##_annotator \
  165. { \
  166. public: \
  167. static_var##_annotator() \
  168. { \
  169. ABSL_ANNOTATE_BENIGN_RACE_SIZED(&static_var, sizeof(static_var), #static_var ": " description); \
  170. } \
  171. }; \
  172. static static_var##_annotator the##static_var##_annotator; \
  173. } // namespace
  174. // Function prototypes of annotations provided by the compiler-based sanitizer
  175. // implementation.
  176. ABSL_INTERNAL_BEGIN_EXTERN_C
  177. void AnnotateRWLockCreate(const char* file, int line, const volatile void* lock);
  178. void AnnotateRWLockCreateStatic(const char* file, int line, const volatile void* lock);
  179. void AnnotateRWLockDestroy(const char* file, int line, const volatile void* lock);
  180. void AnnotateRWLockAcquired(const char* file, int line, const volatile void* lock, long is_w); // NOLINT
  181. void AnnotateRWLockReleased(const char* file, int line, const volatile void* lock, long is_w); // NOLINT
  182. void AnnotateBenignRace(const char* file, int line, const volatile void* address, const char* description);
  183. void AnnotateBenignRaceSized(const char* file, int line, const volatile void* address, size_t size, const char* description);
  184. void AnnotateThreadName(const char* file, int line, const char* name);
  185. void AnnotateEnableRaceDetection(const char* file, int line, int enable);
  186. ABSL_INTERNAL_END_EXTERN_C
  187. #else // ABSL_INTERNAL_RACE_ANNOTATIONS_ENABLED == 0
  188. #define ABSL_ANNOTATE_RWLOCK_CREATE(lock) // empty
  189. #define ABSL_ANNOTATE_RWLOCK_CREATE_STATIC(lock) // empty
  190. #define ABSL_ANNOTATE_RWLOCK_DESTROY(lock) // empty
  191. #define ABSL_ANNOTATE_RWLOCK_ACQUIRED(lock, is_w) // empty
  192. #define ABSL_ANNOTATE_RWLOCK_RELEASED(lock, is_w) // empty
  193. #define ABSL_ANNOTATE_BENIGN_RACE(address, description) // empty
  194. #define ABSL_ANNOTATE_BENIGN_RACE_SIZED(address, size, description) // empty
  195. #define ABSL_ANNOTATE_THREAD_NAME(name) // empty
  196. #define ABSL_ANNOTATE_ENABLE_RACE_DETECTION(enable) // empty
  197. #define ABSL_ANNOTATE_BENIGN_RACE_STATIC(static_var, description) // empty
  198. #endif // ABSL_INTERNAL_RACE_ANNOTATIONS_ENABLED
  199. // -------------------------------------------------------------------------
  200. // Define memory annotations.
  201. #ifdef ABSL_HAVE_MEMORY_SANITIZER
  202. #include <sanitizer/msan_interface.h>
  203. #define ABSL_ANNOTATE_MEMORY_IS_INITIALIZED(address, size) \
  204. __msan_unpoison(address, size)
  205. #define ABSL_ANNOTATE_MEMORY_IS_UNINITIALIZED(address, size) \
  206. __msan_allocated_memory(address, size)
  207. #else // !defined(ABSL_HAVE_MEMORY_SANITIZER)
  208. // TODO(rogeeff): remove this branch
  209. #ifdef ABSL_HAVE_THREAD_SANITIZER
  210. #define ABSL_ANNOTATE_MEMORY_IS_INITIALIZED(address, size) \
  211. do \
  212. { \
  213. (void)(address); \
  214. (void)(size); \
  215. } while (0)
  216. #define ABSL_ANNOTATE_MEMORY_IS_UNINITIALIZED(address, size) \
  217. do \
  218. { \
  219. (void)(address); \
  220. (void)(size); \
  221. } while (0)
  222. #else
  223. #define ABSL_ANNOTATE_MEMORY_IS_INITIALIZED(address, size) // empty
  224. #define ABSL_ANNOTATE_MEMORY_IS_UNINITIALIZED(address, size) // empty
  225. #endif
  226. #endif // ABSL_HAVE_MEMORY_SANITIZER
  227. // -------------------------------------------------------------------------
  228. // Define IGNORE_READS_BEGIN/_END attributes.
  229. #if defined(ABSL_INTERNAL_IGNORE_READS_ATTRIBUTE_ENABLED)
  230. #define ABSL_INTERNAL_IGNORE_READS_BEGIN_ATTRIBUTE \
  231. __attribute((exclusive_lock_function("*")))
  232. #define ABSL_INTERNAL_IGNORE_READS_END_ATTRIBUTE \
  233. __attribute((unlock_function("*")))
  234. #else // !defined(ABSL_INTERNAL_IGNORE_READS_ATTRIBUTE_ENABLED)
  235. #define ABSL_INTERNAL_IGNORE_READS_BEGIN_ATTRIBUTE // empty
  236. #define ABSL_INTERNAL_IGNORE_READS_END_ATTRIBUTE // empty
  237. #endif // defined(ABSL_INTERNAL_IGNORE_READS_ATTRIBUTE_ENABLED)
  238. // -------------------------------------------------------------------------
  239. // Define IGNORE_READS_BEGIN/_END annotations.
  240. #if ABSL_INTERNAL_READS_ANNOTATIONS_ENABLED == 1
  241. // Some of the symbols used in this section (e.g. AnnotateIgnoreReadsBegin) are
  242. // defined by the compiler-based implementation, not by the Abseil
  243. // library. Therefore they do not use ABSL_INTERNAL_C_SYMBOL.
  244. // Request the analysis tool to ignore all reads in the current thread until
  245. // ABSL_ANNOTATE_IGNORE_READS_END is called. Useful to ignore intentional racey
  246. // reads, while still checking other reads and all writes.
  247. // See also ABSL_ANNOTATE_UNPROTECTED_READ.
  248. #define ABSL_ANNOTATE_IGNORE_READS_BEGIN() \
  249. ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateIgnoreReadsBegin) \
  250. (__FILE__, __LINE__)
  251. // Stop ignoring reads.
  252. #define ABSL_ANNOTATE_IGNORE_READS_END() \
  253. ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateIgnoreReadsEnd) \
  254. (__FILE__, __LINE__)
  255. // Function prototypes of annotations provided by the compiler-based sanitizer
  256. // implementation.
  257. ABSL_INTERNAL_BEGIN_EXTERN_C
  258. void AnnotateIgnoreReadsBegin(const char* file, int line)
  259. ABSL_INTERNAL_IGNORE_READS_BEGIN_ATTRIBUTE;
  260. void AnnotateIgnoreReadsEnd(const char* file, int line) ABSL_INTERNAL_IGNORE_READS_END_ATTRIBUTE;
  261. ABSL_INTERNAL_END_EXTERN_C
  262. #elif defined(ABSL_INTERNAL_ANNOTALYSIS_ENABLED)
  263. // When Annotalysis is enabled without Dynamic Annotations, the use of
  264. // static-inline functions allows the annotations to be read at compile-time,
  265. // while still letting the compiler elide the functions from the final build.
  266. //
  267. // TODO(delesley) -- The exclusive lock here ignores writes as well, but
  268. // allows IGNORE_READS_AND_WRITES to work properly.
  269. #define ABSL_ANNOTATE_IGNORE_READS_BEGIN() \
  270. ABSL_INTERNAL_GLOBAL_SCOPED( \
  271. ABSL_INTERNAL_C_SYMBOL(AbslInternalAnnotateIgnoreReadsBegin) \
  272. ) \
  273. ()
  274. #define ABSL_ANNOTATE_IGNORE_READS_END() \
  275. ABSL_INTERNAL_GLOBAL_SCOPED( \
  276. ABSL_INTERNAL_C_SYMBOL(AbslInternalAnnotateIgnoreReadsEnd) \
  277. ) \
  278. ()
  279. ABSL_INTERNAL_STATIC_INLINE void ABSL_INTERNAL_C_SYMBOL(
  280. AbslInternalAnnotateIgnoreReadsBegin
  281. )()
  282. ABSL_INTERNAL_IGNORE_READS_BEGIN_ATTRIBUTE
  283. {
  284. }
  285. ABSL_INTERNAL_STATIC_INLINE void ABSL_INTERNAL_C_SYMBOL(
  286. AbslInternalAnnotateIgnoreReadsEnd
  287. )()
  288. ABSL_INTERNAL_IGNORE_READS_END_ATTRIBUTE
  289. {
  290. }
  291. #else
  292. #define ABSL_ANNOTATE_IGNORE_READS_BEGIN() // empty
  293. #define ABSL_ANNOTATE_IGNORE_READS_END() // empty
  294. #endif
  295. // -------------------------------------------------------------------------
  296. // Define IGNORE_WRITES_BEGIN/_END annotations.
  297. #if ABSL_INTERNAL_WRITES_ANNOTATIONS_ENABLED == 1
  298. // Similar to ABSL_ANNOTATE_IGNORE_READS_BEGIN, but ignore writes instead.
  299. #define ABSL_ANNOTATE_IGNORE_WRITES_BEGIN() \
  300. ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateIgnoreWritesBegin) \
  301. (__FILE__, __LINE__)
  302. // Stop ignoring writes.
  303. #define ABSL_ANNOTATE_IGNORE_WRITES_END() \
  304. ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateIgnoreWritesEnd) \
  305. (__FILE__, __LINE__)
  306. // Function prototypes of annotations provided by the compiler-based sanitizer
  307. // implementation.
  308. ABSL_INTERNAL_BEGIN_EXTERN_C
  309. void AnnotateIgnoreWritesBegin(const char* file, int line);
  310. void AnnotateIgnoreWritesEnd(const char* file, int line);
  311. ABSL_INTERNAL_END_EXTERN_C
  312. #else
  313. #define ABSL_ANNOTATE_IGNORE_WRITES_BEGIN() // empty
  314. #define ABSL_ANNOTATE_IGNORE_WRITES_END() // empty
  315. #endif
  316. // -------------------------------------------------------------------------
  317. // Define the ABSL_ANNOTATE_IGNORE_READS_AND_WRITES_* annotations using the more
  318. // primitive annotations defined above.
  319. //
  320. // Instead of doing
  321. // ABSL_ANNOTATE_IGNORE_READS_BEGIN();
  322. // ... = x;
  323. // ABSL_ANNOTATE_IGNORE_READS_END();
  324. // one can use
  325. // ... = ABSL_ANNOTATE_UNPROTECTED_READ(x);
  326. #if defined(ABSL_INTERNAL_READS_WRITES_ANNOTATIONS_ENABLED)
  327. // Start ignoring all memory accesses (both reads and writes).
  328. #define ABSL_ANNOTATE_IGNORE_READS_AND_WRITES_BEGIN() \
  329. do \
  330. { \
  331. ABSL_ANNOTATE_IGNORE_READS_BEGIN(); \
  332. ABSL_ANNOTATE_IGNORE_WRITES_BEGIN(); \
  333. } while (0)
  334. // Stop ignoring both reads and writes.
  335. #define ABSL_ANNOTATE_IGNORE_READS_AND_WRITES_END() \
  336. do \
  337. { \
  338. ABSL_ANNOTATE_IGNORE_WRITES_END(); \
  339. ABSL_ANNOTATE_IGNORE_READS_END(); \
  340. } while (0)
  341. #ifdef __cplusplus
  342. // ABSL_ANNOTATE_UNPROTECTED_READ is the preferred way to annotate racey reads.
  343. #define ABSL_ANNOTATE_UNPROTECTED_READ(x) \
  344. absl::base_internal::AnnotateUnprotectedRead(x)
  345. namespace absl
  346. {
  347. ABSL_NAMESPACE_BEGIN
  348. namespace base_internal
  349. {
  350. template<typename T>
  351. inline T AnnotateUnprotectedRead(const volatile T& x)
  352. { // NOLINT
  353. ABSL_ANNOTATE_IGNORE_READS_BEGIN();
  354. T res = x;
  355. ABSL_ANNOTATE_IGNORE_READS_END();
  356. return res;
  357. }
  358. } // namespace base_internal
  359. ABSL_NAMESPACE_END
  360. } // namespace absl
  361. #endif
  362. #else
  363. #define ABSL_ANNOTATE_IGNORE_READS_AND_WRITES_BEGIN() // empty
  364. #define ABSL_ANNOTATE_IGNORE_READS_AND_WRITES_END() // empty
  365. #define ABSL_ANNOTATE_UNPROTECTED_READ(x) (x)
  366. #endif
  367. // -------------------------------------------------------------------------
  368. // Address sanitizer annotations
  369. #ifdef ABSL_HAVE_ADDRESS_SANITIZER
  370. // Describe the current state of a contiguous container such as e.g.
  371. // std::vector or std::string. For more details see
  372. // sanitizer/common_interface_defs.h, which is provided by the compiler.
  373. #include <sanitizer/common_interface_defs.h>
  374. #define ABSL_ANNOTATE_CONTIGUOUS_CONTAINER(beg, end, old_mid, new_mid) \
  375. __sanitizer_annotate_contiguous_container(beg, end, old_mid, new_mid)
  376. #define ABSL_ADDRESS_SANITIZER_REDZONE(name) \
  377. struct \
  378. { \
  379. alignas(8) char x[8]; \
  380. } name
  381. #else
  382. #define ABSL_ANNOTATE_CONTIGUOUS_CONTAINER(beg, end, old_mid, new_mid) // empty
  383. #define ABSL_ADDRESS_SANITIZER_REDZONE(name) static_assert(true, "")
  384. #endif // ABSL_HAVE_ADDRESS_SANITIZER
  385. // -------------------------------------------------------------------------
  386. // Undefine the macros intended only for this file.
  387. #undef ABSL_INTERNAL_RACE_ANNOTATIONS_ENABLED
  388. #undef ABSL_INTERNAL_READS_ANNOTATIONS_ENABLED
  389. #undef ABSL_INTERNAL_WRITES_ANNOTATIONS_ENABLED
  390. #undef ABSL_INTERNAL_ANNOTALYSIS_ENABLED
  391. #undef ABSL_INTERNAL_READS_WRITES_ANNOTATIONS_ENABLED
  392. #undef ABSL_INTERNAL_BEGIN_EXTERN_C
  393. #undef ABSL_INTERNAL_END_EXTERN_C
  394. #undef ABSL_INTERNAL_STATIC_INLINE
  395. #endif // ABSL_BASE_DYNAMIC_ANNOTATIONS_H_