6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /*
25 * @test
26 * @enablePreview
27 * @run testng/othervm --enable-native-access=ALL-UNNAMED TestMemoryAccessInstance
28 */
29
30 import java.lang.foreign.MemoryLayout;
31 import java.lang.foreign.MemorySegment;
32 import java.lang.foreign.Arena;
33 import java.lang.foreign.ValueLayout;
34 import java.nio.ByteBuffer;
35 import java.nio.ByteOrder;
36
37 import org.testng.annotations.*;
38 import org.testng.SkipException;
39 import static org.testng.Assert.*;
40
41 public class TestMemoryAccessInstance {
42
43 static class Accessor<X, L extends ValueLayout> {
44
45 interface SegmentGetter<X, L> {
46 X get(MemorySegment segment, L layout, long offset);
|
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /*
25 * @test
26 * @run testng/othervm --enable-native-access=ALL-UNNAMED TestMemoryAccessInstance
27 */
28
29 import java.lang.foreign.MemoryLayout;
30 import java.lang.foreign.MemorySegment;
31 import java.lang.foreign.Arena;
32 import java.lang.foreign.ValueLayout;
33 import java.nio.ByteBuffer;
34 import java.nio.ByteOrder;
35
36 import org.testng.annotations.*;
37 import org.testng.SkipException;
38 import static org.testng.Assert.*;
39
40 public class TestMemoryAccessInstance {
41
42 static class Accessor<X, L extends ValueLayout> {
43
44 interface SegmentGetter<X, L> {
45 X get(MemorySegment segment, L layout, long offset);
|