diff options
author | Peter Zhu <peter@peterzhu.ca> | 2024-02-20 15:58:10 -0500 |
---|---|---|
committer | Peter Zhu <peter@peterzhu.ca> | 2024-02-21 11:33:05 -0500 |
commit | 330830dd1a44b6e497250a14d93efae6fa363f82 (patch) | |
tree | 864fc9a6ba29c91fcbeb0c9c439e99b7d7fb0a04 /gc.c | |
parent | 2e6f8554f8c4ec12f620f31d4a110066ee76bfbe (diff) |
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.
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -3013,11 +3013,11 @@ rb_imemo_name(enum imemo_type type) #undef rb_imemo_new VALUE -rb_imemo_new(enum imemo_type type, VALUE v1, VALUE v2, VALUE v3, VALUE v0) +rb_imemo_new(enum imemo_type type, VALUE v0) { size_t size = RVALUE_SIZE; VALUE flags = T_IMEMO | (type << FL_USHIFT); - return newobj_of(GET_RACTOR(), v0, flags, v1, v2, v3, TRUE, size); + return newobj_of(GET_RACTOR(), v0, flags, 0, 0, 0, TRUE, size); } static VALUE @@ -3079,9 +3079,9 @@ imemo_memsize(VALUE obj) #if IMEMO_DEBUG VALUE -rb_imemo_new_debug(enum imemo_type type, VALUE v1, VALUE v2, VALUE v3, VALUE v0, const char *file, int line) +rb_imemo_new_debug(enum imemo_type type, VALUE v0, const char *file, int line) { - VALUE memo = rb_imemo_new(type, v1, v2, v3, v0); + VALUE memo = rb_imemo_new(type, v0); fprintf(stderr, "memo %p (type: %d) @ %s:%d\n", (void *)memo, imemo_type(memo), file, line); return memo; } |