Documentation ¶
Index ¶
Constants ¶
View Source
const ( // 底层桶使用sync.Pool,内部的[]byte由sync.Pool决定何时释放 StrategyMultiStdPoolBucket = iota + 1 // 底层桶使用切片,内部的[]byte永远不会释放 StrategyMultiSlicePoolBucket )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ModSharedSliceByteOption ¶
type ModSharedSliceByteOption func(option *SharedSliceByteOption)
func WithPool ¶
func WithPool(pool SliceBytePool) ModSharedSliceByteOption
type SharedSliceByte ¶
type SharedSliceByte struct { // contains filtered or unexported fields }
func NewSharedSliceByte ¶
func NewSharedSliceByte(size int, modOptions ...ModSharedSliceByteOption) *SharedSliceByte
func WrapSharedSliceByte ¶
func WrapSharedSliceByte(b []byte, modOptions ...ModSharedSliceByteOption) *SharedSliceByte
func (*SharedSliceByte) Ref ¶
func (ssb *SharedSliceByte) Ref() *SharedSliceByte
func (*SharedSliceByte) ReleaseIfNeeded ¶
func (ssb *SharedSliceByte) ReleaseIfNeeded()
type SharedSliceByteOption ¶
type SharedSliceByteOption struct {
// contains filtered or unexported fields
}
type SliceBucket ¶
type SliceBucket struct {
// contains filtered or unexported fields
}
func NewSliceBucket ¶
func NewSliceBucket() *SliceBucket
func (*SliceBucket) Get ¶
func (b *SliceBucket) Get(size int) []byte
func (*SliceBucket) Put ¶
func (b *SliceBucket) Put(buf []byte)
type SliceBytePool ¶
type SliceBytePool interface { // 功能类似于 make([]byte, <size>) Get(size int) []byte Put(buf []byte) RetrieveStatus() Status }
func NewSliceBytePool ¶
func NewSliceBytePool(strategy Strategy) SliceBytePool
type Status ¶
type Status struct {
// contains filtered or unexported fields
}
func RetrieveStatus ¶
func RetrieveStatus() Status
type StdPoolBucket ¶
type StdPoolBucket struct {
// contains filtered or unexported fields
}
func NewStdPoolBucket ¶
func NewStdPoolBucket() *StdPoolBucket
func (*StdPoolBucket) Get ¶
func (b *StdPoolBucket) Get(size int) []byte
func (*StdPoolBucket) Put ¶
func (b *StdPoolBucket) Put(buf []byte)
Click to show internal directories.
Click to hide internal directories.