Remove padding utility classes

- It's not used anywhere
This commit is contained in:
Trustin Lee 2014-06-21 17:59:20 +09:00
parent f44720850c
commit cdaeb54fb9
4 changed files with 0 additions and 152 deletions

View File

@ -1,24 +0,0 @@
/*
* Copyright 2014 The Netty Project
*
* The Netty Project licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.util.internal;
public final class FullyPaddedReference<T> extends LeftPaddedReference<T> {
private static final long serialVersionUID = -5986650399506826641L;
// cache line padding (must be public)
public transient long rp1, rp2, rp3, rp4, rp5, rp6, rp7; // 56 bytes (excluding LeftPaddedReference.referent)
public transient long rpA, rpB, rpC, rpD, rpE, rpF, rpG, rpH; // 64 bytes
}

View File

@ -1,69 +0,0 @@
/*
* Copyright 2014 The Netty Project
*
* The Netty Project licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.util.internal;
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
abstract class LeftPaddedReference<T> extends LeftPadding {
private static final long serialVersionUID = 6513142711280243198L;
@SuppressWarnings("rawtypes")
private static final AtomicReferenceFieldUpdater<LeftPaddedReference, Object> referentUpdater;
static {
@SuppressWarnings("rawtypes")
AtomicReferenceFieldUpdater<LeftPaddedReference, Object> u;
u = PlatformDependent.newAtomicReferenceFieldUpdater(LeftPaddedReference.class, "referent");
if (u == null) {
u = AtomicReferenceFieldUpdater.newUpdater(LeftPaddedReference.class, Object.class, "referent");
}
referentUpdater = u;
}
private volatile T referent; // 8-byte object field (or 4-byte + padding)
public final T get() {
return referent;
}
public final void set(T referent) {
this.referent = referent;
}
public final void lazySet(T referent) {
referentUpdater.lazySet(this, referent);
}
public final boolean compareAndSet(T expect, T update) {
return referentUpdater.compareAndSet(this, expect, update);
}
public final boolean weakCompareAndSet(T expect, T update) {
return referentUpdater.weakCompareAndSet(this, expect, update);
}
@SuppressWarnings("unchecked")
public final T getAndSet(T referent) {
return (T) referentUpdater.getAndSet(this, referent);
}
@Override
public String toString() {
return String.valueOf(get());
}
}

View File

@ -1,26 +0,0 @@
/*
* Copyright 2014 The Netty Project
*
* The Netty Project licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.util.internal;
import java.io.Serializable;
abstract class LeftPadding implements Serializable {
private static final long serialVersionUID = -9129166504419549394L;
// cache line padding (must be public)
public transient long lp1, lp2, lp3, lp4, lp5, lp6; // 48 bytes (excluding 16-byte object header)
public transient long lpA, lpB, lpC, lpD, lpE, lpF, lpG, lpH; // 64 bytes
}

View File

@ -1,33 +0,0 @@
/*
* Copyright 2014 The Netty Project
*
* The Netty Project licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.util.internal;
import java.util.concurrent.atomic.AtomicReference;
public final class RightPaddedReference<T> extends AtomicReference<T> {
private static final long serialVersionUID = -467619563034125237L;
// cache line padding (must be public)
public transient long rp1, rp2, rp3, rp4, rp5; // 40 bytes (excluding AtomicReference.value and object header)
public transient long rpA, rpB, rpC, rpD, rpE, rpF, rpG, rpH; // 64 bytes
public RightPaddedReference() { }
public RightPaddedReference(T initialValue) {
super(initialValue);
}
}