Skip to content

Implement ByteValued for i128/u128 #238

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
wants to merge 2 commits into from

Conversation

roypat
Copy link
Member

@roypat roypat commented Jun 14, 2023

Summary of the PR

Implements ByteValued for u128/i128, as well as arrays of them.

I also looked at turning the array implementations into one using const generics (to remove the restriction on them being only implemented for array sizes up to 32), but a combination of Default being a super trait of ByteValued and rust-lang/rust#61415 make this impossible

Requirements

Before submitting your PR, please make sure you addressed the following
requirements:

  • All commits in this PR are signed (with git commit -s), and the commit
    message has max 60 characters for the summary and max 75 characters for each
    description line.
  • All added/changed functionality has a corresponding unit/integration
    test.
  • All added/changed public-facing functionality has entries in the "Upcoming
    Release" section of CHANGELOG.md (if no such section exists, please create one).
  • Any newly added unsafe code is properly documented.

@roypat roypat force-pushed the byte-valued-128 branch 2 times, most recently from 674baa4 to e39f487 Compare June 15, 2023 08:20
roypat added 2 commits June 27, 2023 13:52
The only interesting thing in this commit is adjusting the unit test
that tests these implementations, as u128/i128 can be aligned to 8 byte
boundaries on x86. So only check that reading fails for values
misaligned by 1 through 7 bytes.

Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
@vireshk
Copy link
Contributor

vireshk commented Jun 28, 2023

superseded by #242

@jiangliu jiangliu closed this Jun 28, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants