Remove interior mutability for parent-node caching in Tree

In Rust binding, mark Tree as Sync
This commit is contained in:
Max Brunsfeld 2021-05-20 13:36:57 -07:00
parent 019148b304
commit 399b5e4daf
4 changed files with 3 additions and 59 deletions

View file

@ -15,17 +15,12 @@ typedef struct {
struct TSTree {
Subtree root;
const TSLanguage *language;
ParentCacheEntry *parent_cache;
uint32_t parent_cache_start;
uint32_t parent_cache_size;
TSRange *included_ranges;
unsigned included_range_count;
};
TSTree *ts_tree_new(Subtree root, const TSLanguage *language, const TSRange *, unsigned);
TSNode ts_node_new(const TSTree *, const Subtree *, Length, TSSymbol);
TSNode ts_tree_get_cached_parent(const TSTree *, const TSNode *);
void ts_tree_set_cached_parent(const TSTree *, const TSNode *, const TSNode *);
#ifdef __cplusplus
}