Skip to content
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

Change timeout/delay functions to non-async #910

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dalegaard
Copy link

Hi,

Because of a compiler bug, the async implementations of delay/delay_until/timeout/timeout_at produce much larger RAM footprint than they should. This was documented in #890.

This patch replaces those implementations with structs with Future implementations instead. On my current project, over three tasks, this saves 488(776->288) bytes over three tasks that used the delay and timeout functionality. As the target has only 8k of RAM, this was a significant saving.

All tests pass, but if someone could take an extra look at the Delay implementation to verify that it is indeed safe, that would be great. I've not done much work with unsafe Rust so it's new territory for me.

Best regards,
Lasse

Because of a compiler bug, the `async` implementations of
`delay`/`delay_until`/`timeout`/`timeout_at` produce much larger RAM
footprint than they should.

Fixes rtic-rs#890.
@Finomnis
Copy link
Contributor

Finomnis commented Apr 13, 2024

Might have to redo this one after #874 was merged ... :/ sorry for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants