Fix some memory management bugs with trees

This commit is contained in:
Max Brunsfeld 2014-03-01 00:25:05 -08:00
parent 21c0f51b84
commit ded54a3a1a
5 changed files with 32 additions and 32 deletions

View file

@ -27,9 +27,9 @@ typedef struct ts_tree {
} data;
} ts_tree;
ts_tree * ts_tree_make_leaf(ts_symbol symbol);
ts_tree * ts_tree_make_leaf(ts_symbol symbol, size_t size, size_t offset);
ts_tree * ts_tree_make_node(ts_symbol symbol, size_t child_count, ts_tree **children);
ts_tree * ts_tree_make_error(char lookahead_char, size_t expected_input_count, const ts_symbol *expected_inputs);
ts_tree * ts_tree_make_error(char lookahead_char, size_t expected_input_count, const ts_symbol *expected_inputs, size_t size, size_t offset);
void ts_tree_retain(ts_tree *tree);
void ts_tree_release(ts_tree *tree);
int ts_tree_equals(const ts_tree *tree1, const ts_tree *tree2);