Hacker News new | ask | show | jobs
The day byte alignment came back to bite me (njern.co)
2 points by njern 4154 days ago
1 comments

"Changing the instances of 13 to 16 in the above code fixed the problem"

Not in my book. It made the symptom disappear, but the problem stayed. You don't compute magical constants and put them in your source code if your language has AlignOf, Sizeof and Offsetof.

As you rightly point out, the more correct solution is of course to use unsafe.Sizeof()