Sign in Join
Wiki copytemporary

Packed/de

Deutsch · English · Русский

Zurück zu den reservierten Wörtern.

Das reservierte Wort packed weist den Compiler an, für das Objekt sowenig Speicher wie möglich zu verwenden.

Das wird dadurch erreicht, das zwischen einzelnen Elementen kein Zwischenraum gelassen wird.

D. h. die einzelnen Elemente werden auch an ungeraden Speicheradressen ausgerichtet.

Beispiel:

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

Es ist auch bitweises Packen möglich, dies geschieht mit bitpacked.

Das Array a0 ist ein Byte groß.

Das normal deklarierte a1 aber 8 Byte.

pascal
var
  a0: bitpacked array[0..7] of Boolean; // 1 Byte
  a1: array[0..7] of Boolean;           // 8 Byte

From the Free Pascal wiki, page "Packed/de", as it stood on 2020-02-23 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

Revision 2, last changed by WikiArchive .

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.