aboutsummaryrefslogtreecommitdiffstats
path: root/src/badlib.h
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2024-06-16 15:00:19 +0200
committerBad Diode <bd@badd10de.dev>2024-06-16 15:00:19 +0200
commit2e7f414c65d89ebe52570b0b0fb9b7ff2585bf96 (patch)
tree61a0178c877e69f674daff465fba30af76b379ab /src/badlib.h
parentc2c8796511c90930c41700f5fcd2043a5c4405c9 (diff)
downloadbdl-2e7f414c65d89ebe52570b0b0fb9b7ff2585bf96.tar.gz
bdl-2e7f414c65d89ebe52570b0b0fb9b7ff2585bf96.zip
Add graphviz visualization for the parse tree
Diffstat (limited to 'src/badlib.h')
-rw-r--r--src/badlib.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/badlib.h b/src/badlib.h
index 71f4bee..4944d2e 100644
--- a/src/badlib.h
+++ b/src/badlib.h
@@ -832,6 +832,9 @@ _array_maybe_grow(void *arr, sz type_size, Arena *a) {
832 832
833static inline char * 833static inline char *
834_array_insert(char *arr, const char *src, sz n_bytes, sz type_size, Arena *a) { 834_array_insert(char *arr, const char *src, sz n_bytes, sz type_size, Arena *a) {
835 if (!arr) {
836 arr = _array_reserve(0, 0, a);
837 }
835 ArrayHeader *head = array_head(arr); 838 ArrayHeader *head = array_head(arr);
836 sz new_size = n_bytes + head->size; 839 sz new_size = n_bytes + head->size;
837 if (new_size > head->cap * type_size) { 840 if (new_size > head->cap * type_size) {