Skip to content

Commit 8a82661

Browse files
fix(parser): use long long layout
because `long` is smaller than `size_t` on Windows
1 parent 09dd2ad commit 8a82661

File tree

1 file changed

+2
-2
lines changed
  • src/main/java/io/github/treesitter/jtreesitter

1 file changed

+2
-2
lines changed

src/main/java/io/github/treesitter/jtreesitter/Parser.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ public String toString() {
326326
/** A class representing a cancellation flag. */
327327
public static class CancellationFlag {
328328
private final Arena arena = Arena.ofAuto();
329-
private final MemorySegment segment = arena.allocate(C_LONG);
329+
private final MemorySegment segment = arena.allocate(C_LONG_LONG);
330330
private final AtomicLong value = new AtomicLong();
331331

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

0 commit comments

Comments
 (0)