summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-22 05:21:06 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-22 05:21:06 +0000
commit5aece50163fc3636ef06a78b055c2ccea3e0b353 (patch)
tree637f3fb6ad3db5659ff6d2aa58bff56dad68cbc6 /gc.c
parentdaf752b105fc0c60f1ca79fd199d2b2fc8e3c483 (diff)
* gc.c (gc_prepare_free_objects, rest_sweep, lazy_sweep): fix position
of `during_gc' setting. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40886 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gc.c b/gc.c
index 6e325cbe68..0a0238ec79 100644
--- a/gc.c
+++ b/gc.c
@@ -534,6 +534,7 @@ void
rb_objspace_free(rb_objspace_t *objspace)
{
rest_sweep(objspace);
+
if (objspace->profile.record) {
free(objspace->profile.record);
objspace->profile.record = 0;
@@ -2275,7 +2276,6 @@ lazy_sweep(rb_objspace_t *objspace)
if (!next) after_gc_sweep(objspace);
if (has_free_object) {
- during_gc = 0;
return TRUE;
}
}
@@ -2286,9 +2286,11 @@ static void
rest_sweep(rb_objspace_t *objspace)
{
if (objspace->heap.sweep_slots) {
+ during_gc++;
while (objspace->heap.sweep_slots) {
lazy_sweep(objspace);
}
+ during_gc = 0;
}
}
@@ -2341,6 +2343,7 @@ gc_prepare_free_objects(rb_objspace_t *objspace)
if (objspace->heap.sweep_slots) {
if (lazy_sweep(objspace)) {
+ during_gc = 0;
return TRUE;
}
}