Bug 1120778: Update NSPR to NSPR 4.10.8 beta 3 (NSPR_4_10_8_BETA3), r=me

--HG--
extra : rebase_source : 86352e7b5bcf8eaa7486a835f04676bbc8aed613
This commit is contained in:
Brian Smith 2015-01-12 19:29:56 -08:00
parent 13fc7aec80
commit dbf0743a51
7 changed files with 19 additions and 8 deletions

View File

@ -1 +1 @@
NSPR_4_10_8_BETA2
NSPR_4_10_8_BETA3

View File

@ -10,3 +10,4 @@
*/
#error "Do not include this header file."

View File

@ -18,7 +18,7 @@
#include "prlog.h"
#include "prmem.h"
#ifdef _MSC_VER
#if defined(_MSC_VER) && _MSC_VER < 1900
#define snprintf _snprintf
#endif

View File

@ -955,9 +955,10 @@ _PR_MD_LOCKFILE(PROsfd f)
0l, 0l,
0x0l, 0xffffffffl );
if ( rv == 0 ) {
DWORD rc = GetLastError();
DWORD err = GetLastError();
_PR_MD_MAP_DEFAULT_ERROR(err);
PR_LOG( _pr_io_lm, PR_LOG_ERROR,
("_PR_MD_LOCKFILE() failed. Error: %d", rc ));
("_PR_MD_LOCKFILE() failed. Error: %d", err ));
rc = PR_FAILURE;
}

View File

@ -24,7 +24,7 @@
/* BSD-derived systems use sysctl() to get the number of processors */
#if defined(BSDI) || defined(FREEBSD) || defined(NETBSD) \
|| defined(OPENBSD) || defined(DARWIN)
|| defined(OPENBSD) || defined(DRAGONFLY) || defined(DARWIN)
#define _PR_HAVE_SYSCTL
#include <sys/param.h>
#include <sys/sysctl.h>
@ -275,15 +275,24 @@ PR_IMPLEMENT(PRUint64) PR_GetPhysicalMemorySize(void)
if (pageSize >= 0 && pageCount >= 0)
bytes = (PRUint64) pageSize * pageCount;
#elif defined(NETBSD) || defined(OPENBSD)
#elif defined(NETBSD) || defined(OPENBSD) \
|| defined(FREEBSD) || defined(DRAGONFLY)
int mib[2];
int rc;
#ifdef HW_PHYSMEM64
uint64_t memSize;
#else
unsigned long memSize;
#endif
size_t len = sizeof(memSize);
mib[0] = CTL_HW;
#ifdef HW_PHYSMEM64
mib[1] = HW_PHYSMEM64;
#else
mib[1] = HW_PHYSMEM;
#endif
rc = sysctl(mib, 2, &memSize, &len, NULL, 0);
if (-1 != rc) {
bytes = memSize;

View File

@ -124,7 +124,7 @@ static _PRCPUQueue *_PR_CreateCPUQueue(void)
_MD_NEW_LOCK( &cpuQueue->sleepQLock );
_MD_NEW_LOCK( &cpuQueue->miscQLock );
for (index = 0; index < PR_PRIORITY_LAST + 1; index++)
for (index = 0; index < PR_ARRAY_SIZE(cpuQueue->runQ); index++)
PR_INIT_CLIST( &(cpuQueue->runQ[index]) );
PR_INIT_CLIST( &(cpuQueue->sleepQ) );
PR_INIT_CLIST( &(cpuQueue->pauseQ) );

View File

@ -87,7 +87,7 @@ void _PR_DumpThreads(PRFileDesc *fd)
_PR_DumpThread(fd, t);
_PR_DumpPrintf(fd, "Runnable Threads:\n");
for (i = 0; i < 32; i++) {
for (i = 0; i < PR_ARRAY_SIZE(_PR_RUNQ(t->cpu)); i++) {
DumpThreadQueue(fd, &_PR_RUNQ(t->cpu)[i]);
}