589 uintptr_t epsilon = (uintptr_t) MinObjAlignment; 590 uintptr_t heap_start = (uintptr_t) heap->_reserved.start(); 591 uintptr_t heap_end = (uintptr_t) heap->_reserved.end(); 592 593 // Test that NULL is not in the heap. 594 assert(!heap->is_in(NULL), "NULL is unexpectedly in the heap"); 595 596 // Test that a pointer to before the heap start is reported as outside the heap. 597 assert(heap_start >= ((uintptr_t)NULL + epsilon), "sanity"); 598 void* before_heap = (void*)(heap_start - epsilon); 599 assert(!heap->is_in(before_heap), 600 err_msg("before_heap: " PTR_FORMAT " is unexpectedly in the heap", p2i(before_heap))); 601 602 // Test that a pointer to after the heap end is reported as outside the heap. 603 assert(heap_end <= ((uintptr_t)-1 - epsilon), "sanity"); 604 void* after_heap = (void*)(heap_end + epsilon); 605 assert(!heap->is_in(after_heap), 606 err_msg("after_heap: " PTR_FORMAT " is unexpectedly in the heap", p2i(after_heap))); 607 } 608 #endif | 589 uintptr_t epsilon = (uintptr_t) MinObjAlignment; 590 uintptr_t heap_start = (uintptr_t) heap->_reserved.start(); 591 uintptr_t heap_end = (uintptr_t) heap->_reserved.end(); 592 593 // Test that NULL is not in the heap. 594 assert(!heap->is_in(NULL), "NULL is unexpectedly in the heap"); 595 596 // Test that a pointer to before the heap start is reported as outside the heap. 597 assert(heap_start >= ((uintptr_t)NULL + epsilon), "sanity"); 598 void* before_heap = (void*)(heap_start - epsilon); 599 assert(!heap->is_in(before_heap), 600 err_msg("before_heap: " PTR_FORMAT " is unexpectedly in the heap", p2i(before_heap))); 601 602 // Test that a pointer to after the heap end is reported as outside the heap. 603 assert(heap_end <= ((uintptr_t)-1 - epsilon), "sanity"); 604 void* after_heap = (void*)(heap_end + epsilon); 605 assert(!heap->is_in(after_heap), 606 err_msg("after_heap: " PTR_FORMAT " is unexpectedly in the heap", p2i(after_heap))); 607 } 608 #endif 609 610 void CollectedHeap::shutdown() { 611 // Default implementation does nothing. 612 } 613 614 void CollectedHeap::accumulate_statistics_all_gclabs() { 615 // Default implementation does nothing. 616 } 617 618 bool CollectedHeap::supports_object_pinning() const { 619 return false; 620 } 621 622 oop CollectedHeap::pin_object(JavaThread* thread, oop obj) { 623 ShouldNotReachHere(); 624 return NULL; 625 } 626 627 void CollectedHeap::unpin_object(JavaThread* thread, oop obj) { 628 ShouldNotReachHere(); 629 } |