(buf *[]byte)
| 158 | } |
| 159 | |
| 160 | func (p *trackingBufferPool) Put(buf *[]byte) { |
| 161 | p.lock.Lock() |
| 162 | defer p.lock.Unlock() |
| 163 | |
| 164 | if _, ok := p.allocatedBuffers[buf]; !ok { |
| 165 | p.logger.Errorf("Unknown buffer freed:\n%s", string(debug.Stack())) |
| 166 | } else { |
| 167 | delete(p.allocatedBuffers, buf) |
| 168 | } |
| 169 | p.pool.Put(buf) |
| 170 | } |
| 171 | |
| 172 | var goroutinesToIgnore = []string{ |
| 173 | "testing.Main(", |