[fpc-pascal] Memory alignment with FPC

Jonas Maebe jonas.maebe at elis.ugent.be
Thu Oct 11 15:09:03 CEST 2012


On 11 Oct 2012, at 15:00, dhkblaszyk at zeelandnet.nl wrote:

> 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?

Yes.

> 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?

The cpu cache will contain lots of unused padding bytes.


Jonas



More information about the fpc-pascal mailing list