Ruby  2.1.10p492(2016-04-01revision54464)
Data Structures | Macros | Functions | Variables
closure.c File Reference
#include <fiddle.h>

Go to the source code of this file.

Data Structures

struct  fiddle_closure
 

Macros

#define USE_FFI_CLOSURE_ALLOC   1
 

Functions

static void dealloc (void *ptr)
 
static size_t closure_memsize (const void *ptr)
 
void callback (ffi_cif *cif, void *resp, void **args, void *ctx)
 
static VALUE allocate (VALUE klass)
 
static VALUE initialize (int rbargc, VALUE argv[], VALUE self)
 
static VALUE to_i (VALUE self)
 
void Init_fiddle_closure ()
 

Variables

VALUE cFiddleClosure
 
const rb_data_type_t closure_data_type
 

Macro Definition Documentation

#define USE_FFI_CLOSURE_ALLOC   1

Definition at line 20 of file closure.c.

Function Documentation

static VALUE allocate ( VALUE  klass)
static

Definition at line 172 of file closure.c.

References fiddle_closure::code, i, NULL, fiddle_closure::pcl, and TypedData_Make_Struct.

Referenced by Init_fiddle_closure().

void callback ( ffi_cif *  cif,
void resp,
void **  args,
void ctx 
)
static size_t closure_memsize ( const void ptr)
static

Definition at line 37 of file closure.c.

References fiddle_closure::argv, fiddle_closure::cif, and size.

static void dealloc ( void ptr)
static

Definition at line 24 of file closure.c.

References fiddle_closure::argv, fiddle_closure::pcl, and xfree.

void Init_fiddle_closure ( )
static VALUE initialize ( int  rbargc,
VALUE  argv[],
VALUE  self 
)
static
static VALUE to_i ( VALUE  self)
static

Definition at line 250 of file closure.c.

References fiddle_closure::code, code, PTR2NUM, and TypedData_Get_Struct.

Referenced by Init_fiddle_closure().

Variable Documentation

VALUE cFiddleClosure

Definition at line 3 of file closure.c.

Referenced by Init_fiddle_closure().

const rb_data_type_t closure_data_type
Initial value:
= {
"fiddle/closure",
}
static void dealloc(void *ptr)
Definition: closure.c:24
static size_t closure_memsize(const void *ptr)
Definition: closure.c:37

Definition at line 53 of file closure.c.