Skip to content

Commit

Permalink
fix(parser): use long long layout
Browse files Browse the repository at this point in the history
because `long` is smaller than `size_t` on Windows
  • Loading branch information
ObserverOfTime committed Dec 8, 2024
1 parent 09dd2ad commit 8a82661
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/io/github/treesitter/jtreesitter/Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ public String toString() {
/** A class representing a cancellation flag. */
public static class CancellationFlag {
private final Arena arena = Arena.ofAuto();
private final MemorySegment segment = arena.allocate(C_LONG);
private final MemorySegment segment = arena.allocate(C_LONG_LONG);
private final AtomicLong value = new AtomicLong();

/** Creates an uninitialized cancellation flag. */
Expand All @@ -341,7 +341,7 @@ public long get() {
@SuppressWarnings("unused")
public void set(long value) {
// NOTE: can't use _ because of palantir/palantir-java-format#934
segment.set(C_LONG, 0, this.value.updateAndGet(o -> value));
segment.set(C_LONG_LONG, 0L, this.value.updateAndGet(o -> value));
}
}
}

0 comments on commit 8a82661

Please sign in to comment.