mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 02:54:35 +02:00
8004845: Catch incorrect usage of new and delete during compile time for value objects and stack objects
Makes the "new" and "delete" operator of _ValueObj and StackObj private Reviewed-by: dholmes, coleenp
This commit is contained in:
parent
a3355065be
commit
7fc460bae3
5 changed files with 8 additions and 7 deletions
|
@ -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);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue