[fpc-devel] Aligned dynamic arrays

Jonas Maebe jonas at freepascal.org
Sat Mar 30 14:10:48 CET 2019


On 30/03/2019 14:07, Ryan Joseph wrote:
> 
> I never got $align to work for records.

FPC always aligns data to its alignment as specified by the platform 
ABI. {$align x} can be used to limit this alignment to a lower number. 
It cannot be used to increase it.

> Why not use a similar directive for array alignment? That would solve the problem I discovered with insert/concat.
> 
> {$push}
> {$align-array 4096}
> type
>    TIntArray = array of integer;
> {$pop}

Arrays are aligned to the alignment requirements of their components. 
Again, a vector type would solve this, since vectors have their own 
alignment requirements in the ABIs.


Jonas



More information about the fpc-devel mailing list