|
@ -1785,7 +1785,7 @@ var httpObserver = { |
|
|
// the ring buffer are overwritten.
|
|
|
// the ring buffer are overwritten.
|
|
|
pendingURLToIndex: new Map(), |
|
|
pendingURLToIndex: new Map(), |
|
|
pendingWritePointer: 0, |
|
|
pendingWritePointer: 0, |
|
|
pendingRingBuffer: new Array(32), |
|
|
|
|
|
|
|
|
pendingRingBuffer: new Array(256), |
|
|
pendingRingBufferInit: function() { |
|
|
pendingRingBufferInit: function() { |
|
|
// Use and reuse pre-allocated PendingRequest objects = less memory
|
|
|
// Use and reuse pre-allocated PendingRequest objects = less memory
|
|
|
// churning.
|
|
|
// churning.
|
|
@ -1812,7 +1812,7 @@ var httpObserver = { |
|
|
createPendingRequest: function(url) { |
|
|
createPendingRequest: function(url) { |
|
|
var bucket; |
|
|
var bucket; |
|
|
var i = this.pendingWritePointer; |
|
|
var i = this.pendingWritePointer; |
|
|
this.pendingWritePointer = i + 1 & 31; |
|
|
|
|
|
|
|
|
this.pendingWritePointer = i + 1 & 255; |
|
|
var preq = this.pendingRingBuffer[i]; |
|
|
var preq = this.pendingRingBuffer[i]; |
|
|
var si = String.fromCharCode(i); |
|
|
var si = String.fromCharCode(i); |
|
|
// Cleanup unserviced pending request
|
|
|
// Cleanup unserviced pending request
|
|
|