mirror of
https://github.com/prometheus/prometheus.git
synced 2025-02-02 08:31:11 -08:00
Merge pull request #302 from Gouthamve/fix-prom-3957
Add architecture specific map sizes
This commit is contained in:
commit
659ed64429
5
fileutil/mmap_386.go
Normal file
5
fileutil/mmap_386.go
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
// +build windows
|
||||||
|
|
||||||
|
package fileutil
|
||||||
|
|
||||||
|
const maxMapSize = 0x7FFFFFFF // 2GB
|
5
fileutil/mmap_amd64.go
Normal file
5
fileutil/mmap_amd64.go
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
// +build windows
|
||||||
|
|
||||||
|
package fileutil
|
||||||
|
|
||||||
|
const maxMapSize = 0xFFFFFFFFFFFF // 256TB
|
|
@ -19,8 +19,6 @@ import (
|
||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
const maxMapSize = 0xFFFFFFFFFFFF // 256TB
|
|
||||||
|
|
||||||
func mmap(f *os.File, size int) ([]byte, error) {
|
func mmap(f *os.File, size int) ([]byte, error) {
|
||||||
low, high := uint32(size), uint32(size>>32)
|
low, high := uint32(size), uint32(size>>32)
|
||||||
h, errno := syscall.CreateFileMapping(syscall.Handle(f.Fd()), nil, syscall.PAGE_READONLY, high, low, nil)
|
h, errno := syscall.CreateFileMapping(syscall.Handle(f.Fd()), nil, syscall.PAGE_READONLY, high, low, nil)
|
||||||
|
|
Loading…
Reference in a new issue