summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2017-09-04 06:51:31 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2017-09-04 06:51:31 +0900
commit3acaa44a70a44a816076dee65310f0f2487aeebd (patch)
treedb7b29708bd51a1521d2695d0debdf562101d99a /include
parent8a5d783f2ee5ddccdb2b8de2edf5dc6b5ba1c3fc (diff)
downloadmruby-3acaa44a70a44a816076dee65310f0f2487aeebd.tar.gz
mruby-3acaa44a70a44a816076dee65310f0f2487aeebd.zip
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`.
Diffstat (limited to 'include')
-rw-r--r--include/mruby/irep.h3
-rw-r--r--include/mruby/proc.h2
2 files changed, 2 insertions, 3 deletions
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)))