News for hackers. Stuff that matters.
Re:Padding is hard by masklinn on Friday October 09, 2015 @12:36PM (#10361268)
Except technically struct memory layout is currently undefined in Go so you're relying on an implementation detail.
Re:Padding is hard by adonovan on Friday October 09, 2015 @12:53PM (#10361456)
This kind of optimized placement could in principle be done by a sufficiently smart compiler, but no such compiler exists. That's why existing compilers allow their users to control layout by, as you say, relying on an implementation detail.
Re:Padding is hard by masklinn on Friday October 09, 2015 @01:05PM (#10361565)
No, the language can specify source—order struct layout, either by default or opt-in.