path: root/node.h
diff options
authorAaron Patterson <>2019-09-04 09:38:17 -0700
committerAaron Patterson <>2019-09-05 10:13:50 -0700
commit545b6db3fb367944f72cee5d41892eed63574634 (patch)
treec4fa68600e1d00cfdc23b082a8435b78e1c493f0 /node.h
parentf0fd1c0cd8d34b870a3011a36f5179d1b5f3547d (diff)
Create two buckets for allocating NODE structs
This commit adds two buckets for allocating NODE structs, then allocates "markable" NODE objects from one bucket. The reason to do this is so when the AST mark function scans nodes for VALUE objects to mark, we only scan NODE objects that we know to reference VALUE objects. If we *did not* divide the objects, then the mark function spends too much time scanning objects that don't contain any references.
Diffstat (limited to 'node.h')
1 files changed, 1 insertions, 1 deletions
diff --git a/node.h b/node.h
index dbc3162512..4e78b0fff3 100644
--- a/node.h
+++ b/node.h
@@ -409,7 +409,7 @@ void rb_ast_dispose(rb_ast_t*);
void rb_ast_free(rb_ast_t*);
size_t rb_ast_memsize(const rb_ast_t*);
void rb_ast_add_mark_object(rb_ast_t*, VALUE);
-NODE *rb_ast_newnode(rb_ast_t*);
+NODE *rb_ast_newnode(rb_ast_t*, enum node_type type);
void rb_ast_delete_node(rb_ast_t*, NODE *n);
VALUE rb_parser_new(void);