Skip to content

Commit 0a65975

Browse files
committed
64bit alignment
1 parent a8c0f16 commit 0a65975

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

lib/mux/conn.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ func (Self *window) CloseWindow() {
199199

200200
type ReceiveWindow struct {
201201
window
202-
bufQueue ReceiveWindowQueue
202+
bufQueue *ReceiveWindowQueue
203203
element *common.ListElement
204204
count int8
205205
bw *writeBandwidth
@@ -210,7 +210,7 @@ type ReceiveWindow struct {
210210

211211
func (Self *ReceiveWindow) New(mux *Mux) {
212212
// initial a window for receive
213-
Self.bufQueue.New()
213+
Self.bufQueue = NewReceiveWindowQueue()
214214
Self.element = common.ListElementPool.Get()
215215
Self.maxSizeDone = Self.pack(common.MAXIMUM_SEGMENT_SIZE*30, 0, false)
216216
Self.mux = mux

lib/mux/queue.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,10 @@ func NewListElement(buf []byte, l uint16, part bool) (element *common.ListElemen
209209
}
210210

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

224-
func (Self *ReceiveWindowQueue) New() {
225-
Self.readOp = make(chan struct{})
226-
Self.chain = new(bufChain)
227-
Self.chain.new(64)
228-
Self.stopOp = make(chan struct{}, 2)
224+
func NewReceiveWindowQueue() *ReceiveWindowQueue {
225+
queue := ReceiveWindowQueue{
226+
chain: new(bufChain),
227+
stopOp: make(chan struct{}, 2),
228+
readOp: make(chan struct{}),
229+
}
230+
queue.chain.new(64)
231+
return &queue
229232
}
230233

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

0 commit comments

Comments
 (0)