dom96/Aporia

GC safety of handleRead in initSocket()

Closed this issue · 1 comments

After e6d17 in asyncio.nim - made handleRead and other procs GC-safe - there's a type mismatch with initSocket()'s handleRead (it needs to be declared with the gcsafe and closure pragmas).

I tried adding the {.gcsafe, closure.} pragmas to the anonymous proc's, but then got this:

aporia.nim(2192, 8) Error: ':anonymous' is not GC-safe

I think it's because it's accessing the 'win' object?

It will still compile with

nimrod --threadanalysis:off c aporia.nim

but I thought it would be worth an FYI.

Thanks!

dom96 commented

This shouldn't be a problem once we rewrite to use async dispatcher instead of asyncio.