Module context

Module context 

Source

Structsยง

Block ๐Ÿ”’
A block of allocations. This type should be owned by Context and not used directly.
Context ๐Ÿ”’
Owns all allocations and creates objects. All objects have a lifetime tied to the borrow of their Context. When the Context goes out of scope, no objects should be accessible.
RootSet ๐Ÿ”’
A global store of all gc roots. This struct should be passed to the Context when it is created.
ThreadSafeRootSet ๐Ÿ”’
Thread-safe version of RootSet that uses Mutex instead of RefCell. This is specifically designed for multi-threaded scenarios like ChannelManager where roots need to be managed across thread boundaries.

Enumsยง

DropStackElem ๐Ÿ”’

Constantsยง

SINGLETON_CHECK ๐Ÿ”’
Ensure there is only one context per thread.

Staticsยง

GLOBAL_CHECK ๐Ÿ”’
Ensure there is only one global context.

Functionsยง

collect_garbage_raw ๐Ÿ”’ โš 
Perform garbage collection on a block with a root set without requiring a Context. This is useful for scenarios like ChannelManager where we need to GC a shared block from any thread without conflicting with thread-local Context singleton checks.