diff options
author | Benoit Germain <benoit.germain@ubisoft.com> | 2024-04-11 15:14:52 +0200 |
---|---|---|
committer | Benoit Germain <benoit.germain@ubisoft.com> | 2024-04-11 15:14:52 +0200 |
commit | adaa36dbec1ce9aaafd61873b9d3d898a8c240cf (patch) | |
tree | 4c81e8f5983c3d696a636e2cc433ce7c0a9c3dd8 /docs | |
parent | 1d310e6ecb6e156598337612f16573d9cd284f5e (diff) | |
download | lanes-adaa36dbec1ce9aaafd61873b9d3d898a8c240cf.tar.gz lanes-adaa36dbec1ce9aaafd61873b9d3d898a8c240cf.tar.bz2 lanes-adaa36dbec1ce9aaafd61873b9d3d898a8c240cf.zip |
Bring all interesting fixes from the C++ implementation back into the C implementation
Diffstat (limited to 'docs')
-rw-r--r-- | docs/index.html | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/docs/index.html b/docs/index.html index aed022a..da94898 100644 --- a/docs/index.html +++ b/docs/index.html | |||
@@ -70,7 +70,7 @@ | |||
70 | </p> | 70 | </p> |
71 | 71 | ||
72 | <p> | 72 | <p> |
73 | This document was revised on 23-Feb-24, and applies to version <tt>3.16.3</tt>. | 73 | This document was revised on 11-Apr-24, and applies to version <tt>3.17.0</tt>. |
74 | </p> | 74 | </p> |
75 | </font> | 75 | </font> |
76 | </center> | 76 | </center> |
@@ -291,6 +291,19 @@ | |||
291 | </tr> | 291 | </tr> |
292 | 292 | ||
293 | <tr valign=top> | 293 | <tr valign=top> |
294 | <td id="keepers_gc_threshold"> | ||
295 | <code>.keepers_gc_threshold</code> | ||
296 | </td> | ||
297 | <td>integer</td> | ||
298 | <td> | ||
299 | (Since v3.17.0)<br/> | ||
300 | If <0, GC runs automatically. This is the default.<br /> | ||
301 | If 0, GC runs after *every* keeper operation.<br /> | ||
302 | If >0, Keepers run GC manually with <tt>lua_gc(LUA_GCCOLLECT)</tt> whenever memory usage reported by <tt>lua_gc(LUA_GCCOUNT)</tt> reaches this threshold. Check is made after every keeper operation (see <a href="#lindas">below</a>). If memory usage remains above threshold after the GC cycle, an error is raised. | ||
303 | </td> | ||
304 | </tr> | ||
305 | |||
306 | <tr valign=top> | ||
294 | <td id="with_timers"> | 307 | <td id="with_timers"> |
295 | <code>.with_timers</code> | 308 | <code>.with_timers</code> |
296 | </td> | 309 | </td> |
@@ -351,7 +364,6 @@ | |||
351 | </table> | 364 | </table> |
352 | The contents will be used to create the state with <tt>lua_newstate( allocF, allocUD)</tt>. | 365 | The contents will be used to create the state with <tt>lua_newstate( allocF, allocUD)</tt>. |
353 | This option is mostly useful for embedders that want to provide different allocators to each lane, for example to have each one work in a different memory pool thus preventing the need for the allocator itself to be threadsafe. | 366 | This option is mostly useful for embedders that want to provide different allocators to each lane, for example to have each one work in a different memory pool thus preventing the need for the allocator itself to be threadsafe. |
354 | Note however that linda deep proxy are allocated with the allocator from the master state, because they are not tied to a particular state. | ||
355 | </td> | 367 | </td> |
356 | </tr> | 368 | </tr> |
357 | 369 | ||
@@ -364,7 +376,7 @@ | |||
364 | </td> | 376 | </td> |
365 | <td> | 377 | <td> |
366 | (Since v3.16.1)<br /> | 378 | (Since v3.16.1)<br /> |
367 | Controls which allocator is used for Lanest internal allocations (for keeper and deep userdata management). | 379 | Controls which allocator is used for Lanes internal allocations (for keeper, linda and lane management). |
368 | If <tt>"libc"</tt>, Lanes uses <tt>realloc</tt> and <tt>free</tt>.<br /> | 380 | If <tt>"libc"</tt>, Lanes uses <tt>realloc</tt> and <tt>free</tt>.<br /> |
369 | If <tt>"allocator"</tt>, Lanes uses whatever was obtained from the <tt>"allocator"</tt> setting.<br /> | 381 | If <tt>"allocator"</tt>, Lanes uses whatever was obtained from the <tt>"allocator"</tt> setting.<br /> |
370 | This option is mostly useful for embedders that want control all memory allocations, but have issues when Lanes tries to use the Lua State allocator for internal purposes (especially with LuaJIT). | 382 | This option is mostly useful for embedders that want control all memory allocations, but have issues when Lanes tries to use the Lua State allocator for internal purposes (especially with LuaJIT). |
@@ -911,7 +923,7 @@ | |||
911 | <table border="1" bgcolor="#E0E0FF" cellpadding="10" style="width:50%"> | 923 | <table border="1" bgcolor="#E0E0FF" cellpadding="10" style="width:50%"> |
912 | <tr> | 924 | <tr> |
913 | <td> | 925 | <td> |
914 | <pre> {{name = "name", status = "status", ...}|nil = lanes.threads()</pre> | 926 | <pre> {name = "name", status = "status", ...}|nil = lanes.threads()</pre> |
915 | </td> | 927 | </td> |
916 | </tr> | 928 | </tr> |
917 | </table> | 929 | </table> |
@@ -1617,8 +1629,8 @@ events to a common Linda, but... :).</font> | |||
1617 | <h3 id="clonable_userdata">Clonable full userdata in your own apps</h3> | 1629 | <h3 id="clonable_userdata">Clonable full userdata in your own apps</h3> |
1618 | <p> | 1630 | <p> |
1619 | Starting with version 3.13.0, a new way of passing full userdata across lanes uses a new <tt>__lanesclone</tt> metamethod. | 1631 | Starting with version 3.13.0, a new way of passing full userdata across lanes uses a new <tt>__lanesclone</tt> metamethod. |
1620 | When a deep userdata is cloned, Lanes calls <tt>__lanesclone</tt> once, in the context of the source lane.</br> | 1632 | When a deep userdata is cloned, Lanes calls <tt>__lanesclone</tt> once, in the context of the source lane.<br/> |
1621 | The call receives the clone and original as light userdata, plus the actual userdata size, as in <tt>clone:__lanesclone(original,size)</tt>, and should perform the actual cloning.</br> | 1633 | The call receives the clone and original as light userdata, plus the actual userdata size, as in <tt>clone:__lanesclone(original,size)</tt>, and should perform the actual cloning.<br/> |
1622 | A typical implementation would look like (BEWARE, THIS CHANGED WITH VERSION 3.16.0): | 1634 | A typical implementation would look like (BEWARE, THIS CHANGED WITH VERSION 3.16.0): |
1623 | <table border="1" bgcolor="#FFFFE0" cellpadding="10" style="width:50%"><tr><td><pre> | 1635 | <table border="1" bgcolor="#FFFFE0" cellpadding="10" style="width:50%"><tr><td><pre> |
1624 | static int clonable_lanesclone( lua_State* L) | 1636 | static int clonable_lanesclone( lua_State* L) |