Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultPool = NewBytesPool()
DefaultPool is a default BytesBool instance.
Functions ¶
This section is empty.
Types ¶
type BytesPool ¶
type BytesPool struct {
// contains filtered or unexported fields
}
BytesPool maintains large bytes pools, used for reducing memory allocation. It has a slice of pools which handle different size of bytes. Can be safely used concurrently.
func (*BytesPool) Alloc ¶
Alloc allocates a bytes which has the size of power of two. The caller should keep the origin bytes and use the returned data. When finished using, the origin bytes should be freed to the pool. The allocated data may not have zero value.
Click to show internal directories.
Click to hide internal directories.