CodeQL library for C/C++
codeql/cpp-all 0.12.10 (changelog, source)
Search

Member predicate PaddedType::optimalSize

Gets the optimal size of this type on architecture arch, that is, the sum of the sizes of all fields, ignoring padding between them, but adding any trailing padding required to align the type properly. This is a lower bound on the actual size that can be achieved just by reordering fields, and without reorganizing member structs’ field layouts.

int optimalSize(Architecture arch)