Is there a traced equivalent to Nim's pointer (or C's void*), or do ref fields have to be concretely typed?
2018-03-12 21:23:42
You can use RootRef for this, somewhat. The spec makes no promise that string and seq are cast'able to RootRef but the GCs try to support it...
2018-03-13 01:21:44
I'm mainly concerned with user-defined objects (which don't necessarily have any ancestors). RootRef seems to be equivalent to ref[RootObj], which isn't general enough for my purposes. If I were to forcibly cast an incompatible ref object type into a RootRef, would it trip up the GC? All I care about is the actual address and keeping the object alive. I saw GC_ref, but I can't use it because it would be impossible to use GC_unref once the original type is forgotten.
2018-03-13 07:27:24