]> git.saurik.com Git - redis.git/blobdiff - src/scripting.c
call lua_gc() for incremental garbage collection. Likely there is to tune this at...
[redis.git] / src / scripting.c
index 26e33bc705dc90d4c2d3f46cb6ed995287e273e0..ad00123a90ce5aeb8058a9b170ec1874c63a5c15 100644 (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);
 }