linear_ac

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

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 BindNew

func BindNew() *Allocator

func Get

func Get() *Allocator

func NewLinearAc

func NewLinearAc() *Allocator

func (*Allocator) Bool

func (ac *Allocator) Bool(v bool) (r *bool)

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) Enum

func (ac *Allocator) Enum(e interface{}) interface{}

func (*Allocator) Float32

func (ac *Allocator) Float32(v float32) (r *float32)

func (*Allocator) Float64

func (ac *Allocator) Float64(v float64) (r *float64)

func (*Allocator) Int

func (ac *Allocator) Int(v int) (r *int)

func (*Allocator) Int32

func (ac *Allocator) Int32(v int32) (r *int32)

func (*Allocator) Int64

func (ac *Allocator) Int64(v int64) (r *int64)

func (*Allocator) New

func (ac *Allocator) New(ptrToPtr interface{})

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) NewSlice

func (ac *Allocator) NewSlice(slicePtr interface{}, len, cap int)

func (*Allocator) NewString

func (ac *Allocator) NewString(v string) string

func (*Allocator) Release

func (ac *Allocator) Release()

func (*Allocator) SliceAppend

func (ac *Allocator) SliceAppend(slicePtr interface{}, elem interface{})

func (*Allocator) String

func (ac *Allocator) String(v string) (r *string)

func (*Allocator) Uint32

func (ac *Allocator) Uint32(v uint32) (r *uint32)

func (*Allocator) Uint64

func (ac *Allocator) Uint64(v uint64) (r *uint64)

func (*Allocator) Unbind

func (ac *Allocator) Unbind()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL