Closed ChrisHines closed 7 years ago
@suyash (or anyone else who may wish to work on this) - the Windows equivalent of the mmap(2) POSIX APIs can be seen in the core PCP libpcp library pmMemoryMap and pmMemoryUnmap functions: https://github.com/performancecopilot/pcp/blob/master/src/libpcp/src/win32.c
I'd like to work on this. We can use the sys
package (https://github.com/golang/sys), along with conditional compilation to avoid a runtime check for the OS. We should also enable builds on AppVeyor.
@saurvs vendoring x/sys
might not be necessary, go ships with syscall.CreateFileMapping
on windows. The only thing to consider here is if we want to do the work ourselves or use a simpler solution (https://github.com/edsrzf/mmap-go, https://github.com/edsrzf/mmap-go/blob/master/mmap_windows.go#L25-L72).
Could you add the AppVeyor configuration separately, so failures can be verified.
After looking at the source, I am leaning towards https://github.com/edsrzf/mmap-go. The unix version seems pretty minimal and compatible with our usecase, and the windows version seems pretty well designed.
Fixed in #41