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 652712 abcbcde28cab6b3e372acbc9c36113298553a86e
parent 652385 2bc5e39f03a3395cf9de6f1e8223c0086ebc539c
child 728156 1be9a8151fb916e35e4dedb8026d7e8f2430b3c8
push id76128
push userbmo:tom@mozilla.com
push dateFri, 25 Aug 2017 03:57:54 +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;
 }