diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-05-20 17:54:07 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-05-20 17:54:07 +0900 |
| commit | 5c0b9b703c9d1a08d7219b057b809bda4bc89f8a (patch) | |
| tree | ab610a2988ef928c02bfc50e31aedc5a707f008e /src/proc.c | |
| parent | 35ee85164dd19143d4b47a34f13ad2bb71fed369 (diff) | |
| download | mruby-5c0b9b703c9d1a08d7219b057b809bda4bc89f8a.tar.gz mruby-5c0b9b703c9d1a08d7219b057b809bda4bc89f8a.zip | |
primary mruby fiber implementation
Diffstat (limited to 'src/proc.c')
| -rw-r--r-- | src/proc.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/proc.c b/src/proc.c index ce2728779..e21a37736 100644 --- a/src/proc.c +++ b/src/proc.c @@ -19,7 +19,7 @@ mrb_proc_new(mrb_state *mrb, mrb_irep *irep) struct RProc *p; p = (struct RProc*)mrb_obj_alloc(mrb, MRB_TT_PROC, mrb->proc_class); - p->target_class = (mrb->ci) ? mrb->ci->target_class : 0; + p->target_class = (mrb->c->ci) ? mrb->c->ci->target_class : 0; p->body.irep = irep; p->env = 0; @@ -31,16 +31,16 @@ closure_setup(mrb_state *mrb, struct RProc *p, int nlocals) { struct REnv *e; - if (!mrb->ci->env) { - e = (struct REnv*)mrb_obj_alloc(mrb, MRB_TT_ENV, (struct RClass*)mrb->ci->proc->env); + if (!mrb->c->ci->env) { + e = (struct REnv*)mrb_obj_alloc(mrb, MRB_TT_ENV, (struct RClass*)mrb->c->ci->proc->env); e->flags= (unsigned int)nlocals; - e->mid = mrb->ci->mid; - e->cioff = mrb->ci - mrb->cibase; - e->stack = mrb->stack; - mrb->ci->env = e; + e->mid = mrb->c->ci->mid; + e->cioff = mrb->c->ci - mrb->c->cibase; + e->stack = mrb->c->stack; + mrb->c->ci->env = e; } else { - e = mrb->ci->env; + e = mrb->c->ci->env; } p->env = e; } @@ -50,7 +50,7 @@ mrb_closure_new(mrb_state *mrb, mrb_irep *irep) { struct RProc *p = mrb_proc_new(mrb, irep); - closure_setup(mrb, p, mrb->ci->proc->body.irep->nlocals); + closure_setup(mrb, p, mrb->c->ci->proc->body.irep->nlocals); return p; } |
