Commit be851994 authored by Mark Florisson's avatar Mark Florisson

Use Py_intptr_t to check alignment

parent a03a562d
...@@ -81,26 +81,8 @@ typedef volatile __pyx_atomic_int_type __pyx_atomic_int; ...@@ -81,26 +81,8 @@ typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
////////// Atomics ////////// ////////// Atomics //////////
#if CYTHON_ATOMICS #if CYTHON_ATOMICS
#define __pyx_check_unaligned(type, pointer) \ #define __pyx_atomic_unaligned(pointer) \
(((type) pointer) & (sizeof(pointer) - 1)) (((Py_intptr_t) pointer) & (sizeof(pointer) - 1))
static CYTHON_INLINE int
__pyx_atomic_unaligned(__pyx_atomic_int *p)
{
/* uintptr_t is optional in C99, try other stuff */
if (sizeof(unsigned long) >= sizeof(p))
return __pyx_check_unaligned(unsigned long, p);
else if (sizeof(size_t) >= sizeof(p))
return __pyx_check_unaligned(size_t, p);
#if __STDC_VERSION__ >= 199901L
if (sizeof(unsigned long long) >= sizeof(p))
return __pyx_check_unaligned(unsigned long long, p);
#endif
return 1;
}
static CYTHON_INLINE __pyx_atomic_int_type static CYTHON_INLINE __pyx_atomic_int_type
__pyx_atomic_incr_maybealigned(__pyx_atomic_int *value, PyThread_type_lock lock) __pyx_atomic_incr_maybealigned(__pyx_atomic_int *value, PyThread_type_lock lock)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment