69 lines
1.9 KiB
Java
69 lines
1.9 KiB
Java
|
package j0.l.e.n;
|
||
|
|
||
|
import c.q.a.k.a;
|
||
|
import java.util.Iterator;
|
||
|
import sun.misc.Unsafe;
|
||
|
/* compiled from: ConcurrentCircularArrayQueue */
|
||
|
public abstract class e<E> extends f<E> {
|
||
|
public static final int i;
|
||
|
public static final long j;
|
||
|
public static final int k;
|
||
|
public final long l;
|
||
|
public final E[] m;
|
||
|
|
||
|
static {
|
||
|
int intValue = Integer.getInteger("sparse.shift", 0).intValue();
|
||
|
i = intValue;
|
||
|
Unsafe unsafe = y.a;
|
||
|
int arrayIndexScale = unsafe.arrayIndexScale(Object[].class);
|
||
|
if (4 == arrayIndexScale) {
|
||
|
k = intValue + 2;
|
||
|
} else if (8 == arrayIndexScale) {
|
||
|
k = intValue + 3;
|
||
|
} else {
|
||
|
throw new IllegalStateException("Unknown pointer size");
|
||
|
}
|
||
|
j = (long) (unsafe.arrayBaseOffset(Object[].class) + (32 << (k - intValue)));
|
||
|
}
|
||
|
|
||
|
public e(int i2) {
|
||
|
int M = a.M(i2);
|
||
|
this.l = (long) (M - 1);
|
||
|
this.m = (E[]) new Object[((M << i) + 64)];
|
||
|
}
|
||
|
|
||
|
public final long c(long j2) {
|
||
|
return j + ((j2 & this.l) << k);
|
||
|
}
|
||
|
|
||
|
@Override // java.util.AbstractQueue, java.util.AbstractCollection, java.util.Collection
|
||
|
public void clear() {
|
||
|
while (true) {
|
||
|
if (poll() == null && isEmpty()) {
|
||
|
return;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public final E d(E[] eArr, long j2) {
|
||
|
return (E) y.a.getObject(eArr, j2);
|
||
|
}
|
||
|
|
||
|
public final E e(E[] eArr, long j2) {
|
||
|
return (E) y.a.getObjectVolatile(eArr, j2);
|
||
|
}
|
||
|
|
||
|
public final void g(E[] eArr, long j2, E e) {
|
||
|
y.a.putOrderedObject(eArr, j2, e);
|
||
|
}
|
||
|
|
||
|
public final void h(E[] eArr, long j2, E e) {
|
||
|
y.a.putObject(eArr, j2, e);
|
||
|
}
|
||
|
|
||
|
@Override // java.util.AbstractCollection, java.util.Collection, java.lang.Iterable
|
||
|
public Iterator<E> iterator() {
|
||
|
throw new UnsupportedOperationException();
|
||
|
}
|
||
|
}
|