changeset 5618:15a6b0bceb1e

7181353: Update error message to distinguish native OOM and java OOM in net Reviewed-by: chegar
author zhouyx
date Fri, 06 Jul 2012 10:36:19 +0800
parents 4ad204cc7433
children 516e0c884af2
files src/solaris/native/java/net/Inet4AddressImpl.c src/solaris/native/java/net/Inet6AddressImpl.c src/solaris/native/java/net/NetworkInterface.c src/solaris/native/java/net/PlainDatagramSocketImpl.c src/windows/native/java/net/DualStackPlainDatagramSocketImpl.c src/windows/native/java/net/Inet6AddressImpl.c src/windows/native/java/net/NetworkInterface.c src/windows/native/java/net/TwoStacksPlainDatagramSocketImpl.c
diffstat 8 files changed, 16 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/src/solaris/native/java/net/Inet4AddressImpl.c	Thu Jul 05 15:13:45 2012 -0700
+++ b/src/solaris/native/java/net/Inet4AddressImpl.c	Fri Jul 06 10:36:19 2012 +0800
@@ -196,7 +196,7 @@
                 struct addrinfo *next
                     = (struct addrinfo*) malloc(sizeof(struct addrinfo));
                 if (!next) {
-                    JNU_ThrowOutOfMemoryError(env, "heap allocation failed");
+                    JNU_ThrowOutOfMemoryError(env, "Native heap allocation failed");
                     ret = NULL;
                     goto cleanupAndReturn;
                 }
@@ -465,7 +465,7 @@
                 struct addrinfo *next
                     = (struct addrinfo*) malloc(sizeof(struct addrinfo));
                 if (!next) {
-                    JNU_ThrowOutOfMemoryError(env, "heap allocation failed");
+                    JNU_ThrowOutOfMemoryError(env, "Native heap allocation failed");
                     ret = NULL;
                     goto cleanupAndReturn;
                 }
--- a/src/solaris/native/java/net/Inet6AddressImpl.c	Thu Jul 05 15:13:45 2012 -0700
+++ b/src/solaris/native/java/net/Inet6AddressImpl.c	Fri Jul 06 10:36:19 2012 +0800
@@ -267,7 +267,7 @@
                 struct addrinfo *next
                     = (struct addrinfo*) malloc(sizeof(struct addrinfo));
                 if (!next) {
-                    JNU_ThrowOutOfMemoryError(env, "heap allocation failed");
+                    JNU_ThrowOutOfMemoryError(env, "Native heap allocation failed");
                     ret = NULL;
                     goto cleanupAndReturn;
                 }
--- a/src/solaris/native/java/net/NetworkInterface.c	Thu Jul 05 15:13:45 2012 -0700
+++ b/src/solaris/native/java/net/NetworkInterface.c	Fri Jul 06 10:36:19 2012 +0800
@@ -804,7 +804,7 @@
        do{ \
         _pointer = (_type)malloc( _size ); \
         if (_pointer == NULL) { \
-            JNU_ThrowOutOfMemoryError(env, "heap allocation failed"); \
+            JNU_ThrowOutOfMemoryError(env, "Native heap allocation failed"); \
             return ifs; /* return untouched list */ \
         } \
        } while(0)
--- a/src/solaris/native/java/net/PlainDatagramSocketImpl.c	Thu Jul 05 15:13:45 2012 -0700
+++ b/src/solaris/native/java/net/PlainDatagramSocketImpl.c	Fri Jul 06 10:36:19 2012 +0800
@@ -485,7 +485,7 @@
         fullPacket = (char *)malloc(packetBufferLen);
 
         if (!fullPacket) {
-            JNU_ThrowOutOfMemoryError(env, "heap allocation failed");
+            JNU_ThrowOutOfMemoryError(env, "Send buffer native heap allocation failed");
             return;
         } else {
             mallocedPacket = JNI_TRUE;
@@ -714,7 +714,7 @@
         fullPacket = (char *)malloc(packetBufferLen);
 
         if (!fullPacket) {
-            JNU_ThrowOutOfMemoryError(env, "heap allocation failed");
+            JNU_ThrowOutOfMemoryError(env, "Peek buffer native heap allocation failed");
             return -1;
         } else {
             mallocedPacket = JNI_TRUE;
@@ -874,7 +874,7 @@
         fullPacket = (char *)malloc(packetBufferLen);
 
         if (!fullPacket) {
-            JNU_ThrowOutOfMemoryError(env, "heap allocation failed");
+            JNU_ThrowOutOfMemoryError(env, "Receive buffer native heap allocation failed");
             return;
         } else {
             mallocedPacket = JNI_TRUE;
--- a/src/windows/native/java/net/DualStackPlainDatagramSocketImpl.c	Thu Jul 05 15:13:45 2012 -0700
+++ b/src/windows/native/java/net/DualStackPlainDatagramSocketImpl.c	Fri Jul 06 10:36:19 2012 +0800
@@ -265,7 +265,7 @@
         }
         fullPacket = (char *)malloc(packetBufferLen);
         if (!fullPacket) {
-            JNU_ThrowOutOfMemoryError(env, "heap allocation failed");
+            JNU_ThrowOutOfMemoryError(env, "Native heap allocation failed");
             return -1;
         }
     } else {
@@ -427,7 +427,7 @@
         }
         fullPacket = (char *)malloc(length);
         if (!fullPacket) {
-            JNU_ThrowOutOfMemoryError(env, "heap allocation failed");
+            JNU_ThrowOutOfMemoryError(env, "Native heap allocation failed");
             return;
         }
     } else {
--- a/src/windows/native/java/net/Inet6AddressImpl.c	Thu Jul 05 15:13:45 2012 -0700
+++ b/src/windows/native/java/net/Inet6AddressImpl.c	Fri Jul 06 10:36:19 2012 +0800
@@ -197,7 +197,7 @@
                 struct addrinfo *next
                     = (struct addrinfo*) malloc(sizeof(struct addrinfo));
                 if (!next) {
-                    JNU_ThrowOutOfMemoryError(env, "heap allocation failed");
+                    JNU_ThrowOutOfMemoryError(env, "Native heap allocation failed");
                     ret = NULL;
                     goto cleanupAndReturn;
                 }
--- a/src/windows/native/java/net/NetworkInterface.c	Thu Jul 05 15:13:45 2012 -0700
+++ b/src/windows/native/java/net/NetworkInterface.c	Fri Jul 06 10:36:19 2012 +0800
@@ -270,7 +270,7 @@
             }
         }
         if (curr == NULL) {
-            JNU_ThrowOutOfMemoryError(env, "heap allocation failure");
+            JNU_ThrowOutOfMemoryError(env, "Native heap allocation failure");
             free_netif(netifP);
             free(tableP);
             return -1;
@@ -370,7 +370,7 @@
 
             netaddr *curr = (netaddr *)malloc(sizeof(netaddr));
             if (curr == NULL) {
-                JNU_ThrowOutOfMemoryError(env, "heap allocation failure");
+                JNU_ThrowOutOfMemoryError(env, "Native heap allocation failure");
                 free_netaddr(netaddrP);
                 free(tableP);
                 return -1;
--- a/src/windows/native/java/net/TwoStacksPlainDatagramSocketImpl.c	Thu Jul 05 15:13:45 2012 -0700
+++ b/src/windows/native/java/net/TwoStacksPlainDatagramSocketImpl.c	Fri Jul 06 10:36:19 2012 +0800
@@ -243,7 +243,7 @@
                                 addrList = curr;
                             }
                             LeaveCriticalSection(&sizeCheckLock);
-                            JNU_ThrowOutOfMemoryError(env, "heap allocation failed");
+                            JNU_ThrowOutOfMemoryError(env, "Native heap allocation failed");
                             return JNI_TRUE;
                         }
                         curr->addr = htonl((*addrp)->S_un.S_addr);
@@ -740,7 +740,7 @@
          */
         fullPacket = (char *)malloc(packetBufferLen);
         if (!fullPacket) {
-            JNU_ThrowOutOfMemoryError(env, "heap allocation failed");
+            JNU_ThrowOutOfMemoryError(env, "Send buf native heap allocation failed");
             return;
         }
     } else {
@@ -1003,7 +1003,7 @@
          */
         fullPacket = (char *)malloc(packetBufferLen);
         if (!fullPacket) {
-            JNU_ThrowOutOfMemoryError(env, "heap allocation failed");
+            JNU_ThrowOutOfMemoryError(env, "Native heap allocation failed");
             return -1;
         }
     } else {
@@ -1287,7 +1287,7 @@
          */
         fullPacket = (char *)malloc(packetBufferLen);
         if (!fullPacket) {
-            JNU_ThrowOutOfMemoryError(env, "heap allocation failed");
+            JNU_ThrowOutOfMemoryError(env, "Receive buf native heap allocation failed");
             return;
         }
     } else {