]> git.saurik.com Git - redis.git/commitdiff
call lua_gc() for incremental garbage collection. Likely there is to tune this at...
authorantirez <antirez@gmail.com>
Sat, 7 May 2011 09:32:37 +0000 (11:32 +0200)
committerantirez <antirez@gmail.com>
Wed, 25 May 2011 10:32:48 +0000 (12:32 +0200)
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);
 }