From 5c0b9b703c9d1a08d7219b057b809bda4bc89f8a Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Mon, 20 May 2013 17:54:07 +0900 Subject: primary mruby fiber implementation --- include/mruby.h | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'include/mruby.h') diff --git a/include/mruby.h b/include/mruby.h index 9fe70e5b8..73c38cf1d 100644 --- a/include/mruby.h +++ b/include/mruby.h @@ -61,16 +61,8 @@ typedef struct { struct REnv *env; } mrb_callinfo; -enum gc_state { - GC_STATE_NONE = 0, - GC_STATE_MARK, - GC_STATE_SWEEP -}; - -typedef struct mrb_state { - void *jmp; - - mrb_allocf allocf; +struct mrb_context { + struct mrb_context *prev; mrb_value *stack; mrb_value *stbase, *stend; @@ -82,10 +74,24 @@ typedef struct mrb_state { int rsize; struct RProc **ensure; int esize; +}; + +enum gc_state { + GC_STATE_NONE = 0, + GC_STATE_MARK, + GC_STATE_SWEEP +}; + +typedef struct mrb_state { + void *jmp; + + mrb_allocf allocf; + + struct mrb_context *c; + struct mrb_context *root_c; struct RObject *exc; struct iv_tbl *globals; - struct mrb_irep **irep; size_t irep_len, irep_capa; @@ -140,7 +146,6 @@ typedef struct mrb_state { struct RClass *eStandardError_class; void *ud; /* auxiliary data */ - } mrb_state; typedef mrb_value (*mrb_func_t)(mrb_state *mrb, mrb_value); -- cgit v1.2.3