bug 525573: in --enable-tracemalloc builds, initialize tracemalloc in XPCOM unit tests so as to support multi-threaded tests. r=jwalden

This commit is contained in:
Chris Jones 2009-11-16 12:55:39 -06:00
parent 3be750b8f3
commit 213fbd7685

View File

@ -59,6 +59,10 @@
#include <stdlib.h>
#include <stdarg.h>
#ifdef NS_TRACE_MALLOC
# include "nsTraceMalloc.h"
#endif
static PRUint32 gFailCount = 0;
/**
@ -247,6 +251,11 @@ class ScopedXPCOM : public nsIDirectoryServiceProvider2
mTestName = testName;
printf("Running %s tests...\n", mTestName);
#ifdef NS_TRACE_MALLOC
// nsAppRunner starts tracemalloc before init'ing XPCOM
NS_TraceMallocStartup(-1); // -1 == no logging
#endif
nsresult rv = NS_InitXPCOM2(&mServMgr, NULL, this);
if (NS_FAILED(rv))
{