This module provides two kinds of stable references to Haskell objects, stable names and stable pointers.

A data StablePtr a -- abstract, instance of: Eq. makeStablePtr :: a -> IO (StablePtr a) deRefStablePtr :: StablePtr a -> IO a freeStablePtr :: StablePtr a -> IO () Care must be taken to free stable pointers that are no longer required using the The object referenced by the stable pointer will be retained in the heap. The runtime system's internal stable pointer table will grow, which imposes an overhead on garbage collection. Notes: If The reverse is not necessarily true: if two stable pointers are not equal, it doesn't mean that they don't refer to the same Haskell object (although they probably don't). Calling The C interface (which is brought into scope by typedef StablePtr /* abstract, probably an unsigned long */ extern StgPtr deRefStablePtr(StgStablePtr stable_ptr); static void freeStablePtr(StgStablePtr sp); static StgStablePtr splitStablePtr(StgStablePtr sp); The functions Stable Names

A haskell object can be given a data StableName a -- abstract, instance Eq. makeStableName :: a -> IO (StableName a) hashStableName :: StableName a -> Int All these operations run in constant time. Stable names have the following properties: If The reverse is not necessarily true: if two stable names are not equal, it doesn't mean that they don't refer to the same Haskell object (although they probably don't). There is no There is no There is a Properties (1) and (2) are similar to stable pointers, but the key differences are that you can't get back to the original object from a stable name, and you can convert one to an