summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-11 23:13:01 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-11 23:13:01 +0000
commit08f3cfb5859332c0f7a9a574dc64a2a002c50354 (patch)
tree9b88e32745288764702ef3685d3b10b5b1d175a8 /gc.c
parent287b046fab9fc07f228977de7e0dc087f29d2516 (diff)
* 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
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gc.c b/gc.c
index 5df5eb5384..ae9ed86023 100644
--- a/gc.c
+++ b/gc.c
@@ -217,7 +217,7 @@ static ruby_gc_params_t gc_params = {
* 5: show all references
*/
#ifndef RGENGC_CHECK_MODE
-#define RGENGC_CHECK_MODE 0
+#define RGENGC_CHECK_MODE 2
#endif
/* RGENGC_PROFILE
@@ -385,6 +385,7 @@ typedef struct RVALUE {
struct vm_svar svar;
struct vm_throw_data throw_data;
struct vm_ifunc ifunc;
+ struct MEMO memo;
} imemo;
struct {
struct RBasic basic;
@@ -4171,6 +4172,11 @@ gc_mark_children(rb_objspace_t *objspace, VALUE obj)
case imemo_ifunc:
gc_mark_maybe(objspace, (VALUE)RANY(obj)->as.imemo.ifunc.data);
return;
+ case imemo_memo:
+ gc_mark(objspace, RANY(obj)->as.imemo.memo.v1);
+ gc_mark(objspace, RANY(obj)->as.imemo.memo.v2);
+ gc_mark_maybe(objspace, RANY(obj)->as.imemo.memo.u3.value);
+ return;
default:
rb_bug("T_IMEMO: unreachable");
}