Progress towards #30150.
By defining the pointer contents to only be synchronized after explicit sync points, makes it legal to have a fallback implementation based on file operations while still supporting a handful of use cases for memory mapping.
Furthermore, it makes it legal for evented I/O implementations to use evented file I/O for the sync points rather than memory mapping.
Real world use case: src/link/MappedFile.zig
It's marked a breaking change because I constrained the positional file reading and writing error sets. Also on WASI, you now get error.IsDir correctly instead of error.NotOpenForReading.
Followup Tasks
- update src/link/MappedFile.zig in the compiler to use this
- audit the remaining calls to posix.mmap
- handle populate=true on windows using NtSetInformationVirtualMemory with the info class as VmPrefetchInformation
- investigate use of NtExtendSection
Progress towards #30150.
By defining the pointer contents to only be synchronized after explicit sync points, makes it legal to have a fallback implementation based on file operations while still supporting a handful of use cases for memory mapping.
Furthermore, it makes it legal for evented I/O implementations to use evented file I/O for the sync points rather than memory mapping.
Real world use case: src/link/MappedFile.zig
It's marked a breaking change because I constrained the positional file reading and writing error sets. Also on WASI, you now get `error.IsDir` correctly instead of `error.NotOpenForReading`.
## Followup Tasks
* update src/link/MappedFile.zig in the compiler to use this
* audit the remaining calls to posix.mmap
* handle populate=true on windows using NtSetInformationVirtualMemory with the info class as VmPrefetchInformation
* investigate use of NtExtendSection