[fpc-devel] mising ansi string ref increase
sergei_gorelkin at mail.ru
Thu Jul 22 10:57:44 CEST 2010
> 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
If you need proper refcounting, you should pass the argument by value (i.e. without 'const' modifier).
More information about the fpc-devel