提交 f9f7d210 编写于 作者: B brutisso

8004845: Catch incorrect usage of new and delete during compile time for value...

8004845: Catch incorrect usage of new and delete during compile time for value objects and stack objects
Summary: Makes the "new" and "delete" operator of _ValueObj and StackObj private
Reviewed-by: dholmes, coleenp
Contributed-by: erik.helin@oracle.com
上级 2e15df11
......@@ -202,7 +202,7 @@ template <MEMFLAGS F> class CHeapObj ALLOCATION_SUPER_CLASS_SPEC {
// Calling new or delete will result in fatal error.
class StackObj ALLOCATION_SUPER_CLASS_SPEC {
public:
private:
void* operator new(size_t size);
void operator delete(void* p);
};
......@@ -226,7 +226,7 @@ class StackObj ALLOCATION_SUPER_CLASS_SPEC {
// be defined as a an empty string "".
//
class _ValueObj {
public:
private:
void* operator new(size_t size);
void operator delete(void* p);
};
......
......@@ -1839,15 +1839,16 @@ uint Node::match_edge(uint idx) const {
return idx; // True for other than index 0 (control)
}
static RegMask _not_used_at_all;
// Register classes are defined for specific machines
const RegMask &Node::out_RegMask() const {
ShouldNotCallThis();
return *(new RegMask());
return _not_used_at_all;
}
const RegMask &Node::in_RegMask(uint) const {
ShouldNotCallThis();
return *(new RegMask());
return _not_used_at_all;
}
//=============================================================================
......
......@@ -334,7 +334,7 @@ class MemBaseline : public _ValueObj {
// create a memory baseline
MemBaseline();
virtual ~MemBaseline();
~MemBaseline();
inline bool baselined() const {
return _baselined;
......
......@@ -90,7 +90,7 @@ protected:
NOT_PRODUCT(_name = name);
_counter = 0;
}
virtual ~AbstractGangTask() { }
~AbstractGangTask() { }
public:
};
......
......@@ -106,7 +106,7 @@ protected:
_status(INACTIVE),
_gang(NULL) { }
virtual ~YieldingFlexibleGangTask() { }
~YieldingFlexibleGangTask() { }
friend class YieldingFlexibleWorkGang;
friend class YieldingFlexibleGangWorker;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册