aboutsummaryrefslogtreecommitdiff
path: root/node.go
diff options
context:
space:
mode:
authorBen Johnson <benbjohnson@yahoo.com>2014-02-11 08:41:22 -0700
committerBen Johnson <benbjohnson@yahoo.com>2014-02-11 09:07:07 -0700
commitb8122bf568813a975caa365fe51cd2a4e5c1c578 (patch)
tree1892b36889754c39e3d451045e0dc6003a31dbff /node.go
parentMerge pull request #20 from benbjohnson/freelist (diff)
downloaddedo-b8122bf568813a975caa365fe51cd2a4e5c1c578.tar.gz
dedo-b8122bf568813a975caa365fe51cd2a4e5c1c578.tar.xz
Cursor iteration.
Diffstat (limited to 'node.go')
-rw-r--r--node.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/node.go b/node.go
index ad31f5b..11b5e2f 100644
--- a/node.go
+++ b/node.go
@@ -161,8 +161,10 @@ func (n *node) write(p *page) {
// Initialize page.
if n.isLeaf {
p.flags |= p_leaf
+ // warn("∑", p.id, "leaf")
} else {
p.flags |= p_branch
+ // warn("∑", p.id, "branch")
}
p.count = uint16(len(n.inodes))
@@ -175,11 +177,13 @@ func (n *node) write(p *page) {
elem.pos = uint32(uintptr(unsafe.Pointer(&b[0])) - uintptr(unsafe.Pointer(elem)))
elem.ksize = uint32(len(item.key))
elem.vsize = uint32(len(item.value))
+ // warn(" »", string(item.key), "->", string(item.value))
} else {
elem := p.branchPageElement(uint16(i))
elem.pos = uint32(uintptr(unsafe.Pointer(&b[0])) - uintptr(unsafe.Pointer(elem)))
elem.ksize = uint32(len(item.key))
elem.pgid = item.pgid
+ // warn(" »", string(item.key))
}
// Write data for the element to the end of the page.