Commit 270e2ce9 authored by Chun-Min Chang's avatar Chun-Min Chang Committed by Matthew Finkel
Browse files

Bug 1650281 - P1: Widen `gCombinedSizes` once the buffers grow r=gerald

The `gCombinedSizes` need to be enlarged once the inner buffer within
`MemoryBlockCache` grows. Otherwise, when the `MemoryBlockCache` is
released, subtracting the buffer-size of the `MemoryBlockCache` from
`gCombinedSizes` lead to a underflow.

Differential Revision:
parent cc5b0ae5
......@@ -114,6 +114,10 @@ bool MemoryBlockCache::EnsureBufferCanContain(size_t aContentLength) {
// possibly bypass some future growths that would fit in this new capacity.
const size_t newSizes = gCombinedSizes += (extra + extraCapacity);
LOG("EnsureBufferCanContain(%zu) - buffer size %zu + requested %zu + bonus "
"%zu = %zu; combined sizes %zu",
aContentLength, initialLength, extra, extraCapacity, capacity, newSizes);
mHasGrown = true;
return true;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment