call lua_gc() for incremental garbage collection. Likely there is to tune this at some point.

This commit is contained in:
antirez 2011-05-07 11:32:37 +02:00
parent c2a7dd85ae
commit 40531be0e3

View File

@ -380,8 +380,10 @@ void evalCommand(redisClient *c) {
addReplyErrorFormat(c,"Error running script (call to %s): %s\n",
funcname, lua_tostring(lua,-1));
lua_pop(lua,1);
lua_gc(lua,LUA_GCCOLLECT,0);
return;
}
selectDb(c,server.lua_client->db->id); /* set DB ID from Lua client */
luaReplyToRedisReply(c,lua);
lua_gc(lua,LUA_GCSTEP,1);
}