caching
v1.15.5
github.com/bytedance/sonic/internal/caching
Documentation
pkg.go.dev ↗Constants
FieldMap_N (3 declarations)
const (
FieldMap_N = int64(unsafe.Offsetof(FieldMap{}.N))
FieldMap_b = int64(unsafe.Offsetof(FieldMap{}.b))
FieldEntrySize = int64(unsafe.Sizeof(FieldEntry{}))
)
Variables
V_strhash (2 declarations)
var ( V_strhash = rt.UnpackEface(rt.Strhash) S_strhash = *(*uintptr)(V_strhash.Value) )
Functions
StrHash
func StrHash(s string) uint64
Types
FieldEntry
type FieldEntry struct {
ID int
Name string
Hash uint64
}
FieldMap
type FieldMap struct {
N uint64
// contains filtered or unexported fields
}
CreateFieldMap
func CreateFieldMap(n int) *FieldMap
FieldMap.At
func (self *FieldMap) At(p uint64) *FieldEntry
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.
FieldMap.GetCaseInsensitive
func (self *FieldMap) GetCaseInsensitive(name string) int
FieldMap.Set
func (self *FieldMap) Set(name string, i int)
ProgramCache
type ProgramCache struct {
// contains filtered or unexported fields
}
CreateProgramCache
func CreateProgramCache() *ProgramCache
ProgramCache.Compute
func (self *ProgramCache) Compute(vt *rt.GoType, compute func(*rt.GoType, ...interface{}) (interface{}, error), ex ...interface{}) (interface{}, error)
ProgramCache.Get
func (self *ProgramCache) Get(vt *rt.GoType) interface{}
ProgramCache.Reset
func (self *ProgramCache) Reset()