diff packages/infra/current/src/delete.cxx @ 115:6ed91473a1cd ecos-sw-2000-08-21

Merge from eCos master repository on 2000-08-21-22:40:54-BST
author jlarmour
date Fri, 25 Aug 2000 17:32:38 +0000
parents bf00f99aec69
children e0c0827131d1
line wrap: on
line diff
--- a/packages/infra/current/src/delete.cxx
+++ b/packages/infra/current/src/delete.cxx
@@ -45,54 +45,12 @@
 //==========================================================================
 
 #include <pkgconf/system.h>
+#include <pkgconf/infra.h>
 
 #include <cyg/infra/cyg_type.h>
 
-// The configuration here is as follows:
-//
-// To deal with virtual destructors, where the correct delete() function
-// must be called for the derived class in question, the underlying delete
-// is called when needed, from destructors.  This is regardless of whether
-// the destructor is called by delete itself.  So there is a reference to
-// delete() from all destructors.  The default builtin delete() attempts to
-// call free() if there is one defined.  So, if you have destructors, and
-// you have free(), as in malloc() and free() in the C library, any
-// destructor counts as a reference to free().  So the libc heap system is
-// linked in regardless of whether it gets explicitly called.
-//
-// To defeat this undesirable behaviour, we define empty versions of delete
-// and delete[].  But doing this prevents proper use of the libc heap in
-// C++ programs via C++'s new and delete operators.
-//
-// Therefore, configuration is provided (in the libc package, near malloc
-// et al) for explicitly disabling the provision of these empty functions,
-// so that new and delete can be used, if that's what's required.
-//
-// It is also possible to override all this complexity anyway, but that is
-// not yet represented in an external config option.
-
-
-
-// If this is already externally defined, go ahead and override the
-// builtin delete functions.
-#ifndef CYGFUN_INFRA_EMPTY_DELETE_FUNCTIONS
-
-# define CYGFUN_INFRA_EMPTY_DELETE_FUNCTIONS
-# ifdef CYGPKG_LIBC
-// then there is a libc: if there is a malloc, maybe do not supply empty
-// delete functions.  Get the libc config info to find out.
-
-#  include <pkgconf/libc.h>
-
-// So, do NOT provide these functions if there is a malloc and we are not
-// to provide these functions:
-#  ifdef CYGPKG_LIBC_MALLOC
-#   ifdef CYGIMP_LIBC_MALLOC_CXX_DELETE_CALLS_FREE
-#    undef CYGFUN_INFRA_EMPTY_DELETE_FUNCTIONS
-#   endif // CYGIMP_LIBC_MALLOC_CXX_DELETE_CALLS_FREE
-#  endif // CYGPKG_LIBC_MALLOC
-# endif // CYGPKG_LIBC
-#endif // CYGFUN_INFRA_EMPTY_DELETE_FUNCTIONS not already defined
+// see the description comment in infra.cdl for
+// CYGFUN_INFRA_EMPTY_DELETE_FUNCTIONS
 
 #ifdef CYGFUN_INFRA_EMPTY_DELETE_FUNCTIONS
 // then define these empty functions: