From f0fd1c0cd8d34b870a3011a36f5179d1b5f3547d Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 4 Sep 2019 16:00:19 -0700 Subject: Stash the imemo buf at the end of the ID list Now we can reach the ID table buffer from the id table itself, so when SCOPE nodes are marked we can keep the buffers alive. This eliminates the need for the "mark array" during normal parse / compile (IOW *not* Ripper). --- node.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'node.c') diff --git a/node.c b/node.c index 8a519f2947..064ce006ad 100644 --- a/node.c +++ b/node.c @@ -1218,6 +1218,15 @@ static void mark_ast_value(void *ctx, NODE * node) { switch (nd_type(node)) { + case NODE_SCOPE: + { + ID *buf = node->nd_tbl; + if (buf) { + unsigned int size = (unsigned int)*buf; + rb_gc_mark((VALUE)buf[size + 1]); + } + break; + } case NODE_LIT: case NODE_STR: case NODE_XSTR: @@ -1226,7 +1235,6 @@ mark_ast_value(void *ctx, NODE * node) case NODE_DREGX: case NODE_DSYM: case NODE_ARGS: - case NODE_FOR: case NODE_ARYPTN: rb_gc_mark(node->nd_lit); break; -- cgit v1.2.3