ruby-changes:6716
From: ko1 <ko1@a...>
Date: Sun, 27 Jul 2008 22:08:15 +0900 (JST)
Subject: [ruby-changes:6716] Ruby:r18232 (trunk): * gc.c (gc_mark_children, obj_free): T_DEFERRED should not be appear.
ko1 2008-07-27 22:08:02 +0900 (Sun, 27 Jul 2008) New Revision: 18232 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=18232 Log: * gc.c (gc_mark_children, obj_free): T_DEFERRED should not be appear. * gc.c (gc_sweep, finalize_list): fix to decrement heap_slot#limit after executing finalizer. Modified files: trunk/ChangeLog trunk/gc.c Index: ChangeLog =================================================================== --- ChangeLog (revision 18231) +++ ChangeLog (revision 18232) @@ -1,3 +1,10 @@ +Sun Jul 27 21:45:59 2008 Koichi Sasada <ko1@a...> + + * gc.c (gc_mark_children, obj_free): T_DEFERRED should not be appear. + + * gc.c (gc_sweep, finalize_list): fix to decrement heap_slot#limit + after executing finalizer. + Sun Jul 27 14:48:37 2008 Koichi Sasada <ko1@a...> * include/ruby/ruby.h: add a type T_DEFERRED. Index: gc.c =================================================================== --- gc.c (revision 18231) +++ gc.c (revision 18232) @@ -1315,9 +1315,6 @@ } break; - case T_DEFERRED: - break; - default: rb_bug("rb_gc_mark(): unknown data type 0x%lx(%p) %s", BUILTIN_TYPE(obj), obj, @@ -1345,6 +1342,10 @@ if (!FL_TEST(p, FL_SINGLETON)) { /* not freeing page */ add_freelist(objspace, p); } + else { + struct heaps_slot *slot = (struct heaps_slot *)RDATA(p)->dmark; + slot->limit--; + } p = tmp; } } @@ -1439,11 +1440,15 @@ } if (n == heaps[i].limit && freed > do_heap_free) { RVALUE *pp; + int f_count = 0; - heaps[i].limit = 0; for (pp = final_list; pp != final; pp = pp->as.free.next) { - p->as.free.flags |= FL_SINGLETON; /* freeing page mark */ + f_count++; + RDATA(pp)->dmark = (void *)&heaps[i]; + pp->as.free.flags |= FL_SINGLETON; /* freeing page mark */ } + heaps[i].limit = f_count; + freelist = free; /* cancel this page from freelist */ } else { @@ -1605,9 +1610,6 @@ } break; - case T_DEFERRED: - break; - default: rb_bug("gc_sweep(): unknown data type 0x%lx(%p)", BUILTIN_TYPE(obj), (void*)obj); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/