summaryrefslogtreecommitdiff
path: root/iseq.c
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@ruby-lang.org>2019-09-12 15:21:18 -0700
committerAaron Patterson <tenderlove@ruby-lang.org>2019-09-26 13:56:41 -0700
commit3cd8f76f7f1bc09f9dd6b65eaafe2fd3a990ac60 (patch)
tree4f2bd61e116bbdec7c3df14c2a406a5783d8c5cc /iseq.c
parentbd017c633da4fe27c85b5dfc059b85d44a3b7afe (diff)
downloadruby-3cd8f76f7f1bc09f9dd6b65eaafe2fd3a990ac60.tar.gz
Introduce a secondary arena
We'll scan the secondary arena during GC mark. So, we should only allocate "markable" instruction linked list nodes out of the secondary arena.
Diffstat (limited to 'iseq.c')
-rw-r--r--iseq.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/iseq.c b/iseq.c
index b9432538da..b5417cba19 100644
--- a/iseq.c
+++ b/iseq.c
@@ -75,7 +75,8 @@ static void
compile_data_free(struct iseq_compile_data *compile_data)
{
if (compile_data) {
- free_arena(compile_data->storage_head);
+ free_arena(compile_data->node.storage_head);
+ free_arena(compile_data->insn.storage_head);
if (compile_data->ivar_cache_table) {
rb_id_table_free(compile_data->ivar_cache_table);
}
@@ -420,7 +421,7 @@ rb_iseq_memsize(const rb_iseq_t *iseq)
size += sizeof(struct iseq_compile_data);
- cur = compile_data->storage_head;
+ cur = compile_data->node.storage_head;
while (cur) {
size += cur->size + offsetof(struct iseq_compile_data_storage, buff);
cur = cur->next;
@@ -558,7 +559,8 @@ prepare_iseq_build(rb_iseq_t *iseq,
RB_OBJ_WRITE(iseq, &ISEQ_COMPILE_DATA(iseq)->mark_ary, rb_ary_tmp_new(3));
RB_OBJ_WRITE(iseq, &ISEQ_COMPILE_DATA(iseq)->catch_table_ary, Qnil);
- ISEQ_COMPILE_DATA(iseq)->storage_head = ISEQ_COMPILE_DATA(iseq)->storage_current = new_arena();
+ ISEQ_COMPILE_DATA(iseq)->node.storage_head = ISEQ_COMPILE_DATA(iseq)->node.storage_current = new_arena();
+ ISEQ_COMPILE_DATA(iseq)->insn.storage_head = ISEQ_COMPILE_DATA(iseq)->insn.storage_current = new_arena();
ISEQ_COMPILE_DATA(iseq)->option = option;
ISEQ_COMPILE_DATA(iseq)->ivar_cache_table = NULL;