X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/184b5d99a5382cd7a19888c85aff11f8a21af2f6..38d24a39d3269c5b595ec313475c2fb04ac9a353:/src/common/memory.cpp?ds=sidebyside diff --git a/src/common/memory.cpp b/src/common/memory.cpp index 37bf42aa41..602a295bb8 100644 --- a/src/common/memory.cpp +++ b/src/common/memory.cpp @@ -902,11 +902,15 @@ int wxDebugContext::Check(bool checkAll) // Count the number of non-wxDebugContext-related objects // that are outstanding -int wxDebugContext::CountObjectsLeft(void) +int wxDebugContext::CountObjectsLeft(bool sinceCheckpoint) { int n = 0; - - wxMemStruct *from = wxDebugContext::GetHead (); + + wxMemStruct *from = NULL; + if (sinceCheckpoint && checkPoint) + from = checkPoint->m_next; + if (from == (wxMemStruct*) NULL) + from = wxDebugContext::GetHead () ; for (wxMemStruct * st = from; st != 0; st = st->m_next) { @@ -951,6 +955,25 @@ void * operator new (size_t size, char * fileName, int lineNum) #endif } +// Added JACS 25/11/98 +void * operator new (size_t size) +{ +#ifdef NO_DEBUG_ALLOCATION + return malloc(size); +#else + return wxDebugAlloc(size, NULL, 0, FALSE); +#endif +} + +void * operator new[] (size_t size) +{ +#ifdef NO_DEBUG_ALLOCATION + return malloc(size); +#else + return wxDebugAlloc(size, NULL, 0, FALSE, TRUE); +#endif +} + #if !( defined (_MSC_VER) && (_MSC_VER <= 1020) ) void * operator new[] (size_t size, char * fileName, int lineNum) {