Removed Syscall.Mmap to use platform specific mmap

Updates lines 1794 and 2304 to use mmamp in windows or unix versions instead of Syscall.Mmap
pull/4981/head
Adarsha 2015-12-04 09:17:13 +05:30
parent c2b8a24004
commit d39d0a5c90
1 changed files with 3 additions and 3 deletions

View File

@ -14,7 +14,6 @@ import (
"sort"
"strings"
"sync"
"syscall"
"time"
"github.com/golang/snappy"
@ -1971,7 +1970,8 @@ func NewDataFile(f *os.File) (*dataFile, error) {
if err != nil {
return nil, err
}
mmap, err := syscall.Mmap(int(f.Fd()), 0, int(fInfo.Size()), syscall.PROT_READ, syscall.MAP_SHARED|MAP_POPULATE)
//mmap, err := syscall.Mmap(int(f.Fd()), 0, int(fInfo.Size()), syscall.PROT_READ, syscall.MAP_SHARED|MAP_POPULATE)
mmap, err := mmap(f, 0, int(fInfo.Size()))
if err != nil {
return nil, err
}
@ -2030,7 +2030,7 @@ func (d *dataFile) close() error {
if d.mmap == nil {
return nil
}
err := syscall.Munmap(d.mmap)
err := munmap(d.mmap)
if err != nil {
return err
}