Is the ordering of the GC_runOrc and wasMoved correct?
Intuitively I'd think that it'd be wasMoved then running GC_runOrc to handle cleaning up the ORC "roots" from the current thread? I'm not sure where/when the ORC cycle "roots" added or removed.
I could also be misunderstanding the intent of running GC_runOrc at this point, which I'd like to understand as well.
proc send*[T](c: Chan[T], src: sink Isolated[T]) {.inline.} =
## Sends item to the channel (blocking).
var data = src.extract
when defined(gcOrc) and defined(nimSafeOrcSend):
GC_runOrc()
discard channelSend(c.d, data.unsafeAddr, sizeof(T), true)
wasMoved(data)
Is the ordering of the
GC_runOrc
andwasMoved
correct?Intuitively I'd think that it'd be
wasMoved
then runningGC_runOrc
to handle cleaning up the ORC "roots" from the current thread? I'm not sure where/when the ORC cycle "roots" added or removed.I could also be misunderstanding the intent of running
GC_runOrc
at this point, which I'd like to understand as well.