Skip to content

Add a method to query MMTk plan name. #6

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

Merged
merged 1 commit into from
Jul 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -14486,6 +14486,15 @@ rb_gcdebug_remove_stress_to_class(int argc, VALUE *argv, VALUE self)

#include "gc.rbinc"

#ifdef USE_THIRD_PARTY_HEAP
VALUE
rb_mmtk_plan_name(VALUE _)
{
const char* plan_name = mmtk_plan_name();
return rb_str_new(plan_name, strlen(plan_name));
}
#endif

void
Init_GC(void)
{
Expand Down Expand Up @@ -14588,6 +14597,7 @@ Init_GC(void)

#ifdef USE_THIRD_PARTY_HEAP
rb_mMMTk = rb_define_module_under(rb_mGC, "MMTk");
rb_define_singleton_method(rb_mMMTk, "plan_name", rb_mmtk_plan_name, 0);
#endif

{
Expand Down
1 change: 1 addition & 0 deletions mmtk.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ extern void mmtk_flush_mark_buffer(MMTk_VMMutatorThread tls);
extern bool mmtk_will_never_move(void* object);
extern bool mmtk_process(char* name, char* value);
extern void mmtk_handle_user_collection_request(MMTk_VMMutatorThread tls);
extern const char* mmtk_plan_name();

/**
* VM Accounting
Expand Down