e536f4b496108d3e6112d00e7835cf2a1d1ae095
[ghc.git] / includes / rts / StaticPtrTable.h
1 /* -----------------------------------------------------------------------------
2 *
3 * (c) The GHC Team, 2008-2009
4 *
5 * Initialization of the Static Pointer Table
6 *
7 * Do not #include this file directly: #include "Rts.h" instead.
8 *
9 * To understand the structure of the RTS headers, see the wiki:
10 * http://ghc.haskell.org/trac/ghc/wiki/Commentary/SourceTree/Includes
11 *
12 * -------------------------------------------------------------------------- */
13
14 #ifndef RTS_STATICPTRTABLE_H
15 #define RTS_STATICPTRTABLE_H
16
17 /** Inserts an entry in the Static Pointer Table.
18 *
19 * The key is a fingerprint computed from the static pointer and the spe_closure
20 * is a pointer to the closure defining the table entry.
21 *
22 * A stable pointer to the closure is made to prevent it from being garbage
23 * collected while the entry exists on the table.
24 *
25 * This function is called from the code generated by
26 * compiler/deSugar/StaticPtrTable.sptInitCode
27 *
28 * */
29 void hs_spt_insert (StgWord64 key[2],void* spe_closure);
30
31 /** Inserts an entry for a StgTablePtr in the Static Pointer Table.
32 *
33 * This function is called from the GHCi interpreter to insert
34 * SPT entries for bytecode objects.
35 *
36 * */
37 void hs_spt_insert_stableptr(StgWord64 key[2], StgStablePtr *entry);
38
39 /** Removes an entry from the Static Pointer Table.
40 *
41 * This function is called from the code generated by
42 * compiler/deSugar/StaticPtrTable.sptInitCode
43 *
44 * */
45 void hs_spt_remove (StgWord64 key[2]);
46
47 #endif /* RTS_STATICPTRTABLE_H */