Documentation
¶
Index ¶
- Variables
- type Allocator
- func (ac *Allocator) Bool(v bool) (r *bool)
- func (ac *Allocator) CheckExternalPointers()
- func (ac *Allocator) CopySlice(slice interface{}) (ret interface{})
- func (ac *Allocator) Enum(e interface{}) interface{}
- 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) New(ptrToPtr interface{})
- func (ac *Allocator) NewCopy(ptr interface{}) (ret interface{})
- func (ac *Allocator) NewMap(mapPtr interface{})
- func (ac *Allocator) NewSlice(slicePtr interface{}, len, cap int)
- func (ac *Allocator) NewString(v string) string
- func (ac *Allocator) Release()
- func (ac *Allocator) SliceAppend(slicePtr interface{}, elem interface{})
- func (ac *Allocator) String(v string) (r *string)
- func (ac *Allocator) Uint32(v uint32) (r *uint32)
- func (ac *Allocator) Uint64(v uint64) (r *uint64)
- func (ac *Allocator) Unbind()
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DbgMode = false DisableLinearAc = false ChunkSize = 1024 * 32 )
Functions ¶
This section is empty.
Types ¶
type Allocator ¶
type Allocator struct {
// contains filtered or unexported fields
}
func NewLinearAc ¶
func NewLinearAc() *Allocator
func (*Allocator) CheckExternalPointers ¶
func (ac *Allocator) CheckExternalPointers()
CheckExternalPointers is useful for if you want to check external pointers but don't want to invalidate pointers. e.g. using ac as config memory allocator globally.
func (*Allocator) CopySlice ¶
func (ac *Allocator) CopySlice(slice interface{}) (ret interface{})
CopySlice is useful to create simple slice (simple type as element)
func (*Allocator) NewCopy ¶
func (ac *Allocator) NewCopy(ptr interface{}) (ret interface{})
NewCopy is useful for code migration. native mode is slower than new() due to the additional memory move from stack to heap, this is on purpose to avoid heap alloc in linear mode.
func (*Allocator) NewMap ¶
func (ac *Allocator) NewMap(mapPtr interface{})
NewMap use build-in allocator
func (*Allocator) SliceAppend ¶
func (ac *Allocator) SliceAppend(slicePtr interface{}, elem interface{})
Click to show internal directories.
Click to hide internal directories.