ORC/ARC async progress (#15370)

* ARC/ORC: fixes memory leak for empty seqs that have a non-zero capacity

* async: minor refactorings

* it helps to finish a refactoring
This commit is contained in:
Andreas Rumpf 2020-09-20 00:27:32 +02:00 • committed by GitHub
commit a15d77df7e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 11 deletions

View file

@ -616,7 +616,7 @@ template withData*[T](s: Selector[T], fd: SocketHandle|int, value,
let fdi = int(fd)
s.checkFd(fdi)
if fdi in s:
var value = addr(s.getData(fdi))
var value = addr(s.fds[fdi].data)
body
template withData*[T](s: Selector[T], fd: SocketHandle|int, value, body1,
@ -625,7 +625,7 @@ template withData*[T](s: Selector[T], fd: SocketHandle|int, value, body1,
let fdi = int(fd)
s.checkFd(fdi)
if fdi in s:
var value = addr(s.getData(fdi))
var value = addr(s.fds[fdi].data)
body1
else:
body2