📁 File Manager Pro
v10.0.3 | PHP: 8.1.34
Server: Apache
2026-06-21 21:13:20
📂
/ (Root)
/
opt
/
alt
/
ruby19
/
share
/
doc
/
ruby
/
html
/
da
/
d0a
📍 /opt/alt/ruby19/share/doc/ruby/html/da/d0a
🔄 Refresh
✏️
Editing: vm_8h.html
Read Only
<!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.14"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <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 id="projectalign" 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.14 --> <script type="text/javascript" src="../../menudata.js"></script> <script type="text/javascript" src="../../menu.js"></script> <script type="text/javascript"> /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ $(function() { initMenu('../../',false,false,'search.php','Search'); }); /* @license-end */</script> <div id="main-nav"></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"> <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">int </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">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d0a/vm_8h.html#a450d06a010ca9e1139e5ba87c5cb9e38">ruby_vm_at_exit</a> (void(*<a class="el" href="../../dc/dd1/ossl__ssl_8c.html#a86771351f4ef469ab9c94739a64fd7ea">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 id="afd6d6bfc5b87b128cc4b33c5b259b01a"></a> <h2 class="memtitle"><span class="permalink"><a href="#afd6d6bfc5b87b128cc4b33c5b259b01a">◆ </a></span>ruby_vm_t</h2> <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 class="definition">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 id="a450d06a010ca9e1139e5ba87c5cb9e38"></a> <h2 class="memtitle"><span class="permalink"><a href="#a450d06a010ca9e1139e5ba87c5cb9e38">◆ </a></span>ruby_vm_at_exit()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void ruby_vm_at_exit </td> <td>(</td> <td class="paramtype">void(*)(<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 class="definition">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 class="reference">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 id="a64b7830f0ac2f5c4e03c3659051b3e4b"></a> <h2 class="memtitle"><span class="permalink"><a href="#a64b7830f0ac2f5c4e03c3659051b3e4b">◆ </a></span>ruby_vm_destruct()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int 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 class="definition">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 class="reference">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="../../de/de9/vm_8c_source.html#l00045">ruby_current_vm</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 class="reference">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.14 </small></address> </body> </html>
💾 Save Changes
❌ Cancel