RTS tidyup sweep, first phase
[ghc-hetmet.git] / rts / Stable.h
1 /* -----------------------------------------------------------------------------
2  *
3  * (c) The GHC Team, 1998-2004
4  *
5  * Stable Pointers: A stable pointer is represented as an index into
6  * the stable pointer table.
7  *
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*.
12  *
13  * ---------------------------------------------------------------------------*/
14
15 #ifndef STABLE_H
16 #define STABLE_H
17
18 #include "sm/GC.h" // for evac_fn below
19
20 void         freeStablePtr (StgStablePtr sp);
21
22 void    initStablePtrTable    ( void );
23 void    exitStablePtrTable    ( void );
24 StgWord lookupStableName      ( StgPtr p );
25
26 void    markStablePtrTable    ( evac_fn evac, void *user );
27 void    threadStablePtrTable  ( evac_fn evac, void *user );
28 void    gcStablePtrTable      ( void );
29 void    updateStablePtrTable  ( rtsBool full );
30
31 void    stablePtrPreGC        ( void );
32 void    stablePtrPostGC       ( void );
33
34 #endif /* STABLE_H */