mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-30 22:47:16 +08:00
mdbx: add MDBX_MIN_PAGESIZE & MDBX_MAX_PAGESIZE.
Change-Id: I66ba4b637ed5acabb734bbd380e618e01019ade2
This commit is contained in:
parent
fc4f5ffa45
commit
be72cd81dc
17
mdbx.h
17
mdbx.h
@ -892,6 +892,16 @@ LIBMDBX_API int mdbx_env_set_geometry(MDBX_env *env, intptr_t size_lower,
|
|||||||
intptr_t growth_step,
|
intptr_t growth_step,
|
||||||
intptr_t shrink_threshold,
|
intptr_t shrink_threshold,
|
||||||
intptr_t pagesize);
|
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.
|
/* 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,
|
LIBMDBX_API int mdbx_dbi_sequence(MDBX_txn *txn, MDBX_dbi dbi, uint64_t *result,
|
||||||
uint64_t increment);
|
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 */
|
/* attribute support functions for Nexenta */
|
||||||
typedef uint_fast64_t mdbx_attr_t;
|
typedef uint_fast64_t mdbx_attr_t;
|
||||||
|
@ -14520,10 +14520,6 @@ __cold intptr_t mdbx_limits_keysize_max(intptr_t pagesize) {
|
|||||||
return mdbx_maxkey(mdbx_nodemax(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) {
|
__cold intptr_t mdbx_limits_dbsize_min(intptr_t pagesize) {
|
||||||
if (pagesize < 1)
|
if (pagesize < 1)
|
||||||
pagesize = (intptr_t)mdbx_syspagesize();
|
pagesize = (intptr_t)mdbx_syspagesize();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user