[fpc-devel] Aligned dynamic arrays
ryan at thealchemistguild.com
Sat Mar 30 00:05:50 CET 2019
> On Mar 29, 2019, at 5:25 PM, Sven Barth via fpc-devel <fpc-devel at lists.freepascal.org> wrote:
> Ignoring something is not an answer. At least there'd need to be a runtime error.
> Thinking about it maybe it would be better to follow Anthony's idea with the record and not try to adjust/extend a language mechanism that wasn't geared for that.
Biggest problems with records is that we can’t make arrays of records because the  property copies the record with the getter (my other email on this never got posted). If there was a feasible way to fix that problem then dynamic arrays would be nearly obsolete anyways (probably still faster though).
A.Length := 1;
A.x := 100; // Doesn’t work, writes to a copy and never mutates the underlying structure.
Is there no other way to specify alignment? It would be ugly but a compiler directive could be used.
a: array of integer;
SetLength(a,10); // just use normal SetLength now
More information about the fpc-devel