fence: every runtime call is its line's site, and site 0 comes back when it returns
A block took whatever @lp_site held when it was made. Only malloc, calloc, realloc, concat, the number texts, the float text, a substring and Text.* set one, so every other runtime helper - intern, Text.repeat and the string builders, the Fs, Os, unicode, uuid and crypto helpers - was charged to whichever line had allocated last (walk 9 blamed gvk_tex_storage, m4_new, kept_push$int and survey_op_reward for intern's 16 B copies). - Any `call ptr @lp_*` now takes a site of its own, its kind the callee's name when no better one is known (intern, str_repeat, fs_list, ...). What the helper makes, in however many blocks and through whichever helpers it calls in turn, is that line's. - When the call returns, @lp_site goes back to site 0, now named "(runtime) (no site) unsited": a block made with no site of its own says so instead of borrowing the last one. - The ECS stores' grows and a mod's registered stores - the only allocations emitted outside emit_bind - take a site each. Golden alloc_fence_sites: two lines take turns keeping memory, Text.repeat and a record, every frame judged. Each report names its own line (25 x +32 B str_repeat at :11, 25 x +16 B new Box at :12); the toolchain before this charges 23 of the 32 B texts to the new Box line. The other fence and arena goldens are unchanged; ludic.base's tests pass; the game's frame ratchets are 0 on main 7cb2b164. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
48a8caa292
commit
6ab98292d2
8 changed files with 98453 additions and 79775 deletions
|
|
@ -22,6 +22,7 @@ function emit_bind(rest: pointer) -> pointer {
|
|||
let r = nreg()
|
||||
emit(" "); emit(r); emit(" = "); emit(rest); emit("\n")
|
||||
if want { emit(" store i8 0, ptr @lp_want\n") }
|
||||
if g_site_reset { emit(" store i32 0, ptr @lp_site\n"); g_site_reset = false }
|
||||
return r
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue