apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwool...@apache.org
Subject cvs commit: apr-util/include apr_buckets.h apr_ring.h
Date Fri, 10 Aug 2001 00:10:50 GMT
jwoolley    01/08/09 17:10:50

  Modified:    include  apr_buckets.h apr_ring.h
  Log:
  Clarify just a bit.  You can in fact change the bucket pointed to by e
  in various ways.  Change the data it points to all you want.  Change its
  type or start/length if you want.  None of that matters.  Changing its
  prev and next pointers is what's sticky, but even that can be done if
  you're careful that it's what you really want.  As long as you don't
  destroy the bucket or change the value of e, you're probably okay.  Sidebar:
  you _could_ change e's value if you wanted as long is it has a valid value
  by the time the next iteration of the loop comes around.  However, doing this
  would almost certainly not have the effect you expect, so it should
  be avoided.  =-)
  
  Revision  Changes    Path
  1.109     +5 -3      apr-util/include/apr_buckets.h
  
  Index: apr_buckets.h
  ===================================================================
  RCS file: /home/cvs/apr-util/include/apr_buckets.h,v
  retrieving revision 1.108
  retrieving revision 1.109
  diff -u -d -u -r1.108 -r1.109
  --- apr_buckets.h	2001/08/09 23:55:27	1.108
  +++ apr_buckets.h	2001/08/10 00:10:50	1.109
  @@ -337,9 +337,11 @@
    *	    ...
    * 	}
    * </pre>
  - * @warning Be aware that you *cannot* change the value of e within
  - * the foreach loop, nor can you destroy or otherwise modify the
  - * bucket pointed to by e.  If you do, then APR_BRIGADE_FOREACH
  + * @warning Be aware that you cannot change the value of e within
  + * the foreach loop, nor can you destroy the bucket it points to.
  + * Modifying the prev and next pointers of the bucket is dangerous
  + * but can be done if you're careful.  If you change e's value or
  + * destroy the bucket it points to, then APR_BRIGADE_FOREACH
    * will have no way to find out what bucket to use for its next
    * iteration.  The reason for this can be seen by looking closely
    * at the equivalent loops given in the tip above.  So, for example,
  
  
  
  1.10      +5 -3      apr-util/include/apr_ring.h
  
  Index: apr_ring.h
  ===================================================================
  RCS file: /home/cvs/apr-util/include/apr_ring.h,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -d -u -r1.9 -r1.10
  --- apr_ring.h	2001/08/09 23:55:27	1.9
  +++ apr_ring.h	2001/08/10 00:10:50	1.10
  @@ -386,9 +386,11 @@
    *	    ...
    * 	}
    * </pre>
  - * @warning Be aware that you *cannot* change the value of ep within
  - * the foreach loop, nor can you destroy or otherwise modify the
  - * ring element pointed to by ep.  If you do, then APR_RING_FOREACH
  + * @warning Be aware that you cannot change the value of ep within
  + * the foreach loop, nor can you destroy the ring element it points to.
  + * Modifying the prev and next pointers of the element is dangerous
  + * but can be done if you're careful.  If you change ep's value or
  + * destroy the element it points to, then APR_RING_FOREACH
    * will have no way to find out what element to use for its next
    * iteration.  The reason for this can be seen by looking closely
    * at the equivalent loops given in the tip above.  So, for example,
  
  
  

Mime
View raw message