comparison src/share/vm/memory/memRegion.hpp @ 10271:f9be75d21404

8012902: remove use of global operator new - take 2 Summary: The fix of 8010992, disable use of global operator new and new[] which caused failure on some tests. This takes two of the bugs also add ALLOW_OPERATOR_NEW_USAGE to prevent crash for third party code calling operator new of jvm on certain platforms. Reviewed-by: coleenp, dholmes, zgu Contributed-by: yumin.qi@oracle.com
author minqi
date Tue, 14 May 2013 09:41:12 -0700
parents da91efe96a93
children 9758d9f36299
comparison
equal deleted inserted replaced
10269:a9270d9ecb13 10271:f9be75d21404
32 // A very simple data structure representing a contigous region 32 // A very simple data structure representing a contigous region
33 // region of address space. 33 // region of address space.
34 34
35 // Note that MemRegions are passed by value, not by reference. 35 // Note that MemRegions are passed by value, not by reference.
36 // The intent is that they remain very small and contain no 36 // The intent is that they remain very small and contain no
37 // objects. 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.
38 40
39 class MetaWord; 41 class MetaWord;
40 42
41 class MemRegion VALUE_OBJ_CLASS_SPEC { 43 class MemRegion VALUE_OBJ_CLASS_SPEC {
42 friend class VMStructs; 44 friend class VMStructs;
90 92
91 size_t byte_size() const { return _word_size * sizeof(HeapWord); } 93 size_t byte_size() const { return _word_size * sizeof(HeapWord); }
92 size_t word_size() const { return _word_size; } 94 size_t word_size() const { return _word_size; }
93 95
94 bool is_empty() const { return word_size() == 0; } 96 bool is_empty() const { return word_size() == 0; }
97 void* operator new(size_t size);
98 void* operator new [](size_t size);
99 void operator delete(void* p);
100 void operator delete [](void* p);
95 }; 101 };
96 102
97 // For iteration over MemRegion's. 103 // For iteration over MemRegion's.
98 104
99 class MemRegionClosure : public StackObj { 105 class MemRegionClosure : public StackObj {