<div dir="auto"><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">denisgolovan via fpc-devel <<a href="mailto:fpc-devel@lists.freepascal.org">fpc-devel@lists.freepascal.org</a>> schrieb am Di., 21. Apr. 2020, 13:32:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
> One thing to be slightly aware of with<br>
> dynamic pointers and alignment. For V: atray<br>
> of Integer etc, make sure you check the<br>
> alignment of V[0], not V. V points to an<br>
> internal structure that is largely opaque,<br>
> while V[0] points to the actual data, which I<br>
> imagine is what you want to pass into VMOVAPS<br>
> etc.<br>
> <br>
> Gareth aka. Kit<br>
<br>
I believe your are wrong here.<br>
For dynamic arrays, service data is located at negative offset and pointer itself _is_ zero element address.<br>
<br>
type<br>
   TIntArray = array of Integer;<br>
<br>
var v:TIntArray;<br>
begin<br>
   SetLength(v,100);<br>
   Writeln(NativeInt(Pointer(v)) = NativeInt(Pointer(@v[0]))); // always gives true<br>
end.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">I think Gareth meant the address of V instead (Pointer(@V)).</div><div dir="auto"><br></div><div dir="auto">Regards, </div><div dir="auto">Sven </div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>