You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In vanilla Ruby, obj_free is necessary for most types. In most cases, it frees the underlying off-heap buffers of large data structures, including T_OBJECT, T_STRING, T_ARRAY, T_HASH, T_BIGNUM, T_STRUCT, etc. Those off-heap buffers should be reimplemented using GC-traced on-heap objects. By doing so, no finalisation is necessary for those types, as the memory is totally managed by the GC. See #10
Other types may still need finalisation, but we can use non-resurrecting finaliser, instead. Ruby's ObjectSpace.define_finalizer already uses non-resurrecting finalisation.
T_DATA: user-defined types.
T_REGEXP: Regular expression using third-party library "Oniguruma".
other types.
Maybe we can use non-resurrecting finalisation instead, but only if the pointer field that points to native structure never changes.
The text was updated successfully, but these errors were encountered:
This is related to #10, but more general
In vanilla Ruby,
obj_free
is necessary for most types. In most cases, it frees the underlying off-heap buffers of large data structures, includingT_OBJECT
,T_STRING
,T_ARRAY
,T_HASH
,T_BIGNUM
,T_STRUCT
, etc. Those off-heap buffers should be reimplemented using GC-traced on-heap objects. By doing so, no finalisation is necessary for those types, as the memory is totally managed by the GC. See #10Other types may still need finalisation, but we can use non-resurrecting finaliser, instead. Ruby's
ObjectSpace.define_finalizer
already uses non-resurrecting finalisation.T_DATA
: user-defined types.T_REGEXP
: Regular expression using third-party library "Oniguruma".Maybe we can use non-resurrecting finalisation instead, but only if the pointer field that points to native structure never changes.
The text was updated successfully, but these errors were encountered: