mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-14 11:01:01 +02:00
This is a tricky situation that wine-preloader allocates the lower 32MB of stack space through fixed address mmap with MAP_FIXED. They can't use mmap with an address hint nor MAP_FIXED_NOREPLACE because it changes behaviour. mmap won't give you the allocation inside the stack space even if you check `/proc/self/maps` that space isn't yet allocated. The growable space of the stack blocks those allocations. So the wine peeps might be SOL if they actually require this allocation to exist. To replicate this, allocate the application stack at the same location using an address hint. This will give us the correct region on a 48-bit VA system, while also letting it select a different region on a 36-bit VA system.