Expand description
Class descriptors.
Every heap object’s header word 0 points at a Class, whose first field is the GC vtable.
Classes are created when a program loads and live forever. They are frozen: after
register_class returns, nothing in a class changes, so any thread may read them freely.
Modules§
Structs§
- Builtins
- Class
- Class
Spec - Fields of a class under construction.
register_classassigns the id and the GC vtable.
Enums§
- Capability
- Which ownership state new instances start in, and how the type may cross threads.
- ObjKind
- Physical layout of a class’s instances.
Statics§
Functions§
- class_
by_ id - class_
count - class_
id_ of - Class id of a value; bigints report the
Intclass id. - class_
of - Returns the class of any value, including immediates.
- heap_
class ⚠ - The class of a heap object.
- immediate_
class - register_
class - Registers a class, making it immutable and globally visible. Returns its
'staticdescriptor. - set_
methods - Replaces a class’s method table (builtin classes get their methods when the prelude loads). The previous table is leaked, so concurrent readers stay valid.