From: Peter Dimov (pdimov_at_[hidden])
Date: 2003-08-27 06:08:07
E. Gladyshev wrote:
> Sure he could have replaced the system allocator (I actually
> suggested it too) but why would he want to do it?
Because this saves time in the long run. Once you have a non-broken
allocator you can use third party libraries as-is, without need for
modification, and you can donate it to the community if you're after the
fame (aren't we all.)
> The standard system allocator worked just fine for the rest of his
> program. Why would he want to implement a full blown memory manager.
dlmalloc is not that hard to download. :-)
Incidentally, you can #define BOOST_SP_USE_STD_ALLOCATOR or
BOOST_SP_USE_QUICK_ALLOCATOR to tell shared_ptr to use std::allocator or
boost::detail::quick_allocator for counts when your malloc is slow. But it's
better to just replace the global new/delete so that every "new X" in the
program benefits. And it's better yet to submit a "your malloc is slow,
here's the link to dlmalloc which is five times faster on this real code"
(BTW, "five times faster" is not a figure of speech. I do have real
measurements. Had to let you know.)
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk