mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
bpo-39465: Add pycore_atomic_funcs.h header (GH-20766)
Add pycore_atomic_funcs.h internal header file: similar to pycore_atomic.h but don't require to declare variables as atomic. Add _Py_atomic_size_get() and _Py_atomic_size_set() functions.
This commit is contained in:
parent
46b5c6be29
commit
52a327c1cb
9 changed files with 132 additions and 17 deletions
|
@ -11,8 +11,8 @@ extern "C" {
|
|||
#include "dynamic_annotations.h" /* _Py_ANNOTATE_MEMORY_ORDER */
|
||||
#include "pyconfig.h"
|
||||
|
||||
#if defined(HAVE_STD_ATOMIC)
|
||||
#include <stdatomic.h>
|
||||
#ifdef HAVE_STD_ATOMIC
|
||||
# include <stdatomic.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -62,7 +62,7 @@ typedef struct _Py_atomic_int {
|
|||
#define _Py_atomic_load_explicit(ATOMIC_VAL, ORDER) \
|
||||
atomic_load_explicit(&((ATOMIC_VAL)->_value), ORDER)
|
||||
|
||||
/* Use builtin atomic operations in GCC >= 4.7 */
|
||||
// Use builtin atomic operations in GCC >= 4.7 and clang
|
||||
#elif defined(HAVE_BUILTIN_ATOMIC)
|
||||
|
||||
typedef enum _Py_memory_order {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue