hotspot/src/share/vm/memory/allocation.inline.hpp
changeset 17031 9a576749065b
parent 17026 72b2233861f1
child 17087 f0b76c4c93a0
--- a/hotspot/src/share/vm/memory/allocation.inline.hpp	Fri Apr 19 11:08:52 2013 -0700
+++ b/hotspot/src/share/vm/memory/allocation.inline.hpp	Sun Apr 21 20:41:04 2013 -0700
@@ -82,39 +82,30 @@
 
 template <MEMFLAGS F> void* CHeapObj<F>::operator new(size_t size,
       address caller_pc){
+#ifdef ASSERT
     void* p = (void*)AllocateHeap(size, F, (caller_pc != 0 ? caller_pc : CALLER_PC));
-#ifdef ASSERT
     if (PrintMallocFree) trace_heap_malloc(size, "CHeapObj-new", p);
+    return p;
+#else
+    return (void *) AllocateHeap(size, F, (caller_pc != 0 ? caller_pc : CALLER_PC));
 #endif
-    return p;
   }
 
 template <MEMFLAGS F> void* CHeapObj<F>::operator new (size_t size,
   const std::nothrow_t&  nothrow_constant, address caller_pc) {
+#ifdef ASSERT
   void* p = (void*)AllocateHeap(size, F, (caller_pc != 0 ? caller_pc : CALLER_PC),
       AllocFailStrategy::RETURN_NULL);
-#ifdef ASSERT
     if (PrintMallocFree) trace_heap_malloc(size, "CHeapObj-new", p);
-#endif
     return p;
-}
-
-template <MEMFLAGS F> void* CHeapObj<F>::operator new [](size_t size,
-      address caller_pc){
-    return CHeapObj<F>::operator new(size, caller_pc);
-}
-
-template <MEMFLAGS F> void* CHeapObj<F>::operator new [](size_t size,
-  const std::nothrow_t&  nothrow_constant, address caller_pc) {
-    return CHeapObj<F>::operator new(size, nothrow_constant, caller_pc);
+#else
+  return (void *) AllocateHeap(size, F, (caller_pc != 0 ? caller_pc : CALLER_PC),
+      AllocFailStrategy::RETURN_NULL);
+#endif
 }
 
 template <MEMFLAGS F> void CHeapObj<F>::operator delete(void* p){
-    FreeHeap(p, F);
-}
-
-template <MEMFLAGS F> void CHeapObj<F>::operator delete [](void* p){
-    FreeHeap(p, F);
+   FreeHeap(p, F);
 }
 
 template <class E, MEMFLAGS F>