[fpc-devel] mising ansi string ref increase

Martin fpc at mfriebe.de
Thu Jul 22 12:06:10 CEST 2010

On 22/07/2010 09:57, Sergei Gorelkin wrote:
> Martin пишет:
>> Anyone any idea, if there s any code that could cause such an 
>> "optimization" ?
> This is by design. 'const' modifier on ansistring and other 'managed' 
> type arguments instucts the compiler to omit refcount changes, 
> yielding a faster code. At the same time it prohibits direct 
> modification to the argument, but nothing can be done if you modify 
> another location that aliases the argument.
> If you need proper refcounting, you should pass the argument by value 
> (i.e. without 'const' modifier).

So, no need to report as bug then?

More information about the fpc-devel mailing list