pub unsafe trait Fissile: LispFmt + Debug + Clone + Traceable + Any + 'static {
// Required method
fn type_of() -> NkT;
}
Expand description
Structs that can be stored inline in the GC Arena
memory must implement
this trait.
Safety
No. Not safe. Do not implement this trait directly.
Add your new internal heap-storage type to the fissile_types! {...}
list, or just use Object
. This is essentially just a marker-type.
What makes it really gnarly to implement this trait yourself,
without adding it to fissile_types! {...}
is that type_of()
is used
as an index into DESTRUCTORS
when deallocating unreachable GC
objects, and to figure out which pointers to follow during the GC
mark phase. This will obviously cause UB if the memory layout of your
type isn’t what the destructor, or trace
/update_ptrs
expects