|Copyright||(c) The University of Glasgow 2001|
|License||BSD-style (see the file libraries/base/LICENSE)|
Unsafe low-level operations
This function extracts the pointer component of a foreign
pointer. This is a potentially dangerous operations, as if the
unsafeForeignPtrToPtr is the last usage
occurrence of the given foreign pointer, then its finalizer(s) will
be run, which potentially invalidates the plain pointer just
touchForeignPtr must be used
wherever it has to be guaranteed that the pointer lives on - i.e.,
has another usage occurrence.
To avoid subtle coding errors, hand written marshalling code
should preferably use
than combinations of
touchForeignPtr. However, the latter routines
are occasionally preferred in tool generated marshalling code.