Documentation
¶
Index ¶
- Constants
- Variables
- func Append[T any](ac *Allocator, s []T, elem T) []T
- func AppendInplace[T any](ac *Allocator, s []T, elems T) []T
- func AppendInplaceMulti[T any](ac *Allocator, s []T, elems ...T) []T
- func AppendMulti[T any](ac *Allocator, s []T, elems ...T) []T
- func New[T any](ac *Allocator) (r *T)
- func NewSlice[T any](ac *Allocator, len, cap int) (r []T)
- type Allocator
- func (ac *Allocator) BlockSize() int64
- func (ac *Allocator) Bool(v bool) (r *bool)
- func (ac *Allocator) Debug()
- func (ac *Allocator) Float32(v float32) (r *float32)
- func (ac *Allocator) Float64(v float64) (r *float64)
- func (ac *Allocator) Int(v int) (r *int)
- func (ac *Allocator) Int32(v int32) (r *int32)
- func (ac *Allocator) Int64(v int64) (r *int64)
- func (ac *Allocator) KeepAlive(ptr interface{})
- func (ac *Allocator) Merge(src *Allocator) *Allocator
- func (ac *Allocator) NewString(v string) string
- func (ac *Allocator) Reset()
- func (ac *Allocator) ReturnAlloctorToPool()
- func (ac *Allocator) String(v string) (r *string)
- func (ac *Allocator) Uint32(v uint32) (r *uint32)
- func (ac *Allocator) Uint64(v uint64) (r *uint64)
- type Logger
Constants ¶
Variables ¶
View Source
var ( SliceExtendRatio = 2.5 BugfixClearPointerInMem = true BugfixCorruptOtherMem = true )
Functions ¶
func AppendInplace ¶ added in v0.3.0
AppendInplace 与 NewSlice 之间没有任何新的内存分配时使用
func AppendInplaceMulti ¶ added in v0.3.0
AppendInplaceMulti 与 NewSlice 之间没有任何新的内存分配时使用
func AppendMulti ¶ added in v0.3.0
AppendMulti append slice
Types ¶
type Allocator ¶
type Allocator struct {
// contains filtered or unexported fields
}
Allocator 分配器
func (*Allocator) KeepAlive ¶ added in v0.3.0
func (ac *Allocator) KeepAlive(ptr interface{})
KeepAlive GC保活
func (*Allocator) ReturnAlloctorToPool ¶
func (ac *Allocator) ReturnAlloctorToPool()
ReturnAlloctorToPool 归还分配池
Click to show internal directories.
Click to hide internal directories.