# HG changeset patch # User Geoff Voelker # Date 831796705 0 # Node ID 01588278fcebd848a555472b6bc1902889f9eab3 # Parent 5be55ce2c9facb7879ef9303a0adb73e7a1cfe58 (allocate_heap): Bump heap base up to 27MB to wsatisfy Win95. diff -r 5be55ce2c9fa -r 01588278fceb src/w32heap.c --- a/src/w32heap.c Sat May 11 00:29:46 1996 +0000 +++ b/src/w32heap.c Sat May 11 06:38:25 1996 +0000 @@ -131,20 +131,31 @@ size could be roughly double, so if we allow 4MB for the executable we will have plenty of room for expansion. - Thus we set the malloc heap base to 20MB. Since Emacs now leaves + Thus we would like to set the malloc heap base to 20MB. However, + Win95 refuses to allocate the heap starting at this address, so we + set the base to 27MB to make it happy. Since Emacs now leaves 28 bits available for pointers, this lets us use the remainder of - the region below the 256MB line for our malloc arena - 236MB is - still a pretty decent arena to play in! */ + the region below the 256MB line for our malloc arena - 229MB is + still a pretty decent arena to play in! */ - unsigned long base = 0x01400000; /* 20MB */ + unsigned long base = 0x01B00000; /* 27MB */ unsigned long end = 1 << VALBITS; /* 256MB */ - - reserved_heap_size = end - base; + void *ptr = NULL; - return VirtualAlloc ((void *) base, - get_reserved_heap_size (), - MEM_RESERVE, - PAGE_NOACCESS); +#ifdef NTHEAP_PROBE_BASE + while (!ptr && (base < end)) + { +#endif + reserved_heap_size = end - base; + ptr = VirtualAlloc ((void *) base, + get_reserved_heap_size (), + MEM_RESERVE, + PAGE_NOACCESS); +#ifdef NTHEAP_PROBE_BASE + base += 0x00100000; /* 1MB increment */ + } +#endif + return ptr; }