X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Frts%2FHash.c;h=1083b8a7ccef51871cef56dae6a650498c935d48;hb=546e865b133b86a60fccee4adb0bab84d33db264;hp=9b9e98a3dfb290c518f6a19c12f8b1ce80d699d0;hpb=bc5c802181b513216bc88f0d1ec9574157ee05fe;p=ghc-hetmet.git diff --git a/ghc/rts/Hash.c b/ghc/rts/Hash.c index 9b9e98a..1083b8a 100644 --- a/ghc/rts/Hash.c +++ b/ghc/rts/Hash.c @@ -1,5 +1,5 @@ /*----------------------------------------------------------------------------- - * $Id: Hash.c,v 1.6 2001/08/14 13:40:09 sewardj Exp $ + * $Id: Hash.c,v 1.10 2003/03/25 17:58:47 sof Exp $ * * (c) The AQUA Project, Glasgow University, 1995-1998 * (c) The GHC Team, 1999 @@ -14,6 +14,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 */ @@ -282,6 +285,7 @@ removeHashTable(HashTable *table, StgWord key, void *data) table->dir[segment][index] = hl->next; else prev->next = hl->next; + freeHashList(hl); table->kcount--; return hl->data; } @@ -321,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); } /* -----------------------------------------------------------------------------