mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-02 00:24:13 +08:00
mdbx: проверка атомарности C11-операций c 32/64-битными данными.
This commit is contained in:
parent
e46ca81abd
commit
22a84d656b
13
src/core.c
13
src/core.c
@ -11791,6 +11791,19 @@ __cold int mdbx_env_create(MDBX_env **penv) {
|
||||
return MDBX_EINVAL;
|
||||
*penv = nullptr;
|
||||
|
||||
#ifdef MDBX_HAVE_C11ATOMICS
|
||||
if (unlikely(!atomic_is_lock_free((const volatile uint32_t *)penv))) {
|
||||
ERROR("lock-free atomic ops for %u-bit types is required", 32);
|
||||
return MDBX_INCOMPATIBLE;
|
||||
}
|
||||
#if MDBX_64BIT_ATOMIC
|
||||
if (unlikely(!atomic_is_lock_free((const volatile uint64_t *)penv))) {
|
||||
ERROR("lock-free atomic ops for %u-bit types is required", 64);
|
||||
return MDBX_INCOMPATIBLE;
|
||||
}
|
||||
#endif /* MDBX_64BIT_ATOMIC */
|
||||
#endif /* MDBX_HAVE_C11ATOMICS */
|
||||
|
||||
const size_t os_psize = osal_syspagesize();
|
||||
if (unlikely(!is_powerof2(os_psize) || os_psize < MIN_PAGESIZE)) {
|
||||
ERROR("unsuitable system pagesize %" PRIuPTR, os_psize);
|
||||
|
Loading…
x
Reference in New Issue
Block a user