Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


On Tuesday 28 of February 2012, Eike Rathke wrote:
On Tuesday, 2012-02-28 16:37:38 +0000, Michael Meeks wrote:
Of course, on the very rare
occasions that we do a huge allocation for a string - perhaps we store
an entire VBA module in a single string or something silly ;-)

As soon as Calc will use OUString instead of String for cell content and
formula results exactly that will happen..

I've seen Calc abused as a front end for some sort of web CMS, holding
entire HTML "template" fragments in one cell ... complaint was that not
more than 64k characters would fit into a formula result when
concatenating those ...

which
might reasonably fail, then no doubt we could use the native C method,
and act accordingly if it failed.

I doubt anyone would actually do that, so we could only hope for memory
allocation exiting the application gracefully in that case.

 I think that is the real question. I've just found out that e.g. openSUSE 
12.1 in fact has memory overcommitting disabled by default, so such checks 
actually can work and would detect running out of memory. But I doubt anybody 
would be realistically bothered to check that these days.

 Even if the OUString ctor throws std::bad_alloc, there's unlikely any code 
catching it, except for some generic catch(), which perhaps may recover from 
it, or may not. And even if yes, the next time the larger string can cause 
running out of memory when appending to OUStringBuffer, when invokend with 
OUString's operator+, or any other of those functions that OSL_ENSURE the 
allocation result and are done with it.

-- 
 Lubos Lunak
 l.lunak@suse.cz

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.