From: Michael Anthony Knyszek Date: Sun, 9 Mar 2025 17:19:48 +0000 (+0000) Subject: internal/buildcfg: enable greenteagc experiment by default X-Git-Tag: go1.26rc1~692 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=7fbf54bfebf9243550177bc6871d80e58bedf1a6;p=gostls13.git 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 #73581. Change-Id: I485df16c3cf59803a8a1fc852b3e90666981ab09 Reviewed-on: https://go-review.googlesource.com/c/go/+/656195 LUCI-TryBot-Result: Go LUCI Auto-Submit: Michael Knyszek Reviewed-by: Cherry Mui --- diff --git a/src/internal/buildcfg/exp.go b/src/internal/buildcfg/exp.go index d06913d9a7..fb6b5859e3 100644 --- a/src/internal/buildcfg/exp.go +++ b/src/internal/buildcfg/exp.go @@ -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. diff --git a/test/wasmmemsize.dir/main.go b/test/wasmmemsize.dir/main.go index e3aa5b5e92..c51e6b3b04 100644 --- a/test/wasmmemsize.dir/main.go +++ b/test/wasmmemsize.dir/main.go @@ -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)