Avoid one heap allocation when instantiating a TSTreeCursor

This commit is contained in:
Max Brunsfeld 2018-05-16 16:05:08 -07:00
parent 6fc8d9871c
commit e3670be42f
8 changed files with 96 additions and 86 deletions

View file

@ -10,11 +10,11 @@ typedef struct {
uint32_t structural_child_index;
} TreeCursorEntry;
struct TSTreeCursor {
const TSTree *tree;
typedef struct {
Array(TreeCursorEntry) stack;
};
const TSTree *tree;
} TreeCursor;
void ts_tree_cursor_init(TSTreeCursor *, const TSTree *);
void ts_tree_cursor_init(TreeCursor *, const TSTree *);
#endif // RUNTIME_TREE_CURSOR_H_