Re:Static Integer Types
by fanf2 on Thursday July 01, 2021 @12:53PM
(#27701245)
Rust’s usize does the jobs of both uintptr_t (a pointer-width type) and size_t (a data-width type)
[ Parent
| on HN ]
size_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.