[fpc-devel] Performance of string handling in trunk

Hans-Peter Diettrich DrDiettrich1 at aol.com
Thu Jun 27 12:54:34 CEST 2013


Michael Schnell schrieb:
> 
>> 2) Nothing is copied on an assignment to a string variable, except the 
>> reference to the memory object.
>>
> Sorry,  I erroneously thought about the variable itself being ref 
> counted, while in fact the variable is a pointer to the (hidden) String 
> management record,

Fine that you finally start familiarizing with reference counted objects 
reality :-)

> which is the ref counted entity and holds the content 
> pointer to the String array.

Now you also should understand that a string variable points directly to 
the string content, it's usable as PChar(str) without any conversion. 
The other information about the string resides *before* that address.

DoDi




More information about the fpc-devel mailing list