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


Eike Rathke wrote:
On Sunday, 2013-01-20 19:55:17 +0100, Markus Mohrhard wrote:
Someone implemented here manualy ref counting. If you want to remove
the warning you can replace the raw pointer + the ref counting
variable with a  boost::shared_ptr.

While boost::shared_ptr is of course cleaner code, for mass objects it
may add a runtime performance penalty if they are passed around a lot.
For example I wouldn't change formula tokens to shared_ptr ...

Yeah, because of atomic counters, and because of extra memory
allocations. Here's some background on various kinds of smart ptrs:

 http://www.boost.org/doc/libs/1_35_0/doc/html/interprocess/interprocess_smart_ptr.html

As an aside, for a number of basegfx objects, copy-on-write semantics
are implemented via o3tl/inc/o3tl/cow_wrapper.hxx - see
e.g. basegfx/inc/basegfx/tools/b2dclipstate.hxx for a simple
example. At least for vcl stuff like Bitmaps, this template could be
used instead of the hand-rolled versions.

Cheers,

-- Thorsten

Attachment: signature.asc
Description: Digital signature


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.