-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Using ByteBufferPool instead of ByteBufferSlicePool. * Creating a profile for Java > 8 with BC as a dependency for certificate creation and an updated version of jboss logging. Signed-off-by: Emmanuel Hugonnet <[email protected]>
- Loading branch information
Showing
4 changed files
with
108 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ | |
import io.netty.buffer.AbstractByteBufAllocator; | ||
import io.netty.buffer.ByteBuf; | ||
import io.netty.util.internal.PlatformDependent; | ||
import org.xnio.ByteBufferPool; | ||
import org.xnio.ByteBufferSlicePool; | ||
|
||
/** | ||
|
@@ -28,9 +29,9 @@ | |
* @author <a href="mailto:[email protected]">Norman Maurer</a> | ||
*/ | ||
public final class XnioByteBufAllocator extends AbstractByteBufAllocator { | ||
final ByteBufferSlicePool pool; | ||
final ByteBufferPool pool; | ||
|
||
public XnioByteBufAllocator(ByteBufferSlicePool pool) { | ||
public XnioByteBufAllocator(ByteBufferPool pool) { | ||
if (pool == null) { | ||
throw new NullPointerException("pool"); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,10 +17,10 @@ | |
package org.xnio.netty.buffer; | ||
|
||
import io.netty.util.internal.PlatformDependent; | ||
import org.xnio.ByteBufferSlicePool; | ||
import org.xnio.Pooled; | ||
|
||
import java.nio.ByteBuffer; | ||
import org.xnio.ByteBufferPool; | ||
|
||
/** | ||
* @author <a href="mailto:[email protected]">Norman Maurer</a> | ||
|
@@ -31,10 +31,10 @@ private XnioByteBufUtil() { | |
// Utility | ||
} | ||
|
||
static Pooled<ByteBuffer> allocateDirect(ByteBufferSlicePool pool, int initialCapacity) { | ||
static Pooled<ByteBuffer> allocateDirect(ByteBufferPool pool, int initialCapacity) { | ||
Pooled<ByteBuffer> pooled; | ||
if (initialCapacity <= pool.getBufferSize()) { | ||
pooled = pool.allocate(); | ||
if (initialCapacity <= pool.getSize()) { | ||
pooled = new PooledByteBuf(pool.allocate()); | ||
} else { | ||
pooled = new PooledByteBuf(ByteBuffer.allocateDirect(initialCapacity)); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters