summaryrefslogtreecommitdiff
path: root/rts/Stable.h
blob: b1b25ff62fb1c2223cc0e9029d47c2620b44b567 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/* -----------------------------------------------------------------------------
 *
 * (c) The GHC Team, 1998-2004
 *
 * Stable Pointers: A stable pointer is represented as an index into
 * the stable pointer table.
 *
 * StgStablePtr used to be a synonym for StgWord, but stable pointers
 * are guaranteed to be void* on the C-side, so we have to do some
 * occasional casting. Size is not a matter, because StgWord is always
 * the same size as a void*.
 *
 * ---------------------------------------------------------------------------*/

#ifndef STABLE_H
#define STABLE_H

#include "sm/GC.h" // for evac_fn below

#pragma GCC visibility push(hidden)

void    freeStablePtr         ( StgStablePtr sp );

void    initStablePtrTable    ( void );
void    exitStablePtrTable    ( void );
StgWord lookupStableName      ( StgPtr p );

void    markStablePtrTable    ( evac_fn evac, void *user );
void    threadStablePtrTable  ( evac_fn evac, void *user );
void    gcStablePtrTable      ( void );
void    updateStablePtrTable  ( rtsBool full );

void    stablePtrPreGC        ( void );
void    stablePtrPostGC       ( void );

#pragma GCC visibility pop

#endif /* STABLE_H */