소스 검색

reduce memory footprint in kcp

Darien Raymond 9 년 전
부모
커밋
ac2f62b239
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      transport/internet/kcp/config.go

+ 2 - 2
transport/internet/kcp/config.go

@@ -73,7 +73,7 @@ func (this *Config) GetSendingInFlightSize() uint32 {
 }
 
 func (this *Config) GetSendingBufferSize() uint32 {
-	return this.GetSendingInFlightSize() + this.WriteBuffer.GetSize()/this.Mtu.GetValue()
+	return this.WriteBuffer.GetSize() / this.Mtu.GetValue()
 }
 
 func (this *Config) GetReceivingInFlightSize() uint32 {
@@ -85,7 +85,7 @@ func (this *Config) GetReceivingInFlightSize() uint32 {
 }
 
 func (this *Config) GetReceivingBufferSize() uint32 {
-	return this.GetReceivingInFlightSize() + this.ReadBuffer.GetSize()/this.Mtu.GetValue()
+	return this.ReadBuffer.GetSize() / this.Mtu.GetValue()
 }
 
 func init() {