/* -----------------------------------------------------------------------------
- * $Id: RetainerSet.c,v 1.4 2003/03/25 17:58:49 sof Exp $
*
* (c) The GHC Team, 2001
* Author: Sungwoo Park
#ifdef PROFILING
-#include <stdlib.h>
-
#include "Rts.h"
#include "RtsFlags.h"
#include "Stats.h"
#include "Arena.h"
#include "Profiling.h"
+#include <stdlib.h>
#include <string.h>
#define HASH_TABLE_SIZE 255
/* -----------------------------------------------------------------------------
* calculate the size of a RetainerSet structure
* -------------------------------------------------------------------------- */
-static inline size_t
+STATIC_INLINE size_t
sizeofRetainerSet( int elems )
{
return (sizeof(RetainerSet) + elems * sizeof(retainer));
for (i = 0; i < HASH_TABLE_SIZE; i++)
hashTable[i] = NULL;
nextId = 2;
-#endif // FIRST_APPROACH
+#endif /* FIRST_APPROACH */
}
/* -----------------------------------------------------------------------------
StgWord hk; // Hash Key
#ifdef DEBUG_RETAINER
- // fprintf(stderr, "addElement(%p, %p) = ", r, rs);
+ // debugBelch("addElement(%p, %p) = ", r, rs);
#endif
ASSERT(rs != NULL);
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;
hashTable[hash(hk)] = nrs;
#ifdef DEBUG_RETAINER
- // fprintf(stderr, "%p\n", nrs);
+ // debugBelch("%p\n", nrs);
#endif
return nrs;
}
stgFree(rsArray);
}
-#endif // SECOND_APPROACH
+#endif /* SECOND_APPROACH */
#endif /* PROFILING */