Boost logo

Boost Users :

From: Leon Mlakar (leon.mlakar_at_[hidden])
Date: 2006-10-23 10:52:58


 
> >>
> >> It's not in 1.33.1, is it? It may not bring performance benefits,
> >> still, it is a usefull feature to have.
> >
> > No, it isn't in 1.33.1. It will be in 1.34, though.
> > _______________________________________________
> >
>
> But 1.33.1 uses it internally? Since after defining this
> macro I was able to measure some performance benefits.
>
>

It is used internally, yes. You can check how its done in
detail/sp_counted_impl.hpp and detail/quick_allocator.hpp.

However, underneath the quick allocator still relies on the global new
operator (for allocating pages) and uses whatever heap the global new/delete
operators use.

That's okay for a single heap environments. It's just that it cannot be used
when multiple heaps enter the picture. In published versions it is possible
to specify a deletor for the contained object, but not the custom
allocator/deletor for the shared count. Therefore, a shared count may end up
in a different heap than the contained object and that could lead to the
visibility problems.

As a matter of fact, I will be interesting to see how this was done. We
tried to modify the code into this direction but run into some problems, and
since there was a pressure to deliver (as there always is) we then used a
backup plan and guarded the (infrequently used) shared heap by other means.

Best regards,

Leon Mlakar


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net