* 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
This commit is contained in:
tarui 2013-06-20 23:08:30 +00:00
parent 2c79a46764
commit fcd5cc93c9
2 changed files with 11 additions and 4 deletions

View File

@ -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> Fri Jun 21 07:34:47 2013 Koichi Sasada <ko1@atdot.net>
* gc.c (gc_profile_record::oldgen_objects): added. * gc.c (gc_profile_record::oldgen_objects): added.

9
gc.c
View File

@ -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_free_min initial_params.initial_free_min
#define initial_growth_factor initial_params.initial_growth_factor #define initial_growth_factor initial_params.initial_growth_factor
#define is_lazy_sweeping(objspace) ((objspace)->heap.sweep_slots != 0) #define is_lazy_sweeping(objspace) ((objspace)->heap.sweep_slots != 0)
#if SIZEOF_LONG == SIZEOF_VOIDP #if SIZEOF_LONG == SIZEOF_VOIDP
@ -2422,7 +2423,7 @@ lazy_sweep(rb_objspace_t *objspace)
gc_prof_sweep_timer_start(objspace); gc_prof_sweep_timer_start(objspace);
heaps_increment(objspace); heaps_increment(objspace);
while (objspace->heap.sweep_slots) { while (is_lazy_sweeping(objspace)) {
next = objspace->heap.sweep_slots->next; next = objspace->heap.sweep_slots->next;
slot_sweep(objspace, objspace->heap.sweep_slots); slot_sweep(objspace, objspace->heap.sweep_slots);
objspace->heap.sweep_slots = next; objspace->heap.sweep_slots = next;
@ -2443,9 +2444,9 @@ lazy_sweep(rb_objspace_t *objspace)
static void static void
rest_sweep(rb_objspace_t *objspace) rest_sweep(rb_objspace_t *objspace)
{ {
if (objspace->heap.sweep_slots) { if (is_lazy_sweeping(objspace)) {
during_gc++; during_gc++;
while (objspace->heap.sweep_slots) { while (is_lazy_sweeping(objspace)) {
lazy_sweep(objspace); lazy_sweep(objspace);
} }
during_gc = 0; during_gc = 0;
@ -2498,7 +2499,7 @@ gc_prepare_free_objects(rb_objspace_t *objspace)
during_gc++; during_gc++;
if (objspace->heap.sweep_slots) { if (is_lazy_sweeping(objspace)) {
if (lazy_sweep(objspace)) { if (lazy_sweep(objspace)) {
during_gc = 0; during_gc = 0;
return TRUE; return TRUE;