On Tue, 14 Oct 2003 14:27:39 -0400 David Abrahams <[EMAIL PROTECTED]> wrote:
> I was basically saying "I don't understand why you're mentioning > inlining. What about it?" Count instructions. When you assign smart pointer, it's two null tests, one increment, one decrement, one zero comparison, and one deleter call (generated but rarely executed). RefCounter has all this hidden in one function. > Yes, but speed and size of smart pointers isn't everything. What you > get in exchange for the speed and size lost to shared_ptr is extremely > valuable in many applications. Yes, but nothing prevents Boost from improving intrusive_ptr to extent that it becomes better than our own code. It sure can be improved. It can be almost as fast as raw pointers and it can have smaller footprint than function call. > Proper deallocation when objects are passed across DLL boundaries. > This might be relevant to you if you are allowing people to > implement plugins, especially Python extension modules. No such problem with intrusive ref counting. > A function recieving a shared_ptr can be ignorant of its > deallocation and refcounting strategies (avoids a template!!) Every class chooses its smart pointer, so there is no reason to accept multiple smart pointers. Things are different for template functions, but there are (template) adaptors for those cases. > The ability to manage objects held as direct data members of other > objects. Dangerous. > The ability to correctly handle polymorphic classes without virtual > destructors No such problem with intrusive ref counting. > The ability to handle a refcounted heap-allocated object or an > unmanaged (e.g. stack or global) object with the same shared_ptr > interface (using a null deleter) Dangerous. > Does your development time matter? Is it worth your time to > reimplement this stuff? Implementing smart pointers is extremely cheap compared to conversion of legacy code. When we are past that point, we can convert RefCounter to shared_ptr or other type automatically. It's worth spending effort on 100 lines of code that is used 100 000 times. Integrating boost is no fun either, just to get smart pointers. > Robert Vazan <[EMAIL PROTECTED]> writes: > > > I am not sure what's the difference between modified and derived > > work. > > Me neither. Nor am I sure why it's relevant. Mixed Gpl and non-Gpl code must be published under Gpl. I am afraid that this applies to shared_ptr too. > Anyway, as I said: it's your nickel. If you want to roll your own > smart pointers, who am I to say otherwise? I'm outta this thread now > ;-> No problem. I think it was a good choice. I also think that external library can be better, but Boost isn't. ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. SourceForge.net hosts over 70,000 Open Source Projects. See the people who have HELPED US provide better services: Click here: http://sourceforge.net/supporters.php _______________________________________________ Mahogany-Developers mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/mahogany-developers