4 ms·
> Unless those are actually padded to 32 bits in the VM or something. They are.
by efaref 3y ago
> Unless those are actually padded to 32 bits in the VM or something.
They are.
- o11c 3y agoTo be fair, they're padded in a lot of machine code contexts as well, even if you don't explicitly write `int_fast16_t`. And since Java doesn't expose pointer guts, struct padding is purely a runtime optimization concern, not a language concern.
- nwellnhof 3y agoDon't you mean `int_least16_t`?
- o11c 3y agoNo, the `least` typedefs are irrelevant aliases for the exact type these days (except supposedly some 32-bit-only DSPs exist though. But 9-bit computing has been obsolete for longer than most of us have been alive, despite talking about it). The `fast` typedefs are effectively programmer-opted-in to promotion to register size or something. But compiler optimizations often do the same thing on a per-operation level (signed overflow is UB, unsigned overflow masking can be deferred for addition/subtraction/multiplication and bitwise ops (though some can change the mask)).
- twic 3y agoThey're extended when they're locals or temporaries, but they behave like real 8- and 16- bit values in fields and array elements.
- kaba0 3y agoIn interpreted mode. They can be optimized by the JIT compiler differently though.