[fpc-pascal]Strange Segfault...

Matt Emson memsom at interalpha.co.uk
Fri Jul 11 13:43:35 CEST 2003


> 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.

I was revering to his use of 'var s: string' as one of the params in his
functions. That is baaad. That *will* potentially make the proverbial poopy
hit the fan if he changes it in any way in the routine.

Matt






More information about the fpc-pascal mailing list