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 <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
This commit is contained in:
Michael Anthony Knyszek
2025-03-09 17:19:48 +00:00
committed by Michael Knyszek
parent 7bfeb43509
commit 7fbf54bfeb
2 changed files with 13 additions and 5 deletions

View 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.

View 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)