apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dr...@apache.org
Subject cvs commit: apr/memory/unix apr_sms_tracking.c
Date Mon, 18 Jun 2001 20:24:16 GMT
dreid       01/06/18 13:24:16

  Modified:    memory/unix apr_sms_tracking.c
  Log:
  Change some of the logic for list management to make it faster.
  Adjust the order of assignments for the structure.
  
  Submitted by:	Sander Striker <striker@samba-tng.org>
  Reviewed by:	David Reid <dreid@apache.org>
  
  Revision  Changes    Path
  1.14      +5 -7      apr/memory/unix/apr_sms_tracking.c
  
  Index: apr_sms_tracking.c
  ===================================================================
  RCS file: /home/cvs/apr/memory/unix/apr_sms_tracking.c,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- apr_sms_tracking.c	2001/06/13 14:17:38	1.13
  +++ apr_sms_tracking.c	2001/06/18 20:24:13	1.14
  @@ -92,11 +92,10 @@
       if (tms->lock) \
           apr_lock_acquire(tms->lock); \
       \
  -    node->next = tms->nodes; \
  -    tms->nodes = node; \
       node->ref = &tms->nodes; \
  -    if (node->next) \
  +    if ((node->next = tms->nodes) != NULL) \
           node->next->ref = &node->next; \
  +    tms->nodes = node; \
       \
       if (tms->lock) \
           apr_lock_release(tms->lock);
  @@ -106,7 +105,7 @@
               apr_lock_acquire(tms->lock); \
           \
           *(node->ref) = node->next; \
  -        if (node->next) \
  +        if ((*(node->ref) = node->next) != NULL) \
               node->next->ref = node->ref; \
           \
           if (tms->lock) \
  @@ -208,8 +207,7 @@
       
       while (tms->nodes) {
           node = tms->nodes;
  -        *(node->ref) = node->next;
  -        if (node->next)
  +        if ((*(node->ref) = node->next) != NULL)
               node->next->ref = node->ref;
           if ((rv = apr_sms_free(sms->parent, 
                                  node)) != APR_SUCCESS) {
  @@ -283,9 +281,9 @@
       new_sms->realloc_fn     = apr_sms_tracking_realloc;
       new_sms->free_fn        = apr_sms_tracking_free;
       new_sms->reset_fn       = apr_sms_tracking_reset;
  +    new_sms->pre_destroy_fn = apr_sms_tracking_pre_destroy;
       new_sms->destroy_fn     = apr_sms_tracking_destroy;
       new_sms->identity       = module_identity;
  -    new_sms->pre_destroy_fn = apr_sms_tracking_pre_destroy;
       
       tms = (apr_sms_tracking_t *)new_sms;
       tms->nodes = NULL;
  
  
  

Mime
View raw message