-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide a way to get the plan name at runtime #583
Comments
That should be possible with the current public API. Plan is an option: Lines 308 to 309 in ce82a7d
You can store it as a string somewhere, and create a C function to get it. lazy_static!{
// Get the plan option from from the MMTk instance. Dereference it to get a PlanSelector.
// Debug print it into a String, and then into a CString
static ref MMTK_PLAN_STR: CString = CString::new(format!("{:?}", *SINGLETON.get_options().plan)).unwrap();
}
#[no_mangle]
pub extern "C" fn get_plan() -> *const c_char {
MMTK_PLAN_STR.as_ptr()
} |
@wks could you please add a |
Sure. I'll work on that. |
@chrisseaton Instead of adding it to mmtk-core, I added a C API in the mmtk-ruby repository, because mmtk-core doesn't expose C API. All public Rust functions are callable from the binding, and the binding can make wrappers in whatever language relevant for that VM. The commit is: mmtk/mmtk-ruby@7c08f3d I also added a method in the Ruby VM so that we can query the plan name in Ruby. Please have a look and see if my code has any problems. mmtk/ruby#6 |
Ruby has a way to print various configuration options (which JIT it's using etc.) We'd like to be able to print out which GC is being used, so the plan name. We think we'd like a method
get_name
onPlan
for example, but we're not very experienced with the architecture of MMTk.The text was updated successfully, but these errors were encountered: