diff -r 72b2233861f1 -r 9a576749065b hotspot/src/share/vm/memory/allocation.inline.hpp --- a/hotspot/src/share/vm/memory/allocation.inline.hpp Fri Apr 19 11:08:52 2013 -0700 +++ b/hotspot/src/share/vm/memory/allocation.inline.hpp Sun Apr 21 20:41:04 2013 -0700 @@ -82,39 +82,30 @@ template void* CHeapObj::operator new(size_t size, address caller_pc){ +#ifdef ASSERT void* p = (void*)AllocateHeap(size, F, (caller_pc != 0 ? caller_pc : CALLER_PC)); -#ifdef ASSERT if (PrintMallocFree) trace_heap_malloc(size, "CHeapObj-new", p); + return p; +#else + return (void *) AllocateHeap(size, F, (caller_pc != 0 ? caller_pc : CALLER_PC)); #endif - return p; } template void* CHeapObj::operator new (size_t size, const std::nothrow_t& nothrow_constant, address caller_pc) { +#ifdef ASSERT void* p = (void*)AllocateHeap(size, F, (caller_pc != 0 ? caller_pc : CALLER_PC), AllocFailStrategy::RETURN_NULL); -#ifdef ASSERT if (PrintMallocFree) trace_heap_malloc(size, "CHeapObj-new", p); -#endif return p; -} - -template void* CHeapObj::operator new [](size_t size, - address caller_pc){ - return CHeapObj::operator new(size, caller_pc); -} - -template void* CHeapObj::operator new [](size_t size, - const std::nothrow_t& nothrow_constant, address caller_pc) { - return CHeapObj::operator new(size, nothrow_constant, caller_pc); +#else + return (void *) AllocateHeap(size, F, (caller_pc != 0 ? caller_pc : CALLER_PC), + AllocFailStrategy::RETURN_NULL); +#endif } template void CHeapObj::operator delete(void* p){ - FreeHeap(p, F); -} - -template void CHeapObj::operator delete [](void* p){ - FreeHeap(p, F); + FreeHeap(p, F); } template