7036747: 7017009 reappeared, problem with ElfStringTable

Created new "new" operator for CHeapObj that allows malloc to fail without causing fatal error. Also replaced "HeapAllocate" with "os::malloc" in decoder code to allow decoder to handle low memory scenario.

Reviewed-by: coleenp, dholmes
This commit is contained in:
Zhengyu Gu 2011-04-27 09:09:57 -04:00
parent 3c4d3002f2
commit 865413485d
4 changed files with 20 additions and 7 deletions

View file

@ -34,6 +34,8 @@
#include "opto/c2_globals.hpp"
#endif
#include <new>
#define ARENA_ALIGN_M1 (((size_t)(ARENA_AMALLOC_ALIGNMENT)) - 1)
#define ARENA_ALIGN_MASK (~((size_t)ARENA_ALIGN_M1))
#define ARENA_ALIGN(x) ((((size_t)(x)) + ARENA_ALIGN_M1) & ARENA_ALIGN_MASK)
@ -99,6 +101,7 @@ class AllocatedObj {
class CHeapObj ALLOCATION_SUPER_CLASS_SPEC {
public:
void* operator new(size_t size);
void* operator new (size_t size, const std::nothrow_t& nothrow_constant);
void operator delete(void* p);
void* new_array(size_t size);
};