X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Frts%2FThreadLabels.c;h=9b9f1723ffdc0f6a8055279843e8eab6aaeeb4d1;hb=05dad81285b606521b550b690f3e645bb7dc8f75;hp=79a0a77e65470e863e14ac19fc0d87aee023fffd;hpb=7457757f193b28b5fe8fee01edbed012c2fda897;p=ghc-hetmet.git diff --git a/ghc/rts/ThreadLabels.c b/ghc/rts/ThreadLabels.c index 79a0a77..9b9f172 100644 --- a/ghc/rts/ThreadLabels.c +++ b/ghc/rts/ThreadLabels.c @@ -1,16 +1,28 @@ +/* ----------------------------------------------------------------------------- + * ThreadLabels.c + * + * (c) The GHC Team 2002-2003 + * + * Table of thread labels. + * + * ---------------------------------------------------------------------------*/ #include "PosixSource.h" #include "ThreadLabels.h" +#include "RtsUtils.h" #include -HashTable * threadLabels = NULL; +#if defined(DEBUG) +/* to the end */ +static HashTable * threadLabels = NULL; void initThreadLabelTable(void) { - ASSERT(threadLabels == NULL); - threadLabels = allocHashTable(); + if (threadLabels == NULL) { + threadLabels = allocHashTable(); + } } void @@ -32,6 +44,7 @@ removeThreadLabel(StgWord key) void * old = NULL; if ((old = lookupHashTable(threadLabels,key))) { removeHashTable(threadLabels,key,old); - free(old); + stgFree(old); } } +#endif /* DEBUG */