Bug 1413475 - Inline _CRT_SPINCOUNT in mozjemalloc.cpp. r?njn
It is only used once.
--- a/memory/build/mozjemalloc.cpp
+++ b/memory/build/mozjemalloc.cpp
@@ -153,18 +153,16 @@
#include <stdio.h>
#include <string.h>
#include <algorithm>
using namespace mozilla;
#ifdef XP_WIN
-// Some defines from the CRT internal headers that we need here.
-#define _CRT_SPINCOUNT 5000
#include <io.h>
#include <windows.h>
#include <intrin.h>
#define STDERR_FILENO 2
// Implement getenv without using malloc.
static char mozillaMallocOptionsBuf[64];
@@ -1299,17 +1297,17 @@ pthread_atfork(void (*)(void), void (*)(
// cases. We also can't use constructors, because for statics, they would fire
// after the first use of malloc, resetting the locks.
// Initializes a mutex. Returns whether initialization succeeded.
bool
Mutex::Init()
{
#if defined(XP_WIN)
- if (!InitializeCriticalSectionAndSpinCount(&mMutex, _CRT_SPINCOUNT)) {
+ if (!InitializeCriticalSectionAndSpinCount(&mMutex, 5000)) {
return false;
}
#elif defined(XP_DARWIN)
mMutex = OS_SPINLOCK_INIT;
#elif defined(XP_LINUX) && !defined(ANDROID)
pthread_mutexattr_t attr;
if (pthread_mutexattr_init(&attr) != 0) {
return false;