Avoid one heap allocation when instantiating a TSTreeCursor
This commit is contained in:
parent
6fc8d9871c
commit
e3670be42f
8 changed files with 96 additions and 86 deletions
|
|
@ -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_
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue