Say, is sizeof(void*)
the same as the size processor can atomically access per instruction?
For example, 32-bit processor can read aligned 4 bytes atomically, 64-bit processor can read aligned 8 bytes atomically. While, if it's a 32-bit OS on 64-bit hardware, the atomic access size fall back to 4 bytes.
Note by "atomic access" I mean it fetches as a whole, a counterexample would be 32-bit OS would need to fetch uint64_t
two-pass.
With modern processors this is generally the case, but the language does not guarantee it.
For example, on old x86 processors running in 16-bit real mode, you could have 32 (or even 48-bit pointers, but loading a 32-bit value still required two memory accesses.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With