Bug 1392594 Make variable DebugOnly to address unused variable warning r?glandium draft
authorTom Ritter <tom@mozilla.com>
Thu, 24 Aug 2017 22:55:35 -0500
changeset 655103 65a10483ddcfae58c7badedc31f08658d77b7cf0
parent 655102 dd39be675a0822d78461cb2b6d8e4a947e387133
child 655104 297547309c2327d94b1739ce81f69910cc9e4e5e
push id76778
push userbmo:tom@mozilla.com
push dateTue, 29 Aug 2017 17:35:26 +0000
reviewersglandium
bugs1392594
milestone57.0a1
Bug 1392594 Make variable DebugOnly to address unused variable warning r?glandium MozReview-Commit-ID: 1qQQGjeWeel
memory/volatile/VolatileBufferWindows.cpp
--- a/memory/volatile/VolatileBufferWindows.cpp
+++ b/memory/volatile/VolatileBufferWindows.cpp
@@ -1,14 +1,15 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "VolatileBuffer.h"
 #include "mozilla/Assertions.h"
+#include "mozilla/DebugOnly.h"
 #include "mozilla/mozalloc.h"
 #include "mozilla/WindowsVersion.h"
 
 #include <windows.h>
 
 #ifdef MOZ_MEMORY
 extern "C" int posix_memalign(void** memptr, size_t alignment, size_t size);
 #endif
@@ -114,21 +115,21 @@ VolatileBuffer::Unlock()
 {
   MutexAutoLock lock(mMutex);
 
   MOZ_ASSERT(mLockCount > 0, "VolatileBuffer unlocked too many times!");
   if (--mLockCount || OnHeap()) {
     return;
   }
 
-  void* addr = VirtualAllocEx(GetCurrentProcess(),
-                              mBuf,
-                              mSize,
-                              MEM_RESET,
-                              PAGE_READWRITE);
+  DebugOnly<void*> addr = VirtualAllocEx(GetCurrentProcess(),
+                                         mBuf,
+                                         mSize,
+                                         MEM_RESET,
+                                         PAGE_READWRITE);
   MOZ_ASSERT(addr, "Failed to MEM_RESET");
 }
 
 bool
 VolatileBuffer::OnHeap() const
 {
   return mHeap;
 }