Mercurial > hg > truffle
diff src/share/vm/runtime/vmStructs.cpp @ 10130:6f817ce50129
8010992: Remove calls to global ::operator new[] and new
Summary: disable use of global operator new and new[] which could cause unexpected exception and escape from NMT tracking.
Reviewed-by: coleenp, dholmes, zgu
Contributed-by: yumin.qi@oracle.com
author | minqi |
---|---|
date | Fri, 19 Apr 2013 11:08:52 -0700 |
parents | 8617e38bb4cb |
children | 5b6512efcdc4 5a9fa2ba85f0 |
line wrap: on
line diff
--- a/src/share/vm/runtime/vmStructs.cpp Thu Apr 18 14:03:37 2013 -0400 +++ b/src/share/vm/runtime/vmStructs.cpp Fri Apr 19 11:08:52 2013 -0700 @@ -3116,15 +3116,15 @@ // Search for the base type by peeling off const and * size_t len = strlen(typeName); if (typeName[len-1] == '*') { - char * s = new char[len]; + char * s = NEW_C_HEAP_ARRAY(char, len, mtInternal); strncpy(s, typeName, len - 1); s[len-1] = '\0'; // tty->print_cr("checking \"%s\" for \"%s\"", s, typeName); if (recursiveFindType(origtypes, s, true) == 1) { - delete [] s; + FREE_C_HEAP_ARRAY(char, s, mtInternal); return 1; } - delete [] s; + FREE_C_HEAP_ARRAY(char, s, mtInternal); } const char* start = NULL; if (strstr(typeName, "GrowableArray<") == typeName) { @@ -3135,15 +3135,15 @@ if (start != NULL) { const char * end = strrchr(typeName, '>'); int len = end - start + 1; - char * s = new char[len]; + char * s = NEW_C_HEAP_ARRAY(char, len, mtInternal); strncpy(s, start, len - 1); s[len-1] = '\0'; // tty->print_cr("checking \"%s\" for \"%s\"", s, typeName); if (recursiveFindType(origtypes, s, true) == 1) { - delete [] s; + FREE_C_HEAP_ARRAY(char, s, mtInternal); return 1; } - delete [] s; + FREE_C_HEAP_ARRAY(char, s, mtInternal); } if (strstr(typeName, "const ") == typeName) { const char * s = typeName + strlen("const ");