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


Hi Matus,

        So - to confirm; Stephan and I discussed this, and there is interest in
improving things.

        Currently the uno::Sequence destructor (which reaches iDestructSequence
~34k times during startup with a sequence that has a ref-count > 1) -
goes via:

template< class E >
inline Sequence< E >::~Sequence()
{
    const Type & rType = ::cppu::getTypeFavourUnsigned( this );
    ::uno_type_destructData(
        this, rType.getTypeLibType(), (uno_ReleaseFunc)cpp_release );
}

        Which ends up in some wonderful type-informed way inside:

        cppu/source/uno/destr.hxx (idestructSequence)

        But it would be far more ideal to have:

template< class E >
inline Sequence< E >::~Sequence()
{
    if (!osl_atomic_decrement( &rSeq._pSequence->nRefCount ))
        doSomething () ...
}

        Where 'doSomething' is left as the exercise for the hacker there but
ideally in-lines to a very small method call =) Quite possibly we'll
need a new 

        In the -most- ideal world, we could trivially special-case these
uno::Sequence< sal_uInt8 > types (and other basic type sequences) and
just do an rtl_freeMemory (or whatever) in there.

        Anyhow - it'd be great if you could look into that as/when we get to
that item on the list :-) Quite possibly as a quick prototype hack; we
could just directly assign:

        rSeq._pSequence->nRefCount = 1;

        just before calling the destructData ;-) that's just a tad cheesy
though it'd be interesting to see the result on stripped code size
and/or startup perf.

        Thanks !

                Michael.

-- 
 michael.meeks@collabora.com  <><, Pseudo Engineer, itinerant idiot


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.