Efficient string concatenation

Norbert Thiebaud nthiebaud at gmail.com
Sun Dec 2 21:09:44 PST 2012


On Sun, Dec 2, 2012 at 10:59 PM, Norbert Thiebaud <nthiebaud at gmail.com> wrote:
> vaguely related... since we are talking about performance... why
> *_new_WithLength() in strtmpl.cxx is doing a memset on the whole newly
> allocated buffer...
> surely the allocated buffer will be filled with something soon
> enough... all that is needed is buffer[0] = 0 to make getStr()
> C-string-safe.

Oh, apparently you noticed too... later in the patch:

+        rtl_uString* buffer = NULL;
+        rtl_uString_new_WithLength( &buffer, l ); // TODO this
clears, not necessary

:-)

Norbert


More information about the LibreOffice mailing list