This commit is contained in:
Clebert Suconic 2017-08-09 15:20:49 -04:00
commit 687e318d0e
3 changed files with 8 additions and 2 deletions

View File

@ -36,6 +36,7 @@
<bundle>mvn:io.netty/netty-codec/${netty.version}</bundle>
<bundle>mvn:io.netty/netty-handler/${netty.version}</bundle>
<bundle>mvn:io.netty/netty-transport-native-epoll/${netty.version}</bundle>
<bundle>mvn:io.netty/netty-transport-native-unix-common/${netty.version}</bundle>
</feature>
<feature name="artemis-core" version="${pom.version}" description="ActiveMQ Artemis broker libraries">

View File

@ -36,6 +36,7 @@ import io.netty.util.internal.PlatformDependent;
*/
public final class UnpooledUnsafeDirectByteBufWrapper extends AbstractReferenceCountedByteBuf {
private static final byte ZERO = 0;
private ByteBuffer buffer;
private int arrayOffset;
private byte[] array;
@ -563,7 +564,11 @@ public final class UnpooledUnsafeDirectByteBufWrapper extends AbstractReferenceC
@Override
public ByteBuf setZero(int index, int length) {
if (hasMemoryAddress()) {
UnsafeByteBufUtil.setZero(this, addr(index), index, length);
if (length == 0) {
return this;
}
this.checkIndex(index, length);
PlatformDependent.setMemory(addr(index), length, ZERO);
} else {
//prefer Arrays::fill here?
UnsafeByteBufUtil.setZero(array, idx(index), length);

View File

@ -86,7 +86,7 @@
<jgroups.version>3.6.13.Final</jgroups.version>
<maven.assembly.plugin.version>2.4</maven.assembly.plugin.version>
<mockito.version>2.8.47</mockito.version>
<netty.version>4.1.9.Final</netty.version>
<netty.version>4.1.14.Final</netty.version>
<proton.version>0.20.0</proton.version>
<resteasy.version>3.0.19.Final</resteasy.version>
<slf4j.version>1.7.21</slf4j.version>