mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-11-27 14:04:56 +01:00
reclaim stack space used in init
This commit is contained in:
parent
b8b13573ae
commit
bc10fe266d
1 changed files with 10 additions and 2 deletions
|
@ -66,9 +66,17 @@ pub fn app(app: &App, analysis: &Analysis, extra: &Extra) -> TokenStream2 {
|
|||
|
||||
#(#pre_init_stmts)*
|
||||
|
||||
#[inline(never)]
|
||||
fn __rtic_init_resources<F>(f: F) where F: FnOnce() {
|
||||
f();
|
||||
}
|
||||
|
||||
// Wrap late_init_stmts in a function to ensure that stack space is reclaimed.
|
||||
__rtic_init_resources(||{
|
||||
#call_init
|
||||
|
||||
#(#post_init_stmts)*
|
||||
});
|
||||
|
||||
#call_idle
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue