зеркало из https://github.com/mozilla/gecko-dev.git
Bug 559113 - Fix dangling FILE pointer in GCMETER code. r=jorendorff.
This commit is contained in:
Родитель
95065267f5
Коммит
99e8d55d3d
|
@ -2843,11 +2843,11 @@ void dumpGCTimer(GCTimer *gcT, uint64 firstEnter, bool lastGC)
|
|||
|
||||
if (!gcFile) {
|
||||
gcFile = fopen("gcTimer.dat", "w");
|
||||
JS_ASSERT(gcFile);
|
||||
|
||||
fprintf(gcFile, " AppTime, Total, Mark, Sweep, FinObj, ");
|
||||
fprintf(gcFile, "FinStr, FinDbl, Destroy, newChunks, destoyChunks\n");
|
||||
}
|
||||
JS_ASSERT(gcFile);
|
||||
fprintf(gcFile, "%12.1f, %6.1f, %6.1f, %6.1f, %6.1f, %6.1f, %6.1f, %7.1f, ",
|
||||
(double)(gcT->enter - firstEnter) / 1E6,
|
||||
(double)(gcT->end-gcT->enter) / 1E6,
|
||||
|
@ -2860,8 +2860,10 @@ void dumpGCTimer(GCTimer *gcT, uint64 firstEnter, bool lastGC)
|
|||
fprintf(gcFile, "%10d, %10d \n", newChunkCount, destroyChunkCount);
|
||||
fflush(gcFile);
|
||||
|
||||
if (lastGC)
|
||||
if (lastGC) {
|
||||
fclose(gcFile);
|
||||
gcFile = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
# define GCTIMER_PARAM , GCTimer &gcTimer
|
||||
|
|
Загрузка…
Ссылка в новой задаче