[fpc-devel] Aligned dynamic arrays

Ryan Joseph ryan at thealchemistguild.com
Sat Mar 30 15:03:12 CET 2019



> On Mar 30, 2019, at 9:55 AM, Jonas Maebe <jonas at freepascal.org> wrote:
> 
>> You are not required to dereference pointers to write to them.
>> var
>>   P: PPoint;
>> begin
>>   P := AlignedArray[0];
>>   P.X := 3; // can be okay
>>   AlignedArray[0].Y := 4;  // can be okay as well
> 
> That only works in {$mode delphi}

Oh that’s why! How does this work in Delphi mode without pointers and why wasn’t it added to ObjFPC mode? That would have saved me some headache in the past if I knew this.

Regards,
	Ryan Joseph




More information about the fpc-devel mailing list