diff options
author | Martin Kobetic <mkobetic@gmail.com> | 2014-06-20 14:53:25 +0000 |
---|---|---|
committer | Martin Kobetic <mkobetic@gmail.com> | 2014-06-20 14:53:25 +0000 |
commit | 571f20167268659befb8f8e5ea943c511d364cce (patch) | |
tree | fdde635f974c64649488abea2faa7fee781355a4 /freelist.go | |
parent | Merge pull request #202 from benbjohnson/refactor-split (diff) | |
download | dedo-571f20167268659befb8f8e5ea943c511d364cce.tar.gz dedo-571f20167268659befb8f8e5ea943c511d364cce.tar.xz |
split the freelist page count stats to free and pending
Diffstat (limited to 'freelist.go')
-rw-r--r-- | freelist.go | 12 |
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) } |