#ifndef NODES_H #define NODES_H #include "utils.h" #include typedef struct Node { int128_t a, b, c; char move; struct Node* parent; struct Node* next; } Node; /** * @brief Initializes the node pool with a specified maximum number of nodes * @param max_nodes The maximum number of nodes the pool can hold */ void node_pool_init(int32_t max_nodes); /** * @brief Resets the node pool without freeing memory */ void node_pool_reset(); /** * @brief Frees the node pool memory */ void node_pool_destroy(); /** * @brief Returns the current usage of the node pool * @return The number of nodes currently allocated from the pool */ int32_t node_pool_usage(); /** * @brief Returns the total capacity of the node pool * @return The total capacity of the node pool */ int32_t node_pool_capacity(); /** * @brief Returns the next available node from the pool without incrementing the pointer * @return A pointer to the next available node, or NULL if the pool is exhausted */ Node* node_pool_next(); /** * @brief Marks a triplet as visited and checks if it's new * @param a The first integer of the triplet * @param b The second integer of the triplet * @param c The third integer of the triplet * @return 1 if the triplet is new and marked, 0 if it was already visited */ bool visit_and_mark(int128_t a, int128_t b, int128_t c); /** * @brief Clears the hash table */ void clear_hash_table(); #endif /* NODES_H */