> From: Sander Striker [mailto:[EMAIL PROTECTED]
> Sent: 06 December 2001 09:50
> > From: Brian Pane [mailto:[EMAIL PROTECTED]
> > Sent: 06 December 2001 07:52
>
[...]
> > >APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size)
> > >{
> > >
> > ....
> >
> > > /* Reset the active node, get ourselves a new one and activate it. */
> > > active->first_avail = (char *)active + SIZEOF_NODE_T;
> > >
> >
> > I think it might make debugging easier if we waited until the
> > active node was freed (at pool destruction) before resetting
> > its first_avail pointer. Just in case anybody ever ends up
> > looking through the contents of the node list in gdb, it would
> > be less confusing if the first_avail pointers of the previously
> > active nodes still had meaningful values. (Maybe it would be
> > cleanest to just set the first_avail pointer on a node in
> > node_malloc, right before handing the recycled block to the
> > caller?)
>
> Ah, no. I tried to handle as much as possible of the cleanup in apr_palloc.
> This way, apr_pool_clear can be a lot faster than what we have in
> the current pools code. The only thing that needs to be done is reset
> the active node instead of resetting all the nodes.
I forgot to comment on the debug aspect of the thing. I'm not comfortable
with sacrificing performance* for debugging purposes. There will be
pools debug code to use when people need to debug, that won't be aimed
at top performance, but at being usefull for debugging purposes.
*) The performance gain is in not having to walk the list of nodes in
apr_pool_clear as mentioned above. Maybe this is not really a performance
win, but more of a better devision of processing time. apr_pool_clear
and apr_pool_destroy have less work to do, this could be why TStd is
down(?).
Sander