From 7dba35d1934ce5e92bc9c978c2d3842e4904f405 Mon Sep 17 00:00:00 2001 From: Aaron Klotz Date: Mon, 6 Mar 2017 12:11:45 -0700 Subject: [PATCH] Bug 1344827: Only disable critical section debug info on beta and release; r=fitzgen --HG-- extra : amend_source : 764d4a20231a3262bda1dd463d82fc018815ab7b --- mozglue/misc/Mutex_windows.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/mozglue/misc/Mutex_windows.cpp b/mozglue/misc/Mutex_windows.cpp index 41a5619bfb71..990e59faaede 100644 --- a/mozglue/misc/Mutex_windows.cpp +++ b/mozglue/misc/Mutex_windows.cpp @@ -16,12 +16,18 @@ mozilla::detail::MutexImpl::MutexImpl() { // This number was adopted from NSPR. const static DWORD LockSpinCount = 1500; + +#if defined(RELEASE_OR_BETA) // Vista and later automatically allocate and subsequently leak a debug info // object for each critical section that we allocate unless we tell the // system not to do that. + DWORD flags = CRITICAL_SECTION_NO_DEBUG_INFO; +#else + DWORD flags = 0; +#endif // defined(RELEASE_OR_BETA) + BOOL r = InitializeCriticalSectionEx(&platformData()->criticalSection, - LockSpinCount, - CRITICAL_SECTION_NO_DEBUG_INFO); + LockSpinCount, flags); MOZ_RELEASE_ASSERT(r); }