4 ms·
You mean that it reads the values into single byte registers and assembles those back into the value you want?
by looki 10y ago
You mean that it reads the values into single byte registers and assembles those back into the value you want?
- minipci1321 10y agoYes, that is what I meant. It does that even for fields of a structure that are, strictly speaking, not subject to packing -- when, for example, you put a double as the very first field in a struct, and define the entire struct as packed. The double will still be assembled from 8 1-byte reads.
- looki 10y agoThat sounds quite horrible - today was very eye-opening on why people almost never pack structs tightly, thank you.
- vvanders 10y agoYup, same type of thinking helps when working with byte streams, image formats and the like. Working within your native, aligned word size can have wonderful performance benefits.