Skip to content

Sizes should probably be represented as u64, not usize #7

@HadrienG2

Description

@HadrienG2

There are still a number of 32-bit CPUs in the wild, and the Linux x32 ABI uses 32-bit pointers on 64-bit architectures in order to save some memory bandwidth on programs with small working sets. On such platforms, Rust's usize will map to u32, and thus ByteSize will use an u32 counter of bytes internally. But that leads to a maximum representable size of 4 GiB, which is too small to adequately represent modern storage.

For this reason, and taking into account that u64 support can be efficiently emulated on 32-bit platforms, I would propose that ByteSize use u64 as a byte counter rather than usize.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions