Issue #13188 has been updated by Shyouhei Urabe.


AFAIK the ruby interpreter uses lots of global variables, which makes it practically impossible to re-initialize.

This is of course not a good thing (antique design). I think mruby is much modern here.

----------------------------------------
Bug #13188: Reinitialize Ruby VM. 
https://bugs.ruby-lang.org/issues/13188#change-62854

* Author: Joe Daniels
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 2.0.0-p648
* Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
It appears that by following what appears to be a pretty standard setup procedure: 

~~~
ruby_init_stack(variable_in_this_stack_frame)
ruby_init();
ruby_init_loadpath();
        
rb_require("enc/encdb");
rb_require("enc/trans/transdb");
ruby_process_options(Int32(options.count), &cargs)

var state: Int32 = 0;
if ruby_executable_node(node, &state) != 0 {
    state = ruby_exec_node(node)
}
if state != 0 {
    throw RubyError.current
}


ruby_cleanup(state);
~~~

Its not possible to recreate the VM. Are there instructions on this process? or is this an actionable task for which contributions from a first time contributor would be accepted? 





-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>