It's not a some specific bug, actually, I just want to discuss instance registry problems highlighted in the docs.
There could be a window where a Ruby object is marked for deletion but the underlying C++ object is returned back to Ruby
I feel like it's possible to reuse ObjectSpace._id2ref logic here, and take a look on how gc frees T_DATA. Or maybe use weakmap.
Ruby instance may be freed on the C++ side
Is it possible to enable the registry only for Ruby-managed instances? Maybe use Ruby's xmalloc somehow?
It's not a some specific bug, actually, I just want to discuss instance registry problems highlighted in the docs.
I feel like it's possible to reuse
ObjectSpace._id2reflogic here, and take a look on how gc freesT_DATA. Or maybe use weakmap.Is it possible to enable the registry only for Ruby-managed instances? Maybe use Ruby's
xmallocsomehow?