diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-10-16 20:41:49 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-10-16 20:41:49 +0000 |
commit | 82d06c5adeaa54e451e9f873d63b27e3e47f91db (patch) | |
tree | 9ab483c2ad8c186caa2b1ac35686788ef55fc4a5 /gc.c | |
parent | f9718bf703a9cffdc47b6fb69f77ffcb0a838655 (diff) | |
download | ruby-82d06c5adeaa54e451e9f873d63b27e3e47f91db.tar.gz |
* gc.c (objspace_each_objects): do not skip empty RVALUEs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43313 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 23 |
1 files changed, 5 insertions, 18 deletions
@@ -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; } |