17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_MEMORY_MEMREGION_HPP
26 #define SHARE_VM_MEMORY_MEMREGION_HPP
27
28 #include "memory/allocation.hpp"
29 #include "utilities/debug.hpp"
30 #include "utilities/globalDefinitions.hpp"
31
32 // A very simple data structure representing a contigous region
33 // region of address space.
34
35 // Note that MemRegions are passed by value, not by reference.
36 // The intent is that they remain very small and contain no
37 // objects. _ValueObj should never be allocated in heap but we do
38 // create MemRegions (in CardTableModRefBS) in heap so operator
39 // new and operator new [] added for this special case.
40
41 class MetaWord;
42
43 class MemRegion {
44 friend class VMStructs;
45 private:
46 HeapWord* _start;
47 size_t _word_size;
48
49 public:
50 MemRegion() : _start(NULL), _word_size(0) {};
51 MemRegion(HeapWord* start, size_t word_size) :
52 _start(start), _word_size(word_size) {};
53 MemRegion(HeapWord* start, HeapWord* end) :
54 _start(start), _word_size(pointer_delta(end, start)) {
55 assert(end >= start, "incorrect constructor arguments");
56 }
57 MemRegion(MetaWord* start, MetaWord* end) :
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_MEMORY_MEMREGION_HPP
26 #define SHARE_VM_MEMORY_MEMREGION_HPP
27
28 #include "memory/allocation.hpp"
29 #include "utilities/debug.hpp"
30 #include "utilities/globalDefinitions.hpp"
31
32 // A very simple data structure representing a contigous region
33 // region of address space.
34
35 // Note that MemRegions are passed by value, not by reference.
36 // The intent is that they remain very small and contain no
37 // objects. These should never be allocated in heap but we do
38 // create MemRegions (in CardTableModRefBS) in heap so operator
39 // new and operator new [] added for this special case.
40
41 class MetaWord;
42
43 class MemRegion {
44 friend class VMStructs;
45 private:
46 HeapWord* _start;
47 size_t _word_size;
48
49 public:
50 MemRegion() : _start(NULL), _word_size(0) {};
51 MemRegion(HeapWord* start, size_t word_size) :
52 _start(start), _word_size(word_size) {};
53 MemRegion(HeapWord* start, HeapWord* end) :
54 _start(start), _word_size(pointer_delta(end, start)) {
55 assert(end >= start, "incorrect constructor arguments");
56 }
57 MemRegion(MetaWord* start, MetaWord* end) :
|