Skip to content

Commit ec0100e

Browse files
committed
fix after rebase
1 parent 70b3139 commit ec0100e

15 files changed

+18
-28
lines changed

gnovm/pkg/gnolang/alloc.go

-8
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package gnolang
22

33
import (
44
"fmt"
5-
"reflect"
65
)
76

87
// Keeps track of in-memory allocations.
@@ -30,9 +29,6 @@ const (
3029
_allocStructValue = 160
3130
_allocArrayValue = 184
3231
_allocSliceValue = 40
33-
_allocMapValue = 144
34-
_allocBoundMethodValue = 176
35-
_allocBlock = 464
3632
_allocFuncValue = 196
3733
_allocMapValue = 152
3834
_allocBoundMethodValue = 184
@@ -396,10 +392,6 @@ func (sv StringValue) GetShallowSize() int64 {
396392
return allocString + allocStringByte*int64(len(sv))
397393
}
398394

399-
func (nv *NativeValue) GetShallowSize() int64 {
400-
return allocNative
401-
}
402-
403395
func (bv BigintValue) GetShallowSize() int64 {
404396
return allocBigint
405397
}

gnovm/pkg/gnolang/garbage_collector.go

-4
Original file line numberDiff line numberDiff line change
@@ -271,10 +271,6 @@ func (dbv DataByteValue) VisitAssociated(vis Visitor) (stop bool) {
271271
return false
272272
}
273273

274-
func (nv *NativeValue) VisitAssociated(vis Visitor) (stop bool) {
275-
return false
276-
}
277-
278274
func (rv RefValue) VisitAssociated(vis Visitor) (stop bool) {
279275
return false
280276
}

gnovm/pkg/gnolang/nodes.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -2422,8 +2422,10 @@ func validatePkgName(name string) error {
24222422

24232423
// The distinction is used for validation to work
24242424
// both before and after preprocessing.
2425-
const missingResultNamePrefix = ".res." // if there was no name
2426-
const underscoreResultNamePrefix = ".res_" // if was underscore
2425+
const (
2426+
missingResultNamePrefix = ".res." // if there was no name
2427+
underscoreResultNamePrefix = ".res_" // if was underscore
2428+
)
24272429

24282430
func isUnnamedResult(name string) bool {
24292431
return isMissingResult(name) || isUnderscoreResult(name)

gnovm/pkg/gnolang/preprocess.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ func Preprocess(store Store, ctx BlockNode, n Node) Node {
451451
// XXX well the following may be isn't idempotent,
452452
// XXX so it is currently strange.
453453
if bn, ok := n.(BlockNode); ok {
454-
//findGotoLoopDefines(ctx, bn)
454+
// findGotoLoopDefines(ctx, bn)
455455
findHeapDefinesByUse(ctx, bn)
456456
findHeapUsesDemoteDefines(ctx, bn)
457457
findPackageSelectors(bn)
@@ -2893,7 +2893,7 @@ func addHeapCapture(dbn BlockNode, fle *FuncLitExpr, depth int, nx *NameExpr) (i
28932893
// vp := fle.GetPathForName(nil, name)
28942894
vp := nx.Path
28952895
vp.SetDepth(vp.Depth - uint8(depth))
2896-
//vp.SetDepth(vp.Depth - 1) // minus 1 for fle itself.
2896+
// vp.SetDepth(vp.Depth - 1) // minus 1 for fle itself.
28972897
ne := NameExpr{
28982898
Path: vp,
28992899
Name: name,

gnovm/pkg/gnolang/realm.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ func (rlm *Realm) processNewEscapedMarks(store Store, start int) int {
558558
// (and never can be unescaped,)
559559
// except for new-reals that get demoted
560560
// because ref-count isn't >= 2.
561-
//for _, eo := range rlm.newEscaped[start:] {
561+
// for _, eo := range rlm.newEscaped[start:] {
562562
for i := 0; i < len(rlm.newEscaped[start:]); i++ { // may expand.
563563
eo := rlm.newEscaped[i]
564564
if debug {

gnovm/pkg/gnolang/string_methods.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gnovm/stdlibs/generated.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gnovm/tests/files/alloc_0.gno

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ func main() {
1616
}
1717

1818
// Output:
19-
// MemStats: Allocator{maxBytes:100000000, bytes:4862}
19+
// MemStats: Allocator{maxBytes:100000000, bytes:5030}

gnovm/tests/files/alloc_1.gno

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ func main() {
2121
}
2222

2323
// Output:
24-
// MemStats: Allocator{maxBytes:100000000, bytes:5904}
24+
// MemStats: Allocator{maxBytes:100000000, bytes:6072}

gnovm/tests/files/alloc_3.gno

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ func main() {
1111
}
1212

1313
// Output:
14-
// MemStats after GC: Allocator{maxBytes:110000000, bytes:4376}
14+
// MemStats after GC: Allocator{maxBytes:110000000, bytes:4472}

gnovm/tests/files/alloc_4.gno

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ func main() {
2222
}
2323

2424
// Output:
25-
// memstats in main after first GC: Allocator{maxBytes:50000, bytes:12389}
26-
// memstats in main after second GC: Allocator{maxBytes:50000, bytes:5309}
25+
// memstats in main after first GC: Allocator{maxBytes:50000, bytes:12653}
26+
// memstats in main after second GC: Allocator{maxBytes:50000, bytes:5381}

gnovm/tests/files/alloc_5.gno

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ func main() {
1919
}
2020

2121
// Output:
22-
// memstats in main after GC: Allocator{maxBytes:100000000, bytes:4376}
22+
// memstats in main after GC: Allocator{maxBytes:100000000, bytes:4472}

gnovm/tests/files/alloc_6.gno

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ func main() {
1313
}
1414

1515
// Output:
16-
// memstats in main after GC: Allocator{maxBytes:100000000, bytes:4604}
16+
// memstats in main after GC: Allocator{maxBytes:100000000, bytes:4700}

gnovm/tests/files/alloc_6a.gno

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ func main() {
1515
}
1616

1717
// Output:
18-
// memstats in main after GC: Allocator{maxBytes:100000000, bytes:5116}
18+
// memstats in main after GC: Allocator{maxBytes:100000000, bytes:5212}

gnovm/tests/files/alloc_7.gno

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ func main() {
1313
}
1414

1515
// Output:
16-
// MemStats: Allocator{maxBytes:100000000, bytes:4496}
16+
// MemStats: Allocator{maxBytes:100000000, bytes:4664}

0 commit comments

Comments
 (0)