minetest/minetest — pull request #1226 by ShadowNinja (2014-04-14 23:32:52+00:00)
Title: [WIP] Remove dependency on marshal and push the Lua error handler only once

This makes a number of changes:
* Remove the dependency on marshal by using string.dump and loadstring.
* Use lua_tolstring rather than having Lua functions pass string lengths to C++.
* Move lua_api/l_async_events.* to cpp_api/s_async.*, where it belongs.
* Make AsyncWorkerThread a child of ScriptApiBase, this removes some duplicate functionality.
* Only push the error handler once per Lua stack by storing it's index in ScriptApiBase::m_errorhandler.
* Don't wait for async threads to shut down. (Is this safe? Might result in corruption if the thread is writing to a file.)
* Code style fixes
* Pop some more items from the stack
* Other misc changes