-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Use critical-section for heap locking, rename to embedded-alloc
.
#56
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @thalesfragoso (or someone else) soon. Please see the contribution instructions for more information. |
Maybe it should be |
Maybe add a |
Having customizable critical sections also benefits the use case of the nRF softdevice (which requires users never to turn off interrupts completely). If this requires an API change, it might be worth considering whether that change could also be used for non-critical-section exclusitivness. A concrete setup I have in mind is always failing attempts to allocate from interrupts (which in setups without context switching would mean that little to no is needed; of course, if critical_section also allows such a null-implementation, all the better). |
embedded-alloc
.
Discussed on today's WG meeting. chatlogs, it was decided to rename to |
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.
LGTM, @rust-embedded/cortex-m?
> A heap allocator for Cortex-M processors | ||
> A heap allocator for embedded systems. | ||
|
||
Note that using this as your global allocator requires nightly Rust. | ||
|
||
This project is developed and maintained by the [Cortex-M team][team]. |
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 this be moved to the HAL team?
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.
That might make sense if they agree, but I think we can do it as a separate PR.
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.
LGTM
bors r+ |
Build succeeded: |
I've renamed this repo and published to https://crates.io/crates/embedded-alloc 🎉 |
@adamgreig could you add the cortex-m team as an owner on crates.io as well? |
Thanks for the reminder, done. |
653: Rename to embedded-alloc r=eldruin a=Jzow CC [#56](rust-embedded/embedded-alloc#56). Co-authored-by: James Zow <jameszow@163.com>
This uses
critical_section::with
instead ofcortex_m::interrupt::free
to acquire a critical section. This allows customizing the critical section implementation, to make it sound for multicore chips for example.This is a breaking change, so it'll require a 0.5 release.
Interestingly this makes the crate not cortex-m specific anymore. Perhaps it could be renamed to something more general?
TODO