[eigen] Add placement delete to match placement new |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen <eigen@xxxxxxxxxxxxxxxxxxx>
- Subject: [eigen] Add placement delete to match placement new
- From: Keir Mierle <mierle@xxxxxxxxx>
- Date: Mon, 27 Jul 2009 00:52:42 +0000
- Cc: libmv-devel <libmv-devel@xxxxxxxxxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:cc:content-type; bh=q4/q9tJvVFVuHhTwSQicfTHjm4fZwgE2w9joYREbxCY=; b=OBDS5ucMxTV9UW7xc9nqmnsYTQgAnworrVc6OJH9vAAlL/K04JQIyivZB3nlfTgohw LwP6SWPzAuFtYWEQdQ5MDB3a5o/v/32BgPHTa+9PsgeIL/AsYsxIaCJMUHoKfwhJX+W+ fU1CTQvnTDo18IVZI53y17+rDP1v8Mw0sVuOU=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type; b=v6vHq/lLuFcF78keN/DpaeqB94QiKEdubNKc6f6g25vZWBzweZU1IFnmFY4oR6ivEk K7fYSiMeDt5C+S7WBLvhkScOSkep1VFpYVfcmBQpPdfc8o8uK5ZJmYpb/VxoHfgVlx1C SppuWCAik4YW4mj5kFqjzVwdYL2DuWMEK6tv0=
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)