mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-10 02:54:12 +08:00
mdbx: make API compatible to the master branch.
Change-Id: I95c5db639cebe4bba9c600f97c9966082bc9bc09
This commit is contained in:
parent
ba00b597a7
commit
64f6648d0c
2
mdbx.h
2
mdbx.h
@ -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 */
|
||||
|
20
src/mdbx.c
20
src/mdbx.c
@ -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 */
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user