search for: rb_ary_entry_arg

Displaying 1 result from an estimated 1 matches for "rb_ary_entry_arg".

Did you mean: rb_ary_entry_args
2011 Jan 05
0
Fwd: Review of libguestfs ruby bindings
...of the faulting code back into the interpreter. You've now leaked strlist. The idiom to deal with this is a bit clunky; it essentially involves invoking a callback that is guaranteed to never longjmp out, then checking for errors and longjmp'ing yourself. A very simple example is: struct rb_ary_entry_args { VALUE arr; int offset; }; static VALUE rb_ary_entry_wrap(VALUE in) { struct rb_ary_entry_args *e = (struct rb_ary_entry_args *)in; return rb_ary_entry(e->arr, e->offset); } Check_Type (strlistv, T_ARRAY); { size_t i, len; struct rb_ary_entry_args args; i...