mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-04 19:17:47 +00:00
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:
committed by
Ron Evans
parent
bd1d93b705
commit
5f96d2b784
@@ -40,7 +40,7 @@ func CreateStackSizeLoads(mod llvm.Module, config *compileopts.Config) []string
|
||||
stackSizesGlobal := llvm.AddGlobal(mod, stackSizesGlobalType, "internal/task.stackSizes")
|
||||
stackSizesGlobal.SetSection(".tinygo_stacksizes")
|
||||
defaultStackSizes := make([]llvm.Value, len(functions))
|
||||
defaultStackSize := llvm.ConstInt(functions[0].Type(), config.Target.DefaultStackSize, false)
|
||||
defaultStackSize := llvm.ConstInt(functions[0].Type(), config.StackSize(), false)
|
||||
for i := range defaultStackSizes {
|
||||
defaultStackSizes[i] = defaultStackSize
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ func TestCreateStackSizeLoads(t *testing.T) {
|
||||
testTransform(t, "testdata/stacksize", func(mod llvm.Module) {
|
||||
// Run optimization pass.
|
||||
transform.CreateStackSizeLoads(mod, &compileopts.Config{
|
||||
Options: &compileopts.Options{},
|
||||
Target: &compileopts.TargetSpec{
|
||||
DefaultStackSize: 1024,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user