Ruby
2.4.2p198(2017-09-14revision59899)
|
Go to the source code of this file.
Data Structures | |
struct | nogvl_ffi_call_args |
Macros | |
#define | RB_OBJ_CLASSNAME(obj) rb_obj_class(obj) |
#define | RB_OBJ_STRING(obj) (obj) |
#define | MAX_ARGS (SIZE_MAX / (sizeof(void *) + sizeof(fiddle_generic)) - 1) |
#define | Check_Max_Args(name, len) Check_Max_Args_(name, len, "") |
#define | Check_Max_Args_Long(name, len) Check_Max_Args_(name, len, "l") |
#define | Check_Max_Args_(name, len, fmt) |
Functions | |
static void | deallocate (void *p) |
static size_t | function_memsize (const void *p) |
static VALUE | allocate (VALUE klass) |
VALUE | rb_fiddle_new_function (VALUE address, VALUE arg_types, VALUE ret_type) |
static int | parse_keyword_arg_i (VALUE key, VALUE value, VALUE self) |
static VALUE | initialize (int argc, VALUE argv[], VALUE self) |
static void * | nogvl_ffi_call (void *ptr) |
static VALUE | function_call (int argc, VALUE argv[], VALUE self) |
void | Init_fiddle_function (void) |
Variables | |
VALUE | cFiddleFunction |
const rb_data_type_t | function_data_type |
#define Check_Max_Args | ( | name, | |
len | |||
) | Check_Max_Args_(name, len, "") |
Definition at line 17 of file function.c.
Referenced by function_call(), and initialize().
Definition at line 21 of file function.c.
#define Check_Max_Args_Long | ( | name, | |
len | |||
) | Check_Max_Args_(name, len, "l") |
Definition at line 19 of file function.c.
#define MAX_ARGS (SIZE_MAX / (sizeof(void *) + sizeof(fiddle_generic)) - 1) |
Definition at line 15 of file function.c.
Referenced by main().
#define RB_OBJ_CLASSNAME | ( | obj | ) | rb_obj_class(obj) |
Definition at line 5 of file function.c.
#define RB_OBJ_STRING | ( | obj | ) | (obj) |
Definition at line 6 of file function.c.
Referenced by parse_keyword_arg_i().
Definition at line 59 of file function.c.
References callback_args::cif, and TypedData_Make_Struct.
Referenced by Init_fiddle_function().
|
static |
Definition at line 32 of file function.c.
References xfree().
Definition at line 166 of file function.c.
References ALLOCV, ALLOCV_END, argc, Check_Max_Args, nogvl_ffi_call_args::cif, CLASS_OF, errno, FIX2INT, nogvl_ffi_call_args::fn, GENERIC2VALUE, INT2FIX, INT2NUM, mFiddle, NIL_P, nogvl_ffi_call(), NULL, NUM2PTR, OBJ_TAINTED, RARRAY_AREF, RARRAY_LENINT, rb_const_get(), rb_error_arity(), rb_eSecurityError, rb_funcall(), rb_Integer(), rb_intern, rb_iv_get(), rb_raise(), rb_safe_level(), rb_thread_call_without_gvl(), nogvl_ffi_call_args::retval, TYPE_VOIDP, TypedData_Get_Struct, VALUE2GENERIC, and nogvl_ffi_call_args::values.
Referenced by Init_fiddle_function().
|
static |
Definition at line 40 of file function.c.
References ffi_raw_size(), and size.
void Init_fiddle_function | ( | void | ) |
Definition at line 232 of file function.c.
References allocate(), cFiddleFunction, FFI_DEFAULT_ABI, FFI_STDCALL, function_call(), initialize(), INT2NUM, mFiddle, rb_cObject, rb_define_alloc_func(), rb_define_class_under(), rb_define_const(), and rb_define_method().
Referenced by Init_fiddle().
Definition at line 91 of file function.c.
References callback_args::args, Check_Max_Args, Check_Type, callback_args::cif, FFI_DEFAULT_ABI, ffi_prep_cif(), INT2FFI_TYPE, INT2FIX, len, NIL_P, NULL, NUM2INT, NUM2PTR, OBJ_FREEZE, parse_keyword_arg_i(), PTR2NUM, RARRAY_AREF, RARRAY_LEN, RARRAY_LENINT, RARRAY_PTR, rb_ary_store(), rb_ary_subseq(), rb_eRuntimeError, rb_hash_foreach(), rb_Integer(), rb_iv_set(), rb_raise(), rb_scan_args(), result, T_ARRAY, TypedData_Get_Struct, and xcalloc.
Referenced by Init_fiddle_function().
|
static |
Definition at line 156 of file function.c.
References nogvl_ffi_call_args::cif, ffi_call(), nogvl_ffi_call_args::fn, NULL, nogvl_ffi_call_args::retval, and nogvl_ffi_call_args::values.
Referenced by function_call().
Definition at line 79 of file function.c.
References ID2SYM, PRIsVALUE, rb_eArgError, rb_intern, rb_iv_set(), RB_OBJ_STRING, rb_raise(), and ST_CONTINUE.
Referenced by initialize().
Definition at line 67 of file function.c.
References argv, cFiddleFunction, and rb_class_new_instance().
Referenced by rb_fiddle_ptr_free_get().
VALUE cFiddleFunction |
Definition at line 13 of file function.c.
Referenced by Init_fiddle_function(), and rb_fiddle_new_function().
const rb_data_type_t function_data_type |
Definition at line 53 of file function.c.