Skip to content
This repository was archived by the owner on Aug 13, 2019. It is now read-only.

Commit 659ed64

Browse files
authored
Merge pull request #302 from Gouthamve/fix-prom-3957
Add architecture specific map sizes
2 parents 902e1ff + 6e5164f commit 659ed64

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

fileutil/mmap_386.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// +build windows
2+
3+
package fileutil
4+
5+
const maxMapSize = 0x7FFFFFFF // 2GB

fileutil/mmap_amd64.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// +build windows
2+
3+
package fileutil
4+
5+
const maxMapSize = 0xFFFFFFFFFFFF // 256TB

fileutil/mmap_windows.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ import (
1919
"unsafe"
2020
)
2121

22-
const maxMapSize = 0xFFFFFFFFFFFF // 256TB
23-
2422
func mmap(f *os.File, size int) ([]byte, error) {
2523
low, high := uint32(size), uint32(size>>32)
2624
h, errno := syscall.CreateFileMapping(syscall.Handle(f.Fd()), nil, syscall.PAGE_READONLY, high, low, nil)

0 commit comments

Comments
 (0)