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

fix signature of Step::steps_between implementations #513

Merged
merged 5 commits into from
Nov 29, 2024

Commits on Nov 24, 2024

  1. fix signature of Step::steps_between implementations

    A recent nightly changed the signature of Step::steps_between to match
    the signature of Iterator::size_hint. This patch changes our
    implementations to match the new signature.
    Freax13 committed Nov 24, 2024
    Configuration menu
    Copy the full SHA
    b9e3d25 View commit details
    Browse the repository at this point in the history
  2. actually test with slice instead of array

    Without the as_slice call, the value passed to from_ptr was &[i32; 5]
    which is *not* a slice.
    Freax13 committed Nov 24, 2024
    Configuration menu
    Copy the full SHA
    3d65714 View commit details
    Browse the repository at this point in the history
  3. fix tests on 32-bit platforms

    Freax13 committed Nov 24, 2024
    Configuration menu
    Copy the full SHA
    1e5b5a1 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    8fb0668 View commit details
    Browse the repository at this point in the history
  5. fix Page Step impl on 32-bit platforms

    Previously, we scaled count as a usize, not a u64. This is bad because
    stepping forward by 0x10_0000 is perfectly fine, yet we were always
    rejecting this because 0x10_0000 * 0x1000 doesn't fit in usize on
    32-bit platforms. Similarly, we would fail to return a step count above
    or equal to 0x10_0000 because the call to
    <VirtAddr as Step>::steps_between would fail.
    Never scale usize values, instead, always scale u64 values. To make
    this easier to work with, this patch adds variants of the Step
    functions to VirtAddr that take and return u64 instead of usize.
    This patch also adds some regression tests.
    Freax13 committed Nov 24, 2024
    Configuration menu
    Copy the full SHA
    b4b6663 View commit details
    Browse the repository at this point in the history