lift the =dup hook (#21903)

* fixes tests again
* remove helper functions
* fixes closures, owned refs
* final cleanup
This commit is contained in:
ringabout
2023-06-02 22:03:32 +08:00
committed by GitHub
parent ead7e20926
commit 1133f20fe2
15 changed files with 151 additions and 93 deletions

View File

@@ -200,10 +200,6 @@ proc nimDecRefIsLast(p: pointer): bool {.compilerRtl, inl.} =
when traceCollector:
cprintf("[DECREF] %p\n", cell)
proc nimDupRef(dest: ptr pointer, src: pointer) {.compilerRtl, inl.} =
dest[] = src
if src != nil: nimIncRef src
proc GC_unref*[T](x: ref T) =
## New runtime only supports this operation for 'ref T'.
var y {.cursor.} = x