NewDirtyBinaryTieredBufferPool returns a BufferPool backed by multiple sub-pools. It is similar to NewBinaryTieredBufferPool but it does not initialize the buffers before returning them.
(powerOfTwoExponents ...uint8)
| 80 | // sub-pools. It is similar to NewBinaryTieredBufferPool but it does not |
| 81 | // initialize the buffers before returning them. |
| 82 | func NewDirtyBinaryTieredBufferPool(powerOfTwoExponents ...uint8) (*BinaryTieredBufferPool, error) { |
| 83 | return newBinaryTiered(func(size int) bufferPool { |
| 84 | return newSizedBufferPool(size, false) |
| 85 | }, NewDirtySimplePool(), powerOfTwoExponents...) |
| 86 | } |
| 87 | |
| 88 | func newBinaryTiered(sizedPoolFactory func(int) bufferPool, fallbackPool bufferPool, powerOfTwoExponents ...uint8) (*BinaryTieredBufferPool, error) { |
| 89 | slices.Sort(powerOfTwoExponents) |