Project

General

Profile

« Previous | Next » 

Revision 3abdd424

Added by byroot (Jean Boussier) about 1 month ago

Turn rb_classext_t.fields into a T_IMEMO/class_fields

This behave almost exactly as a T_OBJECT, the layout is entirely
compatible.

This aims to solve two problems.

First, it solves the problem of namspaced classes having
a single shape_id. Now each namespaced classext
has an object that can hold the namespace specific
shape.

Second, it open the door to later make class instance variable
writes atomics, hence be able to read class variables
without locking the VM.
In the future, in multi-ractor mode, we can do the write
on a copy of the fields_obj and then atomically swap it.

Considerations:

  • Right now the RClass shape_id is always synchronized,
    but with namespace we should likely mark classes that have
    multiple namespace with a specific shape flag.