[fpc-devel] Performance of string handling in trunk
DrDiettrich1 at aol.com
Wed Jun 26 15:31:54 CEST 2013
Michael Schnell schrieb:
> On 06/26/2013 12:05 PM, Hans-Peter Diettrich wrote:
>> After an assignment both strings refer to the same memory, i.e.
>> pchar(s1)=pchar(s2). Everything else indicates an error, somwehere.
> This is exactly what I wanted to show: it results in ContentPointer,
> StringLength, ReferenceCount (plus - if no auto-conversion is done -
> supposedly EncodingType and ElementSize in DXE) being identical for both
> strings after the assignment. Thus a RawByteString supposedly will in
> fact get the source's encoding type).
1) AnsiString has no ContentPointer.
2) Nothing is copied on an assignment to a string variable, except the
reference to the memory object.
More information about the fpc-devel