|
Boost : |
From: John Maddock (John_Maddock_at_[hidden])
Date: 2000-03-07 07:41:38
Steve,
>I've already started work on this. AFAICT, I have conformant code, but
>BCB chokes on it every time. . . I plan to look at RW's std::allocator
>to see how they got around it.
<
I have written some fairly simple (actually very simple!) allocators using
C++ Builder before and haven't had any problems (at least not yet), if you
want to share your code I may be able to spot something (fresh pair of eyes
etc).
Re: allocator growth stategy - is it worthwhile making the number of
elements allocated in each block a run time constant (rather than fixed at
compile time), that way the allocator could double the number of elements
allocated per-block each time that the allocator runs empty. Assuming that
the cost of removing at pre-allocated element from the stack is negligable
compared to the cost of asking the system for it, this would reduce the
performance to O(lnN) for N blocks. Now before too many programmers
explode all over their Pc's at seeing this let me make it clear that the
assumption is not true, and that this is an abuse of big-O notation.
However there is some truth in there, and it would be interesting to see
whether this offered any speed improvement - obviously at the expense of
space.
- John.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk