mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
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:
parent
3c4d3002f2
commit
865413485d
4 changed files with 20 additions and 7 deletions
|
@ -44,6 +44,14 @@ void* CHeapObj::operator new(size_t size){
|
|||
return (void *) AllocateHeap(size, "CHeapObj-new");
|
||||
}
|
||||
|
||||
void* CHeapObj::operator new (size_t size, const std::nothrow_t& nothrow_constant) {
|
||||
char* p = (char*) os::malloc(size);
|
||||
#ifdef ASSERT
|
||||
if (PrintMallocFree) trace_heap_malloc(size, "CHeapObj-new", p);
|
||||
#endif
|
||||
return p;
|
||||
}
|
||||
|
||||
void CHeapObj::operator delete(void* p){
|
||||
FreeHeap(p);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue