From 3acaa44a70a44a816076dee65310f0f2487aeebd Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Mon, 4 Sep 2017 06:51:31 +0900 Subject: 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`. --- include/mruby/irep.h | 3 ++- include/mruby/proc.h | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/mruby/irep.h b/include/mruby/irep.h index 0370e3983..2717b09c3 100644 --- a/include/mruby/irep.h +++ b/include/mruby/irep.h @@ -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 diff --git a/include/mruby/proc.h b/include/mruby/proc.h index 244b2c361..9c2666289 100644 --- a/include/mruby/proc.h +++ b/include/mruby/proc.h @@ -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))) -- cgit v1.2.3