summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-07-23 07:52:38 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-07-23 07:52:38 +0000
commitadac65af9391f56e964066310ff1d61f65dccc8e (patch)
tree911d5dd077da2c517f4ce45addfedb9731807ffe /gc.c
parentf30049f4ab8748e0d2f31b93f35110ceb6613dc1 (diff)
* gc.c (define_final): should not disclose NODE* to Ruby world.
[ruby-dev:23957] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/gc.c b/gc.c
index 7129a4c..6361ef2 100644
--- a/gc.c
+++ b/gc.c
@@ -1674,8 +1674,6 @@ undefine_final(os, obj)
return obj;
}
-#define NODE_FINAL NODE_LIT
-
/*
* call-seq:
* ObjectSpace.define_finalizer(obj, aProc=proc())
@@ -1704,7 +1702,7 @@ define_final(argc, argv, os)
need_call_final = 1;
FL_SET(obj, FL_FINALIZE);
- block = (VALUE)rb_node_newnode(NODE_FINAL, block, ruby_safe_level, 0);
+ block = rb_ary_new3(2, INT2FIX(ruby_safe_level), block);
if (!finalizer_table) {
finalizer_table = st_init_numtable();
@@ -1757,9 +1755,9 @@ run_final(obj)
}
if (finalizer_table && st_delete(finalizer_table, (st_data_t*)&obj, &table)) {
for (i=0; i<RARRAY(table)->len; i++) {
- NODE *final = (NODE *)RARRAY(table)->ptr[i];
- args[0] = final->nd_lit;
- args[2] = final->nd_nth;
+ VALUE final = RARRAY(table)->ptr[i];
+ args[0] = FIX2INT(RARRAY(final)->ptr[0]);
+ args[2] = RARRAY(final)->ptr[1];
rb_protect((VALUE(*)_((VALUE)))run_single_final, (VALUE)args, &status);
}
}