diff src/share/vm/memory/allocation.hpp @ 7434:32164d89fe9c

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
author brutisso
date Mon, 17 Dec 2012 15:25:26 +0100
parents 59c790074993
children 989155e2d07a 4102b59539ce
line wrap: on
line diff
--- a/src/share/vm/memory/allocation.hpp	Mon Dec 17 08:49:20 2012 +0100
+++ b/src/share/vm/memory/allocation.hpp	Mon Dec 17 15:25:26 2012 +0100
@@ -202,7 +202,7 @@
 // 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 @@
 // be defined as a an empty string "".
 //
 class _ValueObj {
- public:
+ private:
   void* operator new(size_t size);
   void operator delete(void* p);
 };