aboutsummaryrefslogtreecommitdiff
path: root/page.go
diff options
context:
space:
mode:
authorBen Johnson <benbjohnson@yahoo.com>2014-01-30 19:26:10 -0800
committerBen Johnson <benbjohnson@yahoo.com>2014-01-30 19:26:10 -0800
commitd05191d164dbab56adbb3a17a62f66a62695c6d3 (patch)
tree3f270655af94ff2dbbce62f6065d4f1c24030c71 /page.go
parentMerge pull request #2 from benbjohnson/master (diff)
parentAdd RWTransaction.write(). (diff)
downloaddedo-d05191d164dbab56adbb3a17a62f66a62695c6d3.tar.gz
dedo-d05191d164dbab56adbb3a17a62f66a62695c6d3.tar.xz
Merge pull request #3 from benbjohnson/spill
Spill to dirty pages, write to disk
Diffstat (limited to 'page.go')
-rw-r--r--page.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/page.go b/page.go
index 7129208..c18c6b4 100644
--- a/page.go
+++ b/page.go
@@ -14,7 +14,8 @@ const (
p_branch = 0x01
p_leaf = 0x02
p_meta = 0x04
- p_freelist = 0x08
+ p_sys = 0x08
+ p_freelist = 0x10
)
type pgid uint64
@@ -56,3 +57,9 @@ func (p *page) bnodes() []bnode {
func (p *page) freelist() []pgid {
return ((*[maxNodesPerPage]pgid)(unsafe.Pointer(&p.ptr)))[0:p.count]
}
+
+type pages []*page
+
+func (s pages) Len() int { return len(s) }
+func (s pages) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
+func (s pages) Less(i, j int) bool { return s[i].id < s[j].id }