NodeAllocator can now get nodes by value or by reference

Abstracting the interface more, such that callers can use functions
rather than accessing internals directly, allows me to refactor the
allocator without having to do a ton of edits all across the source
tree.
This commit is contained in:
2024-07-26 17:01:20 +01:00
parent 8cbc602799
commit 163f1e691a
2 changed files with 31 additions and 13 deletions

View File

@@ -53,7 +53,9 @@ struct NodeAllocator
std::vector<Node> vec;
NodeAllocator(word_t capacity);
word_t alloc_node(Node n);
word_t alloc(Node n);
Node getVal(word_t n) const;
Node &getRef(word_t n);
};
word_t gcd(word_t a, word_t b);