diff --git a/src/bits.h b/src/bits.h index e80b7973..8776ecec 100644 --- a/src/bits.h +++ b/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)