@@ -71,7 +71,7 @@ public UnsafeDirectLittleEndian allocate(long size) {
71
71
}
72
72
73
73
public int getChunkSize () {
74
- return allocator .chunkSize ;
74
+ return allocator .chunkSize () ;
75
75
}
76
76
77
77
public long getHugeBufferSize () {
@@ -137,7 +137,6 @@ private class InnerAllocator extends PooledByteBufAllocator {
137
137
138
138
private final PoolArena <ByteBuffer >[] directArenas ;
139
139
private final MemoryStatusThread statusThread ;
140
- private final int chunkSize ;
141
140
142
141
public InnerAllocator () {
143
142
super (true );
@@ -150,8 +149,6 @@ public InnerAllocator() {
150
149
throw new RuntimeException ("Failure while initializing allocator. Unable to retrieve direct arenas field." , e );
151
150
}
152
151
153
- this .chunkSize = directArenas [0 ].chunkSize ;
154
-
155
152
if (memoryLogger .isTraceEnabled ()) {
156
153
statusThread = new MemoryStatusThread (this );
157
154
statusThread .start ();
@@ -166,7 +163,7 @@ private UnsafeDirectLittleEndian newDirectBufferL(int initialCapacity, int maxCa
166
163
167
164
if (directArena != null ) {
168
165
169
- if (initialCapacity > directArena . chunkSize ) {
166
+ if (initialCapacity > chunkSize () ) {
170
167
// This is beyond chunk size so we'll allocate separately.
171
168
ByteBuf buf = UnpooledByteBufAllocator .DEFAULT .directBuffer (initialCapacity , maxCapacity );
172
169
0 commit comments