8218192: Remove copy constructor for MemRegion
authormanc
Tue, 05 Feb 2019 08:20:09 -0800
changeset 53758 026e1ea616c8
parent 53757 e31f39e088b7
child 53759 e16b61a1395e
8218192: Remove copy constructor for MemRegion Summary: Remove copy constructor in memRegion.hpp Reviewed-by: tschatzl, kbarrett
src/hotspot/share/memory/memRegion.hpp
--- a/src/hotspot/share/memory/memRegion.hpp	Thu Feb 14 19:48:57 2019 +0100
+++ b/src/hotspot/share/memory/memRegion.hpp	Tue Feb 05 08:20:09 2019 -0800
@@ -34,7 +34,9 @@
 
 // Note that MemRegions are passed by value, not by reference.
 // The intent is that they remain very small and contain no
-// objects. These should never be allocated in heap but we do
+// objects. The copy constructor and destructor must be trivial,
+// to support optimization for pass-by-value.
+// These should never be allocated in heap but we do
 // create MemRegions (in CardTableBarrierSet) in heap so operator
 // new and operator new [] added for this special case.
 
@@ -59,8 +61,6 @@
     assert(end >= start, "incorrect constructor arguments");
   }
 
-  MemRegion(const MemRegion& mr): _start(mr._start), _word_size(mr._word_size) {}
-
   MemRegion intersection(const MemRegion mr2) const;
   // regions must overlap or be adjacent
   MemRegion _union(const MemRegion mr2) const;