From 4124bc76a32c25fb5b92b9696d67357bc71f9785 Mon Sep 17 00:00:00 2001 From: Matt Jaffee Date: Fri, 29 Jun 2018 07:18:26 -0500 Subject: [PATCH] define map size separately for 32 and 64 bit systems --- translate.go | 2 -- translate_mapsize_386.go | 5 +++++ translate_mapsize_all64bitsystems.go | 8 ++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 translate_mapsize_386.go create mode 100644 translate_mapsize_all64bitsystems.go diff --git a/translate.go b/translate.go index 7c716640b..d624eb2d5 100644 --- a/translate.go +++ b/translate.go @@ -25,8 +25,6 @@ const ( ) const ( - DefaultMapSize = 10 * (1 << 30) // 10GB - DefaultReplicationRetryInterval = 1 * time.Second ) diff --git a/translate_mapsize_386.go b/translate_mapsize_386.go new file mode 100644 index 000000000..b8beafa13 --- /dev/null +++ b/translate_mapsize_386.go @@ -0,0 +1,5 @@ +package pilosa + +// DefaultMapSize is the default size of mapped memory for the translate store. +// It is passed as an int to syscall.Mmap and so must be < 2^31 +const DefaultMapSize = (1 << 31) - 1 // 2GB diff --git a/translate_mapsize_all64bitsystems.go b/translate_mapsize_all64bitsystems.go new file mode 100644 index 000000000..5275c6ec5 --- /dev/null +++ b/translate_mapsize_all64bitsystems.go @@ -0,0 +1,8 @@ +// +build !386 + +package pilosa + +// DefaultMapSize is the default size of mapped memory for the translate store. +// It is passed as an int to syscall.Mmap and so can only be larger than 2^31 on +// 64bit systems. +const DefaultMapSize = 10 * (1 << 30) // 10GB