Structures Flashcards

(2 cards)

1
Q

memory allocation

A

In addition to aligning the fields of a record at reasonable offset
boundaries, most compilers will also ensure that the length of the entire
record is a multiple of two, four, or eight bytes. They accomplish this by
adding padding bytes at the end of the record to fill out the record’s size.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Manual memory padding

A
type
aRecord: packed record
bField :byte;
padding0 :array[0..2] of byte; (* add padding to dword align wField *)
wField :word;
padding1 :word;
(* add padding to dword align dField *)
dField :dword;
end;
How well did you know this?
1
Not at all
2
3
4
5
Perfectly