aboutsummaryrefslogtreecommitdiffhomepage
path: root/targets/cortex-m.json
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2020-07-18 13:36:28 +0200
committerRon Evans <[email protected]>2020-08-27 19:23:22 +0200
commita21a039ac774e80d279cf946729ef409575150f8 (patch)
treed78b14739c1d557c782e25fb82266db419a6d8f5 /targets/cortex-m.json
parenta761f556ff81b52a7693dd3c62ac4c1d6398a724 (diff)
downloadtinygo-a21a039ac774e80d279cf946729ef409575150f8.tar.gz
tinygo-a21a039ac774e80d279cf946729ef409575150f8.zip
arm: automatically determine stack sizes
This is a big change that will determine the stack size for many goroutines automatically. Functions that aren't recursive and don't call function pointers can in many cases have an automatically determined worst case stack size. This is useful, as the stack size is usually much lower than the previous hardcoded default of 1024 bytes: somewhere around 200-500 bytes is common. A side effect of this change is that the default stack sizes (including the stack size for other architectures such as AVR) can now be changed in the config JSON file, making it tunable per application.
Diffstat (limited to 'targets/cortex-m.json')
-rw-r--r--targets/cortex-m.json2
1 files changed, 2 insertions, 0 deletions
diff --git a/targets/cortex-m.json b/targets/cortex-m.json
index 2a91f1cd5..958d51eed 100644
--- a/targets/cortex-m.json
+++ b/targets/cortex-m.json
@@ -8,6 +8,8 @@
"linker": "ld.lld",
"rtlib": "compiler-rt",
"libc": "picolibc",
+ "automatic-stack-size": true,
+ "default-stack-size": 1024,
"cflags": [
"-Oz",
"-mthumb",