diff options
| author | Ian McIntyre <ianpmcintyre@gmail.com> | 2024-02-22 16:55:34 -0500 |
|---|---|---|
| committer | Ian McIntyre <ianpmcintyre@gmail.com> | 2024-04-03 09:52:56 -0400 |
| commit | feca35c7c12b3ad2fb8cd5c4e48003da2b283b8b (patch) | |
| tree | 881f438c48b9f99f96d5df914fe0a7c109836c44 /board/build.rs | |
| parent | 1879a2d6be6b72f3a59364200c8b5c75aff9d5f0 (diff) | |
Add environment variable overrides for stack, heap
If you define a runtime, you can call `stack_size_env_override` to
define an optional environment variable checked by the runtime builder.
Same goes for the heap. A user can set these environment variables to
override the runtime's stack / heap size. You can use this package's
examples to try it out; see the updated build script.
There's no default environment variable for either memory region. The
package that defines the runtime needs to opt-in to this feature.
Diffstat (limited to 'board/build.rs')
| -rw-r--r-- | board/build.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/board/build.rs b/board/build.rs index 9ee64e8..8474e85 100644 --- a/board/build.rs +++ b/board/build.rs @@ -28,6 +28,9 @@ fn main() { .data(imxrt_rt::Memory::Dtcm) .bss(imxrt_rt::Memory::Dtcm) .uninit(imxrt_rt::Memory::Dtcm) + .stack_size_env_override("THIS_WONT_BE_CONSIDERED") + .stack_size_env_override("BOARD_STACK") + .heap_size_env_override("BOARD_HEAP") .build() .unwrap() } @@ -37,6 +40,8 @@ fn main() { ) .heap_size(1024) .rodata(imxrt_rt::Memory::Flash) + .stack_size_env_override("BOARD_STACK") + .heap_size_env_override("BOARD_HEAP") .build() .unwrap(), "imxrt1170evk_cm7" => imxrt_rt::RuntimeBuilder::from_flexspi( @@ -44,6 +49,8 @@ fn main() { 16 * 1024 * 1024, ) .rodata(imxrt_rt::Memory::Dtcm) + .stack_size_env_override("BOARD_STACK") + .heap_size_env_override("BOARD_HEAP") .build() .unwrap(), _ => continue, |
