diff options
author | Peter Zhu <[email protected]> | 2024-07-23 14:43:16 -0400 |
---|---|---|
committer | Peter Zhu <[email protected]> | 2024-07-24 08:36:40 -0400 |
commit | f69ba5716f17d8ebe089a4986977afd2feefabc2 (patch) | |
tree | 368dcf8f5cbe46ad1b583f0a732ca7389151919b /ruby.c | |
parent | 993bb55d982f315f5137fc9b5d9d087e971270c2 (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.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -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; } |