[Bug 20331] VirtualAlloc() should allocate addresses low to high

wine-bugs at winehq.org wine-bugs at winehq.org
Mon Oct 12 06:22:30 CDT 2009


http://bugs.winehq.org/show_bug.cgi?id=20331





--- Comment #4 from ray at pobox.co.uk  2009-10-12 06:22:30 ---
(In reply to comment #1)
> Low addresses are returned until we run out of low address space. After that we
> use the system default policy. If your app really depends on this (why?) you'd
> have to tweak the linux kernel policy.

What is "low address space" ?  Hi guess is addresses < 0x80000000.

I have attached the full save from Linux and looking at the end you will see:

292    0x68630000     0x68A30000     0x00400000       4.00MB        0.14%    
0.005
293    0x68220000     0x68620000     0x00400000       4.00MB        0.14%    
0.005
294    0xB7FD0000     0xBF7D0000     0x07800000     120.00MB        4.07%    
0.005

Total  0x02B80000     0xBF7D0000     0xB8400000       2.88GB     124.00MB    
1.486

which shows low addresses at the end, but why is entry 295 0xB7FD0000 at the
end ?

If you look at the attached results from a Windows XP system you will see that
the addresses increse all the time.  The panel is working out which parts of
the virtual address space is available.  Because Wine does not operate the same
as Windows my code does not work.  Looking at
http://www.microsoft.com/whdc/system/platform/server/PAE/PAEdrv.mspx I found:
Test using the MEM_TOP_DOWN registry setting
This forces all allocations for memory to be allocated from the top down,
instead of the normal bottom up.
Set HKLM\System\CurrentControlSet\Control\Session Manager\Memory
Management\AllocationPreference REG_DWORD = 0x100000
which confirms that by default low addresses should be allocated before high
addresses.

I could change SIV to try and work-a-round this, but feel this is an incorrrect
solution given the fact that Wine should return low addresses before high
addresses.  I also feel having to change the Linux kernel is inappropiate.  I
feel Wine would tell Linux to allocate low to high.

-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list