Skip to content

Commit 00e9aa9

Browse files
authored
add TSAN specific flags
1 parent 6e615c1 commit 00e9aa9

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

src/culverin/culverin_compiler_specifics.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,19 @@ static inline uint64_t rdtsc() {
102102
# define CULV_MAYBE_UNUSED
103103
#endif
104104

105+
// Force TSan to ignore a specific function
106+
#if defined(__has_feature)
107+
# if __has_feature(thread_sanitizer)
108+
# define CULV_NO_TSAN __attribute__((no_sanitize("thread")))
109+
# else
110+
# define CULV_NO_TSAN
111+
# endif
112+
#elif defined(__SANITIZE_THREAD__)
113+
# define CULV_NO_TSAN __attribute__((no_sanitize("thread")))
114+
#else
115+
# define CULV_NO_TSAN
116+
#endif
117+
105118
// NOLINTNEXTLINE(readability-identifier-naming)
106119
#define PyCFunction_DeclareMethod CULV_NODISCARD static PyObject *
107120
// NOLINTNEXTLINE(readability-identifier-naming)

0 commit comments

Comments
 (0)