[Dune] [#766] Separate GenericGeometries and the SmallObjectPool (Attachment added)
Dune
flyspray at dune-project.org
Wed Apr 7 22:08:38 CEST 2010
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#766 - Separate GenericGeometries and the SmallObjectPool
User who did this - Carsten Gräser (Carsten)
----------
IMHO you don't need a *PolyAllocator for the following reason:
Although allocators might behave differently in general the standard explicitly says that the stl containers may assume that all instances of the specified allocator compare equal, i.e. you can deallocate with a different instance. Hence all allocators that can be used with stl (e.g. boost::pool_allocator) must use some static/singelton mechanism inside.
Thus for those allocators you can safely (default) construct an allocator for allocation of the derived class using rebind<Derived> and create a new one for deallocation. You only have to store the type in a deleter to allow the later (type erasure!).
For the case of a shared_ptr I have attached an example. Of course shared_ptr might be overkill. Surprisingly there is no auto_ptr with allocator/deleter support. However this should not be to complicated.
----------
One or more files have been attached.
More information can be found at the following URL:
http://www.dune-project.org/flyspray/index.php?do=details&task_id=766#comment1867
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
More information about the Dune
mailing list