Closed 414owen closed 2 years ago
Woops, test fail with -DDEBUG
btw, what's the point of using static
for functions?
btw, what's the point of using
static
for functions?
static
functions are only visible within the current compilation unit, so the only functions our file exports are the tree_sitter_haskell*
functions. It just lets the compiler do more optimizations, inline things that it otherwise wouldn't have been, do dead code analysis, that sort of thing.
I'd deleted an important line of code -_-
@414owen Any chance of getting rid of realloc? (Or conditionally getting rid of it with #ifdef __EMSCRIPTEN__
?)
@wenkokke realloc
seems pretty important. Let's see if upstream wants to include it: https://github.com/tree-sitter/tree-sitter/pull/1571
(I assume _realloc
is the correct way to do this?)
@414owen _realloc
is correct, yes :)
@tek this is safe to merge
None of this has had any tangible impact on performance, so either the compiler already knew what to do, or the scanner is no longer the bottleneck.
We might avoid a few potential stackoverflows though.