[svn:parrot] r38109 - in branches/gc_options_remove: . config/auto lib/Parrot/Configure/Options lib/Parrot/Configure/Options/Conf t/steps
jkeenan at svn.parrot.org
jkeenan at svn.parrot.org
Wed Apr 15 02:16:47 UTC 2009
Author: jkeenan
Date: Wed Apr 15 02:16:47 2009
New Revision: 38109
URL: https://trac.parrot.org/parrot/changeset/38109
Log:
Remove command-line '--gc' option, associated tests and documentation.
Modified:
branches/gc_options_remove/Configure.pl
branches/gc_options_remove/config/auto/gc.pm
branches/gc_options_remove/lib/Parrot/Configure/Options/Conf.pm
branches/gc_options_remove/lib/Parrot/Configure/Options/Conf/Shared.pm
branches/gc_options_remove/t/steps/auto_gc-01.t
Modified: branches/gc_options_remove/Configure.pl
==============================================================================
--- branches/gc_options_remove/Configure.pl Wed Apr 15 01:58:17 2009 (r38108)
+++ branches/gc_options_remove/Configure.pl Wed Apr 15 02:16:47 2009 (r38109)
@@ -331,11 +331,6 @@
Use JIT to emit a native executable.
-=item C<--gc=(type)>
-
-Determine the type of garbage collection. The value for C<type> should be one
-of: C<gc>, C<libc>, C<malloc> or C<malloc-trace>. The default is C<gc>.
-
=back
=head2 International Components For Unicode (ICU) Options
Modified: branches/gc_options_remove/config/auto/gc.pm
==============================================================================
--- branches/gc_options_remove/config/auto/gc.pm Wed Apr 15 01:58:17 2009 (r38108)
+++ branches/gc_options_remove/config/auto/gc.pm Wed Apr 15 02:16:47 2009 (r38109)
@@ -7,16 +7,14 @@
=head1 DESCRIPTION
-Checks whether the C<--gc> command-line option was passed to F<Configure.pl>
-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<src/gc/resources.c>.
-=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<gc>
-
-The default. Use the memory allocator in F<src/resources.c>.
+=over4
=item C<libc>
@@ -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 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/resources\$(O): \$(GENERAL_H_FILES) \$(SRC_DIR)/gc/resources.c
EOF
- TEMP_gc_o => "\$(SRC_DIR)/gc/resources\$(O)",
- gc_flag => '',
- );
- }
+ TEMP_gc_o => "\$(SRC_DIR)/gc/resources\$(O)",
+ gc_flag => '',
+ );
print(" ($gc) ") if $conf->options->get('verbose');
return 1;
Modified: branches/gc_options_remove/lib/Parrot/Configure/Options/Conf.pm
==============================================================================
--- branches/gc_options_remove/lib/Parrot/Configure/Options/Conf.pm Wed Apr 15 01:58:17 2009 (r38108)
+++ branches/gc_options_remove/lib/Parrot/Configure/Options/Conf.pm Wed Apr 15 02:16:47 2009 (r38109)
@@ -92,8 +92,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
External Library Options:
Modified: branches/gc_options_remove/lib/Parrot/Configure/Options/Conf/Shared.pm
==============================================================================
--- branches/gc_options_remove/lib/Parrot/Configure/Options/Conf/Shared.pm Wed Apr 15 01:58:17 2009 (r38108)
+++ branches/gc_options_remove/lib/Parrot/Configure/Options/Conf/Shared.pm Wed Apr 15 02:16:47 2009 (r38109)
@@ -27,7 +27,6 @@
fatal
fatal-step
floatval
- gc
help
icu-config
icuheaders
Modified: branches/gc_options_remove/t/steps/auto_gc-01.t
==============================================================================
--- branches/gc_options_remove/t/steps/auto_gc-01.t Wed Apr 15 01:58:17 2009 (r38108)
+++ branches/gc_options_remove/t/steps/auto_gc-01.t Wed Apr 15 02:16:47 2009 (r38109)
@@ -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,87 +48,6 @@
"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 ###################
More information about the parrot-commits
mailing list