diff options
author | Benoit Germain <b n t DOT g e r m a i n AT g m a i l DOT c o m> | 2018-11-25 12:45:11 +0100 |
---|---|---|
committer | Benoit Germain <b n t DOT g e r m a i n AT g m a i l DOT c o m> | 2018-11-25 12:45:11 +0100 |
commit | 8d6500fe389624be422ee546f71a1efd4456eabe (patch) | |
tree | b9462a142180b8edb01e1eb284a42fea9f0156bc /docs | |
parent | 60e5d94af372471c2a3bab91963588ca650bff7b (diff) | |
download | lanes-8d6500fe389624be422ee546f71a1efd4456eabe.tar.gz lanes-8d6500fe389624be422ee546f71a1efd4456eabe.tar.bz2 lanes-8d6500fe389624be422ee546f71a1efd4456eabe.zip |
protect_allocator configure option is gone, long live allocator (more embedders-friendly)
Diffstat (limited to 'docs')
-rw-r--r-- | docs/index.html | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/docs/index.html b/docs/index.html index 723766d..460a786 100644 --- a/docs/index.html +++ b/docs/index.html | |||
@@ -324,12 +324,37 @@ | |||
324 | <tt>nil</tt>/<tt>false</tt>/<tt>true</tt> | 324 | <tt>nil</tt>/<tt>false</tt>/<tt>true</tt> |
325 | </td> | 325 | </td> |
326 | <td> | 326 | <td> |
327 | REPLACED BY <tt>allocator="protected"</tt> AS OF VERSION v3.13.0. | ||
327 | (Since v3.5.2) If equal to <tt>true</tt>, Lanes wraps all calls to the state's allocator function inside a mutex. Since v3.6.3, when left unset, Lanes attempts to autodetect this value for LuaJIT (the guess might be wrong if <tt>"ffi"</tt> isn't loaded though). | 328 | (Since v3.5.2) If equal to <tt>true</tt>, Lanes wraps all calls to the state's allocator function inside a mutex. Since v3.6.3, when left unset, Lanes attempts to autodetect this value for LuaJIT (the guess might be wrong if <tt>"ffi"</tt> isn't loaded though). |
328 | Default is <tt>true</tt> when Lanes detects it is run by LuaJIT, else <tt>nil</tt>. | 329 | Default is <tt>true</tt> when Lanes detects it is run by LuaJIT, else <tt>nil</tt>. |
329 | </td> | 330 | </td> |
330 | </tr> | 331 | </tr> |
331 | 332 | ||
332 | <tr valign=top> | 333 | <tr valign=top> |
334 | <td id="allocator"> | ||
335 | <code>.allocator</code> | ||
336 | </td> | ||
337 | <td> | ||
338 | <tt>nil</tt>/<tt>"protected"</tt>/function | ||
339 | </td> | ||
340 | <td> | ||
341 | (Since v3.13.0)<br/> | ||
342 | If <tt>nil</tt>, Lua states are created with <tt>luaL_newstate()</tt> and use the default allocator.<br/> | ||
343 | If <tt>"protected"</tt>, The default allocator obtained from <tt>lua_getallocf()</tt> in the state that initializes Lanes is wrapped inside a critical section and used in all newly created states.<br/> | ||
344 | If a <tt>function</tt>, this function is called prior to creating the state. It should return a full userdata containing the following structure: | ||
345 | <table border="1" bgcolor="#E0E0FF" cellpadding="10" style="width:50%"> | ||
346 | <tr> | ||
347 | <td> | ||
348 | <pre> struct { lua_Alloc allocF; void* allocUD;}</pre> | ||
349 | </td> | ||
350 | </tr> | ||
351 | </table> | ||
352 | 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. | ||
354 | </td> | ||
355 | </tr> | ||
356 | |||
357 | <tr valign=top> | ||
333 | <td id="demote_full_userdata"> | 358 | <td id="demote_full_userdata"> |
334 | <code>.demote_full_userdata</code> | 359 | <code>.demote_full_userdata</code> |
335 | </td> | 360 | </td> |