8 /* b-tree definitions */
9 #define TREE_NODE_SIZE 128 /* a power of 2 is probably best */
10 #define TREE_NODE_MID 63 /* must be ceiling(TREE_NODE_SIZE / 2) - 1 */
12 /* linked list definitions */
13 #define LIST_ARRAY_SIZE 64
15 /* doubly-linked list node */
17 struct _dllnode
*previous
;
18 struct _slotblock
*sb
;
19 struct _dllnode
*next
;
26 struct _dllnode
*listblock
;
29 typedef struct _dllnode dllnode
;
30 typedef struct _slotblock slotblock
;
35 slotblock blocks
[TREE_NODE_SIZE
];
36 struct _btreenode
*child
[TREE_NODE_SIZE
+ 1];
38 typedef struct _btreenode btreenode
;
41 typedef struct _slotset
{
42 btreenode
*btree_root
;
43 dllnode
*list_array
[LIST_ARRAY_SIZE
];
48 typedef struct _slotblock
54 typedef struct _slotset
63 slotset
*new_slotset(CmiInt8 startslot
, CmiInt8 nslots
);
64 CmiInt8
get_slots(slotset
*ss
, CmiInt8 nslots
);
65 void grab_slots(slotset
*ss
, CmiInt8 sslot
, CmiInt8 nslots
);
66 void free_slots(slotset
*ss
, CmiInt8 sslot
, CmiInt8 nslots
);