You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl-cvs@perl.apache.org by ri...@apache.org on 2001/11/11 20:19:51 UTC

cvs commit: embperl Makefile.PL ep.h epdat.h epdom.c epmain.c

richter     01/11/11 11:19:51

  Modified:    .        Tag: Embperl2c Makefile.PL ep.h epdat.h epdom.c
                        epmain.c
  Log:
  Embperl 2 - memory leak tracking code
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.31.4.34 +4 -3      embperl/Makefile.PL
  
  Index: Makefile.PL
  ===================================================================
  RCS file: /home/cvs/embperl/Makefile.PL,v
  retrieving revision 1.31.4.33
  retrieving revision 1.31.4.34
  diff -u -r1.31.4.33 -r1.31.4.34
  --- Makefile.PL	2001/11/07 15:21:59	1.31.4.33
  +++ Makefile.PL	2001/11/11 19:19:50	1.31.4.34
  @@ -3,7 +3,7 @@
   #
   # (C) 1997-2001 G.Richter (richter@dev.ecos.de) / ECOS
   #
  -# $Id: Makefile.PL,v 1.31.4.33 2001/11/07 15:21:59 richter Exp $
  +# $Id: Makefile.PL,v 1.31.4.34 2001/11/11 19:19:50 richter Exp $
   #
   
   
  @@ -217,9 +217,10 @@
           my $txt2 = $txt ;
           $txt2 =~ s/\$\(CC\)/\$(CPP)/ ;
           $txt2 =~ s/CCCMD/CPPCMD/ ;
  -        
  -        return "$txt\n\n$txt2" ;
  +
  +        return "$txt\n\n$txt2"  ;
   	}
  +
   
   	
    sub MY::post_initialize
  
  
  
  1.27.4.26 +10 -1     embperl/ep.h
  
  Index: ep.h
  ===================================================================
  RCS file: /home/cvs/embperl/ep.h,v
  retrieving revision 1.27.4.25
  retrieving revision 1.27.4.26
  diff -u -r1.27.4.25 -r1.27.4.26
  --- ep.h	2001/11/08 05:57:37	1.27.4.25
  +++ ep.h	2001/11/11 19:19:50	1.27.4.26
  @@ -165,12 +165,21 @@
   
   #include "epnames.h"
   
  +
  +#if defined (_DEBUG) && defined (WIN32)
  +#define _CRTDBG_MAP_ALLOC
  +#undef malloc
  +#undef calloc
  +#undef realloc
  +#undef free
  +#include <crtdbg.h>
  +#endif
  +
   #ifdef EP2
   #include "epdom.h"
   #endif
   #include "epdat.h"
   #include "embperl.h"
  -
   
   
   /* ---- global variables ---- */
  
  
  
  1.20.4.31 +6 -1      embperl/epdat.h
  
  Index: epdat.h
  ===================================================================
  RCS file: /home/cvs/embperl/epdat.h,v
  retrieving revision 1.20.4.30
  retrieving revision 1.20.4.31
  diff -u -r1.20.4.30 -r1.20.4.31
  --- epdat.h	2001/11/07 21:33:49	1.20.4.30
  +++ epdat.h	2001/11/11 19:19:50	1.20.4.31
  @@ -10,7 +10,7 @@
   #   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
   #   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   #
  -#   $Id: epdat.h,v 1.20.4.30 2001/11/07 21:33:49 richter Exp $
  +#   $Id: epdat.h,v 1.20.4.31 2001/11/11 19:19:50 richter Exp $
   #
   ###################################################################################*/
   
  @@ -572,6 +572,11 @@
   
       SV *   pCodeSV ;		/* contains currently compiled line */
   #endif
  +
  +#if defined (_DEBUG) && defined (WIN32)
  +    _CrtMemState MemCheckpoint ;             /* memory leak debugging */    
  +#endif    
  +
   
       } ;
   
  
  
  
  1.4.2.68  +5 -1      embperl/Attic/epdom.c
  
  Index: epdom.c
  ===================================================================
  RCS file: /home/cvs/embperl/Attic/epdom.c,v
  retrieving revision 1.4.2.67
  retrieving revision 1.4.2.68
  diff -u -r1.4.2.67 -r1.4.2.68
  --- epdom.c	2001/11/11 18:14:42	1.4.2.67
  +++ epdom.c	2001/11/11 19:19:50	1.4.2.68
  @@ -9,7 +9,7 @@
   #   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
   #   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   #
  -#   $Id: epdom.c,v 1.4.2.67 2001/11/11 18:14:42 richter Exp $
  +#   $Id: epdom.c,v 1.4.2.68 2001/11/11 19:19:50 richter Exp $
   #
   ###################################################################################*/
   
  @@ -1014,6 +1014,10 @@
       xNdx = ArrayAdd (&pFreeDomTrees, 1) ;
       pDomTree -> xNdx = 0 ;
       pFreeDomTrees[xNdx] = xDomTree ;
  +
  +#if defined (_DEBUG) && defined (WIN32)
  +    _ASSERTE( _CrtCheckMemory( ) );
  +#endif
   
       return ok ;    
       }
  
  
  
  1.75.4.62 +29 -2     embperl/epmain.c
  
  Index: epmain.c
  ===================================================================
  RCS file: /home/cvs/embperl/epmain.c,v
  retrieving revision 1.75.4.61
  retrieving revision 1.75.4.62
  diff -u -r1.75.4.61 -r1.75.4.62
  --- epmain.c	2001/11/10 15:21:28	1.75.4.61
  +++ epmain.c	2001/11/11 19:19:50	1.75.4.62
  @@ -10,7 +10,7 @@
   #   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
   #   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   #
  -#   $Id: epmain.c,v 1.75.4.61 2001/11/10 15:21:28 richter Exp $
  +#   $Id: epmain.c,v 1.75.4.62 2001/11/11 19:19:50 richter Exp $
   #
   ###################################################################################*/
   
  @@ -348,8 +348,17 @@
       
       }
   
  +#if defined (_DEBUG) && defined (WIN32)
   
  -    
  +static int EmbperlCRTDebugOutput( int reportType, char *userMessage, int *retVal )
  +    {   
  +    lprintf (pCurrReq, "[%d]CRTDBG: %s\n", pCurrReq -> nPid, userMessage) ;  
  +
  +    return TRUE ;
  +    }
  +
  +#endif
  +
   /* */
   /* Magic */
   /* */
  @@ -1436,6 +1445,10 @@
       
       pCurrReq = r ;
   
  +#if defined (_DEBUG) && defined (WIN32)
  +    //_CrtSetReportHook( EmbperlCRTDebugOutput );
  +#endif
  +
       r -> nIOType = _nIOType ;
   
   #ifdef APACHE
  @@ -2334,7 +2347,12 @@
   
       r -> pLastReq = pCurrReq ;
       pCurrReq = r ;
  +
  +#if defined (_DEBUG) && defined (WIN32)
  +    _CrtMemCheckpoint(&r -> MemCheckpoint);    
  +#endif    
       
  +
   #ifdef APACHE
       if (SvROK (pApacheReqSV))
           r -> pApacheReq = (request_rec *)SvIV((SV*)SvRV(pApacheReqSV));
  @@ -2608,8 +2626,13 @@
   	sv_magic (pReqHV, NULL, '~', (char *)&pCurrReq, sizeof (pCurrReq)) ;
   	}
   
  +#if defined (_DEBUG) && defined (WIN32)
  +    _CrtMemDumpAllObjectsSince(&r -> MemCheckpoint);    
  +#endif    
  +
       r -> pNext = pReqFree ;
       pReqFree = r ;
  +
       }
   
   
  @@ -3916,6 +3939,10 @@
       /* --- reset variables and log end of request --- */
       if ((rc = ResetRequest (r, sInputfile)) != ok)
           LogError (r, rc) ;
  +
  +#if defined (_DEBUG) && defined (WIN32)
  +    _ASSERTE( _CrtCheckMemory( ) );
  +#endif
   
       return ok ;
       }
  
  
  

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