denisgolovan via fpc-devel <fpc-devel@lists.freepascal.org> schrieb am Di., 21. Apr. 2020, 13:32:
> > > > One thing to be slightly aware of with > > dynamic pointers and alignment. For V: atray > > of Integer etc, make sure you check the > > alignment of V[0], not V. V points to an > > internal structure that is largely opaque, > > while V[0] points to the actual data, which I > > imagine is what you want to pass into VMOVAPS > > etc. > > > > Gareth aka. Kit > > I believe your are wrong here. > For dynamic arrays, service data is located at negative offset and pointer > itself _is_ zero element address. > > type > TIntArray = array of Integer; > > var v:TIntArray; > begin > SetLength(v,100); > Writeln(NativeInt(Pointer(v)) = NativeInt(Pointer(@v[0]))); // always > gives true > end. > I think Gareth meant the address of V instead (Pointer(@V)). Regards, Sven >
_______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel