diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-06-05 07:43:40 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-10-12 16:21:03 +0900 |
| commit | 5a3e014e4914dbd6421dbbd81e889cd6952e924b (patch) | |
| tree | 0975df1e1554c177d1b7adb1081d70d74c5bf505 /src/proc.c | |
| parent | 744ba809198d79198246dbd6936a53fa98269ccb (diff) | |
| download | mruby-5a3e014e4914dbd6421dbbd81e889cd6952e924b.tar.gz mruby-5a3e014e4914dbd6421dbbd81e889cd6952e924b.zip | |
Constify `irep` members.
- `pool`
- `syms`
- `reps`
Diffstat (limited to 'src/proc.c')
| -rw-r--r-- | src/proc.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/proc.c b/src/proc.c index 36e7a5652..2a980620b 100644 --- a/src/proc.c +++ b/src/proc.c @@ -15,7 +15,7 @@ static const mrb_code call_iseq[] = { }; struct RProc* -mrb_proc_new(mrb_state *mrb, mrb_irep *irep) +mrb_proc_new(mrb_state *mrb, const mrb_irep *irep) { struct RProc *p; mrb_callinfo *ci = mrb->c->ci; @@ -34,7 +34,7 @@ mrb_proc_new(mrb_state *mrb, mrb_irep *irep) p->e.target_class = tc; } p->body.irep = irep; - mrb_irep_incref(mrb, irep); + mrb_irep_incref(mrb, (mrb_irep*)irep); return p; } @@ -90,7 +90,7 @@ closure_setup(mrb_state *mrb, struct RProc *p) } struct RProc* -mrb_closure_new(mrb_state *mrb, mrb_irep *irep) +mrb_closure_new(mrb_state *mrb, const mrb_irep *irep) { struct RProc *p = mrb_proc_new(mrb, irep); @@ -181,7 +181,7 @@ mrb_proc_copy(struct RProc *a, struct RProc *b) a->flags = b->flags; a->body = b->body; if (!MRB_PROC_CFUNC_P(a) && a->body.irep) { - a->body.irep->refcnt++; + mrb_irep_incref(NULL, (mrb_irep*)a->body.irep); } a->upper = b->upper; a->e.env = b->e.env; @@ -262,7 +262,7 @@ proc_lambda(mrb_state *mrb, mrb_value self) mrb_int mrb_proc_arity(const struct RProc *p) { - struct mrb_irep *irep; + const mrb_irep *irep; const mrb_code *pc; mrb_aspec aspec; int ma, op, ra, pa, arity; |
