Index: lib/Parrot/Configure/Options/Conf.pm =================================================================== --- lib/Parrot/Configure/Options/Conf.pm (revision 40201) +++ lib/Parrot/Configure/Options/Conf.pm (working copy) @@ -94,8 +94,6 @@ --cgoto=0 Don't build cgoto core - recommended when short of mem --jitcapable Use JIT --execcapable Use JIT to emit a native executable - --gc=(type) Determine the type of garbage collection - type=(gc|libc|malloc|malloc-trace) default is gc --without-threads Build parrot without thread support External Library Options: Index: lib/Parrot/Configure/Options/Conf/Shared.pm =================================================================== --- lib/Parrot/Configure/Options/Conf/Shared.pm (revision 40201) +++ lib/Parrot/Configure/Options/Conf/Shared.pm (working copy) @@ -29,7 +29,6 @@ fatal fatal-step floatval - gc help icu-config icuheaders Index: Configure.pl =================================================================== --- Configure.pl (revision 40201) +++ Configure.pl (working copy) @@ -355,11 +355,6 @@ Use JIT to emit a native executable. -=item C<--gc=(type)> - -Determine the type of garbage collection. The value for C should be one -of: C, C, C or C. The default is C. - =back =head2 International Components For Unicode (ICU) Options Index: t/steps/auto/gc-01.t =================================================================== --- t/steps/auto/gc-01.t (revision 40201) +++ t/steps/auto/gc-01.t (working copy) @@ -5,7 +5,7 @@ use strict; use warnings; -use Test::More tests => 35; +use Test::More tests => 8; use lib qw( lib t/configure/testlib ); use_ok('config::auto::gc'); use Parrot::Configure; @@ -48,94 +48,13 @@ "Got expected value for 'gc_flag'"); } -$conf->replenish($serialized); - -########### --gc=gc ########### - -($args, $step_list_ref) = process_options( { - argv => [ q{--gc=gc} ], - mode => q{configure}, -} ); -$conf->options->set( %{$args} ); -$step = test_step_constructor_and_description($conf); -my $ret = $step->runstep($conf); -ok( $ret, "runstep() returned true value" ); -is($conf->data->get('gc_flag'), q{}, - "Got expected value for 'gc_flag'"); - -$conf->replenish($serialized); - -########### --gc=libc ########### - -($args, $step_list_ref) = process_options( { - argv => [ q{--gc=libc} ], - mode => q{configure}, -} ); -$conf->options->set( %{$args} ); -$step = test_step_constructor_and_description($conf); -$conf->data->set('i_malloc' => 1); -$ret = $step->runstep($conf); -ok( $ret, "runstep() returned true value" ); -is($conf->data->get('gc_flag'), '-DGC_IS_MALLOC', - "Got expected value for 'gc_flag'"); -is($conf->data->get('malloc_header'), 'malloc.h', - "Got expected value for 'malloc_header'"); - -$conf->replenish($serialized); - -########### --gc=libc ########### - -($args, $step_list_ref) = process_options( { - argv => [ q{--gc=libc} ], - mode => q{configure}, -} ); -$conf->options->set( %{$args} ); -$step = test_step_constructor_and_description($conf); -$conf->data->set('i_malloc' => undef); -$ret = $step->runstep($conf); -ok( $ret, "runstep() returned true value" ); -is($conf->data->get('gc_flag'), '-DGC_IS_MALLOC', - "Got expected value for 'gc_flag'"); -is($conf->data->get('malloc_header'), 'stdlib.h', - "Got expected value for 'malloc_header'"); - -$conf->replenish($serialized); - -########### --gc=malloc ########### - -($args, $step_list_ref) = process_options( { - argv => [ q{--gc=malloc} ], - mode => q{configure}, -} ); -$conf->options->set( %{$args} ); -$step = test_step_constructor_and_description($conf); -$ret = $step->runstep($conf); -ok( $ret, "runstep() returned true value" ); -is($conf->data->get('gc_flag'), '-DGC_IS_MALLOC', - "Got expected value for 'gc_flag'"); - -$conf->replenish($serialized); - -########### --gc=malloc-trace ########### - -($args, $step_list_ref) = process_options( { - argv => [ q{--gc=malloc-trace} ], - mode => q{configure}, -} ); -$conf->options->set( %{$args} ); -$step = test_step_constructor_and_description($conf); -$ret = $step->runstep($conf); -ok( $ret, "runstep() returned true value" ); -is($conf->data->get('gc_flag'), '-DGC_IS_MALLOC', - "Got expected value for 'gc_flag'"); - pass("Completed all tests in $0"); ################### DOCUMENTATION ################### =head1 NAME -auto/gc-01.t - test auto::gc +auto_gc-01.t - test auto::gc =head1 SYNOPSIS Index: config/auto/gc.pm =================================================================== --- config/auto/gc.pm (revision 40201) +++ config/auto/gc.pm (working copy) @@ -7,17 +7,15 @@ =head1 DESCRIPTION -Checks whether the C<--gc> command-line option was passed to F -and sets the memory allocator accordingly. +Sets memory allocator. -Eventually, C<--gc> will be able to take any of the following values: +Currently, we have only one choice: the memory allocator in F. -=over +In the future, we will have a C<--gc> command-line option which will enable +the configurer to choose among the default and: -=item C +=over4 -The default. Use the memory allocator in F. - =item C Use the C library C along with F. @@ -36,8 +34,6 @@ =back -So, for the time being, only the default value works. - =cut package auto::gc; @@ -49,8 +45,6 @@ use Parrot::Configure::Utils ':auto'; - -# valid libc/malloc/malloc-trace/gc sub _init { my $self = shift; my %data; @@ -62,47 +56,15 @@ sub runstep { my ( $self, $conf ) = @_; - my $gc = $conf->options->get('gc'); + my $gc = 'gc'; - # default is GC in alloc_resources.c - $gc = 'gc' unless defined $gc; - - if ( $gc =~ /^malloc(?:-trace)?$/ ) { - $conf->data->set( - TEMP_gc_c => <<"EOF", -\$(SRC_DIR)/$gc\$(O): \$(GENERAL_H_FILES) \$(SRC_DIR)/$gc.c -\$(SRC_DIR)/gc/res_lea\$(O): \$(GENERAL_H_FILES) \$(SRC_DIR)/gc/res_lea.c -EOF - TEMP_gc_o => "\$(SRC_DIR)\/$gc\$(O) \$(SRC_DIR)/gc/res_lea\$(O)", - gc_flag => '-DGC_IS_MALLOC', - ); - } - elsif ( $gc eq 'libc' ) { - $conf->data->set( - TEMP_gc_c => <<"EOF", -\$(SRC_DIR)/gc/res_lea\$(O): \$(GENERAL_H_FILES) \$(SRC_DIR)/gc/res_lea.c -EOF - TEMP_gc_o => "\$(SRC_DIR)/gc/res_lea\$(O)", - gc_flag => '-DGC_IS_MALLOC', - ); - # tests mallinfo after allocation of 128 bytes - if ( $conf->data->get('i_malloc') ) { - $conf->data->set( malloc_header => 'malloc.h' ); - } - else { - $conf->data->set( malloc_header => 'stdlib.h' ); - } - } - else { - $gc = 'gc'; - $conf->data->set( - TEMP_gc_c => <<"EOF", + $conf->data->set( + TEMP_gc_c => <<"EOF", \$(SRC_DIR)/gc/alloc_resources\$(O): \$(GENERAL_H_FILES) \$(SRC_DIR)/gc/alloc_resources.c EOF - TEMP_gc_o => "\$(SRC_DIR)/gc/alloc_resources\$(O)", - gc_flag => '', - ); - } + TEMP_gc_o => "\$(SRC_DIR)/gc/resources\$(O)", + gc_flag => '', + ); print(" ($gc) ") if $conf->options->get('verbose'); return 1;