Skip to content

Commit 314dcea

Browse files
committed
Refactor Options
Remove env_var and command_line because they can all be set in both ways. Also renamed functions that set options by name, and removed "convenient methods" in MMTKBuilder and memory_manager.
1 parent cd2fe83 commit 314dcea

File tree

3 files changed

+107
-140
lines changed

3 files changed

+107
-140
lines changed

src/memory_manager.rs

-19
Original file line numberDiff line numberDiff line change
@@ -494,25 +494,6 @@ pub fn initialize_collection<VM: VMBinding>(mmtk: &'static MMTK<VM>, tls: VMThre
494494
mmtk.initialize_collection(tls);
495495
}
496496

497-
/// Process MMTk run-time options. Returns true if the option is processed successfully.
498-
///
499-
/// Arguments:
500-
/// * `mmtk`: A reference to an MMTk instance.
501-
/// * `name`: The name of the option.
502-
/// * `value`: The value of the option (as a string).
503-
pub fn process(builder: &mut MMTKBuilder, name: &str, value: &str) -> bool {
504-
builder.set_option(name, value)
505-
}
506-
507-
/// Process multiple MMTk run-time options. Returns true if all the options are processed successfully.
508-
///
509-
/// Arguments:
510-
/// * `mmtk`: A reference to an MMTk instance.
511-
/// * `options`: a string that is key value pairs separated by white spaces, e.g. "threads=1 stress_factor=4096"
512-
pub fn process_bulk(builder: &mut MMTKBuilder, options: &str) -> bool {
513-
builder.set_options_bulk_by_str(options)
514-
}
515-
516497
/// Return used memory in bytes. MMTk accounts for memory in pages, thus this method always returns a value in
517498
/// page granularity.
518499
///

src/mmtk.rs

-11
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,6 @@ impl MMTKBuilder {
7575
}
7676
}
7777

78-
/// Set an option.
79-
pub fn set_option(&mut self, name: &str, val: &str) -> bool {
80-
self.options.set_from_command_line(name, val)
81-
}
82-
83-
/// Set multiple options by a string. The string should be key-value pairs separated by white spaces,
84-
/// such as `threads=1 stress_factor=4096`.
85-
pub fn set_options_bulk_by_str(&mut self, options: &str) -> bool {
86-
self.options.set_bulk_from_command_line(options)
87-
}
88-
8978
/// Custom VM layout constants. VM bindings may use this function for compressed or 39-bit heap support.
9079
/// This function must be called before MMTk::new()
9180
pub fn set_vm_layout(&mut self, constants: VMLayout) {

0 commit comments

Comments
 (0)