Problems with VirtualAlloc/Lock

Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Tue Mar 15 05:07:14 CST 2005


>>>>> "Alexandre" == Alexandre Julliard <julliard at winehq.org> writes:

    Alexandre> Michael Ost <most at 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.

    Alexandre> That's a kernel limitation. If you hack the kernel to start
    Alexandre> allocating from lower addresses (or implement the syscall we
    Alexandre> discussed to let us specify the mmap range) you can get the
    Alexandre> full 2GB.

Don't we need some "non-hack" way to tell the kernel about thw desired
allocation strategy? 
-- 
Uwe Bonnes                bon at elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------



More information about the wine-devel mailing list