resources (25.5e, first half): @creates(Kind) / @releases(Kind), and resource_drops

A function marked @creates(PhysShape) makes a handle one marked @releases(PhysShape) gives back.
ludic deps --resources lists every creating call whose handle is thrown away, or bound to a local
that is never released, passed on, stored or returned, and resource_drops is a number --check
ratchets. A test: a thrown-away create and one bound and never handed on are the two found; one
stored in a state and one released are not. A record's owned fields and a borrow form (a shape
used by several scaled ones) are the second half, with a resource type.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-28 16:54:27 +03:00
parent 1cc507e181
commit e009ea313b
7 changed files with 80045 additions and 77146 deletions

View file

@ -46,6 +46,7 @@ function selfhost_frags() -> []pointer {
push(f, "selfhost/backend/emit_fence_ir.ludic")
push(f, "selfhost/backend/emit_frame.ludic")
push(f, "selfhost/backend/emit_escape.ludic")
push(f, "selfhost/backend/emit_resource.ludic")
push(f, "selfhost/backend/emit_head.ludic")
push(f, "selfhost/backend/emit_deps.ludic")
push(f, "selfhost/backend/emit_addr.ludic")