X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7fe7d506b191a94ce327c2a18733a4d3bc576cac..5d1902d6d6efc842c8f488520d3cca40f1ae99f8:/include/wx/memory.h?ds=sidebyside diff --git a/include/wx/memory.h b/include/wx/memory.h index 1f2b25d19d..841ea9e410 100644 --- a/include/wx/memory.h +++ b/include/wx/memory.h @@ -17,6 +17,7 @@ #endif #include "wx/defs.h" +#include "wx/string.h" /* The macro which will be expanded to include the file and line number @@ -37,8 +38,6 @@ # endif #endif -#include "wx/string.h" - #ifdef __WXDEBUG__ void * wxDebugAlloc(size_t size, char * fileName, int lineNum, bool isObject, bool isVect = FALSE); @@ -53,14 +52,25 @@ void wxDebugFree(void * buf, bool isVect = FALSE); #undef new #endif +#if defined(__SUNCC__) +#define wxUSE_ARRAY_MEMORY_OPERATORS 0 +#elif !( defined (_MSC_VER) && (_MSC_VER <= 1020) ) || defined( __MWERKS__) +#define wxUSE_ARRAY_MEMORY_OPERATORS 1 +#else +#define wxUSE_ARRAY_MEMORY_OPERATORS 0 +#endif + // Added JACS 25/11/98: needed for some compilers void * operator new (size_t size); + +#if wxUSE_ARRAY_MEMORY_OPERATORS void * operator new[] (size_t size); +#endif void * operator new (size_t size, char * fileName, int lineNum); void operator delete (void * buf); -#if !( defined (_MSC_VER) && (_MSC_VER <= 1020) ) +#if wxUSE_ARRAY_MEMORY_OPERATORS void * operator new[] (size_t size, char * fileName, int lineNum); void operator delete[] (void * buf); #endif @@ -72,7 +82,9 @@ void operator delete[](void *buf, char*, int); #endif #endif + // wxUSE_GLOBAL_MEMORY_OPERATORS #endif + // __WXDEBUG__ typedef unsigned int wxMarkerType; @@ -251,7 +263,7 @@ public: // Count the number of non-wxDebugContext-related objects // that are outstanding - static int CountObjectsLeft(void); + static int CountObjectsLeft(bool sinceCheckpoint = FALSE); private: // Store these here to allow access to the list without