perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject [patch] default request pool sub
Date Tue, 29 Jan 2002 09:54:57 GMT
I'm not sure if I've picked the best name, but I need this wrapper for 
compat. If I have it I don't need to prototype functions required to 
provide the pool argument as p=SOME_DEFAULT, but just p,

So now in compat.pm we can write wrappers:

my $req_pool = APR::Pool::from_current_request();
APR::Foo::bar($req_pool, ...)

Index: xs/APR/Pool/APR__Pool.h
===================================================================
RCS file: /home/cvs/modperl-2.0/xs/APR/Pool/APR__Pool.h,v
retrieving revision 1.4
diff -u -r1.4 APR__Pool.h
--- xs/APR/Pool/APR__Pool.h	8 May 2001 04:20:17 -0000	1.4
+++ xs/APR/Pool/APR__Pool.h	29 Jan 2002 09:30:28 -0000
@@ -72,3 +72,7 @@
                                mpxs_cleanup_run,
                                apr_pool_cleanup_null);
  }
+
+/* if inside request, this returns current r->pool */
+#define mpxs_APR__Pool_from_current_request() modperl_sv2pool(aTHX_ 
&PL_sv_undef)
+
Index: xs/maps/modperl_functions.map
===================================================================
RCS file: /home/cvs/modperl-2.0/xs/maps/modperl_functions.map,v
retrieving revision 1.34
diff -u -r1.34 modperl_functions.map
--- xs/maps/modperl_functions.map	29 Jan 2002 07:47:25 -0000	1.34
+++ xs/maps/modperl_functions.map	29 Jan 2002 09:30:28 -0000
@@ -102,3 +102,5 @@
  MODULE=APR::String
   mpxs_APR__String_format_size

+MODULE=APR::Pool
+apr_pool_t *:DEFINE_from_current_request

_____________________________________________________________________
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