From 0e83dda2bff94870e1264766ca276b9ccc2f2cd9 Mon Sep 17 00:00:00 2001 From: Benoit Germain Date: Sun, 4 Nov 2018 14:05:24 +0100 Subject: Documentation for __lanesclone --- docs/index.html | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/index.html b/docs/index.html index 7b9b6ce..237b1cc 100644 --- a/docs/index.html +++ b/docs/index.html @@ -70,7 +70,7 @@
- This document was revised on 2-Nov-18, and applies to version 3.13. + This document was revised on 4-Nov-18, and applies to version 3.13.
@@ -113,7 +113,7 @@+ Starting with version 3.13, a new way of passing full userdata across lanes uses a new __lanesclone metamethod. A typical implementation would look like: +
+static int clonable_lanesclone( lua_State* L)
+{
+ // no need to set the metatable, the Lane copying mechanism will take care of it
+ struct s_MyClonableUserdata* self = lua_touserdata( L, 1);
+ struct s_MyClonableUserdata* to = lua_newuserdata( L, sizeof( struct s_MyClonableUserdata));
+ memcpy( to, self, sizeof(struct s_MyClonableUserdata));
+ return 1;
+}
+ |