perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject PerlIO::APR: getting the memory pool
Date Tue, 04 Dec 2001 06:33:42 GMT
I'm implementing PerlIO::APR (will be APR::IO in mod_perl)

I need to get my hands on the memory pool. Currently I use the global 
pool via modperl_global_get_pconf(). which allows you to keep your code 
as a pure perl:

open my $fh, ">:APR", $path or die "$!";

Does calling modperl_global_get_pconf() make things slower? If it does, 
where do we stick $r/$s? something like this?

($r||$s)->file_open(my $fh, ">", $path) or die $!;?

or may be we can keep the perl syntax and use the server pool? which can 
be fetched only once and stored in a static variable? In fact we can do 
the same with modperl_global_get_pconf(),

but I think there is a problem if we don't use $r's pool -- the memory 
allocated during file ops won't be cleaned at the end of request :( but 
I really want to keep the perl syntax, so how about this:

open my $fh, ">:APR", $r, $path or die "$!";

or:

open my $fh, ">:APR", $path, $r or die "$!";

s/$r/$s/ will work too.

_____________________________________________________________________
Stas Bekman             JAm_pH      --   Just Another mod_perl Hacker
http://stason.org/      mod_perl Guide   http://perl.apache.org/guide
mailto:stas@stason.org  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/


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


Mime
View raw message