perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From do...@apache.org
Subject cvs commit: modperl-2.0/src/modules/perl mod_perl.c mod_perl.h modperl_perl.c
Date Sat, 06 Apr 2002 17:42:10 GMT
dougm       02/04/06 09:42:10

  Modified:    src/modules/perl mod_perl.c mod_perl.h modperl_perl.c
  Log:
  skip full teardown of PerlInterpreters in child_exit by default.
  we only need full teardown in the parent to avoid memory leaks.
  this will allow the server to stop much faster.
  
  Revision  Changes    Path
  1.112     +21 -1     modperl-2.0/src/modules/perl/mod_perl.c
  
  Index: mod_perl.c
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/mod_perl.c,v
  retrieving revision 1.111
  retrieving revision 1.112
  diff -u -r1.111 -r1.112
  --- mod_perl.c	6 Apr 2002 01:23:17 -0000	1.111
  +++ mod_perl.c	6 Apr 2002 17:42:10 -0000	1.112
  @@ -466,9 +466,29 @@
       return OK;
   }
   
  +static int modperl_destruct_level = 2; /* default is full tear down */
  +
  +int modperl_perl_destruct_level(void)
  +{
  +    return modperl_destruct_level;
  +}
  +
   static apr_status_t modperl_child_exit(void *data)
   {
  -    apr_pool_clear(server_pool);
  +    char *level = NULL;
  +
  +    if ((level = getenv("PERL_DESTRUCT_LEVEL"))) {
  +        modperl_destruct_level = atoi(level);
  +    }
  +    else {
  +        /* default to no teardown in the children */
  +        modperl_destruct_level = 0;
  +    }
  +
  +    if (modperl_destruct_level) {
  +        apr_pool_clear(server_pool);
  +    }
  +
       server_pool = NULL;
   
       return APR_SUCCESS;
  
  
  
  1.41      +1 -0      modperl-2.0/src/modules/perl/mod_perl.h
  
  Index: mod_perl.h
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/mod_perl.h,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- mod_perl.h	8 Jan 2002 01:13:28 -0000	1.40
  +++ mod_perl.h	6 Apr 2002 17:42:10 -0000	1.41
  @@ -47,6 +47,7 @@
   void modperl_register_hooks(apr_pool_t *p);
   apr_pool_t *modperl_server_pool(void);
   PerlInterpreter *modperl_startup(server_rec *s, apr_pool_t *p);
  +int modperl_perl_destruct_level(void);
   void xs_init(pTHXo);
   
   void modperl_response_init(request_rec *r);
  
  
  
  1.12      +1 -1      modperl-2.0/src/modules/perl/modperl_perl.c
  
  Index: modperl_perl.c
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_perl.c,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- modperl_perl.c	1 Mar 2002 03:30:03 -0000	1.11
  +++ modperl_perl.c	6 Apr 2002 17:42:10 -0000	1.12
  @@ -90,7 +90,7 @@
   
       PERL_SET_CONTEXT(perl);
   
  -    PL_perl_destruct_level = 2;
  +    PL_perl_destruct_level = modperl_perl_destruct_level();
   
   #ifdef USE_ENVIRON_ARRAY
       /* XXX: otherwise Perl may try to free() environ multiple times
  
  
  

Mime
View raw message