Skip to content

Commit

Permalink
Bug 865828: Update NSPR to NSPR_4_10_BETA2. r=wtc.
Browse files Browse the repository at this point in the history
Includes fixes for bug 844513, bug 331169, bug 859066, and bug 871064.
  • Loading branch information
wantehchang committed May 22, 2013
1 parent a572f71 commit a867359
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 17 deletions.
2 changes: 1 addition & 1 deletion nsprpub/TAG-INFO
Original file line number Diff line number Diff line change
@@ -1 +1 @@
NSPR_4_10_BETA1
NSPR_4_10_BETA2
1 change: 1 addition & 0 deletions nsprpub/config/prdepend.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
*/

#error "Do not include this header file."

3 changes: 0 additions & 3 deletions nsprpub/lib/ds/plarena.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ PR_IMPLEMENT(void *) PL_ArenaAllocate(PLArenaPool *pool, PRUint32 nb)
pool->current = a;
rp = (char *)a->avail;
a->avail += nb;
PL_MAKE_MEM_UNDEFINED(rp, nb);
return rp;
}
} while( NULL != (a = a->next) );
Expand Down Expand Up @@ -188,7 +187,6 @@ PR_IMPLEMENT(void *) PL_ArenaAllocate(PLArenaPool *pool, PRUint32 nb)
pool->current = a;
if ( NULL == pool->first.next )
pool->first.next = a;
PL_MAKE_MEM_UNDEFINED(rp, nb);
return(rp);
}
}
Expand All @@ -215,7 +213,6 @@ PR_IMPLEMENT(void *) PL_ArenaAllocate(PLArenaPool *pool, PRUint32 nb)
pool->first.next = a;
PL_COUNT_ARENA(pool,++);
COUNT(pool, nmallocs);
PL_MAKE_MEM_UNDEFINED(rp, nb);
return(rp);
}
}
Expand Down
4 changes: 2 additions & 2 deletions nsprpub/lib/ds/plarena.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,10 @@ void __asan_unpoison_memory_region(void const volatile *addr, size_t size);
if (_q > _a->limit) { \
_p = (PRUword)PL_ArenaAllocate(pool, _nb); \
} else { \
PL_MAKE_MEM_UNDEFINED((void *)_p, nb); \
_a->avail = _q; \
} \
p = (void *)_p; \
PL_MAKE_MEM_UNDEFINED(p, nb); \
PL_ArenaCountAllocation(pool, nb); \
PR_END_MACRO

Expand All @@ -158,7 +158,7 @@ void __asan_unpoison_memory_region(void const volatile *addr, size_t size);
PRUword _q = _p + _incr; \
if (_p == (PRUword)(p) + PL_ARENA_ALIGN(pool, size) && \
_q <= _a->limit) { \
PL_MAKE_MEM_UNDEFINED((void *)((PRUword)(p) + size), incr); \
PL_MAKE_MEM_UNDEFINED((unsigned char *)(p) + size, incr); \
_a->avail = _q; \
PL_ArenaCountInplaceGrowth(pool, size, incr); \
} else { \
Expand Down
3 changes: 3 additions & 0 deletions nsprpub/lib/ds/plarenas.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ PR_EXTERN(void) PL_CompactArenaPool(PLArenaPool *pool);

/*
** Friend functions used by the PL_ARENA_*() macros.
**
** WARNING: do not call these functions directly. Always use the
** PL_ARENA_*() macros.
**/
PR_EXTERN(void *) PL_ArenaAllocate(PLArenaPool *pool, PRUint32 nb);

Expand Down
8 changes: 0 additions & 8 deletions nsprpub/pr/src/io/prsocket.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,14 +288,6 @@ static PRStatus PR_CALLBACK SocketConnectContinue(

#elif defined(WIN32) || defined(WIN16)

#if defined(WIN32)
/*
* The sleep circumvents a bug in Win32 WinSock.
* See Microsoft Knowledge Base article ID: Q165989.
*/
Sleep(0);
#endif /* WIN32 */

if (out_flags & PR_POLL_EXCEPT) {
int len = sizeof(err);
if (getsockopt(osfd, (int)SOL_SOCKET, SO_ERROR, (char *) &err, &len)
Expand Down
2 changes: 1 addition & 1 deletion nsprpub/pr/src/misc/prnetdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -2263,7 +2263,7 @@ static PRStatus pr_NetAddrToStringGNI(
md_af = AF_INET6;
#ifndef _PR_HAVE_SOCKADDR_LEN
addrcopy = *addr;
addrcopy.raw.family = AF_INET6;
addrcopy.raw.family = md_af;
addrp = &addrcopy;
#endif
}
Expand Down
6 changes: 4 additions & 2 deletions nsprpub/pr/src/pthreads/ptthread.c
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,8 @@ PR_IMPLEMENT(void) PR_SetThreadPriority(PRThread *thred, PRThreadPriority newPri
* because adjusting the nice value might be permitted for certain
* ranges but not for others. */
PR_LOG(_pr_thread_lm, PR_LOG_MIN,
("PR_SetThreadPriority: no thread scheduling privilege"));
("PR_SetThreadPriority: setpriority failed with error %d",
errno));
}
}
#endif
Expand Down Expand Up @@ -890,6 +891,8 @@ void _PR_InitThreads(
int rv;
PRThread *thred;

PR_ASSERT(priority == PR_PRIORITY_NORMAL);

#ifdef _PR_NEED_PTHREAD_INIT
/*
* On BSD/OS (3.1 and 4.0), the pthread subsystem is lazily
Expand Down Expand Up @@ -979,7 +982,6 @@ void _PR_InitThreads(
PR_ASSERT(0 == rv);
rv = pthread_setspecific(pt_book.key, thred);
PR_ASSERT(0 == rv);
PR_SetThreadPriority(thred, priority);
} /* _PR_InitThreads */

#ifdef __GNUC__
Expand Down
2 changes: 2 additions & 0 deletions nsprpub/pr/src/threads/combined/pruthr.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ void _PR_InitThreads(PRThreadType type, PRThreadPriority priority,
PRThread *thread;
PRThreadStack *stack;

PR_ASSERT(priority == PR_PRIORITY_NORMAL);

_pr_terminationCVLock = PR_NewLock();
_pr_activeLock = PR_NewLock();

Expand Down
1 change: 1 addition & 0 deletions security/nss/coreconf/coreconf.dep
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
*/

#error "Do not include this header file."

0 comments on commit a867359

Please sign in to comment.