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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user