Mercurial > hg > truffle
comparison src/share/vm/gc_interface/collectedHeap.hpp @ 4708:3c648b9ad052
7121373: Clean up CollectedHeap::is_in
Summary: Fixed G1CollectedHeap::is_in, added tests, cleaned up comments and made Space::is_in pure virtual.
Reviewed-by: brutisso, tonyp, jcoomes
author | stefank |
---|---|
date | Wed, 14 Dec 2011 12:15:26 +0100 |
parents | 53074c2c4600 |
children | 441e946dc1af |
comparison
equal
deleted
inserted
replaced
4132:6d7d0790074d | 4708:3c648b9ad052 |
---|---|
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 { |