diff --git a/common/src/main/java/io/netty/util/internal/FullyPaddedReference.java b/common/src/main/java/io/netty/util/internal/FullyPaddedReference.java deleted file mode 100644 index ccc478eef8..0000000000 --- a/common/src/main/java/io/netty/util/internal/FullyPaddedReference.java +++ /dev/null @@ -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 extends LeftPaddedReference { - 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 -} diff --git a/common/src/main/java/io/netty/util/internal/LeftPaddedReference.java b/common/src/main/java/io/netty/util/internal/LeftPaddedReference.java deleted file mode 100644 index 6e50ba248d..0000000000 --- a/common/src/main/java/io/netty/util/internal/LeftPaddedReference.java +++ /dev/null @@ -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 extends LeftPadding { - - private static final long serialVersionUID = 6513142711280243198L; - - @SuppressWarnings("rawtypes") - private static final AtomicReferenceFieldUpdater referentUpdater; - - static { - @SuppressWarnings("rawtypes") - AtomicReferenceFieldUpdater 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()); - } -} diff --git a/common/src/main/java/io/netty/util/internal/LeftPadding.java b/common/src/main/java/io/netty/util/internal/LeftPadding.java deleted file mode 100644 index 196108dfc1..0000000000 --- a/common/src/main/java/io/netty/util/internal/LeftPadding.java +++ /dev/null @@ -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 -} diff --git a/common/src/main/java/io/netty/util/internal/RightPaddedReference.java b/common/src/main/java/io/netty/util/internal/RightPaddedReference.java deleted file mode 100644 index 7f667e23a6..0000000000 --- a/common/src/main/java/io/netty/util/internal/RightPaddedReference.java +++ /dev/null @@ -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 extends AtomicReference { - 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); - } -}