Add IMEMO_NEW

Rather than exposing that an imemo has a flag and four fields, this
changes the implementation to only expose one field (the klass) and
fills the rest with 0. The type will have to fill in the values themselves.
This commit is contained in:
Peter Zhu 2024-02-20 15:58:10 -05:00
parent 2e6f8554f8
commit 330830dd1a
12 changed files with 69 additions and 33 deletions

3
node.c
View file

@ -344,8 +344,7 @@ rb_ast_t *
rb_ast_new(void)
{
node_buffer_t *nb = rb_node_buffer_new();
rb_ast_t *ast = (rb_ast_t *)rb_imemo_new(imemo_ast, 0, 0, 0, (VALUE)nb);
return ast;
return IMEMO_NEW(rb_ast_t, imemo_ast, (VALUE)nb);
}
#endif