From c4b392a179048f936c062f5ffccc2bc25627e500 Mon Sep 17 00:00:00 2001 From: polwex Date: Mon, 6 Oct 2025 01:01:41 +0700 Subject: working --- vere/pkg/noun/v3/hashtable.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 vere/pkg/noun/v3/hashtable.c (limited to 'vere/pkg/noun/v3/hashtable.c') diff --git a/vere/pkg/noun/v3/hashtable.c b/vere/pkg/noun/v3/hashtable.c new file mode 100644 index 0000000..3044758 --- /dev/null +++ b/vere/pkg/noun/v3/hashtable.c @@ -0,0 +1,33 @@ +/// @file + +#include "v3/hashtable.h" + +#include "../allocate.h" +#include "../vortex.h" + +#include "v3/allocate.h" +#include "v3/vortex.h" + +/* u3h_v3_new_cache(): create hashtable with bounded size. +*/ +u3p(u3h_v3_root) +u3h_v3_new_cache(c3_w max_w) +{ + // set globals (required for aliased functions) + u3H = (u3v_home*) u3H_v3; + u3R = (u3a_road*) u3R_v3; + + u3h_v3_root* har_u = u3a_v3_walloc(c3_wiseof(u3h_v3_root)); + u3p(u3h_v3_root) har_p = u3of(u3h_v3_root, har_u); + c3_w i_w; + + har_u->max_w = max_w; + har_u->use_w = 0; + har_u->arm_u.mug_w = 0; + har_u->arm_u.inx_w = 0; + + for ( i_w = 0; i_w < 64; i_w++ ) { + har_u->sot_w[i_w] = 0; + } + return har_p; +} -- cgit v1.2.3