Problems with VirtualAlloc/Lock

Michael Ost most at
Tue Mar 15 13:04:11 CST 2005

On Tue, 2005-03-15 at 01:09, Alexandre Julliard wrote:
> Michael Ost <most at> writes:
> > 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.

Could you point me to the kernel limitation? I can mmap() 2GB on an
unhacked 2.4.19 kernel with this loop:

int total = 0;
for (;;) {
  void* leak = mmap(0, 1048576, PROT_READ | PROT_WRITE, 
    MAP_PRIVATE | MAP_ANON, -1, 0);
  if (leak) {
    total += 1048576/1024;
    printf("Allocated %ldk\r", total);
  else {

- mo

PS: When building this loop, I tried to copy the behavior of
wine_anon_mmap from libs/wine/mmap.c. But frankly I am new to mmap() and
wine memory management. So maybe I am missing something...?

More information about the wine-devel mailing list