Documentation ¶
Overview ¶
Package pool implements a memory pool similar in concept to sync.Pool but with more determinism.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool of internal buffers
We hold buffers in cache. Every time we Get or Put we update minFill which is the minimum len(cache) seen.
Every flushTime we remove minFill buffers from the cache as they were not used in the previous flushTime interval.
func New ¶
New makes a buffer pool
flushTime is the interval the buffer pools is flushed bufferSize is the size of the allocations poolSize is the maximum number of free buffers in the pool useMmap should be set to use mmap allocations
Click to show internal directories.
Click to hide internal directories.