[project @ 2003-03-28 15:13:52 by sof]
[ghc-hetmet.git] / ghc / includes / Stable.h
index 241f42b..c4c2077 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $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
@@ -35,36 +38,20 @@ typedef struct {
 } 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