1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* gc.c (run_final): backout unnecessary modifies.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2003-07-24 07:50:36 +00:00
parent 1a890d82c3
commit c37d8b287e

13
gc.c
View file

@ -1533,29 +1533,22 @@ run_final(obj)
VALUE obj;
{
long i;
int status, critical_save;
int status, critical_save = rb_thread_critical;
VALUE args[2], table;
rb_thread_critical = Qtrue;
args[1] = rb_ary_new3(1, rb_obj_id(obj)); /* make obj into id */
for (i=0; i<RARRAY(finalizers)->len; i++) {
args[0] = RARRAY(finalizers)->ptr[i];
critical_save = rb_thread_critical;
rb_thread_critical = Qtrue;
rb_protect((VALUE(*)_((VALUE)))run_single_final, (VALUE)args, &status);
rb_thread_critical = critical_save;
CHECK_INTS;
}
CHECK_INTS;
if (finalizer_table && st_delete(finalizer_table, &obj, &table)) {
for (i=0; i<RARRAY(table)->len; i++) {
args[0] = RARRAY(table)->ptr[i];
critical_save = rb_thread_critical;
rb_thread_critical = Qtrue;
rb_protect((VALUE(*)_((VALUE)))run_single_final, (VALUE)args, &status);
rb_thread_critical = critical_save;
CHECK_INTS;
}
}
rb_thread_critical = critical_save;
}
void