Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 0 additions & 97 deletions alloc.go

This file was deleted.

217 changes: 0 additions & 217 deletions alloc_test.go

This file was deleted.

8 changes: 2 additions & 6 deletions integer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,9 @@ func TestLInteger_TypeName(t *testing.T) {
}

func TestLInteger_Preloads(t *testing.T) {
al := newAllocator(64)

// Values in [-256, 256) should be preloaded (zero alloc)
for i := int64(-256); i < 256; i++ {
v := al.LInteger2I(LInteger(i))
v := lintegerToValue(LInteger(i))
if v.Type() != LTInteger {
t.Errorf("LInteger(%d) should have type LTInteger", i)
}
Expand All @@ -45,12 +43,10 @@ func TestLInteger_Preloads(t *testing.T) {
}

func TestLInteger_LargeValues(t *testing.T) {
al := newAllocator(64)

// Values outside preload range should also work
large := []int64{1000, -1000, 1 << 62, -(1 << 62)}
for _, i := range large {
v := al.LInteger2I(LInteger(i))
v := lintegerToValue(LInteger(i))
if v.Type() != LTInteger {
t.Errorf("LInteger(%d) should have type LTInteger", i)
}
Expand Down
7 changes: 3 additions & 4 deletions registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ type registry struct {
top int
growBy int
maxSize int
alloc *allocator
handler registryHandler
}

func newRegistry(handler registryHandler, initialSize int, growBy int, maxSize int, alloc *allocator) *registry {
return &registry{make([]LValue, initialSize), 0, growBy, maxSize, alloc, handler}
func newRegistry(handler registryHandler, initialSize int, growBy int, maxSize int) *registry {
return &registry{make([]LValue, initialSize), 0, growBy, maxSize, handler}
}

func (rg *registry) resize(requiredSize int) bool { // +inline-start
Expand Down Expand Up @@ -266,7 +265,7 @@ func (rg *registry) SetNumber(regi int, vali LNumber) { // +inline-start
rg.resize(requiredSize)
}
}
rg.array[regi] = rg.alloc.LNumber2I(vali)
rg.array[regi] = lnumberToValue(vali)
if regi >= rg.top {
rg.top = regi + 1
}
Expand Down
Loading