-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add ConstInitCell
#14
Add ConstInitCell
#14
Conversation
I think I have exactly the use case that needs this. Yet, I would really like to put it in a static context with (Don't pay attention to the |
btw @ivmarkov, you might like some of the "Generic over RawMutex" shenanigans I'm doing over in the new It looks like this at the device level: |
@jamesmunns How about naming it (I considered Reasons:
|
@ivmarkov I don't love it! IMO the "const" part only applies at "init", the static itself isn't const. I don't feel that strongly about it if dirbaio prefers that tho. |
|
Released v2.1.0 |
This adds a "const initialized" variant of StaticCell.
I decided to add a second type, rather than extending StaticCell, because I couldn't see a way to do this without potentially making the value non-zero-initialized.
My other plan was to change the atomicbool into an AtomicU8 with three states:
But then one of the two flavors would have to start with a non-zero init value, which could "infect" the whole type into
.data
instead of.bss
.