summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authortarui <tarui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-20 23:08:30 +0000
committertarui <tarui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-20 23:08:30 +0000
commitfcd5cc93c92e37ecca2983d939782c4c1b1a121a (patch)
tree8a226373ecb1bd876bce2835e40ee445229f3ddb /gc.c
parent2c79a467640c5e0f422cc31a988d819564f01f07 (diff)
* gc.c (lazy_sweep): Use is_lazy_sweeping()
* gc.c (rest_sweep): Ditto. * gc.c (gc_prepare_free_objects): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/gc.c b/gc.c
index 2f564dbce9..c44b091d48 100644
--- a/gc.c
+++ b/gc.c
@@ -427,6 +427,7 @@ VALUE *ruby_initial_gc_stress_ptr = &rb_objspace.gc_stress;
#define initial_free_min initial_params.initial_free_min
#define initial_growth_factor initial_params.initial_growth_factor
+
#define is_lazy_sweeping(objspace) ((objspace)->heap.sweep_slots != 0)
#if SIZEOF_LONG == SIZEOF_VOIDP
@@ -2422,7 +2423,7 @@ lazy_sweep(rb_objspace_t *objspace)
gc_prof_sweep_timer_start(objspace);
heaps_increment(objspace);
- while (objspace->heap.sweep_slots) {
+ while (is_lazy_sweeping(objspace)) {
next = objspace->heap.sweep_slots->next;
slot_sweep(objspace, objspace->heap.sweep_slots);
objspace->heap.sweep_slots = next;
@@ -2443,9 +2444,9 @@ lazy_sweep(rb_objspace_t *objspace)
static void
rest_sweep(rb_objspace_t *objspace)
{
- if (objspace->heap.sweep_slots) {
+ if (is_lazy_sweeping(objspace)) {
during_gc++;
- while (objspace->heap.sweep_slots) {
+ while (is_lazy_sweeping(objspace)) {
lazy_sweep(objspace);
}
during_gc = 0;
@@ -2498,7 +2499,7 @@ gc_prepare_free_objects(rb_objspace_t *objspace)
during_gc++;
- if (objspace->heap.sweep_slots) {
+ if (is_lazy_sweeping(objspace)) {
if (lazy_sweep(objspace)) {
during_gc = 0;
return TRUE;