all: add flag for setting the goroutine stack size

This is helpful in some cases where the default stack size isn't big
enough.
This commit is contained in:
Ayke van Laethem
2022-09-14 14:09:46 +02:00
committed by Ron Evans
parent bd1d93b705
commit 5f96d2b784
9 changed files with 25 additions and 3 deletions
+9
View File
@@ -175,6 +175,15 @@ func (c *Config) AutomaticStackSize() bool {
return false
}
// StackSize returns the default stack size to be used for goroutines, if the
// stack size could not be determined automatically at compile time.
func (c *Config) StackSize() uint64 {
if c.Options.StackSize != 0 {
return c.Options.StackSize
}
return c.Target.DefaultStackSize
}
// UseThinLTO returns whether ThinLTO should be used for the given target. Some
// targets (such as wasm) are not yet supported.
// We should try and remove as many exceptions as possible in the future, so
+1
View File
@@ -28,6 +28,7 @@ type Options struct {
GC string
PanicStrategy string
Scheduler string
StackSize uint64 // goroutine stack size (if none could be automatically determined)
Serial string
Work bool // -work flag to print temporary build directory
InterpTimeout time.Duration