mirror of
https://github.com/prometheus/prometheus.git
synced 2025-02-21 03:16:00 -08:00
Comment improvement.
This commit is contained in:
parent
66fc61f9b7
commit
a052d32609
|
@ -387,6 +387,8 @@ func (p *persistence) loadChunks(fp clientmodel.Fingerprint, indexes []int, inde
|
||||||
chunks := make([]chunk, 0, len(indexes))
|
chunks := make([]chunk, 0, len(indexes))
|
||||||
buf := p.bufPool.Get().([]byte)
|
buf := p.bufPool.Get().([]byte)
|
||||||
defer func() {
|
defer func() {
|
||||||
|
// buf may change below, so wrap returning to the pool in a function.
|
||||||
|
// A simple 'defer p.bufPool.Put(buf)' would only return the original buf.
|
||||||
p.bufPool.Put(buf)
|
p.bufPool.Put(buf)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue