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

Unified Diff: runtime/vm/flags.cc

Issue 8713012: Introduce Dart_SetVMFlags API function. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Force atomicity. Created 9 years, 1 month 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
« runtime/vm/flags.h ('K') | « runtime/vm/flags.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flags.cc
diff --git a/runtime/vm/flags.cc b/runtime/vm/flags.cc
index 74cb5e7450bceb806688aee2d5355cf79ab67605..19cc3f8a2591c20db09c8dc4e66e838eccc0b9cf 100644
--- a/runtime/vm/flags.cc
+++ b/runtime/vm/flags.cc
@@ -16,6 +16,8 @@ DEFINE_FLAG(bool, ignore_unrecognized_flags, false,
// List of registered flags.
Flag* Flags::flags_ = NULL;
+bool Flags::initialized_ = false;
+
class Flag {
public:
enum Type {
@@ -227,6 +229,13 @@ static bool IsValidFlag(const char* name,
void Flags::ProcessCommandLineFlags(int number_of_vm_flags,
siva 2011/11/30 19:09:38 void => bool
podivilov 2011/12/01 11:10:22 Done.
const char** vm_flags) {
+ if (initialized_) {
+ UNREACHABLE();
+ return;
siva 2011/11/30 19:09:38 return false; and remove the UNREACHABLE();
podivilov 2011/12/01 11:10:22 Done.
+ }
+
+ initialized_ = true;
+
const char* kPrefix = "--";
const intptr_t kPrefixLen = strlen(kPrefix);
« runtime/vm/flags.h ('K') | « runtime/vm/flags.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698