On 11 okt '12, Jonas Maebe wrote: 

> As mentioned before, it not
only depends on the platform, but also on the contents of the
object/record. E.g., a badly misaligned double will generally give much
worse performance even on Intel. 
> 
>> This makes me wonder if
>>
choosing a proper value for $PACKRECORDS could make my file readable
>>
safely on all platforms, only needing to convert the endianess if
>>
applicable. This would not force me to do manual padding in my
structs.
>> Say I use a value of 16 would that cover all ABI's FPC
currently
>> supports?
> 
> Yes.

So misalignment of for instance a
double (or whatever type) will only happen if the record is packed and
the packed value is smaller than what the ABI prescribes, correct?


Let's assume I set the record to packed 16bytes, this would make
reading and writing records as a whole safe on all platform/architecture
combinations right? Apart from a few padding bytes, what are the
performance penalties of doing this then? Why would there be penalties?


Darius 
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to