optimising OUString for space

Stephan Bergmann sbergman at redhat.com
Mon Oct 1 07:13:29 PDT 2012

On 10/01/2012 01:47 PM, Michael Stahl wrote:
> ... which brings me to another point: in a hypothetical future when we
> could efficiently create a UTF8String from a string literal in C++
> without copying the darn thing, what should hypothetical operations to
> mutate the string's buffer do?

If we continue with the current COW strategy, note that there is already 
code to take care of immutable rtl_uString instances, see 
SAL_STRING_IS_STATIC (sal/rtl/source/strimp.hxx).

If we would rather abandon COW, and instead always create copies in copy 
ctors, the point would be moot.


More information about the LibreOffice mailing list