(a cherry-pick of commit
ede8f8c8 from 'release-7_6')
Issue #195 (bdwgc).
Sized variants of global operator delete should be defined along with
the non-sized ones. Otherwise compiler might invoke the one from the
standard library (as observed in e.g. Cygwin) leading to a crash.
* gc_cpp.cc [!_MSC_VER && __cplusplus>201103L] (operator delete):
Define sized variant (the size argument is ignored for now).
* gc_cpp.cc [!_MSC_VER && __cplusplus>201103L && GC_OPERATOR_NEW_ARRAY
&& !CPPCHECK] (operator delete[]): Likewise.
}
# endif
-#endif /* _MSC_VER */
+#else
+
+# if __cplusplus > 201103L // C++14
+ void operator delete(void* obj, size_t size) GC_DECL_DELETE_THROW {
+ (void)size; // size is ignored
+ GC_FREE(obj);
+ }
+
+# if defined(GC_OPERATOR_NEW_ARRAY) && !defined(CPPCHECK)
+ void operator delete[](void* obj, size_t size) GC_DECL_DELETE_THROW {
+ (void)size;
+ GC_FREE(obj);
+ }
+# endif
+# endif // C++14
+
+#endif // !_MSC_VER