[fpc-pascal]Strange Segfault...

Michael Van Canneyt michael.vancanneyt at wisa.be
Fri Jul 11 14:12:25 CEST 2003


On Fri, 11 Jul 2003, Matt Emson wrote:

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

This is correct, of course :-)

Michael.





More information about the fpc-pascal mailing list