Ruby 2.7.6p219 (2022-04-12 revision c9c2245c0a25176072e02db9254f0e0c84c805cd)
Data Structures | Macros | Typedefs | Functions
Context.h File Reference
#include <assert.h>
#include <stddef.h>
#include <setjmp.h>
#include <string.h>
#include <stdlib.h>
#include <alloca.h>

Go to the source code of this file.

Data Structures

struct  coroutine_context
 

Macros

#define COROUTINE   __attribute__((noreturn)) void
 
#define COROUTINE_LIMITED_ADDRESS_SPACE
 
#define COROUTINE_PRIVATE_STACK
 

Typedefs

typedef COROUTINE(* coroutine_start) (struct coroutine_context *from, struct coroutine_context *self)
 

Functions

int coroutine_save_stack (struct coroutine_context *context)
 
COROUTINE coroutine_restore_stack (struct coroutine_context *context)
 
struct coroutine_contextcoroutine_transfer (struct coroutine_context *current, register struct coroutine_context *target)
 

Macro Definition Documentation

◆ COROUTINE

#define COROUTINE   __attribute__((noreturn)) void

Definition at line 17 of file Context.h.

◆ COROUTINE_LIMITED_ADDRESS_SPACE

#define COROUTINE_LIMITED_ADDRESS_SPACE

Definition at line 20 of file Context.h.

◆ COROUTINE_PRIVATE_STACK

#define COROUTINE_PRIVATE_STACK

Definition at line 24 of file Context.h.

Typedef Documentation

◆ coroutine_start

typedef COROUTINE(* coroutine_start) (struct coroutine_context *from, struct coroutine_context *self)

Definition at line 40 of file Context.h.

Function Documentation

◆ coroutine_restore_stack()

COROUTINE coroutine_restore_stack ( struct coroutine_context context)

Referenced by coroutine_transfer().

◆ coroutine_save_stack()

int coroutine_save_stack ( struct coroutine_context context)

Definition at line 78 of file Context.c.

References _setjmp(), and coroutine_context::state.

Referenced by coroutine_transfer().

◆ coroutine_transfer()

struct coroutine_context * coroutine_transfer ( struct coroutine_context current,
register struct coroutine_context target 
)