From 77630de350fc89038378c798cd482ed751280fc2 Mon Sep 17 00:00:00 2001
From: Benoit Germain
Date: Tue, 17 Jun 2014 16:34:31 +0200
Subject: Deep userdata changes
* bumped version to 3.9.6
* separate deep userdata code in a dedicated file to allow external
modules to implement Lanes-compatible deep userdata without requiring a
binary dependency against the Lanes module. because of this linda_id
function(eDO_metatable) must push 2 values on the stack: a metatable and
a deep version string obtained from luaG_pushdeepversion()
---
docs/index.html | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
(limited to 'docs')
diff --git a/docs/index.html b/docs/index.html
index da5da71..bfd26bb 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -70,7 +70,7 @@
- This document was revised on 20-Mar-14, and applies to version 3.9.4.
+ This document was revised on 17-Jun-14, and applies to version 3.9.6.
@@ -1511,12 +1511,12 @@ events to a common Linda, but... :).
- eDO_new: requests the creation of a new object, whose pointer is returned.
- eDO_delete: receives this same pointer on the stack as a light userdata, and should cleanup the object.
- - eDO_metatable: should build a metatable for the object. Don't cache the metatable yourself, Lanes takes care of it (eDO_metatable should only be invoked once per state).
+ - eDO_metatable: should build a metatable for the object. Don't cache the metatable yourself, Lanes takes care of it (eDO_metatable should only be invoked once per state). Push the metatable on the stack, then call luaG_pushdeepversion() before returning (new in version 3.9.5).
- eDO_module: requests the name of the module that exports the idfunc, to be returned. It is necessary so that Lanes can require it in any lane state that receives a userdata. This is to prevent crashes in situations where the module could be unloaded while the idfunc pointer is still held.
Take a look at linda_id in lanes.c.
- Include "deep.h" and link against Lanes.
+ Include "deep.h" and either link against Lanes or statically compile deep.c into your module if you want to avoid a runtime dependency for users that will use your module without Lanes.
Instanciate your userdata using luaG_newdeepuserdata(), instead of the regular lua_newuserdata(). Given an idfunc, it sets up the support structures and returns a state-specific proxy userdata for accessing your data. This proxy can also be copied over to other lanes.
Accessing the deep userdata from your C code, use luaG_todeep() instead of the regular lua_touserdata().
--
cgit v1.2.3-55-g6feb