Mercurial > hg > xemacs-beta
comparison src/ntheap.c @ 647:b39c14581166
[xemacs-hg @ 2001-08-13 04:45:47 by ben]
removal of unsigned, size_t, etc.
author | ben |
---|---|
date | Mon, 13 Aug 2001 04:46:48 +0000 |
parents | abe6d1db359e |
children | a307f9a2021d |
comparison
equal
deleted
inserted
replaced
646:00c54252fe4f | 647:b39c14581166 |
---|---|
235 void *tmp; | 235 void *tmp; |
236 MEMORY_BASIC_INFORMATION info; | 236 MEMORY_BASIC_INFORMATION info; |
237 DWORD size; | 237 DWORD size; |
238 unsigned char* base = get_heap_end (); | 238 unsigned char* base = get_heap_end (); |
239 unsigned char* end = base + get_reserved_heap_size () - get_committed_heap_size (); | 239 unsigned char* end = base + get_reserved_heap_size () - get_committed_heap_size (); |
240 VirtualQuery (base, &info, sizeof info); | 240 VirtualQuery (base, &info, sizeof (info)); |
241 if (info.State != MEM_FREE) | 241 if (info.State != MEM_FREE) |
242 { | 242 { |
243 /* Oops, something has already reserved or commited it, nothing we can do but exit */ | 243 /* Oops, something has already reserved or commited it, nothing we can do but exit */ |
244 char buf[256]; | 244 char buf[256]; |
245 wsprintf(buf, | 245 wsprintf(buf, |
251 MessageBox(NULL, buf, "XEmacs", MB_OK | MB_ICONSTOP); | 251 MessageBox(NULL, buf, "XEmacs", MB_OK | MB_ICONSTOP); |
252 exit(1); | 252 exit(1); |
253 } | 253 } |
254 | 254 |
255 /* Now try and reserve as much as possible */ | 255 /* Now try and reserve as much as possible */ |
256 size = min (info.RegionSize, end - base); | 256 size = min (info.RegionSize, (DWORD) (end - base)); |
257 tmp = VirtualAlloc (base, size, MEM_RESERVE, PAGE_NOACCESS); | 257 tmp = VirtualAlloc (base, size, MEM_RESERVE, PAGE_NOACCESS); |
258 if (!tmp) | 258 if (!tmp) |
259 { | 259 { |
260 /* Can't reserve it, nothing we can do but exit */ | 260 /* Can't reserve it, nothing we can do but exit */ |
261 char buf[256]; | 261 char buf[256]; |