diff options
author | Adam Lerer <alerer@fb.com> | 2015-08-06 02:44:20 +0300 |
---|---|---|
committer | Adam Lerer <alerer@fb.com> | 2015-08-12 18:26:43 +0300 |
commit | a5a407964888298ab640b5c71a4cb5e517e40dfe (patch) | |
tree | c811db699bdd435acabb23c555785258dc4fbc5f /init.c | |
parent | e2b3cb5fddbe43b4fd13fa40e6b52d64fecebcf9 (diff) |
Fix lua GC to support allocations across multiple threads (e.g. threads sharedserialize)
Diffstat (limited to 'init.c')
-rw-r--r-- | init.c | 7 |
1 files changed, 0 insertions, 7 deletions
@@ -47,19 +47,12 @@ static void luaTorchArgErrorHandlerFunction(int argNumber, const char *msg, void luaL_argcheck(L, 0, argNumber, msg); } -static void luaTorchGCFunction(void *data) -{ - lua_State *L = data; - lua_gc(L, LUA_GCCOLLECT, 0); -} - LUA_EXTERNC DLL_EXPORT int luaopen_libtorch(lua_State *L); int luaopen_libtorch(lua_State *L) { THSetErrorHandler(luaTorchErrorHandlerFunction, L); THSetArgErrorHandler(luaTorchArgErrorHandlerFunction, L); - THSetGCHandler(luaTorchGCFunction, L); lua_newtable(L); lua_pushvalue(L, -1); |