From 163f1e691a4364d959d320aa429e537aed50e162 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Fri, 26 Jul 2024 17:01:20 +0100 Subject: 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. --- src/numerics.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/numerics.hpp') diff --git a/src/numerics.hpp b/src/numerics.hpp index 3d74202..ac22ff4 100644 --- a/src/numerics.hpp +++ b/src/numerics.hpp @@ -53,7 +53,9 @@ struct NodeAllocator std::vector 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); -- cgit v1.2.3-13-gbd6f