diff --git a/include/noun/hashtable.h b/include/noun/hashtable.h index 37878810d..871f47f29 100644 --- a/include/noun/hashtable.h +++ b/include/noun/hashtable.h @@ -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; diff --git a/noun/hashtable.c b/noun/hashtable.c index ebd0d15f6..662af8ee7 100644 --- a/noun/hashtable.c +++ b/noun/hashtable.c @@ -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;