summaryrefslogtreecommitdiffstats
path: root/src/trie.h
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2023-06-19 16:58:45 -0400
committerTavian Barnes <tavianator@tavianator.com>2023-06-20 14:26:09 -0400
commit4b177a01a7f4e83f67af2200ec69505b75a3c399 (patch)
tree576028dbd29a0eae452ecd6b7de929de211a6d64 /src/trie.h
parent1649d37f7c88f8a5930fdd4c1ff1b59212da90ee (diff)
downloadbfs-4b177a01a7f4e83f67af2200ec69505b75a3c399.tar.xz
trie: Arena-allocate nodes and leaves
Diffstat (limited to 'src/trie.h')
-rw-r--r--src/trie.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/trie.h b/src/trie.h
index 6bd211e..6921f62 100644
--- a/src/trie.h
+++ b/src/trie.h
@@ -5,6 +5,7 @@
#define BFS_TRIE_H
#include "config.h"
+#include "alloc.h"
#include <stddef.h>
#include <stdint.h>
@@ -30,6 +31,10 @@ struct trie {
uintptr_t root;
/** Linked list of leaves. */
struct trie_leaf *head, *tail;
+ /** Node allocator. */
+ struct varena nodes;
+ /** Leaf allocator. */
+ struct varena leaves;
};
/**