mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Free everything at shutdown
when the RUBY_FREE_ON_SHUTDOWN environment variable is set, manually free memory at shutdown. Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org> Co-authored-by: Peter Zhu <peter@peterzhu.ca>
This commit is contained in:
parent
b361a800c2
commit
6816e8efcf
27 changed files with 285 additions and 6 deletions
5
ruby.c
5
ruby.c
|
@ -1754,6 +1754,11 @@ ruby_opt_init(ruby_cmdline_options_t *opt)
|
|||
"environment variables RUBY_GC_HEAP_%d_INIT_SLOTS");
|
||||
}
|
||||
|
||||
if (getenv("RUBY_FREE_ON_EXIT")) {
|
||||
rb_warn("Free on exit is experimental and may be unstable");
|
||||
rb_free_on_exit = true;
|
||||
}
|
||||
|
||||
#if USE_RJIT
|
||||
// rb_call_builtin_inits depends on RubyVM::RJIT.enabled?
|
||||
if (opt->rjit.on)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue