Fix SctpMessage.duplicate() behavior
Motivation: SctpMessage.duplicate() copied message content that leads to additional buffer allocation and memory copying. Modifications: Duplicate message content instead of copying it. Result: Better performace and less memory consumption.
This commit is contained in:
parent
bdea94d807
commit
968ef8e0af
@ -164,7 +164,7 @@ public final class SctpMessage extends DefaultByteBufHolder {
|
|||||||
if (msgInfo == null) {
|
if (msgInfo == null) {
|
||||||
return new SctpMessage(protocolIdentifier, streamIdentifier, unordered, content().duplicate());
|
return new SctpMessage(protocolIdentifier, streamIdentifier, unordered, content().duplicate());
|
||||||
} else {
|
} else {
|
||||||
return new SctpMessage(msgInfo, content().copy());
|
return new SctpMessage(msgInfo, content().duplicate());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user