Closed
Description
There are a few issues with the current mmap implementation for Windows.
- The file mapping handle can be closed right after calling
MapViewOfFile
. There's no need to keep it in a map. - On 32-bit systems, with large files,
MapViewOfFile
may return a partial mapping. TheVirtualQuery
should be called on the returned address to determine the actual size of the mapping, and return an error if the mapping is incomplete. See https://github.com/golang/go/blob/master/src/cmd/go/internal/mmap/mmap_windows.go. - The mapping is opened with read-only access. No need to call
FlushViewOfFile
at all.
I can open a PR to address these issues, if you are OK with it.
These changes would be essentially a rewrite of mmap_windows.go
, so the special license can be removed as well.
Metadata
Metadata
Assignees
Labels
No labels