mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-11-27 14:04:56 +01:00
Merge #191
191: generate resource proxies only when needed r=japaric a=japaric only `static mut` resources need proxies just a codegen optimization Co-authored-by: Jorge Aparicio <jorge@japaric.io>
This commit is contained in:
commit
3b68816a75
1 changed files with 33 additions and 30 deletions
|
@ -234,6 +234,8 @@ fn resources(
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// generate a resource proxy when needed
|
||||||
|
if res.mutability.is_some() {
|
||||||
if let Some(Ownership::Shared { ceiling }) = analysis.ownerships.get(name) {
|
if let Some(Ownership::Shared { ceiling }) = analysis.ownerships.get(name) {
|
||||||
let ptr = if res.expr.is_none() {
|
let ptr = if res.expr.is_none() {
|
||||||
quote!(#name.as_mut_ptr())
|
quote!(#name.as_mut_ptr())
|
||||||
|
@ -270,6 +272,7 @@ fn resources(
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let mod_resources = if mod_resources.is_empty() {
|
let mod_resources = if mod_resources.is_empty() {
|
||||||
quote!()
|
quote!()
|
||||||
|
|
Loading…
Reference in a new issue