[fpc-devel] Aligned dynamic arrays

Ryan Joseph ryan at thealchemistguild.com
Sat Mar 30 14:07:21 CET 2019



> On Mar 29, 2019, at 5:30 PM, denisgolovan <denisgolovan at yandex.ru> wrote:
> 
> Also I'd like to get an idea how this functionality is to play with existing alignment directives for records.

I never got $align to work for records. Isn’t that supposed to pad the fields to 16 bytes? Doesn’t work for me.

{$push}
{$align 16}
type
  TVertex = record
    pos: TVec2;
    col: TVec2;
  end;
{$pop}

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}

Regards,
	Ryan Joseph




More information about the fpc-devel mailing list