From a9a8d5d8c2fe8810f239f9946521c5ac19baa54f Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Thu, 21 Feb 2013 14:17:04 -0800 Subject: [PATCH] Clean-up --- buffer/src/main/java/io/netty/buffer/PoolArena.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/buffer/src/main/java/io/netty/buffer/PoolArena.java b/buffer/src/main/java/io/netty/buffer/PoolArena.java index ca848d16c0..c4370b9ac6 100644 --- a/buffer/src/main/java/io/netty/buffer/PoolArena.java +++ b/buffer/src/main/java/io/netty/buffer/PoolArena.java @@ -354,6 +354,9 @@ abstract class PoolArena { static final class DirectArena extends PoolArena { + private static final boolean USE_UNSAFE_DIRECTBUF = + PlatformDependent.isUnaligned() && PlatformDependent.unsafeHasCopyMethods(); + DirectArena(PooledByteBufAllocator parent, int pageSize, int maxOrder, int pageShifts, int chunkSize) { super(parent, pageSize, maxOrder, pageShifts, chunkSize); } @@ -376,7 +379,7 @@ abstract class PoolArena { @Override protected PooledByteBuf newByteBuf(int maxCapacity) { - if (PlatformDependent.isUnaligned() && PlatformDependent.unsafeHasCopyMethods()) { + if (USE_UNSAFE_DIRECTBUF) { return new PooledUnsafeDirectByteBuf(maxCapacity); } else { return new PooledDirectByteBuf(maxCapacity);