by o11c · 1y ago · 0 comments
Admittedly, sometimes for good reason - it locks in the ABI.
The dynamic constructor API can allocate the structure exactly sized without the padding.
An alternative is to make the only member `char opaque[16]` (IIRC some locale-related thing in glibc does this, also I think libpng went through a transition of some sort related to this?), but calculating the size can be difficult outside of trivial cases since you can't use sizeof/offsetof.
It’s a performance oriented custom memory allocator.