Skip to content

Commit 7fbf54b

Browse files
committed
internal/buildcfg: enable greenteagc experiment by default
Slightly bump the value in Test/wasmmemsize.go. We use 1 additional page compared to before, and we were already sitting *right* on the edge. For golang#73581. Change-Id: I485df16c3cf59803a8a1fc852b3e90666981ab09 Reviewed-on: https://go-review.googlesource.com/c/go/+/656195 LUCI-TryBot-Result: Go LUCI <[email protected]> Auto-Submit: Michael Knyszek <[email protected]> Reviewed-by: Cherry Mui <[email protected]>
1 parent 7bfeb43 commit 7fbf54b

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

src/internal/buildcfg/exp.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,18 @@ func ParseGOEXPERIMENT(goos, goarch, goexp string) (*ExperimentFlags, error) {
7878
// things like .debug_addr (needed for DWARF 5).
7979
dwarf5Supported := (goos != "darwin" && goos != "ios" && goos != "aix")
8080

81+
// The compiler crashes while compiling some of the Green Tea code.
82+
// The Green Tea code is pretty normal, so this is likely a compiler
83+
// bug in the loong64 port.
84+
greenTeaGCSupported := goarch != "loong64"
85+
8186
baseline := goexperiment.Flags{
8287
RegabiWrappers: regabiSupported,
8388
RegabiArgs: regabiSupported,
8489
Dwarf5: dwarf5Supported,
8590
RandomizedHeapBase64: true,
8691
SizeSpecializedMalloc: true,
92+
GreenTeaGC: greenTeaGCSupported,
8793
}
8894

8995
// Start with the statically enabled set of experiments.

test/wasmmemsize.dir/main.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,19 @@ import (
99
"io"
1010
)
1111

12-
// Expect less than 3 MB of memory usage for a small wasm program.
13-
// This reflects the current allocator. If the allocator changes,
14-
// update this value.
15-
const want = 3 << 20
12+
// Wasm page size.
13+
const pageSize = 64 * 1024
14+
15+
// Expect less than 3 MB + 1 page of memory usage for a small wasm
16+
// program. This reflects the current allocator. If the allocator
17+
// changes, update this value.
18+
const want = 3<<20 + pageSize
1619

1720
var w = io.Discard
1821

1922
func main() {
2023
fmt.Fprintln(w, "hello world")
2124

22-
const pageSize = 64 * 1024
2325
sz := uintptr(currentMemory()) * pageSize
2426
if sz > want {
2527
fmt.Printf("FAIL: unexpected memory size %d, want <= %d\n", sz, want)

0 commit comments

Comments
 (0)