Boost logo

Boost :

From: Boris Fomitchev (fbp_at_[hidden])
Date: 2000-01-31 19:57:28


Greg Colvin wrote:

>
> > Otherwise, with gcc results would be dramatically different as its
> > allocator<> uses SGI node allocator which basically does the same trick
> > linked implementation does, except smallest size of the block would be 8.
> > I think shared_ptr has to have its own memory pool thouhg, as
> > linked approach does - to be independent of std:: quality, to use 8x less
> > memory and to move synchronization overhead out of common allocation
> > bottleneck.
>
> Sure, but by that argument most every class taht allocates most anything
> should have it's own pool. A high-quality operator new should do the job.
>

Ideally for speed - yes, any class should have such a pool. In MT app, they won't
content for free list with each other, and they're fast themselves.
But there are other concerns to consider, like retaining memory in those pools, so
the truth is somewhere in the middle. I consider baseclass for shared_ptr is common
enough to have its own pool. Again, with most allocation tool (new() or
allocator<>),
minimum block size would be 8 (more likely 16 and more), which is minimum
2x (sorry 8x is incorrect) less, which makes sense.

-Boris.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk