From d47758d58d532a9716ad4fd85cc806704df13735 Mon Sep 17 00:00:00 2001 From: Benoit Germain Date: Wed, 29 May 2024 16:16:05 +0200 Subject: Boyscouting deep.cpp|h --- docs/index.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'docs') diff --git a/docs/index.html b/docs/index.html index 8385480..19cc442 100644 --- a/docs/index.html +++ b/docs/index.html @@ -958,7 +958,7 @@

- Only available if lane tracking feature is compiled (see HAVE_LANE_TRACKING in lanes.cpp) and track_lanes is set. + Only available if lane tracking is enabled by setting track_lanes.
Returns an array table where each entry is a table containing a lane's name and status. Returns nil if no lane is running.

@@ -1743,9 +1743,9 @@ class MyDeepFactory : public DeepFactory { private: - DeepPrelude* newDeepObjectInternal(lua_State* L) const override; - void deleteDeepObjectInternal(lua_State* L, DeepPrelude* o_) const override; - void createMetatable(lua_State* L) const override; + void createMetatable(lua_State* const L_) const override; + void deleteDeepObjectInternal(lua_State* const L_, DeepPrelude* o_) const override; + DeepPrelude* newDeepObjectInternal(lua_State* const L_) const override; std::string_view moduleName() const override; }; @@ -1757,7 +1757,7 @@ static MyDeepFactory g_MyDeepFactory;
  • createMetatable: should build a metatable for the object. Don't cache the metatable yourself, Lanes takes care of it (createMetatable should only be invoked once per state). Just push the metatable on the stack.
  • moduleName: requests the name of the module that exports the factory, 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 factory pointer is still held.
  • - Take a look at LindaFactory in linda.cpp or MyDeepFactory in deep_test.cpp. + Take a look at LindaFactory in lindafactory.cpp or MyDeepFactory in deep_test.cpp.
  • Include "deep.h" and either link against Lanes or statically compile compat.cpp deep.cpp into your module if you want to avoid a runtime dependency for users that will use your module without Lanes.
  • Instanciate your userdata using yourFactoryObject.pushDeepUserdata(), instead of the regular lua_newuserdata(). Given a factory, 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.
  • -- cgit v1.2.3-55-g6feb