dynamic_annotations.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479
  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. // -------------------------------------------------------------------------
  52. // Decide which features are enabled.
  53. #ifdef ABSL_HAVE_THREAD_SANITIZER
  54. #define ABSL_INTERNAL_RACE_ANNOTATIONS_ENABLED 1
  55. #define ABSL_INTERNAL_READS_ANNOTATIONS_ENABLED 1
  56. #define ABSL_INTERNAL_WRITES_ANNOTATIONS_ENABLED 1
  57. #define ABSL_INTERNAL_ANNOTALYSIS_ENABLED 0
  58. #define ABSL_INTERNAL_READS_WRITES_ANNOTATIONS_ENABLED 1
  59. #else
  60. #define ABSL_INTERNAL_RACE_ANNOTATIONS_ENABLED 0
  61. #define ABSL_INTERNAL_READS_ANNOTATIONS_ENABLED 0
  62. #define ABSL_INTERNAL_WRITES_ANNOTATIONS_ENABLED 0
  63. // Clang provides limited support for static thread-safety analysis through a
  64. // feature called Annotalysis. We configure macro-definitions according to
  65. // whether Annotalysis support is available. When running in opt-mode, GCC
  66. // will issue a warning, if these attributes are compiled. Only include them
  67. // when compiling using Clang.
  68. #if defined(__clang__)
  69. #define ABSL_INTERNAL_ANNOTALYSIS_ENABLED 1
  70. #if !defined(SWIG)
  71. #define ABSL_INTERNAL_IGNORE_READS_ATTRIBUTE_ENABLED 1
  72. #endif
  73. #else
  74. #define ABSL_INTERNAL_ANNOTALYSIS_ENABLED 0
  75. #endif
  76. // Read/write annotations are enabled in Annotalysis mode; disabled otherwise.
  77. #define ABSL_INTERNAL_READS_WRITES_ANNOTATIONS_ENABLED \
  78. ABSL_INTERNAL_ANNOTALYSIS_ENABLED
  79. #endif // ABSL_HAVE_THREAD_SANITIZER
  80. #ifdef __cplusplus
  81. #define ABSL_INTERNAL_BEGIN_EXTERN_C extern "C" {
  82. #define ABSL_INTERNAL_END_EXTERN_C } // extern "C"
  83. #define ABSL_INTERNAL_GLOBAL_SCOPED(F) ::F
  84. #define ABSL_INTERNAL_STATIC_INLINE inline
  85. #else
  86. #define ABSL_INTERNAL_BEGIN_EXTERN_C // empty
  87. #define ABSL_INTERNAL_END_EXTERN_C // empty
  88. #define ABSL_INTERNAL_GLOBAL_SCOPED(F) F
  89. #define ABSL_INTERNAL_STATIC_INLINE static inline
  90. #endif
  91. // -------------------------------------------------------------------------
  92. // Define race annotations.
  93. #if ABSL_INTERNAL_RACE_ANNOTATIONS_ENABLED == 1
  94. // -------------------------------------------------------------
  95. // Annotations that suppress errors. It is usually better to express the
  96. // program's synchronization using the other annotations, but these can be used
  97. // when all else fails.
  98. // Report that we may have a benign race at `pointer`, with size
  99. // "sizeof(*(pointer))". `pointer` must be a non-void* pointer. Insert at the
  100. // point where `pointer` has been allocated, preferably close to the point
  101. // where the race happens. See also ABSL_ANNOTATE_BENIGN_RACE_STATIC.
  102. #define ABSL_ANNOTATE_BENIGN_RACE(pointer, description) \
  103. ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateBenignRaceSized) \
  104. (__FILE__, __LINE__, pointer, sizeof(*(pointer)), description)
  105. // Same as ABSL_ANNOTATE_BENIGN_RACE(`address`, `description`), but applies to
  106. // the memory range [`address`, `address`+`size`).
  107. #define ABSL_ANNOTATE_BENIGN_RACE_SIZED(address, size, description) \
  108. ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateBenignRaceSized) \
  109. (__FILE__, __LINE__, address, size, description)
  110. // Enable (`enable`!=0) or disable (`enable`==0) race detection for all threads.
  111. // This annotation could be useful if you want to skip expensive race analysis
  112. // during some period of program execution, e.g. during initialization.
  113. #define ABSL_ANNOTATE_ENABLE_RACE_DETECTION(enable) \
  114. ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateEnableRaceDetection) \
  115. (__FILE__, __LINE__, enable)
  116. // -------------------------------------------------------------
  117. // Annotations useful for debugging.
  118. // Report the current thread `name` to a race detector.
  119. #define ABSL_ANNOTATE_THREAD_NAME(name) \
  120. ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateThreadName)(__FILE__, __LINE__, name)
  121. // -------------------------------------------------------------
  122. // Annotations useful when implementing locks. They are not normally needed by
  123. // modules that merely use locks. The `lock` argument is a pointer to the lock
  124. // object.
  125. // Report that a lock has been created at address `lock`.
  126. #define ABSL_ANNOTATE_RWLOCK_CREATE(lock) \
  127. ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateRWLockCreate)(__FILE__, __LINE__, lock)
  128. // Report that a linker initialized lock has been created at address `lock`.
  129. #ifdef ABSL_HAVE_THREAD_SANITIZER
  130. #define ABSL_ANNOTATE_RWLOCK_CREATE_STATIC(lock) \
  131. ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateRWLockCreateStatic) \
  132. (__FILE__, __LINE__, lock)
  133. #else
  134. #define ABSL_ANNOTATE_RWLOCK_CREATE_STATIC(lock) \
  135. ABSL_ANNOTATE_RWLOCK_CREATE(lock)
  136. #endif
  137. // Report that the lock at address `lock` is about to be destroyed.
  138. #define ABSL_ANNOTATE_RWLOCK_DESTROY(lock) \
  139. ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateRWLockDestroy)(__FILE__, __LINE__, lock)
  140. // Report that the lock at address `lock` has been acquired.
  141. // `is_w`=1 for writer lock, `is_w`=0 for reader lock.
  142. #define ABSL_ANNOTATE_RWLOCK_ACQUIRED(lock, is_w) \
  143. ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateRWLockAcquired) \
  144. (__FILE__, __LINE__, lock, is_w)
  145. // Report that the lock at address `lock` is about to be released.
  146. // `is_w`=1 for writer lock, `is_w`=0 for reader lock.
  147. #define ABSL_ANNOTATE_RWLOCK_RELEASED(lock, is_w) \
  148. ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateRWLockReleased) \
  149. (__FILE__, __LINE__, lock, is_w)
  150. // Apply ABSL_ANNOTATE_BENIGN_RACE_SIZED to a static variable `static_var`.
  151. #define ABSL_ANNOTATE_BENIGN_RACE_STATIC(static_var, description) \
  152. namespace { \
  153. class static_var##_annotator { \
  154. public: \
  155. static_var##_annotator() { \
  156. ABSL_ANNOTATE_BENIGN_RACE_SIZED(&static_var, sizeof(static_var), \
  157. #static_var ": " description); \
  158. } \
  159. }; \
  160. static static_var##_annotator the##static_var##_annotator; \
  161. } // namespace
  162. // Function prototypes of annotations provided by the compiler-based sanitizer
  163. // implementation.
  164. ABSL_INTERNAL_BEGIN_EXTERN_C
  165. void AnnotateRWLockCreate(const char* file, int line,
  166. const volatile void* lock);
  167. void AnnotateRWLockCreateStatic(const char* file, int line,
  168. const volatile void* lock);
  169. void AnnotateRWLockDestroy(const char* file, int line,
  170. const volatile void* lock);
  171. void AnnotateRWLockAcquired(const char* file, int line,
  172. const volatile void* lock, long is_w); // NOLINT
  173. void AnnotateRWLockReleased(const char* file, int line,
  174. const volatile void* lock, long is_w); // NOLINT
  175. void AnnotateBenignRace(const char* file, int line,
  176. const volatile void* address, const char* description);
  177. void AnnotateBenignRaceSized(const char* file, int line,
  178. const volatile void* address, size_t size,
  179. const char* description);
  180. void AnnotateThreadName(const char* file, int line, const char* name);
  181. void AnnotateEnableRaceDetection(const char* file, int line, int enable);
  182. ABSL_INTERNAL_END_EXTERN_C
  183. #else // ABSL_INTERNAL_RACE_ANNOTATIONS_ENABLED == 0
  184. #define ABSL_ANNOTATE_RWLOCK_CREATE(lock) // empty
  185. #define ABSL_ANNOTATE_RWLOCK_CREATE_STATIC(lock) // empty
  186. #define ABSL_ANNOTATE_RWLOCK_DESTROY(lock) // empty
  187. #define ABSL_ANNOTATE_RWLOCK_ACQUIRED(lock, is_w) // empty
  188. #define ABSL_ANNOTATE_RWLOCK_RELEASED(lock, is_w) // empty
  189. #define ABSL_ANNOTATE_BENIGN_RACE(address, description) // empty
  190. #define ABSL_ANNOTATE_BENIGN_RACE_SIZED(address, size, description) // empty
  191. #define ABSL_ANNOTATE_THREAD_NAME(name) // empty
  192. #define ABSL_ANNOTATE_ENABLE_RACE_DETECTION(enable) // empty
  193. #define ABSL_ANNOTATE_BENIGN_RACE_STATIC(static_var, description) // empty
  194. #endif // ABSL_INTERNAL_RACE_ANNOTATIONS_ENABLED
  195. // -------------------------------------------------------------------------
  196. // Define memory annotations.
  197. #ifdef ABSL_HAVE_MEMORY_SANITIZER
  198. #include <sanitizer/msan_interface.h>
  199. #define ABSL_ANNOTATE_MEMORY_IS_INITIALIZED(address, size) \
  200. __msan_unpoison(address, size)
  201. #define ABSL_ANNOTATE_MEMORY_IS_UNINITIALIZED(address, size) \
  202. __msan_allocated_memory(address, size)
  203. #else // !defined(ABSL_HAVE_MEMORY_SANITIZER)
  204. // TODO(rogeeff): remove this branch
  205. #ifdef ABSL_HAVE_THREAD_SANITIZER
  206. #define ABSL_ANNOTATE_MEMORY_IS_INITIALIZED(address, size) \
  207. do { \
  208. (void)(address); \
  209. (void)(size); \
  210. } while (0)
  211. #define ABSL_ANNOTATE_MEMORY_IS_UNINITIALIZED(address, size) \
  212. do { \
  213. (void)(address); \
  214. (void)(size); \
  215. } while (0)
  216. #else
  217. #define ABSL_ANNOTATE_MEMORY_IS_INITIALIZED(address, size) // empty
  218. #define ABSL_ANNOTATE_MEMORY_IS_UNINITIALIZED(address, size) // empty
  219. #endif
  220. #endif // ABSL_HAVE_MEMORY_SANITIZER
  221. // -------------------------------------------------------------------------
  222. // Define IGNORE_READS_BEGIN/_END attributes.
  223. #if defined(ABSL_INTERNAL_IGNORE_READS_ATTRIBUTE_ENABLED)
  224. #define ABSL_INTERNAL_IGNORE_READS_BEGIN_ATTRIBUTE \
  225. __attribute((exclusive_lock_function("*")))
  226. #define ABSL_INTERNAL_IGNORE_READS_END_ATTRIBUTE \
  227. __attribute((unlock_function("*")))
  228. #else // !defined(ABSL_INTERNAL_IGNORE_READS_ATTRIBUTE_ENABLED)
  229. #define ABSL_INTERNAL_IGNORE_READS_BEGIN_ATTRIBUTE // empty
  230. #define ABSL_INTERNAL_IGNORE_READS_END_ATTRIBUTE // empty
  231. #endif // defined(ABSL_INTERNAL_IGNORE_READS_ATTRIBUTE_ENABLED)
  232. // -------------------------------------------------------------------------
  233. // Define IGNORE_READS_BEGIN/_END annotations.
  234. #if ABSL_INTERNAL_READS_ANNOTATIONS_ENABLED == 1
  235. // Request the analysis tool to ignore all reads in the current thread until
  236. // ABSL_ANNOTATE_IGNORE_READS_END is called. Useful to ignore intentional racey
  237. // reads, while still checking other reads and all writes.
  238. // See also ABSL_ANNOTATE_UNPROTECTED_READ.
  239. #define ABSL_ANNOTATE_IGNORE_READS_BEGIN() \
  240. ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateIgnoreReadsBegin)(__FILE__, __LINE__)
  241. // Stop ignoring reads.
  242. #define ABSL_ANNOTATE_IGNORE_READS_END() \
  243. ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateIgnoreReadsEnd)(__FILE__, __LINE__)
  244. // Function prototypes of annotations provided by the compiler-based sanitizer
  245. // implementation.
  246. ABSL_INTERNAL_BEGIN_EXTERN_C
  247. void AnnotateIgnoreReadsBegin(const char* file, int line)
  248. ABSL_INTERNAL_IGNORE_READS_BEGIN_ATTRIBUTE;
  249. void AnnotateIgnoreReadsEnd(const char* file,
  250. int line) ABSL_INTERNAL_IGNORE_READS_END_ATTRIBUTE;
  251. ABSL_INTERNAL_END_EXTERN_C
  252. #elif defined(ABSL_INTERNAL_ANNOTALYSIS_ENABLED)
  253. // When Annotalysis is enabled without Dynamic Annotations, the use of
  254. // static-inline functions allows the annotations to be read at compile-time,
  255. // while still letting the compiler elide the functions from the final build.
  256. //
  257. // TODO(delesley) -- The exclusive lock here ignores writes as well, but
  258. // allows IGNORE_READS_AND_WRITES to work properly.
  259. #define ABSL_ANNOTATE_IGNORE_READS_BEGIN() \
  260. ABSL_INTERNAL_GLOBAL_SCOPED(AbslInternalAnnotateIgnoreReadsBegin)()
  261. #define ABSL_ANNOTATE_IGNORE_READS_END() \
  262. ABSL_INTERNAL_GLOBAL_SCOPED(AbslInternalAnnotateIgnoreReadsEnd)()
  263. ABSL_INTERNAL_STATIC_INLINE void AbslInternalAnnotateIgnoreReadsBegin()
  264. ABSL_INTERNAL_IGNORE_READS_BEGIN_ATTRIBUTE {}
  265. ABSL_INTERNAL_STATIC_INLINE void AbslInternalAnnotateIgnoreReadsEnd()
  266. ABSL_INTERNAL_IGNORE_READS_END_ATTRIBUTE {}
  267. #else
  268. #define ABSL_ANNOTATE_IGNORE_READS_BEGIN() // empty
  269. #define ABSL_ANNOTATE_IGNORE_READS_END() // empty
  270. #endif
  271. // -------------------------------------------------------------------------
  272. // Define IGNORE_WRITES_BEGIN/_END annotations.
  273. #if ABSL_INTERNAL_WRITES_ANNOTATIONS_ENABLED == 1
  274. // Similar to ABSL_ANNOTATE_IGNORE_READS_BEGIN, but ignore writes instead.
  275. #define ABSL_ANNOTATE_IGNORE_WRITES_BEGIN() \
  276. ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateIgnoreWritesBegin)(__FILE__, __LINE__)
  277. // Stop ignoring writes.
  278. #define ABSL_ANNOTATE_IGNORE_WRITES_END() \
  279. ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateIgnoreWritesEnd)(__FILE__, __LINE__)
  280. // Function prototypes of annotations provided by the compiler-based sanitizer
  281. // implementation.
  282. ABSL_INTERNAL_BEGIN_EXTERN_C
  283. void AnnotateIgnoreWritesBegin(const char* file, int line);
  284. void AnnotateIgnoreWritesEnd(const char* file, int line);
  285. ABSL_INTERNAL_END_EXTERN_C
  286. #else
  287. #define ABSL_ANNOTATE_IGNORE_WRITES_BEGIN() // empty
  288. #define ABSL_ANNOTATE_IGNORE_WRITES_END() // empty
  289. #endif
  290. // -------------------------------------------------------------------------
  291. // Define the ABSL_ANNOTATE_IGNORE_READS_AND_WRITES_* annotations using the more
  292. // primitive annotations defined above.
  293. //
  294. // Instead of doing
  295. // ABSL_ANNOTATE_IGNORE_READS_BEGIN();
  296. // ... = x;
  297. // ABSL_ANNOTATE_IGNORE_READS_END();
  298. // one can use
  299. // ... = ABSL_ANNOTATE_UNPROTECTED_READ(x);
  300. #if defined(ABSL_INTERNAL_READS_WRITES_ANNOTATIONS_ENABLED)
  301. // Start ignoring all memory accesses (both reads and writes).
  302. #define ABSL_ANNOTATE_IGNORE_READS_AND_WRITES_BEGIN() \
  303. do { \
  304. ABSL_ANNOTATE_IGNORE_READS_BEGIN(); \
  305. ABSL_ANNOTATE_IGNORE_WRITES_BEGIN(); \
  306. } while (0)
  307. // Stop ignoring both reads and writes.
  308. #define ABSL_ANNOTATE_IGNORE_READS_AND_WRITES_END() \
  309. do { \
  310. ABSL_ANNOTATE_IGNORE_WRITES_END(); \
  311. ABSL_ANNOTATE_IGNORE_READS_END(); \
  312. } while (0)
  313. #ifdef __cplusplus
  314. // ABSL_ANNOTATE_UNPROTECTED_READ is the preferred way to annotate racey reads.
  315. #define ABSL_ANNOTATE_UNPROTECTED_READ(x) \
  316. absl::base_internal::AnnotateUnprotectedRead(x)
  317. namespace absl {
  318. ABSL_NAMESPACE_BEGIN
  319. namespace base_internal {
  320. template <typename T>
  321. inline T AnnotateUnprotectedRead(const volatile T& x) { // NOLINT
  322. ABSL_ANNOTATE_IGNORE_READS_BEGIN();
  323. T res = x;
  324. ABSL_ANNOTATE_IGNORE_READS_END();
  325. return res;
  326. }
  327. } // namespace base_internal
  328. ABSL_NAMESPACE_END
  329. } // namespace absl
  330. #endif
  331. #else
  332. #define ABSL_ANNOTATE_IGNORE_READS_AND_WRITES_BEGIN() // empty
  333. #define ABSL_ANNOTATE_IGNORE_READS_AND_WRITES_END() // empty
  334. #define ABSL_ANNOTATE_UNPROTECTED_READ(x) (x)
  335. #endif
  336. #ifdef __cplusplus
  337. #ifdef ABSL_HAVE_THREAD_SANITIZER
  338. ABSL_INTERNAL_BEGIN_EXTERN_C
  339. int RunningOnValgrind();
  340. double ValgrindSlowdown();
  341. ABSL_INTERNAL_END_EXTERN_C
  342. #else
  343. namespace absl {
  344. ABSL_NAMESPACE_BEGIN
  345. namespace base_internal {
  346. ABSL_DEPRECATED(
  347. "Don't use this interface. It is misleading and is being deleted.")
  348. ABSL_ATTRIBUTE_ALWAYS_INLINE inline int RunningOnValgrind() { return 0; }
  349. ABSL_DEPRECATED(
  350. "Don't use this interface. It is misleading and is being deleted.")
  351. ABSL_ATTRIBUTE_ALWAYS_INLINE inline double ValgrindSlowdown() { return 1.0; }
  352. } // namespace base_internal
  353. ABSL_NAMESPACE_END
  354. } // namespace absl
  355. using absl::base_internal::RunningOnValgrind;
  356. using absl::base_internal::ValgrindSlowdown;
  357. #endif
  358. #endif
  359. // -------------------------------------------------------------------------
  360. // Address sanitizer annotations
  361. #ifdef ABSL_HAVE_ADDRESS_SANITIZER
  362. // Describe the current state of a contiguous container such as e.g.
  363. // std::vector or std::string. For more details see
  364. // sanitizer/common_interface_defs.h, which is provided by the compiler.
  365. #include <sanitizer/common_interface_defs.h>
  366. #define ABSL_ANNOTATE_CONTIGUOUS_CONTAINER(beg, end, old_mid, new_mid) \
  367. __sanitizer_annotate_contiguous_container(beg, end, old_mid, new_mid)
  368. #define ABSL_ADDRESS_SANITIZER_REDZONE(name) \
  369. struct { \
  370. char x[8] __attribute__((aligned(8))); \
  371. } name
  372. #else
  373. #define ABSL_ANNOTATE_CONTIGUOUS_CONTAINER(beg, end, old_mid, new_mid) // empty
  374. #define ABSL_ADDRESS_SANITIZER_REDZONE(name) static_assert(true, "")
  375. #endif // ABSL_HAVE_ADDRESS_SANITIZER
  376. // -------------------------------------------------------------------------
  377. // Undefine the macros intended only for this file.
  378. #undef ABSL_INTERNAL_RACE_ANNOTATIONS_ENABLED
  379. #undef ABSL_INTERNAL_READS_ANNOTATIONS_ENABLED
  380. #undef ABSL_INTERNAL_WRITES_ANNOTATIONS_ENABLED
  381. #undef ABSL_INTERNAL_ANNOTALYSIS_ENABLED
  382. #undef ABSL_INTERNAL_READS_WRITES_ANNOTATIONS_ENABLED
  383. #undef ABSL_INTERNAL_BEGIN_EXTERN_C
  384. #undef ABSL_INTERNAL_END_EXTERN_C
  385. #undef ABSL_INTERNAL_STATIC_INLINE
  386. #endif // ABSL_BASE_DYNAMIC_ANNOTATIONS_H_