From 571f20167268659befb8f8e5ea943c511d364cce Mon Sep 17 00:00:00 2001 From: Martin Kobetic Date: Fri, 20 Jun 2014 14:53:25 +0000 Subject: split the freelist page count stats to free and pending --- freelist.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'freelist.go') 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) } -- cgit v1.2.3