Documentation ¶
Index ¶
- Variables
- func AcquireTimer(timeout time.Duration) *time.Timer
- func AcquireWaitGroup() *sync.WaitGroup
- func Go(f func())
- func NewByteBuffer(min, max int) *byteBufferPool
- func NewByteSlice(min, max int) *byteSlicePool
- func ReleaseTimer(t *time.Timer)
- func ReleaseWaitGroup(wg *sync.WaitGroup)
- func ResetTimer(t *time.Timer, period time.Duration)
- type ByteBuffer
Constants ¶
This section is empty.
Variables ¶
View Source
var Bytes = NewByteSlice(32, 64<<10)
View Source
var BytesBuffer = NewByteBuffer(4, 64<<10)
View Source
var TinyBytes = NewByteSlice(4, 128)
Functions ¶
func AcquireWaitGroup ¶
func NewByteBuffer ¶ added in v0.1.4
func NewByteBuffer(min, max int) *byteBufferPool
NewByteBuffer creates new byteBufferPool that reuses objects which size is in logarithmic range [min, max].
Note that it is a shortcut for Custom() constructor with Options provided by WithLogSizeMapping() and WithLogSizeRange(min, max) calls.
func NewByteSlice ¶ added in v0.1.4
func NewByteSlice(min, max int) *byteSlicePool
New creates new byteSlicePool that reuses objects which size is in logarithmic range [min, max].
Note that it is a shortcut for Custom() constructor with Options provided by WithLogSizeMapping() and WithLogSizeRange(min, max) calls.
func ReleaseTimer ¶
func ReleaseWaitGroup ¶
Types ¶
type ByteBuffer ¶ added in v0.1.4
type ByteBuffer struct {
// contains filtered or unexported fields
}
func (*ByteBuffer) Bytes ¶ added in v0.1.4
func (bb *ByteBuffer) Bytes() *[]byte
func (*ByteBuffer) Reset ¶ added in v0.1.4
func (bb *ByteBuffer) Reset()
func (*ByteBuffer) SetBytes ¶ added in v0.1.4
func (bb *ByteBuffer) SetBytes(b *[]byte)
Click to show internal directories.
Click to hide internal directories.