https://bugs.winehq.org/show_bug.cgi?id=37355
--- Comment #24 from Richard Yao ryao@gentoo.org --- (In reply to dereklesho52 from comment #23)
(In reply to Richard Yao from comment #20)
The handler now does mmap() the anonymous file into the correct position while calling unmap() on the previous mapping.
Can you elaborate on this, would we have use shared memory for the entire process heap?
It depends on which of the two approaches are used:
1. For the first approach that I suggested, no. Wine would be leaning on the OS heavily here, but we will need to keep track of what was mapped via this call where and any use of mmap that affects what has been mapped to ensure that we don’t unshare regions or map incorrect regions (e.g. something we thought was mapped is not mapped anymore and we are mapping the stale version).
2. For the second approach, yes. Wine would be reimplementing the kernel’s memory management in userspace such that it would have its own implementation. Ensuring correctness here seems easier, at the expense of going through the wineserver for every memory allocation where the kernel is invoked.