diff options
author | Ben Johnson <benbjohnson@yahoo.com> | 2014-06-10 10:06:01 -0600 |
---|---|---|
committer | Ben Johnson <benbjohnson@yahoo.com> | 2014-06-10 10:06:01 -0600 |
commit | 5e9ce18567adb8d655073be0783d255e2bf435c1 (patch) | |
tree | fc98d16786934aafffd94d55658931d0658f8cda | |
parent | Merge pull request #187 from benbjohnson/fix-seek (diff) | |
parent | Increase max nodes per page. (diff) | |
download | dedo-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.go | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -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. |