diff --git a/ChangeLog b/ChangeLog index 398e344d33..2e2d2bcfca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Oct 31 18:17:38 2012 Narihiro Nakamura + + * gc.c (gc_profile_record): don't define unused variables when + GC_PROFILE_MORE_DETAIL is 0. + Wed Oct 31 18:10:53 2012 Narihiro Nakamura * gc.c (gc_prof_mark_timer_stop): count is not initialized. diff --git a/gc.c b/gc.c index f19a7325ff..f5411282c8 100644 --- a/gc.c +++ b/gc.c @@ -118,22 +118,27 @@ static ruby_gc_params_t initial_params = { typedef struct gc_profile_record { double gc_time; - double gc_mark_time; - double gc_sweep_time; double gc_invoke_time; - size_t heap_use_slots; - size_t heap_live_objects; - size_t heap_free_objects; size_t heap_total_objects; size_t heap_use_size; size_t heap_total_size; - int have_finalize; int is_marked; +#if GC_PROFILE_MORE_DETAIL + double gc_mark_time; + double gc_sweep_time; + + size_t heap_use_slots; + size_t heap_live_objects; + size_t heap_free_objects; + + int have_finalize; + size_t allocate_increase; size_t allocate_limit; +#endif } gc_profile_record;