Merge
authorcoleenp
Thu, 03 Feb 2011 20:30:19 -0800
changeset 8112 77eb272084d9
parent 8111 2c4ceac9480c (diff)
parent 8110 c992c8d52344 (current diff)
child 8113 704d4d037c84
child 8114 340b5b8b544b
child 8115 1b3ccddac0ab
child 8117 6b92785fd629
Merge
hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/LowMemoryDetectorThread.java
--- a/hotspot/src/share/vm/utilities/elfSymbolTable.cpp	Wed Feb 02 14:38:01 2011 -0500
+++ b/hotspot/src/share/vm/utilities/elfSymbolTable.cpp	Thu Feb 03 20:30:19 2011 -0800
@@ -39,13 +39,14 @@
   // try to load the string table
   long cur_offset = ftell(file);
   if (cur_offset != -1) {
-    m_symbols = (Elf_Sym*)NEW_C_HEAP_ARRAY(char, shdr.sh_size);
+    // call malloc so we can back up if memory allocation fails.
+    m_symbols = (Elf_Sym*)os::malloc(shdr.sh_size);
     if (m_symbols) {
       if (fseek(file, shdr.sh_offset, SEEK_SET) ||
         fread((void*)m_symbols, shdr.sh_size, 1, file) != 1 ||
         fseek(file, cur_offset, SEEK_SET)) {
         m_status = Decoder::file_invalid;
-        FREE_C_HEAP_ARRAY(char, m_symbols);
+        os::free(m_symbols);
         m_symbols = NULL;
       }
     }
@@ -59,7 +60,7 @@
 
 ElfSymbolTable::~ElfSymbolTable() {
   if (m_symbols != NULL) {
-    FREE_C_HEAP_ARRAY(char, m_symbols);
+    os::free(m_symbols);
   }
 
   if (m_next != NULL) {