apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i...@apache.org
Subject cvs commit: apr/tables apr_tables.c
Date Sat, 08 Dec 2001 05:01:59 GMT
ianh        01/12/07 21:01:59

  Modified:    .        CHANGES
               tables   apr_tables.c
  Log:
  optimize the apr_array_copy call by remvoing the zero fill
  Thanks Brian!
  
  Obtained from: Brian Pane <bpane@pacbell.net>
  
  Revision  Changes    Path
  1.194     +2 -0      apr/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apr/CHANGES,v
  retrieving revision 1.193
  retrieving revision 1.194
  diff -u -r1.193 -r1.194
  --- CHANGES	2001/12/07 15:48:05	1.193
  +++ CHANGES	2001/12/08 05:01:59	1.194
  @@ -1,5 +1,7 @@
   Changes with APR b1  
   
  +  *) apr_array_copy speedup by removing the zero-fill [Brian Pane]
  +
     *) Fix build breakage on systems with getaddrinfo() but not 
        gai_strerror() (e.g., RedHat 5.2).  [Jeff Trawick]
   
  
  
  
  1.20      +5 -1      apr/tables/apr_tables.c
  
  Index: apr_tables.c
  ===================================================================
  RCS file: /home/cvs/apr/tables/apr_tables.c,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- apr_tables.c	2001/11/26 23:17:09	1.19
  +++ apr_tables.c	2001/12/08 05:01:59	1.20
  @@ -167,10 +167,14 @@
   APR_DECLARE(apr_array_header_t *) apr_array_copy(apr_pool_t *p,
   						const apr_array_header_t *arr)
   {
  -    apr_array_header_t *res = apr_array_make(p, arr->nalloc, arr->elt_size);
  +    apr_array_header_t *res =
  +        (apr_array_header_t *) apr_palloc(p, sizeof(apr_array_header_t));
  +    make_array_core(res, p, arr->nalloc, arr->elt_size, 0);
   
       memcpy(res->elts, arr->elts, arr->elt_size * arr->nelts);
       res->nelts = arr->nelts;
  +    memset(res->elts + res->elt_size * res->nelts, 0,
  +           res->elt_size * (res->nalloc - res->nelts));
       return res;
   }
   
  
  
  

Mime
View raw message