diff options
| -rw-r--r-- | ChangeLog | 7 | ||||
| -rw-r--r-- | gc.c | 33 | ||||
| -rw-r--r-- | version.h | 6 |
3 files changed, 15 insertions, 31 deletions
@@ -1,3 +1,10 @@ +Wed Feb 22 08:11:06 2012 Narihiro Nakamura <authornari@gmail.com> + + * gc.c : remove gc_clear_mark_on_sweep_slots() and use + rest_sweep() instead of it, because some dead objects might be + marked in next the mark phase by false pointers. + [ruby-core:42672] + Sun Feb 19 12:27:24 2012 Nobuyoshi Nakada <nobu@ruby-lang.org> * configure.in: ignore all warnings from an arbitrary @@ -464,13 +464,12 @@ rb_gc_set_params(void) #if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE static void gc_sweep(rb_objspace_t *); static void slot_sweep(rb_objspace_t *, struct heaps_slot *); -static void gc_clear_mark_on_sweep_slots(rb_objspace_t *); +static void rest_sweep(rb_objspace_t *); void rb_objspace_free(rb_objspace_t *objspace) { - gc_clear_mark_on_sweep_slots(objspace); - gc_sweep(objspace); + rest_sweep(objspace); if (objspace->profile.record) { free(objspace->profile.record); objspace->profile.record = 0; @@ -2430,28 +2429,6 @@ mark_current_machine_context(rb_objspace_t *objspace, rb_thread_t *th) } static void -gc_clear_mark_on_sweep_slots(rb_objspace_t *objspace) -{ - struct heaps_slot *scan; - RVALUE *p, *pend; - - if (objspace->heap.sweep_slots) { - while (heaps_increment(objspace)); - while (objspace->heap.sweep_slots) { - scan = objspace->heap.sweep_slots; - p = scan->slot; pend = p + scan->limit; - while (p < pend) { - if (p->as.free.flags & FL_MARK && BUILTIN_TYPE(p) != T_ZOMBIE) { - p->as.basic.flags &= ~FL_MARK; - } - p++; - } - objspace->heap.sweep_slots = objspace->heap.sweep_slots->next; - } - } -} - -static void gc_marks(rb_objspace_t *objspace) { struct gc_list *list; @@ -2462,8 +2439,6 @@ gc_marks(rb_objspace_t *objspace) objspace->count++; - gc_clear_mark_on_sweep_slots(objspace); - SET_STACK_END; init_mark_stack(objspace); @@ -2520,6 +2495,8 @@ garbage_collect(rb_objspace_t *objspace) GC_PROF_TIMER_START; + rest_sweep(objspace); + during_gc++; gc_marks(objspace); @@ -3025,7 +3002,7 @@ rb_objspace_call_finalizer(rb_objspace_t *objspace) size_t i; /* run finalizers */ - gc_clear_mark_on_sweep_slots(objspace); + rest_sweep(objspace); do { /* XXX: this loop will make no sense */ @@ -1,10 +1,10 @@ #define RUBY_VERSION "1.9.3" -#define RUBY_PATCHLEVEL 135 +#define RUBY_PATCHLEVEL 136 -#define RUBY_RELEASE_DATE "2012-02-21" +#define RUBY_RELEASE_DATE "2012-02-22" #define RUBY_RELEASE_YEAR 2012 #define RUBY_RELEASE_MONTH 2 -#define RUBY_RELEASE_DAY 21 +#define RUBY_RELEASE_DAY 22 #include "ruby/version.h" |
