aboutsummaryrefslogtreecommitdiff
path: root/page.go
diff options
context:
space:
mode:
authorBen Johnson <benbjohnson@yahoo.com>2014-05-19 12:08:33 -0600
committerBen Johnson <benbjohnson@yahoo.com>2014-05-19 12:08:33 -0600
commit782ead0dbf3095d0e843c2036bf40cc8ecd9b4d1 (patch)
tree19babfefc617c7f82bc5dcfc287b3f4809a6623a /page.go
parentMerge pull request #166 from benbjohnson/fill-percent (diff)
downloaddedo-782ead0dbf3095d0e843c2036bf40cc8ecd9b4d1.tar.gz
dedo-782ead0dbf3095d0e843c2036bf40cc8ecd9b4d1.tar.xz
Fix freelist allocation direction.
This commit fixes the freelist so that it frees from the beginning of the data file instead of the end. It also adds a fast path for pages which can be allocated from the first free pages and it includes read transaction stats.
Diffstat (limited to 'page.go')
-rw-r--r--page.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/page.go b/page.go
index 56cf064..cd213a4 100644
--- a/page.go
+++ b/page.go
@@ -128,3 +128,9 @@ type PageInfo struct {
Count int
OverflowCount int
}
+
+type pgids []pgid
+
+func (s pgids) Len() int { return len(s) }
+func (s pgids) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
+func (s pgids) Less(i, j int) bool { return s[i] > s[j] }