[Dune] [#766] Separate GenericGeometries and the SmallObjectPool

Dune flyspray at dune-project.org
Tue Apr 6 22:46:13 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 - Oliver Sander (sander)

----------
In theory you need a different allocator for each type of object that you want to store, because different types (generally) have different sizes.  That would mean one allocator for the pointers to the base class, one allocator for the derived class A, one allocator for the derived class B, etc.  Alternatively you can have an allocator of unsigned char.  You then determine the size of the class you want to allocate memory for (with sizeof), and use that as the argument to the allocate method.

When destroying such and object first explicitly call the destructor. It should be virtual and hence do the right thing.  Then use the deallocate-method of your allocator to free the memory.  It should free the correct amount of memory.

I hope this helps a bit.



----------

More information can be found at the following URL:
http://www.dune-project.org/flyspray/index.php?do=details&task_id=766#comment1859

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