-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
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, 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.
Metadata
Metadata
Assignees
Labels
No labels