mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Restructure irep->outer chain; fix #3804
Instead of `irep -> proc` chain, we use `irep -> irep` chain to avoid GC bugs like #3804. We added `target_class` reference to `mrb_irep` struct. That means one more word consumption per `irep`.
This commit is contained in:
@@ -46,7 +46,8 @@ typedef struct mrb_irep {
|
||||
|
||||
int ilen, plen, slen, rlen, refcnt;
|
||||
|
||||
struct RProc *outer; /* Refers outer scope */
|
||||
struct mrb_irep *outer; /* Refers outer scope */
|
||||
struct RClass *target_class;
|
||||
} mrb_irep;
|
||||
|
||||
#define MRB_ISEQ_NO_FREE 1
|
||||
|
||||
@@ -57,8 +57,6 @@ struct RProc {
|
||||
#define MRB_PROC_STRICT_P(p) (((p)->flags & MRB_PROC_STRICT) != 0)
|
||||
#define MRB_PROC_ORPHAN 512
|
||||
#define MRB_PROC_ORPHAN_P(p) (((p)->flags & MRB_PROC_ORPHAN) != 0)
|
||||
#define MRB_PROC_CLASS 1024
|
||||
#define MRB_PROC_CLASS_P(p) (((p)->flags & MRB_PROC_CLASS) != 0)
|
||||
|
||||
#define mrb_proc_ptr(v) ((struct RProc*)(mrb_ptr(v)))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user