Commit 3fc848b5 authored by dearblue's avatar dearblue

Replace `tempirep` with `RProc`

Previously I used the `RData` object to avoid a memory leak in `mrb_irep` if `src/load.c` failed.
ref: https://github.com/mruby/mruby/pull/4250
commit: f1523d24

Considering that the `RProc` object will be created in the subsequent process, it is preferable to create the `RProc` object from the beginning.
Along with this, the inside of `read_irep()` is replaced with the processing centered on the `RProc` object.

The global function that returns the `mrb_irep` pointer is still provided for compatibility.
parent e8e28eac
This diff is collapsed.
......@@ -52,7 +52,9 @@ mrb_proc_new(mrb_state *mrb, const mrb_irep *irep)
p->e.target_class = tc;
}
p->body.irep = irep;
mrb_irep_incref(mrb, (mrb_irep*)irep);
if (irep) {
mrb_irep_incref(mrb, (mrb_irep*)irep);
}
return p;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment