Discover Packages
go.minekube.com/gate
pkg
internal
bufpool
package
Version:
v0.31.0
Opens a new window with list of versions in this module.
Published: Jul 3, 2023
License: Apache-2.0
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
Get returns an empty byte buffer from the pool.
Got byte buffer may be returned to the pool via Put call.
This reduces the number of memory allocations required for byte buffer
management.
Put returns byte buffer to the pool.
ByteBuffer.B mustn't be touched after returning it to the pool.
Otherwise, data races will occur.
type Pool struct {
DisableCalibration bool
}
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 to reduce
memory waste.
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.
Put releases byte buffer obtained via Get to the pool.
The buffer mustn't be accessed after returning to the pool.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.