More On Solaris ADDRESS_SPACE_LIMIT

Alexandre Julliard julliard at winehq.com
Sun Jan 5 20:41:40 CST 2003


Robert Lunnon <bob at yarrabee.net.au> writes:

> In dlls/ntdlls/virtual.c around line 1033 in NtAllocateVirtualMemory:
> 
> NTSTATUS res=anon_mmap_aligned( &base, size,VIRTUAL_GetUnixProt( vprot ), 0 );
>             if (res) return res;
> 
> Why is mmap used here rather than just a malloc/calloc to the OS ? If I can 
> convert this call to a calloc then the ADDRESS_SPACE_LIMIT test will pass on 
> Solaris.

No, you need an mmap. What you have to do is write a routine that
allocates (with mmap) all available memory above ADDRESS_SPACE_LIMIT
to make sure following mmap calls can't allocate there; and that
routine can then be called the first time mmap returns such an
address, so that it will work for all platforms that may have that
problem.

-- 
Alexandre Julliard
julliard at winehq.com



More information about the wine-devel mailing list