SimpleBufferPool is an implementation of the mem.BufferPool interface that attempts to pool buffers with a sync.Pool. When Get is invoked, it tries to acquire a buffer from the pool but if that buffer is too small, it returns it to the pool and creates a new one.
| 302 | // acquire a buffer from the pool but if that buffer is too small, it returns it |
| 303 | // to the pool and creates a new one. |
| 304 | type SimpleBufferPool struct { |
| 305 | pool sync.Pool |
| 306 | shouldZero bool |
| 307 | } |
| 308 | |
| 309 | // NewDirtySimplePool constructs a [SimpleBufferPool]. It does not initialize |
| 310 | // the buffers before returning them. Callers must ensure they don't read the |
nothing calls this directly
no outgoing calls
no test coverage detected