aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Johnson <benbjohnson@yahoo.com>2014-06-10 10:06:01 -0600
committerBen Johnson <benbjohnson@yahoo.com>2014-06-10 10:06:01 -0600
commit5e9ce18567adb8d655073be0783d255e2bf435c1 (patch)
treefc98d16786934aafffd94d55658931d0658f8cda
parentMerge pull request #187 from benbjohnson/fix-seek (diff)
parentIncrease max nodes per page. (diff)
downloaddedo-5e9ce18567adb8d655073be0783d255e2bf435c1.tar.gz
dedo-5e9ce18567adb8d655073be0783d255e2bf435c1.tar.xz
Merge pull request #189 from benbjohnson/increase-max-nodes-per-page
Increase max nodes per page.
-rw-r--r--page.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/page.go b/page.go
index 78ca898..4430c3d 100644
--- a/page.go
+++ b/page.go
@@ -10,7 +10,6 @@ const pageHeaderSize = int(unsafe.Offsetof(((*page)(nil)).ptr))
const maxAllocSize = 0xFFFFFFF
const minKeysPerPage = 2
-const maxNodesPerPage = 65535
const branchPageElementSize = int(unsafe.Sizeof(branchPageElement{}))
const leafPageElementSize = int(unsafe.Sizeof(leafPageElement{}))
@@ -57,23 +56,23 @@ func (p *page) meta() *meta {
// leafPageElement retrieves the leaf node by index
func (p *page) leafPageElement(index uint16) *leafPageElement {
- n := &((*[maxNodesPerPage]leafPageElement)(unsafe.Pointer(&p.ptr)))[index]
+ n := &((*[0xFFFFFFF]leafPageElement)(unsafe.Pointer(&p.ptr)))[index]
return n
}
// leafPageElements retrieves a list of leaf nodes.
func (p *page) leafPageElements() []leafPageElement {
- return ((*[maxNodesPerPage]leafPageElement)(unsafe.Pointer(&p.ptr)))[:]
+ return ((*[0xFFFFFFF]leafPageElement)(unsafe.Pointer(&p.ptr)))[:]
}
// branchPageElement retrieves the branch node by index
func (p *page) branchPageElement(index uint16) *branchPageElement {
- return &((*[maxNodesPerPage]branchPageElement)(unsafe.Pointer(&p.ptr)))[index]
+ return &((*[0xFFFFFFF]branchPageElement)(unsafe.Pointer(&p.ptr)))[index]
}
// branchPageElements retrieves a list of branch nodes.
func (p *page) branchPageElements() []branchPageElement {
- return ((*[maxNodesPerPage]branchPageElement)(unsafe.Pointer(&p.ptr)))[:]
+ return ((*[0xFFFFFFF]branchPageElement)(unsafe.Pointer(&p.ptr)))[:]
}
// dump writes n bytes of the page to STDERR as hex output.