[Dune] SmallObjectPool

Martin Nolte nolte at mathematik.uni-freiburg.de
Fri Jul 25 15:31:37 CEST 2008


Hi Markus,

SmallObjectPool is just a helper for SmallObject. I think the main differences 
to PoolAllocator are:
1) It is singleton
2) It has stacks for different sizes (up to 8k)

The idea of SmallObject is as follows: Imagine you have some small (i.e. < 8k) 
object for which a new / delete technique is necessary (maybe, e.g., a grid 
entity). Now you could use the PoolAllocator, but you will always have to 
provide your own instance. And you cannot use new / delele directly. 
SmallObject does nothing more that overload new / delete to use the 
SmallObjectPool to obtain the memory from or push it to. Now, your existing 
code using new and delete does not have to be changed, but you can simply 
derive the small object from SmallObject and it will be automatically stacked.

If you can obtain this functionality from your PoolAllocator, I will be very 
willing to remove the SmallObjectPool again. I just wanted the functionality 
of SmallObject (which speeds up new / delete by a factor of almost 10).


Cheers,

Martin

P.S.: I admit the documentation is entirely missing. Time was limited...

Markus Blatt wrote:
> Hi,
> 
> I admit I just gave the new SmallObjectPool a glance.
> 
> Can somebody point out the difference to the allready existing
> PoolAllocator?
> 
> Cheers,
> 
> Markus
> 
> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune

-- 
Martin Nolte <nolte at mathematik.uni-freiburg.de>

Universität Freiburg                                   phone: +49-761-203-5642
Abteilung für angewandte Mathematik                    fax:   +49-761-203-5632
Hermann-Herder-Straße 10
79104 Freiburg, Germany




More information about the Dune mailing list