resolved: rearrange DnsResourceRecord for better layout
The structure is rearranged to have less holes. Also fields in the union are rearranged not to have holes (though most variants of the union still have some padding at the end). The full size does not decrease a lot, but the compiler should be able to copy less bytes when it knows the specific type of the union. Bitfields are dropped because they don't give any memory savings due to alignment requirements (but would still require more complex to access). The change from the this and previous commit: /* size: 128, cachelines: 2, members: 13 */ /* sum members: 112, holes: 3, sum holes: 15 */ /* sum bitfield members: 2 bits, bit holes: 1, sum bit holes: 6 bits */ ↓ /* size: 112, cachelines: 2, members: 13 */ /* sum members: 108, holes: 1, sum holes: 4 */
Loading
Please register or sign in to comment