Current File : //opt/RZruby/share/doc/ruby/html/da/d0a/vm_8h.html |
<!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/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>Ruby: include/ruby/vm.h File Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">Ruby
 <span id="projectnumber">1.9.3p551(2014-11-13revision48407)</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="../../index.html"><span>Main Page</span></a></li>
<li><a href="../../modules.html"><span>Modules</span></a></li>
<li><a href="../../annotated.html"><span>Data Structures</span></a></li>
<li class="current"><a href="../../files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="../../files.html"><span>File List</span></a></li>
<li><a href="../../globals.html"><span>Globals</span></a></li>
</ul>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="../../dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="../../dir_82434f6a8a39055b35115fc8d4134985.html">ruby</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#typedef-members">Typedefs</a> |
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">vm.h File Reference</div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
<div class="dyncontent">
<div class="center"><img src="../../d8/d97/vm_8h__dep__incl.png" border="0" usemap="#include_2ruby_2vm_8hdep" alt=""/></div>
<map name="include_2ruby_2vm_8hdep" id="include_2ruby_2vm_8hdep">
<area shape="rect" id="node2" href="../../d3/d57/eval_8c.html" title="eval.c" alt="" coords="5,80,67,107"/><area shape="rect" id="node3" href="../../de/de9/vm_8c.html" title="vm.c" alt="" coords="91,80,145,107"/></map>
</div>
</div>
<p><a href="../../da/d0a/vm_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:afd6d6bfc5b87b128cc4b33c5b259b01a"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="../../db/d74/structrb__vm__struct.html">rb_vm_struct</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d0a/vm_8h.html#afd6d6bfc5b87b128cc4b33c5b259b01a">ruby_vm_t</a></td></tr>
<tr class="separator:afd6d6bfc5b87b128cc4b33c5b259b01a"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a64b7830f0ac2f5c4e03c3659051b3e4b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../db/d97/parse_8c.html#a61569f2965b7a369eb10b6d75d410d11">int</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d0a/vm_8h.html#a64b7830f0ac2f5c4e03c3659051b3e4b">ruby_vm_destruct</a> (<a class="el" href="../../da/d0a/vm_8h.html#afd6d6bfc5b87b128cc4b33c5b259b01a">ruby_vm_t</a> *vm)</td></tr>
<tr class="separator:a64b7830f0ac2f5c4e03c3659051b3e4b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a450d06a010ca9e1139e5ba87c5cb9e38"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../de/d07/bigdecimal_8c.html#ac537498b5ed6e25bced70b90e5949201">void</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d0a/vm_8h.html#a450d06a010ca9e1139e5ba87c5cb9e38">ruby_vm_at_exit</a> (<a class="el" href="../../de/d07/bigdecimal_8c.html#ac537498b5ed6e25bced70b90e5949201">void</a>(*<a class="el" href="../../db/d74/zlib_8c.html#a44e3226ff5693e84f33cd635eb7a746b">func</a>)(<a class="el" href="../../da/d0a/vm_8h.html#afd6d6bfc5b87b128cc4b33c5b259b01a">ruby_vm_t</a> *))</td></tr>
<tr class="memdesc:a450d06a010ca9e1139e5ba87c5cb9e38"><td class="mdescLeft"> </td><td class="mdescRight">ruby_vm_at_exit registers a function <em>func</em> to be invoked when a VM passed away. <a href="#a450d06a010ca9e1139e5ba87c5cb9e38">More...</a><br/></td></tr>
<tr class="separator:a450d06a010ca9e1139e5ba87c5cb9e38"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<h2 class="groupheader">Typedef Documentation</h2>
<a class="anchor" id="afd6d6bfc5b87b128cc4b33c5b259b01a"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef struct <a class="el" href="../../db/d74/structrb__vm__struct.html">rb_vm_struct</a> <a class="el" href="../../da/d0a/vm_8h.html#afd6d6bfc5b87b128cc4b33c5b259b01a">ruby_vm_t</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="../../da/d0a/vm_8h_source.html#l00034">34</a> of file <a class="el" href="../../da/d0a/vm_8h_source.html">vm.h</a>.</p>
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a450d06a010ca9e1139e5ba87c5cb9e38"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="../../de/d07/bigdecimal_8c.html#ac537498b5ed6e25bced70b90e5949201">void</a> ruby_vm_at_exit </td>
<td>(</td>
<td class="paramtype"><a class="el" href="../../de/d07/bigdecimal_8c.html#ac537498b5ed6e25bced70b90e5949201">void</a>(*)(<a class="el" href="../../da/d0a/vm_8h.html#afd6d6bfc5b87b128cc4b33c5b259b01a">ruby_vm_t</a> *) </td>
<td class="paramname"><em>func</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>ruby_vm_at_exit registers a function <em>func</em> to be invoked when a VM passed away. </p>
<p>Functions registered this way runs in reverse order of registration, just like END {} block does. The difference is its timing to be triggered. ruby_vm_at_exit functions runs when a VM <em>passed</em> <em>away</em>, while END {} blocks runs just <em>before</em> a VM <em>is</em> <em>passing</em> <em>away</em>.</p>
<p>You cannot register a function to another VM than where you are in. So where to register is intuitive, omitted. OTOH the argument <em>func</em> cannot know which VM it is in because at the time of invocation, the VM has already died and there is no execution context. The VM itself is passed as the first argument to it.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">func</td><td>the function to register. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="../../de/de9/vm_8c_source.html#l00205">205</a> of file <a class="el" href="../../de/de9/vm_8c_source.html">vm.c</a>.</p>
<p>References <a class="el" href="../../d5/d9d/tcltklib_8c_source.html#l00181">at_exit</a>, <a class="el" href="../../dc/dd1/ossl__ssl_8c_source.html#l00104">func</a>, <a class="el" href="../../d8/d32/vm__core_8h_source.html#l00689">GET_VM</a>, and <a class="el" href="../../dc/dcc/array_8c_source.html#l00740">rb_ary_push()</a>.</p>
</div>
</div>
<a class="anchor" id="a64b7830f0ac2f5c4e03c3659051b3e4b"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="../../db/d97/parse_8c.html#a61569f2965b7a369eb10b6d75d410d11">int</a> ruby_vm_destruct </td>
<td>(</td>
<td class="paramtype"><a class="el" href="../../da/d0a/vm_8h.html#afd6d6bfc5b87b128cc4b33c5b259b01a">ruby_vm_t</a> * </td>
<td class="paramname"><em>vm</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="../../de/de9/vm_8c_source.html#l01618">1618</a> of file <a class="el" href="../../de/de9/vm_8c_source.html">vm.c</a>.</p>
<p>References <a class="el" href="../../d8/d32/vm__core_8h_source.html#l00285">rb_vm_struct::living_threads</a>, <a class="el" href="../../d8/d32/vm__core_8h_source.html#l00282">rb_vm_struct::main_thread</a>, <a class="el" href="../../d8/d32/vm__core_8h_source.html#l00322">rb_vm_struct::objspace</a>, <a class="el" href="../../d5/d75/cont_8c_source.html#l01357">rb_fiber_reset_root_local_storage()</a>, <a class="el" href="../../d8/d16/gc_8c_source.html#l02345">rb_gc_force_recycle()</a>, <a class="el" href="../../d8/d16/gc_8c_source.html#l00494">rb_objspace_free()</a>, <a class="el" href="../../d3/de7/thread_8c_source.html#l00259">rb_vm_gvl_destroy()</a>, <a class="el" href="../../d0/daa/gc_8h_source.html#l00055">RUBY_FREE_ENTER</a>, <a class="el" href="../../d0/daa/gc_8h_source.html#l00056">RUBY_FREE_LEAVE</a>, <a class="el" href="../../de/de9/vm_8c_source.html#l00211">ruby_vm_run_at_exit_hooks()</a>, <a class="el" href="../../d8/d16/gc_8c_source.html#l00916">ruby_xfree()</a>, <a class="el" href="../../d8/d32/vm__core_8h_source.html#l00278">rb_vm_struct::self</a>, <a class="el" href="../../d8/d32/vm__core_8h_source.html#l00394">rb_thread_struct::self</a>, <a class="el" href="../../d6/d87/regint_8h_source.html#l00152">st_free_table</a>, and <a class="el" href="../../de/de9/vm_8c_source.html#l01790">thread_free()</a>.</p>
<p>Referenced by <a class="el" href="../../d3/d57/eval_8c_source.html#l00112">ruby_cleanup()</a>.</p>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="../../doxygen.png" alt="doxygen"/>
</a> 1.8.5
</small></address>
</body>
</html>