tiny.choir.Context
Defined in tiny.choir.
API (138)
Actions
Public operations.
TypeInterfaceHandleactivatecapacityUsagecaptureDiagnosticsclearExhaustioncreatedeinitemitDiagnosticenterMultithreadedExecutioneraseDiagnosticHandlerexhaustedSegmentexhaustion: The segment a request found full and the size of that request, or null when no request has failed since the lastclearExhaustion.getDiagnosticEngineinitisMultithreadedExecutionlookupTraitpassRunCountrecordPassRunsregisterDiagnosticHandlerregisterTraitDefinitionreplayDiagnosticsrequireCapacity
Types and contracts
Public types and contracts.
CapacityErrorExhaustedExhaustionInFlightDiagnosticInitErrorLimitsRefusalRegisterAttributeErrorRegisterErrorRegisterInherentAttributeNameErrorRegisterSegmentSpecErrorRegisterTraitDefinitionErrorRegisterTraitErrorRegisterTypeConstraintErrorRegisterTypeErrorSegmentUsageaddDialectExtensionallocateValueIdallowUnregisteredappendDialectRegistryclaimcontainsOperationcreateOperationensureDialectForOperationeraseOperationsCreatedSincefreezegetArrayAttrgetBoolAttrgetDialectgetDialectAttrgetDialectInterfacegetDialectOpInterfaceFallbackgetDialectTypegetDialectTypeFromNamegetDialectTypeFromNameWithKeygetDialectTypeInterfaceFallbackgetDialectTypeWithKeygetF32AttrgetF64AttrgetFlatSymbolRefAttrgetFloatAttrgetI32AttrgetI64AttrgetIntegerAttrgetOperationRegistrygetOrLoadDialectgetStringAttrgetStringListAttrgetSymbolRefAttrgetTypeInterfacegetTypeListAttrgetTypeParamPayloadgetTypeParamPayloadRawgetTypeRegistryisBackendDialectisDialectLoadedisFrozenlookupAttributeTypelookupOperationlookupTypemaximum_storage_bytesminimum_alignmentoperationCountoperationCreationBoundaryprepareDialectLoadRecordStoragerefusalregisterAttributeInterfaceExternalregisterAttributeTyperegisterBackendDialectregisterDialectInterfaceregisterDialectLoaderregisterDialectOpInterfaceFallbackregisterDialectTypeInterfaceFallbackregisterOperationregisterOperationBatchregisterOperationInherentAttributeNameregisterOperationInherentAttributeNamesregisterOperationInterfaceregisterOperationInterfaceExternalregisterOperationOperandSegmentsregisterOperationOperandTypeConstraintregisterOperationPropertiesModelregisterOperationRequiredAttributeNameregisterOperationRequiredAttributeNamesregisterOperationResultSegmentsregisterOperationResultTypeConstraintregisterOperationShaperegisterOperationTraitregisterOperationTraitIdregisterOperationWithAttributeNameCapacityregisterTyperegisterTypeBatchregisterTypeInterfaceregisterTypeInterfaceExternalrequireRegisteredtypeInterfaceuntrackOperation
Fields and members
Public fields and members.
arithmetic_policyattr_internercapacitydiagnostic_enginedialect_load_transactionsdialect_registryfreeze_policymemoryoperation_storage_allocatorpass_runsphaseresourcesstoragethreading_executiontrait_registrytype_internertype_param_cache
Source
Source: lib/choir/src/core/context/lifecycle.zig:23
zig
pub const Context = struct { phase: alloc_phase.capacity.Phase, capacity: Capacity, storage: [*]u8, memory: *memory_ctx.Memory, operation_storage_allocator: [@sizeOf(core.Operation.StorageAllocator)]u8 align(@alignOf(core.Operation.StorageAllocator)), dialect_registry: dialects.DialectRegistry, trait_registry: interfaces.TraitRegistry, type_interner: types.TypeInterner, attr_interner: attrs.AttributeInterner, resources: resources.Tracker, type_param_cache: types.TypeParamCache, dialect_load_transactions: std.ArrayListUnmanaged(transactions.DialectLoadTransaction), freeze_policy: freeze_ctx.Policy, threading_execution: threading.ExecutionState, diagnostic_engine: diagnostics.Engine, pass_runs: std.atomic.Value(PassRunAtomicInt), arithmetic_policy: interfaces.effects.ArithmeticPolicy = .{}, pub const Limits = memory_ctx.Limits; pub const minimum_alignment = memory_ctx.minimum_alignment; pub const maximum_storage_bytes = memory_ctx.maximum_storage_bytes; pub const Refusal = memory_ctx.Refusal; pub const refusal = memory_ctx.refusal; pub const Capacity = memory_ctx.Capacity; pub const Segment = memory_ctx.Segment; pub const Usage = memory_ctx.Usage; pub const Exhausted = memory_ctx.Exhausted; pub const InFlightDiagnostic = diagnostics.BoundInFlightDiagnostic( Context, diagnosticPayloadAllocator, ); pub const Exhaustion = error{OutOfMemory}; pub const InitError = error{ CapacityOverflow, OutOfMemory }; pub const claim: alloc_phase.capacity.Declaration = .{ .source = .{ .id = "choir.context", .kind = .phase_static, .limit_source = .caller, .storage = .{ .covered = &.{ .{ .id = "dialect_registry_trait_and_configuration_table_storage", .lifetime = .steady, .detail = "dialect, registry, trait, and configuration table storage", }, .{ .id = "interned_dialect_names", .lifetime = .steady, .detail = "interned dialect names", }, .{ .id = "operation_type_attribute_and_dialect_interface_definitions", .lifetime = .steady, .detail = "operation, type, attribute, and dialect interface definitions", }, .{ .id = "dialect_registration_transaction_journals", .lifetime = .initialization, .detail = "dialect registration transaction journals", }, .{ .id = "interned_type_tables", .lifetime = .steady, .detail = "interned type tables", }, .{ .id = "type_names_and_parameter_keys", .lifetime = .steady, .detail = "type names and parameter keys", }, .{ .id = "type_objects_and_parsed_parameter_payloads", .lifetime = .steady, .detail = "type objects and parsed parameter payloads", }, .{ .id = "interned_attribute_tables", .lifetime = .steady, .detail = "interned attribute tables", }, .{ .id = "attribute_objects_and_retained_payloads", .lifetime = .steady, .detail = "attribute objects and retained payloads", }, .{ .id = "fixed_shape_operation_storage_pools", .lifetime = .steady, .detail = "fixed-shape operation storage pools", }, .{ .id = "regions_blocks_properties_operands_successors_and_o_5b44c1ea68c9", .lifetime = .steady, .detail = "regions, blocks, properties, operands, successors, and operation spills", }, .{ .id = "diagnostic_handler_registry", .lifetime = .steady, .detail = "diagnostic handler registry", }, .{ .id = "in_flight_diagnostic_messages_notes_and_metadata", .lifetime = .steady, .detail = "in-flight diagnostic messages, notes, and metadata", }, .{ .id = "bounded_transient_formatting_parsing_verification_a_52aa670b3999", .lifetime = .initialization, .detail = "bounded transient formatting, parsing, verification, and lowering work", }, }, .excluded = &.{ "caller allocator implementation state and an optional stable Context handle", "caller-owned diagnostic capture buffers and foreign interface vtable state", "pass managers, backends, extension registries, and other owners constructed beside Context", }, }, .capacity = .{ .inputs = &.{ alloc_phase.capacity.bindInput(Limits, "attributes_payload_bytes", "attributes.payload_bytes"), alloc_phase.capacity.bindInput(Limits, "attributes_table_bytes", "attributes.table_bytes"), alloc_phase.capacity.bindInput(Limits, "configuration_interface_bytes", "configuration.interface_bytes"), alloc_phase.capacity.bindInput(Limits, "configuration_name_bytes", "configuration.name_bytes"), alloc_phase.capacity.bindInput(Limits, "configuration_table_bytes", "configuration.table_bytes"), alloc_phase.capacity.bindInput(Limits, "configuration_transaction_bytes", "configuration.transaction_bytes"), alloc_phase.capacity.bindInput(Limits, "diagnostics_handler_bytes", "diagnostics.handler_bytes"), alloc_phase.capacity.bindInput(Limits, "diagnostics_payload_bytes", "diagnostics.payload_bytes"), alloc_phase.capacity.bindInput(Limits, "operations_nested_bytes", "operations.nested_bytes"), alloc_phase.capacity.bindInput(Limits, "operations_storage_bytes", "operations.storage_bytes"), alloc_phase.capacity.bindInput(Limits, "transient_bytes", "transient_bytes"), alloc_phase.capacity.bindInput(Limits, "types_key_bytes", "types.key_bytes"), alloc_phase.capacity.bindInput(Limits, "types_payload_bytes", "types.payload_bytes"), alloc_phase.capacity.bindInput(Limits, "types_table_bytes", "types.table_bytes"), }, .type_selectors = &.{}, .nodes = &.{ .{ .input = 0 }, .{ .input = 1 }, .{ .input = 2 }, .{ .input = 3 }, .{ .input = 4 }, .{ .input = 5 }, .{ .input = 6 }, .{ .input = 7 }, .{ .input = 8 }, .{ .input = 9 }, .{ .input = 10 }, .{ .input = 11 }, .{ .input = 12 }, .{ .input = 13 }, .{ .add = .{ .left = 0, .right = 1 } }, .{ .add = .{ .left = 14, .right = 2 } }, .{ .add = .{ .left = 15, .right = 3 } }, .{ .add = .{ .left = 16, .right = 4 } }, .{ .add = .{ .left = 17, .right = 5 } }, .{ .add = .{ .left = 18, .right = 6 } }, .{ .add = .{ .left = 19, .right = 7 } }, .{ .add = .{ .left = 20, .right = 8 } }, .{ .add = .{ .left = 21, .right = 9 } }, .{ .add = .{ .left = 22, .right = 10 } }, .{ .add = .{ .left = 23, .right = 11 } }, .{ .add = .{ .left = 24, .right = 12 } }, .{ .add = .{ .left = 25, .right = 13 } }, }, .assertions = &.{.{ .scope = .closure_total, .measure = .retained, .relation = .upper_bound, .expression = 26, }}, }, .overload = .{ .kind = .reject_before_mutation, .detail = "steady OutOfMemory denotes exhaustion of one named fixed segment; capacity arithmetic and allocation admissions fail before publishing partial state", }, .risks = .{ .transitive = .{ .status = .witnessed, .detail = "all Context-retained nested owners draw from the named fixed segments acquired at construction", }, .foreign = .{ .status = .excluded, .detail = "opaque interface state and caller-owned diagnostic capture storage remain owned by their supplying APIs", }, }, .dependencies = &.{"choir.operation_fixed_storage"}, .obligations = &.{ .{ .key = "choir_context_capacity", .role = .capacity_model }, .{ .key = "choir_context_capacity_overflow", .role = .overload }, .{ .key = "choir_context_single_acquisition", .role = .transitive_risk }, .{ .key = "choir_context_initialization_retry", .role = .overload }, .{ .key = "choir_context_operation_exhaustion_overload", .role = .overload }, .{ .key = "choir_context_operation_exhaustion_transitive_risk", .role = .transitive_risk }, .{ .key = "choir_context_spill_exhaustion", .role = .overload }, .{ .key = "choir_context_foreign_ownership", .role = .foreign_risk }, .{ .key = "choir_context_diagnostic_exhaustion", .role = .overload }, .{ .key = "choir_context_lazy_param_exhaustion", .role = .overload }, .{ .key = "choir_context_attribute_exhaustion", .role = .overload }, }, }, .bindings = .{ .owner = @This(), .seal = .{ .family = alloc_phase.capacity.selector(@This().activate), .premise = .{ .class = .checked_semantic_fact, .authority = .checker, }, }, .teardown = .{ .family = alloc_phase.capacity.selector(@This().deinit), .premise = .{ .class = .checked_semantic_fact, .authority = .checker, }, }, }, }; pub const Error = error{ ContextFrozen, ContextMutationDuringMultithreadedExecution, UnknownDialect, DialectLoadCycle, UnknownOperation, UnknownType, DuplicateDialectLoader, DuplicateInterface, BackendDialectRequired, InvalidTranslationDialect, } || std.mem.Allocator.Error; pub const RegisterTraitDefinitionError = Error || interfaces.TraitRegistry.RegisterError; pub const RegisterError = Error || interfaces.OperationRegistry.GetOrCreateError || interfaces.OperationRegistry.RegisterInterfaceError; pub const RegisterTraitError = Error || interfaces.OperationRegistry.RegisterTraitError; pub const RegisterInherentAttributeNameError = Error || interfaces.OperationRegistry.RegisterInherentAttributeNameError; pub const RegisterTypeConstraintError = Error || interfaces.OperationRegistry.RegisterTypeConstraintError; pub const RegisterSegmentSpecError = Error || interfaces.OperationRegistry.RegisterSegmentSpecError; pub const RegisterTypeError = Error || interfaces.TypeRegistry.GetOrCreateError || interfaces.TypeRegistry.RegisterInterfaceError; pub const RegisterAttributeError = Error || interfaces.AttributeRegistry.RegisterError; pub fn init(allocator: std.mem.Allocator, limits: Limits) InitError!Context { const capacity = try Capacity.derive(limits); const storage = allocator.rawAlloc( capacity.storage_bytes, capacity.storage_alignment, @returnAddress(), ) orelse return error.OutOfMemory; const memory = memory_ctx.Memory.init(storage, capacity); var context = Context{ .phase = .initialization, .capacity = capacity, .storage = storage, .memory = memory, .operation_storage_allocator = undefined, .dialect_registry = dialects.DialectRegistry.init( memory.configuration_tables.allocator(), memory.configuration_interfaces.allocator(), ), .trait_registry = interfaces.TraitRegistry.init(), .type_interner = types.TypeInterner.init( memory.type_tables.allocator(), memory.type_keys.allocator(), ), .attr_interner = attrs.AttributeInterner.init( memory.attribute_tables.allocator(), memory.configuration_interfaces.allocator(), ), .resources = resources.Tracker.init(), .type_param_cache = .{}, .dialect_load_transactions = .empty, .freeze_policy = freeze_ctx.Policy.init(), .threading_execution = threading.ExecutionState.init(), .diagnostic_engine = diagnostics.Engine.init(), .pass_runs = std.atomic.Value(PassRunAtomicInt).init(0), }; operationStorageAllocator(&context).* = core.Operation.StorageAllocator.init( memory_ctx.operationStorageAllocator(context.memory), ); return context; } pub fn create(allocator: std.mem.Allocator, limits: Limits) InitError!*Context { const self = try allocator.create(Context); errdefer allocator.destroy(self); self.* = try init(allocator, limits); return self; } pub fn activate(self: *Context) void { std.debug.assert(self.phase == .initialization); self.freeze(); self.phase = .steady; } pub fn capacityUsage(self: *const Context) Usage { return memory_ctx.cast(self.memory).usage(); } pub fn exhaustedSegment(self: *const Context) ?Segment { return memory_ctx.cast(self.memory).exhausted_segment; } /// The segment a request found full and the size of that request, or /// null when no request has failed since the last `clearExhaustion`. pub fn exhaustion(self: *const Context) ?Exhausted { return memory_ctx.cast(self.memory).exhaustion(); } pub fn clearExhaustion(self: *Context) void { memory_ctx.cast(self.memory).exhausted_segment = null; memory_ctx.cast(self.memory).exhausted_request = 0; } pub fn requireCapacity( self: *Context, segment: Segment, bytes: usize, alignment: std.mem.Alignment, ) Exhaustion!void { const memory = memory_ctx.cast(self.memory); if (!memory.hasCapacity(segment, bytes, alignment)) { memory.exhausted_segment = segment; memory.exhausted_request = bytes; return error.OutOfMemory; } } pub fn deinit(self: *Context, allocator: std.mem.Allocator) void { std.debug.assert(self.phase != .teardown); self.resources.deinit(); operationStorageAllocator(self).deinit(); self.deinitTypeParamCache(); transactions.deinitAll(self); self.trait_registry.deinit(memory_ctx.configurationTableAllocator(self.memory)); self.dialect_registry.deinit( memory_ctx.configurationTableAllocator(self.memory), memory_ctx.configurationNameAllocator(self.memory), memory_ctx.configurationInterfaceAllocator(self.memory), ); self.type_interner.deinit( memory_ctx.typeTableAllocator(self.memory), memory_ctx.typeKeyAllocator(self.memory), memory_ctx.typePayloadAllocator(self.memory), ); self.attr_interner.deinit(memory_ctx.attributePayloadAllocator(self.memory)); self.diagnostic_engine.deinit(memory_ctx.diagnosticHandlerAllocator(self.memory)); const storage = self.storage; const capacity = self.capacity; self.phase = .teardown; self.* = undefined; allocator.rawFree( storage[0..capacity.storage_bytes], capacity.storage_alignment, @returnAddress(), ); } pub fn registerTraitDefinition(self: *Context, entry: interfaces.TraitEntry) RegisterTraitDefinitionError!void { try freeze_ctx.requireMutable(self); try self.trait_registry.register( memory_ctx.configurationTableAllocator(self.memory), entry, ); } pub fn lookupTrait(self: *const Context, trait_id: interfaces.TraitId) ?*const interfaces.TraitVTable { return self.trait_registry.lookup(trait_id); } pub fn getDiagnosticEngine(self: *Context) *diagnostics.Engine { return &self.diagnostic_engine; } pub fn registerDiagnosticHandler( self: *Context, handler: diagnostics.Handler, ) !diagnostics.Engine.HandlerId { return self.diagnostic_engine.registerHandler( memory_ctx.diagnosticHandlerAllocator(self.memory), handler, ); } pub fn eraseDiagnosticHandler(self: *Context, id: diagnostics.Engine.HandlerId) void { self.diagnostic_engine.eraseHandler(id); } pub fn emitDiagnostic( self: *Context, diagnostic: diagnostics.Diagnostic, ) InFlightDiagnostic { return .{ .context = self, .diagnostic = self.diagnostic_engine.emit(diagnostic), }; } pub fn captureDiagnostics( self: *Context, buffer: *diagnostics.CaptureBuffer, ) diagnostics.CaptureScope { return self.diagnostic_engine.capture(buffer); } pub fn replayDiagnostics( self: *Context, buffer: *const diagnostics.CaptureBuffer, ) !diagnostics.HandlerResult { return self.diagnostic_engine.replay(buffer); } pub fn enterMultithreadedExecution(self: *Context) threading.ExecutionGuard { return self.threading_execution.enter(); } pub fn isMultithreadedExecution(self: *const Context) bool { return self.threading_execution.isActive(); } pub fn recordPassRuns(self: *Context, additional: u64) void { var current = self.pass_runs.load(.monotonic); while (true) { const next = saturatingPassRunAdd(PassRunAtomicInt, current, additional); if (self.pass_runs.cmpxchgWeak( current, next, .monotonic, .monotonic, )) |observed| { current = observed; } else { return; } } } pub fn passRunCount(self: *const Context) u64 { return @intCast(self.pass_runs.load(.monotonic)); } fn deinitTypeParamCache(self: *Context) void { var iter = self.type_param_cache.valueIterator(); while (iter.next()) |payload| { payload.deinit(memory_ctx.typePayloadAllocator(self.memory), payload.ptr); } self.type_param_cache.deinit(memory_ctx.typeTableAllocator(self.memory)); } pub const appendDialectRegistry = dialect_ctx.appendDialectRegistry; pub const registerDialectLoader = dialect_ctx.registerDialectLoader; pub const registerBackendDialect = dialect_ctx.registerBackendDialect; pub const isBackendDialect = dialect_ctx.isBackendDialect; pub const addDialectExtension = dialect_ctx.addDialectExtension; pub const getOrLoadDialect = dialect_ctx.getOrLoadDialect; pub const isDialectLoaded = dialect_ctx.isDialectLoaded; pub const getDialect = dialect_ctx.getDialect; pub const ensureDialectForOperation = dialect_ctx.ensureDialectForOperation; pub const prepareDialectLoadRecordStorage = transactions.prepareRecordStorage; pub const registerDialectInterface = interface_ctx.registerDialectInterface; pub const getDialectInterface = interface_ctx.getDialectInterface; pub const registerDialectOpInterfaceFallback = interface_ctx.registerDialectOpInterfaceFallback; pub const getDialectOpInterfaceFallback = interface_ctx.getDialectOpInterfaceFallback; pub const registerDialectTypeInterfaceFallback = interface_ctx.registerDialectTypeInterfaceFallback; pub const getDialectTypeInterfaceFallback = interface_ctx.getDialectTypeInterfaceFallback; pub const requireRegistered = policy_ctx.requireRegistered; pub const allowUnregistered = policy_ctx.allowUnregistered; pub const getOperationRegistry = ops_ctx.getOperationRegistry; pub const lookupOperation = ops_ctx.lookupOperation; pub const registerOperation = ops_ctx.registerOperation; pub const registerOperationWithAttributeNameCapacity = ops_ctx.registerOperationWithAttributeNameCapacity; pub const registerOperationBatch = ops_ctx.registerOperationBatch; pub const registerOperationInterface = ops_ctx.registerOperationInterface; pub const registerOperationInterfaceExternal = ops_ctx.registerOperationInterfaceExternal; pub const registerOperationInherentAttributeName = ops_ctx.registerOperationInherentAttributeName; pub const registerOperationInherentAttributeNames = ops_ctx.registerOperationInherentAttributeNames; pub const registerOperationRequiredAttributeName = ops_ctx.registerOperationRequiredAttributeName; pub const registerOperationRequiredAttributeNames = ops_ctx.registerOperationRequiredAttributeNames; pub const registerOperationPropertiesModel = ops_ctx.registerOperationPropertiesModel; pub const registerOperationShape = ops_ctx.registerOperationShape; pub const registerOperationOperandSegments = ops_ctx.registerOperationOperandSegments; pub const registerOperationResultSegments = ops_ctx.registerOperationResultSegments; pub const registerOperationOperandTypeConstraint = ops_ctx.registerOperationOperandTypeConstraint; pub const registerOperationResultTypeConstraint = ops_ctx.registerOperationResultTypeConstraint; pub const registerOperationTraitId = ops_ctx.registerOperationTraitId; pub const registerOperationTrait = ops_ctx.registerOperationTrait; pub const allocateValueId = resources.allocateValueId; pub const operationCount = resources.operationCount; pub const operationCreationBoundary = resources.operationCreationBoundary; pub const eraseOperationsCreatedSince = resources.eraseOperationsCreatedSince; pub const containsOperation = resources.containsOperation; pub const createOperation = ops_ctx.createOperation; pub const untrackOperation = resources.untrackOperation; pub const getTypeRegistry = type_ctx.getTypeRegistry; pub const lookupType = type_ctx.lookupType; pub const registerType = type_ctx.registerType; pub const registerTypeBatch = type_ctx.registerTypeBatch; pub const registerTypeInterface = type_ctx.registerTypeInterface; pub const registerTypeInterfaceExternal = type_ctx.registerTypeInterfaceExternal; pub fn TypeInterfaceHandle(comptime IFace: type) type { return type_ctx.TypeInterfaceHandle(Context, IFace); } pub const typeInterface = type_ctx.typeInterface; pub const getTypeInterface = type_ctx.getTypeInterface; pub const getTypeParamPayloadRaw = type_ctx.getTypeParamPayloadRaw; pub const getTypeParamPayload = type_ctx.getTypeParamPayload; pub const getDialectType = type_ctx.getDialectType; pub const getDialectTypeWithKey = type_ctx.getDialectTypeWithKey; pub const getDialectTypeFromName = type_ctx.getDialectTypeFromName; pub const getDialectTypeFromNameWithKey = type_ctx.getDialectTypeFromNameWithKey; pub const lookupAttributeType = attr_ctx.lookupAttributeType; pub const registerAttributeType = attr_ctx.registerAttributeType; pub const registerAttributeInterfaceExternal = attr_ctx.registerAttributeInterfaceExternal; pub const getDialectAttr = attr_ctx.getDialectAttr; pub const getIntegerAttr = attr_ctx.getIntegerAttr; pub const getI64Attr = attr_ctx.getI64Attr; pub const getI32Attr = attr_ctx.getI32Attr; pub const getFloatAttr = attr_ctx.getFloatAttr; pub const getF64Attr = attr_ctx.getF64Attr; pub const getF32Attr = attr_ctx.getF32Attr; pub const getBoolAttr = attr_ctx.getBoolAttr; pub const getStringAttr = attr_ctx.getStringAttr; pub const getSymbolRefAttr = attr_ctx.getSymbolRefAttr; pub const getFlatSymbolRefAttr = attr_ctx.getFlatSymbolRefAttr; pub const getStringListAttr = attr_ctx.getStringListAttr; pub const getTypeListAttr = attr_ctx.getTypeListAttr; pub const getArrayAttr = attr_ctx.getArrayAttr; pub const freeze = freeze_ctx.freeze; pub const isFrozen = freeze_ctx.isFrozen;};Source: lib/choir/src/root.zig:36
zig
pub const Context = ir.Context;Also reachable as
backends.wasm.emission.module_encoding.common.ir.Context, backends.wasm.emission.module_encoding.common.ir.context.Context, ir.Context, ir.context.Context.
Complete caller list for Context.deinit
28 direct callers.
lib.choir.src.core.context.lifecycle.test_Context_acquires_one_exact_outer_region_before_activation[function] — test source atlib/choir/src/core/context/lifecycle.zig:575in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_dialect_extension_applied_after_load[function] — test source atlib/choir/src/core/context/lifecycle.zig:967in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_dialect_extension_applied_immediately_if_already_loaded[function] — test source atlib/choir/src/core/context/lifecycle.zig:989in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_dialect_extension_duplicate_interface_handling[function] — test source atlib/choir/src/core/context/lifecycle.zig:1037in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_dialects_clean_up_loaded_dialects[function] — test source atlib/choir/src/core/context/lifecycle.zig:956in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_duplicate_dialect_loader_rejected[function] — test source atlib/choir/src/core/context/lifecycle.zig:1010in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_freeze_allows_Operation.getInterface_lookups[function] — test source atlib/choir/src/core/context/lifecycle.zig:1072in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_freeze_allows_read_operations[function] — test source atlib/choir/src/core/context/lifecycle.zig:1053in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_freeze_blocks_addDialectExtension[function] — test source atlib/choir/src/core/context/lifecycle.zig:912in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_freeze_blocks_getOrLoadDialect_for_unloaded_dialects[function] — test source atlib/choir/src/core/context/lifecycle.zig:938in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_freeze_blocks_registerDialectLoader[function] — test source atlib/choir/src/core/context/lifecycle.zig:925in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_freeze_blocks_registerOperation[function] — test source atlib/choir/src/core/context/lifecycle.zig:784in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_freeze_blocks_registerOperationInterface[function] — test source atlib/choir/src/core/context/lifecycle.zig:799in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_freeze_blocks_registerOperationSegments[function] — test source atlib/choir/src/core/context/lifecycle.zig:858in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_freeze_blocks_registerOperationShape[function] — test source atlib/choir/src/core/context/lifecycle.zig:818in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_freeze_blocks_registerOperationTypeConstraints[function] — test source atlib/choir/src/core/context/lifecycle.zig:832in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_freeze_blocks_registerType[function] — test source atlib/choir/src/core/context/lifecycle.zig:884in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_freeze_blocks_registerTypeInterface[function] — test source atlib/choir/src/core/context/lifecycle.zig:896in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_initialization_rejects_outer_allocation_failure_and_retries[function] — test source atlib/choir/src/core/context/lifecycle.zig:614in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_multiple_extensions_for_same_dialect[function] — test source atlib/choir/src/core/context/lifecycle.zig:1021in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_multithreaded_execution_blocks_registry_mutation[function] — test source atlib/choir/src/core/context/lifecycle.zig:1103in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_multithreaded_execution_blocks_resource_creation[function] — test source atlib/choir/src/core/context/lifecycle.zig:1146in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_multithreaded_execution_requires_preexisting_uniqued_storage[function] — test source atlib/choir/src/core/context/lifecycle.zig:1116in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_reports_and_checks_named_segment_capacity[function] — test source atlib/choir/src/core/context/lifecycle.zig:645in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_resize_hints_preserve_successful_allocation_fallback[function] — test source atlib/choir/src/core/context/lifecycle.zig:1197in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_resources_clean_up_operations_with_use-def_chains[function] — test source atlib/choir/src/core/context/lifecycle.zig:1164in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_resources_erase_operation_prevents_double_free[function] — test source atlib/choir/src/core/context/lifecycle.zig:1183in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_context_pass_run_census_saturates_at_atomic_storage_boundary[function] — test source atlib/choir/src/core/context/lifecycle.zig:679in nearest public ownerlib.choir.src.core.context.lifecycle
Complete call list for Context.deinit
7 direct calls.
tiny.choir.ir.attrs.AttributeInterner.deinit[method] atlib/choir/src/core/attrs.zig:311lib.choir.src.core.context.lifecycle.Context.deinitTypeParamCache[method] — private source atlib/choir/src/core/context/lifecycle.zig:467in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.operationStorageAllocator[function] — private source atlib/choir/src/core/context/lifecycle.zig:557in nearest public ownerlib.choir.src.core.context.lifecycletiny.choir.ir.context.ResourceTracker.deinit[method] atlib/choir/src/core/context/resources.zig:19lib.choir.src.core.context.transactions.deinitAll[function] — private source atlib/choir/src/core/context/transactions.zig:81in nearest public ownerlib.choir.src.core.context.transactionstiny.choir.ir.types.TypeInterner.deinit[method] atlib/choir/src/core/types.zig:92lib.deadalloc.src.allocator.rawFree[function] — private source atlib/deadalloc/src/allocator.zig:1099in nearest public ownerlib.deadalloc.src.allocator
Complete caller list for Context.init
31 direct callers.
tiny.choir.Context.create[function] atlib/choir/src/core/context/lifecycle.zig:308lib.choir.src.core.context.lifecycle.test_Context_acquires_one_exact_outer_region_before_activation[function] — test source atlib/choir/src/core/context/lifecycle.zig:575in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_dialect_extension_applied_after_load[function] — test source atlib/choir/src/core/context/lifecycle.zig:967in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_dialect_extension_applied_immediately_if_already_loaded[function] — test source atlib/choir/src/core/context/lifecycle.zig:989in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_dialect_extension_duplicate_interface_handling[function] — test source atlib/choir/src/core/context/lifecycle.zig:1037in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_dialects_clean_up_loaded_dialects[function] — test source atlib/choir/src/core/context/lifecycle.zig:956in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_duplicate_dialect_loader_rejected[function] — test source atlib/choir/src/core/context/lifecycle.zig:1010in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_freeze_allows_Operation.getInterface_lookups[function] — test source atlib/choir/src/core/context/lifecycle.zig:1072in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_freeze_allows_read_operations[function] — test source atlib/choir/src/core/context/lifecycle.zig:1053in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_freeze_blocks_addDialectExtension[function] — test source atlib/choir/src/core/context/lifecycle.zig:912in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_freeze_blocks_getOrLoadDialect_for_unloaded_dialects[function] — test source atlib/choir/src/core/context/lifecycle.zig:938in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_freeze_blocks_registerDialectLoader[function] — test source atlib/choir/src/core/context/lifecycle.zig:925in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_freeze_blocks_registerOperation[function] — test source atlib/choir/src/core/context/lifecycle.zig:784in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_freeze_blocks_registerOperationInterface[function] — test source atlib/choir/src/core/context/lifecycle.zig:799in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_freeze_blocks_registerOperationSegments[function] — test source atlib/choir/src/core/context/lifecycle.zig:858in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_freeze_blocks_registerOperationShape[function] — test source atlib/choir/src/core/context/lifecycle.zig:818in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_freeze_blocks_registerOperationTypeConstraints[function] — test source atlib/choir/src/core/context/lifecycle.zig:832in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_freeze_blocks_registerType[function] — test source atlib/choir/src/core/context/lifecycle.zig:884in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_freeze_blocks_registerTypeInterface[function] — test source atlib/choir/src/core/context/lifecycle.zig:896in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_initialization_rejects_outer_allocation_failure_and_retries[function] — test source atlib/choir/src/core/context/lifecycle.zig:614in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_multiple_extensions_for_same_dialect[function] — test source atlib/choir/src/core/context/lifecycle.zig:1021in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_multithreaded_execution_blocks_registry_mutation[function] — test source atlib/choir/src/core/context/lifecycle.zig:1103in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_multithreaded_execution_blocks_resource_creation[function] — test source atlib/choir/src/core/context/lifecycle.zig:1146in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_multithreaded_execution_requires_preexisting_uniqued_storage[function] — test source atlib/choir/src/core/context/lifecycle.zig:1116in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_reports_and_checks_named_segment_capacity[function] — test source atlib/choir/src/core/context/lifecycle.zig:645in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_resize_hints_preserve_successful_allocation_fallback[function] — test source atlib/choir/src/core/context/lifecycle.zig:1197in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_resources_clean_up_operations_with_use-def_chains[function] — test source atlib/choir/src/core/context/lifecycle.zig:1164in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_Context_resources_erase_operation_prevents_double_free[function] — test source atlib/choir/src/core/context/lifecycle.zig:1183in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_context_pass_run_census_saturates_at_atomic_storage_boundary[function] — test source atlib/choir/src/core/context/lifecycle.zig:679in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_one_byte_past_the_ceiling_is_refused_before_any_allocator_is_asked[function] — test source atlib/choir/src/core/context/lifecycle.zig:1241in nearest public ownerlib.choir.src.core.context.lifecyclelib.choir.src.core.context.lifecycle.test_the_largest_limits_the_ceiling_admits_reach_an_allocator_and_are_refused,_not_aborted[function] — test source atlib/choir/src/core/context/lifecycle.zig:1222in nearest public ownerlib.choir.src.core.context.lifecycle
Audit
| Definitions | 122 |
|---|---|
| Public names | 610 |
| Members | 20 |
| Version | 26.7.0 |
| Revision | daab053ee433 |