Packed

From Lazarus wiki
Revision as of 03:00, 22 August 2017 by FPC user (talk | contribs) (initial page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Deutsch (de) English (en) русский (ru)

The reserved word packed tells the compiler to use as little memory as possible for a particular complex data type. Without specifying packed, the compiler may insert extra unused bytes between members in order to align the data on full word boundaries for faster access by the CPU. So packed sacrifices some speed while reducing the memory used.


Example:

  type TPArray = Packed array[...] of ...;
  type TPClass = Packed class  ... end;
  type TPObject = Packed object ... end;
  type TPRecord = Packed record ... end;