From 7ee84187e9196c453cd52b595512c8123aeadf05 Mon Sep 17 00:00:00 2001 From: "dp%netscape.com" Date: Wed, 27 Feb 2002 02:54:50 +0000 Subject: [PATCH] bug 127092 heap dumps for accurate heap measurement on MOZ_HeapDump message r=blythe, sr=brendan, a=shaver --- xpfe/bootstrap/nsAppRunner.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/xpfe/bootstrap/nsAppRunner.cpp b/xpfe/bootstrap/nsAppRunner.cpp index ca13da4cc60..48cb671f9d5 100644 --- a/xpfe/bootstrap/nsAppRunner.cpp +++ b/xpfe/bootstrap/nsAppRunner.cpp @@ -98,6 +98,10 @@ #include "nsTraceMalloc.h" #endif +#if defined(DEBUG) && defined(XP_WIN32) +#include +#endif + #include "nsITimelineService.h" #if defined(DEBUG_sspitzer) || defined(DEBUG_seth) || defined(DEBUG_pra) @@ -1527,6 +1531,14 @@ int main(int argc, char* argv[]) { NS_TIMELINE_MARK("enter main"); +#if defined(DEBUG) && defined(XP_WIN32) + // Disable small heap allocator to get heapwalk() giving us + // accurate heap numbers. Win2k non-debug does not use small heap allocator. + // Win2k debug seems to be still using it. + // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt__set_sbh_threshold.asp + _set_sbh_threshold(0); +#endif + #if defined(XP_UNIX) || defined(XP_BEOS) InstallUnixSignalHandlers(argv[0]); #endif