apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject cvs commit: apr/memory/unix apr_pools.c apr_sms_pools.c
Date Thu, 02 Aug 2001 05:24:42 GMT
wrowe       01/08/01 22:24:42

  Modified:    include  apr_pools.h
               memory/unix apr_pools.c apr_sms_pools.c
  Log:
    Modify this semantic to 1. keep in tune with apr return values (although
    no apr_status_t is required) and 2. prepare for additional diagnostics
    (passing the first arg, macroized, as a string 'name'.)
  
  Revision  Changes    Path
  1.55      +5 -4      apr/include/apr_pools.h
  
  Index: apr_pools.h
  ===================================================================
  RCS file: /home/cvs/apr/include/apr_pools.h,v
  retrieving revision 1.54
  retrieving revision 1.55
  diff -u -r1.54 -r1.55
  --- apr_pools.h	2001/07/23 22:19:13	1.54
  +++ apr_pools.h	2001/08/02 05:24:42	1.55
  @@ -329,14 +329,15 @@
   #endif /* !APR_POOLS_ARE_SMS || DOXYGEN */
   
   /**
  - * Make a sub pool from the current pool
  - * @param p The pool to use as a parent pool
  + * @param p The new sub-pool
  + * @param parent The pool to use as a parent pool
    * @param apr_abort A function to use if the pool cannot allocate more memory.
  - * @return The new sub-pool
  + * @deffunc void apr_pool_sub_make(apr_pool_t **p, apr_pool_t *parent, int (*apr_abort)(int
retcode), const char *created)
    * @remark The @a apr_abort function provides a way to quit the program if the
    *      machine is out of memory.  By default, APR will return on error.
    */
  -APR_DECLARE(apr_pool_t *) apr_pool_sub_make(apr_pool_t *p,
  +APR_DECLARE(void) apr_pool_sub_make(apr_pool_t **p, 
  +                                            apr_pool_t *pparent,
                                               int (*apr_abort)(int retcode));
   
   #if defined(APR_POOL_DEBUG) || defined(DOXYGEN) 
  
  
  
  1.106     +14 -15    apr/memory/unix/apr_pools.c
  
  Index: apr_pools.c
  ===================================================================
  RCS file: /home/cvs/apr/memory/unix/apr_pools.c,v
  retrieving revision 1.105
  retrieving revision 1.106
  diff -u -r1.105 -r1.106
  --- apr_pools.c	2001/08/02 03:17:29	1.105
  +++ apr_pools.c	2001/08/02 05:24:42	1.106
  @@ -580,8 +580,9 @@
   #define POOL_HDR_CLICKS (1 + ((sizeof(struct apr_pool_t) - 1) / CLICK_SZ))
   #define POOL_HDR_BYTES (POOL_HDR_CLICKS * CLICK_SZ)
   
  -APR_DECLARE(apr_pool_t *) apr_pool_sub_make(apr_pool_t *p,
  -                                            apr_abortfunc_t abortfunc)
  +APR_DECLARE(void) apr_pool_sub_make(apr_pool_t **p,
  +                                    apr_pool_t *parent,
  +                                    apr_abortfunc_t abortfunc)
   {
       union block_hdr *blok;
       apr_pool_t *new_pool;
  @@ -604,13 +605,13 @@
       new_pool->free_first_avail = blok->h.first_avail;
       new_pool->first = new_pool->last = blok;
   
  -    if (p) {
  -	new_pool->parent = p;
  -	new_pool->sub_next = p->sub_pools;
  +    if (parent) {
  +	new_pool->parent = parent;
  +	new_pool->sub_next = parent->sub_pools;
   	if (new_pool->sub_next) {
   	    new_pool->sub_next->sub_prev = new_pool;
   	}
  -	p->sub_pools = new_pool;
  +	parent->sub_pools = new_pool;
       }
   
   #if APR_HAS_THREADS
  @@ -619,7 +620,7 @@
       }
   #endif
   
  -    return new_pool;
  +    *p = new_pool;
   }
   
   #ifdef APR_POOL_DEBUG
  @@ -653,23 +654,21 @@
   #endif
   
   /* ### why do we have this, in addition to apr_pool_sub_make? */
  -APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newcont,
  +APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newpool,
                                             apr_pool_t *parent_pool)
   {
  -    apr_pool_t *newpool;
       apr_abortfunc_t abortfunc;
   
       abortfunc = parent_pool ? parent_pool->apr_abort : NULL;
   
  -    newpool = apr_pool_sub_make(parent_pool, abortfunc);
  -    if (newpool == NULL) {
  +    apr_pool_sub_make(newpool, parent_pool, abortfunc);
  +    if (*newpool == NULL) {
           return APR_ENOPOOL;
       }   
   
  -    newpool->prog_data = NULL;
  -    newpool->apr_abort = abortfunc;
  +    (*newpool)->prog_data = NULL;
  +    (*newpool)->apr_abort = abortfunc;
   
  -    *newcont = newpool;
       return APR_SUCCESS;
   }
   
  @@ -837,7 +836,7 @@
           return status;
       }
   #endif
  -    permanent_pool = apr_pool_sub_make(globalp, NULL);
  +    apr_pool_sub_make(&permanent_pool, globalp, NULL);
   
   #ifdef ALLOC_STATS
       atexit(dump_stats);
  
  
  
  1.3       +6 -7      apr/memory/unix/apr_sms_pools.c
  
  Index: apr_sms_pools.c
  ===================================================================
  RCS file: /home/cvs/apr/memory/unix/apr_sms_pools.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- apr_sms_pools.c	2001/07/12 16:52:14	1.2
  +++ apr_sms_pools.c	2001/08/02 05:24:42	1.3
  @@ -77,17 +77,16 @@
                                        0x2000, 0, 0x80000);
   }
       
  -APR_DECLARE(apr_pool_t *) apr_pool_sub_make(apr_pool_t * p,
  -                                           apr_abortfunc_t abort)
  +APR_DECLARE(void) apr_pool_sub_make(apr_pool_t **p,
  +                                    apr_pool_t *pparent,
  +                                    apr_abortfunc_t abort)
   {
  -    apr_pool_t *np;
  -
  -    if (apr_sms_trivial_create(&np, p) != APR_SUCCESS)
  +    if (apr_sms_trivial_create(p, pparent) != APR_SUCCESS)
           return NULL;
   
  -    apr_sms_set_abort(abort, np);
  +    apr_sms_set_abort(abort, *p);
   
  -    return np;
  +    return p;
   }
   
   APR_DECLARE(void) apr_pool_cleanup_register(apr_pool_t *pool,
  
  
  

Mime
View raw message