aboutsummaryrefslogtreecommitdiff
path: root/index.html
diff options
context:
space:
mode:
authorBenoit Germain <bnt.germain@gmail.com>2011-02-18 20:33:43 +0100
committerBenoit Germain <bnt.germain@gmail.com>2011-02-18 20:33:43 +0100
commit8a62fc37152aaa54ad7b1cbbf6c6907012fc2d36 (patch)
tree8877c68274e953715322e3125d0bee9127711b4e /index.html
parent3f71574510f7a302cdf6f5eb9af06f012efd3fbc (diff)
downloadlanes-8a62fc37152aaa54ad7b1cbbf6c6907012fc2d36.tar.gz
lanes-8a62fc37152aaa54ad7b1cbbf6c6907012fc2d36.tar.bz2
lanes-8a62fc37152aaa54ad7b1cbbf6c6907012fc2d36.zip
* keeper.lua is now embedded in text form instead of bytecode to improve LuaJIT2-compatibility (but this is not enough).
* moved keeper-related code in a separate source file
Diffstat (limited to 'index.html')
-rw-r--r--index.html27
1 files changed, 25 insertions, 2 deletions
diff --git a/index.html b/index.html
index 03c91f7..a28dd41 100644
--- a/index.html
+++ b/index.html
@@ -799,8 +799,31 @@ can be used for custom userdata as well. Here's what to do.
799</p> 799</p>
800<ol> 800<ol>
801 <li>Provide an <i>identity function</i> for your userdata, in C. This function is 801 <li>Provide an <i>identity function</i> for your userdata, in C. This function is
802used for creation and deletion of your deep userdata (the shared resource), 802 used for creation and deletion of your deep userdata (the shared resource),
803and for making metatables for the state-specific proxies for accessing it. 803 and for making metatables for the state-specific proxies for accessing it. The
804 prototype is
805 <table border="1" bgcolor="#E0E0FF" cellpadding="10">
806 <tr>
807 <td>
808 <code>void idfunc( lua_State *L, char const * const which);</code>
809 </table>
810<tt>which</tt> can be one of:
811<ul>
812 <li>
813 <tt>"new"</tt>: requests the creation of a new object, whose pointer is pushed on the stack
814 as a light userdata.
815 </li>
816 <li>
817 <tt>"delete"</tt>: receives this same pointer on the stack, and should cleanup the object.</li>
818 <li>
819 <tt>"metatable"</tt>: should build a metatable for the object. Don't cache the metatable
820yourself, Lanes takes care of it ("metatable" should only be invoked once).</li>
821 <li>
822 <tt>"module"</tt>: is the name of the module that exports the idfunc,
823to be pushed on the stack as a string. It is necessary so that Lanes can require it in
824any Lane and keeper state that receives a userdata. This is to prevent crashes in situations
825where the module could be unloaded while the idfunc pointer is still held.</li>
826</ul>
804Take a look at <tt>linda_id</tt> in <tt>lanes.c</tt>. 827Take a look at <tt>linda_id</tt> in <tt>lanes.c</tt>.
805 </li> 828 </li>
806 <li>Instanciate your userdata using <tt>luaG_deep_userdata()</tt>, 829 <li>Instanciate your userdata using <tt>luaG_deep_userdata()</tt>,