[Dune] allocators... dingleton vs. instance

Markus Blatt markus at dr-blatt.de
Wed Oct 3 10:17:45 CEST 2012


On Tue, Oct 02, 2012 at 10:32:58PM +0200, Christian Engwer wrote:
> 
> Assume the following:
> 
> AllocatorType<Foo> alloc1;
> AllocatorType<Foo> alloc2;
> Foo * f = alloc1.allocate(1);
> alloc2.deallocate(f,1);
> 
> Is this supposed to work? In general I would assume not (although it
> will work for many implementations). Is there somewhere a place that
> states that the instance of an allocator is important and not only the
> type?

My gut feeling is that there is no guarantee for this to work.

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?

Markus

-- 
Do you need more support with DUNE or HPC in general? 

Dr. Markus Blatt - HPC-Simulation-Software & Services http://www.dr-blatt.de
Hans-Bunte-Str. 8-10, 69123 Heidelberg, Germany
Tel.: +49 (0) 160 97590858  Fax: +49 (0)322 1108991658 




More information about the Dune mailing list