}
/*
- * Insert @bucket to the set of potential buckets in @node
+ * Insert @bucket_id to the set of potential buckets in @node
*/
static inline void
-aggregator_node_add_potential_bucket(struct trie_node *node, const struct aggregator_bucket *bucket)
+aggregator_node_add_potential_bucket(struct trie_node *node, u32 bucket_id)
{
ASSERT_DIE(node->potential_buckets_count < MAX_POTENTIAL_BUCKETS_COUNT);
- if (BIT32R_TEST(node->potential_buckets, bucket->id))
+ if (BIT32R_TEST(node->potential_buckets, bucket_id))
return;
- BIT32R_SET(node->potential_buckets, bucket->id);
+ BIT32R_SET(node->potential_buckets, bucket_id);
node->potential_buckets_count++;
}
/* For the leaf node, by definition, the only bucket in the bitmap is the
* original bucket. */
- aggregator_node_add_potential_bucket(node, node->original_bucket);
+ aggregator_node_add_potential_bucket(node, node->original_bucket->id);
/* No children, no further work. Done! */
return;
* and nothing else. This fixes the (kinda) missing first pass
* when comparing our algorithm to the original one. */
struct trie_node imaginary_node = { 0 };
- aggregator_node_add_potential_bucket(&imaginary_node, node->original_bucket);
+ aggregator_node_add_potential_bucket(&imaginary_node, node->original_bucket->id);
/* Process children */
if (left)
};
/* Imaginary node inherits bucket from its parent - current node */
- aggregator_node_add_potential_bucket(&imaginary_node, node->original_bucket);
+ aggregator_node_add_potential_bucket(&imaginary_node, node->original_bucket->id);
/*
* If the current node (parent of the imaginary node) has a bucket, then
ASSERT_DIE(left == node || right == node);
struct trie_node imaginary_node = { 0 };
- aggregator_node_add_potential_bucket(&imaginary_node, parent->original_bucket);
+ aggregator_node_add_potential_bucket(&imaginary_node, parent->original_bucket->id);
/* Nodes with only one child */
if (left && !right)