diff options
author | Matt Valentine-House <[email protected]> | 2024-10-08 21:30:06 +0100 |
---|---|---|
committer | Matt Valentine-House <[email protected]> | 2024-11-14 10:46:36 +0000 |
commit | ee290c94a3dd0327f3407edb02272d37470edc95 () | |
tree | 941b26392942b9c927876079826f7c4a7ea0e776 /version.c | |
parent | fa10441981c89deec914ba243360b40c5aede6ed (diff) |
Include the currently active GC in RUBY_DESCRIPTION
This will add +MOD_GC to the version string and Ruby description when Ruby is compiled with shared gc support. When shared GC support is compiled in and a GC module has been loaded using RUBY_GC_LIBRARY, the version string will include the name of the currently active GC as reported by the rb_gc_active_gc_name function in the form +MOD_GC[gc_name] [Feature #20794]
Notes: Merged: https://.com/ruby/ruby/pull/11872
-rw-r--r-- | version.c | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -11,6 +11,7 @@ #include "internal/cmdlineopt.h" #include "internal/parse.h" #include "ruby/ruby.h" #include "version.h" #include "vm_core.h" @@ -61,6 +62,11 @@ const int ruby_api_version[] = { #else #define YJIT_DESCRIPTION " +YJIT" #endif const char ruby_version[] = RUBY_VERSION; const char ruby_revision[] = RUBY_FULL_REVISION; const char ruby_release_date[] = RUBY_RELEASE_DATE; @@ -167,6 +173,14 @@ define_ruby_description(const char *const jit_opt) + rb_strlen_lit(YJIT_DESCRIPTION) + rb_strlen_lit(" +MN") + rb_strlen_lit(" +PRISM") ]; int n = ruby_description_opt_point; @@ -176,6 +190,14 @@ define_ruby_description(const char *const jit_opt) RUBY_ASSERT(n <= ruby_description_opt_point + (int)rb_strlen_lit(YJIT_DESCRIPTION)); if (ruby_mn_threads_enabled) append(" +MN"); if (rb_ruby_prism_p()) append(" +PRISM"); append(ruby_description + ruby_description_opt_point); # undef append |