changeset 5400:a48da818ed65

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 cc5a750d21df
children 35c8f57c7c53
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, 15 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/src/solaris/native/java/net/Inet4AddressImpl.c	Mon Aug 20 13:16:18 2012 +0800
+++ 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;
                 }
--- a/src/solaris/native/java/net/Inet6AddressImpl.c	Mon Aug 20 13:16:18 2012 +0800
+++ b/src/solaris/native/java/net/Inet6AddressImpl.c	Fri Jul 06 10:36:19 2012 +0800
@@ -270,7 +270,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	Mon Aug 20 13:16:18 2012 +0800
+++ 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	Mon Aug 20 13:16:18 2012 +0800
+++ 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	Mon Aug 20 13:16:18 2012 +0800
+++ 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	Mon Aug 20 13:16:18 2012 +0800
+++ 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	Mon Aug 20 13:16:18 2012 +0800
+++ b/src/windows/native/java/net/NetworkInterface.c	Fri Jul 06 10:36:19 2012 +0800
@@ -266,7 +266,7 @@
             }
         }
         if (curr == NULL) {
-            JNU_ThrowOutOfMemoryError(env, "heap allocation failure");
+            JNU_ThrowOutOfMemoryError(env, "Native heap allocation failure");
             free_netif(netifP);
             free(tableP);
             return -1;
@@ -366,7 +366,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	Mon Aug 20 13:16:18 2012 +0800
+++ 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 {