mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-07 17:00:19 +02:00
This matches kernel behaviour for how brk works. I initially implemented this as a way to speed up some early applications that relied heavily on brk. We're long past that time and we should match Linux behaviour instead. This fixes issues where applications (FEXLoader really) can see we've allocated a larger granule and breaks self-hosting. There's no reason to be smarter around this, if applications want more perf then they'll switch to a better allocator than brk. Also need to make sure that after the brk region has been reserved, to unmap its initial mapping to allow future mmap syscalls to overwrite it. We need to reserve it early to ensure the region initially exists and we don't accidentally map other things in that space. Then it is up to the guest if they don't want to overwrite it.