aboutsummaryrefslogtreecommitdiffstats
path: root/gc.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-21 09:10:42 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-21 09:10:42 +0000
commit8b71665bbe9949af434a501de69b021cc7ac672c (patch)
tree368a942f6fc4b266b554c87cf204152018846377 /gc.c
parent6ef19f6231add66fd5c29f1566206a089d9b89ae (diff)
downloadruby-8b71665bbe9949af434a501de69b021cc7ac672c.tar.gz
fix up imemo_alloc
* internal.h (rb_imemo_alloc_struct), gc.c (gc_mark_imemo): turned next into the pointer to chain. * parse.y (NEWHEAP): needs a cast. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/gc.c b/gc.c
index bcd48565c4..91ada6746c 100644
--- a/gc.c
+++ b/gc.c
@@ -4532,10 +4532,14 @@ gc_mark_imemo(rb_objspace_t *objspace, VALUE obj)
rb_iseq_mark((rb_iseq_t *)obj);
return;
case imemo_alloc:
- rb_gc_mark_locations(RANY(obj)->as.imemo.alloc.ptr,
- RANY(obj)->as.imemo.alloc.ptr + RANY(obj)->as.imemo.alloc.cnt);
- rb_gc_mark(RANY(obj)->as.imemo.alloc.next);
+ {
+ const rb_imemo_alloc_t *m = &RANY(obj)->as.imemo.alloc;
+ do {
+ rb_gc_mark_locations(m->ptr, m->ptr + m->cnt);
+ } while ((m = m->next) != NULL);
+ }
return;
+ case imemo_mask: break;
#if VM_CHECK_MODE > 0
default:
VM_UNREACHABLE(gc_mark_imemo);
@@ -9376,6 +9380,7 @@ rb_raw_obj_info(char *buff, const int buff_size, VALUE obj)
IMEMO_NAME(iseq);
IMEMO_NAME(alloc);
#undef IMEMO_NAME
+ case imemo_mask: break;
}
snprintf(buff, buff_size, "%s %s", buff, imemo_name);