diff options
Diffstat (limited to 'src/ToolBox/SOS/Strike/strike.cpp')
-rw-r--r-- | src/ToolBox/SOS/Strike/strike.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/ToolBox/SOS/Strike/strike.cpp b/src/ToolBox/SOS/Strike/strike.cpp index e2c77e47ba..2a24245ee0 100644 --- a/src/ToolBox/SOS/Strike/strike.cpp +++ b/src/ToolBox/SOS/Strike/strike.cpp @@ -9414,8 +9414,7 @@ DECLARE_API(DumpLog) return Status; } -#ifdef TRACE_GC - +#ifndef FEATURE_PAL DECLARE_API (DumpGCLog) { INIT_API_NODAC(); @@ -9428,6 +9427,10 @@ DECLARE_API (DumpGCLog) } const char* fileName = "GCLog.txt"; + int iLogSize = 1024*1024; + BYTE* bGCLog = NULL; + int iRealLogSize = iLogSize - 1; + DWORD dwWritten = 0; while (isspace (*args)) args ++; @@ -9472,8 +9475,7 @@ DECLARE_API (DumpGCLog) goto exit; } - int iLogSize = 1024*1024; - BYTE* bGCLog = new NOTHROW BYTE[iLogSize]; + bGCLog = new NOTHROW BYTE[iLogSize]; if (bGCLog == NULL) { ReportOOM(); @@ -9486,7 +9488,6 @@ DECLARE_API (DumpGCLog) ExtOut("failed to read memory from %08x\n", dwAddr); } - int iRealLogSize = iLogSize - 1; while (iRealLogSize >= 0) { if (bGCLog[iRealLogSize] != '*') @@ -9497,13 +9498,17 @@ DECLARE_API (DumpGCLog) iRealLogSize--; } - DWORD dwWritten = 0; WriteFile (hGCLog, bGCLog, iRealLogSize + 1, &dwWritten, NULL); Status = S_OK; exit: + if (bGCLog != NULL) + { + delete [] bGCLog; + } + if (hGCLog != INVALID_HANDLE_VALUE) { CloseHandle (hGCLog); @@ -9518,9 +9523,7 @@ exit: return Status; } -#endif //TRACE_GC -#ifndef FEATURE_PAL DECLARE_API (DumpGCConfigLog) { INIT_API(); |