fix a warning
[ghc-hetmet.git] / ghc / rts / Hash.c
index 38cb65a..ada11a6 100644 (file)
@@ -1,5 +1,4 @@
 /*-----------------------------------------------------------------------------
- * $Id: Hash.c,v 1.9 2002/07/17 09:21:49 simonmar Exp $
  *
  * (c) The AQUA Project, Glasgow University, 1995-1998
  * (c) The GHC Team, 1999
@@ -246,8 +245,9 @@ insertHashTable(HashTable *table, StgWord key, void *data)
     int index;
     HashList *hl;
 
-    /* We want no duplicates */
-    ASSERT(lookupHashTable(table, key) == NULL);
+    // Disable this assert; sometimes it's useful to be able to
+    // overwrite entries in the hash table.
+    // ASSERT(lookupHashTable(table, key) == NULL);
 
     /* When the average load gets too high, we expand the table */
     if (++table->kcount >= HLOAD * table->bcount)
@@ -325,11 +325,11 @@ freeHashTable(HashTable *table, void (*freeDataFun)(void *) )
            }
            index--;
        }
-       free(table->dir[segment]);
+       stgFree(table->dir[segment]);
        segment--;
        index = HSEGSIZE - 1;
     }
-    free(table);
+    stgFree(table);
 }
 
 /* -----------------------------------------------------------------------------