diff --git a/src/util/options.rs b/src/util/options.rs index 9be6d20e18..ac72a98e49 100644 --- a/src/util/options.rs +++ b/src/util/options.rs @@ -116,6 +116,8 @@ pub struct MMTKOption { from_env_var: bool, /// Can we set this option through command line options/API? from_command_line: bool, + /// Is this a default value and has never been modified by the user? + pub is_default: bool, } impl MMTKOption { @@ -143,11 +145,13 @@ impl MMTKOption { validator, from_env_var, from_command_line, + is_default: true, } } /// Set the option to the given value. Returns true if the value is valid, and we set the option to the value. pub fn set(&mut self, value: T) -> bool { + self.is_default = false; if (self.validator)(&value) { self.value = value; return true;