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

Make the creation of TxRingEntry and RxRingEntry const #22

Merged
merged 1 commit into from
Aug 29, 2020

Conversation

thalesfragoso
Copy link
Member

This allow for people to create RingEntry on a const context, which saves a considerable amount of stack during initialization if having them in a static.

I also left the non const Default implementations for compatibility and also because of rust-lang/rust#49147, which causes the creation of entries a bit cumbersome since Aligned isn't Copy, so users can use default on non const contexts if they want to.

CC @adamgreig

Copy link
Member

@adamgreig adamgreig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

bors merge

@bors
Copy link
Contributor

bors bot commented Aug 29, 2020

Build succeeded:

@bors bors bot merged commit 4d6b29b into stm32-rs:master Aug 29, 2020
franeklubi pushed a commit to franeklubi/stm32-eth that referenced this pull request Mar 22, 2022
22: Make the creation of TxRingEntry and RxRingEntry const r=adamgreig a=thalesfragoso

This allow for people to create `RingEntry` on a const context, which saves a considerable amount of stack during initialization if having them in a `static`.

I also left the non const `Default` implementations for compatibility and also because of rust-lang/rust#49147, which causes the creation of entries a bit cumbersome since `Aligned` isn't `Copy`, so users can use `default` on non const contexts if they want to.

CC @adamgreig 

Co-authored-by: Thales Fragoso <[email protected]>
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.

2 participants