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

Unified Diff: runtime/vm/isolate_reload.cc

Issue 2240283002: Reload: Don't free the saved class table while another thread may be reading it. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: . Created 4 years, 4 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 | « runtime/vm/isolate.cc ('k') | runtime/vm/unit_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/isolate_reload.cc
diff --git a/runtime/vm/isolate_reload.cc b/runtime/vm/isolate_reload.cc
index 0957f6fa388e471ee16abfaef84d7da022d02434..81ba9a8009611d4f026b6d8673d657b4457171aa 100644
--- a/runtime/vm/isolate_reload.cc
+++ b/runtime/vm/isolate_reload.cc
@@ -924,9 +924,13 @@ void IsolateReloadContext::RollbackClasses() {
class_table->SetAt(i, saved_class_table_[i]);
}
}
- free(saved_class_table_);
+
+ RawClass** local_saved_class_table = saved_class_table_;
saved_class_table_ = NULL;
- saved_num_cids_ = 0;
+ // Can't free this table immediately as another thread (e.g., the sweeper) may
+ // be suspended between loading the table pointer and loading the table
+ // element. Table will be freed at the next major GC or isolate shutdown.
+ class_table->AddOldTable(local_saved_class_table);
siva 2016/08/12 21:10:45 When does saved_num_cids_ get set to 0?
rmacnak 2016/08/12 21:15:29 Never. We can't set it to zero here because anothe
}
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/unit_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698