Make Float work with no_std#50
Closed
vkahl wants to merge 3 commits into
Closed
Conversation
This is just anecdotal evidence, but in some cases, I did measure faster runtimes when using #[inline(always)] for delegating methods in the past. Since most methods (all except 2) implemented by this crate are solely delegating calls to the wrapped type, I don't see any reason why not to give the compiler the strongest possible inlining suggestion for these methods.
Member
|
The I'm less comfortable with the |
bors Bot
added a commit
that referenced
this pull request
Jul 5, 2023
56: Make Float work with no_std (rebased #50) r=cuviper a=cuviper - Use ::core::num::FpCategory when deriving Float to work with no_std - Get rid of unnecessary double-borrowing to fix clippy lint Co-authored-by: vkahl <42325420+vkahl@users.noreply.github.com> Co-authored-by: Valentin Kahl <code@valentin-kahl.de>
Member
|
Merged in #56 without the inline change. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Float macro is referencing ::std::num::FpCategory and thus doesn't work with no_std yet. Replacing it with ::core::num::FpCategory shouldn't break any existing code but provides no_std compatibility when needed.
After doing this change, I added two more commits to my fork. I think these should be pretty noncontroversial. Otherwise I'd already be happy if only the first one (e1a99e1) got merged.