/* -----------------------------------------------------------------------------
- * $Id: Stable.h,v 1.10 2001/11/21 10:09:15 simonmar Exp $
+ * $Id: Stable.h,v 1.14 2002/12/19 14:25:04 simonmar Exp $
*
* (c) The GHC Team, 1998-2000
*
* casting. Size is not a matter, because StgWord is always the same size as
* a void*.
*
- * ----------------------------------------------------------------------------*/
+ * ---------------------------------------------------------------------------*/
+
+#ifndef STABLE_H
+#define STABLE_H
/* -----------------------------------------------------------------------------
External C Interface
} snEntry;
extern DLL_IMPORT_RTS snEntry *stable_ptr_table;
-extern DLL_IMPORT_RTS snEntry *stable_ptr_free;
-extern DLL_IMPORT_RTS unsigned int SPT_size;
+extern void freeStablePtr(StgStablePtr sp);
-extern inline StgPtr
-deRefStablePtr(StgStablePtr sp)
+#ifndef RTS_STABLE_C
+extern inline
+#endif
+StgPtr deRefStablePtr(StgStablePtr sp)
{
ASSERT(stable_ptr_table[(StgWord)sp].ref > 0);
return stable_ptr_table[(StgWord)sp].addr;
}
-
-extern inline void
-freeStablePtr(StgStablePtr sp)
-{
- StgWord sn = (StgWord)sp;
-
- ASSERT(sn < SPT_size
- && stable_ptr_table[sn].addr != NULL
- && stable_ptr_table[sn].ref > 0);
-
- stable_ptr_table[sn].ref --;
-}
-
-extern inline StgStablePtr
-splitStablePtr(StgStablePtr sp)
-{
- stable_ptr_table[(StgWord)sp].ref ++;
- return sp;
-}
/* No deRefStableName, because the existence of a stable name doesn't
* guarantee the existence of the object itself.
*/
+
+#endif