aboutsummaryrefslogtreecommitdiff
path: root/include/tt_llcht.c
diff options
context:
space:
mode:
Diffstat (limited to 'include/tt_llcht.c')
-rw-r--r--include/tt_llcht.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/include/tt_llcht.c b/include/tt_llcht.c
index 60f8ccc..51ebad9 100644
--- a/include/tt_llcht.c
+++ b/include/tt_llcht.c
@@ -29,7 +29,7 @@ static tt_entry_t *table[TT_LLCHT_SIZE+1];
tt_entry_t * new_ll_node(const uint64_t key, const enum TT_FLAG flag,
const uint8_t depth, const float value,
- const action_t action);
+ const action_t best);
// ===================================================================
@@ -63,8 +63,9 @@ tt_entry_t *tt_seek(const uint64_t key) {
int tt_insert(const uint64_t key, const enum TT_FLAG flag,
const uint8_t depth, const float value,
- const action_t action) {
- tt_entry_t *new = new_ll_node(key, flag, depth, value, action), *n;
+ const action_t best) {
+ tt_entry_t *n,
+ *new = new_ll_node(key, flag, depth, value, best);
// TODO: trap
const uint32_t idx = key & TT_LLCHT_SIZE;
@@ -84,14 +85,14 @@ int tt_insert(const uint64_t key, const enum TT_FLAG flag,
tt_entry_t * new_ll_node(const uint64_t key, const enum TT_FLAG flag,
const uint8_t depth, const float value,
- const action_t action) {
+ const action_t best) {
tt_entry_t *new = malloc(sizeof(struct tt_node_s));
// TODO: trap errno
new->key = key;
+ new->best = best;
new->next = NULL;
new->flag = flag;
new->depth = depth;
new->value = value;
- new->action = action;
return new;
}