mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-30 16:02:05 +08:00
mdbx: fix MAX_MAPSIZE for Win32.
Change-Id: I04cbffb14ab7c73d935614b2f5c8140000b78d76
This commit is contained in:
parent
edc936dc28
commit
f93818a926
15
src/bits.h
15
src/bits.h
@ -345,11 +345,16 @@ typedef struct MDBX_page {
|
||||
#define MIN_PAGESIZE 512u
|
||||
|
||||
#define MIN_MAPSIZE (MIN_PAGESIZE * MIN_PAGENO)
|
||||
#define MAX_MAPSIZE \
|
||||
((sizeof(size_t) < 8) \
|
||||
? UINT32_C(0x7ff80000) \
|
||||
: ((sizeof(pgno_t) > 4) ? UINT64_C(0x7fffFFFFfff80000) \
|
||||
: MAX_PAGENO * (uint64_t)MAX_PAGESIZE))
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
#define MAX_MAPSIZE32 UINT32_C(0x38000000)
|
||||
#else
|
||||
#define MAX_MAPSIZE32 UINT32_C(0x7ff80000)
|
||||
#endif
|
||||
#define MAX_MAPSIZE64 \
|
||||
((sizeof(pgno_t) > 4) ? UINT64_C(0x7fffFFFFfff80000) \
|
||||
: MAX_PAGENO * (uint64_t)MAX_PAGESIZE)
|
||||
|
||||
#define MAX_MAPSIZE ((sizeof(size_t) < 8) ? MAX_MAPSIZE32 : MAX_MAPSIZE64)
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user