Michael Ost most@museresearch.com writes:
Yep, it does. Give it a try. As far as I can tell:
int total = 0; for (;;) { LPVOID* leak = ::VirtualAlloc(NULL, 1048576, MEM_RESERVE, PROT_NOACCESS); if (leak) { total += 1048576/1024; printf("Allocated %ldk\r", total); } else { printf("\n"); PrintWindowsError("VirtualAlloc", ::GetLastError(); break; } }
will stop at 1,022,976k (1GB) on any wine machine. In winxp it goes up to 2GB, as it ought to.
That's a kernel limitation. If you hack the kernel to start allocating from lower addresses (or implement the syscall we discussed to let us specify the mmap range) you can get the full 2GB.