Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Get ¶
func Get() *bytes.ByteBuffer
func Put ¶
func Put(b *bytes.ByteBuffer)
Types ¶
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool represents byte buffer pool. Distinct pools may be used for distinct types of byte buffers. Properly determined byte buffer types with their own pools may help reducing memory waste.
func (*Pool) Get ¶
func (p *Pool) Get() *bytes.ByteBuffer
Get returns new byte buffer with zero length. The byte buffer may be returned to the pool via Put after the use in order to minimize GC overhead.
func (*Pool) Put ¶
func (p *Pool) Put(b *bytes.ByteBuffer)
Put releases byte buffer obtained via Get to the pool. The buffer mustn't be accessed after returning to the pool.
Click to show internal directories.
Click to hide internal directories.