Ruby
2.5.0dev(2017-10-22revision60238)
|
Go to the source code of this file.
Data Structures | |
struct | cont_saved_vm_stack |
struct | rb_context_struct |
struct | rb_fiber_struct |
Macros | |
#define | FIBER_USE_NATIVE 0 |
#define | CAPTURE_JUST_VALID_VM_STACK 1 |
#define | FIBER_CREATED_P(fib) ((fib)->status == FIBER_CREATED) |
#define | FIBER_RESUMED_P(fib) ((fib)->status == FIBER_RESUMED) |
#define | FIBER_SUSPENDED_P(fib) ((fib)->status == FIBER_SUSPENDED) |
#define | FIBER_TERMINATED_P(fib) ((fib)->status == FIBER_TERMINATED) |
#define | FIBER_RUNNABLE_P(fib) (FIBER_CREATED_P(fib) || FIBER_SUSPENDED_P(fib)) |
#define | GetContPtr(obj, ptr) TypedData_Get_Struct((obj), rb_context_t, &cont_data_type, (ptr)) |
#define | GetFiberPtr(obj, ptr) |
#define | THREAD_MUST_BE_RUNNING(th) |
#define | STACK_PAD_SIZE 1024 |
Typedefs | |
typedef struct rb_context_struct | rb_context_t |
Enumerations | |
enum | context_type { CONTINUATION_CONTEXT = 0, FIBER_CONTEXT = 1, ROOT_FIBER_CONTEXT = 2 } |
enum | fiber_status { FIBER_CREATED, FIBER_RESUMED, FIBER_SUSPENDED, FIBER_TERMINATED } |
#define FIBER_CREATED_P | ( | fib | ) | ((fib)->status == FIBER_CREATED) |
#define FIBER_RESUMED_P | ( | fib | ) | ((fib)->status == FIBER_RESUMED) |
Definition at line 137 of file cont.c.
Referenced by rb_fiber_start().
#define FIBER_RUNNABLE_P | ( | fib | ) | (FIBER_CREATED_P(fib) || FIBER_SUSPENDED_P(fib)) |
#define FIBER_SUSPENDED_P | ( | fib | ) | ((fib)->status == FIBER_SUSPENDED) |
#define FIBER_TERMINATED_P | ( | fib | ) | ((fib)->status == FIBER_TERMINATED) |
Definition at line 139 of file cont.c.
Referenced by rb_fiber_alive_p().
#define GetContPtr | ( | obj, | |
ptr | |||
) | TypedData_Get_Struct((obj), rb_context_t, &cont_data_type, (ptr)) |
#define GetFiberPtr | ( | obj, | |
ptr | |||
) |
Definition at line 209 of file cont.c.
Referenced by rb_fiber_alive_p(), rb_fiber_resume(), and rb_fiber_transfer().
#define STACK_PAD_SIZE 1024 |
#define THREAD_MUST_BE_RUNNING | ( | th | ) |
typedef struct rb_context_struct rb_context_t |
enum context_type |
enum fiber_status |
void Init_Cont | ( | void | ) |
Definition at line 1785 of file cont.c.
References rb_thread_struct::ec, GET_THREAD, rb_execution_context_struct::machine, SET_MACHINE_STACK_END, and rb_execution_context_struct::stack_end.
NOINLINE | ( | static VALUE | cont_capturevolatile int *volatile stat | ) |
NOINLINE | ( | NORETURN(static void cont_restore_1(rb_context_t *)) | ) |
NORETURN | ( | NOINLINE(static void cont_restore_0(rb_context_t *, VALUE *)) | ) |
Definition at line 1631 of file cont.c.
References FIBER_TERMINATED_P, GetFiberPtr, Qfalse, and Qtrue.
void rb_fiber_mark_self | ( | const rb_fiber_t * | fib | ) |
Definition at line 377 of file cont.c.
References rb_fiber_struct::cont, rb_gc_mark(), and rb_context_struct::self.
void rb_fiber_reset_root_local_storage | ( | VALUE | thval | ) |
Definition at line 1612 of file cont.c.
Referenced by ruby_vm_destruct().
Definition at line 1590 of file cont.c.
References rb_fiber_struct::cont, GetFiberPtr, rb_fiber_struct::prev, rb_raise(), ROOT_FIBER_CONTEXT, and rb_context_struct::type.
void rb_fiber_start | ( | void | ) |
Definition at line 1325 of file cont.c.
References rb_context_struct::argc, argc, argv, rb_thread_struct::ec, err, rb_execution_context_struct::errinfo, EXEC_EVENT_HOOK, EXEC_TAG, rb_execution_context_struct::fiber, FIBER_RESUMED_P, rb_fiber_struct::first_proc, GET_THREAD, GetProcPtr, NIL_P, Qfalse, Qnil, RARRAY_CONST_PTR, rb_threadptr_pending_interrupt_enque(), rb_vm_invoke_proc(), rb_vm_make_jump_tag_but_local_jump(), rb_vm_proc_local_ep(), rb_execution_context_struct::root_lep, rb_execution_context_struct::root_svar, RUBY_EVENT_FIBER_SWITCH, RUBY_VM_SET_INTERRUPT, rb_thread_struct::self, TAG_FATAL, TAG_NONE, TAG_RAISE, TH_POP_TAG, TH_PUSH_TAG, rb_context_struct::value, VAR_FROM_MEMORY, VM_ASSERT, and VM_BLOCK_HANDLER_NONE.
Definition at line 1563 of file cont.c.
References GetFiberPtr.
Definition at line 425 of file cont.c.
References Qfalse, Qtrue, and rb_typeddata_is_kind_of().
rb_control_frame_t* rb_vm_push_frame | ( | rb_execution_context_t * | sec, |
const rb_iseq_t * | iseq, | ||
VALUE | type, | ||
VALUE | self, | ||
VALUE | specval, | ||
VALUE | cref_or_me, | ||
const VALUE * | pc, | ||
VALUE * | sp, | ||
int | local_size, | ||
int | stack_max | ||
) |
Definition at line 273 of file vm_insnhelper.c.
RUBY_SYMBOL_EXPORT_BEGIN void ruby_Init_Continuation_body | ( | void | ) |
Definition at line 1813 of file cont.c.
Referenced by Init_continuation().
void ruby_Init_Fiber_as_Coroutine | ( | void | ) |