Mercurial > hg > truffle
comparison src/share/vm/memory/allocation.hpp @ 2015:79d8657be916
6993125: runThese crashes with assert(Thread::current()->on_local_stack((address)this))
Summary: add another ResourceObj debug field to distinguish garbage
Reviewed-by: dholmes, coleenp
author | kvn |
---|---|
date | Fri, 10 Dec 2010 14:14:02 -0800 |
parents | f95d63e2154a |
children | f7de3327c683 |
comparison
equal
deleted
inserted
replaced
2014:4de5f4101cfd | 2015:79d8657be916 |
---|---|
335 #ifdef ASSERT | 335 #ifdef ASSERT |
336 private: | 336 private: |
337 // When this object is allocated on stack the new() operator is not | 337 // When this object is allocated on stack the new() operator is not |
338 // called but garbage on stack may look like a valid allocation_type. | 338 // called but garbage on stack may look like a valid allocation_type. |
339 // Store negated 'this' pointer when new() is called to distinguish cases. | 339 // Store negated 'this' pointer when new() is called to distinguish cases. |
340 uintptr_t _allocation; | 340 // Use second array's element for verification value to distinguish garbage. |
341 uintptr_t _allocation_t[2]; | |
342 bool is_type_set() const; | |
341 public: | 343 public: |
342 allocation_type get_allocation_type() const; | 344 allocation_type get_allocation_type() const; |
343 bool allocated_on_stack() const { return get_allocation_type() == STACK_OR_EMBEDDED; } | 345 bool allocated_on_stack() const { return get_allocation_type() == STACK_OR_EMBEDDED; } |
344 bool allocated_on_res_area() const { return get_allocation_type() == RESOURCE_AREA; } | 346 bool allocated_on_res_area() const { return get_allocation_type() == RESOURCE_AREA; } |
345 bool allocated_on_C_heap() const { return get_allocation_type() == C_HEAP; } | 347 bool allocated_on_C_heap() const { return get_allocation_type() == C_HEAP; } |