Expand description
Heap object layouts and their GC hooks.
Every object starts with a Header. Instances keep their fields inline as atomic words, so a
racing reader can never see a torn value. Lists do the same with their elements and swap whole
buffers on growth, so their reads never lock. Dicts and other containers keep Rust-side
buffers; the ownership rules (and per-object locks for shared objects) guarantee those are
never mutated while another thread reads them.
Structs§
- Atomic
Obj - BigInt
Obj - CellObj
- Channel
Inner - Channel
Obj - Channel
State - Closure
Obj - DictObj
- Instance
Obj - ListObj
- A list: header, length, a pointer to a backing array, and room for a few elements inline.
- Mutex
Obj - Native
Obj - StrObj
- A string: immutable UTF-8 bytes with a cached hash and character count.
- String
Builder Obj - Thread
Inner - Thread
Obj - Tuple
Obj
Enums§
- Thread
Outcome - Outcome of a finished thread: its value or its panic message.
Traits§
Functions§
- as_
atomic ⚠ - Safety
- as_
bigint ⚠ - Safety
- as_cell⚠
- Safety
- as_
channel ⚠ - Safety
- as_
closure ⚠ - Safety
- as_dict⚠
- Safety
- as_
instance ⚠ - Safety
- as_list⚠
- Safety
- as_
mutex ⚠ - Safety
- as_
native ⚠ - Safety
- as_sb⚠
- Safety
- as_
str_ ⚠obj - Safety
- as_
thread ⚠ - Safety
- as_
tuple ⚠ - Safety
- atomic_
of - The
Atomicbehindv, or aTypeErrorpanic ifvis not one. - channel_
of - The
Channelbehindv, or aTypeErrorpanic ifvis not one. - dict_of
- The
Dict or Setbehindv, or aTypeErrorpanic ifvis not one. - instance_
of - The instance behind
vif it is of classclass_idexactly (builtin and prelude classes, which have no subclasses), or aTypeErrorpanic namingwant. - instance_
with_ field - The instance behind
vif it is an instance with a fieldi(of any class), elseNone. Reading the field is then memory-safe; whether it is the expected class’s field is up to the caller. - kind_of
- The object kind of a value (
Immediatefor non-pointers). - list_of
- The
Listbehindv, or aTypeErrorpanic ifvis not one. - mark_
value - mutex_
of - The
Mutexbehindv, or aTypeErrorpanic ifvis not one. - sb_of
- The
StringBuilderbehindv, or aTypeErrorpanic ifvis not one. - str_
obj_ of - The
Stringbehindv, or aTypeErrorpanic ifvis not one. - str_of
- Returns the string slice if
vis a string. - thread_
of - The
Threadbehindv, or aTypeErrorpanic ifvis not one. - tuple_
of - The
Tuplebehindv, or aTypeErrorpanic ifvis not one. - type_
error - A
TypeErrorpanic:expected {want}, got {the class of v}.
Type Aliases§
- Wake
- Wakes a parked fiber (see the standard library’s fiber scheduler).