215 |
215 |
216 bool is_in_reserved_or_null(const void* p) const { |
216 bool is_in_reserved_or_null(const void* p) const { |
217 return p == NULL || is_in_reserved(p); |
217 return p == NULL || is_in_reserved(p); |
218 } |
218 } |
219 |
219 |
220 // Returns "TRUE" if "p" points to the head of an allocated object in the |
220 // Returns "TRUE" iff "p" points into the committed areas of the heap. |
221 // heap. Since this method can be expensive in general, we restrict its |
221 // Since this method can be expensive in general, we restrict its |
222 // use to assertion checking only. |
222 // use to assertion checking only. |
223 virtual bool is_in(const void* p) const = 0; |
223 virtual bool is_in(const void* p) const = 0; |
224 |
224 |
225 bool is_in_or_null(const void* p) const { |
225 bool is_in_or_null(const void* p) const { |
226 return p == NULL || is_in(p); |
226 return p == NULL || is_in(p); |
646 // the actual number of GC worker threads is not pertinent but |
646 // the actual number of GC worker threads is not pertinent but |
647 // only whether there more than 0. Use of this method helps |
647 // only whether there more than 0. Use of this method helps |
648 // reduce the occurrence of ParallelGCThreads to uses where the |
648 // reduce the occurrence of ParallelGCThreads to uses where the |
649 // actual number may be germane. |
649 // actual number may be germane. |
650 static bool use_parallel_gc_threads() { return ParallelGCThreads > 0; } |
650 static bool use_parallel_gc_threads() { return ParallelGCThreads > 0; } |
|
651 |
|
652 /////////////// Unit tests /////////////// |
|
653 |
|
654 NOT_PRODUCT(static void test_is_in();) |
651 }; |
655 }; |
652 |
656 |
653 // Class to set and reset the GC cause for a CollectedHeap. |
657 // Class to set and reset the GC cause for a CollectedHeap. |
654 |
658 |
655 class GCCauseSetter : StackObj { |
659 class GCCauseSetter : StackObj { |