Skip to content

Commit

Permalink
* gc.c (run_final): backout unnecessary modifies.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
matz committed Jul 24, 2003
1 parent edaf28a commit c08873b
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c08873b

Please sign in to comment.