[fpc-devel] Performance of string handling in trunk
Hans-Peter Diettrich
DrDiettrich1 at aol.com
Wed Jun 26 12:05:02 CEST 2013
Michael Schnell schrieb:
> On 06/25/2013 01:20 PM, Hans-Peter Diettrich wrote:
>> Michael Schnell schrieb:
>>> Supposedly the length and encoding number and code-bytecount is
>>> copied, too.
>>
>> Please understand reference counted memory objects :-]
> Please check this program I tested with a pre-Unicode Delphi.
>
> It shows that (of course) the string length gets copied when assigning a
> string variable to another and how it is done.
I don't see how this is checked by your code.
After an assignment both strings refer to the same memory, i.e.
pchar(s1)=pchar(s2). Everything else indicates an error, somwehere.
DoDi
More information about the fpc-devel
mailing list