From: E. Gladyshev (egladysh_at_[hidden])
Date: 2003-08-29 17:58:32
--- Gregory Colvin <gregory.colvin_at_[hidden]> wrote:
> At the least, we could add the following bullet
> * Discussion of memory management strategy.
> to http://www.boost.org/more/lib_guide.htm#Documentation
I think it is a great start.
> I'm reluctant to say very much more at this point, as my opinions
> may not be suited to the needs of the many different libraries in
> Boost. But I think it's generally reasonable to:
> * not allocate memory unless it's really necessary
> * use the standard mechanisms (::operator new or std::allocator)
> when it is necessary
Boost already has boost::allocator. IMO other boost libaries
should consider using boost::allocator instead of
::new and std::allocator.
> * use custom allocation mechanisms only when there is a clear
> advantage to doing so
> * parameterize only when there is a clear advantage to doing so
I'd modify it to
* Consider parametrization if your library is to be available
for embedded or non-traditional platfroms.
> * use the standard parameterization mechanisms (Allocator) when
> choosing to parameterize
I'd add to it
* Follow boost::allocator specification for allocator parameters
> * use custom parameterization mechanisms only when there is a
> clear advantage to doing so
> * document whether and how a library allocates memory
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software