3 ms·
Link-time optimization means that you're probably not going to take that much of a performance hit. But yes, opaque structs do enforce that it will be treated
by Dwedit 3y ago
Link-time optimization means that you're probably not going to take that much of a performance hit.
But yes, opaque structs do enforce that it will be treated as a plain pointer, and the compiler (usually) cannot treat it as an aggregate of variables.
- Athas 3y agoIf a linker did that, changing the layout would be an ABI-breaking change. I think this opaque struct design is most common for dynamically loaded libraries, where link time optimisation does not occur (unless dynamic linkers got a lot more fancy recently).