This is to cherry-pick the following commit from the Tarantool LuaJIT branch:
commit 0615898d294847677ce8c652f3a67956a48e0ee1
Author: Nick Zavaritsky <mejedi@gmail.com>
Date: Thu Jul 28 14:24:58 2016 +0300
Automatically try *.so if *.dylib is missing (osx).
Optimize the memory benchmark:
- get rid of the global mutex to calculate statistics
- remove if() and switch() branches on critical code paths
- align memory blocks to OS page size
- use native machine word size instead of 'int'
When the deprecated --num-threads option was used in OLTP prepare, the
sysbench.opt.threads variable exported to Lua scripts contained the
default value of 1, even though the actual number of threads created by
sysbench was higher. Which led to unexpected fireworks.
Now the deprecated options override the correspond sysbench.opt.*
variables when used.
Provide compatibility wrappers for system (i.e. distribution-provided)
ConcurrencyKit on i386. Unlike bundled ConcurrencyKit, older versions
that may be provided by distributions do not support CK_USE_CC_BUILTINS,
which makes implementing 64-bit atomics impossible on x86 (32-bit).
Detect if 64-bit atomics are not provided at compile stage and if so,
resort to GCC builtin implementations.
Avoid Lua string management in OLTP_RW by introducing a new sql_param
method: set_rand_str(). Which calls sb_rand_str() in C code with a given
template string and a pre-allocated result buffer. In oltp_common.lua,
use set_rand_str() instead of allocating a new Lua string each time we
need a random string parameter for a prepared statement.