On Fri, 11 Jul 2003, Matt Emson wrote:

>
> BTW, if you are using longstrings, you shouldn't be passing by reference, as
> the longstring (AnsiString) is already a pointer. If FPC handles memory in a
> similar way to Delphi with respects to longstrings, it may cause a
> performance hit if the string is fairly long (say 1024+ chars).

Normally the performance hit is nearly zero.
No copying is done, only a reference count is increased. As it is a
const, it cannot be assigned to anyway, so there will be no copy-on-
write operation.

It is always a good idea to use 'Const' parameters as it will stop you from
assigning values to the parameter in your procedure. Just proper coding.

Michael.


_______________________________________________
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to