X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/16c1f7f345e1850f590cfbf67c3b00fbb6d2e62e..520e470fdd0daef09c77938db642e4583933c90d:/src/common/memory.cpp diff --git a/src/common/memory.cpp b/src/common/memory.cpp index 8ff4ae193c..1d44a664e9 100644 --- a/src/common/memory.cpp +++ b/src/common/memory.cpp @@ -24,7 +24,7 @@ #include "wx/defs.h" #endif -#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT +#if (WXDEBUG && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT #ifdef __GNUG__ // #pragma implementation @@ -37,12 +37,16 @@ #include -#if USE_IOSTREAMH +#if wxUSE_IOSTREAMH #include +#include #else #include +#include +# ifdef _MSC_VER + using namespace std; +# endif #endif -#include #if !defined(__WATCOMC__) && !defined(__VMS__) #include @@ -324,7 +328,7 @@ void wxMemStruct::PrintNode () { wxObject *obj = (wxObject *)m_actualData; wxClassInfo *info = obj->GetClassInfo(); - +/* if (info && info->GetClassName()) wxTrace("%s", info->GetClassName()); else @@ -333,13 +337,25 @@ void wxMemStruct::PrintNode () if (m_fileName) wxTrace(" (%s %d)", m_fileName, (int)m_lineNum); + wxTrace(" at $%lX, size %d\n", (long)GetActualData(), (int)RequestSize()); +*/ + // Let's put this in standard form so IDEs can load the file at the appropriate + // line + if (m_fileName) + wxTrace("%s(%d): ", m_fileName, (int)m_lineNum); + + if (info && info->GetClassName()) + wxTrace("%s", info->GetClassName()); + else + wxTrace("object"); + wxTrace(" at $%lX, size %d\n", (long)GetActualData(), (int)RequestSize()); } else { - wxTrace("Non-object data"); if (m_fileName) - wxTrace(" (%s %d)", m_fileName, (int)m_lineNum); + wxTrace("%s(%d): ", m_fileName, (int)m_lineNum); + wxTrace("non-object data"); wxTrace(" at $%lX, size %d\n", (long)GetActualData(), (int)RequestSize()); } } @@ -351,23 +367,19 @@ void wxMemStruct::Dump () if (m_isObject) { wxObject *obj = (wxObject *)m_actualData; -// wxClassInfo *info = obj->GetClassInfo(); if (m_fileName) - wxTrace("Item (%s %d)", m_fileName, (int)m_lineNum); - else - wxTrace("Item"); + wxTrace("%s(%d): ", m_fileName, (int)m_lineNum); - wxTrace(" at $%lX, size %d: ", (long)GetActualData(), (int)RequestSize()); -// wxTrace(info->GetClassName()); obj->Dump(wxDebugContext::GetStream()); + wxTrace(" at $%lX, size %d", (long)GetActualData(), (int)RequestSize()); wxTrace("\n"); } else { - wxTrace("Non-object data"); if (m_fileName) - wxTrace(" (%s %d)", m_fileName, (int)m_lineNum); + wxTrace("%s(%d): ", m_fileName, (int)m_lineNum); + wxTrace("non-object data"); wxTrace(" at $%lX, size %d\n", (long)GetActualData(), (int)RequestSize()); } } @@ -888,7 +900,7 @@ int wxDebugContext::CountObjectsLeft(void) // We'll only do malloc and free for the moment: leave the interesting // stuff for the wxObject versions. -#if WXDEBUG && USE_GLOBAL_MEMORY_OPERATORS +#if WXDEBUG && wxUSE_GLOBAL_MEMORY_OPERATORS #ifdef new #undef new @@ -932,6 +944,14 @@ void operator delete (void * buf) #endif } +// VC++ 6.0 +#if _MSC_VER >= 1200 +void operator delete(void* pData, char* /* fileName */, int /* lineNum */) +{ + ::operator delete(pData); +} +#endif + #if !( defined (_MSC_VER) && (_MSC_VER <= 1020) ) void operator delete[] (void * buf) { @@ -1102,7 +1122,7 @@ void wxTraceLevel(int level, const char *fmt ...) #endif } -#else // USE_MEMORY_TRACING && WXDEBUG +#else // wxUSE_MEMORY_TRACING && WXDEBUG void wxTrace(const char *WXUNUSED(fmt) ...) { }