1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-09 00:22:08 +03:00

Allow garbage collection of processed queue items

Set processed queue items to `null` to allow garbage collection of these
items. The command queue contains callbacks. They contain the stack of
the current fiber, which can be large. Allow earlier garbage collection
of these stacks by removing the reference to the queue items.
This commit is contained in:
Jonas Dohse
2015-05-17 18:57:42 +00:00
parent a2ebe4f248
commit 3b6ab9e820

View File

@@ -18,7 +18,10 @@ Queue.prototype.shift = function () {
return;
}
}
return this.head[this.offset++]; // sorry, JSLint
var item = this.head[this.offset];
this.head[this.offset] = null;
this.offset++;
return item;
};
Queue.prototype.push = function (item) {