diff options
| author | Geoff Voelker | 1996-05-11 06:38:25 +0000 |
|---|---|---|
| committer | Geoff Voelker | 1996-05-11 06:38:25 +0000 |
| commit | 709fd16b8e32703a9540c51cdd089e368a18c22a (patch) | |
| tree | c421728fbbe2fc05742b4a5c5c78098fb14257ae /src | |
| parent | f885e95c761af1f4aee365b9ef2cadef14e6c830 (diff) | |
| download | emacs-709fd16b8e32703a9540c51cdd089e368a18c22a.tar.gz emacs-709fd16b8e32703a9540c51cdd089e368a18c22a.zip | |
(allocate_heap): Bump heap base up to 27MB to
wsatisfy Win95.
Diffstat (limited to 'src')
| -rw-r--r-- | src/w32heap.c | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/src/w32heap.c b/src/w32heap.c index 28d44e54b21..776f857f3a5 100644 --- a/src/w32heap.c +++ b/src/w32heap.c | |||
| @@ -131,20 +131,31 @@ allocate_heap (void) | |||
| 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 */ |
| 143 | void *ptr = NULL; | ||
| 141 | 144 | ||
| 142 | reserved_heap_size = end - base; | 145 | #ifdef NTHEAP_PROBE_BASE |
| 143 | 146 | while (!ptr && (base < end)) | |
| 144 | return VirtualAlloc ((void *) base, | 147 | { |
| 145 | get_reserved_heap_size (), | 148 | #endif |
| 146 | MEM_RESERVE, | 149 | reserved_heap_size = end - base; |
| 147 | PAGE_NOACCESS); | 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 | ||