diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/index.html | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/docs/index.html b/docs/index.html index fe92565..4a9fc35 100644 --- a/docs/index.html +++ b/docs/index.html | |||
| @@ -289,11 +289,17 @@ | |||
| 289 | <td> | 289 | <td> |
| 290 | If <tt>nil</tt>, Lua states are created with <tt>lua_newstate()</tt> and reuse the allocator from the master state.<br /> | 290 | If <tt>nil</tt>, Lua states are created with <tt>lua_newstate()</tt> and reuse the allocator from the master state.<br /> |
| 291 | If <tt>"protected"</tt>, The default allocator obtained from <tt>lua_getallocf()</tt> in the master state is wrapped inside a critical section and used in all newly created states.<br /> | 291 | If <tt>"protected"</tt>, The default allocator obtained from <tt>lua_getallocf()</tt> in the master state is wrapped inside a critical section and used in all newly created states.<br /> |
| 292 | If a <tt>function</tt>, this function is called prior to creating the state, with a single string argument, either <tt>"keeper"</tt> or <tt>"lane"</tt>. It should return a full userdata containing the following structure: | 292 | If a <tt>function</tt>, this function is called prior to creating the state, with a single string argument, either <tt>"keeper"</tt> or <tt>"lane"</tt>. It should return a full userdata created as follows: |
| 293 | <table border="1" bgcolor="#E0E0FF" cellpadding="10" style="width:50%"> | 293 | <table border="1" bgcolor="#E0E0FF" cellpadding="10" style="width:50%"> |
| 294 | <tr> | 294 | <tr> |
| 295 | <td> | 295 | <td> |
| 296 | <pre> struct { uintptr_t version { AllocatorDefinition::kAllocatorVersion }; lua_Alloc allocF; void* allocUD; }</pre> | 296 | <pre> |
| 297 | static constexpr lua_CFunction _provideAllocator = +[](lua_State* const L_) { | ||
| 298 | lanes::AllocatorDefinition* const _def{ new (L_) lanes::AllocatorDefinition{} }; | ||
| 299 | // populate _def->allocF and _def->allocUD here | ||
| 300 | return 1; | ||
| 301 | }; | ||
| 302 | </pre> | ||
| 297 | </td> | 303 | </td> |
| 298 | </tr> | 304 | </tr> |
| 299 | </table> | 305 | </table> |
