aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Johnson <benbjohnson@yahoo.com>2015-02-26 16:01:58 -0700
committerBen Johnson <benbjohnson@yahoo.com>2015-02-26 16:01:58 -0700
commitb9c28b721ad8186bdcde91c8731ed87d65c6554d (patch)
treef79af8a9b160a7041bcb0117d373ea5742b83508
parentMerge pull request #314 from vdemario/fix_typo_readme (diff)
downloaddedo-b9c28b721ad8186bdcde91c8731ed87d65c6554d.tar.gz
dedo-b9c28b721ad8186bdcde91c8731ed87d65c6554d.tar.xz
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.
-rw-r--r--page.go2
1 files changed, 1 insertions, 1 deletions
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{}))