You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Stas Bekman <st...@stason.org> on 2004/12/06 17:44:41 UTC

Re: svn commit: r109987 - /perl/modperl/trunk/Changes /perl/modperl/trunk/lib/Apache/SizeLimit.pm

stas@apache.org wrote:

> Added: perl/modperl/trunk/lib/Apache/SizeLimit.pm

> +    # unpack ProcessMemoryCounters structure
> +    my ($cb,                         $PageFaultCount,
> +        $PeakWorkingSetSize,         $WorkingSetSize,
> +        $QuotaPeakPagedPoolUsage,    $QuotaPagedPoolUsage,
> +        $QuotaPeakNonPagedPoolUsage, $QuotaNonPagedPoolUsage,
> +        $PagefileUsage,              $PeakPagefileUsage)
> +        = unpack $pmem_struct, $pProcessMemoryCounters;
> +
> +    # only care about peak working set size
> +    my $size = int($PeakWorkingSetSize / 1024);

why creating 10 variables when only 1 is needed? won't this work just as well?

   my $PeakWorkingSetSize = (unpack $pmem_struct, $pProcessMemoryCounters)[2];

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org