Ruby  2.4.2p198(2017-09-14revision59899)
Data Structures | Macros | Functions | Variables
closure.c File Reference
#include <fiddle.h>
#include <ruby/thread.h>
#include "internal.h"
Include dependency graph for closure.c:

Go to the source code of this file.

Data Structures

struct  fiddle_closure
 
struct  callback_args
 

Macros

#define USE_FFI_CLOSURE_ALLOC   1
 

Functions

static void dealloc (void *ptr)
 
static size_t closure_memsize (const void *ptr)
 
static void * with_gvl_callback (void *ptr)
 
static 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 (void)
 

Variables

VALUE cFiddleClosure
 
const rb_data_type_t closure_data_type
 

Macro Definition Documentation

◆ USE_FFI_CLOSURE_ALLOC

#define USE_FFI_CLOSURE_ALLOC   1

Definition at line 22 of file closure.c.

Function Documentation

◆ allocate()

static VALUE allocate ( VALUE  klass)
static

Definition at line 200 of file closure.c.

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

Referenced by Init_fiddle_closure().

◆ callback()

static void callback ( ffi_cif *  cif,
void *  resp,
void **  args,
void *  ctx 
)
static

◆ closure_memsize()

static size_t closure_memsize ( const void *  ptr)
static

Definition at line 39 of file closure.c.

References fiddle_closure::argv, fiddle_closure::cif, ffi_raw_size(), and size.

◆ dealloc()

static void dealloc ( void *  ptr)
static

Definition at line 26 of file closure.c.

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

◆ Init_fiddle_closure()

void Init_fiddle_closure ( void  )

◆ initialize()

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

◆ to_i()

static VALUE to_i ( VALUE  self)
static

Definition at line 278 of file closure.c.

References fiddle_closure::code, PTR2NUM, and TypedData_Get_Struct.

Referenced by Init_fiddle_closure().

◆ with_gvl_callback()

static void* with_gvl_callback ( void *  ptr)
static

Variable Documentation

◆ cFiddleClosure

VALUE cFiddleClosure

Definition at line 5 of file closure.c.

Referenced by Init_fiddle_closure().

◆ closure_data_type

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

Definition at line 54 of file closure.c.