aboutsummaryrefslogtreecommitdiff
path: root/src/numerics.hpp
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2024-07-26 17:01:20 +0100
committerAryadev Chavali <aryadev@aryadevchavali.com>2024-07-26 17:01:20 +0100
commit163f1e691a4364d959d320aa429e537aed50e162 (patch)
treeb0dc65ae4a866d8b8179581a8d8a54db1d4fbe32 /src/numerics.hpp
parent8cbc60279937adcd8edfcb12866cd56ecd1f1376 (diff)
downloadcw_tree-163f1e691a4364d959d320aa429e537aed50e162.tar.gz
cw_tree-163f1e691a4364d959d320aa429e537aed50e162.tar.bz2
cw_tree-163f1e691a4364d959d320aa429e537aed50e162.zip
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.
Diffstat (limited to 'src/numerics.hpp')
-rw-r--r--src/numerics.hpp4
1 files changed, 3 insertions, 1 deletions
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<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);