]> Cypherpunks repositories - gostls13.git/commitdiff
internal/buildcfg: enable greenteagc experiment by default
authorMichael Anthony Knyszek <mknyszek@google.com>
Sun, 9 Mar 2025 17:19:48 +0000 (17:19 +0000)
committerMichael Knyszek <mknyszek@google.com>
Mon, 6 Oct 2025 23:01:40 +0000 (16:01 -0700)
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 #73581.

Change-Id: I485df16c3cf59803a8a1fc852b3e90666981ab09
Reviewed-on: https://go-review.googlesource.com/c/go/+/656195
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
src/internal/buildcfg/exp.go
test/wasmmemsize.dir/main.go

index d06913d9a7f25a92426d6c7e7ca42a9c897e1135..fb6b5859e31a1e017c277fb6b0292ae230fac13e 100644 (file)
@@ -78,12 +78,18 @@ func ParseGOEXPERIMENT(goos, goarch, goexp string) (*ExperimentFlags, error) {
        // things like .debug_addr (needed for DWARF 5).
        dwarf5Supported := (goos != "darwin" && goos != "ios" && goos != "aix")
 
+       // The compiler crashes while compiling some of the Green Tea code.
+       // The Green Tea code is pretty normal, so this is likely a compiler
+       // bug in the loong64 port.
+       greenTeaGCSupported := goarch != "loong64"
+
        baseline := goexperiment.Flags{
                RegabiWrappers:        regabiSupported,
                RegabiArgs:            regabiSupported,
                Dwarf5:                dwarf5Supported,
                RandomizedHeapBase64:  true,
                SizeSpecializedMalloc: true,
+               GreenTeaGC:            greenTeaGCSupported,
        }
 
        // Start with the statically enabled set of experiments.
index e3aa5b5e92154c3c18e7cfbf1a653cf123eaabef..c51e6b3b0476c91b24e4a78f74d4324e62b19634 100644 (file)
@@ -9,17 +9,19 @@ import (
        "io"
 )
 
-// Expect less than 3 MB of memory usage for a small wasm program.
-// This reflects the current allocator. If the allocator changes,
-// update this value.
-const want = 3 << 20
+// Wasm page size.
+const pageSize = 64 * 1024
+
+// Expect less than 3 MB + 1 page of memory usage for a small wasm
+// program. This reflects the current allocator. If the allocator
+// changes, update this value.
+const want = 3<<20 + pageSize
 
 var w = io.Discard
 
 func main() {
        fmt.Fprintln(w, "hello world")
 
-       const pageSize = 64 * 1024
        sz := uintptr(currentMemory()) * pageSize
        if sz > want {
                fmt.Printf("FAIL: unexpected memory size %d, want <= %d\n", sz, want)