Using rb_iseq_load


Is this API supported by ruby 1.9, I’m trying module to load pre-
compiled version of a script but I endup with core dump.

this the extension:

#include <ruby.h>

VALUE Loader = Qnil;

VALUE load_ruby_iseq(int argc, VALUE *argv, VALUE self)
VALUE data, opt=Qnil;
rb_scan_args(argc, argv, “11”, &data, &opt);

return rb_iseq_load(data, 0, opt);

void Init_loader()
Loader = rb_define_class(“Loader”, rb_cObject);
rb_define_singleton_method(Loader, “load”, load_ruby_iseq, -1);

This the first time i wrote ruby extension, so I’m guessing something
wrong with my code !!!


return rb_iseq_load(data, 0, opt);

twould appear that that’s the right way.
maybe ask core about it?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs