Author: sewardj
Date: 2008-02-17 11:46:58 +0000 (Sun, 17 Feb 2008)
New Revision: 7418

Log:
Comment-only changes.


Modified:
   trunk/helgrind/hg_wordfm.c
   trunk/helgrind/hg_wordfm.h


Modified: trunk/helgrind/hg_wordfm.c
===================================================================
--- trunk/helgrind/hg_wordfm.c  2008-02-17 09:21:05 UTC (rev 7417)
+++ trunk/helgrind/hg_wordfm.c  2008-02-17 11:46:58 UTC (rev 7418)
@@ -544,7 +544,9 @@
    the set are ordered according to the ordering specified by kCmp,
    which becomes obvious if you use VG_(initIterFM),
    VG_(initIterAtFM), VG_(nextIterFM), VG_(doneIterFM) to iterate over
-   sections of the map, or the whole thing. */
+   sections of the map, or the whole thing.  If kCmp is NULL then the
+   ordering used is unsigned word ordering (UWord) on the key
+   values. */
 WordFM* HG_(newFM) ( void* (*alloc_nofail)( SizeT ),
                      void  (*dealloc)(void*),
                      Word  (*kCmp)(UWord,UWord) )

Modified: trunk/helgrind/hg_wordfm.h
===================================================================
--- trunk/helgrind/hg_wordfm.h  2008-02-17 09:21:05 UTC (rev 7417)
+++ trunk/helgrind/hg_wordfm.h  2008-02-17 11:46:58 UTC (rev 7418)
@@ -57,13 +57,25 @@
 //---                      Public interface                      ---//
 //------------------------------------------------------------------//
 
+/* As of r7409 (15 Feb 08), all these word-based abstractions (WordFM,
+   WordSet, WordBag) now operate on unsigned words (UWord), whereas
+   they previously operated on signed words (Word).  This became a
+   problem, when using unboxed comparisons (when kCmp == NULL), with
+   the introduction of HG_(initIterAtFM), which allows iteration over
+   parts of mappings.  Iterating over a mapping in increasing order of
+   signed Word keys is not what callers expect when iterating through
+   maps whose keys represent addresses (Addr) since Addr is unsigned,
+   and causes logical problems and assertion failures. */
+
 typedef  struct _WordFM  WordFM; /* opaque */
 
 /* Allocate and initialise a WordFM.  If kCmp is non-NULL, elements in
    the set are ordered according to the ordering specified by kCmp,
    which becomes obvious if you use VG_(initIterFM),
    VG_(initIterAtFM), VG_(nextIterFM), VG_(doneIterFM) to iterate over
-   sections of the map, or the whole thing. */
+   sections of the map, or the whole thing.  If kCmp is NULL then the
+   ordering used is unsigned word ordering (UWord) on the key
+   values. */
 WordFM* HG_(newFM) ( void* (*alloc_nofail)( SizeT ),
                      void  (*dealloc)(void*),
                      Word  (*kCmp)(UWord,UWord) );


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Valgrind-developers mailing list
Valgrind-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-developers

Reply via email to