[Dune] allocators... dingleton vs. instance

Christian Engwer christian.engwer at uni-muenster.de
Wed Oct 3 14:54:54 CEST 2012


Hi Markus,

thanks for your opinion.

> > > Assume the following:
> > > 
> > > AllocatorType<Foo> alloc1;
> > > AllocatorType<Foo> alloc2;
> > > Foo * f = alloc1.allocate(1);
> > > alloc2.deallocate(f,1);
> > > 
> > 
> > One might want to implement an allocator that manages allocation in
> > a  memory chunk allocated in the initializer.
> > 
> > Indeed there is nothing in the standard about it. Maybe ask on a list?
> > 
> 
> BTW: why would anybody intentionally write such code as above?

I'm currently writing a debugging allocator for dune-common and wanted
to make sure that I don't produce false positives. I needed an
alternative allocator to check that the code really works with other
allocators. There a many allocators in g++-ext but we can not rely on
these. The second point is that I had to debug quite some
memory-management problem in the last time. Here an additional
memory-debugging tool would be handy. valgrind obviously works, but
larger programs become _really_ slow.

Cheers
Christian




More information about the Dune mailing list