summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-22 08:57:21 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-22 08:57:21 +0000
commite322989bb3ebae6b85327963f91ff112fc37fada (patch)
tree4de1aac8df4352d74851e03e12cdc44b4bed2031
parent4103e718f8209dff7da1e8aa6c140820c18412ef (diff)
merge revision(s) 34719,34720: [Backport #6059]
* 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] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34737 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog7
-rw-r--r--gc.c33
-rw-r--r--version.h6
3 files changed, 15 insertions, 31 deletions
diff --git a/ChangeLog b/ChangeLog
index 5393d673d6..1671741a5c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/gc.c b/gc.c
index c53bfd9842..e65d0ec6e6 100644
--- a/gc.c
+++ b/gc.c
@@ -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 */
diff --git a/version.h b/version.h
index b8a4f8c820..3b2e1fabfc 100644
--- a/version.h
+++ b/version.h
@@ -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"