diff options
author | Ben Johnson <benbjohnson@yahoo.com> | 2016-12-21 16:46:06 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-21 16:46:06 -0700 |
commit | f0cf3bfd5b5fe259fea19d5d6a2f8805e9b419e2 (patch) | |
tree | 538785d63060483ca9a4e802ddd6398130a8d7b7 /tx.go | |
parent | Merge pull request #638 from boltdb/fix-634 (diff) | |
parent | Don't allocate huge slices to merge pgids in freelist.write (diff) | |
download | dedo-f0cf3bfd5b5fe259fea19d5d6a2f8805e9b419e2.tar.gz dedo-f0cf3bfd5b5fe259fea19d5d6a2f8805e9b419e2.tar.xz |
Merge pull request #636 from josharian/perf
Don't allocate huge slices to merge pgids in freelist.write
Diffstat (limited to 'tx.go')
-rw-r--r-- | tx.go | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -381,7 +381,9 @@ func (tx *Tx) Check() <-chan error { func (tx *Tx) check(ch chan error) { // Check if any pages are double freed. freed := make(map[pgid]bool) - for _, id := range tx.db.freelist.all() { + all := make([]pgid, tx.db.freelist.lenall()) + tx.db.freelist.copyall(all) + for _, id := range all { if freed[id] { ch <- fmt.Errorf("page %d: already freed", id) } |