2014-11-03 2:50 GMT+08:00 Sven Barth <pascaldra...@googlemail.com>: > 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. > > 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.
I found this in FPC doc (for $ALIGN switch): 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. 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? Thanks! Xiangrong
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal