escape (fix): a function taken as a value keeps what it returns, and an entry is walked
Two more holes of the arena's family, found from ECS's births: - a function called through a function value (UiClass.make's cmp_x_new, a step list, a System's tick) has its result flow nowhere the analysis can see, so what it returned looked LOCAL - and a caller keeping it (ludic.ui's instance table) would keep scratch. Every function taken as a value (fn f) now has its result kept. - an entry block has no name, and the analysis only walked named declarations: what an entry stored was never seen. It is walked now. examples/lang/arena_fnval.ludic (a factory in a field, its records kept by a pool across frames) crashed poisoned before and prints '5 1053' as the heap does now; in ludic-dev test. Maroon Lake: component constructors are kept, not births (birth_leaks 115 -> 103); what fn values return is kept (frame_allocs 194 -> 210, frame_keeps 151 -> 162); 5293 sites local, 6586 kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
b12b66e89a
commit
5d34d0fd09
6 changed files with 62658 additions and 61981 deletions
|
|
@ -827,6 +827,14 @@ function arena_defaults_case() -> void {
|
|||
if (poisoned == "497 124747") { ok(lbl) } else { bad2(lbl, `poisoned [{poisoned}]`) }
|
||||
}
|
||||
|
||||
function arena_fnval_case() -> void {
|
||||
let lbl = "arena_fnval.ludic (--arena: what a function called through a function value returns is kept; a pool holding it survives the resets)"
|
||||
let b = `{tmp_dir()}/e_arena_fnval`
|
||||
if not shq(`bin/ludicc --arena examples/lang/arena_fnval.ludic -o {b} 2>/dev/null`) { bad2(lbl, "did not build"); return }
|
||||
let poisoned = capture_line(`R3D_ARENA_CHECK=1 R3D_ALLOC_FENCE=off {b} < /dev/null`)
|
||||
if (poisoned == "5 1053") { ok(lbl) } else { bad2(lbl, `poisoned [{poisoned}]`) }
|
||||
}
|
||||
|
||||
function arena_pool_case() -> void {
|
||||
let lbl = "arena_pool.ludic (--arena: a generic push into a kept pool keeps its records and its buffer on the heap; 0xDD poison changes nothing)"
|
||||
let b = `{tmp_dir()}/e_arena_pool`
|
||||
|
|
@ -1137,6 +1145,7 @@ function cmd_dev_test() -> int {
|
|||
alloc_fence_leak_case()
|
||||
alloc_fence_auto_case()
|
||||
arena_pool_case()
|
||||
arena_fnval_case()
|
||||
arena_defaults_case()
|
||||
feat_case("lang/nested_templates", "", "outer [inner 3 {x}] \"`}\" end", "nested_templates.ludic (a template literal inside another's hole)")
|
||||
feat_case("lang/aliases", "", "10 5 3", "aliases.ludic (L6: a namespace method declared as an alias of a function, labelled or by its parameters)")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue