summaryrefslogtreecommitdiff
path: root/ruby.c
diff options
context:
space:
mode:
authorPeter Zhu <[email protected]>2024-07-23 14:43:16 -0400
committerPeter Zhu <[email protected]>2024-07-24 08:36:40 -0400
commitf69ba5716f17d8ebe089a4986977afd2feefabc2 (patch)
tree368dcf8f5cbe46ad1b583f0a732ca7389151919b /ruby.c
parent993bb55d982f315f5137fc9b5d9d087e971270c2 (diff)
Move RUBY_FREE_AT_EXIT check earlier
Things that exit early, like `ruby -v`, could not use RUBY_FREE_AT_EXIT because the check for RUBY_FREE_AT_EXIT was not executed.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/11230
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/ruby.c b/ruby.c
index cdbc038b5c..abe4f0f06d 100644
--- a/ruby.c
+++ b/ruby.c
@@ -1784,11 +1784,6 @@ ruby_opt_init(ruby_cmdline_options_t *opt)
"environment variables RUBY_GC_HEAP_%d_INIT_SLOTS");
}
- if (getenv("RUBY_FREE_AT_EXIT")) {
- rb_category_warn(RB_WARN_CATEGORY_EXPERIMENTAL, "Free at exit is experimental and may be unstable");
- rb_free_at_exit = true;
- }
-
#if USE_RJIT
// rb_call_builtin_inits depends on RubyVM::RJIT.enabled?
if (opt->rjit.on)
@@ -3105,6 +3100,12 @@ ruby_process_options(int argc, char **argv)
void ruby_set_crash_report(const char *template);
ruby_set_crash_report(opt.crash_report);
}
+
+ if (getenv("RUBY_FREE_AT_EXIT")) {
+ rb_free_at_exit = true;
+ rb_category_warn(RB_WARN_CATEGORY_EXPERIMENTAL, "Free at exit is experimental and may be unstable");
+ }
+
return (void*)(struct RData*)iseq;
}