diff options
author | Ben Johnson <benbjohnson@yahoo.com> | 2014-02-11 09:56:36 -0700 |
---|---|---|
committer | Ben Johnson <benbjohnson@yahoo.com> | 2014-02-11 09:56:36 -0700 |
commit | e1e683b97ef11a62692b20bf535815dbf204e13a (patch) | |
tree | c696f61c0e7cf9905bb81ec7a099c22349e6c532 /node.go | |
parent | Merge pull request #20 from benbjohnson/freelist (diff) | |
parent | Cursor iteration. (diff) | |
download | dedo-e1e683b97ef11a62692b20bf535815dbf204e13a.tar.gz dedo-e1e683b97ef11a62692b20bf535815dbf204e13a.tar.xz |
Merge pull request #21 from benbjohnson/cursor
Cursor iteration.
Diffstat (limited to 'node.go')
-rw-r--r-- | node.go | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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. |