aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/w32heap.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/w32heap.c b/src/w32heap.c
index 776f857f3a5..6847b9345c7 100644
--- a/src/w32heap.c
+++ b/src/w32heap.c
@@ -142,19 +142,25 @@ allocate_heap (void)
142 unsigned long end = 1 << VALBITS; /* 256MB */ 142 unsigned long end = 1 << VALBITS; /* 256MB */
143 void *ptr = NULL; 143 void *ptr = NULL;
144 144
145#ifdef NTHEAP_PROBE_BASE 145#if NTHEAP_PROBE_BASE /* This is never normally defined */
146 /* Try various addresses looking for one the kernel will let us have. */
146 while (!ptr && (base < end)) 147 while (!ptr && (base < end))
147 { 148 {
148#endif
149 reserved_heap_size = end - base; 149 reserved_heap_size = end - base;
150 ptr = VirtualAlloc ((void *) base, 150 ptr = VirtualAlloc ((void *) base,
151 get_reserved_heap_size (), 151 get_reserved_heap_size (),
152 MEM_RESERVE, 152 MEM_RESERVE,
153 PAGE_NOACCESS); 153 PAGE_NOACCESS);
154#ifdef NTHEAP_PROBE_BASE
155 base += 0x00100000; /* 1MB increment */ 154 base += 0x00100000; /* 1MB increment */
156 } 155 }
156#else
157 reserved_heap_size = end - base;
158 ptr = VirtualAlloc ((void *) base,
159 get_reserved_heap_size (),
160 MEM_RESERVE,
161 PAGE_NOACCESS);
157#endif 162#endif
163
158 return ptr; 164 return ptr;
159} 165}
160 166