summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--gc.c9
2 files changed, 11 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 7c57174a14..147a9aad0b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Fri Jun 21 08:08:11 2013 Masaya Tarui <tarui@ruby-lang.org>
+
+ * gc.c (lazy_sweep): Use is_lazy_sweeping()
+ * gc.c (rest_sweep): Ditto.
+ * gc.c (gc_prepare_free_objects): Ditto.
+
Fri Jun 21 07:34:47 2013 Koichi Sasada <ko1@atdot.net>
* gc.c (gc_profile_record::oldgen_objects): added.
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;