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

_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to