owned fields (25.5e): @owns(Kind) on a record's field, and owned_leaks
A field marked @owns(PhysShape) holds a handle its record owns. A function that releases one owned field of a record (body_free(w, s.body)) and neither releases nor hands on another owned field of the same record type (s.shape) gives the first back and loses the second - the phys_remove bug, at compile time. ludic deps --resources (or --owned) lists them; owned_leaks is a number --check ratchets. A test: the function that frees a solid's body alone is the one found; the one that frees both is not. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
a0c6f8ce7f
commit
b87ee96805
6 changed files with 74859 additions and 72140 deletions
|
|
@ -229,6 +229,7 @@ function deps_keeps(f: pointer, seen: []bool) -> void {
|
|||
if g_arena_strict and n > 0 { exit(1) }
|
||||
deps_births(f, seen)
|
||||
deps_resources(f) # 25.5e
|
||||
deps_owned(f)
|
||||
}
|
||||
|
||||
function fr_consumed(n: Node) -> bool {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue