Skip to content

Commit efcd76e

Browse files
Spec 15.3: rc's getter-temporary leak is fixed
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 9720698 commit efcd76e

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

‎tslang/docs/superpowers/specs/2026-09-24-own-memory-model-design.md‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -873,12 +873,15 @@ AOT, `measure.ps1`, at `-O3` and `-O1` (identical within 1%), in MB:
873873
| program | gc | rc | none | own |
874874
| --- | --- | --- | --- | --- |
875875
| `own_param_kept` | 6.5 | 4.8 | 1657.7 | 4.8 |
876-
| `own_getter_borrow` | 6.5 | 12.6 | 1653.3 | 4.8 |
876+
| `own_getter_borrow` | 6.5 | 4.8 (was 12.6) | 1653.3 | 4.8 |
877877
| `own_any_box` | 6.5 | 4.8 | 558.9 | 4.8 |
878878
| `own_call_no_drops` | 6.5 | 4.8 | 1100.7 | 4.8 |
879879

880-
rc climbs in `own_getter_borrow`: it never releases a getter's result used as a temporary
881-
(`h.cc.x`: the `ts.CallInternal` result has no `ts.Release`). Own has no reference to give back.
880+
rc climbed in `own_getter_borrow`: it never released a getter's result used as a temporary
881+
(`h.cc.x`). The getter retains its result like any function, but `OwnedReturnConsumptionPass`
882+
only settled `ts.CallIndirect`, and a getter read is an accessor op until the affine lowering.
883+
The pass now classifies accessor reads the way it classifies calls (`rc_getter_temporary.ts`).
884+
Own has no reference to give back.
882885
§14.5's `const a: any = new C(i)` loop reads 4.6 MB under all four models, at both levels. `none`
883886
does not grow, so LLVM removes the allocation and that program shows nothing about reclamation.
884887

0 commit comments

Comments
 (0)