We have an autoconf check for stdatomic.h. The test even verifies that a program with atomic_load_explicit() compiles and links.
How do we want to use mimalloc in the future? Is it going to stay optional in 3.12? Then the default setting for --with-mimalloc should depend on presence of stdatomic.h. Do we want to make it mandatory for GC heap walking and nogil? Then --with-mimalloc should default to "yes" and configure should abort when stdatomic.h is missing.
I'm leaning towards --with-mimalloc=yes. It will make users aware that they need a compiler with atomics:
configure: error: --with-mimalloc requires stdatomic.h. Update your compiler or rebuild with --without-mimalloc. Python 3.12 will require stdatomic. |