ext/fiddle/function.c in fiddle-1.1.2 vs ext/fiddle/function.c in fiddle-1.1.3

- old
+ new

@@ -57,11 +57,11 @@ .function = { .dmark = 0, .dfree = deallocate, .dsize = function_memsize }, - .flags = RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED, + .flags = FIDDLE_DEFAULT_TYPED_DATA_FLAGS, }; static VALUE allocate(VALUE klass) { @@ -151,10 +151,13 @@ kw[kw_need_gvl] = rb_intern_const("need_gvl"); } rb_get_kwargs(kwargs, kw, 0, kw_max_, args); if (args[kw_name] != Qundef) { name = args[kw_name]; +#ifdef HAVE_RB_STR_TO_INTERNED_STR + name = rb_str_to_interned_str(name); +#endif } if (args[kw_need_gvl] != Qundef) { need_gvl = args[kw_need_gvl]; } } @@ -369,11 +372,11 @@ rb_ary_push(converted_args, src); } args.values[i_call] = (void *)&generic_args[i_call]; } args.values[i_call] = NULL; - args.fn = (void(*)(void))NUM2PTR(cfunc); + args.fn = (void(*)(void))(VALUE)NUM2PTR(cfunc); if (RTEST(need_gvl)) { ffi_call(args.cif, args.fn, &(args.retval), args.values); } else { @@ -491,6 +494,5 @@ * * +need_gvl+ is whether GVL is needed to call the function * */ rb_define_method(cFiddleFunction, "initialize", initialize, -1); } -/* vim: set noet sws=4 sw=4: */