Skip to content

Commit

Permalink
64bit alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
ffdfgdfg committed Jan 9, 2020
1 parent a8c0f16 commit 0a65975
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions lib/mux/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ func (Self *window) CloseWindow() {

type ReceiveWindow struct {
window
bufQueue ReceiveWindowQueue
bufQueue *ReceiveWindowQueue
element *common.ListElement
count int8
bw *writeBandwidth
Expand All @@ -210,7 +210,7 @@ type ReceiveWindow struct {

func (Self *ReceiveWindow) New(mux *Mux) {
// initial a window for receive
Self.bufQueue.New()
Self.bufQueue = NewReceiveWindowQueue()
Self.element = common.ListElementPool.Get()
Self.maxSizeDone = Self.pack(common.MAXIMUM_SEGMENT_SIZE*30, 0, false)
Self.mux = mux
Expand Down
15 changes: 9 additions & 6 deletions lib/mux/queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,10 @@ func NewListElement(buf []byte, l uint16, part bool) (element *common.ListElemen
}

type ReceiveWindowQueue struct {
lengthWait uint64
chain *bufChain
stopOp chan struct{}
readOp chan struct{}
lengthWait uint64 // really strange ???? need put here
// https://golang.org/pkg/sync/atomic/#pkg-note-BUG
// On non-Linux ARM, the 64-bit functions use instructions unavailable before the ARMv6k core.
// On ARM, x86-32, and 32-bit MIPS, it is the caller's responsibility
Expand All @@ -221,11 +221,14 @@ type ReceiveWindowQueue struct {
timeout time.Time
}

func (Self *ReceiveWindowQueue) New() {
Self.readOp = make(chan struct{})
Self.chain = new(bufChain)
Self.chain.new(64)
Self.stopOp = make(chan struct{}, 2)
func NewReceiveWindowQueue() *ReceiveWindowQueue {
queue := ReceiveWindowQueue{
chain: new(bufChain),
stopOp: make(chan struct{}, 2),
readOp: make(chan struct{}),
}
queue.chain.new(64)
return &queue
}

func (Self *ReceiveWindowQueue) Push(element *common.ListElement) {
Expand Down

0 comments on commit 0a65975

Please sign in to comment.