]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Comment-only changes.
authorJulian Seward <jseward@acm.org>
Sun, 17 Feb 2008 11:46:58 +0000 (11:46 +0000)
committerJulian Seward <jseward@acm.org>
Sun, 17 Feb 2008 11:46:58 +0000 (11:46 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7418

helgrind/hg_wordfm.c
helgrind/hg_wordfm.h

index db41c5df8f4c5aa939b21877d3d2e9156f6a1ce6..6126ff0fbbca93148a6eeb82aece275e5ce07eaf 100644 (file)
@@ -544,7 +544,9 @@ static void initFM ( WordFM* fm,
    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) )
index dea053543e5eea56af0545e623e7d1af8d90e29c..db89712618c20140d957a45e821e085af2e42c39 100644 (file)
 //---                      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) );