summaryrefslogtreecommitdiff
path: root/source/storage/b_tree.h
diff options
context:
space:
mode:
authornasr <nsrddyn@gmail.com>2026-03-08 21:01:43 +0000
committernasr <nsrddyn@gmail.com>2026-03-08 21:01:43 +0000
commit71ced998122c357bc62e54d9bb4e124c88acf94b (patch)
tree746fca3d71a8640478ad6b6f4429a19f4dfbbda8 /source/storage/b_tree.h
parentf8f24f8c67fe903e267ab29bb2fbb9d334a722de (diff)
refactor(main): worked on string handling in C and other stuff
Diffstat (limited to 'source/storage/b_tree.h')
-rw-r--r--source/storage/b_tree.h44
1 files changed, 0 insertions, 44 deletions
diff --git a/source/storage/b_tree.h b/source/storage/b_tree.h
deleted file mode 100644
index 10ad00d..0000000
--- a/source/storage/b_tree.h
+++ /dev/null
@@ -1,44 +0,0 @@
1#ifndef BTREE_H
2#define BTREE_H
3
4// maximum height of the tree the lower the lower the lower amount
5// of disk reads which translates into faster?
6#define B_TREE_ORDER 4
7
8typedef struct b_tree_node b_tree_node;
9struct b_tree_node
10{
11
12 // store the values
13 string8 keys[B_TREE_ORDER - 1];
14 csv_row *rows[B_TREE_ORDER - 1];
15
16 b_tree_node *parent;
17 // handle to store children faster than linked list
18 // because now we can iteratate over the nodes instead of having cache misses
19 // when jumping through linked nodes
20 b_tree_node *children[B_TREE_ORDER];
21
22 // NOTE(nasr): reference count ::: check how many leaves are using this node
23 // also not needed for now because we don't free individual node because of arena allocator
24 // i32 *refc;
25
26 i32 key_count;
27
28 b32 leaf;
29
30};
31
32typedef struct b_tree b_tree;
33struct b_tree
34{
35 // NOTE(nasr): make sure this always stays in memory
36 // so that initial fetch never requires a disk read
37 b_tree_node *root;
38
39};
40
41
42
43
44#endif /* BTREE_H */