Phase 2: heap, regions and allocation budgets (RFC 0008)
- air: own<T>, own_array<T>, region, alloc_error; own.new/array/take/ free, region.create/new/array/reset/destroy; mem.alloc budget form; linear contents of owners gated by linear_aggregates - verifier: allocation types and capability kind (E1001, E3201), mem.alloc effect (E3101), ok/err counts; borrow-typed block params checked in the CFG stage with the region-allocation exception; linear owners and regions (E3002, E3001, E2001, E2002, E2101); region allocations as disjoint exclusive children of the shared region borrow; E2104 when reset/destroy would invalidate a live reference - interp: live-byte budgets charged along the narrowing chain, shared by copies, mandatory in the deterministic profile; heap cells; regions return quota only on reset/destroy - conformance: 25 heap/region tests including a 64 KiB region file copy; 4000 mutants without a crash
This commit is contained in:
1 parent
b8d4ab4d4c
commit
7f4ce71d44
38 files changed
+1341
-48
No files matched your search
@@ -0,0 +1,19 @@
|
||||
; Allocation requires the effect mem.alloc.
|
||||
; expect: reject E3101
|
||||
; phase: 2
|
||||
; spec: docs/spec/03-memory-model.md
|
||||
module test.alloc_without_effect
|
||||
air 0
|
||||
lang 0.1
|
||||
features [capabilities, effects, heap, ownership, resources]
|
||||
|
||||
fn @f(%heap: cap<mem.alloc>) -> void
|
||||
effects []
|
||||
entry:
|
||||
%v = const.u64 1
|
||||
own.new %v, %heap, ok -> @have, err -> @nomem
|
||||
have(%o: own<u64>):
|
||||
own.free %o
|
||||
ret
|
||||
nomem(%e: alloc_error):
|
||||
ret
|
||||
Reference in new issue
Block a user