1 /* -----------------------------------------------------------------------------
3 * (c) The GHC Team, 1998-2004
5 * Stable Pointers: A stable pointer is represented as an index into
6 * the stable pointer table.
8 * StgStablePtr used to be a synonym for StgWord, but stable pointers
9 * are guaranteed to be void* on the C-side, so we have to do some
10 * occasional casting. Size is not a matter, because StgWord is always
11 * the same size as a void*.
13 * ---------------------------------------------------------------------------*/
18 #include "sm/GC.h" // for evac_fn below
20 #include "BeginPrivate.h"
22 void freeStablePtr ( StgStablePtr sp
);
24 /* Use the "Unsafe" one after manually locking with stableLock/stableUnlock */
25 void freeStablePtrUnsafe ( StgStablePtr sp
);
27 void initStableTables ( void );
28 void exitStableTables ( void );
29 StgWord
lookupStableName ( StgPtr p
);
31 /* Call given function on every stable ptr. markStableTables depends
32 * on the function updating its pointers in case the object is
34 /* TODO: This also remembers old stable name addresses, which isn't
35 * necessary in some contexts markStableTables is called from.
36 * Consider splitting it.
38 void markStableTables ( evac_fn evac
, void *user
);
40 void threadStableTables ( evac_fn evac
, void *user
);
41 void gcStableTables ( void );
42 void updateStableTables ( rtsBool full
);
44 void stableLock ( void );
45 void stableUnlock ( void );
48 // needed by Schedule.c:forkProcess()
49 extern Mutex stable_mutex
;
52 #include "EndPrivate.h"