7181353: Update error message to distinguish native OOM and java OOM in net

Reviewed-by: chegar
This commit is contained in:
Sean Chou 2012-07-06 10:36:19 +08:00
parent b28493b31b
commit e83a16fa42
8 changed files with 16 additions and 16 deletions

View file

@ -196,7 +196,7 @@ Java_java_net_Inet4AddressImpl_lookupAllHostAddr(JNIEnv *env, jobject this,
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 @@ Java_java_net_Inet4AddressImpl_lookupAllHostAddr(JNIEnv *env, jobject this,
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;
}

View file

@ -267,7 +267,7 @@ Java_java_net_Inet6AddressImpl_lookupAllHostAddr(JNIEnv *env, jobject this,
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;
}

View file

@ -804,7 +804,7 @@ static netif *enumInterfaces(JNIEnv *env) {
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)

View file

@ -485,7 +485,7 @@ Java_java_net_PlainDatagramSocketImpl_send(JNIEnv *env, jobject this,
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 @@ Java_java_net_PlainDatagramSocketImpl_peekData(JNIEnv *env, jobject this,
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 @@ Java_java_net_PlainDatagramSocketImpl_receive0(JNIEnv *env, jobject this,
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;

View file

@ -265,7 +265,7 @@ JNIEXPORT jint JNICALL Java_java_net_DualStackPlainDatagramSocketImpl_socketRece
}
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 @@ JNIEXPORT void JNICALL Java_java_net_DualStackPlainDatagramSocketImpl_socketSend
}
fullPacket = (char *)malloc(length);
if (!fullPacket) {
JNU_ThrowOutOfMemoryError(env, "heap allocation failed");
JNU_ThrowOutOfMemoryError(env, "Native heap allocation failed");
return;
}
} else {

View file

@ -197,7 +197,7 @@ Java_java_net_Inet6AddressImpl_lookupAllHostAddr(JNIEnv *env, jobject this,
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;
}

View file

@ -270,7 +270,7 @@ int enumInterfaces(JNIEnv *env, netif **netifPP)
}
}
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 @@ int enumAddresses_win(JNIEnv *env, netif *netifP, netaddr **netaddrPP)
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;

View file

@ -243,7 +243,7 @@ jboolean exceedSizeLimit(JNIEnv *env, jint fd, jint addr, jint size)
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 @@ Java_java_net_TwoStacksPlainDatagramSocketImpl_send(JNIEnv *env, jobject this,
*/
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 @@ Java_java_net_TwoStacksPlainDatagramSocketImpl_peekData(JNIEnv *env, jobject thi
*/
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 @@ Java_java_net_TwoStacksPlainDatagramSocketImpl_receive0(JNIEnv *env, jobject thi
*/
fullPacket = (char *)malloc(packetBufferLen);
if (!fullPacket) {
JNU_ThrowOutOfMemoryError(env, "heap allocation failed");
JNU_ThrowOutOfMemoryError(env, "Receive buf native heap allocation failed");
return;
}
} else {