mdbx: treat pagesize == 0/INTPTR_MAX as aliases for MIN_PAGESIZE/MAX_PAGESIZE.

This commit is contained in:
Leo Yuriev 2019-03-05 17:55:33 +03:00
parent 3535e7a6d6
commit ee899a21ed

View File

@ -5723,6 +5723,11 @@ LIBMDBX_API int mdbx_env_set_geometry(MDBX_env *env, intptr_t size_lower,
}
}
if (pagesize == 0)
pagesize = MIN_PAGESIZE;
else if (pagesize == INTPTR_MAX)
pagesize = MAX_PAGESIZE;
if (pagesize < (intptr_t)MIN_PAGESIZE || pagesize > (intptr_t)MAX_PAGESIZE ||
!mdbx_is_power2(pagesize)) {
rc = MDBX_EINVAL;