This commit is contained in:
Paul Driver 2017-11-07 10:02:33 -08:00 committed by Ted Blackman
parent f6d30a0700
commit 495845a59f
2 changed files with 9 additions and 10 deletions

View File

@ -35,17 +35,15 @@
*/
typedef struct {
c3_w map_w;
c3_y arm_w;
u3h_slot sot_w[0];
} u3h_node;
/* u3h_root: hash root table, with future-proof clock.
* If clk_w is greater than zero, this table is a cache.
/* u3h_root: hash root table
*/
typedef struct {
c3_w clk_w;
c3_w use_w;
c3_y arm_w;
c3_w use_w; // number of lines currently filled
c3_w max_w; // number of cache lines (0 for no trimming)
c3_w clk_w; // clock arm, current hash
u3h_slot sot_w[64];
} u3h_root;
@ -53,7 +51,6 @@
*/
typedef struct {
c3_w len_w;
c3_y arm_w;
u3h_slot sot_w[0];
} u3h_buck;

View File

@ -296,11 +296,11 @@ _ch_trim_node(u3h_slot* sot_w, c3_w lef_w)
}
u3a_wfree(han_u);
}
else {
han_u->arm_w += 1;
}
return c3y;
}
else {
han_u->arm_w += 1;
}
}
han_u->arm_w = 0;
@ -333,6 +333,8 @@ _ch_trim_slot(u3h_slot *sot_w, c3_w lef_w)
}
else {
u3_noun kev = u3h_slot_to_noun(*sot_w);
fprintf(stderr, "addr: %p\r\n", kev);
u3m_p("losing(trim)", kev);
u3z(kev);
*sot_w = 0;
return c3y;