Bug 1392594 Make variable DebugOnly to address unused variable warning r?glandium
MozReview-Commit-ID: 1qQQGjeWeel
--- 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;
}