Boost logo

Boost Users :

From: Alexander (gutenev_at_[hidden])
Date: 2008-07-31 11:39:27


> On Wednesday 30 July 2008 16:03 pm, Alexander Gutenev wrote:
>> I want to use intrusive_ptr as a smart pointer to have reference counting
>> without shared_ptr overhead.
>
> I'm curious, could you be more specific about how your implementation has
> less
> overhead than shared_ptr? Do you mean it uses less memory? Compiles
> faster?
> Runs faster?

Less memory.
The overhead of shared_ptr is allocation of another object which has
reference count and deleter object. It is allocated in a separate block,
hence memory overhead - that's the most noticeable when I have a lot of
pointers to small objects. Also shared_ptr itself is double sized then. Also
it is a bit more slow for allocation and deletion - but this is not
noticeable in my case.


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