diff options
Diffstat (limited to 'README')
-rw-r--r-- | README | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -123,9 +123,11 @@ LUA_CPATH. If you are not sure how this works, try creating | |||
123 | ======================= | 123 | ======================= |
124 | Note about LuaJIT | 124 | Note about LuaJIT |
125 | ======================= | 125 | ======================= |
126 | By default LuaJIT2 provides an non-thread-safe memory allocator to improve performance. | 126 | It looks like LuaJIT makes some assumptions about the usage of its allocator. |
127 | Of course this will break when running several Lua states concurrently. | 127 | Namely, when a Lua state closes, memory allocated from its alloc function might be freed, even if said memory |
128 | Don't forget to initialize Lanes with the 'protect_allocator' option (see documentation) | 128 | isn't actually owned by the state (for example if the allocator was used explicitly after retrieving if with lua_getallocf) |
129 | if you experience random crash issues. | 129 | Therefore it seems to be a bad idea, when creating a new lua_State, to propagate the allocator |
130 | from another state, as closing the first state would invalidate all the memory used by the second one... | ||
131 | The best is therefore to leave the 'allocator' configuration option unset when running LuaJIT. | ||
130 | 132 | ||
131 | (end) | 133 | (end) |