This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Pool allocators, the Next Generation


On Tue, Feb 25, 2003 at 09:16:00AM +0100, Gabriel Dos Reis wrote:
> Phil Edwards <phil at jaj dot com> writes:
> 
> | A brief progress report:  One experimental version is done and working.
> | It maintains parity in the current allocator settings, and allows us to
> | delete pthread_allocimpl.h entirely.  A new typedef, __gthread_alloc, sits
> | alongside __alloc and __single_client_alloc, with all the major features of
> | pthread_alloc and the added bonus that it follows the --enable-threads=xxx
> | decisions.
> | 
> | Bunch of other cleanups, e.g., more behind-the-scenes stuff moved from
> | std into __gnu_cxx.
> | 
> | The major downside:  There are virtual function calls in the critical path.
> | I still need to do lots of timing tests before I'll even begin to suggest
> | this approach, and even then it would be with a plea for assistance to
> | help get rid of them.
> 
> [Thinking loudly]  If the decision of which allocator category to use
> is made at configure time or compile time, then I will suggest we use
> traits to get rid of the virtual calls. 

Yes, that's the goal.  In fact, that's how I got this far.

The issue is that the default pool allocator is "instanceless" and
using only statics.  The per-thread pool allocator uses per-object data.
Getting to that per-object data required some hoop-jumping.

At some point I plan to convert the virtual calls into non-virtual ones by
using combinations of traits and pointers, but doing so without imposing
a penalty on the default code path is going to be hard.


Phil

-- 
If ye love wealth greater than liberty, the tranquility of servitude greater
than the animating contest for freedom, go home and leave us in peace.  We seek
not your counsel, nor your arms.  Crouch down and lick the hand that feeds you;
and may posterity forget that ye were our countrymen.            - Samuel Adams


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]