don't stand on your head to take a pointer
the whole stack argument doesn't make much sense in golang; escape analysis should allocate in heap.
This commit is contained in:
parent
575cf339f4
commit
86e65e589d
@ -434,14 +434,9 @@ func (p *PubSub) doAnnounceRetry(pid peer.ID, topic string, sub bool) {
|
||||
return
|
||||
}
|
||||
|
||||
// don't take pointers to the goroutine stack
|
||||
topicP := new(string)
|
||||
subP := new(bool)
|
||||
*topicP = topic
|
||||
*subP = sub
|
||||
subopt := &pb.RPC_SubOpts{
|
||||
Topicid: topicP,
|
||||
Subscribe: subP,
|
||||
Topicid: &topic,
|
||||
Subscribe: &sub,
|
||||
}
|
||||
|
||||
out := rpcWithSubs(subopt)
|
||||
|
Loading…
x
Reference in New Issue
Block a user