[Lazarus] Online LCL docs - Error 404
Michael Van Canneyt
michael at freepascal.org
Tue Apr 28 10:03:04 CEST 2009
Roland Turcan wrote:
> Hello All,
>
> I have found some new information about this problem:
>
> 1.
>
> TYPE TMyOne =record
> First:integer;
> Second:integer;
> end;
>
> ... then the size of this object is 2*4 bytes.
>
> 2.
>
> TYPE TMyOne =record
> First:integer;
> Second:double;
> END;
>
> ... where I would expect 4 + 8 bytes = 12 bytes
> ... but the size of this object is 16!
>
>
> 3.
>
> TYPE TMyOne =record
> First:integer;
> Second:extended;
> END;
>
> ... where I would expect 4 + 16 bytes = 20 bytes
> ... but the size of this object is 32!
>
>
> So this proves me, that compiler tries to align the data structure to
> multiplied size of biggest element to which fit all elements.
>
> I have understood this behavior, but this happens me in these cases:
>
> 1. Delphi 7
> 2. Kylix 3
> 3. Lazarus on Ubuntu
> 4. Lazarus on PowerPC Mac OS X 10.5
>
> but on Intel Based Mac OS X 10.5 Mini with Intel Duo 2 Core it
> DOESN'T. Therefore I have problems with parsing of binaries back to
> memory.
>
> I don't expect CPU specific problem, otherwise it would not work
> active projects, therefore I think it must be compiler specific
> problem.
>
> Do you have any idea?
>
> Thanks in advance.
>
> Greetings, TRoland;
Have you checked packed records ?
Boguslaw
More information about the Lazarus
mailing list