4 ms·
This post shows how knowledge is lost with the past of time. >> Modern CPU hardware performs reads and writes to memory most efficiently when the data is natur
by rsecora 5y ago
This post shows how knowledge is lost with the past of time.
>> Modern CPU hardware performs reads and writes to memory most efficiently when the data is naturally aligned.
Is not only "modern" CPUs, every RISC (80s, 40 years ago) mandate word alignment. In fact, the program will receive a bus fault if not aligned.
The compilers pad between fields to ensure alignment is right. That’s also
why "packed" structures can be defined in some languages.
>> This was is a weird quirk
Not really, a lot of code has been programed that way since I remember (80s).