/opt/alt/php82/usr/include/php/Zend
NameSizeModeActions
Optimizer/-0755rm
zend.h156390644editdlrm
zend_alloc.h192780644editdlrm
zend_alloc_sizes.h26290644editdlrm
zend_API.h1003750644editdlrm
zend_arena.h60630644editdlrm
zend_ast.h130000644editdlrm
zend_atomic.h57040644editdlrm
zend_attributes.h56090644editdlrm
zend_attributes_arginfo.h107550644editdlrm
zend_bitset.h79250644editdlrm
zend_build.h16260644editdlrm
zend_builtin_functions.h15130644editdlrm
zend_builtin_functions_arginfo.h141840644editdlrm
zend_closures.h22900644editdlrm
zend_closures_arginfo.h20840644editdlrm
zend_compile.h488320644editdlrm
zend_config.h320644editdlrm
zend_constants.h67060644editdlrm
zend_constants_arginfo.h13520644editdlrm
zend_cpuinfo.h75560644editdlrm
zend_dtrace.h20510644editdlrm
zend_enum.h28420644editdlrm
zend_enum_arginfo.h17040644editdlrm
zend_errors.h24000644editdlrm
zend_exceptions.h45510644editdlrm
zend_exceptions_arginfo.h177600644editdlrm
zend_execute.h205560644editdlrm
zend_extensions.h63520644editdlrm
zend_fibers.h49620644editdlrm
zend_fibers_arginfo.h35690644editdlrm
zend_float.h154380644editdlrm
zend_gc.h39120644editdlrm
zend_gdb.h14200644editdlrm
zend_generators.h75120644editdlrm
zend_generators_arginfo.h27870644editdlrm
zend_globals.h92010644editdlrm
zend_globals_macros.h28100644editdlrm
zend_hash.h513110644editdlrm
zend_highlight.h22960644editdlrm
zend_inheritance.h24260644editdlrm
zend_ini.h119270644editdlrm
zend_ini_parser.h27300644editdlrm
zend_ini_scanner.h18890644editdlrm
zend_ini_scanner_defs.h2250644editdlrm
zend_interfaces.h41180644editdlrm
zend_interfaces_arginfo.h80290644editdlrm
zend_istdiostream.h15370644editdlrm
zend_iterators.h37860644editdlrm
zend_language_parser.h61020644editdlrm
zend_language_scanner.h30440644editdlrm
zend_language_scanner_defs.h3100644editdlrm
zend_list.h34750644editdlrm
zend_llist.h40010644editdlrm
zend_long.h42270644editdlrm
zend_map_ptr.h30060644editdlrm
zend_max_execution_timer.h14840644editdlrm
zend_mmap.h15090644editdlrm
zend_modules.h48260644editdlrm
zend_multibyte.h48970644editdlrm
zend_multiply.h102080644editdlrm
zend_objects.h18140644editdlrm
zend_objects_API.h46510644editdlrm
zend_object_handlers.h143550644editdlrm
zend_observer.h63980644editdlrm
zend_operators.h338080644editdlrm
zend_portability.h227900644editdlrm
zend_ptr_stack.h42960644editdlrm
zend_range_check.h30000644editdlrm
zend_signal.h40740644editdlrm
zend_smart_str.h69220644editdlrm
zend_smart_string.h42070644editdlrm
zend_smart_string_public.h12400644editdlrm
zend_smart_str_public.h11590644editdlrm
zend_sort.h15350644editdlrm
zend_stack.h23590644editdlrm
zend_stream.h36160644editdlrm
zend_string.h207160644editdlrm
zend_strtod.h21510644editdlrm
zend_strtod_int.h34140644editdlrm
zend_system_id.h14040644editdlrm
zend_types.h475900644editdlrm
zend_type_info.h45440644editdlrm
zend_variables.h30650644editdlrm
zend_virtual_cwd.h129900644editdlrm
zend_vm.h19940644editdlrm
zend_vm_def.h2882090644editdlrm
zend_vm_execute.h21189140644editdlrm
zend_vm_handlers.h915060644editdlrm
zend_vm_opcodes.h126840644editdlrm
zend_vm_trace_handlers.h32160644editdlrm
zend_vm_trace_lines.h17550644editdlrm
zend_vm_trace_map.h26650644editdlrm
zend_weakrefs.h28040644editdlrm
zend_weakrefs_arginfo.h34790644editdlrm
Edit: /opt/alt/php82/usr/include/php/Zend/zend_atomic.h (5704B)
/* +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | https://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Levi Morrison | +----------------------------------------------------------------------+ */ #ifndef ZEND_ATOMIC_H #define ZEND_ATOMIC_H #include "zend_portability.h" #include #define ZEND_GCC_PREREQ(x, y) \ ((__GNUC__ == (x) && __GNUC_MINOR__ >= (y)) || (__GNUC__ > (x))) /* Builtins are used to avoid library linkage */ #if __has_feature(c_atomic) && defined(__clang__) #define HAVE_C11_ATOMICS 1 #elif ZEND_GCC_PREREQ(4, 7) #define HAVE_GNUC_ATOMICS 1 #elif defined(__GNUC__) #define HAVE_SYNC_ATOMICS 1 #elif !defined(ZEND_WIN32) #define HAVE_NO_ATOMICS 1 #endif #undef ZEND_GCC_PREREQ /* Treat zend_atomic_* types as opaque. They have definitions only for size * and alignment purposes. */ #if defined(ZEND_WIN32) || defined(HAVE_SYNC_ATOMICS) typedef struct zend_atomic_bool_s { volatile char value; } zend_atomic_bool; #elif defined(HAVE_C11_ATOMICS) typedef struct zend_atomic_bool_s { _Atomic(bool) value; } zend_atomic_bool; #else typedef struct zend_atomic_bool_s { volatile bool value; } zend_atomic_bool; #endif BEGIN_EXTERN_C() #ifdef ZEND_WIN32 #ifndef InterlockedExchange8 #define InterlockedExchange8 _InterlockedExchange8 #endif #ifndef InterlockedOr8 #define InterlockedOr8 _InterlockedOr8 #endif #define ZEND_ATOMIC_BOOL_INIT(obj, desired) ((obj)->value = (desired)) static zend_always_inline bool zend_atomic_bool_exchange_ex(zend_atomic_bool *obj, bool desired) { return InterlockedExchange8(&obj->value, desired); } /* On this platform it is non-const due to Iterlocked API*/ static zend_always_inline bool zend_atomic_bool_load_ex(zend_atomic_bool *obj) { /* Or'ing with false won't change the value. */ return InterlockedOr8(&obj->value, false); } static zend_always_inline void zend_atomic_bool_store_ex(zend_atomic_bool *obj, bool desired) { (void)InterlockedExchange8(&obj->value, desired); } #elif defined(HAVE_C11_ATOMICS) #define ZEND_ATOMIC_BOOL_INIT(obj, desired) __c11_atomic_init(&(obj)->value, (desired)) static zend_always_inline bool zend_atomic_bool_exchange_ex(zend_atomic_bool *obj, bool desired) { return __c11_atomic_exchange(&obj->value, desired, __ATOMIC_SEQ_CST); } static zend_always_inline bool zend_atomic_bool_load_ex(const zend_atomic_bool *obj) { return __c11_atomic_load(&obj->value, __ATOMIC_SEQ_CST); } static zend_always_inline void zend_atomic_bool_store_ex(zend_atomic_bool *obj, bool desired) { __c11_atomic_store(&obj->value, desired, __ATOMIC_SEQ_CST); } #elif defined(HAVE_GNUC_ATOMICS) #define ZEND_ATOMIC_BOOL_INIT(obj, desired) ((obj)->value = (desired)) static zend_always_inline bool zend_atomic_bool_exchange_ex(zend_atomic_bool *obj, bool desired) { bool prev = false; __atomic_exchange(&obj->value, &desired, &prev, __ATOMIC_SEQ_CST); return prev; } static zend_always_inline bool zend_atomic_bool_load_ex(const zend_atomic_bool *obj) { bool prev = false; __atomic_load(&obj->value, &prev, __ATOMIC_SEQ_CST); return prev; } static zend_always_inline void zend_atomic_bool_store_ex(zend_atomic_bool *obj, bool desired) { __atomic_store(&obj->value, &desired, __ATOMIC_SEQ_CST); } #elif defined(HAVE_SYNC_ATOMICS) #define ZEND_ATOMIC_BOOL_INIT(obj, desired) ((obj)->value = (desired)) static zend_always_inline bool zend_atomic_bool_exchange_ex(zend_atomic_bool *obj, bool desired) { bool prev = __sync_lock_test_and_set(&obj->value, desired); /* __sync_lock_test_and_set only does an acquire barrier, so sync * immediately after. */ __sync_synchronize(); return prev; } static zend_always_inline bool zend_atomic_bool_load_ex(zend_atomic_bool *obj) { /* Or'ing false won't change the value */ return __sync_fetch_and_or(&obj->value, false); } static zend_always_inline void zend_atomic_bool_store_ex(zend_atomic_bool *obj, bool desired) { __sync_synchronize(); obj->value = desired; __sync_synchronize(); } #elif defined(HAVE_NO_ATOMICS) #warning No atomics support detected. Please open an issue with platform details. #define ZEND_ATOMIC_BOOL_INIT(obj, desired) ((obj)->value = (desired)) static zend_always_inline void zend_atomic_bool_store_ex(zend_atomic_bool *obj, bool desired) { obj->value = desired; } static zend_always_inline bool zend_atomic_bool_load_ex(const zend_atomic_bool *obj) { return obj->value; } static zend_always_inline bool zend_atomic_bool_exchange_ex(zend_atomic_bool *obj, bool desired) { bool prev = obj->value; obj->value = desired; return prev; } #endif ZEND_API void zend_atomic_bool_init(zend_atomic_bool *obj, bool desired); ZEND_API bool zend_atomic_bool_exchange(zend_atomic_bool *obj, bool desired); ZEND_API void zend_atomic_bool_store(zend_atomic_bool *obj, bool desired); #if defined(ZEND_WIN32) || defined(HAVE_SYNC_ATOMICS) /* On these platforms it is non-const due to underlying APIs. */ ZEND_API bool zend_atomic_bool_load(zend_atomic_bool *obj); #else ZEND_API bool zend_atomic_bool_load(const zend_atomic_bool *obj); #endif END_EXTERN_C() #endif