On Tue, 1 Jun 2010 14:36:36 +0200
Jonas Maebe <jonas.ma...@elis.ugent.be> wrote:

> 
> On 01 Jun 2010, at 14:28, spir ☣ wrote:
> 
> > On Tue, 1 Jun 2010 13:05:16 +0200 (CEST)
> > Michael Van Canneyt <mich...@freepascal.org> wrote:
> >
> >> This is not correct. Many strings are simply referenced several  
> >> times.
> >
> > May I ask in which typical cases?
> 
> The most common one is probably assigning a function result to a  
> variable or field.

Is there increment of ref count (I think it does +1-1)? If no, passing the ref 
cannot have any side-effect, so the copy_on_write scheme does not apply -- or 
rather does not make any change if applied. This is plain reference copy.
The issue is rather for parameter passing, since here the original var survives 
the call (see Martin's post).


Denis
________________________________

vit esse estrany ☣

spir.wikidot.com
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to