Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(561)

Unified Diff: src/mips64/simulator-mips64.cc

Issue 419343003: when open macro GENERATED_CODE_COVERAGE, fix compiler error and fd leak (Closed) Base URL: https://github.com/v8/v8.git@master
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/mips/simulator-mips.cc ('k') | src/x64/assembler-x64.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mips64/simulator-mips64.cc
diff --git a/src/mips64/simulator-mips64.cc b/src/mips64/simulator-mips64.cc
index 86e8b91464eacbd74a54294a7a14fee232673782..bcc502f001ef0e544fd531c3eea201ecd2f6783c 100644
--- a/src/mips64/simulator-mips64.cc
+++ b/src/mips64/simulator-mips64.cc
@@ -111,11 +111,17 @@ static FILE* coverage_log = NULL;
static void InitializeCoverage() {
char* file_name = getenv("V8_GENERATED_CODE_COVERAGE_LOG");
- if (file_name != NULL) {
+ if (file_name != NULL && NULL == coverage_log) {
coverage_log = fopen(file_name, "aw+");
}
}
+static void DeinitCoverageLog() {
+ if (coverage_log != NULL) {
+ fclose(coverage_log);
+ coverage_log = NULL;
+ }
+}
void MipsDebugger::Stop(Instruction* instr) {
// Get the stop code.
@@ -150,6 +156,7 @@ void MipsDebugger::Stop(Instruction* instr) {
#define UNSUPPORTED() printf("Unsupported instruction.\n");
static void InitializeCoverage() {}
+static void DeinitCoverageLog() {}
void MipsDebugger::Stop(Instruction* instr) {
« no previous file with comments | « src/mips/simulator-mips.cc ('k') | src/x64/assembler-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698