src/share/vm/memory/allocation.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 6973963 Cdiff src/share/vm/memory/allocation.cpp

src/share/vm/memory/allocation.cpp

Print this page

        

*** 41,59 **** void* ResourceObj::operator new(size_t size, allocation_type type) { address res; switch (type) { case C_HEAP: res = (address)AllocateHeap(size, "C_Heap: ResourceOBJ"); break; case RESOURCE_AREA: res = (address)operator new(size); break; default: ShouldNotReachHere(); } - // Set allocation type in the resource object for assertion checks. - DEBUG_ONLY(((ResourceObj *)res)->_allocation = type;) return res; } void ResourceObj::operator delete(void* p) { assert(((ResourceObj *)p)->allocated_on_C_heap(), --- 41,59 ---- void* ResourceObj::operator new(size_t size, allocation_type type) { address res; switch (type) { case C_HEAP: res = (address)AllocateHeap(size, "C_Heap: ResourceOBJ"); + DEBUG_ONLY(set_allocation_type(res, C_HEAP);) break; case RESOURCE_AREA: + // Will set allocation type in the resource object. res = (address)operator new(size); break; default: ShouldNotReachHere(); } return res; } void ResourceObj::operator delete(void* p) { assert(((ResourceObj *)p)->allocated_on_C_heap(),
src/share/vm/memory/allocation.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File