On 04/06/2015 16:37, Marvin Humphrey wrote:
On Thu, Jun 4, 2015 at 7:06 AM, Nick Wellnhofer <[email protected]> wrote:
But we don't set the low bit on the Ruby object pointer (VALUE). Pointers to
Clownfish objects will probably end up in the `data` field of struct RData.
Ruby shouldn't care about the contents of this field.
I'm hoping that we can implement Clownfish under Ruby such that...
* Clownfish objects *are* Ruby objects.
* The Clownfish refcounting routines are made no-ops.
* A `Visit_Refs` method can be factored out of our current `Destroy` methods
which will be used for decref'ing under refcounting hosts and for the
"mark" phase of mark-and-sweep GC under Ruby (and Python).
You mean using a struct RObject as CFISH_OBJ_HEAD similar to what we plan for
the Python bindings? Whether this works depends on how Ruby allocates and
deallocates memory but I wouldn't be surprised if it turns out to be infeasible.
Also, this is only useful for subclassing Clownfish classes from the host
language. If we have some kind of interface support, we'll probably want to
remove this ability anyway. It doesn't make sense to have core features that
are only supported by a subset of host languages.
Nick