gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Size of packed sets


From: Michael Riedl
Subject: Size of packed sets
Date: Sat, 4 Jan 2020 15:49:54 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

Gaius,

first of all a happy new year to you.

Can you please have a short look on the attached code.

MODULE mktest;

FROM SYSTEM   IMPORT TSIZE,BITSPERLOC;
FROM SWholeIO IMPORT WriteCard;
FROM STextIO  IMPORT WriteString,WriteLn;

TYPE  GenOpts   = (opt1,opt2,opt3,opt4,opt5,opt6,opt7,opt8);
      GenOptSet = PACKEDSET OF GenOpts;

TYPE  BitSet8   = PACKEDSET OF [0..BITSPERLOC - 1];

BEGIN
  WriteString(" TSIZE(GenOptSet)  = "); WriteCard(TSIZE(GenOptSet),1); WriteLn;
  WriteString(" TSIZE(BitSet8)    = "); WriteCard(TSIZE(BitSet8)  ,1); WriteLn;
  WriteString(" SYSTEM.BITSPERLOC = "); WriteCard(BITSPERLOC      ,1); WriteLn;
END mktest.


I am wondering why the size of BitSet8 and GenOptSet is 4 bytes - would have expected 1.

Maybe that's per intention - please let me know.


Greetings

Michael



reply via email to

[Prev in Thread] Current Thread [Next in Thread]