mdbx: add MDBX_MIN_PAGESIZE & MDBX_MAX_PAGESIZE.

Change-Id: I66ba4b637ed5acabb734bbd380e618e01019ade2
This commit is contained in:
Leonid Yuriev 2019-09-06 21:02:12 +03:00
parent fc4f5ffa45
commit be72cd81dc
2 changed files with 10 additions and 11 deletions

17
mdbx.h
View File

@ -892,6 +892,16 @@ LIBMDBX_API int mdbx_env_set_geometry(MDBX_env *env, intptr_t size_lower,
intptr_t growth_step,
intptr_t shrink_threshold,
intptr_t pagesize);
#define MDBX_MIN_PAGESIZE 512
__inline intptr_t mdbx_limits_pgsize_min(void) { return MDBX_MIN_PAGESIZE; }
#define MDBX_MAX_PAGESIZE 65536
__inline intptr_t mdbx_limits_pgsize_max(void) { return MDBX_MAX_PAGESIZE; }
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);
/* Set the maximum number of threads/reader slots for the environment.
*
@ -1820,13 +1830,6 @@ LIBMDBX_API int mdbx_is_dirty(const MDBX_txn *txn, const void *ptr);
LIBMDBX_API int mdbx_dbi_sequence(MDBX_txn *txn, MDBX_dbi dbi, uint64_t *result,
uint64_t increment);
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 */
typedef uint_fast64_t mdbx_attr_t;

View File

@ -14520,10 +14520,6 @@ __cold intptr_t mdbx_limits_keysize_max(intptr_t pagesize) {
return mdbx_maxkey(mdbx_nodemax(pagesize));
}
__cold int mdbx_limits_pgsize_min(void) { return MIN_PAGESIZE; }
__cold int mdbx_limits_pgsize_max(void) { return MAX_PAGESIZE; }
__cold intptr_t mdbx_limits_dbsize_min(intptr_t pagesize) {
if (pagesize < 1)
pagesize = (intptr_t)mdbx_syspagesize();