MCPcopy Index your code
hub / github.com/yuin/gopher-lua / newAllocator

Function newAllocator

alloc.go:37–48  ·  view source on GitHub ↗
(size int)

Source from the content-addressed store, hash-verified

35}
36
37func newAllocator(size int) *allocator {
38 al := &allocator{
39 size: size,
40 fptrs: make([]float64, 0, size),
41 fheader: nil,
42 }
43 al.fheader = (*reflect.SliceHeader)(unsafe.Pointer(&al.fptrs))
44 al.scratchValue = LNumber(0)
45 al.scratchValueP = (*iface)(unsafe.Pointer(&al.scratchValue))
46
47 return al
48}
49
50// LNumber2I takes a number value and returns an interface LValue representing the same number.
51// Converting an LNumber to a LValue naively, by doing:

Callers 5

newLStateFunction · 0.85
newLStateFunction · 0.85
BenchmarkRegistrySetTopFunction · 0.85

Calls 1

LNumberTypeAlias · 0.85

Tested by 3

BenchmarkRegistrySetTopFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…