I wonder how Nim's cycle detection work? It is said in the docs that Nim never scans the whole heap, but I believe in worst cases you have to scan the whole heap to detect cycles.
Also how does the gc trace variables on the stack? How do you determine if a value is a pointer to an object or an integer?
Also how does the gc trace variables on the stack? How do you determine if a value is a pointer to an object or an integer?