Skip to content

Commit

Permalink
wip: naive persistence
Browse files Browse the repository at this point in the history
  • Loading branch information
matthew-levan committed Jul 28, 2023
1 parent a315e2f commit cdd3b85
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
13 changes: 3 additions & 10 deletions pkg/noun/nock.c
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,6 @@ _n_bint(u3_noun* ops, u3_noun hif, u3_noun nef, c3_o los_o, c3_o tel_o)
++tot_w; _n_emit(ops, (c3y == los_o) ? BALT : BAST);
break;

// %memo hint implementation
case c3__memo: {
u3_noun mem = u3_nul;
c3_w mem_w = 0;
Expand Down Expand Up @@ -2611,7 +2610,6 @@ _n_burn(u3n_prog* pog_u, u3_noun bus, c3_ys mov, c3_ys off)
skim_out:
o = u3k(mem_u->key);
x = u3nc(x, o);
fprintf(stderr, "skim_out\r\n");
o = u3z_find_m(144 + c3__nock, x);
if ( u3_none == o ) {
_n_push(mov, off, x);
Expand All @@ -2628,14 +2626,9 @@ _n_burn(u3n_prog* pog_u, u3_noun bus, c3_ys mov, c3_ys off)
x = _n_pep(mov, off);
top = _n_peek(off);
o = *top;
// if ( &(u3H->rod_u) != u3R ) {
// u3z_save_m(144 + c3__nock, o, x);
// }

// save in the cache no matter which road we're on
fprintf(stderr, "do_save\r\n");
u3z_save_m(144 + c3__nock, o, x);

if ( &(u3H->rod_u) != u3R ) {
u3z_save_m(144 + c3__nock, o, x);
}
*top = x;
u3z(o);
BURN();
Expand Down
1 change: 0 additions & 1 deletion pkg/noun/zave.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ u3z_key_5(c3_m fun, u3_noun one, u3_noun two, u3_noun tri, u3_noun qua, u3_noun
u3_weak
u3z_find(u3_noun key)
{
fprintf(stderr, "u3z_find\r\n");
return u3h_get(u3R->cax.har_p, key);
}
u3_weak
Expand Down

0 comments on commit cdd3b85

Please sign in to comment.