caching

package
v1.12.5 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FieldMap_N     = int64(unsafe.Offsetof(FieldMap{}.N))
	FieldMap_b     = int64(unsafe.Offsetof(FieldMap{}.b))
	FieldEntrySize = int64(unsafe.Sizeof(FieldEntry{}))
)

Variables

View Source
var (
	V_strhash = rt.UnpackEface(strhash)
	S_strhash = *(*uintptr)(V_strhash.Value)
)

Functions

func StrHash

func StrHash(s string) uint64

Types

type FieldEntry

type FieldEntry struct {
	ID   int
	Name string
	Hash uint64
}

type FieldMap

type FieldMap struct {
	N uint64
	// contains filtered or unexported fields
}

func CreateFieldMap

func CreateFieldMap(n int) *FieldMap

func (*FieldMap) At

func (self *FieldMap) At(p uint64) *FieldEntry

func (*FieldMap) Get

func (self *FieldMap) Get(name string) int

Get searches FieldMap by name. JIT generated assembly does NOT call this function, rather it implements its own version directly in assembly. So we must ensure this function stays in sync with the JIT generated one.

func (*FieldMap) GetCaseInsensitive

func (self *FieldMap) GetCaseInsensitive(name string) int

func (*FieldMap) Set

func (self *FieldMap) Set(name string, i int)

type ProgramCache

type ProgramCache struct {
	// contains filtered or unexported fields
}

func CreateProgramCache

func CreateProgramCache() *ProgramCache

func (*ProgramCache) Compute

func (self *ProgramCache) Compute(vt *rt.GoType, compute func(*rt.GoType, ...interface{}) (interface{}, error), ex ...interface{}) (interface{}, error)

func (*ProgramCache) Get

func (self *ProgramCache) Get(vt *rt.GoType) interface{}

Jump to

Keyboard shortcuts

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