Skip to content

Commit

Permalink
revert r37091
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37096 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
authorNari committed Oct 5, 2012
1 parent ae114a8 commit 4c0f022
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
9 changes: 0 additions & 9 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,6 @@ Fri Oct 05 15:26:18 2012 Koichi Sasada <[email protected]>

* gc.h: export rb_objspace_reachable_objects_from().

Fri Oct 5 16:04:33 2012 Narihiro Nakamura <[email protected]>

* gc.c (chain_finalized_object): remove to check a mark flag since
all objects are certainly unmarked with rest_sweep.

* gc.c (rb_objspace_call_finalizer): remove to mark finalizable
objects. The sweeping doesn't push T_ZOMBIE objects to the
freelist.

Thu Oct 4 23:40:04 2012 Narihiro Nakamura <[email protected]>

* gc.c (init_heap): call init_mark_stack before to allocate
Expand Down
10 changes: 7 additions & 3 deletions gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1457,7 +1457,8 @@ static int
chain_finalized_object(st_data_t key, st_data_t val, st_data_t arg)
{
RVALUE *p = (RVALUE *)key, **final_list = (RVALUE **)arg;
if ((p->as.basic.flags & FL_FINALIZE) == FL_FINALIZE) {
if ((p->as.basic.flags & FL_FINALIZE) == FL_FINALIZE &&
!MARKED_IN_BITMAP(GET_HEAP_BITMAP(p), p)) {
if (BUILTIN_TYPE(p) != T_ZOMBIE) {
p->as.free.flags = T_ZOMBIE;
RDATA(p)->dfree = 0;
Expand Down Expand Up @@ -1499,17 +1500,20 @@ rb_objspace_call_finalizer(rb_objspace_t *objspace)
RVALUE *final_list = 0;
size_t i;

/* run finalizers */
rest_sweep(objspace);

if (ATOMIC_EXCHANGE(finalizing, 1)) return;

/* run finalizers */
do {
/* XXX: this loop will make no sense */
/* because mark will not be removed */
finalize_deferred(objspace);
mark_tbl(objspace, finalizer_table);
gc_mark_stacked_objects(objspace);
st_foreach(finalizer_table, chain_finalized_object,
(st_data_t)&deferred_final_list);
} while (deferred_final_list);

/* force to run finalizer */
while (finalizer_table->num_entries) {
struct force_finalize_list *list = 0;
Expand Down

0 comments on commit 4c0f022

Please sign in to comment.