-
Notifications
You must be signed in to change notification settings - Fork 464
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 basepoint table constants &'static
references
#488
Conversation
618fcc3
to
e42155b
Compare
According to the rust reference: https://doc.rust-lang.org/reference/items/constant-items.html
So the reference doesn't guarantee that the current implementation won't end up duplicating the table And I'm not longer sure that even a const reference is enough: rust-lang/rust#72004 |
Okay, I figured out how to make all of the basepoint tables They're now all |
fe1bd6d
to
d0465a8
Compare
8edee3c
to
8716dcb
Compare
This ensures they have a fixed address and aren't duplicated across compilation units. Since they were already always borrowed, this changes the static values to be `&'static` addresses to ensure they're always borrowed rather than potentially copied.
8716dcb
to
3c6ed86
Compare
Phew, green again. Sidebar: we might consider feature-gating these basepoint tables. Embedded users would probably appreciate that. Edit: opened #489 |
Looks good, thank you! This is how I checked the fmt step:
|
All current accesses to the basepoint tables currently use explicit borrowing.
It's good borrowing is used to prevent them from being copied onto the stack, however instead of requiring the caller to borrow the constant, instead the constant can simply be defined as a
&'static
reference.Closes #486 (I think? cc @elichai)