mdbx: minor refine mdbx_env_set_option(MDBX_opt_sync_bytes).

This commit is contained in:
Леонид Юрьев (Leonid Yuriev) 2021-12-04 01:08:55 +03:00
parent 45a11f3dc2
commit 8ef8733ddc

View File

@ -21900,7 +21900,7 @@ __cold int mdbx_env_set_option(MDBX_env *env, const MDBX_option_t option,
return MDBX_EACCESS;
if (unlikely(!(env->me_flags & MDBX_ENV_ACTIVE)))
return MDBX_EPERM;
if (sizeof(value) > sizeof(size_t) && unlikely(value != (size_t)value))
if (unlikely(value > SIZE_MAX - 65536))
return MDBX_TOO_LARGE;
if (atomic_store32(&env->me_lck->mti_autosync_threshold,
bytes2pgno(env, (size_t)value + env->me_psize - 1),