aboutsummaryrefslogtreecommitdiff
path: root/macros/src/codegen/resources.rs
diff options
context:
space:
mode:
authorGravatar bors[bot] <26634292+bors[bot]@users.noreply.github.com> 2019-10-22 05:29:23 +0000
committerGravatar GitHub <noreply@github.com> 2019-10-22 05:29:23 +0000
commit7d2fa7014dd30ed477180615a4a651535644e51d (patch)
tree98034938ce7c9bdbecf6b7174fb3c1204ed44896 /macros/src/codegen/resources.rs
parent1fe9767ebac37a6f220d5e84505e16691b370002 (diff)
parent9f092efe24a712add30a0512a922cd64d3666069 (diff)
downloadrtic-7d2fa7014dd30ed477180615a4a651535644e51d.tar.gz
rtic-7d2fa7014dd30ed477180615a4a651535644e51d.tar.zst
rtic-7d2fa7014dd30ed477180615a4a651535644e51d.zip
Merge #257
257: do not zero late resource memory on boot r=korken89 a=japaric this is done using the `.uninit` linker section; this optimization was already being applied to message buffers but I forgot to also apply it to late resources Co-authored-by: Jorge Aparicio <jorge@japaric.io>
Diffstat (limited to 'macros/src/codegen/resources.rs')
-rw-r--r--macros/src/codegen/resources.rs12
1 files changed, 10 insertions, 2 deletions
diff --git a/macros/src/codegen/resources.rs b/macros/src/codegen/resources.rs
index bec46020..8cb788d1 100644
--- a/macros/src/codegen/resources.rs
+++ b/macros/src/codegen/resources.rs
@@ -32,7 +32,11 @@ pub fn codegen(
cross_initialized: false,
} => (
util::cfg_core(*core, app.args.cores),
- util::link_section("data", *core),
+ if expr.is_none() {
+ util::link_section_uninit(Some(*core))
+ } else {
+ util::link_section("data", *core)
+ },
),
// shared `static`s and cross-initialized resources need to be in `.shared` memory
@@ -42,7 +46,11 @@ pub fn codegen(
} else {
None
},
- None,
+ if expr.is_none() {
+ util::link_section_uninit(None)
+ } else {
+ None
+ },
),
};