> Well if you protect and dispose the ref properly,

"dispose"

Does it mean that the tracking of the GC disappears when casting ref to ptr ?

Should I use boehm gc ?
    
    
    type
      Foo = object
        head, tail: ptr Foo
    
    var
      f = cast[ptr Foo](Foo.new())
      pf = cast[ptr Foo](Foo.new())
    
    f.head = pf
    f.tail = pf
    
    # proc doWork() =
    #   discard cas(addr(f.head), pf, cast[ptr Foo(Foo.new))
    
    # dealloc(f.head) Is this need ?
    

Reply via email to