On Fri, 2011-07-01 at 18:59 +0200, Julien Nabet wrote:
Le 30/06/2011 14:26, Nigel Hawkins a écrit :
On Wed, 2011-06-29 at 23:26 +0200, Julien Nabet wrote:
diff --git a/sal/qa/osl/process/osl_process.cxx
b/sal/qa/osl/process/osl_process.cxx
index 2535c4c..8695d79 100644
--- a/sal/qa/osl/process/osl_process.cxx
+++ b/sal/qa/osl/process/osl_process.cxx
@@ -477,6 +477,7 @@ public:
);
std::string line;
+ line.reserve(10000);
while (std::getline(file, line, '\0'))
env_container->push_back(line);
tidy_container(*env_container);
That change fixes the problem here.
Hello,
Can i push this patch as a workaround or do you think about a better
solution ?
Presumably this works because the string is sufficiently big that it
doesn't need to be resized by getline so some realloc is skipped in the
other chunk of code compiled with different and apparently incompatible
settings.
Seeing as this thread is dragging on and and we don't have a stand-alone
reproducer to blame on anyone in particular, feel free to stick a
reserve in here. Pick a number that's a reasonably small power of 2
which works for you, e.g. 1024, 4096, 8192 or something and we can
justify it as a micro-optimization :-)
C.
Context
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.