diff options
author | Aaron Patterson <[email protected]> | 2019-09-04 16:00:19 -0700 |
---|---|---|
committer | Aaron Patterson <[email protected]> | 2019-09-05 10:13:50 -0700 |
commit | f0fd1c0cd8d34b870a3011a36f5179d1b5f3547d (patch) | |
tree | 5965f256497951f0ca70fbf6e927880d915c0e8a /node.c | |
parent | 64817a7cfd4a258b45356e6da8fbdd0040b3231b (diff) |
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).
Diffstat (limited to 'node.c')
-rw-r--r-- | node.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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; |