We were seeing some servers spin out of control (allocating memory slowly) in Apace::Constants::AUTOLOAD (which apparently has been reported in the mailing list before). The attached patch fixes the problems for us. Could someone who understands what is going on here shed some light? Jim
diff -ruN mod_perl-1.24/Constants/Constants.pm mod_perl-1.24-new/Constants/Constants.pm --- mod_perl-1.24/Constants/Constants.pm Fri Mar 3 12:20:30 2000 +++ mod_perl-1.24-new/Constants/Constants.pm Sun Jun 25 15:40:41 2000 @@ -14,13 +14,9 @@ *import = \&Exporter::import; } -if ($ENV{MOD_PERL}) { - #outside of mod_perl this will recurse looking for __AUTOLOAD, grr - *AUTOLOAD = sub { - #why must we stringify first??? - __AUTOLOAD() if "$Apache::Constants::AUTOLOAD"; - goto &$Apache::Constants::AUTOLOAD; - }; +sub AUTOLOAD +{ + return __AUTOLOAD() unless $AUTOLOAD =~ /__AUTOLOAD$/; } my %ConstNameCache = (); diff -ruN mod_perl-1.24/src/modules/perl/Constants.xs mod_perl-1.24-new/src/modules/perl/Constants.xs --- mod_perl-1.24/src/modules/perl/Constants.xs Wed Mar 29 16:05:32 2000 +++ mod_perl-1.24-new/src/modules/perl/Constants.xs Sun Jun 25 17:09:42 2000 @@ -938,7 +938,7 @@ #endif -void +double __AUTOLOAD() PREINIT: @@ -956,6 +956,9 @@ croak("Your vendor has not defined Apache::Constants macro `%s'", name); else my_newCONSTSUB(stash, name, newSViv(val)); + RETVAL = val; + OUTPUT: + RETVAL const char * SERVER_VERSION()