News for hackers. Stuff that matters.
Re:The Lost Art of Structure Packing (2018) by throwaway_pdp09 on Monday April 27, 2020 @11:08AM (#22996538)
It's probably not talked about so much now because of the canard that memory is cheap, and because HLLs disguise things a bit too much and so mislead newbies, but to suggest it's lost is plain wrong.
Re:The Lost Art of Structure Packing (2018) by saagarjha on Monday April 27, 2020 @11:36AM (#22996821)
I think the main reason is that many new languages do this for you, at the cost of not guaranteeing a particular structure member order.
Re:The Lost Art of Structure Packing (2018) by WesolyKubeczek on Monday April 27, 2020 @11:57AM (#22997029)
Sheesh, we're trying to be ABI-compatible over here.
Re:The Lost Art of Structure Packing (2018) by saagarjha on Monday April 27, 2020 @01:01PM (#22997631)
For interoperability concerns within the language itself, this is usually solved by making the layout algorithm deterministic or passing around the aggregate around with an invisible pointer. When interacting with other languages, typically there's an attribute to ensure that layout matches declaration order.