equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
86 scaleOK && (byteOrder == ByteOrder.BIG_ENDIAN); |
86 scaleOK && (byteOrder == ByteOrder.BIG_ENDIAN); |
87 } |
87 } |
88 |
88 |
89 // Return whether this platform supports full speed int/long memory access |
89 // Return whether this platform supports full speed int/long memory access |
90 // at unaligned addresses. |
90 // at unaligned addresses. |
91 // This code was copied from java.nio.Bits because there is no equivalent |
|
92 // public API. |
|
93 private static boolean unaligned() { |
91 private static boolean unaligned() { |
94 String arch = java.security.AccessController.doPrivileged |
92 return unsafe.unalignedAccess(); |
95 (new sun.security.action.GetPropertyAction("os.arch", "")); |
|
96 return arch.equals("i386") || arch.equals("x86") || arch.equals("amd64") |
|
97 || arch.equals("x86_64"); |
|
98 } |
93 } |
99 |
94 |
100 /** |
95 /** |
101 * byte[] to int[] conversion, little endian byte order. |
96 * byte[] to int[] conversion, little endian byte order. |
102 */ |
97 */ |