forked from quic-go/quic-go
Merge pull request #2137 from lucas-clemente/struct-alignment
improve memory alignment of frequently used structs
This commit is contained in:
@@ -46,13 +46,14 @@ type TransportParameters struct {
|
||||
MaxAckDelay time.Duration
|
||||
AckDelayExponent uint8
|
||||
|
||||
DisableMigration bool
|
||||
|
||||
MaxPacketSize protocol.ByteCount
|
||||
|
||||
MaxUniStreamNum protocol.StreamNum
|
||||
MaxBidiStreamNum protocol.StreamNum
|
||||
|
||||
IdleTimeout time.Duration
|
||||
DisableMigration bool
|
||||
IdleTimeout time.Duration
|
||||
|
||||
StatelessResetToken *[16]byte
|
||||
OriginalConnectionID protocol.ConnectionID
|
||||
|
||||
@@ -22,10 +22,10 @@ type ExtendedHeader struct {
|
||||
|
||||
typeByte byte
|
||||
|
||||
KeyPhase protocol.KeyPhaseBit
|
||||
|
||||
PacketNumberLen protocol.PacketNumberLen
|
||||
PacketNumber protocol.PacketNumber
|
||||
|
||||
KeyPhase protocol.KeyPhaseBit
|
||||
}
|
||||
|
||||
func (h *ExtendedHeader) parse(b *bytes.Reader, v protocol.VersionNumber) (*ExtendedHeader, error) {
|
||||
|
||||
@@ -46,19 +46,20 @@ var errUnsupportedVersion = errors.New("unsupported version")
|
||||
|
||||
// The Header is the version independent part of the header
|
||||
type Header struct {
|
||||
IsLongHeader bool
|
||||
typeByte byte
|
||||
Type protocol.PacketType
|
||||
|
||||
Version protocol.VersionNumber
|
||||
SrcConnectionID protocol.ConnectionID
|
||||
DestConnectionID protocol.ConnectionID
|
||||
|
||||
IsLongHeader bool
|
||||
Type protocol.PacketType
|
||||
Length protocol.ByteCount
|
||||
Length protocol.ByteCount
|
||||
|
||||
Token []byte
|
||||
SupportedVersions []protocol.VersionNumber // sent in a Version Negotiation Packet
|
||||
OrigDestConnectionID protocol.ConnectionID // sent in the Retry packet
|
||||
|
||||
typeByte byte
|
||||
parsedLen protocol.ByteCount // how many bytes were read while parsing this header
|
||||
}
|
||||
|
||||
|
||||
@@ -13,10 +13,10 @@ import (
|
||||
// A StreamFrame of QUIC
|
||||
type StreamFrame struct {
|
||||
StreamID protocol.StreamID
|
||||
FinBit bool
|
||||
DataLenPresent bool
|
||||
Offset protocol.ByteCount
|
||||
Data []byte
|
||||
FinBit bool
|
||||
DataLenPresent bool
|
||||
|
||||
fromPool bool
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user