]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
64-bit cleanness: make the hash-table have UWord keys instead of UInt keys.
authorNicholas Nethercote <n.nethercote@gmail.com>
Thu, 4 Nov 2004 16:39:43 +0000 (16:39 +0000)
committerNicholas Nethercote <n.nethercote@gmail.com>
Thu, 4 Nov 2004 16:39:43 +0000 (16:39 +0000)
Allows addresses as keys.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2916

coregrind/vg_hashtable.c
helgrind/hg_main.c
include/tool.h.base
massif/ms_main.c
memcheck/mac_malloc_wrappers.c

index 8b19cf73a88a8f383a703f6795639ca7a6e3e87e..9df208072dd276a41de6b7cbb9bfeb9632031bd4 100644 (file)
@@ -73,7 +73,7 @@ void VG_(HT_add_node) ( VgHashTable table, VgHashNode* node )
 /* Looks up a VgHashNode in the table.  Also returns the address of
    the previous node's `next' pointer which allows it to be removed from the
    list later without having to look it up again.  */
-VgHashNode* VG_(HT_get_node) ( VgHashTable table, UInt key,
+VgHashNode* VG_(HT_get_node) ( VgHashTable table, UWord key,
                              /*OUT*/VgHashNode*** next_ptr )
 {
    VgHashNode *prev, *curr;
index 256ae3300a6cea56c04bd8f2cad0f8421fabf44e..8200f5ed134eb27fdcbd7323eb113bb92fd03930 100644 (file)
@@ -1920,7 +1920,7 @@ void handle_free ( void* p )
    HG_Chunk*  hc;
    HG_Chunk** prev_chunks_next_ptr;
 
-   hc = (HG_Chunk*)VG_(HT_get_node) ( hg_malloc_list, (UInt)p,
+   hc = (HG_Chunk*)VG_(HT_get_node) ( hg_malloc_list, (UWord)p,
                                       (VgHashNode***)&prev_chunks_next_ptr );
    if (hc == NULL) {
       return;
@@ -1952,7 +1952,7 @@ void* SK_(realloc) ( void* p, SizeT new_size )
    ThreadId   tid = VG_(get_current_or_recent_tid)();
 
    /* First try and find the block. */
-   hc = (HG_Chunk*)VG_(HT_get_node) ( hg_malloc_list, (UInt)p,
+   hc = (HG_Chunk*)VG_(HT_get_node) ( hg_malloc_list, (UWord)p,
                                        (VgHashNode***)&prev_chunks_next_ptr );
 
    if (hc == NULL) {
index ec0460f7e8aa878f486ea886ce24a8010f8f5ba9..90727a166ce3d9059bf38886d2d6f1117d2b5eb2 100644 (file)
@@ -1586,7 +1586,7 @@ extern VgSectKind VG_(seg_sect_kind)(Addr);
 typedef
    struct _VgHashNode {
       struct _VgHashNode * next;
-      UInt               key;
+      UWord              key;
    }
    VgHashNode;
 
@@ -1606,7 +1606,7 @@ extern void VG_(HT_add_node) ( VgHashTable t, VgHashNode* node );
 /* Looks up a node in the hash table.  Also returns the address of the
    previous node's `next' pointer which allows it to be removed from the
    list later without having to look it up again.  */
-extern VgHashNode* VG_(HT_get_node) ( VgHashTable t, UInt key,
+extern VgHashNode* VG_(HT_get_node) ( VgHashTable t, UWord key,
                                     /*OUT*/VgHashNode*** next_ptr );
 
 /* Allocates an array of pointers to all the shadow chunks of malloc'd
index e88edbd3528a504d8ad2f0a28651114a8a4f8025..9ce8d0e6cf4fe7a3ae77d2493e594bce23d6cc1a 100644 (file)
@@ -648,7 +648,7 @@ void add_HP_Chunk(HP_Chunk* hc)
 static __inline__ 
 HP_Chunk* get_HP_Chunk(void* p, HP_Chunk*** prev_chunks_next_ptr)
 {
-   return (HP_Chunk*)VG_(HT_get_node) ( malloc_list, (UInt)p,
+   return (HP_Chunk*)VG_(HT_get_node) ( malloc_list, (UWord)p,
                                         (VgHashNode***)prev_chunks_next_ptr );
 }
 
index 23f59b65b7e7772bd7fa76f0ec2363b1aac1f730..17c47acacdf21dbc45e93575ab86bd6b6e81b326 100644 (file)
@@ -304,7 +304,7 @@ void MAC_(handle_free) ( Addr p, UInt rzB, MAC_AllocKind kind )
 
    cmalloc_n_frees++;
 
-   mc = (MAC_Chunk*)VG_(HT_get_node) ( MAC_(malloc_list), (UInt)p,
+   mc = (MAC_Chunk*)VG_(HT_get_node) ( MAC_(malloc_list), (UWord)p,
                                        (void*)&prev_chunks_next_ptr );
    if (mc == NULL) {
       MAC_(record_free_error) ( tid, p );
@@ -353,7 +353,7 @@ void* SK_(realloc) ( void* p, SizeT new_size )
       return NULL;
 
    /* First try and find the block. */
-   mc = (MAC_Chunk*)VG_(HT_get_node) ( MAC_(malloc_list), (UInt)p,
+   mc = (MAC_Chunk*)VG_(HT_get_node) ( MAC_(malloc_list), (UWord)p,
                                        (void*)&prev_chunks_next_ptr );
 
    if (mc == NULL) {
@@ -460,7 +460,7 @@ void MAC_(destroy_mempool)(Addr pool)
    MAC_Mempool** prev_next;
 
    mp = (MAC_Mempool*)VG_(HT_get_node) ( MAC_(mempool_list),
-                                         (UInt)pool,
+                                         (UWord)pool,
                                          (void*)&prev_next );
 
    if (mp == NULL) {
@@ -482,7 +482,7 @@ void MAC_(mempool_alloc)(Addr pool, Addr addr, SizeT size)
    MAC_Mempool*  mp;
    MAC_Mempool** prev_next;
 
-   mp = (MAC_Mempool*)VG_(HT_get_node) ( MAC_(mempool_list), (UInt)pool,
+   mp = (MAC_Mempool*)VG_(HT_get_node) ( MAC_(mempool_list), (UWord)pool,
                                         (void*)&prev_next );
 
    if (mp == NULL) {
@@ -505,7 +505,7 @@ void MAC_(mempool_free)(Addr pool, Addr addr)
    ThreadId      tid = VG_(get_current_or_recent_tid)();
 
 
-   mp = (MAC_Mempool*)VG_(HT_get_node)(MAC_(mempool_list), (UInt)pool,
+   mp = (MAC_Mempool*)VG_(HT_get_node)(MAC_(mempool_list), (UWord)pool,
                                        (void*)&prev_pool);
 
    if (mp == NULL) {
@@ -513,7 +513,7 @@ void MAC_(mempool_free)(Addr pool, Addr addr)
       return;
    }
 
-   mc = (MAC_Chunk*)VG_(HT_get_node)(mp->chunks, (UInt)addr,
+   mc = (MAC_Chunk*)VG_(HT_get_node)(mp->chunks, (UWord)addr,
                                      (void*)&prev_chunk);
 
    if (mc == NULL) {