utils

package
v0.1.15 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LoadFactor   = 0.5
	InitCapacity = 4096 // must be a power of 2
)

Variables

View Source
var FnWrite = hir.RegisterICall(
	rt.GetMethod((*iov.BufferWriter)(nil), "WriteDirect"),
	emu_icall_ZeroCopyWriter_WriteDirect,
)
View Source
var ForceEmulator = os.Getenv("FRUGAL_BACKEND") == "emu"

Functions

func IsByteType

func IsByteType(vt reflect.Type) bool

func MaxInt

func MaxInt(a int, b int) int

Types

type ListNode added in v0.1.12

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

ListNode can be used to save references

func (*ListNode) Prepend added in v0.1.12

func (n *ListNode) Prepend(p unsafe.Pointer)

Prepend creates a new node with value=p and adds it at the beginning of this list

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{}, error)) (interface{}, error)

func (*ProgramCache) Get

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

type ProgramEntry

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

type ProgramMap

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

type SyntaxError

type SyntaxError struct {
	Pos    int
	Src    string
	Reason string
}

func ESetList

func ESetList(pos int, src string, vt reflect.Type) SyntaxError

func ESyntax

func ESyntax(pos int, src string, reason string) SyntaxError

func (SyntaxError) Error

func (self SyntaxError) Error() string

type TypeError

type TypeError struct {
	Note string
	Type reflect.Type
}

func EType

func EType(vt reflect.Type, note string) TypeError

func EUseOther added in v0.1.6

func EUseOther(vt reflect.Type, alt string) TypeError

func (TypeError) Error

func (self TypeError) Error() string

Jump to

Keyboard shortcuts

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