]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/memory.cpp
wxMotif: wxWindow/Client/PaintDC starting to work.
[wxWidgets.git] / src / common / memory.cpp
index 01f70591f97eb8440e360a1cdfd91ce3c713ea1a..8ff4ae193c21d95b2926b3771ddbeab7b177c9a8 100644 (file)
 
 #include "wx/memory.h"
 
-/*
 #ifdef new
 #undef new
 #endif
-*/
 
 // wxDebugContext wxTheDebugContext;
 /*
@@ -651,10 +649,16 @@ bool wxDebugContext::Dump(void)
     {
         appNameStr = wxTheApp->GetAppName();
         appName = (char*) (const char*) appNameStr;
-        wxTrace("Memory dump of %s at %s:\n", appName, WXSTRINGCAST wxNow() );
+        wxTrace("----- Memory dump of %s at %s -----\n", appName, WXSTRINGCAST wxNow() );
+    }
+    else
+    {
+      wxTrace( "----- Memory dump -----\n" );
     }
   }
   TraverseList ((PmSFV)&wxMemStruct::Dump, (checkPoint ? checkPoint->m_next : (wxMemStruct*)NULL));
+  
+  wxTrace( "\n\n" );
 
   return TRUE;
 #else
@@ -693,6 +697,22 @@ bool wxDebugContext::PrintStatistics(bool detailed)
   if (!HasStream())
     return FALSE;
 
+  if (TRUE)
+  {
+    char* appName = "application";
+    wxString appNameStr("");
+    if (wxTheApp)
+    {
+        appNameStr = wxTheApp->GetAppName();
+        appName = (char*) (const char*) appNameStr;
+        wxTrace("----- Memory statistics of %s at %s -----\n", appName, WXSTRINGCAST wxNow() );
+    }
+    else
+    {
+      wxTrace( "----- Memory statistics -----\n" );
+    }
+  }
+  
   bool currentMode = GetDebugMode();
   SetDebugMode(FALSE);
   
@@ -760,6 +780,7 @@ bool wxDebugContext::PrintStatistics(bool detailed)
   wxTrace("Number of object items: %ld\n", noObjectNodes);
   wxTrace("Number of non-object items: %ld\n", noNonObjectNodes);
   wxTrace("Total allocated size: %ld\n", totalSize);
+  wxTrace("\n\n");
 
   return TRUE;
 #else
@@ -780,7 +801,7 @@ bool wxDebugContext::PrintClasses(void)
     {
         appNameStr = wxTheApp->GetAppName();
         appName = (char*) (const char*) appNameStr;
-        wxTrace("Classes in %s:\n\n", appName);
+        wxTrace("----- Classes in %s -----\n", appName);
     }
   }
 
@@ -806,10 +827,10 @@ bool wxDebugContext::PrintClasses(void)
       else
         wxTrace("\n");
     }
-    node = node->Next();
+    node = wxClassInfo::sm_classTable->Next();
     n ++;
   }
-  wxTrace("\nThere are %d classes derived from wxObject.\n", n);
+  wxTrace("\nThere are %d classes derived from wxObject.\n\n\n", n);
   return TRUE;
 }    
 
@@ -891,7 +912,7 @@ void * operator new (size_t size, char * fileName, int lineNum)
 #endif
 }
 
-#if !( defined (_MSC_VER) && (_MSC_VER <= 1000) )
+#if !( defined (_MSC_VER) && (_MSC_VER <= 1020) )
 void * operator new[] (size_t size, char * fileName, int lineNum)
 {
 #ifdef NO_DEBUG_ALLOCATION
@@ -911,7 +932,7 @@ void operator delete (void * buf)
 #endif
 }
 
-#if !( defined (_MSC_VER) && (_MSC_VER <= 1000) )
+#if !( defined (_MSC_VER) && (_MSC_VER <= 1020) )
 void operator delete[] (void * buf)
 {
 #ifdef NO_DEBUG_ALLOCATION