Hacker News new | ask | show | jobs
by myrrlyn 1813 days ago
I am the author of a library that requires knowledge and awareness of integers that are strictly not wider than the general purpose register on the processor; the fact that `usize` is "the largest GPR" on every target Rust knows about is great but I'd still appreciate a distinction between "this fits in exactly one GPR" vs "this fits in the address bus"

_especially_ since the library in question creates pointers that are wider than `usize`

1 comments

The definition clearly says that `usize` is pointer-sized, and makes no reference to register size, so it seems there's already a pretty clear distinction?

If you are specifically looking for a register sized tyoe then you should define it on a per-architecture basis via `cfg()` options.