From 08f3cfb5859332c0f7a9a574dc64a2a002c50354 Mon Sep 17 00:00:00 2001 From: ko1 Date: Wed, 11 Mar 2015 23:13:01 +0000 Subject: * internal.h: use T_IMEMO to represent `struct MEMO' value. memo->v1 and memo->v2 is WB protected values. So use MEMO_V1/V2_SET() macros to set these values. memo->u3 is ambiguous (sometimes a VALUE, sometimes an integer value), so use gc_mark_maybe() in gc.c to mark it. Rename NEW_MEMO() to MEMO_NEW(). Move MEMO_FOR and NEW_MEMO_FOF macros from node.h. Export a rb_imemo_new() function for ext/ripper. * node.h: remove NODE_MEMO. * enum.c: catch up these change. * enumerator.c: ditto. * load.c: ditto. * ext/objspace/objspace.c (count_nodes): ditto. * gc.c (gc_mark_children): mark imemo_memo type. * parse.y (new_args_gen): use T_IMEMO. (I'm not sure it is working correctly...) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49942 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- load.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'load.c') diff --git a/load.c b/load.c index 5c3a78389f..2e6e9cce89 100644 --- a/load.c +++ b/load.c @@ -728,7 +728,7 @@ load_lock(const char *ftptr) st_insert(loading_tbl, (st_data_t)ftptr, data); return (char *)ftptr; } - else if (RB_TYPE_P((VALUE)data, T_NODE) && nd_type((VALUE)data) == NODE_MEMO) { + else if (RB_TYPE_P((VALUE)data, T_IMEMO) && imemo_type((VALUE)data) == imemo_memo) { struct MEMO *memo = MEMO_CAST(data); void (*init)(void) = (void (*)(void))memo->u3.func; data = (st_data_t)rb_thread_shield_new(); @@ -1078,7 +1078,7 @@ register_init_ext(st_data_t *key, st_data_t *value, st_data_t init, int existing rb_warn("%s is already registered", name); } else { - *value = (st_data_t)NEW_MEMO(0, 0, init); + *value = (st_data_t)MEMO_NEW(0, 0, init); *key = (st_data_t)ruby_strdup(name); } return ST_CONTINUE; -- cgit v1.2.3