Precalculate size of pending pgids in freelist.copyall

This recovers the slight alloc regression in #636.
pull/3/head
Josh Bleecher Snyder 2016-12-22 17:20:50 -08:00
parent 1858583b3b
commit 0e120dc470
1 changed files with 1 additions and 1 deletions

View File

@ -49,7 +49,7 @@ func (f *freelist) pending_count() int {
// copyall copies into dst a list of all free ids and all pending ids in one sorted list.
// f.count returns the minimum length required for dst.
func (f *freelist) copyall(dst []pgid) {
m := make(pgids, 0, len(f.pending)) // len(f.pending) undercounts, but it is a start
m := make(pgids, 0, f.pending_count())
for _, list := range f.pending {
m = append(m, list...)
}