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

Dune flyspray at dune-project.org
Sat Jan 15 18:02:57 CET 2011


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)

----------
A few comments about the patch:

1) With reinterpret_cast you will always get a strict aliasing warning here. It seems that the only way to avoid this is to store an additional (redundant) pointer to the char buffer with the appropriate base class type (see above). Then you can simply use a static_cast from char[] to char* for the placement new (see exaple above). The base class pointer can then be obtained as result of the placement new and should be returned by construct() as suggested by Martin.

2) IMHO it's dangerous to use a base class pointer as argument for the construct() and trace() methods. This looks like you can pass a pointer to some existing object of a derived class here. However this is NOT true since the constructed object might be larger then the existing storage. Using a cahr[], char* or void* would reflect that you need some raw storage of appropriate size here.
----------

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

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