Skip to content

Commit

Permalink
davide
Browse files Browse the repository at this point in the history
  • Loading branch information
matthew-levan committed Aug 29, 2023
1 parent 5b68c5f commit 22e43a5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
6 changes: 3 additions & 3 deletions pkg/noun/allocate.c
Original file line number Diff line number Diff line change
Expand Up @@ -2185,7 +2185,7 @@ u3a_reclaim(void)
u3R->cax.har_p = u3h_new();

// XX clear the persistent cache?
fprintf(stderr, "u3a_reclaim: freeing persistent cache\r\n");
// fprintf(stderr, "u3a_reclaim: freeing persistent cache\r\n");
// u3h_free(u3R->cax.per_p);
// u3R->cax.per_p = u3h_new();
}
Expand All @@ -2203,7 +2203,7 @@ u3a_rewrite_compact(void)
u3a_rewrite_noun(u3R->pro.trace);
u3h_rewrite(u3R->cax.har_p);
// XX rewrite persistent cache?
fprintf(stderr, "u3a_rewrite_compact: rewrite persistent cache\r\n");
// fprintf(stderr, "u3a_rewrite_compact: rewrite persistent cache\r\n");
// u3h_rewrite(u3R->cax.per_p);

u3R->ski.gul = u3a_rewritten_noun(u3R->ski.gul);
Expand All @@ -2214,7 +2214,7 @@ u3a_rewrite_compact(void)
u3R->pro.trace = u3a_rewritten_noun(u3R->pro.trace);
u3R->cax.har_p = u3a_rewritten(u3R->cax.har_p);
// XX persistent cache?
fprintf(stderr, "u3a_rewrite_compact: rewritten persistent cache\r\n");
// fprintf(stderr, "u3a_rewrite_compact: rewritten persistent cache\r\n");
// u3R->cax.per_p = u3a_rewritten(u3R->cax.per_p);
}

Expand Down
6 changes: 5 additions & 1 deletion pkg/noun/jets.c
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,8 @@ _cj_nail(u3_noun loc, u3_noun axe,
u3_weak act;
act = _cj_find_warm(loc);
if ( u3_none == act ) {
fprintf(stderr, "_cj_nail: %p\r\n", u3a_into(u3H->rod_u.jed.war_p));
fprintf(stderr, "_cj_nail: jed: %p\r\n", &u3H->rod_u.jed);
fprintf(stderr, "_cj_nail: jed.war_p: %p\r\n", u3a_into(u3H->rod_u.jed.war_p));
}
u3_assert(u3_none != act);
u3x_qual(act, &jax, &hap, &bal, &jit);
Expand Down Expand Up @@ -2019,6 +2020,7 @@ u3a_jets
u3j_take(u3a_jets jed_u)
{
jed_u.war_p = u3h_take(jed_u.war_p);
u3l_log("u3j_take: set war_p: %p", u3a_into(jed_u.war_p));
jed_u.cod_p = u3h_take(jed_u.cod_p);
jed_u.han_p = u3h_take_with(jed_u.han_p, _cj_take_hank_cb);
jed_u.bas_p = u3h_take(jed_u.bas_p);
Expand Down Expand Up @@ -2185,6 +2187,7 @@ u3j_ream(void)
u3_assert(u3R == &(u3H->rod_u));
u3h_free(u3R->jed.war_p);
u3R->jed.war_p = u3h_new();
u3l_log("u3j_ream: set war_p: %p", u3a_into(u3R->jed.war_p));
u3h_walk_with(u3R->jed.cod_p, _cj_warm_tap, &rel);
_cj_ream(rel);
u3z(rel);
Expand Down Expand Up @@ -2410,6 +2413,7 @@ u3j_rewrite_compact()
}

u3R->jed.war_p = u3a_rewritten(u3R->jed.war_p);
u3l_log("u3j_rewrite_compact: set war_p: %p", u3a_into(u3R->jed.war_p));
u3R->jed.cod_p = u3a_rewritten(u3R->jed.cod_p);
u3R->jed.han_p = u3a_rewritten(u3R->jed.han_p);
u3R->jed.bas_p = u3a_rewritten(u3R->jed.bas_p);
Expand Down
19 changes: 10 additions & 9 deletions pkg/noun/manage.c
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,7 @@ _pave_parts(void)
u3R->cax.har_p = u3h_new_cache(u3C.hap_w); // transient
u3R->cax.per_p = u3h_new_cache(u3C.per_w); // persistent
u3R->jed.war_p = u3h_new();
u3l_log("_pave_parts: set war_p: %p", u3a_into(u3R->jed.war_p));
u3R->jed.cod_p = u3h_new();
u3R->jed.han_p = u3h_new();
u3R->jed.bas_p = u3h_new();
Expand Down Expand Up @@ -612,7 +613,7 @@ _find_home(void)
c3_w siz_w = c3_wiseof(u3v_home);
c3_w *mat_w = c3_align(mem_w + len_w - siz_w, u3C.balign_d, C3_ALGLO);

if ( U3V_VER1 > ver_w ) {
if ( U3V_VER2 > ver_w ) {
u3m_migrate(ver_w, U3V_VER3);
}

Expand Down Expand Up @@ -2148,6 +2149,7 @@ u3m_boot(c3_c* dir_c, size_t len_i)
*/
if ( c3n == nuu_o ) {
u3j_ream();
u3l_log("U3N_REAM");
u3n_ream();
// u3z_ream();
return u3A->eve_d;
Expand Down Expand Up @@ -2428,6 +2430,7 @@ _migrate_memoization()
rod_u.all.fre_w = rud_u->all.fre_w;
rod_u.all.max_w = rud_u->all.max_w;

rod_u.jed = rud_u->jed;
rod_u.jed.hot_p = rud_u->jed.hot_p;
rod_u.jed.war_p = rud_u->jed.war_p;
rod_u.jed.cod_p = rud_u->jed.cod_p;
Expand All @@ -2454,15 +2457,13 @@ _migrate_memoization()
c3_w *mat_w = c3_align(mem_w + len_w - siz_w, u3C.balign_d, C3_ALGLO);
memcpy(&hum_u->rod_u, &rod_u, sizeof(u3a_road));

// manually set version
hom_u.ver_w = U3V_VER3;
memcpy(&hum_u->ver_w, &hom_u.ver_w, sizeof(u3v_version));
// update version
hum_u->ver_w = U3V_VER3;

// copy old arvo to new arvo
memcpy(&hum_u->arv_u, &hum_u->arv_u, sizeof(u3v_arvo));

u3v_home tes_u = *((u3v_home *)mat_w);
fprintf(stderr, "_migrate_memoization: %p\r\n", u3a_into(tes_u.rod_u.jed.war_p));
u3H = (u3v_home*)hum_u;
u3R = &u3H->rod_u;
fprintf(stderr, "_migrate_memoization: jed: %p\r\n", &u3H->rod_u.jed);
fprintf(stderr, "_migrate_memoization: jed.war_p: %p\r\n", u3a_into(u3H->rod_u.jed.war_p));
}

/* u3m_migrate: perform loom migration if necessary.
Expand Down

0 comments on commit 22e43a5

Please sign in to comment.