From 440b89418f5907099cf06764ad7f2b83cf12fbcf Mon Sep 17 00:00:00 2001 From: Ben Johnson Date: Mon, 31 Mar 2014 08:52:13 -0600 Subject: Write freelist after each commit. Well, this is embarassing. Somehow the freelist was never getting written after each commit. This commit fixes that and fixes a small reporting issue with "bolt pages". --- freelist.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'freelist.go') diff --git a/freelist.go b/freelist.go index d0b1492..cb58a54 100644 --- a/freelist.go +++ b/freelist.go @@ -12,6 +12,11 @@ type freelist struct { pending map[txid][]pgid } +// size returns the size of the page after serialization. +func (f *freelist) size() int { + return pageHeaderSize + (int(unsafe.Sizeof(pgid(0))) * len(f.all())) +} + // all returns a list of all free ids and all pending ids in one sorted list. func (f *freelist) all() []pgid { ids := make([]pgid, len(f.ids)) -- cgit v1.2.3