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 /README | |
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 '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) |