So, the question is:

let's say I have a `ref object` type (which may contain from simple types - 
ints, bools, etc - to more complicated ones, seqs, strings, or even references 
to the `ref object` in question itself). See here for example: 
<https://github.com/zuiderkwast/nanbox>

How do I get the pointer to one of the created objects and make sure that it's 
not collected by the GC?

Basically, what I'm trying to do is NaN-boxing in Nim (simply put, passing 
different values around like numbers - and when they are more complicated ones, 
stuff the _pointer_ to the aforementioned value somewhere in that number). But 
for that to work, we must obviously be 100% sure that the pointer will keep 
pointing to a valid memory location, until we don't want it to.

Also, last but not least, do `GC_ref` and `GC_unref` keep working with 
`--mm:orc`? (I'm asking so that I don't have to go into Nim's source for the 
1045th time... lol)

Reply via email to