X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Frts%2FRetainerSet.c;h=bfa0bc8acfa947e3c5d8d4868856e872804b7255;hb=45252b35151fc55aa19fb6770df5ed8267639083;hp=af776bf6ce5b5072677b2cba9fea175e132fd713;hpb=c41b6b7824ce67f0d97a316ada3482035fd4fe3d;p=ghc-hetmet.git diff --git a/ghc/rts/RetainerSet.c b/ghc/rts/RetainerSet.c index af776bf..bfa0bc8 100644 --- a/ghc/rts/RetainerSet.c +++ b/ghc/rts/RetainerSet.c @@ -1,5 +1,4 @@ /* ----------------------------------------------------------------------------- - * $Id: RetainerSet.c,v 1.3 2002/07/18 09:12:36 simonmar Exp $ * * (c) The GHC Team, 2001 * Author: Sungwoo Park @@ -10,8 +9,6 @@ #ifdef PROFILING -#include - #include "Rts.h" #include "RtsFlags.h" #include "Stats.h" @@ -20,6 +17,7 @@ #include "Arena.h" #include "Profiling.h" +#include #include #define HASH_TABLE_SIZE 255 @@ -52,7 +50,7 @@ RetainerSet rs_MANY = { /* ----------------------------------------------------------------------------- * calculate the size of a RetainerSet structure * -------------------------------------------------------------------------- */ -static inline size_t +STATIC_INLINE size_t sizeofRetainerSet( int elems ) { return (sizeof(RetainerSet) + elems * sizeof(retainer)); @@ -90,7 +88,7 @@ refreshAllRetainerSet(void) for (i = 0; i < HASH_TABLE_SIZE; i++) hashTable[i] = NULL; nextId = 2; -#endif // FIRST_APPROACH +#endif /* FIRST_APPROACH */ } /* ----------------------------------------------------------------------------- @@ -148,7 +146,7 @@ addElement(retainer r, RetainerSet *rs) StgWord hk; // Hash Key #ifdef DEBUG_RETAINER - // fprintf(stderr, "addElement(%p, %p) = ", r, rs); + // debugBelch("addElement(%p, %p) = ", r, rs); #endif ASSERT(rs != NULL); @@ -188,7 +186,7 @@ addElement(retainer r, RetainerSet *rs) if (i < rs->num) continue; #ifdef DEBUG_RETAINER - // fprintf(stderr, "%p\n", nrs); + // debugBelch("%p\n", nrs); #endif // The set we are seeking already exists! return nrs; @@ -211,7 +209,7 @@ addElement(retainer r, RetainerSet *rs) hashTable[hash(hk)] = nrs; #ifdef DEBUG_RETAINER - // fprintf(stderr, "%p\n", nrs); + // debugBelch("%p\n", nrs); #endif return nrs; } @@ -493,8 +491,8 @@ outputAllRetainerSet(FILE *prof_file) fprintf(prof_file, "}\n"); } - free(rsArray); + stgFree(rsArray); } -#endif // SECOND_APPROACH +#endif /* SECOND_APPROACH */ #endif /* PROFILING */