mdbx: make API compatible to the master branch.

Change-Id: I95c5db639cebe4bba9c600f97c9966082bc9bc09
This commit is contained in:
Leo Yuriev 2019-02-03 12:47:56 +03:00
parent ba00b597a7
commit 64f6648d0c
2 changed files with 14 additions and 8 deletions

2
mdbx.h
View File

@ -1683,6 +1683,8 @@ LIBMDBX_API int mdbx_limits_pgsize_min(void);
LIBMDBX_API int mdbx_limits_pgsize_max(void);
LIBMDBX_API intptr_t mdbx_limits_dbsize_min(intptr_t pagesize);
LIBMDBX_API intptr_t mdbx_limits_dbsize_max(intptr_t pagesize);
LIBMDBX_API intptr_t mdbx_limits_keysize_max(intptr_t pagesize);
LIBMDBX_API intptr_t mdbx_limits_txnsize_max(intptr_t pagesize);
/*----------------------------------------------------------------------------*/
/* attribute support functions for Nexenta */

View File

@ -5037,14 +5037,7 @@ int __cold mdbx_env_get_maxkeysize(MDBX_env *env) {
(((pagesize)-PAGEHDRSZ) / sizeof(pgno_t) - 1)
int mdbx_get_maxkeysize(intptr_t pagesize) {
if (pagesize < 1)
pagesize = (intptr_t)mdbx_syspagesize();
else if (unlikely(pagesize < (intptr_t)MIN_PAGESIZE ||
pagesize > (intptr_t)MAX_PAGESIZE ||
!mdbx_is_power2((size_t)pagesize)))
return -MDBX_EINVAL;
return mdbx_maxkey(mdbx_nodemax(pagesize));
return (int)mdbx_limits_keysize_max(pagesize);
}
static void __cold mdbx_setup_pagesize(MDBX_env *env, const size_t pagesize) {
@ -12540,6 +12533,17 @@ __cold intptr_t mdbx_limits_dbsize_max(intptr_t pagesize) {
: (intptr_t)MAX_MAPSIZE;
}
__cold intptr_t mdbx_limits_txnsize_max(intptr_t pagesize) {
if (pagesize < 1)
pagesize = (intptr_t)mdbx_syspagesize();
else if (unlikely(pagesize < (intptr_t)MIN_PAGESIZE ||
pagesize > (intptr_t)MAX_PAGESIZE ||
!mdbx_is_power2((size_t)pagesize)))
return (MDBX_EINVAL > 0) ? -MDBX_EINVAL : MDBX_EINVAL;
return pagesize * (MDBX_PNL_UM_SIZE - 1);
}
/*----------------------------------------------------------------------------*/
/* attribute support functions for Nexenta */