mdbx: introduce MDBX_PGL_LIMIT.

Change-Id: Ifab1156ec22fb0908284298393f52c09c0731829
This commit is contained in:
Leonid Yuriev
2020-12-01 20:20:29 +03:00
parent 4cd08f0ef9
commit 0b62453f6d
4 changed files with 27 additions and 28 deletions

View File

@@ -628,9 +628,11 @@ typedef struct MDBX_lockinfo {
#define MAX_MAPSIZE MAX_MAPSIZE64
#define MDBX_READERS_LIMIT \
((65536 - sizeof(MDBX_lockinfo)) / sizeof(MDBX_reader))
#define MDBX_PGL_LIMIT MAX_PAGENO
#else
#define MDBX_READERS_LIMIT 1024
#define MAX_MAPSIZE MAX_MAPSIZE32
#define MDBX_PGL_LIMIT (MAX_MAPSIZE32 / MIN_PAGESIZE)
#endif /* MDBX_WORDBITS */
/*----------------------------------------------------------------------------*/
@@ -677,13 +679,9 @@ typedef MDBX_DP *MDBX_DPL;
(MDBX_PNL_GRANULATE - 2 - MDBX_ASSUME_MALLOC_OVERHEAD / sizeof(pgno_t))
#if MDBX_HUGE_TRANSACTIONS
#define MDBX_PNL_MAX \
((1u << 26) - 2 - MDBX_ASSUME_MALLOC_OVERHEAD / sizeof(pgno_t))
#define MDBX_DPL_TXNFULL (MDBX_PNL_MAX / 2)
#define MDBX_DPL_TXNFULL (MDBX_PGL_LIMIT / 8)
#else
#define MDBX_PNL_MAX \
((1u << 24) - 2 - MDBX_ASSUME_MALLOC_OVERHEAD / sizeof(pgno_t))
#define MDBX_DPL_TXNFULL (MDBX_PNL_MAX / 4)
#define MDBX_DPL_TXNFULL (MDBX_PGL_LIMIT / 256)
#endif /* MDBX_HUGE_TRANSACTIONS */
#define MDBX_TXL_GRANULATE 32