[eigen] Add placement delete to match placement new

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


Eigen is missing to a placement delete operator to match its placement new. I only noticed this using MS's cl.exe, which complained about this. Apparently it's a problem with exceptions enabled. If someone with access can to commit this, that would be great.

Keir

libmv note: see r598 and r612 changes to third_party/
Index: src/third_party/eigen/Eigen/src/Core/util/Memory.h
===================================================================
--- src/third_party/eigen/Eigen/src/Core/util/Memory.h	(revision 532)
+++ src/third_party/eigen/Eigen/src/Core/util/Memory.h	(revision 612)
@@ -245,9 +245,10 @@
       void *operator new[](size_t size) throw() { \
         return Eigen::ei_conditional_aligned_malloc<NeedsToAlign>(size); \
       } \
+      void *operator new(size_t, void * ptr) throw() { return ptr; } \
       void operator delete(void * ptr) { Eigen::ei_conditional_aligned_free<NeedsToAlign>(ptr); } \
       void operator delete[](void * ptr) { Eigen::ei_conditional_aligned_free<NeedsToAlign>(ptr); } \
-      void *operator new(size_t, void *ptr) throw() { return ptr; } \
+      void operator delete(void * new_ptr, void * placement_ptr) throw() { (void) new_ptr; (void) placement_ptr; } \
       typedef void ei_operator_new_marker_type;
 #else
   #define EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF(NeedsToAlign)


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/