--- old/src/share/vm/memory/allocation.cpp Mon Aug 2 14:26:19 2010 +++ new/src/share/vm/memory/allocation.cpp Mon Aug 2 14:26:19 2010 @@ -43,15 +43,15 @@ 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(); } - // Set allocation type in the resource object for assertion checks. - DEBUG_ONLY(((ResourceObj *)res)->_allocation = type;) return res; }