refactor(packages): 0.R5 - jobs, session, settings, hints and net make their tables when the state is made, not on the first question (jobs__ensure, session__init and ply_init, sg_init, hn_mute_ensure, net__init gone); their questions read

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-27 01:29:32 +03:00
parent 63c30b9ebe
commit 9e4f4edb92
21 changed files with 98 additions and 163 deletions

View file

@ -22,7 +22,6 @@ export function nb_copy(dst: []byte, d: int, src: []byte, s: int, n: int) -> voi
# the writer: past the MTU it counts on and keeps nothing, and np_queue cuts the message there
export function nw_begin(net_st: mut NetState) -> void {
net__init(net_st)
net_st.net__wl = 0
}
@ -82,7 +81,6 @@ export function nr_bad(net_st: NetState) -> bool { return net_st.net__rbad }
# a message that came in, made the one nr_* reads
export function net_read(net_st: mut NetState, m: NetMessage) -> void {
net__init(net_st)
nb_copy(net_st.net__rb, 0, m.data, 0, m.len)
net_st.net__rl = m.len
net_st.net__rp = 0
@ -90,8 +88,7 @@ export function net_read(net_st: mut NetState, m: NetMessage) -> void {
}
# the message just written, as if it had come in (a loopback: a test, a host telling itself)
export function net_written(net_st: mut NetState) -> NetMessage {
net__init(net_st)
export function net_written(net_st: NetState) -> NetMessage {
let m = new NetMessage
m.from = net_st.net__my_pid
m.len = min(net_st.net__wl, NET_MTU)