Skip to content

Commit a97883f

Browse files
committed
pythongh-112536: Define MI_TSAN to 1 for --with-mimalloc and --with-thread-sanitizer
1 parent 5b2f21f commit a97883f

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

configure

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

+6
Original file line numberDiff line numberDiff line change
@@ -4750,6 +4750,12 @@ elif test "$disable_gil" = "yes"; then
47504750
AC_MSG_ERROR([--disable-gil requires mimalloc memory allocator (--with-mimalloc).])
47514751
fi
47524752

4753+
if test "$with_mimalloc" = yes; then
4754+
if test "$with_tsan" = yes; then
4755+
AC_DEFINE([MI_TSAN], [1], [Define MI_TSAN for thread sanitizer])
4756+
fi
4757+
fi
4758+
47534759
AC_MSG_RESULT([$with_mimalloc])
47544760
AC_SUBST([WITH_MIMALLOC])
47554761
AC_SUBST([MIMALLOC_HEADERS])

pyconfig.h.in

+3
Original file line numberDiff line numberDiff line change
@@ -1588,6 +1588,9 @@
15881588
<sysmacros.h>. */
15891589
#undef MAJOR_IN_SYSMACROS
15901590

1591+
/* Define MI_TSAN for thread sanitizer */
1592+
#undef MI_TSAN
1593+
15911594
/* Define if mvwdelch in curses.h is an expression. */
15921595
#undef MVWDELCH_IS_EXPRESSION
15931596

0 commit comments

Comments
 (0)