Hacker News new | ask | show | jobs
by Someone 4158 days ago
"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.

1 comments

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