> From: Sander Striker [mailto:[EMAIL PROTECTED] > Subject: [PATCH] Default tagging of pools in debug mode > > Hi, > > We are doing something similar in subversion. It might be > useful to add this. However, this will screw up stats and > memory usage output (and it will ofcourse only work in > when APR_POOL_DEBUG is defined). > > Thoughts?
Yes, this won't work. The first time apr_pool_clear is called, we end up with a bad tag pointer. Ideas welcome. A 'tag pool' (child of global_pool)? Sander > Index: memory/unix/apr_pools.c > =================================================================== > RCS file: /home/cvs/apr/memory/unix/apr_pools.c,v > retrieving revision 1.130 > diff -u -r1.130 apr_pools.c > --- memory/unix/apr_pools.c 13 Jan 2002 02:12:24 -0000 1.130 > +++ memory/unix/apr_pools.c 13 Jan 2002 02:17:41 -0000 > @@ -1160,6 +1160,13 @@ > pool->ref = NULL; > } > > +#if APR_POOL_TAG_DEFAULT > + /* This will screw up the stats and memory usage indicators > + * but it may prove useful. > + */ > + pool->tag = apr_psprintf(pool, "%s:%u", file, line); > +#endif > + > *newpool = pool; > > #if defined(APR_POOL_DEBUG_VERBOSE) > > >
