diff options
| author | polwex <polwex@sortug.com> | 2025-10-06 01:01:41 +0700 |
|---|---|---|
| committer | polwex <polwex@sortug.com> | 2025-10-06 01:01:41 +0700 |
| commit | c4b392a179048f936c062f5ffccc2bc25627e500 (patch) | |
| tree | 09be0904be8ec4d7ea52992ef7580d42ed0c28c1 /vere/pkg/noun/v3/hashtable.c | |
working
Diffstat (limited to 'vere/pkg/noun/v3/hashtable.c')
| -rw-r--r-- | vere/pkg/noun/v3/hashtable.c | 33 |
1 files changed, 33 insertions, 0 deletions
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; +} |
