Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultBytesSlicePool = NewBytesSlicePool(1024) DefaultBytesBufferPool = NewBytesBufferPool() DefaultStringBuilderPool = NewStringBuilderPool() )
Functions ¶
Types ¶
type BytesBufferPool ¶
BytesBufferPool 定义 *bytes.Buffer 复用池的类型
func NewBytesBufferPool ¶
func NewBytesBufferPool() *BytesBufferPool
func (*BytesBufferPool) Alloc ¶
func (own *BytesBufferPool) Alloc() *bytes.Buffer
Alloc 分配一个 *bytes.Buffer 对象
func (*BytesBufferPool) Dealloc ¶
func (own *BytesBufferPool) Dealloc(obj *bytes.Buffer)
Dealloc 释放当前 *bytes.Buffer 对象
type BytesSlicePool ¶
type BytesSlicePool struct {
// contains filtered or unexported fields
}
BytesSlicePool 定义 []byte 复用池的类型
func NewBytesSlicePool ¶
func NewBytesSlicePool(sliceCap int, maxRecyclingCap ...int) *BytesSlicePool
NewBytesSlicePool 创建一个 []byte 复用池
func (*BytesSlicePool) Dealloc ¶
func (own *BytesSlicePool) Dealloc(obj []byte)
Dealloc 释放当前 []byte 对象
type StringBuilderPool ¶
StringBuilderPool 定义 *strings.Builder 复用池的类型
func NewStringBuilderPool ¶
func NewStringBuilderPool() *StringBuilderPool
NewStringBuilderPool 创建一个 *strings.Builder 复用池
func (*StringBuilderPool) Alloc ¶
func (own *StringBuilderPool) Alloc() *strings.Builder
Alloc 分配一个 *strings.Builder 对象
func (*StringBuilderPool) Dealloc ¶
func (own *StringBuilderPool) Dealloc(obj *strings.Builder)
Dealloc 释放当前 *strings.Builder 对象
Click to show internal directories.
Click to hide internal directories.