Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
ltzmaxwell committed Jan 8, 2025
1 parent 6dcf54b commit 3b81300
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion gnovm/tests/files/alloc1.gno
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,24 @@ type Foo struct{ name string }

func bar() {
f := &Foo{"foo"}
f2 := f
println(f)
bb := &Foo{"bar"}
println("MemStats 2: ", std.MemStats())
}

func main() {
a := 1
println("MemStats 1: ", std.MemStats())
bar()
println("MemStats before GC: ", std.MemStats())
std.GC()
println("MemStats after GC: ", std.MemStats())
}

// Output:
// MemStats 1: Allocator{maxBytes:10000000000,bytes,bytes:1904}
// &(struct{("foo" string)} main.Foo)
// MemStats before GC: Allocator{maxBytes:10000000000,bytes,bytes:4440}
// MemStats 2: Allocator{maxBytes:10000000000,bytes,bytes:5984}
// MemStats before GC: Allocator{maxBytes:10000000000,bytes,bytes:7488}
// MemStats after GC: Allocator{maxBytes:10000000000,bytes,bytes:3197}

0 comments on commit 3b81300

Please sign in to comment.