[fpc-devel] Data alignment feature

Adriaan van Os fpc at microbizz.nl
Fri Jan 26 22:25:25 CET 2018


J. Gareth Moreton wrote:

> Florian has implemented a fix recently that allows for better memory alignment using $codealign - true 
> though, I do think we need something to guarantee aligned memory from a function akin to GetMem, since one 
> way or another, there is a performance penalty in using dynamic arrays over raw pointers (although it's not 
> too bad).

I have many objections against the built-in dynamic arrays and never use them.

> For Florian's fix though, any local variables are given the correct alignment on the stack, even if the 
> stack is unaligned beforehand.

That's good news. Can you give a small code example ? And I would suggest  to add test-programs 
(checking the addeess of aligned global, heap and stack variables) to the fpc test-suite,

Regards,

Adriaan van Os




More information about the fpc-devel mailing list