Ticket #45832: patch-js-src-jsgc.cpp.diff
File patch-js-src-jsgc.cpp.diff, 1.2 KB (added by ballapete (Peter "Pete" Dyballa), 9 years ago) |
---|
-
js/src/jsgc.
old new 95 95 96 96 #ifdef XP_WIN 97 97 # include "jswin.h" 98 #else 99 # include <unistd.h> 98 #else /* Handle Mac OS X < 10.5, pre-Leopard */ 99 # if __MAC_OS_X_VERSION_MIN_REQUIRED < 1050 || __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1050 100 # include <sys/param.h> 101 # include <sys/sysctl.h> 102 # else 103 # include <unistd.h> /* On Mac OS X < 10.5 no definition of _SC_NPROCESSORS_ONLN */ 104 # endif 100 105 #endif 101 106 102 107 using namespace mozilla; … … 2864 2869 SYSTEM_INFO sysinfo; 2865 2870 GetSystemInfo(&sysinfo); 2866 2871 ncpus = unsigned(sysinfo.dwNumberOfProcessors); 2872 # elif __MAC_OS_X_VERSION_MIN_REQUIRED < 1050 || __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1050 2873 int nm[2]; 2874 size_t len = 4; 2875 2876 nm[0] = CTL_HW; nm[1] = HW_AVAILCPU; 2877 sysctl(nm, 2, &ncpus, &len, NULL, 0); 2878 2879 if(ncpus < 1) { 2880 nm[1] = HW_NCPU; 2881 sysctl(nm, 2, &ncpus, &len, NULL, 0); 2882 if(ncpus < 1) { ncpus = 1; } 2883 } 2867 2884 # else 2868 2885 long n = sysconf(_SC_NPROCESSORS_ONLN); 2869 2886 ncpus = (n > 0) ? unsigned(n) : 1;