-
Notifications
You must be signed in to change notification settings - Fork 168
safe &'static mut
references through a runtime checked macro
#70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Looks great, I'm not too hot about the name |
Me neither.
Sounds better to me. Please continue bikeshedding :-). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found some minor nits, but otherwise this looks great! I also agree that singleton!
is a nicer name than static_!
.
src/macros.rs
Outdated
@@ -22,3 +22,44 @@ macro_rules! iprintln { | |||
iprint!($channel, concat!($fmt, "\n"), $($arg)*); | |||
}; | |||
} | |||
|
|||
/// Macro to create an statically allocated value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be "a statically allocated value", I think?
src/macros.rs
Outdated
/// | ||
/// # Example | ||
/// | ||
/// ``` ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be possible to un-ignore
this example by adding this to the beginning:
# #[macro_use] extern crate cortex_m;
// rest of example
It still won't run, because of the deliberate panic, but the ignore
can be replaced with no_run
, which will at least will make sure that the example can be compiled.
OK, thanks everyone for the feedback. Let's go ahead with @homunkulus r+ |
📌 Commit 4f9664c has been approved by |
safe `&'static mut` references through a runtime checked macro runtime checked implementation of japaric/cortex-m-rtfm#59 that doesn't depend on RTFM macros TODO - [ ] bikeshed macro syntax
☀️ Test successful - status-travis |
to make it more compatible with LLD. This commit contains no functional changes. fixes #70 Overview of changes: - Alignment checks are enabled now that rust-lld (LLD 7.0) supports the modulo operator. - Removed some private symbols (e.g. __foo) in favor of ADDR and SIZEOF. - Turned .got into a NOLOAD section now that rust-lld supports it. - Replaced `ABSOLUTE(.)` with `.` as an old LLD overlap bug seems to be gone and ABSOLUTE seems to cause problems, like #70, on bigger programs. - Made the linker assertion messages more uniform. - Extended test suite to check that linking works with both rust-lld and GNU LD.
84: refactor the linker script r=therealprof a=japaric to make it more compatible with LLD. This commit contains no functional changes. fixes #70 Overview of changes: - Alignment checks are enabled now that rust-lld (LLD 7.0) supports the modulo operator. - Removed some private symbols (e.g. __foo) in favor of ADDR and SIZEOF. - Turned .got into a NOLOAD section now that rust-lld supports it. - Replaced `ABSOLUTE(.)` with `.` as an old LLD overlap bug seems to be gone and ABSOLUTE seems to cause problems, like #70, on bigger programs. - Made the linker assertion messages more uniform. - Extended test suite to check that linking works with both rust-lld and GNU LD. r? therealprof (chosen at random) Co-authored-by: Jorge Aparicio <[email protected]>
runtime checked implementation of japaric/cortex-m-rtfm#59 that doesn't depend on RTFM macros
TODO