X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Frts%2FHash.c;h=ada11a6a859ef59f941719f3dfb3e28fee869547;hb=4dd415e9d8e564ca09937042b5c5605f7f2991c9;hp=05f2b191b68df77a9eff77913c5ef2fa025bbee9;hpb=ed0222d6dcf80ed4b46f1199c0c4e81c58f45e9d;p=ghc-hetmet.git diff --git a/ghc/rts/Hash.c b/ghc/rts/Hash.c index 05f2b19..ada11a6 100644 --- a/ghc/rts/Hash.c +++ b/ghc/rts/Hash.c @@ -1,5 +1,4 @@ /*----------------------------------------------------------------------------- - * $Id: Hash.c,v 1.8 2002/04/09 12:55:11 simonmar Exp $ * * (c) The AQUA Project, Glasgow University, 1995-1998 * (c) The GHC Team, 1999 @@ -14,6 +13,9 @@ #include "Hash.h" #include "RtsUtils.h" +#include +#include + #define HSEGSIZE 1024 /* Size of a single hash table segment */ /* Also the minimum size of a hash table */ #define HDIRSIZE 1024 /* Size of the segment directory */ @@ -243,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) @@ -322,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); } /* -----------------------------------------------------------------------------