Cygwin: Allow accessing 48 bit address space in Windows 8.1 or later

64 bit Windows started out with a 44 bit address space due to a
restriction of the AMD64 CPUs at the time.  Starting with Windows
8.1, these CPUs are not supported anymore and Windows switched to
the full 48 bit address space supported by AMD64.

Cygwin didn't follow suit yet so mmaps are still restricted to
the lower 44 bit address space.  Fix that by using a system-specific
upper address for mmap allocations, 44 bit up to Windows 8, 48 bit
starting with Windows 8.1.

While at it, move the heap by another 8 Gigs to leave some space
for a potential extension of DLL address space, and restrict the
mmap lower address so the heap can grow to 32 Gigs before colliding
with mmaps.
This commit is contained in:
Corinna Vinschen
2019-06-04 16:58:53 +02:00
parent f03ea8e1c5
commit e1254add73
4 changed files with 20 additions and 5 deletions

View File

@@ -12,6 +12,7 @@ details. */
struct wincaps
{
DWORD def_guard_pages;
int64_t mmap_storage_high;
/* The bitfields must be 8 byte aligned on x86_64, otherwise the bitfield
ops generated by gcc are off by 4 bytes. */
struct __attribute__ ((aligned (8))) {
@@ -71,6 +72,9 @@ public:
{
return ((wincaps *) this->caps)->def_guard_pages * page_size ();
}
#ifdef __x86_64__
intptr_t IMPLEMENT (mmap_storage_high)
#endif
bool IMPLEMENT (is_server)
bool IMPLEMENT (needs_count_in_si_lpres2)
bool IMPLEMENT (needs_query_information)