<div dir="ltr"><div class="gmail_default" style="font-family:'courier new',monospace"><span style="font-family:arial">2014-11-03 2:50 GMT+08:00 Sven Barth </span><span dir="ltr" style="font-family:arial"><<a href="mailto:pascaldragon@googlemail.com" target="_blank">pascaldragon@googlemail.com</a>></span><span style="font-family:arial">:</span><br></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><p>If you use SetLength the dynamic array consists not only of the array data, but also of an information record in front of it. This will likely lead to the data not being aligned correctly (FillQWord works best with 8-Byte alignment). So what about testing FillDWord or FillChar? Just to see whether they would be faster.<br></p><span class="">
<p></p></span></blockquote><div><div class="gmail_default" style="font-family:'courier new',monospace;display:inline">It is quite strange that if I use SetLength+FillByte, it is really faster (for the FillByte), but if I use GetMemory+FillByte, it is not faster than using FillDWord or FillQWord.</div></div><div><div class="gmail_default" style="font-family:'courier new',monospace;display:inline"><br></div></div><div><div class="gmail_default" style="font-family:'courier new',monospace;display:inline">I found this in FPC doc (for $ALIGN switch):</div></div><div><span style="font-family:'courier new',monospace;color:rgb(0,0,0)"><br></span></div><div><span style="font-family:'courier new',monospace;color:rgb(0,0,0)">This switch is recognized for Turbo Pascal Compatibility, but is not yet implemented. The alignment of data will be different in any case, since Free Pascalis a 32-bit compiler.</span><br></div><p style="color:rgb(0,0,0)"></p><div><div class="gmail_default" style="font-family:'courier new',monospace">It is a pity that this switch is not recognized yet. But I need to understand the last statement, will alignment be different or not?</div><div class="gmail_default" style="font-family:'courier new',monospace"><br></div><div class="gmail_default" style="font-family:'courier new',monospace">Thanks!</div><div class="gmail_default" style="font-family:'courier new',monospace"><br></div><div class="gmail_default" style="font-family:'courier new',monospace">Xiangrong</div><br></div></div></div></div>