summaryrefslogtreecommitdiff
path: root/vere/pkg/noun/v3/hashtable.c
blob: 3044758e20bac4d700161fad00365742eb90edc3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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;
}