Bug 673382, Upgrade to NSPR 4.8.9, landing beta 5, r=wtc
authorKai Engert <kaie@kuix.de>
Fri, 05 Aug 2011 17:51:26 +0200
changeset 73905 d0c53c6ed070a3894fdce4b1bcb0a5bc0671196e
parent 73904 b4fb6f334a4fa92421afa8468f815e8fb8e1c759
child 73906 660e9d2e0adb7eb2f6619855c9ccadb81c028b98
push id2
push userbsmedberg@mozilla.com
push dateFri, 19 Aug 2011 14:38:13 +0000
reviewerswtc
bugs673382
milestone8.0a1
Bug 673382, Upgrade to NSPR 4.8.9, landing beta 5, r=wtc
nsprpub/TAG-INFO
nsprpub/config/prdepend.h
nsprpub/configure
nsprpub/configure.in
nsprpub/lib/ds/plarenas.h
nsprpub/pr/src/md/windows/w32poll.c
nsprpub/tools/httpget.c
--- a/nsprpub/TAG-INFO
+++ b/nsprpub/TAG-INFO
@@ -1,1 +1,1 @@
-NSPR_4_8_9_BETA4
+NSPR_4_8_9_BETA5
--- a/nsprpub/config/prdepend.h
+++ b/nsprpub/config/prdepend.h
@@ -37,8 +37,9 @@
 
 /*
  * A dummy header file that is a dependency for all the object files.
  * Used to force a full recompilation of NSPR in Mozilla's Tinderbox
  * depend builds.  See comments in rules.mk.
  */
 
 #error "Do not include this header file."
+
--- a/nsprpub/configure
+++ b/nsprpub/configure
@@ -3115,24 +3115,24 @@ if test "${enable_os2_high_mem+set}" = s
         MOZ_OS2_HIGH_MEMORY=
       else
         MOZ_OS2_HIGH_MEMORY=1
       fi 
 fi
 
 
 
-case "${target}" in
-arm-android-eabi)
+case "${CPU_ARCH}-${OS_TARGET}" in
+arm-Android)
     MOZ_THUMB=yes
     MOZ_ARCH=armv7-a
     MOZ_FPU=vfp
     MOZ_FLOAT_ABI=softfp
     ;;
-arm*-*)
+arm-*)
     if test -n "$MOZ_PLATFORM_MAEMO"; then
         MOZ_THUMB=no
         MOZ_ARCH=armv7-a
         MOZ_FLOAT_ABI=softfp
     fi
     if test "$MOZ_PLATFORM_MAEMO" = 6; then
         MOZ_THUMB=yes
     fi
--- a/nsprpub/configure.in
+++ b/nsprpub/configure.in
@@ -925,24 +925,24 @@ AC_ARG_ENABLE(os2-high-mem,
         MOZ_OS2_HIGH_MEMORY=1
       fi ])
 
 dnl ========================================================
 dnl = ARM toolchain tweaks
 dnl ========================================================
 
 dnl Defaults
-case "${target}" in
-arm-android-eabi)
+case "${CPU_ARCH}-${OS_TARGET}" in
+arm-Android)
     MOZ_THUMB=yes
     MOZ_ARCH=armv7-a
     MOZ_FPU=vfp
     MOZ_FLOAT_ABI=softfp
     ;;
-arm*-*)
+arm-*)
     if test -n "$MOZ_PLATFORM_MAEMO"; then
         MOZ_THUMB=no
         MOZ_ARCH=armv7-a
         MOZ_FLOAT_ABI=softfp
     fi
     if test "$MOZ_PLATFORM_MAEMO" = 6; then
         MOZ_THUMB=yes
     fi
--- a/nsprpub/lib/ds/plarenas.h
+++ b/nsprpub/lib/ds/plarenas.h
@@ -30,51 +30,24 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
-#if defined(PLARENAS_H)
-#else  /* defined(PLARENAS_H) */
+#ifndef PLARENAS_H
 #define PLARENAS_H
 
 PR_BEGIN_EXTERN_C
 
 typedef struct PLArenaPool      PLArenaPool;
 
 /*
-** Allocate an arena pool as specified by the parameters.
-**
-** This is equivelant to allocating the space yourself and then
-** calling PL_InitArenaPool().
-**
-** This function may fail (and return a NULL) for a variety of
-** reasons. The reason for a particular failure can be discovered
-** by calling PR_GetError().
-*/
-#if 0  /* Not implemented */
-PR_EXTERN(PLArenaPool*) PL_AllocArenaPool(
-    const char *name, PRUint32 size, PRUint32 align);
-#endif
-
-/*
-** Destroy an arena pool previously allocated by PL_AllocArenaPool().
-**
-** This function may fail if the arena is not empty and the caller
-** wishes to check for empty upon descruction.
-*/
-#if 0  /* Not implemented */
-PR_EXTERN(PRStatus) PL_DestroyArenaPool(PLArenaPool *pool, PRBool checkEmpty);
-#endif
-
-
-/*
 ** Initialize an arena pool with the given name for debugging and metering,
 ** with a minimum size per arena of size bytes.
 **/
 PR_EXTERN(void) PL_InitArenaPool(
     PLArenaPool *pool, const char *name, PRUint32 size, PRUint32 align);
 
 /*
 ** Finish using arenas, freeing all memory associated with them.
@@ -90,16 +63,17 @@ PR_EXTERN(void) PL_FreeArenaPool(PLArena
 
 /*
 ** Free the arenas in pool and finish using it altogether.
 **/
 PR_EXTERN(void) PL_FinishArenaPool(PLArenaPool *pool);
 
 /*
 ** Compact all of the arenas in a pool so that no space is wasted.
+** NOT IMPLEMENTED.  Do not use.
 **/
 PR_EXTERN(void) PL_CompactArenaPool(PLArenaPool *pool);
 
 /*
 ** Friend functions used by the PL_ARENA_*() macros.
 **/
 PR_EXTERN(void *) PL_ArenaAllocate(PLArenaPool *pool, PRUint32 nb);
 
@@ -110,11 +84,9 @@ PR_EXTERN(void) PL_ArenaRelease(PLArenaP
 
 /*
 ** memset contents of all arenas in pool to pattern
 */
 PR_EXTERN(void) PL_ClearArenaPool(PLArenaPool *pool, PRInt32 pattern);
 
 PR_END_EXTERN_C
 
-#endif /* defined(PLARENAS_H) */
-
-/* plarenas */
+#endif /* PLARENAS_H */
--- a/nsprpub/pr/src/md/windows/w32poll.c
+++ b/nsprpub/pr/src/md/windows/w32poll.c
@@ -283,80 +283,47 @@ PRInt32 _PR_MD_PR_POLL(PRPollDesc *pds, 
 
     /*
     ** Now to unravel the select sets back into the client's poll
     ** descriptor list. Is this possibly an area for pissing away
     ** a few cycles or what?
     */
     if (ready > 0)
     {
-        PR_ASSERT(rd.fd_count || wt.fd_count || ex.fd_count);
-
         ready = 0;
         for (pd = pds, epd = pd + npds; pd < epd; pd++)
         {
             PRInt16 out_flags = 0;
             if ((NULL != pd->fd) && (0 != pd->in_flags))
             {
                 SOCKET osfd;
                 bottom = PR_GetIdentitiesLayer(pd->fd, PR_NSPR_IO_LAYER);
                 PR_ASSERT(NULL != bottom);
 
                 osfd = (SOCKET) bottom->secret->md.osfd;
-                PR_ASSERT(INVALID_SOCKET != osfd);
 
                 if (FD_ISSET(osfd, &rd))
                 {
                     if (pd->out_flags & _PR_POLL_READ_SYS_READ)
                         out_flags |= PR_POLL_READ;
                     if (pd->out_flags & _PR_POLL_WRITE_SYS_READ)
                         out_flags |= PR_POLL_WRITE;
-
-                    // Adding assertion for |pd->out_flags| before |out_flags|
-                    // to recognize if we have some out flags set on the socket
-                    // or not ; if we do, then the out flags are not one of 
-                    // flags tested above
-                    PR_ASSERT(pd->out_flags);
-                    PR_ASSERT(out_flags);
                 } 
                 if (FD_ISSET(osfd, &wt))
                 {
                     if (pd->out_flags & _PR_POLL_READ_SYS_WRITE)
                         out_flags |= PR_POLL_READ;
                     if (pd->out_flags & _PR_POLL_WRITE_SYS_WRITE)
                         out_flags |= PR_POLL_WRITE;
-
-                    PR_ASSERT(pd->out_flags);
-                    PR_ASSERT(out_flags);
                 } 
                 if (FD_ISSET(osfd, &ex)) out_flags |= PR_POLL_EXCEPT;
             }
             pd->out_flags = out_flags;
             if (out_flags) ready++;
         }
-#ifdef DEBUG
-        if (ready == 0) {
-            printf("No ready socket but should be at least one, dumping: \n");
-            for (pd = pds, epd = pd + npds; pd < epd; pd++)
-            {
-                SOCKET osfd;
-                if (pd->fd) {
-                    bottom = PR_GetIdentitiesLayer(pd->fd, PR_NSPR_IO_LAYER);
-                    osfd = (SOCKET) bottom->secret->md.osfd;
-                    printf("\tfd=%p, in=%d, out=%d, osfd=%x / rd:%d wt:%d, ex:%d\n", 
-                        pd->fd, pd->in_flags, pd->out_flags, osfd,
-                        FD_ISSET(osfd, &rd), FD_ISSET(osfd, &wt), FD_ISSET(osfd, &ex));
-                }
-                else {
-                    printf("\tfd=NULL !\n");
-                }
-
-            }
-        }
-#endif
         PR_ASSERT(ready > 0);
     }
     else if (ready == SOCKET_ERROR)
     {
         err = WSAGetLastError();
         if (err == WSAENOTSOCK)
         {
             /* Find the bad fds */
--- a/nsprpub/tools/httpget.c
+++ b/nsprpub/tools/httpget.c
@@ -196,24 +196,23 @@ PRStatus FastFetchFile(PRFileDesc *in, P
     PRUint32 bytesToRead;
     PRStatus rv;
     PRInt64 sz64;
 
     LL_UI2L(sz64, size);
     outfMap = PR_CreateFileMap(out, sz64, PR_PROT_READWRITE);
     PR_ASSERT(outfMap);
     addr = PR_MemMap(outfMap, LL_ZERO, size);
-    if (addr == (void *) -1) {
+    if (addr == NULL) {
 	fprintf(stderr, "cannot memory-map file: (%d, %d)\n", PR_GetError(),
 		PR_GetOSError());
 
 	PR_CloseFileMap(outfMap);
 	return PR_FAILURE;
     }
-    PR_ASSERT(addr != (void *) -1);
     start = (char *) addr;
     rem = size;
     while ((nBytes = DrainInputBuffer(start, rem)) > 0) {
 	start += nBytes;
 	rem -= nBytes;
     }
     if (nBytes < 0) {
 	/* Input buffer is empty and end of stream */