mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-04 18:34:12 +08:00
mdbx: дополнительный static_assert для контроля выравнивания 64-битного atomic-типа.
This commit is contained in:
parent
ff6674b377
commit
5561cec9c5
@ -835,6 +835,9 @@ atomic_store64(MDBX_atomic_uint64_t *p, const uint64_t value,
|
|||||||
enum MDBX_memory_order order) {
|
enum MDBX_memory_order order) {
|
||||||
STATIC_ASSERT(sizeof(MDBX_atomic_uint64_t) == 8);
|
STATIC_ASSERT(sizeof(MDBX_atomic_uint64_t) == 8);
|
||||||
#if MDBX_64BIT_ATOMIC
|
#if MDBX_64BIT_ATOMIC
|
||||||
|
#if __GNUC_PREREQ(11, 0)
|
||||||
|
STATIC_ASSERT(__alignof__(MDBX_atomic_uint64_t) >= sizeof(uint64_t));
|
||||||
|
#endif /* GNU C >= 11 */
|
||||||
#ifdef MDBX_HAVE_C11ATOMICS
|
#ifdef MDBX_HAVE_C11ATOMICS
|
||||||
assert(atomic_is_lock_free(MDBX_c11a_rw(uint64_t, p)));
|
assert(atomic_is_lock_free(MDBX_c11a_rw(uint64_t, p)));
|
||||||
atomic_store_explicit(MDBX_c11a_rw(uint64_t, p), value, mo_c11_store(order));
|
atomic_store_explicit(MDBX_c11a_rw(uint64_t, p), value, mo_c11_store(order));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user