Sequential layout: Specify the packing size.
连续布局:指定封装大小。
Compute the natural packing size for the field: If the field is a simple data type, use the size.
计算字段的自然封装大小:如果该字段是简单数据类型,则使用该大小。
Occasionally, the field is used to reduce memory requirements by producing a tighter packing size.
偶尔,字段用于通过产生更紧密的封装大小来降低内存要求。
Explicit layout: Either specify the offset of each field or specify the class size and the packing size.
显式布局:指定每个字段的偏移量,或者指定类大小和封装大小。
A field is aligned according to either its natural size or the packing size, whichever results in the smaller offset of the field.
字段根据其自然大小或封装大小来对齐,以使字段偏移量最小的大小为准。
The offset is the first memory location that is equal to or larger than the minimum, and a multiple of the effective packing size computed in step 3.
偏移量是等于或大于最小值的第一个内存位置,并且是步骤3中计算的有效封装大小的倍数。
If the field is itself a structure, compare the packing size of that structure to the size of the largest field in that structure, and use the smaller of the two values.
如果该字段自身是一个结构,则比较该结构的封装大小与结构中最大字段的大小,并使用两者中较小的值。
Packing size:25KG in paper-plastic composite bag.
包装:用纸塑复合袋包装,每包净重25KG。
Packing size:25KG in paper-plastic composite bag.
包装:用纸塑复合袋包装,每包净重25KG。
应用推荐