using rb_iseq_load

H

Husam Senussi

Hi,

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 !!!


Thanks
Husam
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top