alexcrichton opened PR #4353 from const-size
to main
:
The more I read over this again the more I think that these should be
constants to explicitly indicate that we're supposed to be able to
optimize for them. Currently I'm predicting that adding memory64 support
will probably double the surface area of each trait (e.g.lower32
and
lower64
) rather than have a parameter passed around. This is in the
hopes that having specialized 32 and 64-bit paths will enable better
optimizations within each path instead of having to check all bounds
everywhere.Additionally one day I'd like to have
fn load(bytes: &[u8; Self::SIZE32])
but that doesn't work today in Rust.<!--
Please ensure that the following steps are all taken care of before submitting
the PR.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
alexcrichton requested fitzgen for a review on PR #4353.
dicej created PR review comment:
Would it be possible to make
next_field
const
so we could keep using it here?
dicej submitted PR review.
dicej submitted PR review.
alexcrichton submitted PR review.
alexcrichton created PR review comment:
I initially attempted that yeah but in
const
Rust we apparently can't take&mut
references which prevented me from calling that. I figured that the amount of duplication here isn't too too big so I'm hoping it won't be too bad.
fitzgen submitted PR review.
alexcrichton merged PR #4353.
Last updated: Nov 22 2024 at 16:03 UTC