aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--gc.c23
2 files changed, 9 insertions, 18 deletions
diff --git a/ChangeLog b/ChangeLog
index 006aeaddb3..34fd881486 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Thu Oct 17 05:40:33 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (objspace_each_objects): do not skip empty RVALUEs.
+
Thu Oct 17 05:31:31 2013 Koichi Sasada <ko1@atdot.net>
* error.c (rb_bug_reporter_add): return simply 0 if failed.
diff --git a/gc.c b/gc.c
index 6830e78ab6..4289b8af6e 100644
--- a/gc.c
+++ b/gc.c
@@ -1411,16 +1411,12 @@ objspace_each_objects(VALUE arg)
RVALUE *pstart, *pend;
rb_objspace_t *objspace = &rb_objspace;
struct each_obj_args *args = (struct each_obj_args *)arg;
- volatile VALUE v;
i = 0;
while (i < heap_used) {
- while (0 < i && last_body < objspace->heap.sorted[i-1]->body)
- i--;
- while (i < heap_used && objspace->heap.sorted[i]->body <= last_body)
- i++;
- if (heap_used <= i)
- break;
+ while (0 < i && last_body < objspace->heap.sorted[i-1]->body) i--;
+ while (i < heap_used && objspace->heap.sorted[i]->body <= last_body) i++;
+ if (heap_used <= i) break;
slot = objspace->heap.sorted[i];
last_body = slot->body;
@@ -1428,19 +1424,10 @@ objspace_each_objects(VALUE arg)
pstart = slot->start;
pend = pstart + slot->limit;
- for (; pstart != pend; pstart++) {
- if (pstart->as.basic.flags) {
- v = (VALUE)pstart; /* acquire to save this object */
- break;
- }
- }
- if (pstart != pend) {
- if ((*args->callback)(pstart, pend, sizeof(RVALUE), args->data)) {
- break;
- }
+ if ((*args->callback)(pstart, pend, sizeof(RVALUE), args->data)) {
+ break;
}
}
- RB_GC_GUARD(v);
return Qnil;
}