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-02 16:11:23 +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-02 16:11:23 +0100 |
| commit | 94c794c8e06a848868509927eefde0741cd8bbe6 (patch) | |
| tree | abae1e9532464e2ff0c31492d8e7d9d3b31d2de2 | |
| parent | 846322e52afdad04c92c90c8d43ecc19e46a2b9e (diff) | |
| download | lanes-94c794c8e06a848868509927eefde0741cd8bbe6.tar.gz lanes-94c794c8e06a848868509927eefde0741cd8bbe6.tar.bz2 lanes-94c794c8e06a848868509927eefde0741cd8bbe6.zip | |
Fix error with LuaJIT when ffi package isn't required
| -rw-r--r-- | CHANGES | 4 | ||||
| -rw-r--r-- | docs/index.html | 6 | ||||
| -rw-r--r-- | src/lanes.c | 2 | ||||
| -rw-r--r-- | src/lanes.lua | 2 |
4 files changed, 9 insertions, 5 deletions
| @@ -1,5 +1,9 @@ | |||
| 1 | CHANGES: | 1 | CHANGES: |
| 2 | 2 | ||
| 3 | CHANGE 129: BGe 2-Nov-18 | ||
| 4 | * Bumped version to 3.13 | ||
| 5 | * fix error when autodetecting protect_allocator when running under LuaJIT | ||
| 6 | |||
| 3 | CHANGE 128: BGe 31-Oct-18 | 7 | CHANGE 128: BGe 31-Oct-18 |
| 4 | * Better default value autodetection for protect_allocator setting | 8 | * Better default value autodetection for protect_allocator setting |
| 5 | 9 | ||
diff --git a/docs/index.html b/docs/index.html index ff4b7a0..7b9b6ce 100644 --- a/docs/index.html +++ b/docs/index.html | |||
| @@ -64,13 +64,13 @@ | |||
| 64 | <font size="-1"> | 64 | <font size="-1"> |
| 65 | <p> | 65 | <p> |
| 66 | <br/> | 66 | <br/> |
| 67 | <i>Copyright © 2007-17 Asko Kauppi, Benoit Germain. All rights reserved.</i> | 67 | <i>Copyright © 2007-18 Asko Kauppi, Benoit Germain. All rights reserved.</i> |
| 68 | <br/> | 68 | <br/> |
| 69 | Lua Lanes is published under the same <a href="http://en.wikipedia.org/wiki/MIT_License">MIT license</a> as Lua 5.1, 5.2, and 5.3. | 69 | Lua Lanes is published under the same <a href="http://en.wikipedia.org/wiki/MIT_License">MIT license</a> as Lua 5.1, 5.2, and 5.3. |
| 70 | </p> | 70 | </p> |
| 71 | 71 | ||
| 72 | <p> | 72 | <p> |
| 73 | This document was revised on 1-Aug-17, and applies to version <tt>3.12</tt>. | 73 | This document was revised on 2-Nov-18, and applies to version <tt>3.13</tt>. |
| 74 | </p> | 74 | </p> |
| 75 | </font> | 75 | </font> |
| 76 | </center> | 76 | </center> |
| @@ -324,7 +324,7 @@ | |||
| 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 | (Since v3.5.2) If equal to <tt>true</tt>, Lanes wraps all calls to the state's allocator function inside a mutex. Useful when running Lanes with LuaJIT, whose allocator is not threadsafe. | 327 | (Since v3.5.2) If equal to <tt>true</tt>, Lanes wraps all calls to the state's allocator function inside a mutex. Lanes autodetects 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>. | 328 | Default is <tt>true</tt> when Lanes detects it is run by LuaJIT, else <tt>nil</tt>. |
| 329 | </td> | 329 | </td> |
| 330 | </tr> | 330 | </tr> |
diff --git a/src/lanes.c b/src/lanes.c index b89e3f5..f2e7927 100644 --- a/src/lanes.c +++ b/src/lanes.c | |||
| @@ -52,7 +52,7 @@ | |||
| 52 | * ... | 52 | * ... |
| 53 | */ | 53 | */ |
| 54 | 54 | ||
| 55 | char const* VERSION = "3.12"; | 55 | char const* VERSION = "3.13"; |
| 56 | 56 | ||
| 57 | /* | 57 | /* |
| 58 | =============================================================================== | 58 | =============================================================================== |
diff --git a/src/lanes.lua b/src/lanes.lua index 54fa0ac..b82ae2a 100644 --- a/src/lanes.lua +++ b/src/lanes.lua | |||
| @@ -77,7 +77,7 @@ lanes.configure = function( settings_) | |||
| 77 | demote_full_userdata = nil, | 77 | demote_full_userdata = nil, |
| 78 | verbose_errors = false, | 78 | verbose_errors = false, |
| 79 | -- LuaJIT provides a thread-unsafe allocator by default, so we need to protect it when used in parallel lanes | 79 | -- LuaJIT provides a thread-unsafe allocator by default, so we need to protect it when used in parallel lanes |
| 80 | protect_allocator = (package.loaded.jit and jit.version and (package.loaded.ffi.abi( "32bit") or package.loaded.ffi.abi( "gc64"))) and true or false | 80 | protect_allocator = (package.loaded.jit and jit.version and package.loaded.ffi and (package.loaded.ffi.abi( "32bit") or package.loaded.ffi.abi( "gc64"))) and true or false |
| 81 | } | 81 | } |
| 82 | local boolean_param_checker = function( val_) | 82 | local boolean_param_checker = function( val_) |
| 83 | -- non-'boolean-false' should be 'boolean-true' or nil | 83 | -- non-'boolean-false' should be 'boolean-true' or nil |
