News for hackers. Stuff that matters.
Re:Conflating pointers with arrays: C's biggest mistake? (2009) by amluto on Sunday July 22, 2018 @11:41AM (#17587256)
Except that hashing a block of memory is likely to be much faster than hashing individual fields once there are more than a couple fields.

IMO the right solution would be a special annotation on a struct that says “I want the logical value of this struct to uniquely determine the bytes of the struct’s in-memory representation.”

Of course, adding such an attribute without nasty edge cases may be tricky.

Re:Conflating pointers with arrays: C's biggest mistake? (2009) by Tarean on Sunday July 22, 2018 @01:42PM (#17587860)
But this mostly matter for arrays and then an alternative optimization might be to store it as a structure of arrays. This doesn't need the padding and is more simd friendly.