[fpc-devel] String and UnicodeString and UTF8String

Thaddy thaddy at thaddy.com
Thu Jan 13 22:19:22 CET 2011

On 13-1-2011 21:40, Sven Barth wrote:
> WideString on Windows has no reference counting, thus everytime a 
> WideString is assigned it needs to be copied.
Not exactly true. widestring is com marshaled and thus has reference 
counting on the com level. afaik .
As long as your memorymanager is com marshaled too, that is. And since 
most pascal memory manager versions do not support com directly, it goes 
wrong in a big way.
I once wrote a simple com memory manager to test this. Performance stays 
sh*t, but strings seem to be counted, not copied.
If you use coTaskMemAlloc, coTaskMemFree,CoTaskMemRealloc  in your 
memory manager you will see what I mean.
At least it comes close, but slow it will stay.

More information about the fpc-devel mailing list