Skip to content
C and C++Article

Structure packing in C: memory layout and padding

Eric S. Raymond published the article “The Lost Art of Structure Packing”, on arranging the fields of C structures and memory layout. Wendelmaques shows how to audit and control that layout in production systems.

By Wendelmaques Pereira ·

Source: A arte perdida de organizar estruturas (catb.org). Text prepared with AI from this source.

What happened and what to do

The article by Eric S. Raymond, titled “The Lost Art of Structure Packing”, addresses how the fields of a C structure are placed in memory and how the ordering and alignment of those fields affect the final size of the record. The text is dated 28 February 2026 and focuses on this technical topic without addressing AI applications.

For a company, the practical point is that poorly planned layouts waste memory and can make binary protocols and data formats fragile across platforms. An engineering response can include reviewing the most used structures, automated size and alignment checks in the build pipeline, tests that compare layouts across architectures, and a memory consumption dashboard to identify the components with the most waste.

How the consultancy can help

Diagnosis of the company's critical C structures, with measurement of padding and alignment, and implementation of automated layout checks in the build pipeline, with supported operation after delivery.

Next step

If your C system uses large structures or binary formats shared across platforms, send a short description of the case and receive a scoped proposal from Wendelmaques.

Looking for something else?Frequently asked questionsGuidesContact