Sha256: ac7cb27b5f0ed63560cac7d41e52a8e83f037e05c1df70beb5f6520378903a28

Contents?: true

Size: 509 Bytes

Versions: 3

Compression:

Stored size: 509 Bytes

Contents

#include "ruby.h"

extern VALUE rb_cRubyVM;
extern int mjit_init_p;

/* Calling this without --jit would cause SEGV. */
static VALUE
mjit_enable(VALUE self)
{
    mjit_init_p = 1;
    return Qtrue;
}

static VALUE
mjit_disable(VALUE self)
{
    mjit_init_p = 0;
    return Qfalse;
}

void
Init_mjit()
{
    VALUE rb_mMJIT = rb_const_get(rb_cRubyVM, rb_intern("MJIT"));
    rb_define_singleton_method(rb_mMJIT, "enable", mjit_enable, 0);
    rb_define_singleton_method(rb_mMJIT, "disable", mjit_disable, 0);
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mjit-0.3.0 ext/mjit/mjit.c
mjit-0.2.0 ext/mjit/mjit.c
mjit-0.1.0 ext/mjit/mjit.c