From 52d926ba29dcc37af8d299dd278aa2a879c269f5 Mon Sep 17 00:00:00 2001 From: gorhill Date: Sun, 28 Jun 2015 09:25:19 -0400 Subject: [PATCH 1/2] this fixes #391 --- src/js/logger.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/js/logger.js b/src/js/logger.js index 1a4692322..2ef03ede0 100644 --- a/src/js/logger.js +++ b/src/js/logger.js @@ -101,6 +101,14 @@ LogBuffer.prototype.dispose = function() { /******************************************************************************/ +LogBuffer.prototype.clearBuffer = function(beg, end) { + for ( var i = beg; i < end; i++ ) { + this.buffer[i] = null; + } +}; + +/******************************************************************************/ + LogBuffer.prototype.writeOne = function(args) { // Reusing log entry = less memory churning var entry = this.buffer[this.writePtr]; @@ -116,6 +124,13 @@ LogBuffer.prototype.writeOne = function(args) { // Grow the buffer between 1.5x-2x the current size if ( this.writePtr === this.readPtr ) { var toMove = this.buffer.slice(0, this.writePtr); + // https://github.com/gorhill/uBlock/issues/391 + // "The slice() method returns a shallow copy of a portion of an + // "array into a new array object." + // "shallow" => since we reuse entries, we need to remove the copied + // entries to prevent single instance of LogEntry being used in + // more than one slot. + this.clearBuffer(0, this.writePtr); var minSize = Math.ceil(this.size * 1.5); this.size += toMove.length; if ( this.size < minSize ) { From 81cc849bb45d5060cc5f600836820718a1b54d28 Mon Sep 17 00:00:00 2001 From: gorhill Date: Sat, 4 Jul 2015 08:25:33 -0400 Subject: [PATCH 2/2] opera: new revision --- platform/opera/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/opera/manifest.json b/platform/opera/manifest.json index 013a05825..7eb89f51e 100644 --- a/platform/opera/manifest.json +++ b/platform/opera/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 2, "name": "uBlock Origin", - "version": "0.9.9.2", + "version": "0.9.9.3", "default_locale": "en", "description": "__MSG_extShortDesc__",