perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <>
Subject Re: [mp2] pools that go out of scope aren't a problem anymore?
Date Thu, 02 Dec 2004 15:08:07 GMT
Philippe M. Chiasson wrote:
> For instance, for each request, we create a modperl_request_pool() and 
> $r->pool returns that,
> not the underlying $r->pool. We just register a cleanup handler with 
> $r->pool to destroy our
> request pool, but use a refcount technique to figure out if the pool can 
> be safely freed. If not,
> we either die verbosely, or just warn about it
>  "Warning: prolonging the lifetime of request pool at foo/ line 232"
> Certainly possible to implement, but I am just not sure we can justify 
> this added magic/complexity
> simply for the sake of catching improper uses of the API.

Too complicated. It's not worth the very small probability of people 
writing this kind of really bad code.

>> Unfortunately it doesn't seem like this dependency code can be easily 
>> integrated with the automatic type conversion, because the code 
>> accepts a single argument in xs/modperl_xs_sv_convert.h.
> I am not sure about this one, but couldn't we use our fancy XS 
> generation framerowk
> to magically detect methods with a pool argument and facilitate this 
> somewhat ?
>> At the moment we will need to rewrite all methods that accept the pool 
>> object, like I did for APR::Table::make above. for example inside 
>> APR::Table there are also copy() and overlay() that need the same 
>> solution.
> And that sounds like a terrible idea to me, unless we can make it really 
> tiny,
> like a single macro or sth. Still, I think it would be much more 
> error-prone than
> figuring this out somewhat automatically. If the typemap stuff isn't 
> sufficient,
> why can't we just implement our own sort of meta-typemap from all the 
> neat data
> we got in xs/tables ?

I'll give it a try.

Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker     mod_perl Guide --->

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

View raw message