u3: adds u3j_stay/load to manage cold jet state

This commit is contained in:
Joe Bryan 2019-11-20 11:36:27 -08:00
parent c8b36220f0
commit 0c6914f505
2 changed files with 37 additions and 0 deletions

View File

@ -190,6 +190,16 @@
void
u3j_ream(void);
/* u3j_stay(): extract cold state
*/
u3_noun
u3j_stay(void);
/* u3j_load(): inject cold state
*/
void
u3j_load(u3_noun rel);
/* u3j_reap(): promote jet state.
*/
void

View File

@ -2191,6 +2191,33 @@ u3j_ream(void)
u3h_walk(u3R->jed.han_p, _cj_ream_hank);
}
/* u3j_stay(): extract cold state
*/
u3_noun
u3j_stay(void)
{
u3_noun rel = u3_nul;
c3_assert(u3R == &(u3H->rod_u));
u3h_walk_with(u3R->jed.cod_p, _cj_warm_tap, &rel);
return rel;
}
/* u3j_load(): inject cold state
*/
void
u3j_load(u3_noun rel)
{
u3_noun ler = rel;
u3_noun lor;
while ( u3_nul != ler ) {
u3x_cell(ler, &lor, &ler);
u3h_put(u3R->jed.cod_p, u3h(lor), u3k(u3t(lor)));
}
u3z(rel);
}
/* _cj_fink_mark(): mark a u3j_fink for gc.
*/
static c3_w