Sophie

Sophie

distrib > Mageia > 5 > i586 > media > core-release > by-pkgid > 6e204a966e8c42d976f99a1700ce5f20 > files > 2274

ghc-7.4.2-4.mga5.i586.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Foreign.ForeignPtr.Unsafe</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Foreign-ForeignPtr-Unsafe.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">base-4.5.1.0: Basic libraries</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Portability</th><td>portable</td></tr><tr><th>Stability</th><td>provisional</td></tr><tr><th>Maintainer</th><td>ffi@haskell.org</td></tr><tr><th>Safe Haskell</th><td>Unsafe</td></tr></table><p class="caption">Foreign.ForeignPtr.Unsafe</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Unsafe low-level operations
</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>The <code><a href="Foreign-ForeignPtr-Safe.html#t:ForeignPtr">ForeignPtr</a></code> type and operations.  This module is part of the
 Foreign Function Interface (FFI) and will usually be imported via
 the <a href="Foreign.html">Foreign</a> module.
</p><p>Unsafe API Only.
</p></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><a href="#v:unsafeForeignPtrToPtr">unsafeForeignPtrToPtr</a> ::  <a href="Foreign-ForeignPtr-Safe.html#t:ForeignPtr">ForeignPtr</a> a -&gt; <a href="Foreign-Ptr.html#t:Ptr">Ptr</a> a</li></ul></div><div id="interface"><h2 id="g:1">Unsafe low-level operations
</h2><div class="top"><p class="src"><a name="v:unsafeForeignPtrToPtr" class="def">unsafeForeignPtrToPtr</a> ::  <a href="Foreign-ForeignPtr-Safe.html#t:ForeignPtr">ForeignPtr</a> a -&gt; <a href="Foreign-Ptr.html#t:Ptr">Ptr</a> a</p><div class="doc"><p>This function extracts the pointer component of a foreign
 pointer.  This is a potentially dangerous operations, as if the
 argument to <code><a href="Foreign-ForeignPtr-Unsafe.html#v:unsafeForeignPtrToPtr">unsafeForeignPtrToPtr</a></code> is the last usage
 occurrence of the given foreign pointer, then its finalizer(s) will
 be run, which potentially invalidates the plain pointer just
 obtained.  Hence, <code><a href="Foreign-ForeignPtr-Safe.html#v:touchForeignPtr">touchForeignPtr</a></code> must be used
 wherever it has to be guaranteed that the pointer lives on - i.e.,
 has another usage occurrence.
</p><p>To avoid subtle coding errors, hand written marshalling code
 should preferably use <code><a href="Foreign-ForeignPtr.html#v:withForeignPtr">withForeignPtr</a></code> rather
 than combinations of <code><a href="Foreign-ForeignPtr-Unsafe.html#v:unsafeForeignPtrToPtr">unsafeForeignPtrToPtr</a></code> and
 <code><a href="Foreign-ForeignPtr-Safe.html#v:touchForeignPtr">touchForeignPtr</a></code>.  However, the latter routines
 are occasionally preferred in tool generated marshalling code.
</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.11.0</p></div></body></html>