Re: [boost] [review] Exception

Emil Dotchevski wrote:
2. shared_ptr<> may be replaced by intrusive_ptr<> or home made equivalent. This (a) reduces dependency on other Boost part (shared_ptr does depend on quite few other libs) and (b) the atomic locking used by shared_ptr would be eliminated. This would help a little bit on multiprocessor systems - lock may be hundredths of cycles and during the time access to the memory bus is disabled. (a) is a valid concern, OTOH shared_ptr is such a low level component of Boost that -- as careful as I am in avoiding physical coupling -- I don't consider it a real dependency; rather, it's a tool for avoiding dependencies.
Any reason for not using intrusive_ptr? Shared_ptr may be a low level part of Boost, but I'm not sure it should be lower level than this library. A library like this is overdue in my opinion. Brian Wood Ebenezer Enterprises www.webebenezer.net

(a) is a valid concern, OTOH shared_ptr is such a low level component of Boost that -- as careful as I am in avoiding physical coupling -- I don't consider it a real dependency; rather, it's a tool for avoiding dependencies.
Any reason for not using intrusive_ptr? Shared_ptr may be a low level part of Boost, but I'm not sure it should be lower level than this library. A library like this is overdue in my opinion.
I don't have a particular reason for not using intrusive_ptr. I also don't have a particular reason not to use shared_ptr. Emil Dotchevski

"Emil Dotchevski" <emil@revergestudios.com> writes:
(a) is a valid concern, OTOH shared_ptr is such a low level component of Boost that -- as careful as I am in avoiding physical coupling -- I don't consider it a real dependency; rather, it's a tool for avoiding dependencies.
Any reason for not using intrusive_ptr? Shared_ptr may be a low level part of Boost, but I'm not sure it should be lower level than this library. A library like this is overdue in my opinion.
I don't have a particular reason for not using intrusive_ptr.
I also don't have a particular reason not to use shared_ptr.
shared_ptr requires additional allocations. Since in this case the optimization is very easy to implement, it should probably be done. -- Jeremy Maitin-Shepard

I don't have a particular reason for not using intrusive_ptr. I also don't have a particular reason not to use shared_ptr.
shared_ptr requires additional allocations.
It requires one additional allocation. Compare this to the potentially many memory allocations required by the std::map used in the pointee.
Since in this case the optimization is very easy to implement, it should probably be done.
Probably so. Emil Dotchevski
participants (3)
-
brass goowy
-
Emil Dotchevski
-
Jeremy Maitin-Shepard