3 ms·
Rust’s usize does the jobs of both uintptr_t (a pointer-width type) and size_t (a data-width type)
by fanf2 5y ago
Rust’s usize does the jobs of both uintptr_t (a pointer-width type) and size_t (a data-width type)
- Diggsey 5y agosize_t is just a type that's large enough to hold the largest possible object. It doesn't necessarily relate to the register size... This means that `uintptr_t` must be at least as large as `size_t`, and so Rust's usage of `usize` for both is not problematic.