plug memoization leak

This commit is contained in:
Philip C Monk 2015-05-13 18:23:20 -04:00
parent 18080ab9bd
commit 9b9fe1bfb4
2 changed files with 9 additions and 1 deletions

5
n/n.c
View File

@ -86,7 +86,10 @@ _n_hint(u3_noun zep,
}
pro = _n_nock_on(u3k(bus), u3k(nex));
u3z_save_2(c3__nock, bus, nex, pro);
if ( u3R != &(u3H->rod_u) ) {
u3z_save_2(c3__nock, bus, nex, pro);
}
u3z(bus); u3z(nex);
return pro;

View File

@ -1859,6 +1859,8 @@ _raft_grab(u3_noun ova)
har_w = 0, das_w = 0, flu_w = 0, tax_w = 0, mer_w = 0, don_w = 0,
day_w = 0, car_w = 0;
c3_assert( u3R == &(u3H->rod_u) );
fprintf(stderr, "\r\n");
usr_w = _raft_prof(u3_nul, 0, u3A->sac);
fprintf(stderr, "total userspace: ");
@ -1919,6 +1921,9 @@ _raft_grab(u3_noun ova)
fprintf(stderr, "sweep: ");
_raft_print_memory(wep_w);
u3h_free(u3R->cax.har_p);
u3R->cax.har_p = u3h_new();
u3z(u3A->sac);
u3A->sac = u3_nul;
}