Debugging Wine thoughts

Damjan Jovanovic damjan.jov at
Thu Sep 11 00:44:09 CDT 2008

On Wed, Sep 10, 2008 at 8:17 PM,  <celticht32 at> wrote:

> Question :
> Why does wine have to allocate all its memory at startup? re... the issue
> that is causing the ATI drivers to have such
> a fuss....  why not just allocate as needed? or have the ability (if its not
> there already) to specify the total amount of memory
> which is available to the wine process and limit wine to just that ammount
> of memory (kind of like the way most VM machines
> have the option of setting the maximum amount of memory which is available).

Windows applications assume a certain memory layout, which sometimes
conflicts with what *nix does.

For example applications don't expect to see pointers into the upper
1-2 GB of the 4 GB virtual memory address space because on Windows the
kernel's memory is mapped there. But, could load
libraries there, including libraries hosting Wine's DLLs, and pointers
to memory in those would leak into the Windows code. So Wine prevents
the "special" areas of Windows memory from being used by *nix
libraries and functions like malloc() by mmap()ing that memory in

In my opinion, it would be better if we used a custom dynamic linker
(ie. an that could control where all libraries get loaded
so we wouldn't have to steal memory in advance and go through one of
the most elaborate startup processes in existence, where an assembly
_start routine in wine-preloader loads before and then
pretends to be the kernel.

Damjan Jovanovic

More information about the wine-devel mailing list