perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <>
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 "$!";


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

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

Stas Bekman             JAm_pH      --   Just Another mod_perl Hacker      mod_perl Guide

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message