Skip to content

Commit

Permalink
transport: replace (chan bool) with (chan struct{})
Browse files Browse the repository at this point in the history
(chan struct{}) take ZERO memory footprint.
  • Loading branch information
prataprc committed Apr 19, 2016
1 parent 978b187 commit e89b291
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions TODO.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
* use chan struct{} instead of chan bool for synchronization.
* there is a leak in verify/* use mmprof to fix it.
* add code coverage for verification.
* find a way to add SendHeartbeat() in verify/{client.go,server.go}
* logs are commented, wrap them under log flag.
* document reserved tags.
Expand All @@ -17,3 +14,4 @@
* run travis for go1.4, go1.5, go1.6
* try gofast on raspberry-pi.
* support snappy compression.
* add code coverage for verification.
4 changes: 2 additions & 2 deletions transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ type Transport struct {
aliveat int64
txch chan *txproto
rxch chan rxpacket
killch chan bool
killch chan struct{}

// memory pools
p_strms chan *Stream // for locally initiated streams
Expand Down Expand Up @@ -140,7 +140,7 @@ func NewTransport(name string, conn Transporter, version Version, config map[str
conn: conn,
txch: make(chan *txproto, chansize+batchsize),
rxch: make(chan rxpacket, chansize),
killch: make(chan bool),
killch: make(chan struct{}),

msgpools: make(map[uint64]*sync.Pool),

Expand Down

0 comments on commit e89b291

Please sign in to comment.