apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stri...@apache.org
Subject cvs commit: apr/memory/unix apr_pools.c
Date Sat, 09 Feb 2002 14:49:16 GMT
striker     02/02/09 06:49:16

  Modified:    memory/unix apr_pools.c
  Log:
  Implement apr_pcalloc in terms of apr_palloc.
  
  Revision  Changes    Path
  1.154     +2 -29     apr/memory/unix/apr_pools.c
  
  Index: apr_pools.c
  ===================================================================
  RCS file: /home/cvs/apr/memory/unix/apr_pools.c,v
  retrieving revision 1.153
  retrieving revision 1.154
  diff -u -r1.153 -r1.154
  --- apr_pools.c	9 Feb 2002 14:08:39 -0000	1.153
  +++ apr_pools.c	9 Feb 2002 14:49:16 -0000	1.154
  @@ -503,40 +503,13 @@
   
   APR_DECLARE(void *) apr_pcalloc(apr_pool_t *pool, apr_size_t size)
   {
  -    node_t *active, *node;
       void *mem;
  -    char *endp;
   
       size = APR_ALIGN_DEFAULT(size);
  -    active = pool->active;
  -
  -    /* If the active node has enough bytes left, use it. */
  -    endp = active->first_avail + size;
  -    if (endp < active->endp) {
  -        mem = active->first_avail;
  -        active->first_avail = endp;
  -
  +    if ((mem = apr_palloc(pool, size)) != NULL) {
           memset(mem, 0, size);
  -
  -        return mem;
  -    }
  -
  -    if ((node = node_malloc(pool->allocator, size)) == NULL) {
  -        active->first_avail = active->endp;
  -
  -        if (pool->abort_fn)
  -            pool->abort_fn(APR_ENOMEM);
  -
  -        return NULL;
       }
   
  -    active->next = pool->active = node;
  -
  -    mem = node->first_avail;
  -    node->first_avail += size;
  -
  -    memset(mem, 0, size);
  -
       return mem;
   }
   
  @@ -1427,7 +1400,7 @@
   
   APR_DECLARE(apr_pool_t *) apr_pool_find(const void *mem)
   {
  -    void *pool = mem;
  +    void *pool = (void *)mem;
   
       if (apr_pool_walk_tree(global_pool, pool_find, &pool))
           return pool;
  
  
  

Mime
View raw message