u3: moves event-number tracking inside u3u_uniq()

This commit is contained in:
Joe Bryan 2020-07-30 14:51:39 -07:00
parent d7f6e79409
commit 52c86946d7
2 changed files with 17 additions and 12 deletions

View File

@ -313,8 +313,6 @@ u3u_uniq(void)
{
c3_assert( &(u3H->rod_u) == u3R );
ur_root_t *r = ur_hcon_init();
// allow read/write on the whole loom, bypassing page tracking
//
// NB: u3e_save() will reinstate protection flags
@ -323,23 +321,27 @@ u3u_uniq(void)
c3_assert(0);
}
// reallocate kernel
// stash event number
//
ur_nref ken = _cu_from_loom(r, u3A->roc);
c3_d eve_d = u3A->ent_d;
// reallocate cold jet state
// reallocate kernel and cold jet state
//
ur_root_t* rot_u = ur_hcon_init();
ur_nref ken = _cu_from_loom(rot_u, u3A->roc);
ur_nvec_t cod_u;
{
c3_w cod_w = u3h_wyt(u3R->jed.cod_p);
_cu_vec dat_u = { .vec_u = &cod_u, .rot_u = r };
_cu_vec dat_u = { .vec_u = &cod_u, .rot_u = rot_u };
ur_nvec_init(&cod_u, cod_w);
u3h_walk_with(u3R->jed.cod_p, _cu_hamt_walk, &dat_u);
}
// print [rot_u] measurements
//
ur_hcon_info(stderr, r);
ur_hcon_info(stderr, rot_u);
fprintf(stderr, "\r\n");
// reinitialize looom
@ -352,8 +354,8 @@ u3u_uniq(void)
// reallocate all nouns on the loom
//
_cu_loom lom_u;
_cu_atoms_to_loom(r, &lom_u);
_cu_cells_to_loom(r, &lom_u);
_cu_atoms_to_loom(rot_u, &lom_u);
_cu_cells_to_loom(rot_u, &lom_u);
// restore kernel reference (always a cell)
//
@ -381,6 +383,10 @@ u3u_uniq(void)
u3j_boot(c3y);
u3j_ream();
// restore event number
//
u3A->ent_d = eve_d;
// mark all pages dirty
//
memset((void*)u3P.dit_w, 0xff, u3a_pages >> 3);

View File

@ -298,7 +298,8 @@ _cw_uniq(c3_i argc, c3_c* argv[])
c3_assert( 3 <= argc );
c3_c* dir_c = argv[2];
c3_d eve_d = u3m_boot(dir_c);
u3m_boot(dir_c);
u3_serf_grab();
@ -306,8 +307,6 @@ _cw_uniq(c3_i argc, c3_c* argv[])
u3_serf_grab();
u3A->ent_d = eve_d;
u3e_save();
}