Message258661
Attached patch fixes compiler warnings on atomic pointers.
Python has 4 implementations of atomic types:
* <stdatomic.h>
* GCC 4.7+ builtin atomic operations
* GCC x86 and x86_64 assembler
* volatile
The type of atomic pointers changes depending on the implementation. Attached patch changes the _Py_atomic_address to use atomic_uintptr_t (<stdatomic.h>) or Py_uintptr_t type internally.
The patchs also adds GET_TSTATE(), SET_TSTATE() and GET_INTERP_STATE() macros in pystate.c to make the code more readable.
This issue is a follow up of the issue #22038 which added support for <stdatomic.h> in Python/pyatomic.h. See also issues #23644 (compilation issue with g++), #25150 (compilation issue with OpenMP) and #26154 (add _PyThreadState_UncheckedGet()).
I would be "nice" to backport this change to Python 3.5.2 to fix the compiler warning, but I'm not 100% confident that my patch works on all compilers and all platforms. Maybe it's better to "experiment" it only in Python 3.6.
Note: I copied the nosy list of the issue #22038 since this one is a follow up. |
|
Date |
User |
Action |
Args |
2016-01-20 10:57:13 | vstinner | set | recipients:
+ vstinner, Arfrever, neologix, fijall, koobs, John.Malmberg, Vitor.de.Lima, gustavotemple, lbianc |
2016-01-20 10:57:13 | vstinner | set | messageid: <1453287433.06.0.917991277181.issue26161@psf.upfronthosting.co.za> |
2016-01-20 10:57:12 | vstinner | link | issue26161 messages |
2016-01-20 10:57:12 | vstinner | create | |
|