Bug 1413651 - Correct the chunk range to dealloc shmem when AllocChunk() fails to return. r=nical
authorvincentliu <vliu@mozilla.com>
Tue, 07 Nov 2017 15:49:46 +0800
changeset 443757 a84fff04d9384160bec16b22dbb7063c62149b2e
parent 443756 d2580222abc787c50573436a761be699778115d8
child 443758 0b32504fcef2fc58835881e78a5ac675be361c3d
child 443770 574820f4c220065da36bbc6b78ac2b9b4adb676f
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical
bugs1413651
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1413651 - Correct the chunk range to dealloc shmem when AllocChunk() fails to return. r=nical
gfx/layers/wr/IpcResourceUpdateQueue.cpp
--- a/gfx/layers/wr/IpcResourceUpdateQueue.cpp
+++ b/gfx/layers/wr/IpcResourceUpdateQueue.cpp
@@ -43,17 +43,17 @@ ShmSegmentsWriter::Write(Range<uint8_t> 
 
   size_t srcCursor = 0;
   size_t dstCursor = mCursor;
   size_t currAllocLen = mSmallAllocs.Length();
 
   while (remainingBytesToCopy > 0) {
     if (dstCursor >= mSmallAllocs.Length() * mChunkSize) {
       if (!AllocChunk()) {
-        for (size_t i = mSmallAllocs.Length() ; currAllocLen <= i ; i--) {
+        for (size_t i = mSmallAllocs.Length() ; currAllocLen < i ; i--) {
           ipc::Shmem shm = mSmallAllocs.ElementAt(i);
           mShmAllocator->DeallocShmem(shm);
           mSmallAllocs.RemoveElementAt(i);
         }
         return layers::OffsetRange(0, start, 0);
       }
       continue;
     }