X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fincludes%2FStable.h;h=c4c207787c598186ffbd1593b4f5e0e300bfd9c3;hb=49bff3215bf3fe9ada24dac2cf80f97db4e597dd;hp=241f42bf1902ef99892baf4725440ed563742dd6;hpb=560bf0f68bdfd422c9d744a83ca38ec0a4bc780c;p=ghc-hetmet.git diff --git a/ghc/includes/Stable.h b/ghc/includes/Stable.h index 241f42b..c4c2077 100644 --- a/ghc/includes/Stable.h +++ b/ghc/includes/Stable.h @@ -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 * @@ -12,7 +12,10 @@ * 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