[project @ 2002-10-15 13:18:51 by simonmar]
[ghc-hetmet.git] / ghc / rts / Hash.c
index 50fb3bc..38cb65a 100644 (file)
@@ -1,5 +1,5 @@
 /*-----------------------------------------------------------------------------
- * $Id: Hash.c,v 1.5 2001/06/27 11:29:10 sewardj Exp $
+ * $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
@@ -9,10 +9,14 @@
  * pp. 446 -- 457.
  * -------------------------------------------------------------------------- */
 
+#include "PosixSource.h"
 #include "Rts.h"
 #include "Hash.h"
 #include "RtsUtils.h"
 
+#include <stdlib.h>
+#include <string.h>
+
 #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 */
@@ -281,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;
        }