Merge pull request #5 from netty/faster-send

Make Buf.send() faster
This commit is contained in:
Chris Vest 2020-11-26 13:59:47 +01:00 committed by GitHub
commit 89860b779a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -712,8 +712,7 @@ class MemSegBuf extends RcSupport<Buf, MemSegBuf> implements Buf {
return new Owned<MemSegBuf>() { return new Owned<MemSegBuf>() {
@Override @Override
public MemSegBuf transferOwnership(Drop<MemSegBuf> drop) { public MemSegBuf transferOwnership(Drop<MemSegBuf> drop) {
var newSegment = isConfined? transferSegment.handoff(Thread.currentThread()) : transferSegment; MemSegBuf copy = new MemSegBuf(transferSegment, drop, alloc);
MemSegBuf copy = new MemSegBuf(newSegment, drop, alloc);
copy.order = outer.order; copy.order = outer.order;
copy.roff = outer.roff; copy.roff = outer.roff;
copy.woff = outer.woff; copy.woff = outer.woff;