Contexts#
- class unit.Context#
Manages state and memory for all UNIT objects. Procedures created with a context share its memory allocator.
Context supports the context manager protocol. When used with
with, it becomes the current context, so procedures can be created without passing it explicitly.Example# # Explicit context ctx = unit.Context() proc = unit.Procedure("main", context=ctx) # Implicit via context manager with unit.Context(): proc = unit.Procedure("main") # uses the current context
- __exit__(*args) None#
Restore the previous context.