apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sander Striker <stri...@apache.org>
Subject apr_pool_join, WAS: Re: svn commit: r168115 - in /apr/apr/trunk: include/apr_pools.h memory/unix/apr_pools.c
Date Wed, 04 May 2005 12:08:43 GMT
jorton@apache.org wrote:
> Author: jorton
> Date: Wed May  4 04:30:27 2005
> New Revision: 168115
> 
> URL: http://svn.apache.org/viewcvs?rev=168115&view=rev
> Log:
> Steal the joined-pool debug code from 1.3:
> 
> * include/apr_pools.h (apr_pool_is_ancestor): Note special semantics
> for joined pools.
> 
> * memory/unix/apr_pools.c (apr_pool_join): Implement.
> (apr_pool_is_ancestor): Adjust for joined pools.
> 
> Modified:
>     apr/apr/trunk/include/apr_pools.h
>     apr/apr/trunk/memory/unix/apr_pools.c
> 
> Modified: apr/apr/trunk/include/apr_pools.h
> URL: http://svn.apache.org/viewcvs/apr/apr/trunk/include/apr_pools.h?rev=168115&r1=168114&r2=168115&view=diff
> ==============================================================================
> --- apr/apr/trunk/include/apr_pools.h (original)
> +++ apr/apr/trunk/include/apr_pools.h Wed May  4 04:30:27 2005
> @@ -392,11 +392,15 @@
>  APR_DECLARE(apr_pool_t *) apr_pool_parent_get(apr_pool_t *pool);
>  
>  /**
> - * Determine if pool a is an ancestor of pool b
> + * Determine if pool a is an ancestor of pool b.
>   * @param a The pool to search
>   * @param b The pool to search for
>   * @return True if a is an ancestor of b, NULL is considered an ancestor
>   *         of all pools.
> + * @remark if compiled with APR_POOL_DEBUG, this function will also
> + * return true if A is a pool which has been guaranteed by the caller
> + * (using apr_pool_join) to have a lifetime at least as long as some
> + * ancestor of pool B.
>   */
>  APR_DECLARE(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b);

I'd rather see a new function for this.  apr_pool_will_outlive()?  apr_pool_outlives()?
Naming isn't my strong part.  Anyways, I'd like to see ancestor mean
ancestor and not something else.  Mostly because ancestry is not only about
lifetimes but about hierarchy as well.

Other than that: +1.

Sander

Mime
View raw message