What does “Packed Now Forces Byte Alignment of Records” mean?

前端 未结 4 682
一生所求
一生所求 2020-12-24 13:19

The What\'s New for Delphi XE2 contains the following.

Packed Now Forces Byte Alignment of Records

If you have legacy code that uses the

4条回答
  •  天涯浪人
    2020-12-24 14:08

    As far as I remember, record used to be packed since a version of the compiler around Delphi 5-6.

    Then, for performance reasons, plain record fields were aligned, according to the settings in the project option. If you define a packed record there won't be any alignment within the record.

    The text you are quoting seems related not specifically to XE2, but to a Delphi 2009 change. See this Blog entry for historical purpose.

    I guess that "'Packed' Now Forces Byte Alignment of Records" refers to the Delphi 2009 {$OLDTYPELAYOUT ON} feature - which may have some implementation issue before XE2. I agree with you: it sounds like a documentation issue.

提交回复
热议问题