selfhost/cmd/w6a: strip *arena cascade (γ-3)

amalloc has 0 callers post-γ-2; the *arena threaded through w6a's
init/dupstr/bufinit and the asm_.a / buf.a fields are vestigial.

Drop `import mem;` from opcodes/parse/obj/main, remove asm_.a and
buf.a struct fields, strip *arena from init/dupstr/bufinit
signatures, update 12 call sites. main.combined.ww auto-regenerated.

Comment at main.ww:36 retidied "argv/arena" → "argv-style" to match
post-strip reality.

Verified 132/132 incl. 991_w6a_ww + 995_self_rebuild byte-identity.
This commit is contained in:
2026-05-21 11:46:13 +09:00
parent 3dae4d9e9a
commit 12e0b4057f
5 changed files with 124 additions and 144 deletions

View File

@@ -8,7 +8,6 @@ package main;
import os;
import rt;
import mem;
import strings;
import opcodes;
import lex;
@@ -34,7 +33,7 @@ fn cstrlen(p: *u8) u64 = {
return n;
};
// pathstr — view a NUL-terminated *u8 as a str. Bridges argv/arena
// pathstr — view a NUL-terminated *u8 as a str. Bridges argv-style
// callers to lib/os entrypoints (str post-task-#23).
fn pathstr(p: *u8) str = {
let r: str;
@@ -112,14 +111,13 @@ export fn main(argc: i32, argv: **u8) i32 = {
return 1;
};
let ar: *arena = newarena();
let s: asm_;
let nlen: u64 = cstrlen(src);
let view: str;
view.ptr = src;
view.len = nlen: i32;
let fname: str = strings.dup(view);
init(&s, ar, fname, buf, blen);
init(&s, fname, buf, blen);
if (parse(&s) != 0) { return 1; };
if (encode(&s) != 0) { return 1; };