Skip to content

Don't use clock_gettime on macOS - #361

Merged
nathansobo merged 1 commit into
tree-sitter:masterfrom
as-cii:dont-use-clock-monotonic-on-mac
Jun 12, 2019
Merged

nathansobo merged 1 commit into
tree-sitter:masterfrom
as-cii:dont-use-clock-monotonic-on-mac

Conversation

@as-cii

@as-cii as-cii commented Jun 12, 2019

Copy link
Copy Markdown
Contributor

This pull request stops using the monotonic clock API on macOS because it is supported only on macOS >= 10.12. Instead, it uses the fallback clock APIs for platforms without monotonic clock support.

The use of clock_gettime was causing issues on Atom because, even though we build it on a new macOS version supporting such API, some users may run Atom on older versions of macOS. On those platforms, Atom would crash whenever opening a file parsed with a tree-sitter grammar.

This commit stops using the monotonic clock API on macOS because it is 
supported only on macOS >= 10.12. Instead, it uses the fallback clock 
APIs for platforms without monotonic clock support.

The use of `clock_gettime` was causing issues on Atom because, even 
though we build it on a new macOS version supporting such API, some 
users may run Atom on older versions of macOS. On those platforms, Atom 
would crash whenever opening a file parsed with a tree-sitter grammar.
@nathansobo
nathansobo merged commit 4ac56b4 into tree-sitter:master Jun 12, 2019
@nathansobo
nathansobo deleted the dont-use-clock-monotonic-on-mac branch June 12, 2019 17:31
nathansobo pushed a commit to nathansobo/node-tree-sitter that referenced this pull request Jun 12, 2019
nathansobo pushed a commit to atom/node-tree-sitter that referenced this pull request Jun 12, 2019
This change was merged into tree-sitter/master from 
tree-sitter/tree-sitter#361, but master was way 
ahead of the submodule version in node-tree-sitter and upgrading caused 
failures.
maxbrunsfeld pushed a commit that referenced this pull request Jun 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants