Add advanced leakdetection for methods introduced by [#4842]
Motivation: [#4842] introduced 4 new methods but missed to implement advanced leak detection for these. Modifications: Correctly implement advanced leak detection for these methods. Result: Advanced leak detection works for all methods as expected.
This commit is contained in:
parent
f0f0b69d90
commit
74495fd27f
@ -27,6 +27,7 @@ import java.io.InputStream;
|
|||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
import java.nio.ByteOrder;
|
import java.nio.ByteOrder;
|
||||||
|
import java.nio.channels.FileChannel;
|
||||||
import java.nio.channels.GatheringByteChannel;
|
import java.nio.channels.GatheringByteChannel;
|
||||||
import java.nio.channels.ScatteringByteChannel;
|
import java.nio.channels.ScatteringByteChannel;
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.Charset;
|
||||||
@ -843,6 +844,30 @@ final class AdvancedLeakAwareByteBuf extends WrappedByteBuf {
|
|||||||
return super.writeLongLE(value);
|
return super.writeLongLE(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getBytes(int index, FileChannel out, long position, int length) throws IOException {
|
||||||
|
recordLeakNonRefCountingOperation(leak);
|
||||||
|
return super.getBytes(index, out, position, length);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int setBytes(int index, FileChannel in, long position, int length) throws IOException {
|
||||||
|
recordLeakNonRefCountingOperation(leak);
|
||||||
|
return super.setBytes(index, in, position, length);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int readBytes(FileChannel out, long position, int length) throws IOException {
|
||||||
|
recordLeakNonRefCountingOperation(leak);
|
||||||
|
return super.readBytes(out, position, length);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int writeBytes(FileChannel in, long position, int length) throws IOException {
|
||||||
|
recordLeakNonRefCountingOperation(leak);
|
||||||
|
return super.writeBytes(in, position, length);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ByteBuf retain() {
|
public ByteBuf retain() {
|
||||||
leak.record();
|
leak.record();
|
||||||
|
@ -24,6 +24,7 @@ import java.io.InputStream;
|
|||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
import java.nio.ByteOrder;
|
import java.nio.ByteOrder;
|
||||||
|
import java.nio.channels.FileChannel;
|
||||||
import java.nio.channels.GatheringByteChannel;
|
import java.nio.channels.GatheringByteChannel;
|
||||||
import java.nio.channels.ScatteringByteChannel;
|
import java.nio.channels.ScatteringByteChannel;
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.Charset;
|
||||||
@ -903,6 +904,30 @@ final class AdvancedLeakAwareCompositeByteBuf extends WrappedCompositeByteBuf {
|
|||||||
return super.consolidate(cIndex, numComponents);
|
return super.consolidate(cIndex, numComponents);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getBytes(int index, FileChannel out, long position, int length) throws IOException {
|
||||||
|
recordLeakNonRefCountingOperation(leak);
|
||||||
|
return super.getBytes(index, out, position, length);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int setBytes(int index, FileChannel in, long position, int length) throws IOException {
|
||||||
|
recordLeakNonRefCountingOperation(leak);
|
||||||
|
return super.setBytes(index, in, position, length);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int readBytes(FileChannel out, long position, int length) throws IOException {
|
||||||
|
recordLeakNonRefCountingOperation(leak);
|
||||||
|
return super.readBytes(out, position, length);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int writeBytes(FileChannel in, long position, int length) throws IOException {
|
||||||
|
recordLeakNonRefCountingOperation(leak);
|
||||||
|
return super.writeBytes(in, position, length);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CompositeByteBuf retain() {
|
public CompositeByteBuf retain() {
|
||||||
leak.record();
|
leak.record();
|
||||||
|
Loading…
Reference in New Issue
Block a user