本文整理了Java中sun.misc.Unsafe.getInt()
方法的一些代码示例,展示了Unsafe.getInt()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Unsafe.getInt()
方法的具体详情如下:
包路径:sun.misc.Unsafe
类名称:Unsafe
方法名:getInt
[英]This method, like all others with 32-bit offsets, was native in a previous release but is now a wrapper which simply casts the offset to a long value. It provides backward compatibility with bytecodes compiled against 1.4.
[中]与所有其他32位偏移量的方法一样,这个方法在以前的版本中是原生的,但现在是一个包装器,它只是将偏移量强制转换为长值。它提供了与根据1.4编译的字节码的向后兼容性。
代码示例来源:origin: com.koloboke/koloboke-impl-jdk8
public int setHashCode() {
int hashCode = 0;
int mc = modCount();
long[] tab = table;
long base = LONG_BASE + FLOAT_KEY_OFFSET;
for (long off = ((long) tab.length) << LONG_SCALE_SHIFT; (off -= LONG_SCALE) >= 0L;) {
int key;
if ((key = U.getInt(tab, base + off)) < FREE_BITS) {
hashCode += key;
}
}
if (mc != modCount())
throw new java.util.ConcurrentModificationException();
return hashCode;
}
代码示例来源:origin: com.koloboke/koloboke-impl-jdk8
public int setHashCode() {
int hashCode = 0;
int mc = modCount();
long[] tab = table;
long base = LONG_BASE + FLOAT_KEY_OFFSET;
for (long off = ((long) tab.length) << LONG_SCALE_SHIFT; (off -= LONG_SCALE) >= 0L;) {
int key;
if ((key = U.getInt(tab, base + off)) < FREE_BITS) {
hashCode += key;
}
}
if (mc != modCount())
throw new java.util.ConcurrentModificationException();
return hashCode;
}
代码示例来源:origin: net.openhft/koloboke-impl-jdk8
public int setHashCode() {
int hashCode = 0;
int mc = modCount();
long[] tab = table;
long base = LONG_BASE + FLOAT_KEY_OFFSET;
for (long off = ((long) tab.length) << LONG_SCALE_SHIFT; (off -= LONG_SCALE) >= 0L;) {
int key;
if ((key = U.getInt(tab, base + off)) < FREE_BITS) {
hashCode += key;
}
}
if (mc != modCount())
throw new java.util.ConcurrentModificationException();
return hashCode;
}
代码示例来源:origin: net.openhft/koloboke-impl-jdk6-7
public int setHashCode() {
int hashCode = 0;
int mc = modCount();
long[] tab = table;
long base = LONG_BASE + FLOAT_KEY_OFFSET;
for (long off = ((long) tab.length) << LONG_SCALE_SHIFT; (off -= LONG_SCALE) >= 0L;) {
int key;
if ((key = U.getInt(tab, base + off)) < FREE_BITS) {
hashCode += key;
}
}
if (mc != modCount())
throw new java.util.ConcurrentModificationException();
return hashCode;
}
代码示例来源:origin: net.openhft/koloboke-impl-jdk6-7
public int setHashCode() {
int hashCode = 0;
int mc = modCount();
long[] tab = table;
long base = LONG_BASE + FLOAT_KEY_OFFSET;
for (long off = ((long) tab.length) << LONG_SCALE_SHIFT; (off -= LONG_SCALE) >= 0L;) {
int key;
if ((key = U.getInt(tab, base + off)) < FREE_BITS) {
hashCode += key;
}
}
if (mc != modCount())
throw new java.util.ConcurrentModificationException();
return hashCode;
}
代码示例来源:origin: net.openhft/koloboke-impl-jdk8
public int setHashCode() {
int hashCode = 0;
int mc = modCount();
long[] tab = table;
long base = LONG_BASE + FLOAT_KEY_OFFSET;
for (long off = ((long) tab.length) << LONG_SCALE_SHIFT; (off -= LONG_SCALE) >= 0L;) {
int key;
if ((key = U.getInt(tab, base + off)) < FREE_BITS) {
hashCode += key;
}
}
if (mc != modCount())
throw new java.util.ConcurrentModificationException();
return hashCode;
}
代码示例来源:origin: com.koloboke/koloboke-impl-jdk6-7
public int setHashCode() {
int hashCode = 0;
int mc = modCount();
long[] tab = table;
long base = LONG_BASE + FLOAT_KEY_OFFSET;
for (long off = ((long) tab.length) << LONG_SCALE_SHIFT; (off -= LONG_SCALE) >= 0L;) {
int key;
if ((key = U.getInt(tab, base + off)) < FREE_BITS) {
hashCode += key;
}
}
if (mc != modCount())
throw new java.util.ConcurrentModificationException();
return hashCode;
}
代码示例来源:origin: com.koloboke/koloboke-impl-jdk6-7
public int setHashCode() {
int hashCode = 0;
int mc = modCount();
long[] tab = table;
long base = LONG_BASE + FLOAT_KEY_OFFSET;
for (long off = ((long) tab.length) << LONG_SCALE_SHIFT; (off -= LONG_SCALE) >= 0L;) {
int key;
if ((key = U.getInt(tab, base + off)) < FREE_BITS) {
hashCode += key;
}
}
if (mc != modCount())
throw new java.util.ConcurrentModificationException();
return hashCode;
}
代码示例来源:origin: com.koloboke/koloboke-impl-jdk6-7
public int setHashCode() {
int hashCode = 0;
int mc = modCount();
long[] tab = table;
long base = LONG_BASE + FLOAT_KEY_OFFSET;
for (long off = ((long) tab.length) << LONG_SCALE_SHIFT; (off -= LONG_SCALE) >= 0L;) {
int key;
if ((key = U.getInt(tab, base + off)) < FREE_BITS) {
hashCode += key;
}
}
if (mc != modCount())
throw new java.util.ConcurrentModificationException();
return hashCode;
}
代码示例来源:origin: com.koloboke/koloboke-impl-jdk8
public int setHashCode() {
int hashCode = 0;
int mc = modCount();
long[] tab = table;
long base = LONG_BASE + FLOAT_KEY_OFFSET;
for (long off = ((long) tab.length) << LONG_SCALE_SHIFT; (off -= LONG_SCALE) >= 0L;) {
int key;
if ((key = U.getInt(tab, base + off)) < FREE_BITS) {
hashCode += key;
}
}
if (mc != modCount())
throw new java.util.ConcurrentModificationException();
return hashCode;
}
代码示例来源:origin: net.openhft/koloboke-impl-jdk8
public int setHashCode() {
int hashCode = 0;
int mc = modCount();
long[] tab = table;
long base = LONG_BASE + FLOAT_KEY_OFFSET;
for (long off = ((long) tab.length) << LONG_SCALE_SHIFT; (off -= LONG_SCALE) >= 0L;) {
int key;
if ((key = U.getInt(tab, base + off)) < FREE_BITS) {
hashCode += key;
}
}
if (mc != modCount())
throw new java.util.ConcurrentModificationException();
return hashCode;
}
代码示例来源:origin: com.koloboke/koloboke-impl-jdk6-7
public int setHashCode() {
int hashCode = 0;
int mc = modCount();
long[] tab = table;
long base = LONG_BASE + FLOAT_KEY_OFFSET;
for (long off = ((long) tab.length) << LONG_SCALE_SHIFT; (off -= LONG_SCALE) >= 0L;) {
int key;
if ((key = U.getInt(tab, base + off)) < FREE_BITS) {
hashCode += key;
}
}
if (mc != modCount())
throw new java.util.ConcurrentModificationException();
return hashCode;
}
代码示例来源:origin: net.openhft/koloboke-impl-jdk6-7
public int setHashCode() {
int hashCode = 0;
int mc = modCount();
long[] tab = table;
long base = LONG_BASE + FLOAT_KEY_OFFSET;
for (long off = ((long) tab.length) << LONG_SCALE_SHIFT; (off -= LONG_SCALE) >= 0L;) {
int key;
if ((key = U.getInt(tab, base + off)) < FREE_BITS) {
hashCode += key;
}
}
if (mc != modCount())
throw new java.util.ConcurrentModificationException();
return hashCode;
}
代码示例来源:origin: net.openhft/koloboke-impl-jdk6-7
public int setHashCode() {
int hashCode = 0;
int mc = modCount();
long[] tab = table;
long base = LONG_BASE + FLOAT_KEY_OFFSET;
for (long off = ((long) tab.length) << LONG_SCALE_SHIFT; (off -= LONG_SCALE) >= 0L;) {
int key;
if ((key = U.getInt(tab, base + off)) < FREE_BITS) {
hashCode += key;
}
}
if (mc != modCount())
throw new java.util.ConcurrentModificationException();
return hashCode;
}
代码示例来源:origin: com.koloboke/koloboke-impl-jdk8
public int setHashCode() {
int hashCode = 0;
int mc = modCount();
int free = freeValue;
long[] tab = table;
long base = LONG_BASE + INT_KEY_OFFSET;
for (long off = ((long) tab.length) << LONG_SCALE_SHIFT; (off -= LONG_SCALE) >= 0L;) {
int key;
if ((key = U.getInt(tab, base + off)) != free) {
hashCode += key;
}
}
if (mc != modCount())
throw new java.util.ConcurrentModificationException();
return hashCode;
}
代码示例来源:origin: com.koloboke/koloboke-impl-jdk8
public int setHashCode() {
int hashCode = 0;
int mc = modCount();
int free = freeValue;
long[] tab = table;
long base = LONG_BASE + INT_KEY_OFFSET;
for (long off = ((long) tab.length) << LONG_SCALE_SHIFT; (off -= LONG_SCALE) >= 0L;) {
int key;
if ((key = U.getInt(tab, base + off)) != free) {
hashCode += key;
}
}
if (mc != modCount())
throw new java.util.ConcurrentModificationException();
return hashCode;
}
代码示例来源:origin: net.openhft/koloboke-impl-jdk6-7
public int setHashCode() {
int hashCode = 0;
int mc = modCount();
int free = freeValue;
long[] tab = table;
long base = LONG_BASE + INT_KEY_OFFSET;
for (long off = ((long) tab.length) << LONG_SCALE_SHIFT; (off -= LONG_SCALE) >= 0L;) {
int key;
if ((key = U.getInt(tab, base + off)) != free) {
hashCode += key;
}
}
if (mc != modCount())
throw new java.util.ConcurrentModificationException();
return hashCode;
}
代码示例来源:origin: net.openhft/koloboke-impl-jdk8
public int setHashCode() {
int hashCode = 0;
int mc = modCount();
int free = freeValue;
long[] tab = table;
long base = LONG_BASE + INT_KEY_OFFSET;
for (long off = ((long) tab.length) << LONG_SCALE_SHIFT; (off -= LONG_SCALE) >= 0L;) {
int key;
if ((key = U.getInt(tab, base + off)) != free) {
hashCode += key;
}
}
if (mc != modCount())
throw new java.util.ConcurrentModificationException();
return hashCode;
}
代码示例来源:origin: net.openhft/koloboke-impl-jdk8
public int setHashCode() {
int hashCode = 0;
int mc = modCount();
int free = freeValue;
long[] tab = table;
long base = LONG_BASE + INT_KEY_OFFSET;
for (long off = ((long) tab.length) << LONG_SCALE_SHIFT; (off -= LONG_SCALE) >= 0L;) {
int key;
if ((key = U.getInt(tab, base + off)) != free) {
hashCode += key;
}
}
if (mc != modCount())
throw new java.util.ConcurrentModificationException();
return hashCode;
}
代码示例来源:origin: net.openhft/koloboke-impl-jdk6-7
public int setHashCode() {
int hashCode = 0;
int mc = modCount();
int free = freeValue;
long[] tab = table;
long base = LONG_BASE + INT_KEY_OFFSET;
for (long off = ((long) tab.length) << LONG_SCALE_SHIFT; (off -= LONG_SCALE) >= 0L;) {
int key;
if ((key = U.getInt(tab, base + off)) != free) {
hashCode += key;
}
}
if (mc != modCount())
throw new java.util.ConcurrentModificationException();
return hashCode;
}
内容来源于网络,如有侵权,请联系作者删除!