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-10-31 12:22:26 +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-10-31 12:22:26 +0100 |
commit | e21a392b9c5f22c92e56fb0e0897cb8e77d51d0f (patch) | |
tree | e3b15b79fa2cb0b02d50b7484c23bc249496aec7 | |
parent | c014bc59d0d9d323d39a6addde0ad7cba5242692 (diff) | |
download | lanes-e21a392b9c5f22c92e56fb0e0897cb8e77d51d0f.tar.gz lanes-e21a392b9c5f22c92e56fb0e0897cb8e77d51d0f.tar.bz2 lanes-e21a392b9c5f22c92e56fb0e0897cb8e77d51d0f.zip |
Better protect_allocator autodetection
-rw-r--r-- | CHANGES | 3 | ||||
-rw-r--r-- | src/lanes.lua | 2 |
2 files changed, 4 insertions, 1 deletions
@@ -1,5 +1,8 @@ | |||
1 | CHANGES: | 1 | CHANGES: |
2 | 2 | ||
3 | CHANGE 128: BGe 31-Oct-18 | ||
4 | * Better default value autodetection for protect_allocator setting | ||
5 | |||
3 | CHANGE 127: BGe 30-Oct-18 | 6 | CHANGE 127: BGe 30-Oct-18 |
4 | * restrict internal light userdata constants to 47 significant bits when building against LuaJIT-x64 | 7 | * restrict internal light userdata constants to 47 significant bits when building against LuaJIT-x64 |
5 | 8 | ||
diff --git a/src/lanes.lua b/src/lanes.lua index 09603b3..54fa0ac 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 true or false | 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 |
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 |