Bug 1344827: Only disable critical section debug info on beta and release; r=fitzgen

--HG--
extra : amend_source : 764d4a20231a3262bda1dd463d82fc018815ab7b
This commit is contained in:
Aaron Klotz 2017-03-06 12:11:45 -07:00
parent af86144916
commit 7dba35d193

View File

@ -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);
}