Skip to content
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

unsafe improvements #6551

Merged
merged 5 commits into from
Oct 21, 2024
Merged

unsafe improvements #6551

merged 5 commits into from
Oct 21, 2024

Commits on Oct 11, 2024

  1. Configuration menu
    Copy the full SHA
    cab348d View commit details
    Browse the repository at this point in the history
  2. Remove unnecessarily scary use of MaybeUninit.

    The MaybeUninit doesn't ever hold any uninitialized bytes, but if it _did_,
    then this would have been UB! Because the write can write fewer than 8
    bytes, it would leave the remaining bytes uninitialized.
    
    Since the `MaybeUninit<u64>` is never uninitialized, we can remove
    the use of `MaybeUninit`, and just use `u64`. Then it becomes clear
    that the only thing for the unsafe block is the `copy_nonoverlapping`.
    ssbr committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    7d23f7e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c6201c7 View commit details
    Browse the repository at this point in the history

Commits on Oct 14, 2024

  1. Push count <= 8 precondition into doc comment.

    The alternative would be to actually convert the `debug_assert` to
    an `assert`, or clamp to 8, but both of these could conceivably
    have a performance impact, so in the interest of being a pure
    win, with no downsides, that change is left to a future editor.
    ssbr committed Oct 14, 2024
    Configuration menu
    Copy the full SHA
    c1c8bec View commit details
    Browse the repository at this point in the history
  2. cargo fmt

    I hear git has an `absorb` extension, but I don't have it. :(
    ssbr committed Oct 14, 2024
    Configuration menu
    Copy the full SHA
    8abab9a View commit details
    Browse the repository at this point in the history