/* -----------------------------------------------------------------------------
- * $Id: Stable.c,v 1.26 2003/06/24 13:45:49 stolz Exp $
+ * $Id: Stable.c,v 1.29 2004/08/22 15:50:42 panne Exp $
*
* (c) The GHC Team, 1998-2002
*
#include "PosixSource.h"
#include "Rts.h"
#include "Hash.h"
-#include "StablePriv.h"
#include "RtsUtils.h"
#include "Storage.h"
#include "RtsAPI.h"
#define INIT_SPT_SIZE 64
-static inline void
+STATIC_INLINE void
initFreeList(snEntry *table, nat n, snEntry *free)
{
snEntry *p;
lookupStableName(StgPtr p)
{
StgWord sn;
+ void* sn_tmp;
if (stable_ptr_free == NULL) {
enlargeStablePtrTable();
*/
p = (StgPtr)removeIndirections((StgClosure*)p);
- (void *)sn = lookupHashTable(addrToStableHash,(W_)p);
+ sn_tmp = lookupHashTable(addrToStableHash,(W_)p);
+ sn = (StgWord)sn_tmp;
if (sn != 0) {
ASSERT(stable_ptr_table[sn].addr == p);
return sn;
} else {
sn = stable_ptr_free - stable_ptr_table;
- (P_)stable_ptr_free = stable_ptr_free->addr;
+ stable_ptr_free = (snEntry*)(stable_ptr_free->addr);
stable_ptr_table[sn].ref = 0;
stable_ptr_table[sn].addr = p;
stable_ptr_table[sn].sn_obj = NULL;
}
}
-static inline void
+STATIC_INLINE void
freeStableName(snEntry *sn)
{
ASSERT(sn->sn_obj == NULL);
continue;
} else {
- (StgClosure *)p->addr = isAlive((StgClosure *)p->addr);
+ p->addr = (StgPtr)isAlive((StgClosure *)p->addr);
IF_DEBUG(stable, fprintf(stderr,"Stable name %d still alive at %p, ref %d\n", p - stable_ptr_table, p->addr, p->ref));
}
}