fix(lua): disable custom allocation for Lua, it is crashing

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
test(lua): add a new example showing how to create nested State objects and threads

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
feat(util/shared_mutex): add shared_mutex object, this is a temporary replacement for std::shared_mutex that will be available in C++11

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
fix(lua): make sure environment objects can be safely accessed/updated from current threads

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
feat(lua): allow environment object references to be moved between Lua states

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
feat(lua): allow Booleans to be copied between Lua states

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
test(lua): add example showing how to access/update an environment object using multiple threads

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
fix(lua): redefine Lua 'print' function, and make sure it is thread safe

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
fix(lua): memory leaks, we should not use luaL_error because it does not unwind C++ stack

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
feat(lua): expose kernel objects in the Lua API

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
feat(lua): expose formatter in the Lua API

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
feat(lua): add support for copying closures between Lua states

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
chore(build): remove CheckLuaObjlen, it is easier to check the Lua version

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
feat(lua): allow Lua scripts to update 'global' options

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
feat(lua): use (** ... **) instead of {{ ... }} for nested Lua scripts

The token }} is a bad delimiter for blocks of Lua script code nested in Lean files.
The problem is that the sequence }} occurs very often in Lua code because Lua uses { and } to build tables/lists/arrays.
Here is an example of Lua code that contains the sequence }}
     t = {{1, 2}, {2, 3}, {3, 4}}

In Lean, (* ... *) is used to create comments. Thus, (** ... **) code blocks will not affect
valid Lean files. It also looks reasonably good.

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
feat(lua): use formatter available in the state object to convert Lean objects into strings in the Lua API

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
chore(build): exclude leanslowtests from OSX debug regression

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
chore(memcheck.supp): add suppressions for LuaJIT bugs

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
chore(travis): fix .travis.osx.yml