I just performed Allocation Profiling about how many objects of each type are in my application. I am using boost::shared_ptr extensively.
I found a large number of sp_counted_impl_p objects allocated, each occupying 16 bytes. How many of sp_counted_impl_p objects can be expect per shared_ptr? Does someone have an idea?
For what I can see in the implementation, just one per shared_ptr. However, note that there are more objects used by boost internally, that may use this counted class directly or shared_ptr itself. Also, if you use the boost.serialization framework, it is also based on this class/mechanism. Anyway, by ‘a large number’, how many of them are there?