From: Brad Fitzpatrick Date: Sun, 3 Apr 2016 01:34:29 +0000 (+0000) Subject: fmt: hold on to all free buffers, regardless of size X-Git-Tag: go1.7beta1~937 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=0656da910a1750921961b0955f9150f326199847;p=gostls13.git fmt: hold on to all free buffers, regardless of size This code made sense before fmt switched to using sync.Pool, but a sync.Pool clears all items on GC, so not reusing something based on size is just a waste of memory. Change-Id: I201312b0ee6c572ff3c0ffaf71e42623a160d23f Reviewed-on: https://go-review.googlesource.com/21480 Reviewed-by: Rob Pike Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- diff --git a/src/fmt/print.go b/src/fmt/print.go index 1a0b51a5a9..d071dcfb31 100644 --- a/src/fmt/print.go +++ b/src/fmt/print.go @@ -132,10 +132,6 @@ func newPrinter() *pp { // free saves used pp structs in ppFree; avoids an allocation per invocation. func (p *pp) free() { - // Don't hold on to pp structs with large buffers. - if cap(p.buf) > 1024 { - return - } p.buf = p.buf[:0] p.arg = nil p.value = reflect.Value{}