Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Pascal Misc > Re: FreePascal'...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 5 Topic 720 of 811
Post > Topic >>

Re: FreePascal's $PackRecords and alignment

by Jonas Maebe <Jonas.Maebe@[EMAIL PROTECTED] > Feb 21, 2007 at 01:36 PM

In article <slrnetod98.mg3.marcov@[EMAIL PROTECTED]
>,
 Marco van de Voort <marcov@[EMAIL PROTECTED]
> wrote:

> As far as I got it from a recent discussion with FPC devels:
> 
> - packrecords <x> means that a field of size <x> is aligned on a <x>
byte
>   boundery. 
> - A field with a larger size than <x> is also aligned on <x> 

The more common way to say this is, that
a) every type has a so-called natural alignment, which usually (but not 
always!) is the size of this type
b) {$packrecords x} means that if a type appears in a record, it will be 
aligned at min(x,natural_alignment(type)).

> - packrecords C says to take the default of C. I believe it
>   nowadays also can be 8.

No, packrecords C has its own semantics which are different from 
{$packrecords x}. Moreover these semantics vary between different 
platforms.


Jonas
 




 5 Posts in Topic:
FreePascal's $PackRecords and alignment
Stephen <stephen@[EMAI  2007-02-21 00:14:14 
Re: FreePascal's $PackRecords and alignment
Marco van de Voort <ma  2007-02-21 12:03:52 
Re: FreePascal's $PackRecords and alignment
Jonas Maebe <Jonas.Mae  2007-02-21 13:36:40 
Re: FreePascal's $PackRecords and alignment
Marco van de Voort <ma  2007-02-21 14:34:29 
Re: FreePascal's $PackRecords and alignment
Jonas Maebe <Jonas.Mae  2007-02-21 13:33:46 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Jul 26 0:54:51 CDT 2008.