From b9c28b721ad8186bdcde91c8731ed87d65c6554d Mon Sep 17 00:00:00 2001 From: Ben Johnson Date: Thu, 26 Feb 2015 16:01:58 -0700 Subject: [PATCH] Increase max array size to 2GB. This commit changes the maxAllocSize from 256GB to 2GB to handle large values. It was previously 0xFFFFFFF and I tried adding one more "F" but it caused an "array too large" error. I played around with the value some more and found that 0x7FFFFFFF (2GB) is the highest allowed value. This does not affect how the data is stored. It is simply used for type converting pointers to array pointers in order to utilize zero copy from the mmap. --- page.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/page.go b/page.go index b3dc473..de2e623 100644 --- a/page.go +++ b/page.go @@ -8,7 +8,7 @@ import ( const pageHeaderSize = int(unsafe.Offsetof(((*page)(nil)).ptr)) -const maxAllocSize = 0xFFFFFFF +const maxAllocSize = 0x7FFFFFFF const minKeysPerPage = 2 const branchPageElementSize = int(unsafe.Sizeof(branchPageElement{}))