Does Nim have a type that is basically a managed reference but you tell the compiler that it should no longer track it. This mostly in question for reference counted GC models. The type I'm asking for i similar to the Unmanaged type in Swift.
https://developer.apple.com/documentation/swift/unmanaged
The purpose for such type is that if you send your managed pointer to FFI or do some pointer acrobatics that the compiler can no longer manage the resource. At some point later you want to reclaim the resource in Nim and convert it back to a managed reference without copying the data. Also when unmanaged, manual reference counting should be available like retain/release similar to the Swift example.
Not sure if you know this already or not but ptr is Nim's untraced pointer and it can be used like so:
type
Obj = object
data: int
proc toUntraced(): ptr Obj =
let x = (ref Obj)(data: 345)
GC_ref x
result = cast[ptr Obj](x)
proc fromUntraced(x: ptr Obj) =
let y = cast[ref Obj](x)
GC_unref(y)