comparison src/w32heap.c @ 15208:01588278fceb

(allocate_heap): Bump heap base up to 27MB to wsatisfy Win95.
author Geoff Voelker <voelker@cs.washington.edu>
date Sat, 11 May 1996 06:38:25 +0000
parents d7d0413e95e2
children ae9888a75348
comparison
equal deleted inserted replaced
15207:5be55ce2c9fa 15208:01588278fceb
129 safety margin. At the moment, the executable has about 810KB of 129 safety margin. At the moment, the executable has about 810KB of
130 code (for x86) and about 550KB of data - on RISC platforms the code 130 code (for x86) and about 550KB of data - on RISC platforms the code
131 size could be roughly double, so if we allow 4MB for the executable 131 size could be roughly double, so if we allow 4MB for the executable
132 we will have plenty of room for expansion. 132 we will have plenty of room for expansion.
133 133
134 Thus we set the malloc heap base to 20MB. Since Emacs now leaves 134 Thus we would like to set the malloc heap base to 20MB. However,
135 Win95 refuses to allocate the heap starting at this address, so we
136 set the base to 27MB to make it happy. Since Emacs now leaves
135 28 bits available for pointers, this lets us use the remainder of 137 28 bits available for pointers, this lets us use the remainder of
136 the region below the 256MB line for our malloc arena - 236MB is 138 the region below the 256MB line for our malloc arena - 229MB is
137 still a pretty decent arena to play in! */ 139 still a pretty decent arena to play in! */
138 140
139 unsigned long base = 0x01400000; /* 20MB */ 141 unsigned long base = 0x01B00000; /* 27MB */
140 unsigned long end = 1 << VALBITS; /* 256MB */ 142 unsigned long end = 1 << VALBITS; /* 256MB */
141 143 void *ptr = NULL;
142 reserved_heap_size = end - base; 144
143 145 #ifdef NTHEAP_PROBE_BASE
144 return VirtualAlloc ((void *) base, 146 while (!ptr && (base < end))
145 get_reserved_heap_size (), 147 {
146 MEM_RESERVE, 148 #endif
147 PAGE_NOACCESS); 149 reserved_heap_size = end - base;
150 ptr = VirtualAlloc ((void *) base,
151 get_reserved_heap_size (),
152 MEM_RESERVE,
153 PAGE_NOACCESS);
154 #ifdef NTHEAP_PROBE_BASE
155 base += 0x00100000; /* 1MB increment */
156 }
157 #endif
158 return ptr;
148 } 159 }
149 160
150 161
151 /* Emulate Unix sbrk. */ 162 /* Emulate Unix sbrk. */
152 void * 163 void *