< prev index next >

src/java.base/share/classes/java/nio/Direct-X-Buffer-bin.java.template

Print this page
rev 57242 : imported patch 8234049.patch

@@ -31,10 +31,11 @@
 
 #if[rw]
 
     private $type$ get$Type$(long a) {
         try {
+            checkSegment();
             $memtype$ x = UNSAFE.get$Memtype$Unaligned(null, a, bigEndian);
             return $fromBits$(x);
         } finally {
             Reference.reachabilityFence(this);
         }

@@ -59,10 +60,11 @@
 #end[rw]
 
     private ByteBuffer put$Type$(long a, $type$ x) {
 #if[rw]
         try {
+            checkSegment();
             $memtype$ y = $toBits$(x);
             UNSAFE.put$Memtype$Unaligned(null, a, y, bigEndian);
         } finally {
             Reference.reachabilityFence(this);
         }

@@ -102,31 +104,31 @@
                     ? ($Type$Buffer)(new ByteBufferAs$Type$Buffer$RW$B(this,
                                                                        -1,
                                                                        0,
                                                                        size,
                                                                        size,
-                                                                       address + off))
+                                                                       address + off, segment))
                     : ($Type$Buffer)(new ByteBufferAs$Type$Buffer$RW$L(this,
                                                                        -1,
                                                                        0,
                                                                        size,
                                                                        size,
-                                                                       address + off)));
+                                                                       address + off, segment)));
         } else {
             return (nativeByteOrder
                     ? ($Type$Buffer)(new Direct$Type$Buffer$RW$U(this,
                                                                  -1,
                                                                  0,
                                                                  size,
                                                                  size,
-                                                                 off))
+                                                                 off, segment))
                     : ($Type$Buffer)(new Direct$Type$Buffer$RW$S(this,
                                                                  -1,
                                                                  0,
                                                                  size,
                                                                  size,
-                                                                 off)));
+                                                                 off, segment)));
         }
     }
 
 #end
 
< prev index next >