2050:21e519b91576 | 2099:f8c5d1bdaad4 |
---|---|
56 } | 56 } |
57 | 57 |
58 void ResourceObj::operator delete(void* p) { | 58 void ResourceObj::operator delete(void* p) { |
59 assert(((ResourceObj *)p)->allocated_on_C_heap(), | 59 assert(((ResourceObj *)p)->allocated_on_C_heap(), |
60 "delete only allowed for C_HEAP objects"); | 60 "delete only allowed for C_HEAP objects"); |
61 DEBUG_ONLY(((ResourceObj *)p)->_allocation = badHeapOopVal;) | 61 DEBUG_ONLY(((ResourceObj *)p)->_allocation = (uintptr_t)badHeapOopVal;) |
62 FreeHeap(p); | 62 FreeHeap(p); |
63 } | 63 } |
64 | 64 |
65 #ifdef ASSERT | 65 #ifdef ASSERT |
66 void ResourceObj::set_allocation_type(address res, allocation_type type) { | 66 void ResourceObj::set_allocation_type(address res, allocation_type type) { |
102 } | 102 } |
103 | 103 |
104 ResourceObj::~ResourceObj() { | 104 ResourceObj::~ResourceObj() { |
105 // allocated_on_C_heap() also checks that encoded (in _allocation) address == this. | 105 // allocated_on_C_heap() also checks that encoded (in _allocation) address == this. |
106 if (!allocated_on_C_heap()) { // ResourceObj::delete() zaps _allocation for C_heap. | 106 if (!allocated_on_C_heap()) { // ResourceObj::delete() zaps _allocation for C_heap. |
107 _allocation = badHeapOopVal; // zap type | 107 _allocation = (uintptr_t)badHeapOopVal; // zap type |
108 } | 108 } |
109 } | 109 } |
110 #endif // ASSERT | 110 #endif // ASSERT |
111 | 111 |
112 | 112 |