1
0
Fork 0
forked from forgejo/forgejo

Bump unrolled/render to v1.1.0 (#15581)

v1.1.0 has improved buffer pooling
This commit is contained in:
Nathan Smith 2021-04-22 02:54:27 -07:00 committed by GitHub
parent f719ffc783
commit 445e47b692
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 97 additions and 32 deletions

View file

@ -2,9 +2,6 @@ package render
import "bytes"
// bufPool represents a reusable buffer pool for executing templates into.
var bufPool *BufferPool
// BufferPool implements a pool of bytes.Buffers in the form of a bounded channel.
// Pulled from the github.com/oxtoacart/bpool package (Apache licensed).
type BufferPool struct {
@ -39,8 +36,3 @@ func (bp *BufferPool) Put(b *bytes.Buffer) {
default: // Discard the buffer if the pool is full.
}
}
// Initialize buffer pool for writing templates into.
func init() {
bufPool = NewBufferPool(64)
}