utils

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: Apache-2.0 Imports: 8 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((*thrift.NocopyWriter)(nil), "WriteDirect"),
	emu_icall_ZeroCopyWriter_WriteDirect,
)
View Source
var ForceEmulator = os.Getenv("FRUGAL_BACKEND") == "emu"

Functions

func MaxInt

func MaxInt(a int, b int) int

Types

type ListNode

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

ListNode can be used to save references

func (*ListNode) Prepend

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 Queue

type Queue struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Queue ...

func NewQueue

func NewQueue() *Queue

NewQueue ...

func (*Queue) Dequeue

func (q *Queue) Dequeue() interface{}

Dequeue removes and returns the front queue item

func (*Queue) Empty

func (q *Queue) Empty() bool

Empty checks if the queue is empty

func (*Queue) Enqueue

func (q *Queue) Enqueue(item interface{})

Enqueue adds an item at the back of the queue

Jump to

Keyboard shortcuts

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