hotspot/src/share/vm/memory/memRegion.cpp
changeset 17376 4ee999c3c007
parent 7397 5b173b4ca846
child 19696 bd5a0131bde1
--- a/hotspot/src/share/vm/memory/memRegion.cpp	Tue May 14 11:34:30 2013 +0400
+++ b/hotspot/src/share/vm/memory/memRegion.cpp	Tue May 14 09:41:12 2013 -0700
@@ -23,6 +23,8 @@
  */
 
 #include "precompiled.hpp"
+#include "memory/allocation.hpp"
+#include "memory/allocation.inline.hpp"
 #include "memory/memRegion.hpp"
 #include "runtime/globals.hpp"
 
@@ -99,3 +101,19 @@
   ShouldNotReachHere();
   return MemRegion();
 }
+
+void* MemRegion::operator new(size_t size) {
+  return (address)AllocateHeap(size, mtGC, 0, AllocFailStrategy::RETURN_NULL);
+}
+
+void* MemRegion::operator new [](size_t size) {
+  return (address)AllocateHeap(size, mtGC, 0, AllocFailStrategy::RETURN_NULL);
+}
+void  MemRegion::operator delete(void* p) {
+  FreeHeap(p, mtGC);
+}
+
+void  MemRegion::operator delete [](void* p) {
+  FreeHeap(p, mtGC);
+}
+