aboutsummaryrefslogtreecommitdiff
path: root/freelist.go
diff options
context:
space:
mode:
Diffstat (limited to 'freelist.go')
-rw-r--r--freelist.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/freelist.go b/freelist.go
index 3551113..6f05ac5 100644
--- a/freelist.go
+++ b/freelist.go
@@ -27,7 +27,17 @@ func (f *freelist) size() int {
// count returns count of pages on the freelist
func (f *freelist) count() int {
- var count = len(f.ids)
+ return f.free_count() + f.pending_count()
+}
+
+// free_count returns count of free pages
+func (f *freelist) free_count() int {
+ return len(f.ids)
+}
+
+// pending_count returns count of pending pages
+func (f *freelist) pending_count() int {
+ var count int
for _, list := range f.pending {
count += len(list)
}