From e260451ce33c1cf1dc54ad419f339f0c87e891f7 Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Fri, 14 Jun 2024 10:56:24 +0200 Subject: [PATCH 01/69] panama-backend - basic integration with jextract --- feature_tests/java/somelib/.gitignore | 38 + feature_tests/java/somelib/pom.xml | 17 + .../java/dev/diplomattest/somelib/Main.java | 17 + .../somelib/ntv/BorrowedFields.java | 219 + .../somelib/ntv/BorrowedFieldsReturning.java | 127 + .../somelib/ntv/BorrowedFieldsWithBounds.java | 219 + .../somelib/ntv/DiplomatBoolArray.java | 173 + .../somelib/ntv/DiplomatBoolView.java | 173 + .../somelib/ntv/DiplomatCharArray.java | 173 + .../somelib/ntv/DiplomatCharView.java | 173 + .../somelib/ntv/DiplomatF32Array.java | 173 + .../somelib/ntv/DiplomatF32View.java | 173 + .../somelib/ntv/DiplomatF64Array.java | 173 + .../somelib/ntv/DiplomatF64View.java | 173 + .../somelib/ntv/DiplomatI16Array.java | 173 + .../somelib/ntv/DiplomatI16View.java | 173 + .../somelib/ntv/DiplomatI32Array.java | 173 + .../somelib/ntv/DiplomatI32View.java | 173 + .../somelib/ntv/DiplomatI64Array.java | 173 + .../somelib/ntv/DiplomatI64View.java | 173 + .../somelib/ntv/DiplomatI8Array.java | 173 + .../somelib/ntv/DiplomatI8View.java | 173 + .../somelib/ntv/DiplomatIsizeArray.java | 173 + .../somelib/ntv/DiplomatIsizeView.java | 173 + .../somelib/ntv/DiplomatString16Array.java | 173 + .../somelib/ntv/DiplomatString16View.java | 173 + .../somelib/ntv/DiplomatStringArray.java | 173 + .../somelib/ntv/DiplomatStringView.java | 173 + .../somelib/ntv/DiplomatStrings16Array.java | 173 + .../somelib/ntv/DiplomatStrings16View.java | 173 + .../somelib/ntv/DiplomatStringsArray.java | 173 + .../somelib/ntv/DiplomatStringsView.java | 173 + .../somelib/ntv/DiplomatU16Array.java | 173 + .../somelib/ntv/DiplomatU16View.java | 173 + .../somelib/ntv/DiplomatU32Array.java | 173 + .../somelib/ntv/DiplomatU32View.java | 173 + .../somelib/ntv/DiplomatU64Array.java | 173 + .../somelib/ntv/DiplomatU64View.java | 173 + .../somelib/ntv/DiplomatU8Array.java | 173 + .../somelib/ntv/DiplomatU8View.java | 173 + .../somelib/ntv/DiplomatUsizeArray.java | 173 + .../somelib/ntv/DiplomatUsizeView.java | 173 + .../somelib/ntv/DiplomatWrite.java | 512 + .../diplomattest/somelib/ntv/ErrorStruct.java | 173 + .../dev/diplomattest/somelib/ntv/FILE.java | 47 + .../somelib/ntv/Float64Vec_get_result.java | 178 + .../somelib/ntv/ImportedStruct.java | 174 + .../diplomattest/somelib/ntv/MyStruct.java | 405 + .../MyStruct_returns_zst_result_result.java | 127 + .../somelib/ntv/NestedBorrowedFields.java | 219 + .../ntv/OptionOpaque_option_i32_result.java | 178 + .../ntv/OptionOpaque_option_isize_result.java | 178 + .../ntv/OptionOpaque_option_u32_result.java | 178 + .../ntv/OptionOpaque_option_usize_result.java | 178 + .../ntv/OptionOpaque_returns_result.java | 178 + .../ntv/OptionString_borrow_result.java | 178 + .../ntv/OptionString_write_result.java | 127 + .../somelib/ntv/OptionStruct.java | 266 + .../ResultOpaque_new_failing_bar_result.java | 224 + .../ResultOpaque_new_failing_foo_result.java | 224 + ...esultOpaque_new_failing_struct_result.java | 224 + .../ResultOpaque_new_failing_unit_result.java | 178 + .../ResultOpaque_new_in_enum_err_result.java | 224 + .../ntv/ResultOpaque_new_in_err_result.java | 178 + .../ntv/ResultOpaque_new_int_result.java | 178 + .../somelib/ntv/ResultOpaque_new_result.java | 224 + .../somelib/ntv/_OSUnalignedU16.java | 127 + .../somelib/ntv/_OSUnalignedU32.java | 127 + .../somelib/ntv/_OSUnalignedU64.java | 127 + .../somelib/ntv/__darwin_mbstate_t.java | 26 + .../somelib/ntv/__darwin_pthread_attr_t.java | 29 + .../somelib/ntv/__darwin_pthread_cond_t.java | 29 + .../ntv/__darwin_pthread_condattr_t.java | 29 + .../ntv/__darwin_pthread_handler_rec.java | 272 + .../somelib/ntv/__darwin_pthread_mutex_t.java | 29 + .../ntv/__darwin_pthread_mutexattr_t.java | 29 + .../somelib/ntv/__darwin_pthread_once_t.java | 29 + .../ntv/__darwin_pthread_rwlock_t.java | 29 + .../ntv/__darwin_pthread_rwlockattr_t.java | 29 + .../diplomattest/somelib/ntv/__mbstate_t.java | 206 + .../dev/diplomattest/somelib/ntv/__sFILE.java | 1292 ++ .../dev/diplomattest/somelib/ntv/__sbuf.java | 174 + .../somelib/ntv/_opaque_pthread_attr_t.java | 206 + .../somelib/ntv/_opaque_pthread_cond_t.java | 206 + .../ntv/_opaque_pthread_condattr_t.java | 206 + .../somelib/ntv/_opaque_pthread_mutex_t.java | 206 + .../ntv/_opaque_pthread_mutexattr_t.java | 206 + .../somelib/ntv/_opaque_pthread_once_t.java | 206 + .../somelib/ntv/_opaque_pthread_rwlock_t.java | 206 + .../ntv/_opaque_pthread_rwlockattr_t.java | 206 + .../somelib/ntv/_opaque_pthread_t.java | 252 + .../dev/diplomattest/somelib/ntv/fd_set.java | 160 + .../diplomattest/somelib/ntv/funopen$x0.java | 70 + .../diplomattest/somelib/ntv/funopen$x1.java | 70 + .../diplomattest/somelib/ntv/funopen$x2.java | 70 + .../diplomattest/somelib/ntv/funopen$x3.java | 68 + .../ntv/namespace_MyIndexer_get_result.java | 178 + .../ntv/namespace_MyIterator_next_result.java | 177 + .../somelib/ntv/pthread_attr_t.java | 26 + .../somelib/ntv/pthread_cond_t.java | 26 + .../somelib/ntv/pthread_condattr_t.java | 26 + .../somelib/ntv/pthread_mutex_t.java | 26 + .../somelib/ntv/pthread_mutexattr_t.java | 26 + .../somelib/ntv/pthread_once_t.java | 26 + .../somelib/ntv/pthread_rwlock_t.java | 26 + .../somelib/ntv/pthread_rwlockattr_t.java | 26 + .../diplomattest/somelib/ntv/somelib_h.java | 19182 ++++++++++++++++ tool/src/java/mod.rs | 104 + tool/src/lib.rs | 26 + 109 files changed, 36611 insertions(+) create mode 100644 feature_tests/java/somelib/.gitignore create mode 100644 feature_tests/java/somelib/pom.xml create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Main.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/BorrowedFields.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/BorrowedFieldsReturning.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/BorrowedFieldsWithBounds.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatBoolArray.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatBoolView.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatCharArray.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatCharView.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF32Array.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF32View.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF64Array.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF64View.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI16Array.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI16View.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI32Array.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI32View.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI64Array.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI64View.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI8Array.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI8View.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatIsizeArray.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatIsizeView.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatString16Array.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatString16View.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringArray.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringView.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStrings16Array.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStrings16View.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringsArray.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringsView.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU16Array.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU16View.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU32Array.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU32View.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU64Array.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU64View.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU8Array.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU8View.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatUsizeArray.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatUsizeView.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatWrite.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ErrorStruct.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/FILE.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/Float64Vec_get_result.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ImportedStruct.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/MyStruct.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/MyStruct_returns_zst_result_result.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/NestedBorrowedFields.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionOpaque_option_i32_result.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionOpaque_option_isize_result.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionOpaque_option_u32_result.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionOpaque_option_usize_result.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionOpaque_returns_result.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionString_borrow_result.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionString_write_result.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionStruct.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_failing_bar_result.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_failing_foo_result.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_failing_struct_result.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_failing_unit_result.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_in_enum_err_result.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_in_err_result.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_int_result.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_result.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_OSUnalignedU16.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_OSUnalignedU32.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_OSUnalignedU64.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__darwin_mbstate_t.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_attr_t.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_cond_t.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_condattr_t.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_handler_rec.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_mutex_t.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_mutexattr_t.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_once_t.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_rwlock_t.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_rwlockattr_t.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__mbstate_t.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__sFILE.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__sbuf.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_attr_t.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_cond_t.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_condattr_t.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_mutex_t.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_mutexattr_t.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_once_t.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_rwlock_t.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_rwlockattr_t.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_t.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/fd_set.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/funopen$x0.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/funopen$x1.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/funopen$x2.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/funopen$x3.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/namespace_MyIndexer_get_result.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/namespace_MyIterator_next_result.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_attr_t.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_cond_t.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_condattr_t.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_mutex_t.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_mutexattr_t.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_once_t.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_rwlock_t.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_rwlockattr_t.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java create mode 100644 tool/src/java/mod.rs diff --git a/feature_tests/java/somelib/.gitignore b/feature_tests/java/somelib/.gitignore new file mode 100644 index 000000000..5ff6309b7 --- /dev/null +++ b/feature_tests/java/somelib/.gitignore @@ -0,0 +1,38 @@ +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### IntelliJ IDEA ### +.idea/modules.xml +.idea/jarRepositories.xml +.idea/compiler.xml +.idea/libraries/ +*.iws +*.iml +*.ipr + +### Eclipse ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ + +### Mac OS ### +.DS_Store \ No newline at end of file diff --git a/feature_tests/java/somelib/pom.xml b/feature_tests/java/somelib/pom.xml new file mode 100644 index 000000000..24ef5d0e8 --- /dev/null +++ b/feature_tests/java/somelib/pom.xml @@ -0,0 +1,17 @@ + + + 4.0.0 + + dev.diplomattest.somelib + somelib + 1.0-SNAPSHOT + + + 22 + 22 + UTF-8 + + + \ No newline at end of file diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Main.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Main.java new file mode 100644 index 000000000..e290a1398 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Main.java @@ -0,0 +1,17 @@ +package dev.diplomattest.somelib; + +//TIP To Run code, press or +// click the icon in the gutter. +public class Main { + public static void main(String[] args) { + //TIP Press with your caret at the highlighted text + // to see how IntelliJ IDEA suggests fixing it. + System.out.printf("Hello and welcome!"); + + for (int i = 1; i <= 5; i++) { + //TIP Press to start debugging your code. We have set one breakpoint + // for you, but you can always add more by pressing . + System.out.println("i = " + i); + } + } +} \ No newline at end of file diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/BorrowedFields.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/BorrowedFields.java new file mode 100644 index 000000000..069d1f939 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/BorrowedFields.java @@ -0,0 +1,219 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct BorrowedFields { + * DiplomatString16View a; + * DiplomatStringView b; + * DiplomatStringView c; + * } + * } + */ +public class BorrowedFields { + + BorrowedFields() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + DiplomatString16View.layout().withName("a"), + DiplomatStringView.layout().withName("b"), + DiplomatStringView.layout().withName("c") + ).withName("BorrowedFields"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final GroupLayout a$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("a")); + + /** + * Layout for field: + * {@snippet lang=c : + * DiplomatString16View a + * } + */ + public static final GroupLayout a$layout() { + return a$LAYOUT; + } + + private static final long a$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * DiplomatString16View a + * } + */ + public static final long a$offset() { + return a$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * DiplomatString16View a + * } + */ + public static MemorySegment a(MemorySegment struct) { + return struct.asSlice(a$OFFSET, a$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * DiplomatString16View a + * } + */ + public static void a(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, a$OFFSET, a$LAYOUT.byteSize()); + } + + private static final GroupLayout b$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("b")); + + /** + * Layout for field: + * {@snippet lang=c : + * DiplomatStringView b + * } + */ + public static final GroupLayout b$layout() { + return b$LAYOUT; + } + + private static final long b$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * DiplomatStringView b + * } + */ + public static final long b$offset() { + return b$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * DiplomatStringView b + * } + */ + public static MemorySegment b(MemorySegment struct) { + return struct.asSlice(b$OFFSET, b$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * DiplomatStringView b + * } + */ + public static void b(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, b$OFFSET, b$LAYOUT.byteSize()); + } + + private static final GroupLayout c$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("c")); + + /** + * Layout for field: + * {@snippet lang=c : + * DiplomatStringView c + * } + */ + public static final GroupLayout c$layout() { + return c$LAYOUT; + } + + private static final long c$OFFSET = 32; + + /** + * Offset for field: + * {@snippet lang=c : + * DiplomatStringView c + * } + */ + public static final long c$offset() { + return c$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * DiplomatStringView c + * } + */ + public static MemorySegment c(MemorySegment struct) { + return struct.asSlice(c$OFFSET, c$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * DiplomatStringView c + * } + */ + public static void c(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, c$OFFSET, c$LAYOUT.byteSize()); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/BorrowedFieldsReturning.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/BorrowedFieldsReturning.java new file mode 100644 index 000000000..f6ea5f207 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/BorrowedFieldsReturning.java @@ -0,0 +1,127 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct BorrowedFieldsReturning { + * DiplomatStringView bytes; + * } + * } + */ +public class BorrowedFieldsReturning { + + BorrowedFieldsReturning() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + DiplomatStringView.layout().withName("bytes") + ).withName("BorrowedFieldsReturning"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final GroupLayout bytes$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("bytes")); + + /** + * Layout for field: + * {@snippet lang=c : + * DiplomatStringView bytes + * } + */ + public static final GroupLayout bytes$layout() { + return bytes$LAYOUT; + } + + private static final long bytes$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * DiplomatStringView bytes + * } + */ + public static final long bytes$offset() { + return bytes$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * DiplomatStringView bytes + * } + */ + public static MemorySegment bytes(MemorySegment struct) { + return struct.asSlice(bytes$OFFSET, bytes$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * DiplomatStringView bytes + * } + */ + public static void bytes(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, bytes$OFFSET, bytes$LAYOUT.byteSize()); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/BorrowedFieldsWithBounds.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/BorrowedFieldsWithBounds.java new file mode 100644 index 000000000..ae8284f57 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/BorrowedFieldsWithBounds.java @@ -0,0 +1,219 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct BorrowedFieldsWithBounds { + * DiplomatString16View field_a; + * DiplomatStringView field_b; + * DiplomatStringView field_c; + * } + * } + */ +public class BorrowedFieldsWithBounds { + + BorrowedFieldsWithBounds() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + DiplomatString16View.layout().withName("field_a"), + DiplomatStringView.layout().withName("field_b"), + DiplomatStringView.layout().withName("field_c") + ).withName("BorrowedFieldsWithBounds"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final GroupLayout field_a$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("field_a")); + + /** + * Layout for field: + * {@snippet lang=c : + * DiplomatString16View field_a + * } + */ + public static final GroupLayout field_a$layout() { + return field_a$LAYOUT; + } + + private static final long field_a$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * DiplomatString16View field_a + * } + */ + public static final long field_a$offset() { + return field_a$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * DiplomatString16View field_a + * } + */ + public static MemorySegment field_a(MemorySegment struct) { + return struct.asSlice(field_a$OFFSET, field_a$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * DiplomatString16View field_a + * } + */ + public static void field_a(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, field_a$OFFSET, field_a$LAYOUT.byteSize()); + } + + private static final GroupLayout field_b$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("field_b")); + + /** + * Layout for field: + * {@snippet lang=c : + * DiplomatStringView field_b + * } + */ + public static final GroupLayout field_b$layout() { + return field_b$LAYOUT; + } + + private static final long field_b$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * DiplomatStringView field_b + * } + */ + public static final long field_b$offset() { + return field_b$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * DiplomatStringView field_b + * } + */ + public static MemorySegment field_b(MemorySegment struct) { + return struct.asSlice(field_b$OFFSET, field_b$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * DiplomatStringView field_b + * } + */ + public static void field_b(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, field_b$OFFSET, field_b$LAYOUT.byteSize()); + } + + private static final GroupLayout field_c$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("field_c")); + + /** + * Layout for field: + * {@snippet lang=c : + * DiplomatStringView field_c + * } + */ + public static final GroupLayout field_c$layout() { + return field_c$LAYOUT; + } + + private static final long field_c$OFFSET = 32; + + /** + * Offset for field: + * {@snippet lang=c : + * DiplomatStringView field_c + * } + */ + public static final long field_c$offset() { + return field_c$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * DiplomatStringView field_c + * } + */ + public static MemorySegment field_c(MemorySegment struct) { + return struct.asSlice(field_c$OFFSET, field_c$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * DiplomatStringView field_c + * } + */ + public static void field_c(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, field_c$OFFSET, field_c$LAYOUT.byteSize()); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatBoolArray.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatBoolArray.java new file mode 100644 index 000000000..b4d33578a --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatBoolArray.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatBoolArray { + * const bool *data; + * size_t len; + * } + * } + */ +public class DiplomatBoolArray { + + DiplomatBoolArray() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatBoolArray"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const bool *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const bool *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const bool *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const bool *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatBoolView.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatBoolView.java new file mode 100644 index 000000000..f72f81bda --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatBoolView.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatBoolView { + * const bool *data; + * size_t len; + * } + * } + */ +public class DiplomatBoolView { + + DiplomatBoolView() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatBoolView"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const bool *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const bool *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const bool *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const bool *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatCharArray.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatCharArray.java new file mode 100644 index 000000000..ad43f41a1 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatCharArray.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatCharArray { + * const char32_t *data; + * size_t len; + * } + * } + */ +public class DiplomatCharArray { + + DiplomatCharArray() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatCharArray"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const char32_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const char32_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const char32_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const char32_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatCharView.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatCharView.java new file mode 100644 index 000000000..6dc3f0ec4 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatCharView.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatCharView { + * const char32_t *data; + * size_t len; + * } + * } + */ +public class DiplomatCharView { + + DiplomatCharView() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatCharView"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const char32_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const char32_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const char32_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const char32_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF32Array.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF32Array.java new file mode 100644 index 000000000..3483f6970 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF32Array.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatF32Array { + * const float *data; + * size_t len; + * } + * } + */ +public class DiplomatF32Array { + + DiplomatF32Array() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatF32Array"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const float *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const float *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const float *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const float *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF32View.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF32View.java new file mode 100644 index 000000000..ef9439b3d --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF32View.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatF32View { + * const float *data; + * size_t len; + * } + * } + */ +public class DiplomatF32View { + + DiplomatF32View() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatF32View"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const float *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const float *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const float *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const float *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF64Array.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF64Array.java new file mode 100644 index 000000000..f31fa2fa2 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF64Array.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatF64Array { + * const double *data; + * size_t len; + * } + * } + */ +public class DiplomatF64Array { + + DiplomatF64Array() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatF64Array"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const double *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const double *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const double *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const double *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF64View.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF64View.java new file mode 100644 index 000000000..d1960966d --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF64View.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatF64View { + * const double *data; + * size_t len; + * } + * } + */ +public class DiplomatF64View { + + DiplomatF64View() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatF64View"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const double *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const double *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const double *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const double *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI16Array.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI16Array.java new file mode 100644 index 000000000..08f04934b --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI16Array.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatI16Array { + * const int16_t *data; + * size_t len; + * } + * } + */ +public class DiplomatI16Array { + + DiplomatI16Array() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatI16Array"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const int16_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const int16_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const int16_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const int16_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI16View.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI16View.java new file mode 100644 index 000000000..265552cd6 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI16View.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatI16View { + * const int16_t *data; + * size_t len; + * } + * } + */ +public class DiplomatI16View { + + DiplomatI16View() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatI16View"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const int16_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const int16_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const int16_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const int16_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI32Array.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI32Array.java new file mode 100644 index 000000000..a33abc59b --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI32Array.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatI32Array { + * const int32_t *data; + * size_t len; + * } + * } + */ +public class DiplomatI32Array { + + DiplomatI32Array() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatI32Array"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const int32_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const int32_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const int32_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const int32_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI32View.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI32View.java new file mode 100644 index 000000000..d5c0eff9f --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI32View.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatI32View { + * const int32_t *data; + * size_t len; + * } + * } + */ +public class DiplomatI32View { + + DiplomatI32View() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatI32View"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const int32_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const int32_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const int32_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const int32_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI64Array.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI64Array.java new file mode 100644 index 000000000..db760366f --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI64Array.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatI64Array { + * const int64_t *data; + * size_t len; + * } + * } + */ +public class DiplomatI64Array { + + DiplomatI64Array() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatI64Array"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const int64_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const int64_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const int64_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const int64_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI64View.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI64View.java new file mode 100644 index 000000000..2ae01c5e3 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI64View.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatI64View { + * const int64_t *data; + * size_t len; + * } + * } + */ +public class DiplomatI64View { + + DiplomatI64View() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatI64View"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const int64_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const int64_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const int64_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const int64_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI8Array.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI8Array.java new file mode 100644 index 000000000..cea362b51 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI8Array.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatI8Array { + * const int8_t *data; + * size_t len; + * } + * } + */ +public class DiplomatI8Array { + + DiplomatI8Array() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatI8Array"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const int8_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const int8_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const int8_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const int8_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI8View.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI8View.java new file mode 100644 index 000000000..c8240e123 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI8View.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatI8View { + * const int8_t *data; + * size_t len; + * } + * } + */ +public class DiplomatI8View { + + DiplomatI8View() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatI8View"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const int8_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const int8_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const int8_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const int8_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatIsizeArray.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatIsizeArray.java new file mode 100644 index 000000000..4e4b5a287 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatIsizeArray.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatIsizeArray { + * const intptr_t *data; + * size_t len; + * } + * } + */ +public class DiplomatIsizeArray { + + DiplomatIsizeArray() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatIsizeArray"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const intptr_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const intptr_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const intptr_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const intptr_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatIsizeView.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatIsizeView.java new file mode 100644 index 000000000..953f1aacd --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatIsizeView.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatIsizeView { + * const intptr_t *data; + * size_t len; + * } + * } + */ +public class DiplomatIsizeView { + + DiplomatIsizeView() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatIsizeView"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const intptr_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const intptr_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const intptr_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const intptr_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatString16Array.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatString16Array.java new file mode 100644 index 000000000..d69cc5c7d --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatString16Array.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatString16Array { + * const char16_t *data; + * size_t len; + * } + * } + */ +public class DiplomatString16Array { + + DiplomatString16Array() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatString16Array"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const char16_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const char16_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const char16_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const char16_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatString16View.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatString16View.java new file mode 100644 index 000000000..192de994e --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatString16View.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatString16View { + * const char16_t *data; + * size_t len; + * } + * } + */ +public class DiplomatString16View { + + DiplomatString16View() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatString16View"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const char16_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const char16_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const char16_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const char16_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringArray.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringArray.java new file mode 100644 index 000000000..d7aa9f6ff --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringArray.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatStringArray { + * const char *data; + * size_t len; + * } + * } + */ +public class DiplomatStringArray { + + DiplomatStringArray() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatStringArray"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const char *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const char *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const char *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const char *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringView.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringView.java new file mode 100644 index 000000000..185d5aff6 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringView.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatStringView { + * const char *data; + * size_t len; + * } + * } + */ +public class DiplomatStringView { + + DiplomatStringView() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatStringView"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const char *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const char *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const char *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const char *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStrings16Array.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStrings16Array.java new file mode 100644 index 000000000..b2c9354d1 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStrings16Array.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatStrings16Array { + * const DiplomatString16View *data; + * size_t len; + * } + * } + */ +public class DiplomatStrings16Array { + + DiplomatStrings16Array() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatStrings16Array"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const DiplomatString16View *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const DiplomatString16View *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const DiplomatString16View *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const DiplomatString16View *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStrings16View.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStrings16View.java new file mode 100644 index 000000000..3e10bbeba --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStrings16View.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatStrings16View { + * const DiplomatString16View *data; + * size_t len; + * } + * } + */ +public class DiplomatStrings16View { + + DiplomatStrings16View() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatStrings16View"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const DiplomatString16View *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const DiplomatString16View *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const DiplomatString16View *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const DiplomatString16View *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringsArray.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringsArray.java new file mode 100644 index 000000000..bef36d353 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringsArray.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatStringsArray { + * const DiplomatStringView *data; + * size_t len; + * } + * } + */ +public class DiplomatStringsArray { + + DiplomatStringsArray() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatStringsArray"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const DiplomatStringView *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const DiplomatStringView *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const DiplomatStringView *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const DiplomatStringView *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringsView.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringsView.java new file mode 100644 index 000000000..9e16e26b7 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringsView.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatStringsView { + * const DiplomatStringView *data; + * size_t len; + * } + * } + */ +public class DiplomatStringsView { + + DiplomatStringsView() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatStringsView"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const DiplomatStringView *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const DiplomatStringView *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const DiplomatStringView *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const DiplomatStringView *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU16Array.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU16Array.java new file mode 100644 index 000000000..482eea704 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU16Array.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatU16Array { + * const uint16_t *data; + * size_t len; + * } + * } + */ +public class DiplomatU16Array { + + DiplomatU16Array() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatU16Array"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const uint16_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const uint16_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const uint16_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const uint16_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU16View.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU16View.java new file mode 100644 index 000000000..a8c75ea49 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU16View.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatU16View { + * const uint16_t *data; + * size_t len; + * } + * } + */ +public class DiplomatU16View { + + DiplomatU16View() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatU16View"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const uint16_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const uint16_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const uint16_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const uint16_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU32Array.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU32Array.java new file mode 100644 index 000000000..8ecc93d8b --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU32Array.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatU32Array { + * const uint32_t *data; + * size_t len; + * } + * } + */ +public class DiplomatU32Array { + + DiplomatU32Array() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatU32Array"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const uint32_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const uint32_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const uint32_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const uint32_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU32View.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU32View.java new file mode 100644 index 000000000..5b0e57b04 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU32View.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatU32View { + * const uint32_t *data; + * size_t len; + * } + * } + */ +public class DiplomatU32View { + + DiplomatU32View() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatU32View"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const uint32_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const uint32_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const uint32_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const uint32_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU64Array.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU64Array.java new file mode 100644 index 000000000..5b407a970 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU64Array.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatU64Array { + * const uint64_t *data; + * size_t len; + * } + * } + */ +public class DiplomatU64Array { + + DiplomatU64Array() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatU64Array"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const uint64_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const uint64_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const uint64_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const uint64_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU64View.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU64View.java new file mode 100644 index 000000000..2ec76ae90 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU64View.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatU64View { + * const uint64_t *data; + * size_t len; + * } + * } + */ +public class DiplomatU64View { + + DiplomatU64View() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatU64View"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const uint64_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const uint64_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const uint64_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const uint64_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU8Array.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU8Array.java new file mode 100644 index 000000000..66872b949 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU8Array.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatU8Array { + * const uint8_t *data; + * size_t len; + * } + * } + */ +public class DiplomatU8Array { + + DiplomatU8Array() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatU8Array"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const uint8_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const uint8_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const uint8_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const uint8_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU8View.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU8View.java new file mode 100644 index 000000000..3c6671156 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU8View.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatU8View { + * const uint8_t *data; + * size_t len; + * } + * } + */ +public class DiplomatU8View { + + DiplomatU8View() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatU8View"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const uint8_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const uint8_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const uint8_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const uint8_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatUsizeArray.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatUsizeArray.java new file mode 100644 index 000000000..21b119c6a --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatUsizeArray.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatUsizeArray { + * const size_t *data; + * size_t len; + * } + * } + */ +public class DiplomatUsizeArray { + + DiplomatUsizeArray() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatUsizeArray"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const size_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const size_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const size_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const size_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatUsizeView.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatUsizeView.java new file mode 100644 index 000000000..ba9b410d6 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatUsizeView.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatUsizeView { + * const size_t *data; + * size_t len; + * } + * } + */ +public class DiplomatUsizeView { + + DiplomatUsizeView() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatUsizeView"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const size_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const size_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const size_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const size_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatWrite.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatWrite.java new file mode 100644 index 000000000..6da2825dd --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatWrite.java @@ -0,0 +1,512 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatWrite { + * void *context; + * char *buf; + * size_t len; + * size_t cap; + * bool grow_failed; + * void (*flush)(struct DiplomatWrite *); + * bool (*grow)(struct DiplomatWrite *, size_t); + * } + * } + */ +public class DiplomatWrite { + + DiplomatWrite() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("context"), + somelib_h.C_POINTER.withName("buf"), + somelib_h.C_LONG.withName("len"), + somelib_h.C_LONG.withName("cap"), + somelib_h.C_BOOL.withName("grow_failed"), + MemoryLayout.paddingLayout(7), + somelib_h.C_POINTER.withName("flush"), + somelib_h.C_POINTER.withName("grow") + ).withName("DiplomatWrite"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout context$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("context")); + + /** + * Layout for field: + * {@snippet lang=c : + * void *context + * } + */ + public static final AddressLayout context$layout() { + return context$LAYOUT; + } + + private static final long context$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * void *context + * } + */ + public static final long context$offset() { + return context$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * void *context + * } + */ + public static MemorySegment context(MemorySegment struct) { + return struct.get(context$LAYOUT, context$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * void *context + * } + */ + public static void context(MemorySegment struct, MemorySegment fieldValue) { + struct.set(context$LAYOUT, context$OFFSET, fieldValue); + } + + private static final AddressLayout buf$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("buf")); + + /** + * Layout for field: + * {@snippet lang=c : + * char *buf + * } + */ + public static final AddressLayout buf$layout() { + return buf$LAYOUT; + } + + private static final long buf$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * char *buf + * } + */ + public static final long buf$offset() { + return buf$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * char *buf + * } + */ + public static MemorySegment buf(MemorySegment struct) { + return struct.get(buf$LAYOUT, buf$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * char *buf + * } + */ + public static void buf(MemorySegment struct, MemorySegment fieldValue) { + struct.set(buf$LAYOUT, buf$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + private static final OfLong cap$LAYOUT = (OfLong)$LAYOUT.select(groupElement("cap")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t cap + * } + */ + public static final OfLong cap$layout() { + return cap$LAYOUT; + } + + private static final long cap$OFFSET = 24; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t cap + * } + */ + public static final long cap$offset() { + return cap$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t cap + * } + */ + public static long cap(MemorySegment struct) { + return struct.get(cap$LAYOUT, cap$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t cap + * } + */ + public static void cap(MemorySegment struct, long fieldValue) { + struct.set(cap$LAYOUT, cap$OFFSET, fieldValue); + } + + private static final OfBoolean grow_failed$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("grow_failed")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool grow_failed + * } + */ + public static final OfBoolean grow_failed$layout() { + return grow_failed$LAYOUT; + } + + private static final long grow_failed$OFFSET = 32; + + /** + * Offset for field: + * {@snippet lang=c : + * bool grow_failed + * } + */ + public static final long grow_failed$offset() { + return grow_failed$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool grow_failed + * } + */ + public static boolean grow_failed(MemorySegment struct) { + return struct.get(grow_failed$LAYOUT, grow_failed$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool grow_failed + * } + */ + public static void grow_failed(MemorySegment struct, boolean fieldValue) { + struct.set(grow_failed$LAYOUT, grow_failed$OFFSET, fieldValue); + } + + /** + * {@snippet lang=c : + * void (*flush)(struct DiplomatWrite *) + * } + */ + public static class flush { + + flush() { + // Should not be called directly + } + + /** + * The function pointer signature, expressed as a functional interface + */ + public interface Function { + void apply(MemorySegment _x0); + } + + private static final FunctionDescriptor $DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); + + /** + * The descriptor of this function pointer + */ + public static FunctionDescriptor descriptor() { + return $DESC; + } + + private static final MethodHandle UP$MH = somelib_h.upcallHandle(flush.Function.class, "apply", $DESC); + + /** + * Allocates a new upcall stub, whose implementation is defined by {@code fi}. + * The lifetime of the returned segment is managed by {@code arena} + */ + public static MemorySegment allocate(flush.Function fi, Arena arena) { + return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena); + } + + private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC); + + /** + * Invoke the upcall stub {@code funcPtr}, with given parameters + */ + public static void invoke(MemorySegment funcPtr,MemorySegment _x0) { + try { + DOWN$MH.invokeExact(funcPtr, _x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static final AddressLayout flush$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("flush")); + + /** + * Layout for field: + * {@snippet lang=c : + * void (*flush)(struct DiplomatWrite *) + * } + */ + public static final AddressLayout flush$layout() { + return flush$LAYOUT; + } + + private static final long flush$OFFSET = 40; + + /** + * Offset for field: + * {@snippet lang=c : + * void (*flush)(struct DiplomatWrite *) + * } + */ + public static final long flush$offset() { + return flush$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * void (*flush)(struct DiplomatWrite *) + * } + */ + public static MemorySegment flush(MemorySegment struct) { + return struct.get(flush$LAYOUT, flush$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * void (*flush)(struct DiplomatWrite *) + * } + */ + public static void flush(MemorySegment struct, MemorySegment fieldValue) { + struct.set(flush$LAYOUT, flush$OFFSET, fieldValue); + } + + /** + * {@snippet lang=c : + * bool (*grow)(struct DiplomatWrite *, size_t) + * } + */ + public static class grow { + + grow() { + // Should not be called directly + } + + /** + * The function pointer signature, expressed as a functional interface + */ + public interface Function { + boolean apply(MemorySegment _x0, long _x1); + } + + private static final FunctionDescriptor $DESC = FunctionDescriptor.of( + somelib_h.C_BOOL, + somelib_h.C_POINTER, + somelib_h.C_LONG + ); + + /** + * The descriptor of this function pointer + */ + public static FunctionDescriptor descriptor() { + return $DESC; + } + + private static final MethodHandle UP$MH = somelib_h.upcallHandle(grow.Function.class, "apply", $DESC); + + /** + * Allocates a new upcall stub, whose implementation is defined by {@code fi}. + * The lifetime of the returned segment is managed by {@code arena} + */ + public static MemorySegment allocate(grow.Function fi, Arena arena) { + return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena); + } + + private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC); + + /** + * Invoke the upcall stub {@code funcPtr}, with given parameters + */ + public static boolean invoke(MemorySegment funcPtr,MemorySegment _x0, long _x1) { + try { + return (boolean) DOWN$MH.invokeExact(funcPtr, _x0, _x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static final AddressLayout grow$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("grow")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool (*grow)(struct DiplomatWrite *, size_t) + * } + */ + public static final AddressLayout grow$layout() { + return grow$LAYOUT; + } + + private static final long grow$OFFSET = 48; + + /** + * Offset for field: + * {@snippet lang=c : + * bool (*grow)(struct DiplomatWrite *, size_t) + * } + */ + public static final long grow$offset() { + return grow$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool (*grow)(struct DiplomatWrite *, size_t) + * } + */ + public static MemorySegment grow(MemorySegment struct) { + return struct.get(grow$LAYOUT, grow$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool (*grow)(struct DiplomatWrite *, size_t) + * } + */ + public static void grow(MemorySegment struct, MemorySegment fieldValue) { + struct.set(grow$LAYOUT, grow$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ErrorStruct.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ErrorStruct.java new file mode 100644 index 000000000..c50ae3211 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ErrorStruct.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct ErrorStruct { + * int32_t i; + * int32_t j; + * } + * } + */ +public class ErrorStruct { + + ErrorStruct() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_INT.withName("i"), + somelib_h.C_INT.withName("j") + ).withName("ErrorStruct"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt i$LAYOUT = (OfInt)$LAYOUT.select(groupElement("i")); + + /** + * Layout for field: + * {@snippet lang=c : + * int32_t i + * } + */ + public static final OfInt i$layout() { + return i$LAYOUT; + } + + private static final long i$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * int32_t i + * } + */ + public static final long i$offset() { + return i$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int32_t i + * } + */ + public static int i(MemorySegment struct) { + return struct.get(i$LAYOUT, i$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int32_t i + * } + */ + public static void i(MemorySegment struct, int fieldValue) { + struct.set(i$LAYOUT, i$OFFSET, fieldValue); + } + + private static final OfInt j$LAYOUT = (OfInt)$LAYOUT.select(groupElement("j")); + + /** + * Layout for field: + * {@snippet lang=c : + * int32_t j + * } + */ + public static final OfInt j$layout() { + return j$LAYOUT; + } + + private static final long j$OFFSET = 4; + + /** + * Offset for field: + * {@snippet lang=c : + * int32_t j + * } + */ + public static final long j$offset() { + return j$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int32_t j + * } + */ + public static int j(MemorySegment struct) { + return struct.get(j$LAYOUT, j$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int32_t j + * } + */ + public static void j(MemorySegment struct, int fieldValue) { + struct.set(j$LAYOUT, j$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/FILE.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/FILE.java new file mode 100644 index 000000000..c73dc11c2 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/FILE.java @@ -0,0 +1,47 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef struct __sFILE { + * unsigned char *_p; + * int _r; + * int _w; + * short _flags; + * short _file; + * struct __sbuf _bf; + * int _lbfsize; + * void *_cookie; + * int (* _Nullable _close)(void *); + * int (* _Nullable _read)(void *, char *, int); + * fpos_t (* _Nullable _seek)(void *, fpos_t, int); + * int (* _Nullable _write)(void *, const char *, int); + * struct __sbuf _ub; + * struct __sFILEX *_extra; + * int _ur; + * unsigned char _ubuf[3]; + * unsigned char _nbuf[1]; + * struct __sbuf _lb; + * int _blksize; + * fpos_t _offset; + * } FILE + * } + */ +public class FILE extends __sFILE { + + FILE() { + // Should not be called directly + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/Float64Vec_get_result.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/Float64Vec_get_result.java new file mode 100644 index 000000000..25f871d78 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/Float64Vec_get_result.java @@ -0,0 +1,178 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct Float64Vec_get_result { + * union { + * double ok; + * }; + * bool is_ok; + * } + * } + */ +public class Float64Vec_get_result { + + Float64Vec_get_result() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.unionLayout( + somelib_h.C_DOUBLE.withName("ok") + ).withName("$anon$44:31"), + somelib_h.C_BOOL.withName("is_ok"), + MemoryLayout.paddingLayout(7) + ).withName("Float64Vec_get_result"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfDouble ok$LAYOUT = (OfDouble)$LAYOUT.select(groupElement("$anon$44:31"), groupElement("ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * double ok + * } + */ + public static final OfDouble ok$layout() { + return ok$LAYOUT; + } + + private static final long ok$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * double ok + * } + */ + public static final long ok$offset() { + return ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * double ok + * } + */ + public static double ok(MemorySegment struct) { + return struct.get(ok$LAYOUT, ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * double ok + * } + */ + public static void ok(MemorySegment struct, double fieldValue) { + struct.set(ok$LAYOUT, ok$OFFSET, fieldValue); + } + + private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final OfBoolean is_ok$layout() { + return is_ok$LAYOUT; + } + + private static final long is_ok$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final long is_ok$offset() { + return is_ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static boolean is_ok(MemorySegment struct) { + return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static void is_ok(MemorySegment struct, boolean fieldValue) { + struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ImportedStruct.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ImportedStruct.java new file mode 100644 index 000000000..0ef6656c7 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ImportedStruct.java @@ -0,0 +1,174 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct ImportedStruct { + * UnimportedEnum foo; + * uint8_t count; + * } + * } + */ +public class ImportedStruct { + + ImportedStruct() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_INT.withName("foo"), + somelib_h.C_CHAR.withName("count"), + MemoryLayout.paddingLayout(3) + ).withName("ImportedStruct"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt foo$LAYOUT = (OfInt)$LAYOUT.select(groupElement("foo")); + + /** + * Layout for field: + * {@snippet lang=c : + * UnimportedEnum foo + * } + */ + public static final OfInt foo$layout() { + return foo$LAYOUT; + } + + private static final long foo$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * UnimportedEnum foo + * } + */ + public static final long foo$offset() { + return foo$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * UnimportedEnum foo + * } + */ + public static int foo(MemorySegment struct) { + return struct.get(foo$LAYOUT, foo$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * UnimportedEnum foo + * } + */ + public static void foo(MemorySegment struct, int fieldValue) { + struct.set(foo$LAYOUT, foo$OFFSET, fieldValue); + } + + private static final OfByte count$LAYOUT = (OfByte)$LAYOUT.select(groupElement("count")); + + /** + * Layout for field: + * {@snippet lang=c : + * uint8_t count + * } + */ + public static final OfByte count$layout() { + return count$LAYOUT; + } + + private static final long count$OFFSET = 4; + + /** + * Offset for field: + * {@snippet lang=c : + * uint8_t count + * } + */ + public static final long count$offset() { + return count$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * uint8_t count + * } + */ + public static byte count(MemorySegment struct) { + return struct.get(count$LAYOUT, count$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * uint8_t count + * } + */ + public static void count(MemorySegment struct, byte fieldValue) { + struct.set(count$LAYOUT, count$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/MyStruct.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/MyStruct.java new file mode 100644 index 000000000..4cd6b64bd --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/MyStruct.java @@ -0,0 +1,405 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct MyStruct { + * uint8_t a; + * bool b; + * uint8_t c; + * uint64_t d; + * int32_t e; + * char32_t f; + * MyEnum g; + * } + * } + */ +public class MyStruct { + + MyStruct() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_CHAR.withName("a"), + somelib_h.C_BOOL.withName("b"), + somelib_h.C_CHAR.withName("c"), + MemoryLayout.paddingLayout(5), + somelib_h.C_LONG_LONG.withName("d"), + somelib_h.C_INT.withName("e"), + somelib_h.C_INT.withName("f"), + somelib_h.C_INT.withName("g"), + MemoryLayout.paddingLayout(4) + ).withName("MyStruct"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfByte a$LAYOUT = (OfByte)$LAYOUT.select(groupElement("a")); + + /** + * Layout for field: + * {@snippet lang=c : + * uint8_t a + * } + */ + public static final OfByte a$layout() { + return a$LAYOUT; + } + + private static final long a$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * uint8_t a + * } + */ + public static final long a$offset() { + return a$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * uint8_t a + * } + */ + public static byte a(MemorySegment struct) { + return struct.get(a$LAYOUT, a$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * uint8_t a + * } + */ + public static void a(MemorySegment struct, byte fieldValue) { + struct.set(a$LAYOUT, a$OFFSET, fieldValue); + } + + private static final OfBoolean b$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("b")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool b + * } + */ + public static final OfBoolean b$layout() { + return b$LAYOUT; + } + + private static final long b$OFFSET = 1; + + /** + * Offset for field: + * {@snippet lang=c : + * bool b + * } + */ + public static final long b$offset() { + return b$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool b + * } + */ + public static boolean b(MemorySegment struct) { + return struct.get(b$LAYOUT, b$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool b + * } + */ + public static void b(MemorySegment struct, boolean fieldValue) { + struct.set(b$LAYOUT, b$OFFSET, fieldValue); + } + + private static final OfByte c$LAYOUT = (OfByte)$LAYOUT.select(groupElement("c")); + + /** + * Layout for field: + * {@snippet lang=c : + * uint8_t c + * } + */ + public static final OfByte c$layout() { + return c$LAYOUT; + } + + private static final long c$OFFSET = 2; + + /** + * Offset for field: + * {@snippet lang=c : + * uint8_t c + * } + */ + public static final long c$offset() { + return c$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * uint8_t c + * } + */ + public static byte c(MemorySegment struct) { + return struct.get(c$LAYOUT, c$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * uint8_t c + * } + */ + public static void c(MemorySegment struct, byte fieldValue) { + struct.set(c$LAYOUT, c$OFFSET, fieldValue); + } + + private static final OfLong d$LAYOUT = (OfLong)$LAYOUT.select(groupElement("d")); + + /** + * Layout for field: + * {@snippet lang=c : + * uint64_t d + * } + */ + public static final OfLong d$layout() { + return d$LAYOUT; + } + + private static final long d$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * uint64_t d + * } + */ + public static final long d$offset() { + return d$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * uint64_t d + * } + */ + public static long d(MemorySegment struct) { + return struct.get(d$LAYOUT, d$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * uint64_t d + * } + */ + public static void d(MemorySegment struct, long fieldValue) { + struct.set(d$LAYOUT, d$OFFSET, fieldValue); + } + + private static final OfInt e$LAYOUT = (OfInt)$LAYOUT.select(groupElement("e")); + + /** + * Layout for field: + * {@snippet lang=c : + * int32_t e + * } + */ + public static final OfInt e$layout() { + return e$LAYOUT; + } + + private static final long e$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * int32_t e + * } + */ + public static final long e$offset() { + return e$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int32_t e + * } + */ + public static int e(MemorySegment struct) { + return struct.get(e$LAYOUT, e$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int32_t e + * } + */ + public static void e(MemorySegment struct, int fieldValue) { + struct.set(e$LAYOUT, e$OFFSET, fieldValue); + } + + private static final OfInt f$LAYOUT = (OfInt)$LAYOUT.select(groupElement("f")); + + /** + * Layout for field: + * {@snippet lang=c : + * char32_t f + * } + */ + public static final OfInt f$layout() { + return f$LAYOUT; + } + + private static final long f$OFFSET = 20; + + /** + * Offset for field: + * {@snippet lang=c : + * char32_t f + * } + */ + public static final long f$offset() { + return f$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * char32_t f + * } + */ + public static int f(MemorySegment struct) { + return struct.get(f$LAYOUT, f$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * char32_t f + * } + */ + public static void f(MemorySegment struct, int fieldValue) { + struct.set(f$LAYOUT, f$OFFSET, fieldValue); + } + + private static final OfInt g$LAYOUT = (OfInt)$LAYOUT.select(groupElement("g")); + + /** + * Layout for field: + * {@snippet lang=c : + * MyEnum g + * } + */ + public static final OfInt g$layout() { + return g$LAYOUT; + } + + private static final long g$OFFSET = 24; + + /** + * Offset for field: + * {@snippet lang=c : + * MyEnum g + * } + */ + public static final long g$offset() { + return g$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * MyEnum g + * } + */ + public static int g(MemorySegment struct) { + return struct.get(g$LAYOUT, g$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * MyEnum g + * } + */ + public static void g(MemorySegment struct, int fieldValue) { + struct.set(g$LAYOUT, g$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/MyStruct_returns_zst_result_result.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/MyStruct_returns_zst_result_result.java new file mode 100644 index 000000000..e20b244cf --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/MyStruct_returns_zst_result_result.java @@ -0,0 +1,127 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct MyStruct_returns_zst_result_result { + * bool is_ok; + * } + * } + */ +public class MyStruct_returns_zst_result_result { + + MyStruct_returns_zst_result_result() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_BOOL.withName("is_ok") + ).withName("MyStruct_returns_zst_result_result"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final OfBoolean is_ok$layout() { + return is_ok$LAYOUT; + } + + private static final long is_ok$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final long is_ok$offset() { + return is_ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static boolean is_ok(MemorySegment struct) { + return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static void is_ok(MemorySegment struct, boolean fieldValue) { + struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/NestedBorrowedFields.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/NestedBorrowedFields.java new file mode 100644 index 000000000..f543e068f --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/NestedBorrowedFields.java @@ -0,0 +1,219 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct NestedBorrowedFields { + * BorrowedFields fields; + * BorrowedFieldsWithBounds bounds; + * BorrowedFieldsWithBounds bounds2; + * } + * } + */ +public class NestedBorrowedFields { + + NestedBorrowedFields() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + BorrowedFields.layout().withName("fields"), + BorrowedFieldsWithBounds.layout().withName("bounds"), + BorrowedFieldsWithBounds.layout().withName("bounds2") + ).withName("NestedBorrowedFields"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final GroupLayout fields$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("fields")); + + /** + * Layout for field: + * {@snippet lang=c : + * BorrowedFields fields + * } + */ + public static final GroupLayout fields$layout() { + return fields$LAYOUT; + } + + private static final long fields$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * BorrowedFields fields + * } + */ + public static final long fields$offset() { + return fields$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * BorrowedFields fields + * } + */ + public static MemorySegment fields(MemorySegment struct) { + return struct.asSlice(fields$OFFSET, fields$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * BorrowedFields fields + * } + */ + public static void fields(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, fields$OFFSET, fields$LAYOUT.byteSize()); + } + + private static final GroupLayout bounds$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("bounds")); + + /** + * Layout for field: + * {@snippet lang=c : + * BorrowedFieldsWithBounds bounds + * } + */ + public static final GroupLayout bounds$layout() { + return bounds$LAYOUT; + } + + private static final long bounds$OFFSET = 48; + + /** + * Offset for field: + * {@snippet lang=c : + * BorrowedFieldsWithBounds bounds + * } + */ + public static final long bounds$offset() { + return bounds$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * BorrowedFieldsWithBounds bounds + * } + */ + public static MemorySegment bounds(MemorySegment struct) { + return struct.asSlice(bounds$OFFSET, bounds$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * BorrowedFieldsWithBounds bounds + * } + */ + public static void bounds(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, bounds$OFFSET, bounds$LAYOUT.byteSize()); + } + + private static final GroupLayout bounds2$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("bounds2")); + + /** + * Layout for field: + * {@snippet lang=c : + * BorrowedFieldsWithBounds bounds2 + * } + */ + public static final GroupLayout bounds2$layout() { + return bounds2$LAYOUT; + } + + private static final long bounds2$OFFSET = 96; + + /** + * Offset for field: + * {@snippet lang=c : + * BorrowedFieldsWithBounds bounds2 + * } + */ + public static final long bounds2$offset() { + return bounds2$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * BorrowedFieldsWithBounds bounds2 + * } + */ + public static MemorySegment bounds2(MemorySegment struct) { + return struct.asSlice(bounds2$OFFSET, bounds2$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * BorrowedFieldsWithBounds bounds2 + * } + */ + public static void bounds2(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, bounds2$OFFSET, bounds2$LAYOUT.byteSize()); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionOpaque_option_i32_result.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionOpaque_option_i32_result.java new file mode 100644 index 000000000..f2ba41a30 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionOpaque_option_i32_result.java @@ -0,0 +1,178 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct OptionOpaque_option_i32_result { + * union { + * int32_t ok; + * }; + * bool is_ok; + * } + * } + */ +public class OptionOpaque_option_i32_result { + + OptionOpaque_option_i32_result() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.unionLayout( + somelib_h.C_INT.withName("ok") + ).withName("$anon$32:40"), + somelib_h.C_BOOL.withName("is_ok"), + MemoryLayout.paddingLayout(3) + ).withName("OptionOpaque_option_i32_result"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt ok$LAYOUT = (OfInt)$LAYOUT.select(groupElement("$anon$32:40"), groupElement("ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * int32_t ok + * } + */ + public static final OfInt ok$layout() { + return ok$LAYOUT; + } + + private static final long ok$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * int32_t ok + * } + */ + public static final long ok$offset() { + return ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int32_t ok + * } + */ + public static int ok(MemorySegment struct) { + return struct.get(ok$LAYOUT, ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int32_t ok + * } + */ + public static void ok(MemorySegment struct, int fieldValue) { + struct.set(ok$LAYOUT, ok$OFFSET, fieldValue); + } + + private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final OfBoolean is_ok$layout() { + return is_ok$LAYOUT; + } + + private static final long is_ok$OFFSET = 4; + + /** + * Offset for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final long is_ok$offset() { + return is_ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static boolean is_ok(MemorySegment struct) { + return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static void is_ok(MemorySegment struct, boolean fieldValue) { + struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionOpaque_option_isize_result.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionOpaque_option_isize_result.java new file mode 100644 index 000000000..5b8aa735e --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionOpaque_option_isize_result.java @@ -0,0 +1,178 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct OptionOpaque_option_isize_result { + * union { + * intptr_t ok; + * }; + * bool is_ok; + * } + * } + */ +public class OptionOpaque_option_isize_result { + + OptionOpaque_option_isize_result() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.unionLayout( + somelib_h.C_LONG.withName("ok") + ).withName("$anon$26:42"), + somelib_h.C_BOOL.withName("is_ok"), + MemoryLayout.paddingLayout(7) + ).withName("OptionOpaque_option_isize_result"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong ok$LAYOUT = (OfLong)$LAYOUT.select(groupElement("$anon$26:42"), groupElement("ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * intptr_t ok + * } + */ + public static final OfLong ok$layout() { + return ok$LAYOUT; + } + + private static final long ok$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * intptr_t ok + * } + */ + public static final long ok$offset() { + return ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * intptr_t ok + * } + */ + public static long ok(MemorySegment struct) { + return struct.get(ok$LAYOUT, ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * intptr_t ok + * } + */ + public static void ok(MemorySegment struct, long fieldValue) { + struct.set(ok$LAYOUT, ok$OFFSET, fieldValue); + } + + private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final OfBoolean is_ok$layout() { + return is_ok$LAYOUT; + } + + private static final long is_ok$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final long is_ok$offset() { + return is_ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static boolean is_ok(MemorySegment struct) { + return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static void is_ok(MemorySegment struct, boolean fieldValue) { + struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionOpaque_option_u32_result.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionOpaque_option_u32_result.java new file mode 100644 index 000000000..96d0a0ad5 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionOpaque_option_u32_result.java @@ -0,0 +1,178 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct OptionOpaque_option_u32_result { + * union { + * uint32_t ok; + * }; + * bool is_ok; + * } + * } + */ +public class OptionOpaque_option_u32_result { + + OptionOpaque_option_u32_result() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.unionLayout( + somelib_h.C_INT.withName("ok") + ).withName("$anon$35:40"), + somelib_h.C_BOOL.withName("is_ok"), + MemoryLayout.paddingLayout(3) + ).withName("OptionOpaque_option_u32_result"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt ok$LAYOUT = (OfInt)$LAYOUT.select(groupElement("$anon$35:40"), groupElement("ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * uint32_t ok + * } + */ + public static final OfInt ok$layout() { + return ok$LAYOUT; + } + + private static final long ok$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * uint32_t ok + * } + */ + public static final long ok$offset() { + return ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * uint32_t ok + * } + */ + public static int ok(MemorySegment struct) { + return struct.get(ok$LAYOUT, ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * uint32_t ok + * } + */ + public static void ok(MemorySegment struct, int fieldValue) { + struct.set(ok$LAYOUT, ok$OFFSET, fieldValue); + } + + private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final OfBoolean is_ok$layout() { + return is_ok$LAYOUT; + } + + private static final long is_ok$OFFSET = 4; + + /** + * Offset for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final long is_ok$offset() { + return is_ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static boolean is_ok(MemorySegment struct) { + return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static void is_ok(MemorySegment struct, boolean fieldValue) { + struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionOpaque_option_usize_result.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionOpaque_option_usize_result.java new file mode 100644 index 000000000..e01eabc77 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionOpaque_option_usize_result.java @@ -0,0 +1,178 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct OptionOpaque_option_usize_result { + * union { + * size_t ok; + * }; + * bool is_ok; + * } + * } + */ +public class OptionOpaque_option_usize_result { + + OptionOpaque_option_usize_result() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.unionLayout( + somelib_h.C_LONG.withName("ok") + ).withName("$anon$29:42"), + somelib_h.C_BOOL.withName("is_ok"), + MemoryLayout.paddingLayout(7) + ).withName("OptionOpaque_option_usize_result"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong ok$LAYOUT = (OfLong)$LAYOUT.select(groupElement("$anon$29:42"), groupElement("ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t ok + * } + */ + public static final OfLong ok$layout() { + return ok$LAYOUT; + } + + private static final long ok$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t ok + * } + */ + public static final long ok$offset() { + return ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t ok + * } + */ + public static long ok(MemorySegment struct) { + return struct.get(ok$LAYOUT, ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t ok + * } + */ + public static void ok(MemorySegment struct, long fieldValue) { + struct.set(ok$LAYOUT, ok$OFFSET, fieldValue); + } + + private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final OfBoolean is_ok$layout() { + return is_ok$LAYOUT; + } + + private static final long is_ok$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final long is_ok$offset() { + return is_ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static boolean is_ok(MemorySegment struct) { + return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static void is_ok(MemorySegment struct, boolean fieldValue) { + struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionOpaque_returns_result.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionOpaque_returns_result.java new file mode 100644 index 000000000..642bbf921 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionOpaque_returns_result.java @@ -0,0 +1,178 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct OptionOpaque_returns_result { + * union { + * OptionStruct ok; + * }; + * bool is_ok; + * } + * } + */ +public class OptionOpaque_returns_result { + + OptionOpaque_returns_result() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.unionLayout( + OptionStruct.layout().withName("ok") + ).withName("$anon$23:37"), + somelib_h.C_BOOL.withName("is_ok"), + MemoryLayout.paddingLayout(7) + ).withName("OptionOpaque_returns_result"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final GroupLayout ok$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$23:37"), groupElement("ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * OptionStruct ok + * } + */ + public static final GroupLayout ok$layout() { + return ok$LAYOUT; + } + + private static final long ok$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * OptionStruct ok + * } + */ + public static final long ok$offset() { + return ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * OptionStruct ok + * } + */ + public static MemorySegment ok(MemorySegment struct) { + return struct.asSlice(ok$OFFSET, ok$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * OptionStruct ok + * } + */ + public static void ok(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, ok$OFFSET, ok$LAYOUT.byteSize()); + } + + private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final OfBoolean is_ok$layout() { + return is_ok$LAYOUT; + } + + private static final long is_ok$OFFSET = 32; + + /** + * Offset for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final long is_ok$offset() { + return is_ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static boolean is_ok(MemorySegment struct) { + return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static void is_ok(MemorySegment struct, boolean fieldValue) { + struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionString_borrow_result.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionString_borrow_result.java new file mode 100644 index 000000000..3798179a0 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionString_borrow_result.java @@ -0,0 +1,178 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct OptionString_borrow_result { + * union { + * DiplomatStringView ok; + * }; + * bool is_ok; + * } + * } + */ +public class OptionString_borrow_result { + + OptionString_borrow_result() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.unionLayout( + DiplomatStringView.layout().withName("ok") + ).withName("$anon$23:36"), + somelib_h.C_BOOL.withName("is_ok"), + MemoryLayout.paddingLayout(7) + ).withName("OptionString_borrow_result"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final GroupLayout ok$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$23:36"), groupElement("ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * DiplomatStringView ok + * } + */ + public static final GroupLayout ok$layout() { + return ok$LAYOUT; + } + + private static final long ok$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * DiplomatStringView ok + * } + */ + public static final long ok$offset() { + return ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * DiplomatStringView ok + * } + */ + public static MemorySegment ok(MemorySegment struct) { + return struct.asSlice(ok$OFFSET, ok$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * DiplomatStringView ok + * } + */ + public static void ok(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, ok$OFFSET, ok$LAYOUT.byteSize()); + } + + private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final OfBoolean is_ok$layout() { + return is_ok$LAYOUT; + } + + private static final long is_ok$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final long is_ok$offset() { + return is_ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static boolean is_ok(MemorySegment struct) { + return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static void is_ok(MemorySegment struct, boolean fieldValue) { + struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionString_write_result.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionString_write_result.java new file mode 100644 index 000000000..bb05e867e --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionString_write_result.java @@ -0,0 +1,127 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct OptionString_write_result { + * bool is_ok; + * } + * } + */ +public class OptionString_write_result { + + OptionString_write_result() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_BOOL.withName("is_ok") + ).withName("OptionString_write_result"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final OfBoolean is_ok$layout() { + return is_ok$LAYOUT; + } + + private static final long is_ok$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final long is_ok$offset() { + return is_ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static boolean is_ok(MemorySegment struct) { + return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static void is_ok(MemorySegment struct, boolean fieldValue) { + struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionStruct.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionStruct.java new file mode 100644 index 000000000..9e93d8e5a --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionStruct.java @@ -0,0 +1,266 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct OptionStruct { + * OptionOpaque *a; + * OptionOpaqueChar *b; + * uint32_t c; + * OptionOpaque *d; + * } + * } + */ +public class OptionStruct { + + OptionStruct() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("a"), + somelib_h.C_POINTER.withName("b"), + somelib_h.C_INT.withName("c"), + MemoryLayout.paddingLayout(4), + somelib_h.C_POINTER.withName("d") + ).withName("OptionStruct"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout a$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("a")); + + /** + * Layout for field: + * {@snippet lang=c : + * OptionOpaque *a + * } + */ + public static final AddressLayout a$layout() { + return a$LAYOUT; + } + + private static final long a$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * OptionOpaque *a + * } + */ + public static final long a$offset() { + return a$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * OptionOpaque *a + * } + */ + public static MemorySegment a(MemorySegment struct) { + return struct.get(a$LAYOUT, a$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * OptionOpaque *a + * } + */ + public static void a(MemorySegment struct, MemorySegment fieldValue) { + struct.set(a$LAYOUT, a$OFFSET, fieldValue); + } + + private static final AddressLayout b$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("b")); + + /** + * Layout for field: + * {@snippet lang=c : + * OptionOpaqueChar *b + * } + */ + public static final AddressLayout b$layout() { + return b$LAYOUT; + } + + private static final long b$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * OptionOpaqueChar *b + * } + */ + public static final long b$offset() { + return b$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * OptionOpaqueChar *b + * } + */ + public static MemorySegment b(MemorySegment struct) { + return struct.get(b$LAYOUT, b$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * OptionOpaqueChar *b + * } + */ + public static void b(MemorySegment struct, MemorySegment fieldValue) { + struct.set(b$LAYOUT, b$OFFSET, fieldValue); + } + + private static final OfInt c$LAYOUT = (OfInt)$LAYOUT.select(groupElement("c")); + + /** + * Layout for field: + * {@snippet lang=c : + * uint32_t c + * } + */ + public static final OfInt c$layout() { + return c$LAYOUT; + } + + private static final long c$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * uint32_t c + * } + */ + public static final long c$offset() { + return c$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * uint32_t c + * } + */ + public static int c(MemorySegment struct) { + return struct.get(c$LAYOUT, c$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * uint32_t c + * } + */ + public static void c(MemorySegment struct, int fieldValue) { + struct.set(c$LAYOUT, c$OFFSET, fieldValue); + } + + private static final AddressLayout d$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("d")); + + /** + * Layout for field: + * {@snippet lang=c : + * OptionOpaque *d + * } + */ + public static final AddressLayout d$layout() { + return d$LAYOUT; + } + + private static final long d$OFFSET = 24; + + /** + * Offset for field: + * {@snippet lang=c : + * OptionOpaque *d + * } + */ + public static final long d$offset() { + return d$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * OptionOpaque *d + * } + */ + public static MemorySegment d(MemorySegment struct) { + return struct.get(d$LAYOUT, d$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * OptionOpaque *d + * } + */ + public static void d(MemorySegment struct, MemorySegment fieldValue) { + struct.set(d$LAYOUT, d$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_failing_bar_result.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_failing_bar_result.java new file mode 100644 index 000000000..0b02cac84 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_failing_bar_result.java @@ -0,0 +1,224 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct ResultOpaque_new_failing_bar_result { + * union { + * ResultOpaque *ok; + * ErrorEnum err; + * }; + * bool is_ok; + * } + * } + */ +public class ResultOpaque_new_failing_bar_result { + + ResultOpaque_new_failing_bar_result() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.unionLayout( + somelib_h.C_POINTER.withName("ok"), + somelib_h.C_INT.withName("err") + ).withName("$anon$26:45"), + somelib_h.C_BOOL.withName("is_ok"), + MemoryLayout.paddingLayout(7) + ).withName("ResultOpaque_new_failing_bar_result"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout ok$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("$anon$26:45"), groupElement("ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * ResultOpaque *ok + * } + */ + public static final AddressLayout ok$layout() { + return ok$LAYOUT; + } + + private static final long ok$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * ResultOpaque *ok + * } + */ + public static final long ok$offset() { + return ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * ResultOpaque *ok + * } + */ + public static MemorySegment ok(MemorySegment struct) { + return struct.get(ok$LAYOUT, ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * ResultOpaque *ok + * } + */ + public static void ok(MemorySegment struct, MemorySegment fieldValue) { + struct.set(ok$LAYOUT, ok$OFFSET, fieldValue); + } + + private static final OfInt err$LAYOUT = (OfInt)$LAYOUT.select(groupElement("$anon$26:45"), groupElement("err")); + + /** + * Layout for field: + * {@snippet lang=c : + * ErrorEnum err + * } + */ + public static final OfInt err$layout() { + return err$LAYOUT; + } + + private static final long err$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * ErrorEnum err + * } + */ + public static final long err$offset() { + return err$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * ErrorEnum err + * } + */ + public static int err(MemorySegment struct) { + return struct.get(err$LAYOUT, err$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * ErrorEnum err + * } + */ + public static void err(MemorySegment struct, int fieldValue) { + struct.set(err$LAYOUT, err$OFFSET, fieldValue); + } + + private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final OfBoolean is_ok$layout() { + return is_ok$LAYOUT; + } + + private static final long is_ok$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final long is_ok$offset() { + return is_ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static boolean is_ok(MemorySegment struct) { + return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static void is_ok(MemorySegment struct, boolean fieldValue) { + struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_failing_foo_result.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_failing_foo_result.java new file mode 100644 index 000000000..3c0137f18 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_failing_foo_result.java @@ -0,0 +1,224 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct ResultOpaque_new_failing_foo_result { + * union { + * ResultOpaque *ok; + * ErrorEnum err; + * }; + * bool is_ok; + * } + * } + */ +public class ResultOpaque_new_failing_foo_result { + + ResultOpaque_new_failing_foo_result() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.unionLayout( + somelib_h.C_POINTER.withName("ok"), + somelib_h.C_INT.withName("err") + ).withName("$anon$23:45"), + somelib_h.C_BOOL.withName("is_ok"), + MemoryLayout.paddingLayout(7) + ).withName("ResultOpaque_new_failing_foo_result"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout ok$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("$anon$23:45"), groupElement("ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * ResultOpaque *ok + * } + */ + public static final AddressLayout ok$layout() { + return ok$LAYOUT; + } + + private static final long ok$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * ResultOpaque *ok + * } + */ + public static final long ok$offset() { + return ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * ResultOpaque *ok + * } + */ + public static MemorySegment ok(MemorySegment struct) { + return struct.get(ok$LAYOUT, ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * ResultOpaque *ok + * } + */ + public static void ok(MemorySegment struct, MemorySegment fieldValue) { + struct.set(ok$LAYOUT, ok$OFFSET, fieldValue); + } + + private static final OfInt err$LAYOUT = (OfInt)$LAYOUT.select(groupElement("$anon$23:45"), groupElement("err")); + + /** + * Layout for field: + * {@snippet lang=c : + * ErrorEnum err + * } + */ + public static final OfInt err$layout() { + return err$LAYOUT; + } + + private static final long err$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * ErrorEnum err + * } + */ + public static final long err$offset() { + return err$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * ErrorEnum err + * } + */ + public static int err(MemorySegment struct) { + return struct.get(err$LAYOUT, err$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * ErrorEnum err + * } + */ + public static void err(MemorySegment struct, int fieldValue) { + struct.set(err$LAYOUT, err$OFFSET, fieldValue); + } + + private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final OfBoolean is_ok$layout() { + return is_ok$LAYOUT; + } + + private static final long is_ok$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final long is_ok$offset() { + return is_ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static boolean is_ok(MemorySegment struct) { + return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static void is_ok(MemorySegment struct, boolean fieldValue) { + struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_failing_struct_result.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_failing_struct_result.java new file mode 100644 index 000000000..b6bda0217 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_failing_struct_result.java @@ -0,0 +1,224 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct ResultOpaque_new_failing_struct_result { + * union { + * ResultOpaque *ok; + * ErrorStruct err; + * }; + * bool is_ok; + * } + * } + */ +public class ResultOpaque_new_failing_struct_result { + + ResultOpaque_new_failing_struct_result() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.unionLayout( + somelib_h.C_POINTER.withName("ok"), + ErrorStruct.layout().withName("err") + ).withName("$anon$32:48"), + somelib_h.C_BOOL.withName("is_ok"), + MemoryLayout.paddingLayout(7) + ).withName("ResultOpaque_new_failing_struct_result"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout ok$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("$anon$32:48"), groupElement("ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * ResultOpaque *ok + * } + */ + public static final AddressLayout ok$layout() { + return ok$LAYOUT; + } + + private static final long ok$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * ResultOpaque *ok + * } + */ + public static final long ok$offset() { + return ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * ResultOpaque *ok + * } + */ + public static MemorySegment ok(MemorySegment struct) { + return struct.get(ok$LAYOUT, ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * ResultOpaque *ok + * } + */ + public static void ok(MemorySegment struct, MemorySegment fieldValue) { + struct.set(ok$LAYOUT, ok$OFFSET, fieldValue); + } + + private static final GroupLayout err$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$32:48"), groupElement("err")); + + /** + * Layout for field: + * {@snippet lang=c : + * ErrorStruct err + * } + */ + public static final GroupLayout err$layout() { + return err$LAYOUT; + } + + private static final long err$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * ErrorStruct err + * } + */ + public static final long err$offset() { + return err$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * ErrorStruct err + * } + */ + public static MemorySegment err(MemorySegment struct) { + return struct.asSlice(err$OFFSET, err$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * ErrorStruct err + * } + */ + public static void err(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, err$OFFSET, err$LAYOUT.byteSize()); + } + + private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final OfBoolean is_ok$layout() { + return is_ok$LAYOUT; + } + + private static final long is_ok$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final long is_ok$offset() { + return is_ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static boolean is_ok(MemorySegment struct) { + return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static void is_ok(MemorySegment struct, boolean fieldValue) { + struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_failing_unit_result.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_failing_unit_result.java new file mode 100644 index 000000000..26da09930 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_failing_unit_result.java @@ -0,0 +1,178 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct ResultOpaque_new_failing_unit_result { + * union { + * ResultOpaque *ok; + * }; + * bool is_ok; + * } + * } + */ +public class ResultOpaque_new_failing_unit_result { + + ResultOpaque_new_failing_unit_result() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.unionLayout( + somelib_h.C_POINTER.withName("ok") + ).withName("$anon$29:46"), + somelib_h.C_BOOL.withName("is_ok"), + MemoryLayout.paddingLayout(7) + ).withName("ResultOpaque_new_failing_unit_result"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout ok$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("$anon$29:46"), groupElement("ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * ResultOpaque *ok + * } + */ + public static final AddressLayout ok$layout() { + return ok$LAYOUT; + } + + private static final long ok$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * ResultOpaque *ok + * } + */ + public static final long ok$offset() { + return ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * ResultOpaque *ok + * } + */ + public static MemorySegment ok(MemorySegment struct) { + return struct.get(ok$LAYOUT, ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * ResultOpaque *ok + * } + */ + public static void ok(MemorySegment struct, MemorySegment fieldValue) { + struct.set(ok$LAYOUT, ok$OFFSET, fieldValue); + } + + private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final OfBoolean is_ok$layout() { + return is_ok$LAYOUT; + } + + private static final long is_ok$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final long is_ok$offset() { + return is_ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static boolean is_ok(MemorySegment struct) { + return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static void is_ok(MemorySegment struct, boolean fieldValue) { + struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_in_enum_err_result.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_in_enum_err_result.java new file mode 100644 index 000000000..588694ecd --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_in_enum_err_result.java @@ -0,0 +1,224 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct ResultOpaque_new_in_enum_err_result { + * union { + * ErrorEnum ok; + * ResultOpaque *err; + * }; + * bool is_ok; + * } + * } + */ +public class ResultOpaque_new_in_enum_err_result { + + ResultOpaque_new_in_enum_err_result() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.unionLayout( + somelib_h.C_INT.withName("ok"), + somelib_h.C_POINTER.withName("err") + ).withName("$anon$41:45"), + somelib_h.C_BOOL.withName("is_ok"), + MemoryLayout.paddingLayout(7) + ).withName("ResultOpaque_new_in_enum_err_result"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt ok$LAYOUT = (OfInt)$LAYOUT.select(groupElement("$anon$41:45"), groupElement("ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * ErrorEnum ok + * } + */ + public static final OfInt ok$layout() { + return ok$LAYOUT; + } + + private static final long ok$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * ErrorEnum ok + * } + */ + public static final long ok$offset() { + return ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * ErrorEnum ok + * } + */ + public static int ok(MemorySegment struct) { + return struct.get(ok$LAYOUT, ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * ErrorEnum ok + * } + */ + public static void ok(MemorySegment struct, int fieldValue) { + struct.set(ok$LAYOUT, ok$OFFSET, fieldValue); + } + + private static final AddressLayout err$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("$anon$41:45"), groupElement("err")); + + /** + * Layout for field: + * {@snippet lang=c : + * ResultOpaque *err + * } + */ + public static final AddressLayout err$layout() { + return err$LAYOUT; + } + + private static final long err$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * ResultOpaque *err + * } + */ + public static final long err$offset() { + return err$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * ResultOpaque *err + * } + */ + public static MemorySegment err(MemorySegment struct) { + return struct.get(err$LAYOUT, err$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * ResultOpaque *err + * } + */ + public static void err(MemorySegment struct, MemorySegment fieldValue) { + struct.set(err$LAYOUT, err$OFFSET, fieldValue); + } + + private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final OfBoolean is_ok$layout() { + return is_ok$LAYOUT; + } + + private static final long is_ok$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final long is_ok$offset() { + return is_ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static boolean is_ok(MemorySegment struct) { + return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static void is_ok(MemorySegment struct, boolean fieldValue) { + struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_in_err_result.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_in_err_result.java new file mode 100644 index 000000000..da94af79f --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_in_err_result.java @@ -0,0 +1,178 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct ResultOpaque_new_in_err_result { + * union { + * ResultOpaque *err; + * }; + * bool is_ok; + * } + * } + */ +public class ResultOpaque_new_in_err_result { + + ResultOpaque_new_in_err_result() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.unionLayout( + somelib_h.C_POINTER.withName("err") + ).withName("$anon$35:40"), + somelib_h.C_BOOL.withName("is_ok"), + MemoryLayout.paddingLayout(7) + ).withName("ResultOpaque_new_in_err_result"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout err$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("$anon$35:40"), groupElement("err")); + + /** + * Layout for field: + * {@snippet lang=c : + * ResultOpaque *err + * } + */ + public static final AddressLayout err$layout() { + return err$LAYOUT; + } + + private static final long err$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * ResultOpaque *err + * } + */ + public static final long err$offset() { + return err$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * ResultOpaque *err + * } + */ + public static MemorySegment err(MemorySegment struct) { + return struct.get(err$LAYOUT, err$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * ResultOpaque *err + * } + */ + public static void err(MemorySegment struct, MemorySegment fieldValue) { + struct.set(err$LAYOUT, err$OFFSET, fieldValue); + } + + private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final OfBoolean is_ok$layout() { + return is_ok$LAYOUT; + } + + private static final long is_ok$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final long is_ok$offset() { + return is_ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static boolean is_ok(MemorySegment struct) { + return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static void is_ok(MemorySegment struct, boolean fieldValue) { + struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_int_result.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_int_result.java new file mode 100644 index 000000000..5038cbb46 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_int_result.java @@ -0,0 +1,178 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct ResultOpaque_new_int_result { + * union { + * int32_t ok; + * }; + * bool is_ok; + * } + * } + */ +public class ResultOpaque_new_int_result { + + ResultOpaque_new_int_result() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.unionLayout( + somelib_h.C_INT.withName("ok") + ).withName("$anon$38:37"), + somelib_h.C_BOOL.withName("is_ok"), + MemoryLayout.paddingLayout(3) + ).withName("ResultOpaque_new_int_result"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt ok$LAYOUT = (OfInt)$LAYOUT.select(groupElement("$anon$38:37"), groupElement("ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * int32_t ok + * } + */ + public static final OfInt ok$layout() { + return ok$LAYOUT; + } + + private static final long ok$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * int32_t ok + * } + */ + public static final long ok$offset() { + return ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int32_t ok + * } + */ + public static int ok(MemorySegment struct) { + return struct.get(ok$LAYOUT, ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int32_t ok + * } + */ + public static void ok(MemorySegment struct, int fieldValue) { + struct.set(ok$LAYOUT, ok$OFFSET, fieldValue); + } + + private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final OfBoolean is_ok$layout() { + return is_ok$LAYOUT; + } + + private static final long is_ok$OFFSET = 4; + + /** + * Offset for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final long is_ok$offset() { + return is_ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static boolean is_ok(MemorySegment struct) { + return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static void is_ok(MemorySegment struct, boolean fieldValue) { + struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_result.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_result.java new file mode 100644 index 000000000..516d30060 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_result.java @@ -0,0 +1,224 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct ResultOpaque_new_result { + * union { + * ResultOpaque *ok; + * ErrorEnum err; + * }; + * bool is_ok; + * } + * } + */ +public class ResultOpaque_new_result { + + ResultOpaque_new_result() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.unionLayout( + somelib_h.C_POINTER.withName("ok"), + somelib_h.C_INT.withName("err") + ).withName("$anon$20:33"), + somelib_h.C_BOOL.withName("is_ok"), + MemoryLayout.paddingLayout(7) + ).withName("ResultOpaque_new_result"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout ok$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("$anon$20:33"), groupElement("ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * ResultOpaque *ok + * } + */ + public static final AddressLayout ok$layout() { + return ok$LAYOUT; + } + + private static final long ok$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * ResultOpaque *ok + * } + */ + public static final long ok$offset() { + return ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * ResultOpaque *ok + * } + */ + public static MemorySegment ok(MemorySegment struct) { + return struct.get(ok$LAYOUT, ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * ResultOpaque *ok + * } + */ + public static void ok(MemorySegment struct, MemorySegment fieldValue) { + struct.set(ok$LAYOUT, ok$OFFSET, fieldValue); + } + + private static final OfInt err$LAYOUT = (OfInt)$LAYOUT.select(groupElement("$anon$20:33"), groupElement("err")); + + /** + * Layout for field: + * {@snippet lang=c : + * ErrorEnum err + * } + */ + public static final OfInt err$layout() { + return err$LAYOUT; + } + + private static final long err$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * ErrorEnum err + * } + */ + public static final long err$offset() { + return err$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * ErrorEnum err + * } + */ + public static int err(MemorySegment struct) { + return struct.get(err$LAYOUT, err$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * ErrorEnum err + * } + */ + public static void err(MemorySegment struct, int fieldValue) { + struct.set(err$LAYOUT, err$OFFSET, fieldValue); + } + + private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final OfBoolean is_ok$layout() { + return is_ok$LAYOUT; + } + + private static final long is_ok$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final long is_ok$offset() { + return is_ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static boolean is_ok(MemorySegment struct) { + return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static void is_ok(MemorySegment struct, boolean fieldValue) { + struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_OSUnalignedU16.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_OSUnalignedU16.java new file mode 100644 index 000000000..7d88e1de8 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_OSUnalignedU16.java @@ -0,0 +1,127 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct _OSUnalignedU16 { + * volatile uint16_t __val; + * } + * } + */ +public class _OSUnalignedU16 { + + _OSUnalignedU16() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.align(somelib_h.C_SHORT, 1).withName("__val") + ).withName("_OSUnalignedU16"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfShort __val$LAYOUT = (OfShort)$LAYOUT.select(groupElement("__val")); + + /** + * Layout for field: + * {@snippet lang=c : + * volatile uint16_t __val + * } + */ + public static final OfShort __val$layout() { + return __val$LAYOUT; + } + + private static final long __val$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * volatile uint16_t __val + * } + */ + public static final long __val$offset() { + return __val$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * volatile uint16_t __val + * } + */ + public static short __val(MemorySegment struct) { + return struct.get(__val$LAYOUT, __val$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * volatile uint16_t __val + * } + */ + public static void __val(MemorySegment struct, short fieldValue) { + struct.set(__val$LAYOUT, __val$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_OSUnalignedU32.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_OSUnalignedU32.java new file mode 100644 index 000000000..e92d4f122 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_OSUnalignedU32.java @@ -0,0 +1,127 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct _OSUnalignedU32 { + * volatile uint32_t __val; + * } + * } + */ +public class _OSUnalignedU32 { + + _OSUnalignedU32() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.align(somelib_h.C_INT, 1).withName("__val") + ).withName("_OSUnalignedU32"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt __val$LAYOUT = (OfInt)$LAYOUT.select(groupElement("__val")); + + /** + * Layout for field: + * {@snippet lang=c : + * volatile uint32_t __val + * } + */ + public static final OfInt __val$layout() { + return __val$LAYOUT; + } + + private static final long __val$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * volatile uint32_t __val + * } + */ + public static final long __val$offset() { + return __val$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * volatile uint32_t __val + * } + */ + public static int __val(MemorySegment struct) { + return struct.get(__val$LAYOUT, __val$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * volatile uint32_t __val + * } + */ + public static void __val(MemorySegment struct, int fieldValue) { + struct.set(__val$LAYOUT, __val$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_OSUnalignedU64.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_OSUnalignedU64.java new file mode 100644 index 000000000..3c28f93f5 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_OSUnalignedU64.java @@ -0,0 +1,127 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct _OSUnalignedU64 { + * volatile uint64_t __val; + * } + * } + */ +public class _OSUnalignedU64 { + + _OSUnalignedU64() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.align(somelib_h.C_LONG_LONG, 1).withName("__val") + ).withName("_OSUnalignedU64"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong __val$LAYOUT = (OfLong)$LAYOUT.select(groupElement("__val")); + + /** + * Layout for field: + * {@snippet lang=c : + * volatile uint64_t __val + * } + */ + public static final OfLong __val$layout() { + return __val$LAYOUT; + } + + private static final long __val$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * volatile uint64_t __val + * } + */ + public static final long __val$offset() { + return __val$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * volatile uint64_t __val + * } + */ + public static long __val(MemorySegment struct) { + return struct.get(__val$LAYOUT, __val$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * volatile uint64_t __val + * } + */ + public static void __val(MemorySegment struct, long fieldValue) { + struct.set(__val$LAYOUT, __val$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__darwin_mbstate_t.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__darwin_mbstate_t.java new file mode 100644 index 000000000..53cbe9810 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__darwin_mbstate_t.java @@ -0,0 +1,26 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef __mbstate_t __darwin_mbstate_t + * } + */ +public class __darwin_mbstate_t extends __mbstate_t { + + __darwin_mbstate_t() { + // Should not be called directly + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_attr_t.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_attr_t.java new file mode 100644 index 000000000..5ec0ad420 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_attr_t.java @@ -0,0 +1,29 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef struct _opaque_pthread_attr_t { + * long __sig; + * char __opaque[56]; + * } __darwin_pthread_attr_t + * } + */ +public class __darwin_pthread_attr_t extends _opaque_pthread_attr_t { + + __darwin_pthread_attr_t() { + // Should not be called directly + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_cond_t.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_cond_t.java new file mode 100644 index 000000000..82e1d131b --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_cond_t.java @@ -0,0 +1,29 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef struct _opaque_pthread_cond_t { + * long __sig; + * char __opaque[40]; + * } __darwin_pthread_cond_t + * } + */ +public class __darwin_pthread_cond_t extends _opaque_pthread_cond_t { + + __darwin_pthread_cond_t() { + // Should not be called directly + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_condattr_t.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_condattr_t.java new file mode 100644 index 000000000..598f5a21f --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_condattr_t.java @@ -0,0 +1,29 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef struct _opaque_pthread_condattr_t { + * long __sig; + * char __opaque[8]; + * } __darwin_pthread_condattr_t + * } + */ +public class __darwin_pthread_condattr_t extends _opaque_pthread_condattr_t { + + __darwin_pthread_condattr_t() { + // Should not be called directly + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_handler_rec.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_handler_rec.java new file mode 100644 index 000000000..ea9c9af0b --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_handler_rec.java @@ -0,0 +1,272 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct __darwin_pthread_handler_rec { + * void (*__routine)(void *); + * void *__arg; + * struct __darwin_pthread_handler_rec *__next; + * } + * } + */ +public class __darwin_pthread_handler_rec { + + __darwin_pthread_handler_rec() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("__routine"), + somelib_h.C_POINTER.withName("__arg"), + somelib_h.C_POINTER.withName("__next") + ).withName("__darwin_pthread_handler_rec"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + /** + * {@snippet lang=c : + * void (*__routine)(void *) + * } + */ + public static class __routine { + + __routine() { + // Should not be called directly + } + + /** + * The function pointer signature, expressed as a functional interface + */ + public interface Function { + void apply(MemorySegment _x0); + } + + private static final FunctionDescriptor $DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); + + /** + * The descriptor of this function pointer + */ + public static FunctionDescriptor descriptor() { + return $DESC; + } + + private static final MethodHandle UP$MH = somelib_h.upcallHandle(__routine.Function.class, "apply", $DESC); + + /** + * Allocates a new upcall stub, whose implementation is defined by {@code fi}. + * The lifetime of the returned segment is managed by {@code arena} + */ + public static MemorySegment allocate(__routine.Function fi, Arena arena) { + return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena); + } + + private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC); + + /** + * Invoke the upcall stub {@code funcPtr}, with given parameters + */ + public static void invoke(MemorySegment funcPtr,MemorySegment _x0) { + try { + DOWN$MH.invokeExact(funcPtr, _x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static final AddressLayout __routine$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("__routine")); + + /** + * Layout for field: + * {@snippet lang=c : + * void (*__routine)(void *) + * } + */ + public static final AddressLayout __routine$layout() { + return __routine$LAYOUT; + } + + private static final long __routine$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * void (*__routine)(void *) + * } + */ + public static final long __routine$offset() { + return __routine$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * void (*__routine)(void *) + * } + */ + public static MemorySegment __routine(MemorySegment struct) { + return struct.get(__routine$LAYOUT, __routine$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * void (*__routine)(void *) + * } + */ + public static void __routine(MemorySegment struct, MemorySegment fieldValue) { + struct.set(__routine$LAYOUT, __routine$OFFSET, fieldValue); + } + + private static final AddressLayout __arg$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("__arg")); + + /** + * Layout for field: + * {@snippet lang=c : + * void *__arg + * } + */ + public static final AddressLayout __arg$layout() { + return __arg$LAYOUT; + } + + private static final long __arg$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * void *__arg + * } + */ + public static final long __arg$offset() { + return __arg$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * void *__arg + * } + */ + public static MemorySegment __arg(MemorySegment struct) { + return struct.get(__arg$LAYOUT, __arg$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * void *__arg + * } + */ + public static void __arg(MemorySegment struct, MemorySegment fieldValue) { + struct.set(__arg$LAYOUT, __arg$OFFSET, fieldValue); + } + + private static final AddressLayout __next$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("__next")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct __darwin_pthread_handler_rec *__next + * } + */ + public static final AddressLayout __next$layout() { + return __next$LAYOUT; + } + + private static final long __next$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * struct __darwin_pthread_handler_rec *__next + * } + */ + public static final long __next$offset() { + return __next$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct __darwin_pthread_handler_rec *__next + * } + */ + public static MemorySegment __next(MemorySegment struct) { + return struct.get(__next$LAYOUT, __next$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct __darwin_pthread_handler_rec *__next + * } + */ + public static void __next(MemorySegment struct, MemorySegment fieldValue) { + struct.set(__next$LAYOUT, __next$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_mutex_t.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_mutex_t.java new file mode 100644 index 000000000..60a2fde5e --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_mutex_t.java @@ -0,0 +1,29 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef struct _opaque_pthread_mutex_t { + * long __sig; + * char __opaque[56]; + * } __darwin_pthread_mutex_t + * } + */ +public class __darwin_pthread_mutex_t extends _opaque_pthread_mutex_t { + + __darwin_pthread_mutex_t() { + // Should not be called directly + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_mutexattr_t.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_mutexattr_t.java new file mode 100644 index 000000000..d0212cad8 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_mutexattr_t.java @@ -0,0 +1,29 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef struct _opaque_pthread_mutexattr_t { + * long __sig; + * char __opaque[8]; + * } __darwin_pthread_mutexattr_t + * } + */ +public class __darwin_pthread_mutexattr_t extends _opaque_pthread_mutexattr_t { + + __darwin_pthread_mutexattr_t() { + // Should not be called directly + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_once_t.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_once_t.java new file mode 100644 index 000000000..7bd98a64e --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_once_t.java @@ -0,0 +1,29 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef struct _opaque_pthread_once_t { + * long __sig; + * char __opaque[8]; + * } __darwin_pthread_once_t + * } + */ +public class __darwin_pthread_once_t extends _opaque_pthread_once_t { + + __darwin_pthread_once_t() { + // Should not be called directly + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_rwlock_t.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_rwlock_t.java new file mode 100644 index 000000000..b39afdd2b --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_rwlock_t.java @@ -0,0 +1,29 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef struct _opaque_pthread_rwlock_t { + * long __sig; + * char __opaque[192]; + * } __darwin_pthread_rwlock_t + * } + */ +public class __darwin_pthread_rwlock_t extends _opaque_pthread_rwlock_t { + + __darwin_pthread_rwlock_t() { + // Should not be called directly + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_rwlockattr_t.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_rwlockattr_t.java new file mode 100644 index 000000000..1c415ffc7 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_rwlockattr_t.java @@ -0,0 +1,29 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef struct _opaque_pthread_rwlockattr_t { + * long __sig; + * char __opaque[16]; + * } __darwin_pthread_rwlockattr_t + * } + */ +public class __darwin_pthread_rwlockattr_t extends _opaque_pthread_rwlockattr_t { + + __darwin_pthread_rwlockattr_t() { + // Should not be called directly + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__mbstate_t.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__mbstate_t.java new file mode 100644 index 000000000..b83bd44db --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__mbstate_t.java @@ -0,0 +1,206 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * union { + * char __mbstate8[128]; + * long long _mbstateL; + * } + * } + */ +public class __mbstate_t { + + __mbstate_t() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.unionLayout( + MemoryLayout.sequenceLayout(128, somelib_h.C_CHAR).withName("__mbstate8"), + somelib_h.C_LONG_LONG.withName("_mbstateL") + ).withName("$anon$54:9"); + + /** + * The layout of this union + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final SequenceLayout __mbstate8$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("__mbstate8")); + + /** + * Layout for field: + * {@snippet lang=c : + * char __mbstate8[128] + * } + */ + public static final SequenceLayout __mbstate8$layout() { + return __mbstate8$LAYOUT; + } + + private static final long __mbstate8$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * char __mbstate8[128] + * } + */ + public static final long __mbstate8$offset() { + return __mbstate8$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * char __mbstate8[128] + * } + */ + public static MemorySegment __mbstate8(MemorySegment union) { + return union.asSlice(__mbstate8$OFFSET, __mbstate8$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * char __mbstate8[128] + * } + */ + public static void __mbstate8(MemorySegment union, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, union, __mbstate8$OFFSET, __mbstate8$LAYOUT.byteSize()); + } + + private static long[] __mbstate8$DIMS = { 128 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * char __mbstate8[128] + * } + */ + public static long[] __mbstate8$dimensions() { + return __mbstate8$DIMS; + } + private static final VarHandle __mbstate8$ELEM_HANDLE = __mbstate8$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * char __mbstate8[128] + * } + */ + public static byte __mbstate8(MemorySegment union, long index0) { + return (byte)__mbstate8$ELEM_HANDLE.get(union, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * char __mbstate8[128] + * } + */ + public static void __mbstate8(MemorySegment union, long index0, byte fieldValue) { + __mbstate8$ELEM_HANDLE.set(union, 0L, index0, fieldValue); + } + + private static final OfLong _mbstateL$LAYOUT = (OfLong)$LAYOUT.select(groupElement("_mbstateL")); + + /** + * Layout for field: + * {@snippet lang=c : + * long long _mbstateL + * } + */ + public static final OfLong _mbstateL$layout() { + return _mbstateL$LAYOUT; + } + + private static final long _mbstateL$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * long long _mbstateL + * } + */ + public static final long _mbstateL$offset() { + return _mbstateL$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * long long _mbstateL + * } + */ + public static long _mbstateL(MemorySegment union) { + return union.get(_mbstateL$LAYOUT, _mbstateL$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * long long _mbstateL + * } + */ + public static void _mbstateL(MemorySegment union, long fieldValue) { + union.set(_mbstateL$LAYOUT, _mbstateL$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this union + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__sFILE.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__sFILE.java new file mode 100644 index 000000000..2da0db2d6 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__sFILE.java @@ -0,0 +1,1292 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct __sFILE { + * unsigned char *_p; + * int _r; + * int _w; + * short _flags; + * short _file; + * struct __sbuf _bf; + * int _lbfsize; + * void *_cookie; + * int (* _Nullable _close)(void *); + * int (* _Nullable _read)(void *, char *, int); + * fpos_t (* _Nullable _seek)(void *, fpos_t, int); + * int (* _Nullable _write)(void *, const char *, int); + * struct __sbuf _ub; + * struct __sFILEX *_extra; + * int _ur; + * unsigned char _ubuf[3]; + * unsigned char _nbuf[1]; + * struct __sbuf _lb; + * int _blksize; + * fpos_t _offset; + * } + * } + */ +public class __sFILE { + + __sFILE() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("_p"), + somelib_h.C_INT.withName("_r"), + somelib_h.C_INT.withName("_w"), + somelib_h.C_SHORT.withName("_flags"), + somelib_h.C_SHORT.withName("_file"), + MemoryLayout.paddingLayout(4), + __sbuf.layout().withName("_bf"), + somelib_h.C_INT.withName("_lbfsize"), + MemoryLayout.paddingLayout(4), + somelib_h.C_POINTER.withName("_cookie"), + somelib_h.C_POINTER.withName("_close"), + somelib_h.C_POINTER.withName("_read"), + somelib_h.C_POINTER.withName("_seek"), + somelib_h.C_POINTER.withName("_write"), + __sbuf.layout().withName("_ub"), + somelib_h.C_POINTER.withName("_extra"), + somelib_h.C_INT.withName("_ur"), + MemoryLayout.sequenceLayout(3, somelib_h.C_CHAR).withName("_ubuf"), + MemoryLayout.sequenceLayout(1, somelib_h.C_CHAR).withName("_nbuf"), + __sbuf.layout().withName("_lb"), + somelib_h.C_INT.withName("_blksize"), + MemoryLayout.paddingLayout(4), + somelib_h.C_LONG_LONG.withName("_offset") + ).withName("__sFILE"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout _p$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("_p")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned char *_p + * } + */ + public static final AddressLayout _p$layout() { + return _p$LAYOUT; + } + + private static final long _p$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned char *_p + * } + */ + public static final long _p$offset() { + return _p$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned char *_p + * } + */ + public static MemorySegment _p(MemorySegment struct) { + return struct.get(_p$LAYOUT, _p$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned char *_p + * } + */ + public static void _p(MemorySegment struct, MemorySegment fieldValue) { + struct.set(_p$LAYOUT, _p$OFFSET, fieldValue); + } + + private static final OfInt _r$LAYOUT = (OfInt)$LAYOUT.select(groupElement("_r")); + + /** + * Layout for field: + * {@snippet lang=c : + * int _r + * } + */ + public static final OfInt _r$layout() { + return _r$LAYOUT; + } + + private static final long _r$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * int _r + * } + */ + public static final long _r$offset() { + return _r$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int _r + * } + */ + public static int _r(MemorySegment struct) { + return struct.get(_r$LAYOUT, _r$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int _r + * } + */ + public static void _r(MemorySegment struct, int fieldValue) { + struct.set(_r$LAYOUT, _r$OFFSET, fieldValue); + } + + private static final OfInt _w$LAYOUT = (OfInt)$LAYOUT.select(groupElement("_w")); + + /** + * Layout for field: + * {@snippet lang=c : + * int _w + * } + */ + public static final OfInt _w$layout() { + return _w$LAYOUT; + } + + private static final long _w$OFFSET = 12; + + /** + * Offset for field: + * {@snippet lang=c : + * int _w + * } + */ + public static final long _w$offset() { + return _w$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int _w + * } + */ + public static int _w(MemorySegment struct) { + return struct.get(_w$LAYOUT, _w$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int _w + * } + */ + public static void _w(MemorySegment struct, int fieldValue) { + struct.set(_w$LAYOUT, _w$OFFSET, fieldValue); + } + + private static final OfShort _flags$LAYOUT = (OfShort)$LAYOUT.select(groupElement("_flags")); + + /** + * Layout for field: + * {@snippet lang=c : + * short _flags + * } + */ + public static final OfShort _flags$layout() { + return _flags$LAYOUT; + } + + private static final long _flags$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * short _flags + * } + */ + public static final long _flags$offset() { + return _flags$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * short _flags + * } + */ + public static short _flags(MemorySegment struct) { + return struct.get(_flags$LAYOUT, _flags$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * short _flags + * } + */ + public static void _flags(MemorySegment struct, short fieldValue) { + struct.set(_flags$LAYOUT, _flags$OFFSET, fieldValue); + } + + private static final OfShort _file$LAYOUT = (OfShort)$LAYOUT.select(groupElement("_file")); + + /** + * Layout for field: + * {@snippet lang=c : + * short _file + * } + */ + public static final OfShort _file$layout() { + return _file$LAYOUT; + } + + private static final long _file$OFFSET = 18; + + /** + * Offset for field: + * {@snippet lang=c : + * short _file + * } + */ + public static final long _file$offset() { + return _file$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * short _file + * } + */ + public static short _file(MemorySegment struct) { + return struct.get(_file$LAYOUT, _file$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * short _file + * } + */ + public static void _file(MemorySegment struct, short fieldValue) { + struct.set(_file$LAYOUT, _file$OFFSET, fieldValue); + } + + private static final GroupLayout _bf$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("_bf")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct __sbuf _bf + * } + */ + public static final GroupLayout _bf$layout() { + return _bf$LAYOUT; + } + + private static final long _bf$OFFSET = 24; + + /** + * Offset for field: + * {@snippet lang=c : + * struct __sbuf _bf + * } + */ + public static final long _bf$offset() { + return _bf$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct __sbuf _bf + * } + */ + public static MemorySegment _bf(MemorySegment struct) { + return struct.asSlice(_bf$OFFSET, _bf$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct __sbuf _bf + * } + */ + public static void _bf(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, _bf$OFFSET, _bf$LAYOUT.byteSize()); + } + + private static final OfInt _lbfsize$LAYOUT = (OfInt)$LAYOUT.select(groupElement("_lbfsize")); + + /** + * Layout for field: + * {@snippet lang=c : + * int _lbfsize + * } + */ + public static final OfInt _lbfsize$layout() { + return _lbfsize$LAYOUT; + } + + private static final long _lbfsize$OFFSET = 40; + + /** + * Offset for field: + * {@snippet lang=c : + * int _lbfsize + * } + */ + public static final long _lbfsize$offset() { + return _lbfsize$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int _lbfsize + * } + */ + public static int _lbfsize(MemorySegment struct) { + return struct.get(_lbfsize$LAYOUT, _lbfsize$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int _lbfsize + * } + */ + public static void _lbfsize(MemorySegment struct, int fieldValue) { + struct.set(_lbfsize$LAYOUT, _lbfsize$OFFSET, fieldValue); + } + + private static final AddressLayout _cookie$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("_cookie")); + + /** + * Layout for field: + * {@snippet lang=c : + * void *_cookie + * } + */ + public static final AddressLayout _cookie$layout() { + return _cookie$LAYOUT; + } + + private static final long _cookie$OFFSET = 48; + + /** + * Offset for field: + * {@snippet lang=c : + * void *_cookie + * } + */ + public static final long _cookie$offset() { + return _cookie$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * void *_cookie + * } + */ + public static MemorySegment _cookie(MemorySegment struct) { + return struct.get(_cookie$LAYOUT, _cookie$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * void *_cookie + * } + */ + public static void _cookie(MemorySegment struct, MemorySegment fieldValue) { + struct.set(_cookie$LAYOUT, _cookie$OFFSET, fieldValue); + } + + /** + * {@snippet lang=c : + * int (* _Nullable _close)(void *) + * } + */ + public static class _close { + + _close() { + // Should not be called directly + } + + /** + * The function pointer signature, expressed as a functional interface + */ + public interface Function { + int apply(MemorySegment _x0); + } + + private static final FunctionDescriptor $DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + /** + * The descriptor of this function pointer + */ + public static FunctionDescriptor descriptor() { + return $DESC; + } + + private static final MethodHandle UP$MH = somelib_h.upcallHandle(_close.Function.class, "apply", $DESC); + + /** + * Allocates a new upcall stub, whose implementation is defined by {@code fi}. + * The lifetime of the returned segment is managed by {@code arena} + */ + public static MemorySegment allocate(_close.Function fi, Arena arena) { + return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena); + } + + private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC); + + /** + * Invoke the upcall stub {@code funcPtr}, with given parameters + */ + public static int invoke(MemorySegment funcPtr,MemorySegment _x0) { + try { + return (int) DOWN$MH.invokeExact(funcPtr, _x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static final AddressLayout _close$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("_close")); + + /** + * Layout for field: + * {@snippet lang=c : + * int (* _Nullable _close)(void *) + * } + */ + public static final AddressLayout _close$layout() { + return _close$LAYOUT; + } + + private static final long _close$OFFSET = 56; + + /** + * Offset for field: + * {@snippet lang=c : + * int (* _Nullable _close)(void *) + * } + */ + public static final long _close$offset() { + return _close$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int (* _Nullable _close)(void *) + * } + */ + public static MemorySegment _close(MemorySegment struct) { + return struct.get(_close$LAYOUT, _close$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int (* _Nullable _close)(void *) + * } + */ + public static void _close(MemorySegment struct, MemorySegment fieldValue) { + struct.set(_close$LAYOUT, _close$OFFSET, fieldValue); + } + + /** + * {@snippet lang=c : + * int (* _Nullable _read)(void *, char *, int) + * } + */ + public static class _read { + + _read() { + // Should not be called directly + } + + /** + * The function pointer signature, expressed as a functional interface + */ + public interface Function { + int apply(MemorySegment _x0, MemorySegment _x1, int _x2); + } + + private static final FunctionDescriptor $DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_INT + ); + + /** + * The descriptor of this function pointer + */ + public static FunctionDescriptor descriptor() { + return $DESC; + } + + private static final MethodHandle UP$MH = somelib_h.upcallHandle(_read.Function.class, "apply", $DESC); + + /** + * Allocates a new upcall stub, whose implementation is defined by {@code fi}. + * The lifetime of the returned segment is managed by {@code arena} + */ + public static MemorySegment allocate(_read.Function fi, Arena arena) { + return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena); + } + + private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC); + + /** + * Invoke the upcall stub {@code funcPtr}, with given parameters + */ + public static int invoke(MemorySegment funcPtr,MemorySegment _x0, MemorySegment _x1, int _x2) { + try { + return (int) DOWN$MH.invokeExact(funcPtr, _x0, _x1, _x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static final AddressLayout _read$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("_read")); + + /** + * Layout for field: + * {@snippet lang=c : + * int (* _Nullable _read)(void *, char *, int) + * } + */ + public static final AddressLayout _read$layout() { + return _read$LAYOUT; + } + + private static final long _read$OFFSET = 64; + + /** + * Offset for field: + * {@snippet lang=c : + * int (* _Nullable _read)(void *, char *, int) + * } + */ + public static final long _read$offset() { + return _read$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int (* _Nullable _read)(void *, char *, int) + * } + */ + public static MemorySegment _read(MemorySegment struct) { + return struct.get(_read$LAYOUT, _read$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int (* _Nullable _read)(void *, char *, int) + * } + */ + public static void _read(MemorySegment struct, MemorySegment fieldValue) { + struct.set(_read$LAYOUT, _read$OFFSET, fieldValue); + } + + /** + * {@snippet lang=c : + * fpos_t (* _Nullable _seek)(void *, fpos_t, int) + * } + */ + public static class _seek { + + _seek() { + // Should not be called directly + } + + /** + * The function pointer signature, expressed as a functional interface + */ + public interface Function { + long apply(MemorySegment _x0, long _x1, int _x2); + } + + private static final FunctionDescriptor $DESC = FunctionDescriptor.of( + somelib_h.C_LONG_LONG, + somelib_h.C_POINTER, + somelib_h.C_LONG_LONG, + somelib_h.C_INT + ); + + /** + * The descriptor of this function pointer + */ + public static FunctionDescriptor descriptor() { + return $DESC; + } + + private static final MethodHandle UP$MH = somelib_h.upcallHandle(_seek.Function.class, "apply", $DESC); + + /** + * Allocates a new upcall stub, whose implementation is defined by {@code fi}. + * The lifetime of the returned segment is managed by {@code arena} + */ + public static MemorySegment allocate(_seek.Function fi, Arena arena) { + return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena); + } + + private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC); + + /** + * Invoke the upcall stub {@code funcPtr}, with given parameters + */ + public static long invoke(MemorySegment funcPtr,MemorySegment _x0, long _x1, int _x2) { + try { + return (long) DOWN$MH.invokeExact(funcPtr, _x0, _x1, _x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static final AddressLayout _seek$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("_seek")); + + /** + * Layout for field: + * {@snippet lang=c : + * fpos_t (* _Nullable _seek)(void *, fpos_t, int) + * } + */ + public static final AddressLayout _seek$layout() { + return _seek$LAYOUT; + } + + private static final long _seek$OFFSET = 72; + + /** + * Offset for field: + * {@snippet lang=c : + * fpos_t (* _Nullable _seek)(void *, fpos_t, int) + * } + */ + public static final long _seek$offset() { + return _seek$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * fpos_t (* _Nullable _seek)(void *, fpos_t, int) + * } + */ + public static MemorySegment _seek(MemorySegment struct) { + return struct.get(_seek$LAYOUT, _seek$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * fpos_t (* _Nullable _seek)(void *, fpos_t, int) + * } + */ + public static void _seek(MemorySegment struct, MemorySegment fieldValue) { + struct.set(_seek$LAYOUT, _seek$OFFSET, fieldValue); + } + + /** + * {@snippet lang=c : + * int (* _Nullable _write)(void *, const char *, int) + * } + */ + public static class _write { + + _write() { + // Should not be called directly + } + + /** + * The function pointer signature, expressed as a functional interface + */ + public interface Function { + int apply(MemorySegment _x0, MemorySegment _x1, int _x2); + } + + private static final FunctionDescriptor $DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_INT + ); + + /** + * The descriptor of this function pointer + */ + public static FunctionDescriptor descriptor() { + return $DESC; + } + + private static final MethodHandle UP$MH = somelib_h.upcallHandle(_write.Function.class, "apply", $DESC); + + /** + * Allocates a new upcall stub, whose implementation is defined by {@code fi}. + * The lifetime of the returned segment is managed by {@code arena} + */ + public static MemorySegment allocate(_write.Function fi, Arena arena) { + return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena); + } + + private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC); + + /** + * Invoke the upcall stub {@code funcPtr}, with given parameters + */ + public static int invoke(MemorySegment funcPtr,MemorySegment _x0, MemorySegment _x1, int _x2) { + try { + return (int) DOWN$MH.invokeExact(funcPtr, _x0, _x1, _x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static final AddressLayout _write$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("_write")); + + /** + * Layout for field: + * {@snippet lang=c : + * int (* _Nullable _write)(void *, const char *, int) + * } + */ + public static final AddressLayout _write$layout() { + return _write$LAYOUT; + } + + private static final long _write$OFFSET = 80; + + /** + * Offset for field: + * {@snippet lang=c : + * int (* _Nullable _write)(void *, const char *, int) + * } + */ + public static final long _write$offset() { + return _write$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int (* _Nullable _write)(void *, const char *, int) + * } + */ + public static MemorySegment _write(MemorySegment struct) { + return struct.get(_write$LAYOUT, _write$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int (* _Nullable _write)(void *, const char *, int) + * } + */ + public static void _write(MemorySegment struct, MemorySegment fieldValue) { + struct.set(_write$LAYOUT, _write$OFFSET, fieldValue); + } + + private static final GroupLayout _ub$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("_ub")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct __sbuf _ub + * } + */ + public static final GroupLayout _ub$layout() { + return _ub$LAYOUT; + } + + private static final long _ub$OFFSET = 88; + + /** + * Offset for field: + * {@snippet lang=c : + * struct __sbuf _ub + * } + */ + public static final long _ub$offset() { + return _ub$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct __sbuf _ub + * } + */ + public static MemorySegment _ub(MemorySegment struct) { + return struct.asSlice(_ub$OFFSET, _ub$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct __sbuf _ub + * } + */ + public static void _ub(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, _ub$OFFSET, _ub$LAYOUT.byteSize()); + } + + private static final AddressLayout _extra$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("_extra")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct __sFILEX *_extra + * } + */ + public static final AddressLayout _extra$layout() { + return _extra$LAYOUT; + } + + private static final long _extra$OFFSET = 104; + + /** + * Offset for field: + * {@snippet lang=c : + * struct __sFILEX *_extra + * } + */ + public static final long _extra$offset() { + return _extra$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct __sFILEX *_extra + * } + */ + public static MemorySegment _extra(MemorySegment struct) { + return struct.get(_extra$LAYOUT, _extra$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct __sFILEX *_extra + * } + */ + public static void _extra(MemorySegment struct, MemorySegment fieldValue) { + struct.set(_extra$LAYOUT, _extra$OFFSET, fieldValue); + } + + private static final OfInt _ur$LAYOUT = (OfInt)$LAYOUT.select(groupElement("_ur")); + + /** + * Layout for field: + * {@snippet lang=c : + * int _ur + * } + */ + public static final OfInt _ur$layout() { + return _ur$LAYOUT; + } + + private static final long _ur$OFFSET = 112; + + /** + * Offset for field: + * {@snippet lang=c : + * int _ur + * } + */ + public static final long _ur$offset() { + return _ur$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int _ur + * } + */ + public static int _ur(MemorySegment struct) { + return struct.get(_ur$LAYOUT, _ur$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int _ur + * } + */ + public static void _ur(MemorySegment struct, int fieldValue) { + struct.set(_ur$LAYOUT, _ur$OFFSET, fieldValue); + } + + private static final SequenceLayout _ubuf$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("_ubuf")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned char _ubuf[3] + * } + */ + public static final SequenceLayout _ubuf$layout() { + return _ubuf$LAYOUT; + } + + private static final long _ubuf$OFFSET = 116; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned char _ubuf[3] + * } + */ + public static final long _ubuf$offset() { + return _ubuf$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned char _ubuf[3] + * } + */ + public static MemorySegment _ubuf(MemorySegment struct) { + return struct.asSlice(_ubuf$OFFSET, _ubuf$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned char _ubuf[3] + * } + */ + public static void _ubuf(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, _ubuf$OFFSET, _ubuf$LAYOUT.byteSize()); + } + + private static long[] _ubuf$DIMS = { 3 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * unsigned char _ubuf[3] + * } + */ + public static long[] _ubuf$dimensions() { + return _ubuf$DIMS; + } + private static final VarHandle _ubuf$ELEM_HANDLE = _ubuf$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * unsigned char _ubuf[3] + * } + */ + public static byte _ubuf(MemorySegment struct, long index0) { + return (byte)_ubuf$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * unsigned char _ubuf[3] + * } + */ + public static void _ubuf(MemorySegment struct, long index0, byte fieldValue) { + _ubuf$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + private static final SequenceLayout _nbuf$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("_nbuf")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned char _nbuf[1] + * } + */ + public static final SequenceLayout _nbuf$layout() { + return _nbuf$LAYOUT; + } + + private static final long _nbuf$OFFSET = 119; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned char _nbuf[1] + * } + */ + public static final long _nbuf$offset() { + return _nbuf$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned char _nbuf[1] + * } + */ + public static MemorySegment _nbuf(MemorySegment struct) { + return struct.asSlice(_nbuf$OFFSET, _nbuf$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned char _nbuf[1] + * } + */ + public static void _nbuf(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, _nbuf$OFFSET, _nbuf$LAYOUT.byteSize()); + } + + private static long[] _nbuf$DIMS = { 1 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * unsigned char _nbuf[1] + * } + */ + public static long[] _nbuf$dimensions() { + return _nbuf$DIMS; + } + private static final VarHandle _nbuf$ELEM_HANDLE = _nbuf$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * unsigned char _nbuf[1] + * } + */ + public static byte _nbuf(MemorySegment struct, long index0) { + return (byte)_nbuf$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * unsigned char _nbuf[1] + * } + */ + public static void _nbuf(MemorySegment struct, long index0, byte fieldValue) { + _nbuf$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + private static final GroupLayout _lb$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("_lb")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct __sbuf _lb + * } + */ + public static final GroupLayout _lb$layout() { + return _lb$LAYOUT; + } + + private static final long _lb$OFFSET = 120; + + /** + * Offset for field: + * {@snippet lang=c : + * struct __sbuf _lb + * } + */ + public static final long _lb$offset() { + return _lb$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct __sbuf _lb + * } + */ + public static MemorySegment _lb(MemorySegment struct) { + return struct.asSlice(_lb$OFFSET, _lb$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct __sbuf _lb + * } + */ + public static void _lb(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, _lb$OFFSET, _lb$LAYOUT.byteSize()); + } + + private static final OfInt _blksize$LAYOUT = (OfInt)$LAYOUT.select(groupElement("_blksize")); + + /** + * Layout for field: + * {@snippet lang=c : + * int _blksize + * } + */ + public static final OfInt _blksize$layout() { + return _blksize$LAYOUT; + } + + private static final long _blksize$OFFSET = 136; + + /** + * Offset for field: + * {@snippet lang=c : + * int _blksize + * } + */ + public static final long _blksize$offset() { + return _blksize$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int _blksize + * } + */ + public static int _blksize(MemorySegment struct) { + return struct.get(_blksize$LAYOUT, _blksize$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int _blksize + * } + */ + public static void _blksize(MemorySegment struct, int fieldValue) { + struct.set(_blksize$LAYOUT, _blksize$OFFSET, fieldValue); + } + + private static final OfLong _offset$LAYOUT = (OfLong)$LAYOUT.select(groupElement("_offset")); + + /** + * Layout for field: + * {@snippet lang=c : + * fpos_t _offset + * } + */ + public static final OfLong _offset$layout() { + return _offset$LAYOUT; + } + + private static final long _offset$OFFSET = 144; + + /** + * Offset for field: + * {@snippet lang=c : + * fpos_t _offset + * } + */ + public static final long _offset$offset() { + return _offset$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * fpos_t _offset + * } + */ + public static long _offset(MemorySegment struct) { + return struct.get(_offset$LAYOUT, _offset$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * fpos_t _offset + * } + */ + public static void _offset(MemorySegment struct, long fieldValue) { + struct.set(_offset$LAYOUT, _offset$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__sbuf.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__sbuf.java new file mode 100644 index 000000000..c4fd8a3c7 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/__sbuf.java @@ -0,0 +1,174 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct __sbuf { + * unsigned char *_base; + * int _size; + * } + * } + */ +public class __sbuf { + + __sbuf() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("_base"), + somelib_h.C_INT.withName("_size"), + MemoryLayout.paddingLayout(4) + ).withName("__sbuf"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout _base$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("_base")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned char *_base + * } + */ + public static final AddressLayout _base$layout() { + return _base$LAYOUT; + } + + private static final long _base$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned char *_base + * } + */ + public static final long _base$offset() { + return _base$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned char *_base + * } + */ + public static MemorySegment _base(MemorySegment struct) { + return struct.get(_base$LAYOUT, _base$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned char *_base + * } + */ + public static void _base(MemorySegment struct, MemorySegment fieldValue) { + struct.set(_base$LAYOUT, _base$OFFSET, fieldValue); + } + + private static final OfInt _size$LAYOUT = (OfInt)$LAYOUT.select(groupElement("_size")); + + /** + * Layout for field: + * {@snippet lang=c : + * int _size + * } + */ + public static final OfInt _size$layout() { + return _size$LAYOUT; + } + + private static final long _size$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * int _size + * } + */ + public static final long _size$offset() { + return _size$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int _size + * } + */ + public static int _size(MemorySegment struct) { + return struct.get(_size$LAYOUT, _size$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int _size + * } + */ + public static void _size(MemorySegment struct, int fieldValue) { + struct.set(_size$LAYOUT, _size$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_attr_t.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_attr_t.java new file mode 100644 index 000000000..1da474a48 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_attr_t.java @@ -0,0 +1,206 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct _opaque_pthread_attr_t { + * long __sig; + * char __opaque[56]; + * } + * } + */ +public class _opaque_pthread_attr_t { + + _opaque_pthread_attr_t() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_LONG.withName("__sig"), + MemoryLayout.sequenceLayout(56, somelib_h.C_CHAR).withName("__opaque") + ).withName("_opaque_pthread_attr_t"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong __sig$LAYOUT = (OfLong)$LAYOUT.select(groupElement("__sig")); + + /** + * Layout for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static final OfLong __sig$layout() { + return __sig$LAYOUT; + } + + private static final long __sig$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static final long __sig$offset() { + return __sig$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static long __sig(MemorySegment struct) { + return struct.get(__sig$LAYOUT, __sig$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static void __sig(MemorySegment struct, long fieldValue) { + struct.set(__sig$LAYOUT, __sig$OFFSET, fieldValue); + } + + private static final SequenceLayout __opaque$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("__opaque")); + + /** + * Layout for field: + * {@snippet lang=c : + * char __opaque[56] + * } + */ + public static final SequenceLayout __opaque$layout() { + return __opaque$LAYOUT; + } + + private static final long __opaque$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * char __opaque[56] + * } + */ + public static final long __opaque$offset() { + return __opaque$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * char __opaque[56] + * } + */ + public static MemorySegment __opaque(MemorySegment struct) { + return struct.asSlice(__opaque$OFFSET, __opaque$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * char __opaque[56] + * } + */ + public static void __opaque(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, __opaque$OFFSET, __opaque$LAYOUT.byteSize()); + } + + private static long[] __opaque$DIMS = { 56 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * char __opaque[56] + * } + */ + public static long[] __opaque$dimensions() { + return __opaque$DIMS; + } + private static final VarHandle __opaque$ELEM_HANDLE = __opaque$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * char __opaque[56] + * } + */ + public static byte __opaque(MemorySegment struct, long index0) { + return (byte)__opaque$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * char __opaque[56] + * } + */ + public static void __opaque(MemorySegment struct, long index0, byte fieldValue) { + __opaque$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_cond_t.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_cond_t.java new file mode 100644 index 000000000..d558a7c41 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_cond_t.java @@ -0,0 +1,206 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct _opaque_pthread_cond_t { + * long __sig; + * char __opaque[40]; + * } + * } + */ +public class _opaque_pthread_cond_t { + + _opaque_pthread_cond_t() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_LONG.withName("__sig"), + MemoryLayout.sequenceLayout(40, somelib_h.C_CHAR).withName("__opaque") + ).withName("_opaque_pthread_cond_t"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong __sig$LAYOUT = (OfLong)$LAYOUT.select(groupElement("__sig")); + + /** + * Layout for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static final OfLong __sig$layout() { + return __sig$LAYOUT; + } + + private static final long __sig$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static final long __sig$offset() { + return __sig$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static long __sig(MemorySegment struct) { + return struct.get(__sig$LAYOUT, __sig$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static void __sig(MemorySegment struct, long fieldValue) { + struct.set(__sig$LAYOUT, __sig$OFFSET, fieldValue); + } + + private static final SequenceLayout __opaque$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("__opaque")); + + /** + * Layout for field: + * {@snippet lang=c : + * char __opaque[40] + * } + */ + public static final SequenceLayout __opaque$layout() { + return __opaque$LAYOUT; + } + + private static final long __opaque$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * char __opaque[40] + * } + */ + public static final long __opaque$offset() { + return __opaque$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * char __opaque[40] + * } + */ + public static MemorySegment __opaque(MemorySegment struct) { + return struct.asSlice(__opaque$OFFSET, __opaque$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * char __opaque[40] + * } + */ + public static void __opaque(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, __opaque$OFFSET, __opaque$LAYOUT.byteSize()); + } + + private static long[] __opaque$DIMS = { 40 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * char __opaque[40] + * } + */ + public static long[] __opaque$dimensions() { + return __opaque$DIMS; + } + private static final VarHandle __opaque$ELEM_HANDLE = __opaque$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * char __opaque[40] + * } + */ + public static byte __opaque(MemorySegment struct, long index0) { + return (byte)__opaque$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * char __opaque[40] + * } + */ + public static void __opaque(MemorySegment struct, long index0, byte fieldValue) { + __opaque$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_condattr_t.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_condattr_t.java new file mode 100644 index 000000000..02538b060 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_condattr_t.java @@ -0,0 +1,206 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct _opaque_pthread_condattr_t { + * long __sig; + * char __opaque[8]; + * } + * } + */ +public class _opaque_pthread_condattr_t { + + _opaque_pthread_condattr_t() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_LONG.withName("__sig"), + MemoryLayout.sequenceLayout(8, somelib_h.C_CHAR).withName("__opaque") + ).withName("_opaque_pthread_condattr_t"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong __sig$LAYOUT = (OfLong)$LAYOUT.select(groupElement("__sig")); + + /** + * Layout for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static final OfLong __sig$layout() { + return __sig$LAYOUT; + } + + private static final long __sig$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static final long __sig$offset() { + return __sig$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static long __sig(MemorySegment struct) { + return struct.get(__sig$LAYOUT, __sig$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static void __sig(MemorySegment struct, long fieldValue) { + struct.set(__sig$LAYOUT, __sig$OFFSET, fieldValue); + } + + private static final SequenceLayout __opaque$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("__opaque")); + + /** + * Layout for field: + * {@snippet lang=c : + * char __opaque[8] + * } + */ + public static final SequenceLayout __opaque$layout() { + return __opaque$LAYOUT; + } + + private static final long __opaque$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * char __opaque[8] + * } + */ + public static final long __opaque$offset() { + return __opaque$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * char __opaque[8] + * } + */ + public static MemorySegment __opaque(MemorySegment struct) { + return struct.asSlice(__opaque$OFFSET, __opaque$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * char __opaque[8] + * } + */ + public static void __opaque(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, __opaque$OFFSET, __opaque$LAYOUT.byteSize()); + } + + private static long[] __opaque$DIMS = { 8 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * char __opaque[8] + * } + */ + public static long[] __opaque$dimensions() { + return __opaque$DIMS; + } + private static final VarHandle __opaque$ELEM_HANDLE = __opaque$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * char __opaque[8] + * } + */ + public static byte __opaque(MemorySegment struct, long index0) { + return (byte)__opaque$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * char __opaque[8] + * } + */ + public static void __opaque(MemorySegment struct, long index0, byte fieldValue) { + __opaque$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_mutex_t.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_mutex_t.java new file mode 100644 index 000000000..6d772cce2 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_mutex_t.java @@ -0,0 +1,206 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct _opaque_pthread_mutex_t { + * long __sig; + * char __opaque[56]; + * } + * } + */ +public class _opaque_pthread_mutex_t { + + _opaque_pthread_mutex_t() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_LONG.withName("__sig"), + MemoryLayout.sequenceLayout(56, somelib_h.C_CHAR).withName("__opaque") + ).withName("_opaque_pthread_mutex_t"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong __sig$LAYOUT = (OfLong)$LAYOUT.select(groupElement("__sig")); + + /** + * Layout for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static final OfLong __sig$layout() { + return __sig$LAYOUT; + } + + private static final long __sig$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static final long __sig$offset() { + return __sig$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static long __sig(MemorySegment struct) { + return struct.get(__sig$LAYOUT, __sig$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static void __sig(MemorySegment struct, long fieldValue) { + struct.set(__sig$LAYOUT, __sig$OFFSET, fieldValue); + } + + private static final SequenceLayout __opaque$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("__opaque")); + + /** + * Layout for field: + * {@snippet lang=c : + * char __opaque[56] + * } + */ + public static final SequenceLayout __opaque$layout() { + return __opaque$LAYOUT; + } + + private static final long __opaque$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * char __opaque[56] + * } + */ + public static final long __opaque$offset() { + return __opaque$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * char __opaque[56] + * } + */ + public static MemorySegment __opaque(MemorySegment struct) { + return struct.asSlice(__opaque$OFFSET, __opaque$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * char __opaque[56] + * } + */ + public static void __opaque(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, __opaque$OFFSET, __opaque$LAYOUT.byteSize()); + } + + private static long[] __opaque$DIMS = { 56 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * char __opaque[56] + * } + */ + public static long[] __opaque$dimensions() { + return __opaque$DIMS; + } + private static final VarHandle __opaque$ELEM_HANDLE = __opaque$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * char __opaque[56] + * } + */ + public static byte __opaque(MemorySegment struct, long index0) { + return (byte)__opaque$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * char __opaque[56] + * } + */ + public static void __opaque(MemorySegment struct, long index0, byte fieldValue) { + __opaque$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_mutexattr_t.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_mutexattr_t.java new file mode 100644 index 000000000..5910bf334 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_mutexattr_t.java @@ -0,0 +1,206 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct _opaque_pthread_mutexattr_t { + * long __sig; + * char __opaque[8]; + * } + * } + */ +public class _opaque_pthread_mutexattr_t { + + _opaque_pthread_mutexattr_t() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_LONG.withName("__sig"), + MemoryLayout.sequenceLayout(8, somelib_h.C_CHAR).withName("__opaque") + ).withName("_opaque_pthread_mutexattr_t"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong __sig$LAYOUT = (OfLong)$LAYOUT.select(groupElement("__sig")); + + /** + * Layout for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static final OfLong __sig$layout() { + return __sig$LAYOUT; + } + + private static final long __sig$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static final long __sig$offset() { + return __sig$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static long __sig(MemorySegment struct) { + return struct.get(__sig$LAYOUT, __sig$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static void __sig(MemorySegment struct, long fieldValue) { + struct.set(__sig$LAYOUT, __sig$OFFSET, fieldValue); + } + + private static final SequenceLayout __opaque$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("__opaque")); + + /** + * Layout for field: + * {@snippet lang=c : + * char __opaque[8] + * } + */ + public static final SequenceLayout __opaque$layout() { + return __opaque$LAYOUT; + } + + private static final long __opaque$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * char __opaque[8] + * } + */ + public static final long __opaque$offset() { + return __opaque$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * char __opaque[8] + * } + */ + public static MemorySegment __opaque(MemorySegment struct) { + return struct.asSlice(__opaque$OFFSET, __opaque$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * char __opaque[8] + * } + */ + public static void __opaque(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, __opaque$OFFSET, __opaque$LAYOUT.byteSize()); + } + + private static long[] __opaque$DIMS = { 8 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * char __opaque[8] + * } + */ + public static long[] __opaque$dimensions() { + return __opaque$DIMS; + } + private static final VarHandle __opaque$ELEM_HANDLE = __opaque$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * char __opaque[8] + * } + */ + public static byte __opaque(MemorySegment struct, long index0) { + return (byte)__opaque$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * char __opaque[8] + * } + */ + public static void __opaque(MemorySegment struct, long index0, byte fieldValue) { + __opaque$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_once_t.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_once_t.java new file mode 100644 index 000000000..b64f81dd4 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_once_t.java @@ -0,0 +1,206 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct _opaque_pthread_once_t { + * long __sig; + * char __opaque[8]; + * } + * } + */ +public class _opaque_pthread_once_t { + + _opaque_pthread_once_t() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_LONG.withName("__sig"), + MemoryLayout.sequenceLayout(8, somelib_h.C_CHAR).withName("__opaque") + ).withName("_opaque_pthread_once_t"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong __sig$LAYOUT = (OfLong)$LAYOUT.select(groupElement("__sig")); + + /** + * Layout for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static final OfLong __sig$layout() { + return __sig$LAYOUT; + } + + private static final long __sig$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static final long __sig$offset() { + return __sig$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static long __sig(MemorySegment struct) { + return struct.get(__sig$LAYOUT, __sig$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static void __sig(MemorySegment struct, long fieldValue) { + struct.set(__sig$LAYOUT, __sig$OFFSET, fieldValue); + } + + private static final SequenceLayout __opaque$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("__opaque")); + + /** + * Layout for field: + * {@snippet lang=c : + * char __opaque[8] + * } + */ + public static final SequenceLayout __opaque$layout() { + return __opaque$LAYOUT; + } + + private static final long __opaque$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * char __opaque[8] + * } + */ + public static final long __opaque$offset() { + return __opaque$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * char __opaque[8] + * } + */ + public static MemorySegment __opaque(MemorySegment struct) { + return struct.asSlice(__opaque$OFFSET, __opaque$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * char __opaque[8] + * } + */ + public static void __opaque(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, __opaque$OFFSET, __opaque$LAYOUT.byteSize()); + } + + private static long[] __opaque$DIMS = { 8 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * char __opaque[8] + * } + */ + public static long[] __opaque$dimensions() { + return __opaque$DIMS; + } + private static final VarHandle __opaque$ELEM_HANDLE = __opaque$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * char __opaque[8] + * } + */ + public static byte __opaque(MemorySegment struct, long index0) { + return (byte)__opaque$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * char __opaque[8] + * } + */ + public static void __opaque(MemorySegment struct, long index0, byte fieldValue) { + __opaque$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_rwlock_t.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_rwlock_t.java new file mode 100644 index 000000000..8341224b0 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_rwlock_t.java @@ -0,0 +1,206 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct _opaque_pthread_rwlock_t { + * long __sig; + * char __opaque[192]; + * } + * } + */ +public class _opaque_pthread_rwlock_t { + + _opaque_pthread_rwlock_t() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_LONG.withName("__sig"), + MemoryLayout.sequenceLayout(192, somelib_h.C_CHAR).withName("__opaque") + ).withName("_opaque_pthread_rwlock_t"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong __sig$LAYOUT = (OfLong)$LAYOUT.select(groupElement("__sig")); + + /** + * Layout for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static final OfLong __sig$layout() { + return __sig$LAYOUT; + } + + private static final long __sig$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static final long __sig$offset() { + return __sig$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static long __sig(MemorySegment struct) { + return struct.get(__sig$LAYOUT, __sig$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static void __sig(MemorySegment struct, long fieldValue) { + struct.set(__sig$LAYOUT, __sig$OFFSET, fieldValue); + } + + private static final SequenceLayout __opaque$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("__opaque")); + + /** + * Layout for field: + * {@snippet lang=c : + * char __opaque[192] + * } + */ + public static final SequenceLayout __opaque$layout() { + return __opaque$LAYOUT; + } + + private static final long __opaque$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * char __opaque[192] + * } + */ + public static final long __opaque$offset() { + return __opaque$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * char __opaque[192] + * } + */ + public static MemorySegment __opaque(MemorySegment struct) { + return struct.asSlice(__opaque$OFFSET, __opaque$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * char __opaque[192] + * } + */ + public static void __opaque(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, __opaque$OFFSET, __opaque$LAYOUT.byteSize()); + } + + private static long[] __opaque$DIMS = { 192 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * char __opaque[192] + * } + */ + public static long[] __opaque$dimensions() { + return __opaque$DIMS; + } + private static final VarHandle __opaque$ELEM_HANDLE = __opaque$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * char __opaque[192] + * } + */ + public static byte __opaque(MemorySegment struct, long index0) { + return (byte)__opaque$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * char __opaque[192] + * } + */ + public static void __opaque(MemorySegment struct, long index0, byte fieldValue) { + __opaque$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_rwlockattr_t.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_rwlockattr_t.java new file mode 100644 index 000000000..ef84d9724 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_rwlockattr_t.java @@ -0,0 +1,206 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct _opaque_pthread_rwlockattr_t { + * long __sig; + * char __opaque[16]; + * } + * } + */ +public class _opaque_pthread_rwlockattr_t { + + _opaque_pthread_rwlockattr_t() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_LONG.withName("__sig"), + MemoryLayout.sequenceLayout(16, somelib_h.C_CHAR).withName("__opaque") + ).withName("_opaque_pthread_rwlockattr_t"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong __sig$LAYOUT = (OfLong)$LAYOUT.select(groupElement("__sig")); + + /** + * Layout for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static final OfLong __sig$layout() { + return __sig$LAYOUT; + } + + private static final long __sig$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static final long __sig$offset() { + return __sig$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static long __sig(MemorySegment struct) { + return struct.get(__sig$LAYOUT, __sig$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static void __sig(MemorySegment struct, long fieldValue) { + struct.set(__sig$LAYOUT, __sig$OFFSET, fieldValue); + } + + private static final SequenceLayout __opaque$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("__opaque")); + + /** + * Layout for field: + * {@snippet lang=c : + * char __opaque[16] + * } + */ + public static final SequenceLayout __opaque$layout() { + return __opaque$LAYOUT; + } + + private static final long __opaque$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * char __opaque[16] + * } + */ + public static final long __opaque$offset() { + return __opaque$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * char __opaque[16] + * } + */ + public static MemorySegment __opaque(MemorySegment struct) { + return struct.asSlice(__opaque$OFFSET, __opaque$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * char __opaque[16] + * } + */ + public static void __opaque(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, __opaque$OFFSET, __opaque$LAYOUT.byteSize()); + } + + private static long[] __opaque$DIMS = { 16 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * char __opaque[16] + * } + */ + public static long[] __opaque$dimensions() { + return __opaque$DIMS; + } + private static final VarHandle __opaque$ELEM_HANDLE = __opaque$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * char __opaque[16] + * } + */ + public static byte __opaque(MemorySegment struct, long index0) { + return (byte)__opaque$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * char __opaque[16] + * } + */ + public static void __opaque(MemorySegment struct, long index0, byte fieldValue) { + __opaque$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_t.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_t.java new file mode 100644 index 000000000..1fe6ceda3 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_t.java @@ -0,0 +1,252 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct _opaque_pthread_t { + * long __sig; + * struct __darwin_pthread_handler_rec *__cleanup_stack; + * char __opaque[8176]; + * } + * } + */ +public class _opaque_pthread_t { + + _opaque_pthread_t() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_LONG.withName("__sig"), + somelib_h.C_POINTER.withName("__cleanup_stack"), + MemoryLayout.sequenceLayout(8176, somelib_h.C_CHAR).withName("__opaque") + ).withName("_opaque_pthread_t"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong __sig$LAYOUT = (OfLong)$LAYOUT.select(groupElement("__sig")); + + /** + * Layout for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static final OfLong __sig$layout() { + return __sig$LAYOUT; + } + + private static final long __sig$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static final long __sig$offset() { + return __sig$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static long __sig(MemorySegment struct) { + return struct.get(__sig$LAYOUT, __sig$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static void __sig(MemorySegment struct, long fieldValue) { + struct.set(__sig$LAYOUT, __sig$OFFSET, fieldValue); + } + + private static final AddressLayout __cleanup_stack$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("__cleanup_stack")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct __darwin_pthread_handler_rec *__cleanup_stack + * } + */ + public static final AddressLayout __cleanup_stack$layout() { + return __cleanup_stack$LAYOUT; + } + + private static final long __cleanup_stack$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * struct __darwin_pthread_handler_rec *__cleanup_stack + * } + */ + public static final long __cleanup_stack$offset() { + return __cleanup_stack$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct __darwin_pthread_handler_rec *__cleanup_stack + * } + */ + public static MemorySegment __cleanup_stack(MemorySegment struct) { + return struct.get(__cleanup_stack$LAYOUT, __cleanup_stack$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct __darwin_pthread_handler_rec *__cleanup_stack + * } + */ + public static void __cleanup_stack(MemorySegment struct, MemorySegment fieldValue) { + struct.set(__cleanup_stack$LAYOUT, __cleanup_stack$OFFSET, fieldValue); + } + + private static final SequenceLayout __opaque$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("__opaque")); + + /** + * Layout for field: + * {@snippet lang=c : + * char __opaque[8176] + * } + */ + public static final SequenceLayout __opaque$layout() { + return __opaque$LAYOUT; + } + + private static final long __opaque$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * char __opaque[8176] + * } + */ + public static final long __opaque$offset() { + return __opaque$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * char __opaque[8176] + * } + */ + public static MemorySegment __opaque(MemorySegment struct) { + return struct.asSlice(__opaque$OFFSET, __opaque$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * char __opaque[8176] + * } + */ + public static void __opaque(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, __opaque$OFFSET, __opaque$LAYOUT.byteSize()); + } + + private static long[] __opaque$DIMS = { 8176 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * char __opaque[8176] + * } + */ + public static long[] __opaque$dimensions() { + return __opaque$DIMS; + } + private static final VarHandle __opaque$ELEM_HANDLE = __opaque$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * char __opaque[8176] + * } + */ + public static byte __opaque(MemorySegment struct, long index0) { + return (byte)__opaque$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * char __opaque[8176] + * } + */ + public static void __opaque(MemorySegment struct, long index0, byte fieldValue) { + __opaque$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/fd_set.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/fd_set.java new file mode 100644 index 000000000..618dad751 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/fd_set.java @@ -0,0 +1,160 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct fd_set { + * __int32_t fds_bits[32]; + * } + * } + */ +public class fd_set { + + fd_set() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.sequenceLayout(32, somelib_h.C_INT).withName("fds_bits") + ).withName("fd_set"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final SequenceLayout fds_bits$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("fds_bits")); + + /** + * Layout for field: + * {@snippet lang=c : + * __int32_t fds_bits[32] + * } + */ + public static final SequenceLayout fds_bits$layout() { + return fds_bits$LAYOUT; + } + + private static final long fds_bits$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * __int32_t fds_bits[32] + * } + */ + public static final long fds_bits$offset() { + return fds_bits$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * __int32_t fds_bits[32] + * } + */ + public static MemorySegment fds_bits(MemorySegment struct) { + return struct.asSlice(fds_bits$OFFSET, fds_bits$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * __int32_t fds_bits[32] + * } + */ + public static void fds_bits(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, fds_bits$OFFSET, fds_bits$LAYOUT.byteSize()); + } + + private static long[] fds_bits$DIMS = { 32 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * __int32_t fds_bits[32] + * } + */ + public static long[] fds_bits$dimensions() { + return fds_bits$DIMS; + } + private static final VarHandle fds_bits$ELEM_HANDLE = fds_bits$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * __int32_t fds_bits[32] + * } + */ + public static int fds_bits(MemorySegment struct, long index0) { + return (int)fds_bits$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * __int32_t fds_bits[32] + * } + */ + public static void fds_bits(MemorySegment struct, long index0, int fieldValue) { + fds_bits$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/funopen$x0.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/funopen$x0.java new file mode 100644 index 000000000..1afd8820d --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/funopen$x0.java @@ -0,0 +1,70 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * int (* _Nullable)(void *, char *, int) + * } + */ +public class funopen$x0 { + + funopen$x0() { + // Should not be called directly + } + + /** + * The function pointer signature, expressed as a functional interface + */ + public interface Function { + int apply(MemorySegment _x0, MemorySegment _x1, int _x2); + } + + private static final FunctionDescriptor $DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_INT + ); + + /** + * The descriptor of this function pointer + */ + public static FunctionDescriptor descriptor() { + return $DESC; + } + + private static final MethodHandle UP$MH = somelib_h.upcallHandle(funopen$x0.Function.class, "apply", $DESC); + + /** + * Allocates a new upcall stub, whose implementation is defined by {@code fi}. + * The lifetime of the returned segment is managed by {@code arena} + */ + public static MemorySegment allocate(funopen$x0.Function fi, Arena arena) { + return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena); + } + + private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC); + + /** + * Invoke the upcall stub {@code funcPtr}, with given parameters + */ + public static int invoke(MemorySegment funcPtr,MemorySegment _x0, MemorySegment _x1, int _x2) { + try { + return (int) DOWN$MH.invokeExact(funcPtr, _x0, _x1, _x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/funopen$x1.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/funopen$x1.java new file mode 100644 index 000000000..3dca88784 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/funopen$x1.java @@ -0,0 +1,70 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * int (* _Nullable)(void *, const char *, int) + * } + */ +public class funopen$x1 { + + funopen$x1() { + // Should not be called directly + } + + /** + * The function pointer signature, expressed as a functional interface + */ + public interface Function { + int apply(MemorySegment _x0, MemorySegment _x1, int _x2); + } + + private static final FunctionDescriptor $DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_INT + ); + + /** + * The descriptor of this function pointer + */ + public static FunctionDescriptor descriptor() { + return $DESC; + } + + private static final MethodHandle UP$MH = somelib_h.upcallHandle(funopen$x1.Function.class, "apply", $DESC); + + /** + * Allocates a new upcall stub, whose implementation is defined by {@code fi}. + * The lifetime of the returned segment is managed by {@code arena} + */ + public static MemorySegment allocate(funopen$x1.Function fi, Arena arena) { + return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena); + } + + private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC); + + /** + * Invoke the upcall stub {@code funcPtr}, with given parameters + */ + public static int invoke(MemorySegment funcPtr,MemorySegment _x0, MemorySegment _x1, int _x2) { + try { + return (int) DOWN$MH.invokeExact(funcPtr, _x0, _x1, _x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/funopen$x2.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/funopen$x2.java new file mode 100644 index 000000000..0fe263b6a --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/funopen$x2.java @@ -0,0 +1,70 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * fpos_t (* _Nullable)(void *, fpos_t, int) + * } + */ +public class funopen$x2 { + + funopen$x2() { + // Should not be called directly + } + + /** + * The function pointer signature, expressed as a functional interface + */ + public interface Function { + long apply(MemorySegment _x0, long _x1, int _x2); + } + + private static final FunctionDescriptor $DESC = FunctionDescriptor.of( + somelib_h.C_LONG_LONG, + somelib_h.C_POINTER, + somelib_h.C_LONG_LONG, + somelib_h.C_INT + ); + + /** + * The descriptor of this function pointer + */ + public static FunctionDescriptor descriptor() { + return $DESC; + } + + private static final MethodHandle UP$MH = somelib_h.upcallHandle(funopen$x2.Function.class, "apply", $DESC); + + /** + * Allocates a new upcall stub, whose implementation is defined by {@code fi}. + * The lifetime of the returned segment is managed by {@code arena} + */ + public static MemorySegment allocate(funopen$x2.Function fi, Arena arena) { + return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena); + } + + private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC); + + /** + * Invoke the upcall stub {@code funcPtr}, with given parameters + */ + public static long invoke(MemorySegment funcPtr,MemorySegment _x0, long _x1, int _x2) { + try { + return (long) DOWN$MH.invokeExact(funcPtr, _x0, _x1, _x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/funopen$x3.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/funopen$x3.java new file mode 100644 index 000000000..dd516ce4c --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/funopen$x3.java @@ -0,0 +1,68 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * int (* _Nullable)(void *) + * } + */ +public class funopen$x3 { + + funopen$x3() { + // Should not be called directly + } + + /** + * The function pointer signature, expressed as a functional interface + */ + public interface Function { + int apply(MemorySegment _x0); + } + + private static final FunctionDescriptor $DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + /** + * The descriptor of this function pointer + */ + public static FunctionDescriptor descriptor() { + return $DESC; + } + + private static final MethodHandle UP$MH = somelib_h.upcallHandle(funopen$x3.Function.class, "apply", $DESC); + + /** + * Allocates a new upcall stub, whose implementation is defined by {@code fi}. + * The lifetime of the returned segment is managed by {@code arena} + */ + public static MemorySegment allocate(funopen$x3.Function fi, Arena arena) { + return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena); + } + + private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC); + + /** + * Invoke the upcall stub {@code funcPtr}, with given parameters + */ + public static int invoke(MemorySegment funcPtr,MemorySegment _x0) { + try { + return (int) DOWN$MH.invokeExact(funcPtr, _x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/namespace_MyIndexer_get_result.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/namespace_MyIndexer_get_result.java new file mode 100644 index 000000000..aa203db64 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/namespace_MyIndexer_get_result.java @@ -0,0 +1,178 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct namespace_MyIndexer_get_result { + * union { + * DiplomatStringView ok; + * }; + * bool is_ok; + * } + * } + */ +public class namespace_MyIndexer_get_result { + + namespace_MyIndexer_get_result() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.unionLayout( + DiplomatStringView.layout().withName("ok") + ).withName("$anon$18:40"), + somelib_h.C_BOOL.withName("is_ok"), + MemoryLayout.paddingLayout(7) + ).withName("namespace_MyIndexer_get_result"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final GroupLayout ok$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$18:40"), groupElement("ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * DiplomatStringView ok + * } + */ + public static final GroupLayout ok$layout() { + return ok$LAYOUT; + } + + private static final long ok$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * DiplomatStringView ok + * } + */ + public static final long ok$offset() { + return ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * DiplomatStringView ok + * } + */ + public static MemorySegment ok(MemorySegment struct) { + return struct.asSlice(ok$OFFSET, ok$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * DiplomatStringView ok + * } + */ + public static void ok(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, ok$OFFSET, ok$LAYOUT.byteSize()); + } + + private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final OfBoolean is_ok$layout() { + return is_ok$LAYOUT; + } + + private static final long is_ok$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final long is_ok$offset() { + return is_ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static boolean is_ok(MemorySegment struct) { + return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static void is_ok(MemorySegment struct, boolean fieldValue) { + struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/namespace_MyIterator_next_result.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/namespace_MyIterator_next_result.java new file mode 100644 index 000000000..8ebc5584c --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/namespace_MyIterator_next_result.java @@ -0,0 +1,177 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct namespace_MyIterator_next_result { + * union { + * uint8_t ok; + * }; + * bool is_ok; + * } + * } + */ +public class namespace_MyIterator_next_result { + + namespace_MyIterator_next_result() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.unionLayout( + somelib_h.C_CHAR.withName("ok") + ).withName("$anon$18:42"), + somelib_h.C_BOOL.withName("is_ok") + ).withName("namespace_MyIterator_next_result"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfByte ok$LAYOUT = (OfByte)$LAYOUT.select(groupElement("$anon$18:42"), groupElement("ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * uint8_t ok + * } + */ + public static final OfByte ok$layout() { + return ok$LAYOUT; + } + + private static final long ok$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * uint8_t ok + * } + */ + public static final long ok$offset() { + return ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * uint8_t ok + * } + */ + public static byte ok(MemorySegment struct) { + return struct.get(ok$LAYOUT, ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * uint8_t ok + * } + */ + public static void ok(MemorySegment struct, byte fieldValue) { + struct.set(ok$LAYOUT, ok$OFFSET, fieldValue); + } + + private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final OfBoolean is_ok$layout() { + return is_ok$LAYOUT; + } + + private static final long is_ok$OFFSET = 1; + + /** + * Offset for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final long is_ok$offset() { + return is_ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static boolean is_ok(MemorySegment struct) { + return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static void is_ok(MemorySegment struct, boolean fieldValue) { + struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_attr_t.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_attr_t.java new file mode 100644 index 000000000..e4bfe4bbf --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_attr_t.java @@ -0,0 +1,26 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef __darwin_pthread_attr_t pthread_attr_t + * } + */ +public class pthread_attr_t extends _opaque_pthread_attr_t { + + pthread_attr_t() { + // Should not be called directly + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_cond_t.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_cond_t.java new file mode 100644 index 000000000..ad8ee80cb --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_cond_t.java @@ -0,0 +1,26 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef __darwin_pthread_cond_t pthread_cond_t + * } + */ +public class pthread_cond_t extends _opaque_pthread_cond_t { + + pthread_cond_t() { + // Should not be called directly + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_condattr_t.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_condattr_t.java new file mode 100644 index 000000000..b3b04c732 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_condattr_t.java @@ -0,0 +1,26 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef __darwin_pthread_condattr_t pthread_condattr_t + * } + */ +public class pthread_condattr_t extends _opaque_pthread_condattr_t { + + pthread_condattr_t() { + // Should not be called directly + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_mutex_t.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_mutex_t.java new file mode 100644 index 000000000..41e191b4b --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_mutex_t.java @@ -0,0 +1,26 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef __darwin_pthread_mutex_t pthread_mutex_t + * } + */ +public class pthread_mutex_t extends _opaque_pthread_mutex_t { + + pthread_mutex_t() { + // Should not be called directly + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_mutexattr_t.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_mutexattr_t.java new file mode 100644 index 000000000..f7bb8b17d --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_mutexattr_t.java @@ -0,0 +1,26 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef __darwin_pthread_mutexattr_t pthread_mutexattr_t + * } + */ +public class pthread_mutexattr_t extends _opaque_pthread_mutexattr_t { + + pthread_mutexattr_t() { + // Should not be called directly + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_once_t.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_once_t.java new file mode 100644 index 000000000..cc2bf572b --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_once_t.java @@ -0,0 +1,26 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef __darwin_pthread_once_t pthread_once_t + * } + */ +public class pthread_once_t extends _opaque_pthread_once_t { + + pthread_once_t() { + // Should not be called directly + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_rwlock_t.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_rwlock_t.java new file mode 100644 index 000000000..4e774a4c2 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_rwlock_t.java @@ -0,0 +1,26 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef __darwin_pthread_rwlock_t pthread_rwlock_t + * } + */ +public class pthread_rwlock_t extends _opaque_pthread_rwlock_t { + + pthread_rwlock_t() { + // Should not be called directly + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_rwlockattr_t.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_rwlockattr_t.java new file mode 100644 index 000000000..a674c0acf --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_rwlockattr_t.java @@ -0,0 +1,26 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef __darwin_pthread_rwlockattr_t pthread_rwlockattr_t + * } + */ +public class pthread_rwlockattr_t extends _opaque_pthread_rwlockattr_t { + + pthread_rwlockattr_t() { + // Should not be called directly + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java new file mode 100644 index 000000000..024437bfe --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java @@ -0,0 +1,19182 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +public class somelib_h { + + somelib_h() { + // Should not be called directly + } + + static final Arena LIBRARY_ARENA = Arena.ofAuto(); + static final boolean TRACE_DOWNCALLS = Boolean.getBoolean("jextract.trace.downcalls"); + + static void traceDowncall(String name, Object... args) { + String traceArgs = Arrays.stream(args) + .map(Object::toString) + .collect(Collectors.joining(", ")); + System.out.printf("%s(%s)\n", name, traceArgs); + } + + static MemorySegment findOrThrow(String symbol) { + return SYMBOL_LOOKUP.find(symbol) + .orElseThrow(() -> new UnsatisfiedLinkError("unresolved symbol: " + symbol)); + } + + static MethodHandle upcallHandle(Class fi, String name, FunctionDescriptor fdesc) { + try { + return MethodHandles.lookup().findVirtual(fi, name, fdesc.toMethodType()); + } catch (ReflectiveOperationException ex) { + throw new AssertionError(ex); + } + } + + static MemoryLayout align(MemoryLayout layout, long align) { + return switch (layout) { + case PaddingLayout p -> p; + case ValueLayout v -> v.withByteAlignment(align); + case GroupLayout g -> { + MemoryLayout[] alignedMembers = g.memberLayouts().stream() + .map(m -> align(m, align)).toArray(MemoryLayout[]::new); + yield g instanceof StructLayout ? + MemoryLayout.structLayout(alignedMembers) : MemoryLayout.unionLayout(alignedMembers); + } + case SequenceLayout s -> MemoryLayout.sequenceLayout(s.elementCount(), align(s.elementLayout(), align)); + }; + } + + static final SymbolLookup SYMBOL_LOOKUP = SymbolLookup.libraryLookup(System.mapLibraryName("somelib"), LIBRARY_ARENA) + .or(SymbolLookup.loaderLookup()) + .or(Linker.nativeLinker().defaultLookup()); + + public static final ValueLayout.OfBoolean C_BOOL = ValueLayout.JAVA_BOOLEAN; + public static final ValueLayout.OfByte C_CHAR = ValueLayout.JAVA_BYTE; + public static final ValueLayout.OfShort C_SHORT = ValueLayout.JAVA_SHORT; + public static final ValueLayout.OfInt C_INT = ValueLayout.JAVA_INT; + public static final ValueLayout.OfLong C_LONG_LONG = ValueLayout.JAVA_LONG; + public static final ValueLayout.OfFloat C_FLOAT = ValueLayout.JAVA_FLOAT; + public static final ValueLayout.OfDouble C_DOUBLE = ValueLayout.JAVA_DOUBLE; + public static final AddressLayout C_POINTER = ValueLayout.ADDRESS + .withTargetLayout(MemoryLayout.sequenceLayout(java.lang.Long.MAX_VALUE, JAVA_BYTE)); + public static final ValueLayout.OfLong C_LONG = ValueLayout.JAVA_LONG; + private static final int __has_safe_buffers = (int)0L; + /** + * {@snippet lang=c : + * #define __has_safe_buffers 0 + * } + */ + public static int __has_safe_buffers() { + return __has_safe_buffers; + } + private static final int __DARWIN_ONLY_64_BIT_INO_T = (int)1L; + /** + * {@snippet lang=c : + * #define __DARWIN_ONLY_64_BIT_INO_T 1 + * } + */ + public static int __DARWIN_ONLY_64_BIT_INO_T() { + return __DARWIN_ONLY_64_BIT_INO_T; + } + private static final int __DARWIN_ONLY_UNIX_CONFORMANCE = (int)1L; + /** + * {@snippet lang=c : + * #define __DARWIN_ONLY_UNIX_CONFORMANCE 1 + * } + */ + public static int __DARWIN_ONLY_UNIX_CONFORMANCE() { + return __DARWIN_ONLY_UNIX_CONFORMANCE; + } + private static final int __DARWIN_ONLY_VERS_1050 = (int)1L; + /** + * {@snippet lang=c : + * #define __DARWIN_ONLY_VERS_1050 1 + * } + */ + public static int __DARWIN_ONLY_VERS_1050() { + return __DARWIN_ONLY_VERS_1050; + } + private static final int __DARWIN_UNIX03 = (int)1L; + /** + * {@snippet lang=c : + * #define __DARWIN_UNIX03 1 + * } + */ + public static int __DARWIN_UNIX03() { + return __DARWIN_UNIX03; + } + private static final int __DARWIN_64_BIT_INO_T = (int)1L; + /** + * {@snippet lang=c : + * #define __DARWIN_64_BIT_INO_T 1 + * } + */ + public static int __DARWIN_64_BIT_INO_T() { + return __DARWIN_64_BIT_INO_T; + } + private static final int __DARWIN_VERS_1050 = (int)1L; + /** + * {@snippet lang=c : + * #define __DARWIN_VERS_1050 1 + * } + */ + public static int __DARWIN_VERS_1050() { + return __DARWIN_VERS_1050; + } + private static final int __DARWIN_NON_CANCELABLE = (int)0L; + /** + * {@snippet lang=c : + * #define __DARWIN_NON_CANCELABLE 0 + * } + */ + public static int __DARWIN_NON_CANCELABLE() { + return __DARWIN_NON_CANCELABLE; + } + private static final int __STDC_WANT_LIB_EXT1__ = (int)1L; + /** + * {@snippet lang=c : + * #define __STDC_WANT_LIB_EXT1__ 1 + * } + */ + public static int __STDC_WANT_LIB_EXT1__() { + return __STDC_WANT_LIB_EXT1__; + } + private static final int __DARWIN_NO_LONG_LONG = (int)0L; + /** + * {@snippet lang=c : + * #define __DARWIN_NO_LONG_LONG 0 + * } + */ + public static int __DARWIN_NO_LONG_LONG() { + return __DARWIN_NO_LONG_LONG; + } + private static final int _DARWIN_FEATURE_64_BIT_INODE = (int)1L; + /** + * {@snippet lang=c : + * #define _DARWIN_FEATURE_64_BIT_INODE 1 + * } + */ + public static int _DARWIN_FEATURE_64_BIT_INODE() { + return _DARWIN_FEATURE_64_BIT_INODE; + } + private static final int _DARWIN_FEATURE_ONLY_64_BIT_INODE = (int)1L; + /** + * {@snippet lang=c : + * #define _DARWIN_FEATURE_ONLY_64_BIT_INODE 1 + * } + */ + public static int _DARWIN_FEATURE_ONLY_64_BIT_INODE() { + return _DARWIN_FEATURE_ONLY_64_BIT_INODE; + } + private static final int _DARWIN_FEATURE_ONLY_VERS_1050 = (int)1L; + /** + * {@snippet lang=c : + * #define _DARWIN_FEATURE_ONLY_VERS_1050 1 + * } + */ + public static int _DARWIN_FEATURE_ONLY_VERS_1050() { + return _DARWIN_FEATURE_ONLY_VERS_1050; + } + private static final int _DARWIN_FEATURE_ONLY_UNIX_CONFORMANCE = (int)1L; + /** + * {@snippet lang=c : + * #define _DARWIN_FEATURE_ONLY_UNIX_CONFORMANCE 1 + * } + */ + public static int _DARWIN_FEATURE_ONLY_UNIX_CONFORMANCE() { + return _DARWIN_FEATURE_ONLY_UNIX_CONFORMANCE; + } + private static final int _DARWIN_FEATURE_UNIX_CONFORMANCE = (int)3L; + /** + * {@snippet lang=c : + * #define _DARWIN_FEATURE_UNIX_CONFORMANCE 3 + * } + */ + public static int _DARWIN_FEATURE_UNIX_CONFORMANCE() { + return _DARWIN_FEATURE_UNIX_CONFORMANCE; + } + private static final int __has_ptrcheck = (int)0L; + /** + * {@snippet lang=c : + * #define __has_ptrcheck 0 + * } + */ + public static int __has_ptrcheck() { + return __has_ptrcheck; + } + private static final int __API_TO_BE_DEPRECATED = (int)100000L; + /** + * {@snippet lang=c : + * #define __API_TO_BE_DEPRECATED 100000 + * } + */ + public static int __API_TO_BE_DEPRECATED() { + return __API_TO_BE_DEPRECATED; + } + private static final int __API_TO_BE_DEPRECATED_MACOS = (int)100000L; + /** + * {@snippet lang=c : + * #define __API_TO_BE_DEPRECATED_MACOS 100000 + * } + */ + public static int __API_TO_BE_DEPRECATED_MACOS() { + return __API_TO_BE_DEPRECATED_MACOS; + } + private static final int __API_TO_BE_DEPRECATED_IOS = (int)100000L; + /** + * {@snippet lang=c : + * #define __API_TO_BE_DEPRECATED_IOS 100000 + * } + */ + public static int __API_TO_BE_DEPRECATED_IOS() { + return __API_TO_BE_DEPRECATED_IOS; + } + private static final int __API_TO_BE_DEPRECATED_MACCATALYST = (int)100000L; + /** + * {@snippet lang=c : + * #define __API_TO_BE_DEPRECATED_MACCATALYST 100000 + * } + */ + public static int __API_TO_BE_DEPRECATED_MACCATALYST() { + return __API_TO_BE_DEPRECATED_MACCATALYST; + } + private static final int __API_TO_BE_DEPRECATED_WATCHOS = (int)100000L; + /** + * {@snippet lang=c : + * #define __API_TO_BE_DEPRECATED_WATCHOS 100000 + * } + */ + public static int __API_TO_BE_DEPRECATED_WATCHOS() { + return __API_TO_BE_DEPRECATED_WATCHOS; + } + private static final int __API_TO_BE_DEPRECATED_TVOS = (int)100000L; + /** + * {@snippet lang=c : + * #define __API_TO_BE_DEPRECATED_TVOS 100000 + * } + */ + public static int __API_TO_BE_DEPRECATED_TVOS() { + return __API_TO_BE_DEPRECATED_TVOS; + } + private static final int __API_TO_BE_DEPRECATED_DRIVERKIT = (int)100000L; + /** + * {@snippet lang=c : + * #define __API_TO_BE_DEPRECATED_DRIVERKIT 100000 + * } + */ + public static int __API_TO_BE_DEPRECATED_DRIVERKIT() { + return __API_TO_BE_DEPRECATED_DRIVERKIT; + } + private static final int __API_TO_BE_DEPRECATED_VISIONOS = (int)100000L; + /** + * {@snippet lang=c : + * #define __API_TO_BE_DEPRECATED_VISIONOS 100000 + * } + */ + public static int __API_TO_BE_DEPRECATED_VISIONOS() { + return __API_TO_BE_DEPRECATED_VISIONOS; + } + private static final int __MAC_10_0 = (int)1000L; + /** + * {@snippet lang=c : + * #define __MAC_10_0 1000 + * } + */ + public static int __MAC_10_0() { + return __MAC_10_0; + } + private static final int __MAC_10_1 = (int)1010L; + /** + * {@snippet lang=c : + * #define __MAC_10_1 1010 + * } + */ + public static int __MAC_10_1() { + return __MAC_10_1; + } + private static final int __MAC_10_2 = (int)1020L; + /** + * {@snippet lang=c : + * #define __MAC_10_2 1020 + * } + */ + public static int __MAC_10_2() { + return __MAC_10_2; + } + private static final int __MAC_10_3 = (int)1030L; + /** + * {@snippet lang=c : + * #define __MAC_10_3 1030 + * } + */ + public static int __MAC_10_3() { + return __MAC_10_3; + } + private static final int __MAC_10_4 = (int)1040L; + /** + * {@snippet lang=c : + * #define __MAC_10_4 1040 + * } + */ + public static int __MAC_10_4() { + return __MAC_10_4; + } + private static final int __MAC_10_5 = (int)1050L; + /** + * {@snippet lang=c : + * #define __MAC_10_5 1050 + * } + */ + public static int __MAC_10_5() { + return __MAC_10_5; + } + private static final int __MAC_10_6 = (int)1060L; + /** + * {@snippet lang=c : + * #define __MAC_10_6 1060 + * } + */ + public static int __MAC_10_6() { + return __MAC_10_6; + } + private static final int __MAC_10_7 = (int)1070L; + /** + * {@snippet lang=c : + * #define __MAC_10_7 1070 + * } + */ + public static int __MAC_10_7() { + return __MAC_10_7; + } + private static final int __MAC_10_8 = (int)1080L; + /** + * {@snippet lang=c : + * #define __MAC_10_8 1080 + * } + */ + public static int __MAC_10_8() { + return __MAC_10_8; + } + private static final int __MAC_10_9 = (int)1090L; + /** + * {@snippet lang=c : + * #define __MAC_10_9 1090 + * } + */ + public static int __MAC_10_9() { + return __MAC_10_9; + } + private static final int __MAC_10_10 = (int)101000L; + /** + * {@snippet lang=c : + * #define __MAC_10_10 101000 + * } + */ + public static int __MAC_10_10() { + return __MAC_10_10; + } + private static final int __MAC_10_10_2 = (int)101002L; + /** + * {@snippet lang=c : + * #define __MAC_10_10_2 101002 + * } + */ + public static int __MAC_10_10_2() { + return __MAC_10_10_2; + } + private static final int __MAC_10_10_3 = (int)101003L; + /** + * {@snippet lang=c : + * #define __MAC_10_10_3 101003 + * } + */ + public static int __MAC_10_10_3() { + return __MAC_10_10_3; + } + private static final int __MAC_10_11 = (int)101100L; + /** + * {@snippet lang=c : + * #define __MAC_10_11 101100 + * } + */ + public static int __MAC_10_11() { + return __MAC_10_11; + } + private static final int __MAC_10_11_2 = (int)101102L; + /** + * {@snippet lang=c : + * #define __MAC_10_11_2 101102 + * } + */ + public static int __MAC_10_11_2() { + return __MAC_10_11_2; + } + private static final int __MAC_10_11_3 = (int)101103L; + /** + * {@snippet lang=c : + * #define __MAC_10_11_3 101103 + * } + */ + public static int __MAC_10_11_3() { + return __MAC_10_11_3; + } + private static final int __MAC_10_11_4 = (int)101104L; + /** + * {@snippet lang=c : + * #define __MAC_10_11_4 101104 + * } + */ + public static int __MAC_10_11_4() { + return __MAC_10_11_4; + } + private static final int __MAC_10_12 = (int)101200L; + /** + * {@snippet lang=c : + * #define __MAC_10_12 101200 + * } + */ + public static int __MAC_10_12() { + return __MAC_10_12; + } + private static final int __MAC_10_12_1 = (int)101201L; + /** + * {@snippet lang=c : + * #define __MAC_10_12_1 101201 + * } + */ + public static int __MAC_10_12_1() { + return __MAC_10_12_1; + } + private static final int __MAC_10_12_2 = (int)101202L; + /** + * {@snippet lang=c : + * #define __MAC_10_12_2 101202 + * } + */ + public static int __MAC_10_12_2() { + return __MAC_10_12_2; + } + private static final int __MAC_10_12_4 = (int)101204L; + /** + * {@snippet lang=c : + * #define __MAC_10_12_4 101204 + * } + */ + public static int __MAC_10_12_4() { + return __MAC_10_12_4; + } + private static final int __MAC_10_13 = (int)101300L; + /** + * {@snippet lang=c : + * #define __MAC_10_13 101300 + * } + */ + public static int __MAC_10_13() { + return __MAC_10_13; + } + private static final int __MAC_10_13_1 = (int)101301L; + /** + * {@snippet lang=c : + * #define __MAC_10_13_1 101301 + * } + */ + public static int __MAC_10_13_1() { + return __MAC_10_13_1; + } + private static final int __MAC_10_13_2 = (int)101302L; + /** + * {@snippet lang=c : + * #define __MAC_10_13_2 101302 + * } + */ + public static int __MAC_10_13_2() { + return __MAC_10_13_2; + } + private static final int __MAC_10_13_4 = (int)101304L; + /** + * {@snippet lang=c : + * #define __MAC_10_13_4 101304 + * } + */ + public static int __MAC_10_13_4() { + return __MAC_10_13_4; + } + private static final int __MAC_10_14 = (int)101400L; + /** + * {@snippet lang=c : + * #define __MAC_10_14 101400 + * } + */ + public static int __MAC_10_14() { + return __MAC_10_14; + } + private static final int __MAC_10_14_1 = (int)101401L; + /** + * {@snippet lang=c : + * #define __MAC_10_14_1 101401 + * } + */ + public static int __MAC_10_14_1() { + return __MAC_10_14_1; + } + private static final int __MAC_10_14_4 = (int)101404L; + /** + * {@snippet lang=c : + * #define __MAC_10_14_4 101404 + * } + */ + public static int __MAC_10_14_4() { + return __MAC_10_14_4; + } + private static final int __MAC_10_14_5 = (int)101405L; + /** + * {@snippet lang=c : + * #define __MAC_10_14_5 101405 + * } + */ + public static int __MAC_10_14_5() { + return __MAC_10_14_5; + } + private static final int __MAC_10_14_6 = (int)101406L; + /** + * {@snippet lang=c : + * #define __MAC_10_14_6 101406 + * } + */ + public static int __MAC_10_14_6() { + return __MAC_10_14_6; + } + private static final int __MAC_10_15 = (int)101500L; + /** + * {@snippet lang=c : + * #define __MAC_10_15 101500 + * } + */ + public static int __MAC_10_15() { + return __MAC_10_15; + } + private static final int __MAC_10_15_1 = (int)101501L; + /** + * {@snippet lang=c : + * #define __MAC_10_15_1 101501 + * } + */ + public static int __MAC_10_15_1() { + return __MAC_10_15_1; + } + private static final int __MAC_10_15_4 = (int)101504L; + /** + * {@snippet lang=c : + * #define __MAC_10_15_4 101504 + * } + */ + public static int __MAC_10_15_4() { + return __MAC_10_15_4; + } + private static final int __MAC_10_16 = (int)101600L; + /** + * {@snippet lang=c : + * #define __MAC_10_16 101600 + * } + */ + public static int __MAC_10_16() { + return __MAC_10_16; + } + private static final int __MAC_11_0 = (int)110000L; + /** + * {@snippet lang=c : + * #define __MAC_11_0 110000 + * } + */ + public static int __MAC_11_0() { + return __MAC_11_0; + } + private static final int __MAC_11_1 = (int)110100L; + /** + * {@snippet lang=c : + * #define __MAC_11_1 110100 + * } + */ + public static int __MAC_11_1() { + return __MAC_11_1; + } + private static final int __MAC_11_3 = (int)110300L; + /** + * {@snippet lang=c : + * #define __MAC_11_3 110300 + * } + */ + public static int __MAC_11_3() { + return __MAC_11_3; + } + private static final int __MAC_11_4 = (int)110400L; + /** + * {@snippet lang=c : + * #define __MAC_11_4 110400 + * } + */ + public static int __MAC_11_4() { + return __MAC_11_4; + } + private static final int __MAC_11_5 = (int)110500L; + /** + * {@snippet lang=c : + * #define __MAC_11_5 110500 + * } + */ + public static int __MAC_11_5() { + return __MAC_11_5; + } + private static final int __MAC_11_6 = (int)110600L; + /** + * {@snippet lang=c : + * #define __MAC_11_6 110600 + * } + */ + public static int __MAC_11_6() { + return __MAC_11_6; + } + private static final int __MAC_12_0 = (int)120000L; + /** + * {@snippet lang=c : + * #define __MAC_12_0 120000 + * } + */ + public static int __MAC_12_0() { + return __MAC_12_0; + } + private static final int __MAC_12_1 = (int)120100L; + /** + * {@snippet lang=c : + * #define __MAC_12_1 120100 + * } + */ + public static int __MAC_12_1() { + return __MAC_12_1; + } + private static final int __MAC_12_2 = (int)120200L; + /** + * {@snippet lang=c : + * #define __MAC_12_2 120200 + * } + */ + public static int __MAC_12_2() { + return __MAC_12_2; + } + private static final int __MAC_12_3 = (int)120300L; + /** + * {@snippet lang=c : + * #define __MAC_12_3 120300 + * } + */ + public static int __MAC_12_3() { + return __MAC_12_3; + } + private static final int __MAC_12_4 = (int)120400L; + /** + * {@snippet lang=c : + * #define __MAC_12_4 120400 + * } + */ + public static int __MAC_12_4() { + return __MAC_12_4; + } + private static final int __MAC_12_5 = (int)120500L; + /** + * {@snippet lang=c : + * #define __MAC_12_5 120500 + * } + */ + public static int __MAC_12_5() { + return __MAC_12_5; + } + private static final int __MAC_12_6 = (int)120600L; + /** + * {@snippet lang=c : + * #define __MAC_12_6 120600 + * } + */ + public static int __MAC_12_6() { + return __MAC_12_6; + } + private static final int __MAC_12_7 = (int)120700L; + /** + * {@snippet lang=c : + * #define __MAC_12_7 120700 + * } + */ + public static int __MAC_12_7() { + return __MAC_12_7; + } + private static final int __MAC_13_0 = (int)130000L; + /** + * {@snippet lang=c : + * #define __MAC_13_0 130000 + * } + */ + public static int __MAC_13_0() { + return __MAC_13_0; + } + private static final int __MAC_13_1 = (int)130100L; + /** + * {@snippet lang=c : + * #define __MAC_13_1 130100 + * } + */ + public static int __MAC_13_1() { + return __MAC_13_1; + } + private static final int __MAC_13_2 = (int)130200L; + /** + * {@snippet lang=c : + * #define __MAC_13_2 130200 + * } + */ + public static int __MAC_13_2() { + return __MAC_13_2; + } + private static final int __MAC_13_3 = (int)130300L; + /** + * {@snippet lang=c : + * #define __MAC_13_3 130300 + * } + */ + public static int __MAC_13_3() { + return __MAC_13_3; + } + private static final int __MAC_13_4 = (int)130400L; + /** + * {@snippet lang=c : + * #define __MAC_13_4 130400 + * } + */ + public static int __MAC_13_4() { + return __MAC_13_4; + } + private static final int __MAC_13_5 = (int)130500L; + /** + * {@snippet lang=c : + * #define __MAC_13_5 130500 + * } + */ + public static int __MAC_13_5() { + return __MAC_13_5; + } + private static final int __MAC_13_6 = (int)130600L; + /** + * {@snippet lang=c : + * #define __MAC_13_6 130600 + * } + */ + public static int __MAC_13_6() { + return __MAC_13_6; + } + private static final int __MAC_14_0 = (int)140000L; + /** + * {@snippet lang=c : + * #define __MAC_14_0 140000 + * } + */ + public static int __MAC_14_0() { + return __MAC_14_0; + } + private static final int __MAC_14_1 = (int)140100L; + /** + * {@snippet lang=c : + * #define __MAC_14_1 140100 + * } + */ + public static int __MAC_14_1() { + return __MAC_14_1; + } + private static final int __MAC_14_2 = (int)140200L; + /** + * {@snippet lang=c : + * #define __MAC_14_2 140200 + * } + */ + public static int __MAC_14_2() { + return __MAC_14_2; + } + private static final int __MAC_14_3 = (int)140300L; + /** + * {@snippet lang=c : + * #define __MAC_14_3 140300 + * } + */ + public static int __MAC_14_3() { + return __MAC_14_3; + } + private static final int __MAC_14_4 = (int)140400L; + /** + * {@snippet lang=c : + * #define __MAC_14_4 140400 + * } + */ + public static int __MAC_14_4() { + return __MAC_14_4; + } + private static final int __MAC_14_5 = (int)140500L; + /** + * {@snippet lang=c : + * #define __MAC_14_5 140500 + * } + */ + public static int __MAC_14_5() { + return __MAC_14_5; + } + private static final int __IPHONE_2_0 = (int)20000L; + /** + * {@snippet lang=c : + * #define __IPHONE_2_0 20000 + * } + */ + public static int __IPHONE_2_0() { + return __IPHONE_2_0; + } + private static final int __IPHONE_2_1 = (int)20100L; + /** + * {@snippet lang=c : + * #define __IPHONE_2_1 20100 + * } + */ + public static int __IPHONE_2_1() { + return __IPHONE_2_1; + } + private static final int __IPHONE_2_2 = (int)20200L; + /** + * {@snippet lang=c : + * #define __IPHONE_2_2 20200 + * } + */ + public static int __IPHONE_2_2() { + return __IPHONE_2_2; + } + private static final int __IPHONE_3_0 = (int)30000L; + /** + * {@snippet lang=c : + * #define __IPHONE_3_0 30000 + * } + */ + public static int __IPHONE_3_0() { + return __IPHONE_3_0; + } + private static final int __IPHONE_3_1 = (int)30100L; + /** + * {@snippet lang=c : + * #define __IPHONE_3_1 30100 + * } + */ + public static int __IPHONE_3_1() { + return __IPHONE_3_1; + } + private static final int __IPHONE_3_2 = (int)30200L; + /** + * {@snippet lang=c : + * #define __IPHONE_3_2 30200 + * } + */ + public static int __IPHONE_3_2() { + return __IPHONE_3_2; + } + private static final int __IPHONE_4_0 = (int)40000L; + /** + * {@snippet lang=c : + * #define __IPHONE_4_0 40000 + * } + */ + public static int __IPHONE_4_0() { + return __IPHONE_4_0; + } + private static final int __IPHONE_4_1 = (int)40100L; + /** + * {@snippet lang=c : + * #define __IPHONE_4_1 40100 + * } + */ + public static int __IPHONE_4_1() { + return __IPHONE_4_1; + } + private static final int __IPHONE_4_2 = (int)40200L; + /** + * {@snippet lang=c : + * #define __IPHONE_4_2 40200 + * } + */ + public static int __IPHONE_4_2() { + return __IPHONE_4_2; + } + private static final int __IPHONE_4_3 = (int)40300L; + /** + * {@snippet lang=c : + * #define __IPHONE_4_3 40300 + * } + */ + public static int __IPHONE_4_3() { + return __IPHONE_4_3; + } + private static final int __IPHONE_5_0 = (int)50000L; + /** + * {@snippet lang=c : + * #define __IPHONE_5_0 50000 + * } + */ + public static int __IPHONE_5_0() { + return __IPHONE_5_0; + } + private static final int __IPHONE_5_1 = (int)50100L; + /** + * {@snippet lang=c : + * #define __IPHONE_5_1 50100 + * } + */ + public static int __IPHONE_5_1() { + return __IPHONE_5_1; + } + private static final int __IPHONE_6_0 = (int)60000L; + /** + * {@snippet lang=c : + * #define __IPHONE_6_0 60000 + * } + */ + public static int __IPHONE_6_0() { + return __IPHONE_6_0; + } + private static final int __IPHONE_6_1 = (int)60100L; + /** + * {@snippet lang=c : + * #define __IPHONE_6_1 60100 + * } + */ + public static int __IPHONE_6_1() { + return __IPHONE_6_1; + } + private static final int __IPHONE_7_0 = (int)70000L; + /** + * {@snippet lang=c : + * #define __IPHONE_7_0 70000 + * } + */ + public static int __IPHONE_7_0() { + return __IPHONE_7_0; + } + private static final int __IPHONE_7_1 = (int)70100L; + /** + * {@snippet lang=c : + * #define __IPHONE_7_1 70100 + * } + */ + public static int __IPHONE_7_1() { + return __IPHONE_7_1; + } + private static final int __IPHONE_8_0 = (int)80000L; + /** + * {@snippet lang=c : + * #define __IPHONE_8_0 80000 + * } + */ + public static int __IPHONE_8_0() { + return __IPHONE_8_0; + } + private static final int __IPHONE_8_1 = (int)80100L; + /** + * {@snippet lang=c : + * #define __IPHONE_8_1 80100 + * } + */ + public static int __IPHONE_8_1() { + return __IPHONE_8_1; + } + private static final int __IPHONE_8_2 = (int)80200L; + /** + * {@snippet lang=c : + * #define __IPHONE_8_2 80200 + * } + */ + public static int __IPHONE_8_2() { + return __IPHONE_8_2; + } + private static final int __IPHONE_8_3 = (int)80300L; + /** + * {@snippet lang=c : + * #define __IPHONE_8_3 80300 + * } + */ + public static int __IPHONE_8_3() { + return __IPHONE_8_3; + } + private static final int __IPHONE_8_4 = (int)80400L; + /** + * {@snippet lang=c : + * #define __IPHONE_8_4 80400 + * } + */ + public static int __IPHONE_8_4() { + return __IPHONE_8_4; + } + private static final int __IPHONE_9_0 = (int)90000L; + /** + * {@snippet lang=c : + * #define __IPHONE_9_0 90000 + * } + */ + public static int __IPHONE_9_0() { + return __IPHONE_9_0; + } + private static final int __IPHONE_9_1 = (int)90100L; + /** + * {@snippet lang=c : + * #define __IPHONE_9_1 90100 + * } + */ + public static int __IPHONE_9_1() { + return __IPHONE_9_1; + } + private static final int __IPHONE_9_2 = (int)90200L; + /** + * {@snippet lang=c : + * #define __IPHONE_9_2 90200 + * } + */ + public static int __IPHONE_9_2() { + return __IPHONE_9_2; + } + private static final int __IPHONE_9_3 = (int)90300L; + /** + * {@snippet lang=c : + * #define __IPHONE_9_3 90300 + * } + */ + public static int __IPHONE_9_3() { + return __IPHONE_9_3; + } + private static final int __IPHONE_10_0 = (int)100000L; + /** + * {@snippet lang=c : + * #define __IPHONE_10_0 100000 + * } + */ + public static int __IPHONE_10_0() { + return __IPHONE_10_0; + } + private static final int __IPHONE_10_1 = (int)100100L; + /** + * {@snippet lang=c : + * #define __IPHONE_10_1 100100 + * } + */ + public static int __IPHONE_10_1() { + return __IPHONE_10_1; + } + private static final int __IPHONE_10_2 = (int)100200L; + /** + * {@snippet lang=c : + * #define __IPHONE_10_2 100200 + * } + */ + public static int __IPHONE_10_2() { + return __IPHONE_10_2; + } + private static final int __IPHONE_10_3 = (int)100300L; + /** + * {@snippet lang=c : + * #define __IPHONE_10_3 100300 + * } + */ + public static int __IPHONE_10_3() { + return __IPHONE_10_3; + } + private static final int __IPHONE_11_0 = (int)110000L; + /** + * {@snippet lang=c : + * #define __IPHONE_11_0 110000 + * } + */ + public static int __IPHONE_11_0() { + return __IPHONE_11_0; + } + private static final int __IPHONE_11_1 = (int)110100L; + /** + * {@snippet lang=c : + * #define __IPHONE_11_1 110100 + * } + */ + public static int __IPHONE_11_1() { + return __IPHONE_11_1; + } + private static final int __IPHONE_11_2 = (int)110200L; + /** + * {@snippet lang=c : + * #define __IPHONE_11_2 110200 + * } + */ + public static int __IPHONE_11_2() { + return __IPHONE_11_2; + } + private static final int __IPHONE_11_3 = (int)110300L; + /** + * {@snippet lang=c : + * #define __IPHONE_11_3 110300 + * } + */ + public static int __IPHONE_11_3() { + return __IPHONE_11_3; + } + private static final int __IPHONE_11_4 = (int)110400L; + /** + * {@snippet lang=c : + * #define __IPHONE_11_4 110400 + * } + */ + public static int __IPHONE_11_4() { + return __IPHONE_11_4; + } + private static final int __IPHONE_12_0 = (int)120000L; + /** + * {@snippet lang=c : + * #define __IPHONE_12_0 120000 + * } + */ + public static int __IPHONE_12_0() { + return __IPHONE_12_0; + } + private static final int __IPHONE_12_1 = (int)120100L; + /** + * {@snippet lang=c : + * #define __IPHONE_12_1 120100 + * } + */ + public static int __IPHONE_12_1() { + return __IPHONE_12_1; + } + private static final int __IPHONE_12_2 = (int)120200L; + /** + * {@snippet lang=c : + * #define __IPHONE_12_2 120200 + * } + */ + public static int __IPHONE_12_2() { + return __IPHONE_12_2; + } + private static final int __IPHONE_12_3 = (int)120300L; + /** + * {@snippet lang=c : + * #define __IPHONE_12_3 120300 + * } + */ + public static int __IPHONE_12_3() { + return __IPHONE_12_3; + } + private static final int __IPHONE_12_4 = (int)120400L; + /** + * {@snippet lang=c : + * #define __IPHONE_12_4 120400 + * } + */ + public static int __IPHONE_12_4() { + return __IPHONE_12_4; + } + private static final int __IPHONE_13_0 = (int)130000L; + /** + * {@snippet lang=c : + * #define __IPHONE_13_0 130000 + * } + */ + public static int __IPHONE_13_0() { + return __IPHONE_13_0; + } + private static final int __IPHONE_13_1 = (int)130100L; + /** + * {@snippet lang=c : + * #define __IPHONE_13_1 130100 + * } + */ + public static int __IPHONE_13_1() { + return __IPHONE_13_1; + } + private static final int __IPHONE_13_2 = (int)130200L; + /** + * {@snippet lang=c : + * #define __IPHONE_13_2 130200 + * } + */ + public static int __IPHONE_13_2() { + return __IPHONE_13_2; + } + private static final int __IPHONE_13_3 = (int)130300L; + /** + * {@snippet lang=c : + * #define __IPHONE_13_3 130300 + * } + */ + public static int __IPHONE_13_3() { + return __IPHONE_13_3; + } + private static final int __IPHONE_13_4 = (int)130400L; + /** + * {@snippet lang=c : + * #define __IPHONE_13_4 130400 + * } + */ + public static int __IPHONE_13_4() { + return __IPHONE_13_4; + } + private static final int __IPHONE_13_5 = (int)130500L; + /** + * {@snippet lang=c : + * #define __IPHONE_13_5 130500 + * } + */ + public static int __IPHONE_13_5() { + return __IPHONE_13_5; + } + private static final int __IPHONE_13_6 = (int)130600L; + /** + * {@snippet lang=c : + * #define __IPHONE_13_6 130600 + * } + */ + public static int __IPHONE_13_6() { + return __IPHONE_13_6; + } + private static final int __IPHONE_13_7 = (int)130700L; + /** + * {@snippet lang=c : + * #define __IPHONE_13_7 130700 + * } + */ + public static int __IPHONE_13_7() { + return __IPHONE_13_7; + } + private static final int __IPHONE_14_0 = (int)140000L; + /** + * {@snippet lang=c : + * #define __IPHONE_14_0 140000 + * } + */ + public static int __IPHONE_14_0() { + return __IPHONE_14_0; + } + private static final int __IPHONE_14_1 = (int)140100L; + /** + * {@snippet lang=c : + * #define __IPHONE_14_1 140100 + * } + */ + public static int __IPHONE_14_1() { + return __IPHONE_14_1; + } + private static final int __IPHONE_14_2 = (int)140200L; + /** + * {@snippet lang=c : + * #define __IPHONE_14_2 140200 + * } + */ + public static int __IPHONE_14_2() { + return __IPHONE_14_2; + } + private static final int __IPHONE_14_3 = (int)140300L; + /** + * {@snippet lang=c : + * #define __IPHONE_14_3 140300 + * } + */ + public static int __IPHONE_14_3() { + return __IPHONE_14_3; + } + private static final int __IPHONE_14_5 = (int)140500L; + /** + * {@snippet lang=c : + * #define __IPHONE_14_5 140500 + * } + */ + public static int __IPHONE_14_5() { + return __IPHONE_14_5; + } + private static final int __IPHONE_14_4 = (int)140400L; + /** + * {@snippet lang=c : + * #define __IPHONE_14_4 140400 + * } + */ + public static int __IPHONE_14_4() { + return __IPHONE_14_4; + } + private static final int __IPHONE_14_6 = (int)140600L; + /** + * {@snippet lang=c : + * #define __IPHONE_14_6 140600 + * } + */ + public static int __IPHONE_14_6() { + return __IPHONE_14_6; + } + private static final int __IPHONE_14_7 = (int)140700L; + /** + * {@snippet lang=c : + * #define __IPHONE_14_7 140700 + * } + */ + public static int __IPHONE_14_7() { + return __IPHONE_14_7; + } + private static final int __IPHONE_14_8 = (int)140800L; + /** + * {@snippet lang=c : + * #define __IPHONE_14_8 140800 + * } + */ + public static int __IPHONE_14_8() { + return __IPHONE_14_8; + } + private static final int __IPHONE_15_0 = (int)150000L; + /** + * {@snippet lang=c : + * #define __IPHONE_15_0 150000 + * } + */ + public static int __IPHONE_15_0() { + return __IPHONE_15_0; + } + private static final int __IPHONE_15_1 = (int)150100L; + /** + * {@snippet lang=c : + * #define __IPHONE_15_1 150100 + * } + */ + public static int __IPHONE_15_1() { + return __IPHONE_15_1; + } + private static final int __IPHONE_15_2 = (int)150200L; + /** + * {@snippet lang=c : + * #define __IPHONE_15_2 150200 + * } + */ + public static int __IPHONE_15_2() { + return __IPHONE_15_2; + } + private static final int __IPHONE_15_3 = (int)150300L; + /** + * {@snippet lang=c : + * #define __IPHONE_15_3 150300 + * } + */ + public static int __IPHONE_15_3() { + return __IPHONE_15_3; + } + private static final int __IPHONE_15_4 = (int)150400L; + /** + * {@snippet lang=c : + * #define __IPHONE_15_4 150400 + * } + */ + public static int __IPHONE_15_4() { + return __IPHONE_15_4; + } + private static final int __IPHONE_15_5 = (int)150500L; + /** + * {@snippet lang=c : + * #define __IPHONE_15_5 150500 + * } + */ + public static int __IPHONE_15_5() { + return __IPHONE_15_5; + } + private static final int __IPHONE_15_6 = (int)150600L; + /** + * {@snippet lang=c : + * #define __IPHONE_15_6 150600 + * } + */ + public static int __IPHONE_15_6() { + return __IPHONE_15_6; + } + private static final int __IPHONE_15_7 = (int)150700L; + /** + * {@snippet lang=c : + * #define __IPHONE_15_7 150700 + * } + */ + public static int __IPHONE_15_7() { + return __IPHONE_15_7; + } + private static final int __IPHONE_15_8 = (int)150800L; + /** + * {@snippet lang=c : + * #define __IPHONE_15_8 150800 + * } + */ + public static int __IPHONE_15_8() { + return __IPHONE_15_8; + } + private static final int __IPHONE_16_0 = (int)160000L; + /** + * {@snippet lang=c : + * #define __IPHONE_16_0 160000 + * } + */ + public static int __IPHONE_16_0() { + return __IPHONE_16_0; + } + private static final int __IPHONE_16_1 = (int)160100L; + /** + * {@snippet lang=c : + * #define __IPHONE_16_1 160100 + * } + */ + public static int __IPHONE_16_1() { + return __IPHONE_16_1; + } + private static final int __IPHONE_16_2 = (int)160200L; + /** + * {@snippet lang=c : + * #define __IPHONE_16_2 160200 + * } + */ + public static int __IPHONE_16_2() { + return __IPHONE_16_2; + } + private static final int __IPHONE_16_3 = (int)160300L; + /** + * {@snippet lang=c : + * #define __IPHONE_16_3 160300 + * } + */ + public static int __IPHONE_16_3() { + return __IPHONE_16_3; + } + private static final int __IPHONE_16_4 = (int)160400L; + /** + * {@snippet lang=c : + * #define __IPHONE_16_4 160400 + * } + */ + public static int __IPHONE_16_4() { + return __IPHONE_16_4; + } + private static final int __IPHONE_16_5 = (int)160500L; + /** + * {@snippet lang=c : + * #define __IPHONE_16_5 160500 + * } + */ + public static int __IPHONE_16_5() { + return __IPHONE_16_5; + } + private static final int __IPHONE_16_6 = (int)160600L; + /** + * {@snippet lang=c : + * #define __IPHONE_16_6 160600 + * } + */ + public static int __IPHONE_16_6() { + return __IPHONE_16_6; + } + private static final int __IPHONE_16_7 = (int)160700L; + /** + * {@snippet lang=c : + * #define __IPHONE_16_7 160700 + * } + */ + public static int __IPHONE_16_7() { + return __IPHONE_16_7; + } + private static final int __IPHONE_17_0 = (int)170000L; + /** + * {@snippet lang=c : + * #define __IPHONE_17_0 170000 + * } + */ + public static int __IPHONE_17_0() { + return __IPHONE_17_0; + } + private static final int __IPHONE_17_1 = (int)170100L; + /** + * {@snippet lang=c : + * #define __IPHONE_17_1 170100 + * } + */ + public static int __IPHONE_17_1() { + return __IPHONE_17_1; + } + private static final int __IPHONE_17_2 = (int)170200L; + /** + * {@snippet lang=c : + * #define __IPHONE_17_2 170200 + * } + */ + public static int __IPHONE_17_2() { + return __IPHONE_17_2; + } + private static final int __IPHONE_17_3 = (int)170300L; + /** + * {@snippet lang=c : + * #define __IPHONE_17_3 170300 + * } + */ + public static int __IPHONE_17_3() { + return __IPHONE_17_3; + } + private static final int __IPHONE_17_4 = (int)170400L; + /** + * {@snippet lang=c : + * #define __IPHONE_17_4 170400 + * } + */ + public static int __IPHONE_17_4() { + return __IPHONE_17_4; + } + private static final int __IPHONE_17_5 = (int)170500L; + /** + * {@snippet lang=c : + * #define __IPHONE_17_5 170500 + * } + */ + public static int __IPHONE_17_5() { + return __IPHONE_17_5; + } + private static final int __WATCHOS_1_0 = (int)10000L; + /** + * {@snippet lang=c : + * #define __WATCHOS_1_0 10000 + * } + */ + public static int __WATCHOS_1_0() { + return __WATCHOS_1_0; + } + private static final int __WATCHOS_2_0 = (int)20000L; + /** + * {@snippet lang=c : + * #define __WATCHOS_2_0 20000 + * } + */ + public static int __WATCHOS_2_0() { + return __WATCHOS_2_0; + } + private static final int __WATCHOS_2_1 = (int)20100L; + /** + * {@snippet lang=c : + * #define __WATCHOS_2_1 20100 + * } + */ + public static int __WATCHOS_2_1() { + return __WATCHOS_2_1; + } + private static final int __WATCHOS_2_2 = (int)20200L; + /** + * {@snippet lang=c : + * #define __WATCHOS_2_2 20200 + * } + */ + public static int __WATCHOS_2_2() { + return __WATCHOS_2_2; + } + private static final int __WATCHOS_3_0 = (int)30000L; + /** + * {@snippet lang=c : + * #define __WATCHOS_3_0 30000 + * } + */ + public static int __WATCHOS_3_0() { + return __WATCHOS_3_0; + } + private static final int __WATCHOS_3_1 = (int)30100L; + /** + * {@snippet lang=c : + * #define __WATCHOS_3_1 30100 + * } + */ + public static int __WATCHOS_3_1() { + return __WATCHOS_3_1; + } + private static final int __WATCHOS_3_1_1 = (int)30101L; + /** + * {@snippet lang=c : + * #define __WATCHOS_3_1_1 30101 + * } + */ + public static int __WATCHOS_3_1_1() { + return __WATCHOS_3_1_1; + } + private static final int __WATCHOS_3_2 = (int)30200L; + /** + * {@snippet lang=c : + * #define __WATCHOS_3_2 30200 + * } + */ + public static int __WATCHOS_3_2() { + return __WATCHOS_3_2; + } + private static final int __WATCHOS_4_0 = (int)40000L; + /** + * {@snippet lang=c : + * #define __WATCHOS_4_0 40000 + * } + */ + public static int __WATCHOS_4_0() { + return __WATCHOS_4_0; + } + private static final int __WATCHOS_4_1 = (int)40100L; + /** + * {@snippet lang=c : + * #define __WATCHOS_4_1 40100 + * } + */ + public static int __WATCHOS_4_1() { + return __WATCHOS_4_1; + } + private static final int __WATCHOS_4_2 = (int)40200L; + /** + * {@snippet lang=c : + * #define __WATCHOS_4_2 40200 + * } + */ + public static int __WATCHOS_4_2() { + return __WATCHOS_4_2; + } + private static final int __WATCHOS_4_3 = (int)40300L; + /** + * {@snippet lang=c : + * #define __WATCHOS_4_3 40300 + * } + */ + public static int __WATCHOS_4_3() { + return __WATCHOS_4_3; + } + private static final int __WATCHOS_5_0 = (int)50000L; + /** + * {@snippet lang=c : + * #define __WATCHOS_5_0 50000 + * } + */ + public static int __WATCHOS_5_0() { + return __WATCHOS_5_0; + } + private static final int __WATCHOS_5_1 = (int)50100L; + /** + * {@snippet lang=c : + * #define __WATCHOS_5_1 50100 + * } + */ + public static int __WATCHOS_5_1() { + return __WATCHOS_5_1; + } + private static final int __WATCHOS_5_2 = (int)50200L; + /** + * {@snippet lang=c : + * #define __WATCHOS_5_2 50200 + * } + */ + public static int __WATCHOS_5_2() { + return __WATCHOS_5_2; + } + private static final int __WATCHOS_5_3 = (int)50300L; + /** + * {@snippet lang=c : + * #define __WATCHOS_5_3 50300 + * } + */ + public static int __WATCHOS_5_3() { + return __WATCHOS_5_3; + } + private static final int __WATCHOS_6_0 = (int)60000L; + /** + * {@snippet lang=c : + * #define __WATCHOS_6_0 60000 + * } + */ + public static int __WATCHOS_6_0() { + return __WATCHOS_6_0; + } + private static final int __WATCHOS_6_1 = (int)60100L; + /** + * {@snippet lang=c : + * #define __WATCHOS_6_1 60100 + * } + */ + public static int __WATCHOS_6_1() { + return __WATCHOS_6_1; + } + private static final int __WATCHOS_6_2 = (int)60200L; + /** + * {@snippet lang=c : + * #define __WATCHOS_6_2 60200 + * } + */ + public static int __WATCHOS_6_2() { + return __WATCHOS_6_2; + } + private static final int __WATCHOS_7_0 = (int)70000L; + /** + * {@snippet lang=c : + * #define __WATCHOS_7_0 70000 + * } + */ + public static int __WATCHOS_7_0() { + return __WATCHOS_7_0; + } + private static final int __WATCHOS_7_1 = (int)70100L; + /** + * {@snippet lang=c : + * #define __WATCHOS_7_1 70100 + * } + */ + public static int __WATCHOS_7_1() { + return __WATCHOS_7_1; + } + private static final int __WATCHOS_7_2 = (int)70200L; + /** + * {@snippet lang=c : + * #define __WATCHOS_7_2 70200 + * } + */ + public static int __WATCHOS_7_2() { + return __WATCHOS_7_2; + } + private static final int __WATCHOS_7_3 = (int)70300L; + /** + * {@snippet lang=c : + * #define __WATCHOS_7_3 70300 + * } + */ + public static int __WATCHOS_7_3() { + return __WATCHOS_7_3; + } + private static final int __WATCHOS_7_4 = (int)70400L; + /** + * {@snippet lang=c : + * #define __WATCHOS_7_4 70400 + * } + */ + public static int __WATCHOS_7_4() { + return __WATCHOS_7_4; + } + private static final int __WATCHOS_7_5 = (int)70500L; + /** + * {@snippet lang=c : + * #define __WATCHOS_7_5 70500 + * } + */ + public static int __WATCHOS_7_5() { + return __WATCHOS_7_5; + } + private static final int __WATCHOS_7_6 = (int)70600L; + /** + * {@snippet lang=c : + * #define __WATCHOS_7_6 70600 + * } + */ + public static int __WATCHOS_7_6() { + return __WATCHOS_7_6; + } + private static final int __WATCHOS_8_0 = (int)80000L; + /** + * {@snippet lang=c : + * #define __WATCHOS_8_0 80000 + * } + */ + public static int __WATCHOS_8_0() { + return __WATCHOS_8_0; + } + private static final int __WATCHOS_8_1 = (int)80100L; + /** + * {@snippet lang=c : + * #define __WATCHOS_8_1 80100 + * } + */ + public static int __WATCHOS_8_1() { + return __WATCHOS_8_1; + } + private static final int __WATCHOS_8_3 = (int)80300L; + /** + * {@snippet lang=c : + * #define __WATCHOS_8_3 80300 + * } + */ + public static int __WATCHOS_8_3() { + return __WATCHOS_8_3; + } + private static final int __WATCHOS_8_4 = (int)80400L; + /** + * {@snippet lang=c : + * #define __WATCHOS_8_4 80400 + * } + */ + public static int __WATCHOS_8_4() { + return __WATCHOS_8_4; + } + private static final int __WATCHOS_8_5 = (int)80500L; + /** + * {@snippet lang=c : + * #define __WATCHOS_8_5 80500 + * } + */ + public static int __WATCHOS_8_5() { + return __WATCHOS_8_5; + } + private static final int __WATCHOS_8_6 = (int)80600L; + /** + * {@snippet lang=c : + * #define __WATCHOS_8_6 80600 + * } + */ + public static int __WATCHOS_8_6() { + return __WATCHOS_8_6; + } + private static final int __WATCHOS_8_7 = (int)80700L; + /** + * {@snippet lang=c : + * #define __WATCHOS_8_7 80700 + * } + */ + public static int __WATCHOS_8_7() { + return __WATCHOS_8_7; + } + private static final int __WATCHOS_8_8 = (int)80800L; + /** + * {@snippet lang=c : + * #define __WATCHOS_8_8 80800 + * } + */ + public static int __WATCHOS_8_8() { + return __WATCHOS_8_8; + } + private static final int __WATCHOS_9_0 = (int)90000L; + /** + * {@snippet lang=c : + * #define __WATCHOS_9_0 90000 + * } + */ + public static int __WATCHOS_9_0() { + return __WATCHOS_9_0; + } + private static final int __WATCHOS_9_1 = (int)90100L; + /** + * {@snippet lang=c : + * #define __WATCHOS_9_1 90100 + * } + */ + public static int __WATCHOS_9_1() { + return __WATCHOS_9_1; + } + private static final int __WATCHOS_9_2 = (int)90200L; + /** + * {@snippet lang=c : + * #define __WATCHOS_9_2 90200 + * } + */ + public static int __WATCHOS_9_2() { + return __WATCHOS_9_2; + } + private static final int __WATCHOS_9_3 = (int)90300L; + /** + * {@snippet lang=c : + * #define __WATCHOS_9_3 90300 + * } + */ + public static int __WATCHOS_9_3() { + return __WATCHOS_9_3; + } + private static final int __WATCHOS_9_4 = (int)90400L; + /** + * {@snippet lang=c : + * #define __WATCHOS_9_4 90400 + * } + */ + public static int __WATCHOS_9_4() { + return __WATCHOS_9_4; + } + private static final int __WATCHOS_9_5 = (int)90500L; + /** + * {@snippet lang=c : + * #define __WATCHOS_9_5 90500 + * } + */ + public static int __WATCHOS_9_5() { + return __WATCHOS_9_5; + } + private static final int __WATCHOS_9_6 = (int)90600L; + /** + * {@snippet lang=c : + * #define __WATCHOS_9_6 90600 + * } + */ + public static int __WATCHOS_9_6() { + return __WATCHOS_9_6; + } + private static final int __WATCHOS_10_0 = (int)100000L; + /** + * {@snippet lang=c : + * #define __WATCHOS_10_0 100000 + * } + */ + public static int __WATCHOS_10_0() { + return __WATCHOS_10_0; + } + private static final int __WATCHOS_10_1 = (int)100100L; + /** + * {@snippet lang=c : + * #define __WATCHOS_10_1 100100 + * } + */ + public static int __WATCHOS_10_1() { + return __WATCHOS_10_1; + } + private static final int __WATCHOS_10_2 = (int)100200L; + /** + * {@snippet lang=c : + * #define __WATCHOS_10_2 100200 + * } + */ + public static int __WATCHOS_10_2() { + return __WATCHOS_10_2; + } + private static final int __WATCHOS_10_3 = (int)100300L; + /** + * {@snippet lang=c : + * #define __WATCHOS_10_3 100300 + * } + */ + public static int __WATCHOS_10_3() { + return __WATCHOS_10_3; + } + private static final int __WATCHOS_10_4 = (int)100400L; + /** + * {@snippet lang=c : + * #define __WATCHOS_10_4 100400 + * } + */ + public static int __WATCHOS_10_4() { + return __WATCHOS_10_4; + } + private static final int __WATCHOS_10_5 = (int)100500L; + /** + * {@snippet lang=c : + * #define __WATCHOS_10_5 100500 + * } + */ + public static int __WATCHOS_10_5() { + return __WATCHOS_10_5; + } + private static final int __TVOS_9_0 = (int)90000L; + /** + * {@snippet lang=c : + * #define __TVOS_9_0 90000 + * } + */ + public static int __TVOS_9_0() { + return __TVOS_9_0; + } + private static final int __TVOS_9_1 = (int)90100L; + /** + * {@snippet lang=c : + * #define __TVOS_9_1 90100 + * } + */ + public static int __TVOS_9_1() { + return __TVOS_9_1; + } + private static final int __TVOS_9_2 = (int)90200L; + /** + * {@snippet lang=c : + * #define __TVOS_9_2 90200 + * } + */ + public static int __TVOS_9_2() { + return __TVOS_9_2; + } + private static final int __TVOS_10_0 = (int)100000L; + /** + * {@snippet lang=c : + * #define __TVOS_10_0 100000 + * } + */ + public static int __TVOS_10_0() { + return __TVOS_10_0; + } + private static final int __TVOS_10_0_1 = (int)100001L; + /** + * {@snippet lang=c : + * #define __TVOS_10_0_1 100001 + * } + */ + public static int __TVOS_10_0_1() { + return __TVOS_10_0_1; + } + private static final int __TVOS_10_1 = (int)100100L; + /** + * {@snippet lang=c : + * #define __TVOS_10_1 100100 + * } + */ + public static int __TVOS_10_1() { + return __TVOS_10_1; + } + private static final int __TVOS_10_2 = (int)100200L; + /** + * {@snippet lang=c : + * #define __TVOS_10_2 100200 + * } + */ + public static int __TVOS_10_2() { + return __TVOS_10_2; + } + private static final int __TVOS_11_0 = (int)110000L; + /** + * {@snippet lang=c : + * #define __TVOS_11_0 110000 + * } + */ + public static int __TVOS_11_0() { + return __TVOS_11_0; + } + private static final int __TVOS_11_1 = (int)110100L; + /** + * {@snippet lang=c : + * #define __TVOS_11_1 110100 + * } + */ + public static int __TVOS_11_1() { + return __TVOS_11_1; + } + private static final int __TVOS_11_2 = (int)110200L; + /** + * {@snippet lang=c : + * #define __TVOS_11_2 110200 + * } + */ + public static int __TVOS_11_2() { + return __TVOS_11_2; + } + private static final int __TVOS_11_3 = (int)110300L; + /** + * {@snippet lang=c : + * #define __TVOS_11_3 110300 + * } + */ + public static int __TVOS_11_3() { + return __TVOS_11_3; + } + private static final int __TVOS_11_4 = (int)110400L; + /** + * {@snippet lang=c : + * #define __TVOS_11_4 110400 + * } + */ + public static int __TVOS_11_4() { + return __TVOS_11_4; + } + private static final int __TVOS_12_0 = (int)120000L; + /** + * {@snippet lang=c : + * #define __TVOS_12_0 120000 + * } + */ + public static int __TVOS_12_0() { + return __TVOS_12_0; + } + private static final int __TVOS_12_1 = (int)120100L; + /** + * {@snippet lang=c : + * #define __TVOS_12_1 120100 + * } + */ + public static int __TVOS_12_1() { + return __TVOS_12_1; + } + private static final int __TVOS_12_2 = (int)120200L; + /** + * {@snippet lang=c : + * #define __TVOS_12_2 120200 + * } + */ + public static int __TVOS_12_2() { + return __TVOS_12_2; + } + private static final int __TVOS_12_3 = (int)120300L; + /** + * {@snippet lang=c : + * #define __TVOS_12_3 120300 + * } + */ + public static int __TVOS_12_3() { + return __TVOS_12_3; + } + private static final int __TVOS_12_4 = (int)120400L; + /** + * {@snippet lang=c : + * #define __TVOS_12_4 120400 + * } + */ + public static int __TVOS_12_4() { + return __TVOS_12_4; + } + private static final int __TVOS_13_0 = (int)130000L; + /** + * {@snippet lang=c : + * #define __TVOS_13_0 130000 + * } + */ + public static int __TVOS_13_0() { + return __TVOS_13_0; + } + private static final int __TVOS_13_2 = (int)130200L; + /** + * {@snippet lang=c : + * #define __TVOS_13_2 130200 + * } + */ + public static int __TVOS_13_2() { + return __TVOS_13_2; + } + private static final int __TVOS_13_3 = (int)130300L; + /** + * {@snippet lang=c : + * #define __TVOS_13_3 130300 + * } + */ + public static int __TVOS_13_3() { + return __TVOS_13_3; + } + private static final int __TVOS_13_4 = (int)130400L; + /** + * {@snippet lang=c : + * #define __TVOS_13_4 130400 + * } + */ + public static int __TVOS_13_4() { + return __TVOS_13_4; + } + private static final int __TVOS_14_0 = (int)140000L; + /** + * {@snippet lang=c : + * #define __TVOS_14_0 140000 + * } + */ + public static int __TVOS_14_0() { + return __TVOS_14_0; + } + private static final int __TVOS_14_1 = (int)140100L; + /** + * {@snippet lang=c : + * #define __TVOS_14_1 140100 + * } + */ + public static int __TVOS_14_1() { + return __TVOS_14_1; + } + private static final int __TVOS_14_2 = (int)140200L; + /** + * {@snippet lang=c : + * #define __TVOS_14_2 140200 + * } + */ + public static int __TVOS_14_2() { + return __TVOS_14_2; + } + private static final int __TVOS_14_3 = (int)140300L; + /** + * {@snippet lang=c : + * #define __TVOS_14_3 140300 + * } + */ + public static int __TVOS_14_3() { + return __TVOS_14_3; + } + private static final int __TVOS_14_5 = (int)140500L; + /** + * {@snippet lang=c : + * #define __TVOS_14_5 140500 + * } + */ + public static int __TVOS_14_5() { + return __TVOS_14_5; + } + private static final int __TVOS_14_6 = (int)140600L; + /** + * {@snippet lang=c : + * #define __TVOS_14_6 140600 + * } + */ + public static int __TVOS_14_6() { + return __TVOS_14_6; + } + private static final int __TVOS_14_7 = (int)140700L; + /** + * {@snippet lang=c : + * #define __TVOS_14_7 140700 + * } + */ + public static int __TVOS_14_7() { + return __TVOS_14_7; + } + private static final int __TVOS_15_0 = (int)150000L; + /** + * {@snippet lang=c : + * #define __TVOS_15_0 150000 + * } + */ + public static int __TVOS_15_0() { + return __TVOS_15_0; + } + private static final int __TVOS_15_1 = (int)150100L; + /** + * {@snippet lang=c : + * #define __TVOS_15_1 150100 + * } + */ + public static int __TVOS_15_1() { + return __TVOS_15_1; + } + private static final int __TVOS_15_2 = (int)150200L; + /** + * {@snippet lang=c : + * #define __TVOS_15_2 150200 + * } + */ + public static int __TVOS_15_2() { + return __TVOS_15_2; + } + private static final int __TVOS_15_3 = (int)150300L; + /** + * {@snippet lang=c : + * #define __TVOS_15_3 150300 + * } + */ + public static int __TVOS_15_3() { + return __TVOS_15_3; + } + private static final int __TVOS_15_4 = (int)150400L; + /** + * {@snippet lang=c : + * #define __TVOS_15_4 150400 + * } + */ + public static int __TVOS_15_4() { + return __TVOS_15_4; + } + private static final int __TVOS_15_5 = (int)150500L; + /** + * {@snippet lang=c : + * #define __TVOS_15_5 150500 + * } + */ + public static int __TVOS_15_5() { + return __TVOS_15_5; + } + private static final int __TVOS_15_6 = (int)150600L; + /** + * {@snippet lang=c : + * #define __TVOS_15_6 150600 + * } + */ + public static int __TVOS_15_6() { + return __TVOS_15_6; + } + private static final int __TVOS_16_0 = (int)160000L; + /** + * {@snippet lang=c : + * #define __TVOS_16_0 160000 + * } + */ + public static int __TVOS_16_0() { + return __TVOS_16_0; + } + private static final int __TVOS_16_1 = (int)160100L; + /** + * {@snippet lang=c : + * #define __TVOS_16_1 160100 + * } + */ + public static int __TVOS_16_1() { + return __TVOS_16_1; + } + private static final int __TVOS_16_2 = (int)160200L; + /** + * {@snippet lang=c : + * #define __TVOS_16_2 160200 + * } + */ + public static int __TVOS_16_2() { + return __TVOS_16_2; + } + private static final int __TVOS_16_3 = (int)160300L; + /** + * {@snippet lang=c : + * #define __TVOS_16_3 160300 + * } + */ + public static int __TVOS_16_3() { + return __TVOS_16_3; + } + private static final int __TVOS_16_4 = (int)160400L; + /** + * {@snippet lang=c : + * #define __TVOS_16_4 160400 + * } + */ + public static int __TVOS_16_4() { + return __TVOS_16_4; + } + private static final int __TVOS_16_5 = (int)160500L; + /** + * {@snippet lang=c : + * #define __TVOS_16_5 160500 + * } + */ + public static int __TVOS_16_5() { + return __TVOS_16_5; + } + private static final int __TVOS_16_6 = (int)160600L; + /** + * {@snippet lang=c : + * #define __TVOS_16_6 160600 + * } + */ + public static int __TVOS_16_6() { + return __TVOS_16_6; + } + private static final int __TVOS_17_0 = (int)170000L; + /** + * {@snippet lang=c : + * #define __TVOS_17_0 170000 + * } + */ + public static int __TVOS_17_0() { + return __TVOS_17_0; + } + private static final int __TVOS_17_1 = (int)170100L; + /** + * {@snippet lang=c : + * #define __TVOS_17_1 170100 + * } + */ + public static int __TVOS_17_1() { + return __TVOS_17_1; + } + private static final int __TVOS_17_2 = (int)170200L; + /** + * {@snippet lang=c : + * #define __TVOS_17_2 170200 + * } + */ + public static int __TVOS_17_2() { + return __TVOS_17_2; + } + private static final int __TVOS_17_3 = (int)170300L; + /** + * {@snippet lang=c : + * #define __TVOS_17_3 170300 + * } + */ + public static int __TVOS_17_3() { + return __TVOS_17_3; + } + private static final int __TVOS_17_4 = (int)170400L; + /** + * {@snippet lang=c : + * #define __TVOS_17_4 170400 + * } + */ + public static int __TVOS_17_4() { + return __TVOS_17_4; + } + private static final int __TVOS_17_5 = (int)170500L; + /** + * {@snippet lang=c : + * #define __TVOS_17_5 170500 + * } + */ + public static int __TVOS_17_5() { + return __TVOS_17_5; + } + private static final int __BRIDGEOS_2_0 = (int)20000L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_2_0 20000 + * } + */ + public static int __BRIDGEOS_2_0() { + return __BRIDGEOS_2_0; + } + private static final int __BRIDGEOS_3_0 = (int)30000L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_3_0 30000 + * } + */ + public static int __BRIDGEOS_3_0() { + return __BRIDGEOS_3_0; + } + private static final int __BRIDGEOS_3_1 = (int)30100L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_3_1 30100 + * } + */ + public static int __BRIDGEOS_3_1() { + return __BRIDGEOS_3_1; + } + private static final int __BRIDGEOS_3_4 = (int)30400L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_3_4 30400 + * } + */ + public static int __BRIDGEOS_3_4() { + return __BRIDGEOS_3_4; + } + private static final int __BRIDGEOS_4_0 = (int)40000L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_4_0 40000 + * } + */ + public static int __BRIDGEOS_4_0() { + return __BRIDGEOS_4_0; + } + private static final int __BRIDGEOS_4_1 = (int)40100L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_4_1 40100 + * } + */ + public static int __BRIDGEOS_4_1() { + return __BRIDGEOS_4_1; + } + private static final int __BRIDGEOS_5_0 = (int)50000L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_5_0 50000 + * } + */ + public static int __BRIDGEOS_5_0() { + return __BRIDGEOS_5_0; + } + private static final int __BRIDGEOS_5_1 = (int)50100L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_5_1 50100 + * } + */ + public static int __BRIDGEOS_5_1() { + return __BRIDGEOS_5_1; + } + private static final int __BRIDGEOS_5_3 = (int)50300L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_5_3 50300 + * } + */ + public static int __BRIDGEOS_5_3() { + return __BRIDGEOS_5_3; + } + private static final int __BRIDGEOS_6_0 = (int)60000L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_6_0 60000 + * } + */ + public static int __BRIDGEOS_6_0() { + return __BRIDGEOS_6_0; + } + private static final int __BRIDGEOS_6_2 = (int)60200L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_6_2 60200 + * } + */ + public static int __BRIDGEOS_6_2() { + return __BRIDGEOS_6_2; + } + private static final int __BRIDGEOS_6_4 = (int)60400L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_6_4 60400 + * } + */ + public static int __BRIDGEOS_6_4() { + return __BRIDGEOS_6_4; + } + private static final int __BRIDGEOS_6_5 = (int)60500L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_6_5 60500 + * } + */ + public static int __BRIDGEOS_6_5() { + return __BRIDGEOS_6_5; + } + private static final int __BRIDGEOS_6_6 = (int)60600L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_6_6 60600 + * } + */ + public static int __BRIDGEOS_6_6() { + return __BRIDGEOS_6_6; + } + private static final int __BRIDGEOS_7_0 = (int)70000L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_7_0 70000 + * } + */ + public static int __BRIDGEOS_7_0() { + return __BRIDGEOS_7_0; + } + private static final int __BRIDGEOS_7_1 = (int)70100L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_7_1 70100 + * } + */ + public static int __BRIDGEOS_7_1() { + return __BRIDGEOS_7_1; + } + private static final int __BRIDGEOS_7_2 = (int)70200L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_7_2 70200 + * } + */ + public static int __BRIDGEOS_7_2() { + return __BRIDGEOS_7_2; + } + private static final int __BRIDGEOS_7_3 = (int)70300L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_7_3 70300 + * } + */ + public static int __BRIDGEOS_7_3() { + return __BRIDGEOS_7_3; + } + private static final int __BRIDGEOS_7_4 = (int)70400L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_7_4 70400 + * } + */ + public static int __BRIDGEOS_7_4() { + return __BRIDGEOS_7_4; + } + private static final int __BRIDGEOS_7_6 = (int)70600L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_7_6 70600 + * } + */ + public static int __BRIDGEOS_7_6() { + return __BRIDGEOS_7_6; + } + private static final int __BRIDGEOS_8_0 = (int)80000L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_8_0 80000 + * } + */ + public static int __BRIDGEOS_8_0() { + return __BRIDGEOS_8_0; + } + private static final int __BRIDGEOS_8_1 = (int)80100L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_8_1 80100 + * } + */ + public static int __BRIDGEOS_8_1() { + return __BRIDGEOS_8_1; + } + private static final int __BRIDGEOS_8_2 = (int)80200L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_8_2 80200 + * } + */ + public static int __BRIDGEOS_8_2() { + return __BRIDGEOS_8_2; + } + private static final int __BRIDGEOS_8_3 = (int)80300L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_8_3 80300 + * } + */ + public static int __BRIDGEOS_8_3() { + return __BRIDGEOS_8_3; + } + private static final int __BRIDGEOS_8_4 = (int)80400L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_8_4 80400 + * } + */ + public static int __BRIDGEOS_8_4() { + return __BRIDGEOS_8_4; + } + private static final int __BRIDGEOS_8_5 = (int)80500L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_8_5 80500 + * } + */ + public static int __BRIDGEOS_8_5() { + return __BRIDGEOS_8_5; + } + private static final int __DRIVERKIT_19_0 = (int)190000L; + /** + * {@snippet lang=c : + * #define __DRIVERKIT_19_0 190000 + * } + */ + public static int __DRIVERKIT_19_0() { + return __DRIVERKIT_19_0; + } + private static final int __DRIVERKIT_20_0 = (int)200000L; + /** + * {@snippet lang=c : + * #define __DRIVERKIT_20_0 200000 + * } + */ + public static int __DRIVERKIT_20_0() { + return __DRIVERKIT_20_0; + } + private static final int __DRIVERKIT_21_0 = (int)210000L; + /** + * {@snippet lang=c : + * #define __DRIVERKIT_21_0 210000 + * } + */ + public static int __DRIVERKIT_21_0() { + return __DRIVERKIT_21_0; + } + private static final int __DRIVERKIT_22_0 = (int)220000L; + /** + * {@snippet lang=c : + * #define __DRIVERKIT_22_0 220000 + * } + */ + public static int __DRIVERKIT_22_0() { + return __DRIVERKIT_22_0; + } + private static final int __DRIVERKIT_22_4 = (int)220400L; + /** + * {@snippet lang=c : + * #define __DRIVERKIT_22_4 220400 + * } + */ + public static int __DRIVERKIT_22_4() { + return __DRIVERKIT_22_4; + } + private static final int __DRIVERKIT_22_5 = (int)220500L; + /** + * {@snippet lang=c : + * #define __DRIVERKIT_22_5 220500 + * } + */ + public static int __DRIVERKIT_22_5() { + return __DRIVERKIT_22_5; + } + private static final int __DRIVERKIT_22_6 = (int)220600L; + /** + * {@snippet lang=c : + * #define __DRIVERKIT_22_6 220600 + * } + */ + public static int __DRIVERKIT_22_6() { + return __DRIVERKIT_22_6; + } + private static final int __DRIVERKIT_23_0 = (int)230000L; + /** + * {@snippet lang=c : + * #define __DRIVERKIT_23_0 230000 + * } + */ + public static int __DRIVERKIT_23_0() { + return __DRIVERKIT_23_0; + } + private static final int __DRIVERKIT_23_1 = (int)230100L; + /** + * {@snippet lang=c : + * #define __DRIVERKIT_23_1 230100 + * } + */ + public static int __DRIVERKIT_23_1() { + return __DRIVERKIT_23_1; + } + private static final int __DRIVERKIT_23_2 = (int)230200L; + /** + * {@snippet lang=c : + * #define __DRIVERKIT_23_2 230200 + * } + */ + public static int __DRIVERKIT_23_2() { + return __DRIVERKIT_23_2; + } + private static final int __DRIVERKIT_23_3 = (int)230300L; + /** + * {@snippet lang=c : + * #define __DRIVERKIT_23_3 230300 + * } + */ + public static int __DRIVERKIT_23_3() { + return __DRIVERKIT_23_3; + } + private static final int __DRIVERKIT_23_4 = (int)230400L; + /** + * {@snippet lang=c : + * #define __DRIVERKIT_23_4 230400 + * } + */ + public static int __DRIVERKIT_23_4() { + return __DRIVERKIT_23_4; + } + private static final int __DRIVERKIT_23_5 = (int)230500L; + /** + * {@snippet lang=c : + * #define __DRIVERKIT_23_5 230500 + * } + */ + public static int __DRIVERKIT_23_5() { + return __DRIVERKIT_23_5; + } + private static final int __VISIONOS_1_0 = (int)10000L; + /** + * {@snippet lang=c : + * #define __VISIONOS_1_0 10000 + * } + */ + public static int __VISIONOS_1_0() { + return __VISIONOS_1_0; + } + private static final int __VISIONOS_1_1 = (int)10100L; + /** + * {@snippet lang=c : + * #define __VISIONOS_1_1 10100 + * } + */ + public static int __VISIONOS_1_1() { + return __VISIONOS_1_1; + } + private static final int __VISIONOS_1_2 = (int)10200L; + /** + * {@snippet lang=c : + * #define __VISIONOS_1_2 10200 + * } + */ + public static int __VISIONOS_1_2() { + return __VISIONOS_1_2; + } + private static final int __ENABLE_LEGACY_MAC_AVAILABILITY = (int)1L; + /** + * {@snippet lang=c : + * #define __ENABLE_LEGACY_MAC_AVAILABILITY 1 + * } + */ + public static int __ENABLE_LEGACY_MAC_AVAILABILITY() { + return __ENABLE_LEGACY_MAC_AVAILABILITY; + } + private static final int __PTHREAD_SIZE__ = (int)8176L; + /** + * {@snippet lang=c : + * #define __PTHREAD_SIZE__ 8176 + * } + */ + public static int __PTHREAD_SIZE__() { + return __PTHREAD_SIZE__; + } + private static final int __PTHREAD_ATTR_SIZE__ = (int)56L; + /** + * {@snippet lang=c : + * #define __PTHREAD_ATTR_SIZE__ 56 + * } + */ + public static int __PTHREAD_ATTR_SIZE__() { + return __PTHREAD_ATTR_SIZE__; + } + private static final int __PTHREAD_MUTEXATTR_SIZE__ = (int)8L; + /** + * {@snippet lang=c : + * #define __PTHREAD_MUTEXATTR_SIZE__ 8 + * } + */ + public static int __PTHREAD_MUTEXATTR_SIZE__() { + return __PTHREAD_MUTEXATTR_SIZE__; + } + private static final int __PTHREAD_MUTEX_SIZE__ = (int)56L; + /** + * {@snippet lang=c : + * #define __PTHREAD_MUTEX_SIZE__ 56 + * } + */ + public static int __PTHREAD_MUTEX_SIZE__() { + return __PTHREAD_MUTEX_SIZE__; + } + private static final int __PTHREAD_CONDATTR_SIZE__ = (int)8L; + /** + * {@snippet lang=c : + * #define __PTHREAD_CONDATTR_SIZE__ 8 + * } + */ + public static int __PTHREAD_CONDATTR_SIZE__() { + return __PTHREAD_CONDATTR_SIZE__; + } + private static final int __PTHREAD_COND_SIZE__ = (int)40L; + /** + * {@snippet lang=c : + * #define __PTHREAD_COND_SIZE__ 40 + * } + */ + public static int __PTHREAD_COND_SIZE__() { + return __PTHREAD_COND_SIZE__; + } + private static final int __PTHREAD_ONCE_SIZE__ = (int)8L; + /** + * {@snippet lang=c : + * #define __PTHREAD_ONCE_SIZE__ 8 + * } + */ + public static int __PTHREAD_ONCE_SIZE__() { + return __PTHREAD_ONCE_SIZE__; + } + private static final int __PTHREAD_RWLOCK_SIZE__ = (int)192L; + /** + * {@snippet lang=c : + * #define __PTHREAD_RWLOCK_SIZE__ 192 + * } + */ + public static int __PTHREAD_RWLOCK_SIZE__() { + return __PTHREAD_RWLOCK_SIZE__; + } + private static final int __PTHREAD_RWLOCKATTR_SIZE__ = (int)16L; + /** + * {@snippet lang=c : + * #define __PTHREAD_RWLOCKATTR_SIZE__ 16 + * } + */ + public static int __PTHREAD_RWLOCKATTR_SIZE__() { + return __PTHREAD_RWLOCKATTR_SIZE__; + } + private static final int _FORTIFY_SOURCE = (int)2L; + /** + * {@snippet lang=c : + * #define _FORTIFY_SOURCE 2 + * } + */ + public static int _FORTIFY_SOURCE() { + return _FORTIFY_SOURCE; + } + private static final int RENAME_SECLUDE = (int)1L; + /** + * {@snippet lang=c : + * #define RENAME_SECLUDE 1 + * } + */ + public static int RENAME_SECLUDE() { + return RENAME_SECLUDE; + } + private static final int RENAME_SWAP = (int)2L; + /** + * {@snippet lang=c : + * #define RENAME_SWAP 2 + * } + */ + public static int RENAME_SWAP() { + return RENAME_SWAP; + } + private static final int RENAME_EXCL = (int)4L; + /** + * {@snippet lang=c : + * #define RENAME_EXCL 4 + * } + */ + public static int RENAME_EXCL() { + return RENAME_EXCL; + } + private static final int RENAME_RESERVED1 = (int)8L; + /** + * {@snippet lang=c : + * #define RENAME_RESERVED1 8 + * } + */ + public static int RENAME_RESERVED1() { + return RENAME_RESERVED1; + } + private static final int RENAME_NOFOLLOW_ANY = (int)16L; + /** + * {@snippet lang=c : + * #define RENAME_NOFOLLOW_ANY 16 + * } + */ + public static int RENAME_NOFOLLOW_ANY() { + return RENAME_NOFOLLOW_ANY; + } + private static final int SEEK_SET = (int)0L; + /** + * {@snippet lang=c : + * #define SEEK_SET 0 + * } + */ + public static int SEEK_SET() { + return SEEK_SET; + } + private static final int SEEK_CUR = (int)1L; + /** + * {@snippet lang=c : + * #define SEEK_CUR 1 + * } + */ + public static int SEEK_CUR() { + return SEEK_CUR; + } + private static final int SEEK_END = (int)2L; + /** + * {@snippet lang=c : + * #define SEEK_END 2 + * } + */ + public static int SEEK_END() { + return SEEK_END; + } + private static final int SEEK_HOLE = (int)3L; + /** + * {@snippet lang=c : + * #define SEEK_HOLE 3 + * } + */ + public static int SEEK_HOLE() { + return SEEK_HOLE; + } + private static final int SEEK_DATA = (int)4L; + /** + * {@snippet lang=c : + * #define SEEK_DATA 4 + * } + */ + public static int SEEK_DATA() { + return SEEK_DATA; + } + private static final int __SLBF = (int)1L; + /** + * {@snippet lang=c : + * #define __SLBF 1 + * } + */ + public static int __SLBF() { + return __SLBF; + } + private static final int __SNBF = (int)2L; + /** + * {@snippet lang=c : + * #define __SNBF 2 + * } + */ + public static int __SNBF() { + return __SNBF; + } + private static final int __SRD = (int)4L; + /** + * {@snippet lang=c : + * #define __SRD 4 + * } + */ + public static int __SRD() { + return __SRD; + } + private static final int __SWR = (int)8L; + /** + * {@snippet lang=c : + * #define __SWR 8 + * } + */ + public static int __SWR() { + return __SWR; + } + private static final int __SRW = (int)16L; + /** + * {@snippet lang=c : + * #define __SRW 16 + * } + */ + public static int __SRW() { + return __SRW; + } + private static final int __SEOF = (int)32L; + /** + * {@snippet lang=c : + * #define __SEOF 32 + * } + */ + public static int __SEOF() { + return __SEOF; + } + private static final int __SERR = (int)64L; + /** + * {@snippet lang=c : + * #define __SERR 64 + * } + */ + public static int __SERR() { + return __SERR; + } + private static final int __SMBF = (int)128L; + /** + * {@snippet lang=c : + * #define __SMBF 128 + * } + */ + public static int __SMBF() { + return __SMBF; + } + private static final int __SAPP = (int)256L; + /** + * {@snippet lang=c : + * #define __SAPP 256 + * } + */ + public static int __SAPP() { + return __SAPP; + } + private static final int __SSTR = (int)512L; + /** + * {@snippet lang=c : + * #define __SSTR 512 + * } + */ + public static int __SSTR() { + return __SSTR; + } + private static final int __SOPT = (int)1024L; + /** + * {@snippet lang=c : + * #define __SOPT 1024 + * } + */ + public static int __SOPT() { + return __SOPT; + } + private static final int __SNPT = (int)2048L; + /** + * {@snippet lang=c : + * #define __SNPT 2048 + * } + */ + public static int __SNPT() { + return __SNPT; + } + private static final int __SOFF = (int)4096L; + /** + * {@snippet lang=c : + * #define __SOFF 4096 + * } + */ + public static int __SOFF() { + return __SOFF; + } + private static final int __SMOD = (int)8192L; + /** + * {@snippet lang=c : + * #define __SMOD 8192 + * } + */ + public static int __SMOD() { + return __SMOD; + } + private static final int __SALC = (int)16384L; + /** + * {@snippet lang=c : + * #define __SALC 16384 + * } + */ + public static int __SALC() { + return __SALC; + } + private static final int __SIGN = (int)32768L; + /** + * {@snippet lang=c : + * #define __SIGN 32768 + * } + */ + public static int __SIGN() { + return __SIGN; + } + private static final int _IOFBF = (int)0L; + /** + * {@snippet lang=c : + * #define _IOFBF 0 + * } + */ + public static int _IOFBF() { + return _IOFBF; + } + private static final int _IOLBF = (int)1L; + /** + * {@snippet lang=c : + * #define _IOLBF 1 + * } + */ + public static int _IOLBF() { + return _IOLBF; + } + private static final int _IONBF = (int)2L; + /** + * {@snippet lang=c : + * #define _IONBF 2 + * } + */ + public static int _IONBF() { + return _IONBF; + } + private static final int BUFSIZ = (int)1024L; + /** + * {@snippet lang=c : + * #define BUFSIZ 1024 + * } + */ + public static int BUFSIZ() { + return BUFSIZ; + } + private static final int FOPEN_MAX = (int)20L; + /** + * {@snippet lang=c : + * #define FOPEN_MAX 20 + * } + */ + public static int FOPEN_MAX() { + return FOPEN_MAX; + } + private static final int FILENAME_MAX = (int)1024L; + /** + * {@snippet lang=c : + * #define FILENAME_MAX 1024 + * } + */ + public static int FILENAME_MAX() { + return FILENAME_MAX; + } + private static final int L_tmpnam = (int)1024L; + /** + * {@snippet lang=c : + * #define L_tmpnam 1024 + * } + */ + public static int L_tmpnam() { + return L_tmpnam; + } + private static final int TMP_MAX = (int)308915776L; + /** + * {@snippet lang=c : + * #define TMP_MAX 308915776 + * } + */ + public static int TMP_MAX() { + return TMP_MAX; + } + private static final int L_ctermid = (int)1024L; + /** + * {@snippet lang=c : + * #define L_ctermid 1024 + * } + */ + public static int L_ctermid() { + return L_ctermid; + } + private static final int _USE_FORTIFY_LEVEL = (int)2L; + /** + * {@snippet lang=c : + * #define _USE_FORTIFY_LEVEL 2 + * } + */ + public static int _USE_FORTIFY_LEVEL() { + return _USE_FORTIFY_LEVEL; + } + private static final int __WORDSIZE = (int)64L; + /** + * {@snippet lang=c : + * #define __WORDSIZE 64 + * } + */ + public static int __WORDSIZE() { + return __WORDSIZE; + } + private static final int INT8_MAX = (int)127L; + /** + * {@snippet lang=c : + * #define INT8_MAX 127 + * } + */ + public static int INT8_MAX() { + return INT8_MAX; + } + private static final int INT16_MAX = (int)32767L; + /** + * {@snippet lang=c : + * #define INT16_MAX 32767 + * } + */ + public static int INT16_MAX() { + return INT16_MAX; + } + private static final int INT32_MAX = (int)2147483647L; + /** + * {@snippet lang=c : + * #define INT32_MAX 2147483647 + * } + */ + public static int INT32_MAX() { + return INT32_MAX; + } + private static final int UINT8_MAX = (int)255L; + /** + * {@snippet lang=c : + * #define UINT8_MAX 255 + * } + */ + public static int UINT8_MAX() { + return UINT8_MAX; + } + private static final int UINT16_MAX = (int)65535L; + /** + * {@snippet lang=c : + * #define UINT16_MAX 65535 + * } + */ + public static int UINT16_MAX() { + return UINT16_MAX; + } + private static final int true_ = (int)1L; + /** + * {@snippet lang=c : + * #define true 1 + * } + */ + public static int true_() { + return true_; + } + private static final int false_ = (int)0L; + /** + * {@snippet lang=c : + * #define false 0 + * } + */ + public static int false_() { + return false_; + } + private static final int __bool_true_false_are_defined = (int)1L; + /** + * {@snippet lang=c : + * #define __bool_true_false_are_defined 1 + * } + */ + public static int __bool_true_false_are_defined() { + return __bool_true_false_are_defined; + } + private static final int _QUAD_HIGHWORD = (int)1L; + /** + * {@snippet lang=c : + * #define _QUAD_HIGHWORD 1 + * } + */ + public static int _QUAD_HIGHWORD() { + return _QUAD_HIGHWORD; + } + private static final int _QUAD_LOWWORD = (int)0L; + /** + * {@snippet lang=c : + * #define _QUAD_LOWWORD 0 + * } + */ + public static int _QUAD_LOWWORD() { + return _QUAD_LOWWORD; + } + private static final int __DARWIN_LITTLE_ENDIAN = (int)1234L; + /** + * {@snippet lang=c : + * #define __DARWIN_LITTLE_ENDIAN 1234 + * } + */ + public static int __DARWIN_LITTLE_ENDIAN() { + return __DARWIN_LITTLE_ENDIAN; + } + private static final int __DARWIN_BIG_ENDIAN = (int)4321L; + /** + * {@snippet lang=c : + * #define __DARWIN_BIG_ENDIAN 4321 + * } + */ + public static int __DARWIN_BIG_ENDIAN() { + return __DARWIN_BIG_ENDIAN; + } + private static final int __DARWIN_PDP_ENDIAN = (int)3412L; + /** + * {@snippet lang=c : + * #define __DARWIN_PDP_ENDIAN 3412 + * } + */ + public static int __DARWIN_PDP_ENDIAN() { + return __DARWIN_PDP_ENDIAN; + } + private static final int __DARWIN_FD_SETSIZE = (int)1024L; + /** + * {@snippet lang=c : + * #define __DARWIN_FD_SETSIZE 1024 + * } + */ + public static int __DARWIN_FD_SETSIZE() { + return __DARWIN_FD_SETSIZE; + } + private static final int __DARWIN_NBBY = (int)8L; + /** + * {@snippet lang=c : + * #define __DARWIN_NBBY 8 + * } + */ + public static int __DARWIN_NBBY() { + return __DARWIN_NBBY; + } + /** + * {@snippet lang=c : + * typedef signed char __int8_t + * } + */ + public static final OfByte __int8_t = somelib_h.C_CHAR; + /** + * {@snippet lang=c : + * typedef unsigned char __uint8_t + * } + */ + public static final OfByte __uint8_t = somelib_h.C_CHAR; + /** + * {@snippet lang=c : + * typedef short __int16_t + * } + */ + public static final OfShort __int16_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef unsigned short __uint16_t + * } + */ + public static final OfShort __uint16_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef int __int32_t + * } + */ + public static final OfInt __int32_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef unsigned int __uint32_t + * } + */ + public static final OfInt __uint32_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef long long __int64_t + * } + */ + public static final OfLong __int64_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef unsigned long long __uint64_t + * } + */ + public static final OfLong __uint64_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef long __darwin_intptr_t + * } + */ + public static final OfLong __darwin_intptr_t = somelib_h.C_LONG; + /** + * {@snippet lang=c : + * typedef unsigned int __darwin_natural_t + * } + */ + public static final OfInt __darwin_natural_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef int __darwin_ct_rune_t + * } + */ + public static final OfInt __darwin_ct_rune_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef long __darwin_ptrdiff_t + * } + */ + public static final OfLong __darwin_ptrdiff_t = somelib_h.C_LONG; + /** + * {@snippet lang=c : + * typedef unsigned long __darwin_size_t + * } + */ + public static final OfLong __darwin_size_t = somelib_h.C_LONG; + /** + * {@snippet lang=c : + * typedef __builtin_va_list __darwin_va_list + * } + */ + public static final AddressLayout __darwin_va_list = somelib_h.C_POINTER; + /** + * {@snippet lang=c : + * typedef int __darwin_wchar_t + * } + */ + public static final OfInt __darwin_wchar_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef __darwin_wchar_t __darwin_rune_t + * } + */ + public static final OfInt __darwin_rune_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef int __darwin_wint_t + * } + */ + public static final OfInt __darwin_wint_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef unsigned long __darwin_clock_t + * } + */ + public static final OfLong __darwin_clock_t = somelib_h.C_LONG; + /** + * {@snippet lang=c : + * typedef __uint32_t __darwin_socklen_t + * } + */ + public static final OfInt __darwin_socklen_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef long __darwin_ssize_t + * } + */ + public static final OfLong __darwin_ssize_t = somelib_h.C_LONG; + /** + * {@snippet lang=c : + * typedef long __darwin_time_t + * } + */ + public static final OfLong __darwin_time_t = somelib_h.C_LONG; + /** + * {@snippet lang=c : + * typedef __int64_t __darwin_blkcnt_t + * } + */ + public static final OfLong __darwin_blkcnt_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef __int32_t __darwin_blksize_t + * } + */ + public static final OfInt __darwin_blksize_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef __int32_t __darwin_dev_t + * } + */ + public static final OfInt __darwin_dev_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef unsigned int __darwin_fsblkcnt_t + * } + */ + public static final OfInt __darwin_fsblkcnt_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef unsigned int __darwin_fsfilcnt_t + * } + */ + public static final OfInt __darwin_fsfilcnt_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef __uint32_t __darwin_gid_t + * } + */ + public static final OfInt __darwin_gid_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef __uint32_t __darwin_id_t + * } + */ + public static final OfInt __darwin_id_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef __uint64_t __darwin_ino64_t + * } + */ + public static final OfLong __darwin_ino64_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef __darwin_ino64_t __darwin_ino_t + * } + */ + public static final OfLong __darwin_ino_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef __darwin_natural_t __darwin_mach_port_name_t + * } + */ + public static final OfInt __darwin_mach_port_name_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef __darwin_mach_port_name_t __darwin_mach_port_t + * } + */ + public static final OfInt __darwin_mach_port_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef __uint16_t __darwin_mode_t + * } + */ + public static final OfShort __darwin_mode_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef __int64_t __darwin_off_t + * } + */ + public static final OfLong __darwin_off_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef __int32_t __darwin_pid_t + * } + */ + public static final OfInt __darwin_pid_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef __uint32_t __darwin_sigset_t + * } + */ + public static final OfInt __darwin_sigset_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef __int32_t __darwin_suseconds_t + * } + */ + public static final OfInt __darwin_suseconds_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef __uint32_t __darwin_uid_t + * } + */ + public static final OfInt __darwin_uid_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef __uint32_t __darwin_useconds_t + * } + */ + public static final OfInt __darwin_useconds_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef unsigned long __darwin_pthread_key_t + * } + */ + public static final OfLong __darwin_pthread_key_t = somelib_h.C_LONG; + /** + * {@snippet lang=c : + * typedef struct _opaque_pthread_t { + * long __sig; + * struct __darwin_pthread_handler_rec *__cleanup_stack; + * char __opaque[8176]; + * } *__darwin_pthread_t + * } + */ + public static final AddressLayout __darwin_pthread_t = somelib_h.C_POINTER; + /** + * {@snippet lang=c : + * typedef int __darwin_nl_item + * } + */ + public static final OfInt __darwin_nl_item = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef int __darwin_wctrans_t + * } + */ + public static final OfInt __darwin_wctrans_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef __uint32_t __darwin_wctype_t + * } + */ + public static final OfInt __darwin_wctype_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef signed char int8_t + * } + */ + public static final OfByte int8_t = somelib_h.C_CHAR; + /** + * {@snippet lang=c : + * typedef short int16_t + * } + */ + public static final OfShort int16_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef int int32_t + * } + */ + public static final OfInt int32_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef long long int64_t + * } + */ + public static final OfLong int64_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef unsigned char u_int8_t + * } + */ + public static final OfByte u_int8_t = somelib_h.C_CHAR; + /** + * {@snippet lang=c : + * typedef unsigned short u_int16_t + * } + */ + public static final OfShort u_int16_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef unsigned int u_int32_t + * } + */ + public static final OfInt u_int32_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef unsigned long long u_int64_t + * } + */ + public static final OfLong u_int64_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef int64_t register_t + * } + */ + public static final OfLong register_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef __darwin_intptr_t intptr_t + * } + */ + public static final OfLong intptr_t = somelib_h.C_LONG; + /** + * {@snippet lang=c : + * typedef unsigned long uintptr_t + * } + */ + public static final OfLong uintptr_t = somelib_h.C_LONG; + /** + * {@snippet lang=c : + * typedef u_int64_t user_addr_t + * } + */ + public static final OfLong user_addr_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef u_int64_t user_size_t + * } + */ + public static final OfLong user_size_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef int64_t user_ssize_t + * } + */ + public static final OfLong user_ssize_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef int64_t user_long_t + * } + */ + public static final OfLong user_long_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef u_int64_t user_ulong_t + * } + */ + public static final OfLong user_ulong_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef int64_t user_time_t + * } + */ + public static final OfLong user_time_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef int64_t user_off_t + * } + */ + public static final OfLong user_off_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef u_int64_t syscall_arg_t + * } + */ + public static final OfLong syscall_arg_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef __darwin_va_list va_list + * } + */ + public static final AddressLayout va_list = somelib_h.C_POINTER; + /** + * {@snippet lang=c : + * typedef __darwin_size_t size_t + * } + */ + public static final OfLong size_t = somelib_h.C_LONG; + + private static class renameat { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("renameat"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int renameat(int, const char *, int, const char *) + * } + */ + public static FunctionDescriptor renameat$descriptor() { + return renameat.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int renameat(int, const char *, int, const char *) + * } + */ + public static MethodHandle renameat$handle() { + return renameat.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int renameat(int, const char *, int, const char *) + * } + */ + public static MemorySegment renameat$address() { + return renameat.ADDR; + } + + /** + * {@snippet lang=c : + * int renameat(int, const char *, int, const char *) + * } + */ + public static int renameat(int x0, MemorySegment x1, int x2, MemorySegment x3) { + var mh$ = renameat.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("renameat", x0, x1, x2, x3); + } + return (int)mh$.invokeExact(x0, x1, x2, x3); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class renamex_np { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_INT + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("renamex_np"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int renamex_np(const char *, const char *, unsigned int) + * } + */ + public static FunctionDescriptor renamex_np$descriptor() { + return renamex_np.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int renamex_np(const char *, const char *, unsigned int) + * } + */ + public static MethodHandle renamex_np$handle() { + return renamex_np.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int renamex_np(const char *, const char *, unsigned int) + * } + */ + public static MemorySegment renamex_np$address() { + return renamex_np.ADDR; + } + + /** + * {@snippet lang=c : + * int renamex_np(const char *, const char *, unsigned int) + * } + */ + public static int renamex_np(MemorySegment x0, MemorySegment x1, int x2) { + var mh$ = renamex_np.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("renamex_np", x0, x1, x2); + } + return (int)mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class renameatx_np { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_INT + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("renameatx_np"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int renameatx_np(int, const char *, int, const char *, unsigned int) + * } + */ + public static FunctionDescriptor renameatx_np$descriptor() { + return renameatx_np.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int renameatx_np(int, const char *, int, const char *, unsigned int) + * } + */ + public static MethodHandle renameatx_np$handle() { + return renameatx_np.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int renameatx_np(int, const char *, int, const char *, unsigned int) + * } + */ + public static MemorySegment renameatx_np$address() { + return renameatx_np.ADDR; + } + + /** + * {@snippet lang=c : + * int renameatx_np(int, const char *, int, const char *, unsigned int) + * } + */ + public static int renameatx_np(int x0, MemorySegment x1, int x2, MemorySegment x3, int x4) { + var mh$ = renameatx_np.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("renameatx_np", x0, x1, x2, x3, x4); + } + return (int)mh$.invokeExact(x0, x1, x2, x3, x4); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + /** + * {@snippet lang=c : + * typedef __darwin_off_t fpos_t + * } + */ + public static final OfLong fpos_t = somelib_h.C_LONG_LONG; + + private static class __stdinp$constants { + public static final AddressLayout LAYOUT = somelib_h.C_POINTER; + public static final MemorySegment SEGMENT = somelib_h.findOrThrow("__stdinp").reinterpret(LAYOUT.byteSize()); + } + + /** + * Layout for variable: + * {@snippet lang=c : + * extern FILE *__stdinp + * } + */ + public static AddressLayout __stdinp$layout() { + return __stdinp$constants.LAYOUT; + } + + /** + * Segment for variable: + * {@snippet lang=c : + * extern FILE *__stdinp + * } + */ + public static MemorySegment __stdinp$segment() { + return __stdinp$constants.SEGMENT; + } + + /** + * Getter for variable: + * {@snippet lang=c : + * extern FILE *__stdinp + * } + */ + public static MemorySegment __stdinp() { + return __stdinp$constants.SEGMENT.get(__stdinp$constants.LAYOUT, 0L); + } + + /** + * Setter for variable: + * {@snippet lang=c : + * extern FILE *__stdinp + * } + */ + public static void __stdinp(MemorySegment varValue) { + __stdinp$constants.SEGMENT.set(__stdinp$constants.LAYOUT, 0L, varValue); + } + + private static class __stdoutp$constants { + public static final AddressLayout LAYOUT = somelib_h.C_POINTER; + public static final MemorySegment SEGMENT = somelib_h.findOrThrow("__stdoutp").reinterpret(LAYOUT.byteSize()); + } + + /** + * Layout for variable: + * {@snippet lang=c : + * extern FILE *__stdoutp + * } + */ + public static AddressLayout __stdoutp$layout() { + return __stdoutp$constants.LAYOUT; + } + + /** + * Segment for variable: + * {@snippet lang=c : + * extern FILE *__stdoutp + * } + */ + public static MemorySegment __stdoutp$segment() { + return __stdoutp$constants.SEGMENT; + } + + /** + * Getter for variable: + * {@snippet lang=c : + * extern FILE *__stdoutp + * } + */ + public static MemorySegment __stdoutp() { + return __stdoutp$constants.SEGMENT.get(__stdoutp$constants.LAYOUT, 0L); + } + + /** + * Setter for variable: + * {@snippet lang=c : + * extern FILE *__stdoutp + * } + */ + public static void __stdoutp(MemorySegment varValue) { + __stdoutp$constants.SEGMENT.set(__stdoutp$constants.LAYOUT, 0L, varValue); + } + + private static class __stderrp$constants { + public static final AddressLayout LAYOUT = somelib_h.C_POINTER; + public static final MemorySegment SEGMENT = somelib_h.findOrThrow("__stderrp").reinterpret(LAYOUT.byteSize()); + } + + /** + * Layout for variable: + * {@snippet lang=c : + * extern FILE *__stderrp + * } + */ + public static AddressLayout __stderrp$layout() { + return __stderrp$constants.LAYOUT; + } + + /** + * Segment for variable: + * {@snippet lang=c : + * extern FILE *__stderrp + * } + */ + public static MemorySegment __stderrp$segment() { + return __stderrp$constants.SEGMENT; + } + + /** + * Getter for variable: + * {@snippet lang=c : + * extern FILE *__stderrp + * } + */ + public static MemorySegment __stderrp() { + return __stderrp$constants.SEGMENT.get(__stderrp$constants.LAYOUT, 0L); + } + + /** + * Setter for variable: + * {@snippet lang=c : + * extern FILE *__stderrp + * } + */ + public static void __stderrp(MemorySegment varValue) { + __stderrp$constants.SEGMENT.set(__stderrp$constants.LAYOUT, 0L, varValue); + } + + private static class clearerr { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("clearerr"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void clearerr(FILE *) + * } + */ + public static FunctionDescriptor clearerr$descriptor() { + return clearerr.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void clearerr(FILE *) + * } + */ + public static MethodHandle clearerr$handle() { + return clearerr.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void clearerr(FILE *) + * } + */ + public static MemorySegment clearerr$address() { + return clearerr.ADDR; + } + + /** + * {@snippet lang=c : + * void clearerr(FILE *) + * } + */ + public static void clearerr(MemorySegment x0) { + var mh$ = clearerr.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("clearerr", x0); + } + mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class fclose { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("fclose"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int fclose(FILE *) + * } + */ + public static FunctionDescriptor fclose$descriptor() { + return fclose.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int fclose(FILE *) + * } + */ + public static MethodHandle fclose$handle() { + return fclose.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int fclose(FILE *) + * } + */ + public static MemorySegment fclose$address() { + return fclose.ADDR; + } + + /** + * {@snippet lang=c : + * int fclose(FILE *) + * } + */ + public static int fclose(MemorySegment x0) { + var mh$ = fclose.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fclose", x0); + } + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class feof { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("feof"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int feof(FILE *) + * } + */ + public static FunctionDescriptor feof$descriptor() { + return feof.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int feof(FILE *) + * } + */ + public static MethodHandle feof$handle() { + return feof.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int feof(FILE *) + * } + */ + public static MemorySegment feof$address() { + return feof.ADDR; + } + + /** + * {@snippet lang=c : + * int feof(FILE *) + * } + */ + public static int feof(MemorySegment x0) { + var mh$ = feof.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("feof", x0); + } + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class ferror { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("ferror"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int ferror(FILE *) + * } + */ + public static FunctionDescriptor ferror$descriptor() { + return ferror.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int ferror(FILE *) + * } + */ + public static MethodHandle ferror$handle() { + return ferror.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int ferror(FILE *) + * } + */ + public static MemorySegment ferror$address() { + return ferror.ADDR; + } + + /** + * {@snippet lang=c : + * int ferror(FILE *) + * } + */ + public static int ferror(MemorySegment x0) { + var mh$ = ferror.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("ferror", x0); + } + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class fflush { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("fflush"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int fflush(FILE *) + * } + */ + public static FunctionDescriptor fflush$descriptor() { + return fflush.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int fflush(FILE *) + * } + */ + public static MethodHandle fflush$handle() { + return fflush.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int fflush(FILE *) + * } + */ + public static MemorySegment fflush$address() { + return fflush.ADDR; + } + + /** + * {@snippet lang=c : + * int fflush(FILE *) + * } + */ + public static int fflush(MemorySegment x0) { + var mh$ = fflush.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fflush", x0); + } + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class fgetc { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("fgetc"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int fgetc(FILE *) + * } + */ + public static FunctionDescriptor fgetc$descriptor() { + return fgetc.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int fgetc(FILE *) + * } + */ + public static MethodHandle fgetc$handle() { + return fgetc.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int fgetc(FILE *) + * } + */ + public static MemorySegment fgetc$address() { + return fgetc.ADDR; + } + + /** + * {@snippet lang=c : + * int fgetc(FILE *) + * } + */ + public static int fgetc(MemorySegment x0) { + var mh$ = fgetc.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fgetc", x0); + } + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class fgetpos { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("fgetpos"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int fgetpos(FILE *restrict, fpos_t *) + * } + */ + public static FunctionDescriptor fgetpos$descriptor() { + return fgetpos.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int fgetpos(FILE *restrict, fpos_t *) + * } + */ + public static MethodHandle fgetpos$handle() { + return fgetpos.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int fgetpos(FILE *restrict, fpos_t *) + * } + */ + public static MemorySegment fgetpos$address() { + return fgetpos.ADDR; + } + + /** + * {@snippet lang=c : + * int fgetpos(FILE *restrict, fpos_t *) + * } + */ + public static int fgetpos(MemorySegment x0, MemorySegment x1) { + var mh$ = fgetpos.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fgetpos", x0, x1); + } + return (int)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class fgets { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("fgets"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * char *fgets(char *restrict, int, FILE *) + * } + */ + public static FunctionDescriptor fgets$descriptor() { + return fgets.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * char *fgets(char *restrict, int, FILE *) + * } + */ + public static MethodHandle fgets$handle() { + return fgets.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * char *fgets(char *restrict, int, FILE *) + * } + */ + public static MemorySegment fgets$address() { + return fgets.ADDR; + } + + /** + * {@snippet lang=c : + * char *fgets(char *restrict, int, FILE *) + * } + */ + public static MemorySegment fgets(MemorySegment x0, int x1, MemorySegment x2) { + var mh$ = fgets.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fgets", x0, x1, x2); + } + return (MemorySegment)mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class fopen { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("fopen"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * FILE *fopen(const char *restrict __filename, const char *restrict __mode) + * } + */ + public static FunctionDescriptor fopen$descriptor() { + return fopen.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * FILE *fopen(const char *restrict __filename, const char *restrict __mode) + * } + */ + public static MethodHandle fopen$handle() { + return fopen.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * FILE *fopen(const char *restrict __filename, const char *restrict __mode) + * } + */ + public static MemorySegment fopen$address() { + return fopen.ADDR; + } + + /** + * {@snippet lang=c : + * FILE *fopen(const char *restrict __filename, const char *restrict __mode) + * } + */ + public static MemorySegment fopen(MemorySegment __filename, MemorySegment __mode) { + var mh$ = fopen.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fopen", __filename, __mode); + } + return (MemorySegment)mh$.invokeExact(__filename, __mode); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + /** + * Variadic invoker class for: + * {@snippet lang=c : + * int fprintf(FILE *restrict, const char *restrict, ...) + * } + */ + public static class fprintf { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("fprintf"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private fprintf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * int fprintf(FILE *restrict, const char *restrict, ...) + * } + */ + public static fprintf makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new fprintf(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public int apply(MemorySegment x0, MemorySegment x1, Object... x2) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fprintf", x0, x1, x2); + } + return (int)spreader.invokeExact(x0, x1, x2); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static class fputc { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("fputc"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int fputc(int, FILE *) + * } + */ + public static FunctionDescriptor fputc$descriptor() { + return fputc.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int fputc(int, FILE *) + * } + */ + public static MethodHandle fputc$handle() { + return fputc.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int fputc(int, FILE *) + * } + */ + public static MemorySegment fputc$address() { + return fputc.ADDR; + } + + /** + * {@snippet lang=c : + * int fputc(int, FILE *) + * } + */ + public static int fputc(int x0, MemorySegment x1) { + var mh$ = fputc.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fputc", x0, x1); + } + return (int)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class fputs { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("fputs"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int fputs(const char *restrict, FILE *restrict) + * } + */ + public static FunctionDescriptor fputs$descriptor() { + return fputs.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int fputs(const char *restrict, FILE *restrict) + * } + */ + public static MethodHandle fputs$handle() { + return fputs.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int fputs(const char *restrict, FILE *restrict) + * } + */ + public static MemorySegment fputs$address() { + return fputs.ADDR; + } + + /** + * {@snippet lang=c : + * int fputs(const char *restrict, FILE *restrict) + * } + */ + public static int fputs(MemorySegment x0, MemorySegment x1) { + var mh$ = fputs.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fputs", x0, x1); + } + return (int)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class fread { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_LONG, + somelib_h.C_POINTER, + somelib_h.C_LONG, + somelib_h.C_LONG, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("fread"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * unsigned long fread(void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) + * } + */ + public static FunctionDescriptor fread$descriptor() { + return fread.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * unsigned long fread(void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) + * } + */ + public static MethodHandle fread$handle() { + return fread.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * unsigned long fread(void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) + * } + */ + public static MemorySegment fread$address() { + return fread.ADDR; + } + + /** + * {@snippet lang=c : + * unsigned long fread(void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) + * } + */ + public static long fread(MemorySegment __ptr, long __size, long __nitems, MemorySegment __stream) { + var mh$ = fread.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fread", __ptr, __size, __nitems, __stream); + } + return (long)mh$.invokeExact(__ptr, __size, __nitems, __stream); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class freopen { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("freopen"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * FILE *freopen(const char *restrict, const char *restrict, FILE *restrict) + * } + */ + public static FunctionDescriptor freopen$descriptor() { + return freopen.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * FILE *freopen(const char *restrict, const char *restrict, FILE *restrict) + * } + */ + public static MethodHandle freopen$handle() { + return freopen.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * FILE *freopen(const char *restrict, const char *restrict, FILE *restrict) + * } + */ + public static MemorySegment freopen$address() { + return freopen.ADDR; + } + + /** + * {@snippet lang=c : + * FILE *freopen(const char *restrict, const char *restrict, FILE *restrict) + * } + */ + public static MemorySegment freopen(MemorySegment x0, MemorySegment x1, MemorySegment x2) { + var mh$ = freopen.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("freopen", x0, x1, x2); + } + return (MemorySegment)mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + /** + * Variadic invoker class for: + * {@snippet lang=c : + * int fscanf(FILE *restrict, const char *restrict, ...) + * } + */ + public static class fscanf { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("fscanf"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private fscanf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * int fscanf(FILE *restrict, const char *restrict, ...) + * } + */ + public static fscanf makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new fscanf(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public int apply(MemorySegment x0, MemorySegment x1, Object... x2) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fscanf", x0, x1, x2); + } + return (int)spreader.invokeExact(x0, x1, x2); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static class fseek { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_LONG, + somelib_h.C_INT + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("fseek"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int fseek(FILE *, long, int) + * } + */ + public static FunctionDescriptor fseek$descriptor() { + return fseek.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int fseek(FILE *, long, int) + * } + */ + public static MethodHandle fseek$handle() { + return fseek.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int fseek(FILE *, long, int) + * } + */ + public static MemorySegment fseek$address() { + return fseek.ADDR; + } + + /** + * {@snippet lang=c : + * int fseek(FILE *, long, int) + * } + */ + public static int fseek(MemorySegment x0, long x1, int x2) { + var mh$ = fseek.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fseek", x0, x1, x2); + } + return (int)mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class fsetpos { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("fsetpos"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int fsetpos(FILE *, const fpos_t *) + * } + */ + public static FunctionDescriptor fsetpos$descriptor() { + return fsetpos.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int fsetpos(FILE *, const fpos_t *) + * } + */ + public static MethodHandle fsetpos$handle() { + return fsetpos.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int fsetpos(FILE *, const fpos_t *) + * } + */ + public static MemorySegment fsetpos$address() { + return fsetpos.ADDR; + } + + /** + * {@snippet lang=c : + * int fsetpos(FILE *, const fpos_t *) + * } + */ + public static int fsetpos(MemorySegment x0, MemorySegment x1) { + var mh$ = fsetpos.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fsetpos", x0, x1); + } + return (int)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class ftell { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_LONG, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("ftell"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * long ftell(FILE *) + * } + */ + public static FunctionDescriptor ftell$descriptor() { + return ftell.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * long ftell(FILE *) + * } + */ + public static MethodHandle ftell$handle() { + return ftell.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * long ftell(FILE *) + * } + */ + public static MemorySegment ftell$address() { + return ftell.ADDR; + } + + /** + * {@snippet lang=c : + * long ftell(FILE *) + * } + */ + public static long ftell(MemorySegment x0) { + var mh$ = ftell.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("ftell", x0); + } + return (long)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class fwrite { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_LONG, + somelib_h.C_POINTER, + somelib_h.C_LONG, + somelib_h.C_LONG, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("fwrite"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * unsigned long fwrite(const void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) + * } + */ + public static FunctionDescriptor fwrite$descriptor() { + return fwrite.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * unsigned long fwrite(const void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) + * } + */ + public static MethodHandle fwrite$handle() { + return fwrite.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * unsigned long fwrite(const void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) + * } + */ + public static MemorySegment fwrite$address() { + return fwrite.ADDR; + } + + /** + * {@snippet lang=c : + * unsigned long fwrite(const void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) + * } + */ + public static long fwrite(MemorySegment __ptr, long __size, long __nitems, MemorySegment __stream) { + var mh$ = fwrite.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fwrite", __ptr, __size, __nitems, __stream); + } + return (long)mh$.invokeExact(__ptr, __size, __nitems, __stream); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class getc { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("getc"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int getc(FILE *) + * } + */ + public static FunctionDescriptor getc$descriptor() { + return getc.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int getc(FILE *) + * } + */ + public static MethodHandle getc$handle() { + return getc.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int getc(FILE *) + * } + */ + public static MemorySegment getc$address() { + return getc.ADDR; + } + + /** + * {@snippet lang=c : + * int getc(FILE *) + * } + */ + public static int getc(MemorySegment x0) { + var mh$ = getc.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("getc", x0); + } + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class getchar { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("getchar"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int getchar() + * } + */ + public static FunctionDescriptor getchar$descriptor() { + return getchar.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int getchar() + * } + */ + public static MethodHandle getchar$handle() { + return getchar.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int getchar() + * } + */ + public static MemorySegment getchar$address() { + return getchar.ADDR; + } + + /** + * {@snippet lang=c : + * int getchar() + * } + */ + public static int getchar() { + var mh$ = getchar.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("getchar"); + } + return (int)mh$.invokeExact(); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class gets { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("gets"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * char *gets(char *) + * } + */ + public static FunctionDescriptor gets$descriptor() { + return gets.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * char *gets(char *) + * } + */ + public static MethodHandle gets$handle() { + return gets.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * char *gets(char *) + * } + */ + public static MemorySegment gets$address() { + return gets.ADDR; + } + + /** + * {@snippet lang=c : + * char *gets(char *) + * } + */ + public static MemorySegment gets(MemorySegment x0) { + var mh$ = gets.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("gets", x0); + } + return (MemorySegment)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class perror { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("perror"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void perror(const char *) + * } + */ + public static FunctionDescriptor perror$descriptor() { + return perror.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void perror(const char *) + * } + */ + public static MethodHandle perror$handle() { + return perror.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void perror(const char *) + * } + */ + public static MemorySegment perror$address() { + return perror.ADDR; + } + + /** + * {@snippet lang=c : + * void perror(const char *) + * } + */ + public static void perror(MemorySegment x0) { + var mh$ = perror.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("perror", x0); + } + mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + /** + * Variadic invoker class for: + * {@snippet lang=c : + * int printf(const char *restrict, ...) + * } + */ + public static class printf { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER + ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("printf"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private printf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * int printf(const char *restrict, ...) + * } + */ + public static printf makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new printf(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public int apply(MemorySegment x0, Object... x1) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("printf", x0, x1); + } + return (int)spreader.invokeExact(x0, x1); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static class putc { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("putc"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int putc(int, FILE *) + * } + */ + public static FunctionDescriptor putc$descriptor() { + return putc.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int putc(int, FILE *) + * } + */ + public static MethodHandle putc$handle() { + return putc.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int putc(int, FILE *) + * } + */ + public static MemorySegment putc$address() { + return putc.ADDR; + } + + /** + * {@snippet lang=c : + * int putc(int, FILE *) + * } + */ + public static int putc(int x0, MemorySegment x1) { + var mh$ = putc.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("putc", x0, x1); + } + return (int)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class putchar { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_INT + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("putchar"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int putchar(int) + * } + */ + public static FunctionDescriptor putchar$descriptor() { + return putchar.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int putchar(int) + * } + */ + public static MethodHandle putchar$handle() { + return putchar.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int putchar(int) + * } + */ + public static MemorySegment putchar$address() { + return putchar.ADDR; + } + + /** + * {@snippet lang=c : + * int putchar(int) + * } + */ + public static int putchar(int x0) { + var mh$ = putchar.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("putchar", x0); + } + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class puts { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("puts"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int puts(const char *) + * } + */ + public static FunctionDescriptor puts$descriptor() { + return puts.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int puts(const char *) + * } + */ + public static MethodHandle puts$handle() { + return puts.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int puts(const char *) + * } + */ + public static MemorySegment puts$address() { + return puts.ADDR; + } + + /** + * {@snippet lang=c : + * int puts(const char *) + * } + */ + public static int puts(MemorySegment x0) { + var mh$ = puts.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("puts", x0); + } + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class remove { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("remove"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int remove(const char *) + * } + */ + public static FunctionDescriptor remove$descriptor() { + return remove.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int remove(const char *) + * } + */ + public static MethodHandle remove$handle() { + return remove.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int remove(const char *) + * } + */ + public static MemorySegment remove$address() { + return remove.ADDR; + } + + /** + * {@snippet lang=c : + * int remove(const char *) + * } + */ + public static int remove(MemorySegment x0) { + var mh$ = remove.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("remove", x0); + } + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class rename { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("rename"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int rename(const char *__old, const char *__new) + * } + */ + public static FunctionDescriptor rename$descriptor() { + return rename.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int rename(const char *__old, const char *__new) + * } + */ + public static MethodHandle rename$handle() { + return rename.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int rename(const char *__old, const char *__new) + * } + */ + public static MemorySegment rename$address() { + return rename.ADDR; + } + + /** + * {@snippet lang=c : + * int rename(const char *__old, const char *__new) + * } + */ + public static int rename(MemorySegment __old, MemorySegment __new) { + var mh$ = rename.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("rename", __old, __new); + } + return (int)mh$.invokeExact(__old, __new); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class rewind { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("rewind"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void rewind(FILE *) + * } + */ + public static FunctionDescriptor rewind$descriptor() { + return rewind.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void rewind(FILE *) + * } + */ + public static MethodHandle rewind$handle() { + return rewind.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void rewind(FILE *) + * } + */ + public static MemorySegment rewind$address() { + return rewind.ADDR; + } + + /** + * {@snippet lang=c : + * void rewind(FILE *) + * } + */ + public static void rewind(MemorySegment x0) { + var mh$ = rewind.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("rewind", x0); + } + mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + /** + * Variadic invoker class for: + * {@snippet lang=c : + * int scanf(const char *restrict, ...) + * } + */ + public static class scanf { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER + ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("scanf"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private scanf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * int scanf(const char *restrict, ...) + * } + */ + public static scanf makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new scanf(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public int apply(MemorySegment x0, Object... x1) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("scanf", x0, x1); + } + return (int)spreader.invokeExact(x0, x1); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static class setbuf { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("setbuf"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void setbuf(FILE *restrict, char *restrict) + * } + */ + public static FunctionDescriptor setbuf$descriptor() { + return setbuf.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void setbuf(FILE *restrict, char *restrict) + * } + */ + public static MethodHandle setbuf$handle() { + return setbuf.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void setbuf(FILE *restrict, char *restrict) + * } + */ + public static MemorySegment setbuf$address() { + return setbuf.ADDR; + } + + /** + * {@snippet lang=c : + * void setbuf(FILE *restrict, char *restrict) + * } + */ + public static void setbuf(MemorySegment x0, MemorySegment x1) { + var mh$ = setbuf.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("setbuf", x0, x1); + } + mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class setvbuf { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_INT, + somelib_h.C_LONG + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("setvbuf"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int setvbuf(FILE *restrict, char *restrict, int, size_t) + * } + */ + public static FunctionDescriptor setvbuf$descriptor() { + return setvbuf.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int setvbuf(FILE *restrict, char *restrict, int, size_t) + * } + */ + public static MethodHandle setvbuf$handle() { + return setvbuf.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int setvbuf(FILE *restrict, char *restrict, int, size_t) + * } + */ + public static MemorySegment setvbuf$address() { + return setvbuf.ADDR; + } + + /** + * {@snippet lang=c : + * int setvbuf(FILE *restrict, char *restrict, int, size_t) + * } + */ + public static int setvbuf(MemorySegment x0, MemorySegment x1, int x2, long x3) { + var mh$ = setvbuf.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("setvbuf", x0, x1, x2, x3); + } + return (int)mh$.invokeExact(x0, x1, x2, x3); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + /** + * Variadic invoker class for: + * {@snippet lang=c : + * int sprintf(char *restrict, const char *restrict, ...) + * } + */ + public static class sprintf { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("sprintf"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private sprintf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * int sprintf(char *restrict, const char *restrict, ...) + * } + */ + public static sprintf makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new sprintf(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public int apply(MemorySegment x0, MemorySegment x1, Object... x2) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("sprintf", x0, x1, x2); + } + return (int)spreader.invokeExact(x0, x1, x2); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + /** + * Variadic invoker class for: + * {@snippet lang=c : + * int sscanf(const char *restrict, const char *restrict, ...) + * } + */ + public static class sscanf { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("sscanf"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private sscanf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * int sscanf(const char *restrict, const char *restrict, ...) + * } + */ + public static sscanf makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new sscanf(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public int apply(MemorySegment x0, MemorySegment x1, Object... x2) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("sscanf", x0, x1, x2); + } + return (int)spreader.invokeExact(x0, x1, x2); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static class tmpfile { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("tmpfile"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * FILE *tmpfile() + * } + */ + public static FunctionDescriptor tmpfile$descriptor() { + return tmpfile.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * FILE *tmpfile() + * } + */ + public static MethodHandle tmpfile$handle() { + return tmpfile.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * FILE *tmpfile() + * } + */ + public static MemorySegment tmpfile$address() { + return tmpfile.ADDR; + } + + /** + * {@snippet lang=c : + * FILE *tmpfile() + * } + */ + public static MemorySegment tmpfile() { + var mh$ = tmpfile.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("tmpfile"); + } + return (MemorySegment)mh$.invokeExact(); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class tmpnam { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("tmpnam"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * char *tmpnam(char *) + * } + */ + public static FunctionDescriptor tmpnam$descriptor() { + return tmpnam.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * char *tmpnam(char *) + * } + */ + public static MethodHandle tmpnam$handle() { + return tmpnam.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * char *tmpnam(char *) + * } + */ + public static MemorySegment tmpnam$address() { + return tmpnam.ADDR; + } + + /** + * {@snippet lang=c : + * char *tmpnam(char *) + * } + */ + public static MemorySegment tmpnam(MemorySegment x0) { + var mh$ = tmpnam.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("tmpnam", x0); + } + return (MemorySegment)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class ungetc { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("ungetc"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int ungetc(int, FILE *) + * } + */ + public static FunctionDescriptor ungetc$descriptor() { + return ungetc.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int ungetc(int, FILE *) + * } + */ + public static MethodHandle ungetc$handle() { + return ungetc.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int ungetc(int, FILE *) + * } + */ + public static MemorySegment ungetc$address() { + return ungetc.ADDR; + } + + /** + * {@snippet lang=c : + * int ungetc(int, FILE *) + * } + */ + public static int ungetc(int x0, MemorySegment x1) { + var mh$ = ungetc.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("ungetc", x0, x1); + } + return (int)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class vfprintf { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("vfprintf"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int vfprintf(FILE *restrict, const char *restrict, va_list) + * } + */ + public static FunctionDescriptor vfprintf$descriptor() { + return vfprintf.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int vfprintf(FILE *restrict, const char *restrict, va_list) + * } + */ + public static MethodHandle vfprintf$handle() { + return vfprintf.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int vfprintf(FILE *restrict, const char *restrict, va_list) + * } + */ + public static MemorySegment vfprintf$address() { + return vfprintf.ADDR; + } + + /** + * {@snippet lang=c : + * int vfprintf(FILE *restrict, const char *restrict, va_list) + * } + */ + public static int vfprintf(MemorySegment x0, MemorySegment x1, MemorySegment x2) { + var mh$ = vfprintf.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("vfprintf", x0, x1, x2); + } + return (int)mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class vprintf { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("vprintf"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int vprintf(const char *restrict, va_list) + * } + */ + public static FunctionDescriptor vprintf$descriptor() { + return vprintf.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int vprintf(const char *restrict, va_list) + * } + */ + public static MethodHandle vprintf$handle() { + return vprintf.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int vprintf(const char *restrict, va_list) + * } + */ + public static MemorySegment vprintf$address() { + return vprintf.ADDR; + } + + /** + * {@snippet lang=c : + * int vprintf(const char *restrict, va_list) + * } + */ + public static int vprintf(MemorySegment x0, MemorySegment x1) { + var mh$ = vprintf.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("vprintf", x0, x1); + } + return (int)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class vsprintf { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("vsprintf"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int vsprintf(char *restrict, const char *restrict, va_list) + * } + */ + public static FunctionDescriptor vsprintf$descriptor() { + return vsprintf.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int vsprintf(char *restrict, const char *restrict, va_list) + * } + */ + public static MethodHandle vsprintf$handle() { + return vsprintf.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int vsprintf(char *restrict, const char *restrict, va_list) + * } + */ + public static MemorySegment vsprintf$address() { + return vsprintf.ADDR; + } + + /** + * {@snippet lang=c : + * int vsprintf(char *restrict, const char *restrict, va_list) + * } + */ + public static int vsprintf(MemorySegment x0, MemorySegment x1, MemorySegment x2) { + var mh$ = vsprintf.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("vsprintf", x0, x1, x2); + } + return (int)mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class ctermid { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("ctermid"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * char *ctermid(char *) + * } + */ + public static FunctionDescriptor ctermid$descriptor() { + return ctermid.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * char *ctermid(char *) + * } + */ + public static MethodHandle ctermid$handle() { + return ctermid.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * char *ctermid(char *) + * } + */ + public static MemorySegment ctermid$address() { + return ctermid.ADDR; + } + + /** + * {@snippet lang=c : + * char *ctermid(char *) + * } + */ + public static MemorySegment ctermid(MemorySegment x0) { + var mh$ = ctermid.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("ctermid", x0); + } + return (MemorySegment)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class fdopen { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("fdopen"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * FILE *fdopen(int, const char *) + * } + */ + public static FunctionDescriptor fdopen$descriptor() { + return fdopen.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * FILE *fdopen(int, const char *) + * } + */ + public static MethodHandle fdopen$handle() { + return fdopen.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * FILE *fdopen(int, const char *) + * } + */ + public static MemorySegment fdopen$address() { + return fdopen.ADDR; + } + + /** + * {@snippet lang=c : + * FILE *fdopen(int, const char *) + * } + */ + public static MemorySegment fdopen(int x0, MemorySegment x1) { + var mh$ = fdopen.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fdopen", x0, x1); + } + return (MemorySegment)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class fileno { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("fileno"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int fileno(FILE *) + * } + */ + public static FunctionDescriptor fileno$descriptor() { + return fileno.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int fileno(FILE *) + * } + */ + public static MethodHandle fileno$handle() { + return fileno.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int fileno(FILE *) + * } + */ + public static MemorySegment fileno$address() { + return fileno.ADDR; + } + + /** + * {@snippet lang=c : + * int fileno(FILE *) + * } + */ + public static int fileno(MemorySegment x0) { + var mh$ = fileno.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fileno", x0); + } + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class pclose { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("pclose"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int pclose(FILE *) + * } + */ + public static FunctionDescriptor pclose$descriptor() { + return pclose.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int pclose(FILE *) + * } + */ + public static MethodHandle pclose$handle() { + return pclose.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int pclose(FILE *) + * } + */ + public static MemorySegment pclose$address() { + return pclose.ADDR; + } + + /** + * {@snippet lang=c : + * int pclose(FILE *) + * } + */ + public static int pclose(MemorySegment x0) { + var mh$ = pclose.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("pclose", x0); + } + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class popen { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("popen"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * FILE *popen(const char *, const char *) + * } + */ + public static FunctionDescriptor popen$descriptor() { + return popen.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * FILE *popen(const char *, const char *) + * } + */ + public static MethodHandle popen$handle() { + return popen.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * FILE *popen(const char *, const char *) + * } + */ + public static MemorySegment popen$address() { + return popen.ADDR; + } + + /** + * {@snippet lang=c : + * FILE *popen(const char *, const char *) + * } + */ + public static MemorySegment popen(MemorySegment x0, MemorySegment x1) { + var mh$ = popen.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("popen", x0, x1); + } + return (MemorySegment)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class __srget { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("__srget"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int __srget(FILE *) + * } + */ + public static FunctionDescriptor __srget$descriptor() { + return __srget.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int __srget(FILE *) + * } + */ + public static MethodHandle __srget$handle() { + return __srget.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int __srget(FILE *) + * } + */ + public static MemorySegment __srget$address() { + return __srget.ADDR; + } + + /** + * {@snippet lang=c : + * int __srget(FILE *) + * } + */ + public static int __srget(MemorySegment x0) { + var mh$ = __srget.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("__srget", x0); + } + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class __svfscanf { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("__svfscanf"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int __svfscanf(FILE *, const char *, va_list) + * } + */ + public static FunctionDescriptor __svfscanf$descriptor() { + return __svfscanf.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int __svfscanf(FILE *, const char *, va_list) + * } + */ + public static MethodHandle __svfscanf$handle() { + return __svfscanf.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int __svfscanf(FILE *, const char *, va_list) + * } + */ + public static MemorySegment __svfscanf$address() { + return __svfscanf.ADDR; + } + + /** + * {@snippet lang=c : + * int __svfscanf(FILE *, const char *, va_list) + * } + */ + public static int __svfscanf(MemorySegment x0, MemorySegment x1, MemorySegment x2) { + var mh$ = __svfscanf.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("__svfscanf", x0, x1, x2); + } + return (int)mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class __swbuf { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("__swbuf"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int __swbuf(int, FILE *) + * } + */ + public static FunctionDescriptor __swbuf$descriptor() { + return __swbuf.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int __swbuf(int, FILE *) + * } + */ + public static MethodHandle __swbuf$handle() { + return __swbuf.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int __swbuf(int, FILE *) + * } + */ + public static MemorySegment __swbuf$address() { + return __swbuf.ADDR; + } + + /** + * {@snippet lang=c : + * int __swbuf(int, FILE *) + * } + */ + public static int __swbuf(int x0, MemorySegment x1) { + var mh$ = __swbuf.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("__swbuf", x0, x1); + } + return (int)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class flockfile { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("flockfile"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void flockfile(FILE *) + * } + */ + public static FunctionDescriptor flockfile$descriptor() { + return flockfile.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void flockfile(FILE *) + * } + */ + public static MethodHandle flockfile$handle() { + return flockfile.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void flockfile(FILE *) + * } + */ + public static MemorySegment flockfile$address() { + return flockfile.ADDR; + } + + /** + * {@snippet lang=c : + * void flockfile(FILE *) + * } + */ + public static void flockfile(MemorySegment x0) { + var mh$ = flockfile.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("flockfile", x0); + } + mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class ftrylockfile { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("ftrylockfile"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int ftrylockfile(FILE *) + * } + */ + public static FunctionDescriptor ftrylockfile$descriptor() { + return ftrylockfile.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int ftrylockfile(FILE *) + * } + */ + public static MethodHandle ftrylockfile$handle() { + return ftrylockfile.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int ftrylockfile(FILE *) + * } + */ + public static MemorySegment ftrylockfile$address() { + return ftrylockfile.ADDR; + } + + /** + * {@snippet lang=c : + * int ftrylockfile(FILE *) + * } + */ + public static int ftrylockfile(MemorySegment x0) { + var mh$ = ftrylockfile.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("ftrylockfile", x0); + } + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class funlockfile { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("funlockfile"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void funlockfile(FILE *) + * } + */ + public static FunctionDescriptor funlockfile$descriptor() { + return funlockfile.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void funlockfile(FILE *) + * } + */ + public static MethodHandle funlockfile$handle() { + return funlockfile.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void funlockfile(FILE *) + * } + */ + public static MemorySegment funlockfile$address() { + return funlockfile.ADDR; + } + + /** + * {@snippet lang=c : + * void funlockfile(FILE *) + * } + */ + public static void funlockfile(MemorySegment x0) { + var mh$ = funlockfile.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("funlockfile", x0); + } + mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class getc_unlocked { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("getc_unlocked"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int getc_unlocked(FILE *) + * } + */ + public static FunctionDescriptor getc_unlocked$descriptor() { + return getc_unlocked.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int getc_unlocked(FILE *) + * } + */ + public static MethodHandle getc_unlocked$handle() { + return getc_unlocked.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int getc_unlocked(FILE *) + * } + */ + public static MemorySegment getc_unlocked$address() { + return getc_unlocked.ADDR; + } + + /** + * {@snippet lang=c : + * int getc_unlocked(FILE *) + * } + */ + public static int getc_unlocked(MemorySegment x0) { + var mh$ = getc_unlocked.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("getc_unlocked", x0); + } + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class getchar_unlocked { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("getchar_unlocked"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int getchar_unlocked() + * } + */ + public static FunctionDescriptor getchar_unlocked$descriptor() { + return getchar_unlocked.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int getchar_unlocked() + * } + */ + public static MethodHandle getchar_unlocked$handle() { + return getchar_unlocked.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int getchar_unlocked() + * } + */ + public static MemorySegment getchar_unlocked$address() { + return getchar_unlocked.ADDR; + } + + /** + * {@snippet lang=c : + * int getchar_unlocked() + * } + */ + public static int getchar_unlocked() { + var mh$ = getchar_unlocked.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("getchar_unlocked"); + } + return (int)mh$.invokeExact(); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class putc_unlocked { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("putc_unlocked"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int putc_unlocked(int, FILE *) + * } + */ + public static FunctionDescriptor putc_unlocked$descriptor() { + return putc_unlocked.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int putc_unlocked(int, FILE *) + * } + */ + public static MethodHandle putc_unlocked$handle() { + return putc_unlocked.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int putc_unlocked(int, FILE *) + * } + */ + public static MemorySegment putc_unlocked$address() { + return putc_unlocked.ADDR; + } + + /** + * {@snippet lang=c : + * int putc_unlocked(int, FILE *) + * } + */ + public static int putc_unlocked(int x0, MemorySegment x1) { + var mh$ = putc_unlocked.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("putc_unlocked", x0, x1); + } + return (int)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class putchar_unlocked { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_INT + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("putchar_unlocked"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int putchar_unlocked(int) + * } + */ + public static FunctionDescriptor putchar_unlocked$descriptor() { + return putchar_unlocked.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int putchar_unlocked(int) + * } + */ + public static MethodHandle putchar_unlocked$handle() { + return putchar_unlocked.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int putchar_unlocked(int) + * } + */ + public static MemorySegment putchar_unlocked$address() { + return putchar_unlocked.ADDR; + } + + /** + * {@snippet lang=c : + * int putchar_unlocked(int) + * } + */ + public static int putchar_unlocked(int x0) { + var mh$ = putchar_unlocked.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("putchar_unlocked", x0); + } + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class getw { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("getw"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int getw(FILE *) + * } + */ + public static FunctionDescriptor getw$descriptor() { + return getw.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int getw(FILE *) + * } + */ + public static MethodHandle getw$handle() { + return getw.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int getw(FILE *) + * } + */ + public static MemorySegment getw$address() { + return getw.ADDR; + } + + /** + * {@snippet lang=c : + * int getw(FILE *) + * } + */ + public static int getw(MemorySegment x0) { + var mh$ = getw.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("getw", x0); + } + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class putw { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("putw"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int putw(int, FILE *) + * } + */ + public static FunctionDescriptor putw$descriptor() { + return putw.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int putw(int, FILE *) + * } + */ + public static MethodHandle putw$handle() { + return putw.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int putw(int, FILE *) + * } + */ + public static MemorySegment putw$address() { + return putw.ADDR; + } + + /** + * {@snippet lang=c : + * int putw(int, FILE *) + * } + */ + public static int putw(int x0, MemorySegment x1) { + var mh$ = putw.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("putw", x0, x1); + } + return (int)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class tempnam { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("tempnam"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * char *tempnam(const char *__dir, const char *__prefix) + * } + */ + public static FunctionDescriptor tempnam$descriptor() { + return tempnam.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * char *tempnam(const char *__dir, const char *__prefix) + * } + */ + public static MethodHandle tempnam$handle() { + return tempnam.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * char *tempnam(const char *__dir, const char *__prefix) + * } + */ + public static MemorySegment tempnam$address() { + return tempnam.ADDR; + } + + /** + * {@snippet lang=c : + * char *tempnam(const char *__dir, const char *__prefix) + * } + */ + public static MemorySegment tempnam(MemorySegment __dir, MemorySegment __prefix) { + var mh$ = tempnam.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("tempnam", __dir, __prefix); + } + return (MemorySegment)mh$.invokeExact(__dir, __prefix); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + /** + * {@snippet lang=c : + * typedef __darwin_off_t off_t + * } + */ + public static final OfLong off_t = somelib_h.C_LONG_LONG; + + private static class fseeko { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_LONG_LONG, + somelib_h.C_INT + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("fseeko"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int fseeko(FILE *__stream, off_t __offset, int __whence) + * } + */ + public static FunctionDescriptor fseeko$descriptor() { + return fseeko.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int fseeko(FILE *__stream, off_t __offset, int __whence) + * } + */ + public static MethodHandle fseeko$handle() { + return fseeko.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int fseeko(FILE *__stream, off_t __offset, int __whence) + * } + */ + public static MemorySegment fseeko$address() { + return fseeko.ADDR; + } + + /** + * {@snippet lang=c : + * int fseeko(FILE *__stream, off_t __offset, int __whence) + * } + */ + public static int fseeko(MemorySegment __stream, long __offset, int __whence) { + var mh$ = fseeko.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fseeko", __stream, __offset, __whence); + } + return (int)mh$.invokeExact(__stream, __offset, __whence); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class ftello { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_LONG_LONG, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("ftello"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * off_t ftello(FILE *__stream) + * } + */ + public static FunctionDescriptor ftello$descriptor() { + return ftello.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * off_t ftello(FILE *__stream) + * } + */ + public static MethodHandle ftello$handle() { + return ftello.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * off_t ftello(FILE *__stream) + * } + */ + public static MemorySegment ftello$address() { + return ftello.ADDR; + } + + /** + * {@snippet lang=c : + * off_t ftello(FILE *__stream) + * } + */ + public static long ftello(MemorySegment __stream) { + var mh$ = ftello.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("ftello", __stream); + } + return (long)mh$.invokeExact(__stream); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + /** + * Variadic invoker class for: + * {@snippet lang=c : + * int snprintf(char *restrict __str, size_t __size, const char *restrict __format, ...) + * } + */ + public static class snprintf { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_LONG, + somelib_h.C_POINTER + ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("snprintf"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private snprintf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * int snprintf(char *restrict __str, size_t __size, const char *restrict __format, ...) + * } + */ + public static snprintf makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new snprintf(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public int apply(MemorySegment __str, long __size, MemorySegment __format, Object... x3) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("snprintf", __str, __size, __format, x3); + } + return (int)spreader.invokeExact(__str, __size, __format, x3); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static class vfscanf { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("vfscanf"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int vfscanf(FILE *restrict __stream, const char *restrict __format, va_list) + * } + */ + public static FunctionDescriptor vfscanf$descriptor() { + return vfscanf.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int vfscanf(FILE *restrict __stream, const char *restrict __format, va_list) + * } + */ + public static MethodHandle vfscanf$handle() { + return vfscanf.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int vfscanf(FILE *restrict __stream, const char *restrict __format, va_list) + * } + */ + public static MemorySegment vfscanf$address() { + return vfscanf.ADDR; + } + + /** + * {@snippet lang=c : + * int vfscanf(FILE *restrict __stream, const char *restrict __format, va_list) + * } + */ + public static int vfscanf(MemorySegment __stream, MemorySegment __format, MemorySegment x2) { + var mh$ = vfscanf.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("vfscanf", __stream, __format, x2); + } + return (int)mh$.invokeExact(__stream, __format, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class vscanf { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("vscanf"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int vscanf(const char *restrict __format, va_list) + * } + */ + public static FunctionDescriptor vscanf$descriptor() { + return vscanf.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int vscanf(const char *restrict __format, va_list) + * } + */ + public static MethodHandle vscanf$handle() { + return vscanf.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int vscanf(const char *restrict __format, va_list) + * } + */ + public static MemorySegment vscanf$address() { + return vscanf.ADDR; + } + + /** + * {@snippet lang=c : + * int vscanf(const char *restrict __format, va_list) + * } + */ + public static int vscanf(MemorySegment __format, MemorySegment x1) { + var mh$ = vscanf.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("vscanf", __format, x1); + } + return (int)mh$.invokeExact(__format, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class vsnprintf { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_LONG, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("vsnprintf"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int vsnprintf(char *restrict __str, size_t __size, const char *restrict __format, va_list) + * } + */ + public static FunctionDescriptor vsnprintf$descriptor() { + return vsnprintf.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int vsnprintf(char *restrict __str, size_t __size, const char *restrict __format, va_list) + * } + */ + public static MethodHandle vsnprintf$handle() { + return vsnprintf.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int vsnprintf(char *restrict __str, size_t __size, const char *restrict __format, va_list) + * } + */ + public static MemorySegment vsnprintf$address() { + return vsnprintf.ADDR; + } + + /** + * {@snippet lang=c : + * int vsnprintf(char *restrict __str, size_t __size, const char *restrict __format, va_list) + * } + */ + public static int vsnprintf(MemorySegment __str, long __size, MemorySegment __format, MemorySegment x3) { + var mh$ = vsnprintf.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("vsnprintf", __str, __size, __format, x3); + } + return (int)mh$.invokeExact(__str, __size, __format, x3); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class vsscanf { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("vsscanf"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int vsscanf(const char *restrict __str, const char *restrict __format, va_list) + * } + */ + public static FunctionDescriptor vsscanf$descriptor() { + return vsscanf.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int vsscanf(const char *restrict __str, const char *restrict __format, va_list) + * } + */ + public static MethodHandle vsscanf$handle() { + return vsscanf.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int vsscanf(const char *restrict __str, const char *restrict __format, va_list) + * } + */ + public static MemorySegment vsscanf$address() { + return vsscanf.ADDR; + } + + /** + * {@snippet lang=c : + * int vsscanf(const char *restrict __str, const char *restrict __format, va_list) + * } + */ + public static int vsscanf(MemorySegment __str, MemorySegment __format, MemorySegment x2) { + var mh$ = vsscanf.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("vsscanf", __str, __format, x2); + } + return (int)mh$.invokeExact(__str, __format, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + /** + * {@snippet lang=c : + * typedef __darwin_ssize_t ssize_t + * } + */ + public static final OfLong ssize_t = somelib_h.C_LONG; + + /** + * Variadic invoker class for: + * {@snippet lang=c : + * int dprintf(int, const char *restrict, ...) + * } + */ + public static class dprintf { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_INT, + somelib_h.C_POINTER + ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("dprintf"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private dprintf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * int dprintf(int, const char *restrict, ...) + * } + */ + public static dprintf makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new dprintf(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public int apply(int x0, MemorySegment x1, Object... x2) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("dprintf", x0, x1, x2); + } + return (int)spreader.invokeExact(x0, x1, x2); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static class vdprintf { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("vdprintf"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int vdprintf(int, const char *restrict, va_list) + * } + */ + public static FunctionDescriptor vdprintf$descriptor() { + return vdprintf.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int vdprintf(int, const char *restrict, va_list) + * } + */ + public static MethodHandle vdprintf$handle() { + return vdprintf.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int vdprintf(int, const char *restrict, va_list) + * } + */ + public static MemorySegment vdprintf$address() { + return vdprintf.ADDR; + } + + /** + * {@snippet lang=c : + * int vdprintf(int, const char *restrict, va_list) + * } + */ + public static int vdprintf(int x0, MemorySegment x1, MemorySegment x2) { + var mh$ = vdprintf.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("vdprintf", x0, x1, x2); + } + return (int)mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class getdelim { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_LONG, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("getdelim"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * ssize_t getdelim(char **restrict __linep, size_t *restrict __linecapp, int __delimiter, FILE *restrict __stream) + * } + */ + public static FunctionDescriptor getdelim$descriptor() { + return getdelim.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * ssize_t getdelim(char **restrict __linep, size_t *restrict __linecapp, int __delimiter, FILE *restrict __stream) + * } + */ + public static MethodHandle getdelim$handle() { + return getdelim.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * ssize_t getdelim(char **restrict __linep, size_t *restrict __linecapp, int __delimiter, FILE *restrict __stream) + * } + */ + public static MemorySegment getdelim$address() { + return getdelim.ADDR; + } + + /** + * {@snippet lang=c : + * ssize_t getdelim(char **restrict __linep, size_t *restrict __linecapp, int __delimiter, FILE *restrict __stream) + * } + */ + public static long getdelim(MemorySegment __linep, MemorySegment __linecapp, int __delimiter, MemorySegment __stream) { + var mh$ = getdelim.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("getdelim", __linep, __linecapp, __delimiter, __stream); + } + return (long)mh$.invokeExact(__linep, __linecapp, __delimiter, __stream); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class getline { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_LONG, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("getline"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * ssize_t getline(char **restrict __linep, size_t *restrict __linecapp, FILE *restrict __stream) + * } + */ + public static FunctionDescriptor getline$descriptor() { + return getline.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * ssize_t getline(char **restrict __linep, size_t *restrict __linecapp, FILE *restrict __stream) + * } + */ + public static MethodHandle getline$handle() { + return getline.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * ssize_t getline(char **restrict __linep, size_t *restrict __linecapp, FILE *restrict __stream) + * } + */ + public static MemorySegment getline$address() { + return getline.ADDR; + } + + /** + * {@snippet lang=c : + * ssize_t getline(char **restrict __linep, size_t *restrict __linecapp, FILE *restrict __stream) + * } + */ + public static long getline(MemorySegment __linep, MemorySegment __linecapp, MemorySegment __stream) { + var mh$ = getline.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("getline", __linep, __linecapp, __stream); + } + return (long)mh$.invokeExact(__linep, __linecapp, __stream); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class fmemopen { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("fmemopen"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * FILE *fmemopen(void *restrict __buf, size_t __size, const char *restrict __mode) + * } + */ + public static FunctionDescriptor fmemopen$descriptor() { + return fmemopen.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * FILE *fmemopen(void *restrict __buf, size_t __size, const char *restrict __mode) + * } + */ + public static MethodHandle fmemopen$handle() { + return fmemopen.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * FILE *fmemopen(void *restrict __buf, size_t __size, const char *restrict __mode) + * } + */ + public static MemorySegment fmemopen$address() { + return fmemopen.ADDR; + } + + /** + * {@snippet lang=c : + * FILE *fmemopen(void *restrict __buf, size_t __size, const char *restrict __mode) + * } + */ + public static MemorySegment fmemopen(MemorySegment __buf, long __size, MemorySegment __mode) { + var mh$ = fmemopen.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fmemopen", __buf, __size, __mode); + } + return (MemorySegment)mh$.invokeExact(__buf, __size, __mode); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class open_memstream { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("open_memstream"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * FILE *open_memstream(char **__bufp, size_t *__sizep) + * } + */ + public static FunctionDescriptor open_memstream$descriptor() { + return open_memstream.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * FILE *open_memstream(char **__bufp, size_t *__sizep) + * } + */ + public static MethodHandle open_memstream$handle() { + return open_memstream.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * FILE *open_memstream(char **__bufp, size_t *__sizep) + * } + */ + public static MemorySegment open_memstream$address() { + return open_memstream.ADDR; + } + + /** + * {@snippet lang=c : + * FILE *open_memstream(char **__bufp, size_t *__sizep) + * } + */ + public static MemorySegment open_memstream(MemorySegment __bufp, MemorySegment __sizep) { + var mh$ = open_memstream.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("open_memstream", __bufp, __sizep); + } + return (MemorySegment)mh$.invokeExact(__bufp, __sizep); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class sys_nerr$constants { + public static final OfInt LAYOUT = somelib_h.C_INT; + public static final MemorySegment SEGMENT = somelib_h.findOrThrow("sys_nerr").reinterpret(LAYOUT.byteSize()); + } + + /** + * Layout for variable: + * {@snippet lang=c : + * extern const int sys_nerr + * } + */ + public static OfInt sys_nerr$layout() { + return sys_nerr$constants.LAYOUT; + } + + /** + * Segment for variable: + * {@snippet lang=c : + * extern const int sys_nerr + * } + */ + public static MemorySegment sys_nerr$segment() { + return sys_nerr$constants.SEGMENT; + } + + /** + * Getter for variable: + * {@snippet lang=c : + * extern const int sys_nerr + * } + */ + public static int sys_nerr() { + return sys_nerr$constants.SEGMENT.get(sys_nerr$constants.LAYOUT, 0L); + } + + /** + * Setter for variable: + * {@snippet lang=c : + * extern const int sys_nerr + * } + */ + public static void sys_nerr(int varValue) { + sys_nerr$constants.SEGMENT.set(sys_nerr$constants.LAYOUT, 0L, varValue); + } + + private static class sys_errlist$constants { + public static final SequenceLayout LAYOUT = MemoryLayout.sequenceLayout(0, somelib_h.C_POINTER); + public static final MemorySegment SEGMENT = somelib_h.findOrThrow("sys_errlist").reinterpret(LAYOUT.byteSize()); + public static final VarHandle HANDLE = LAYOUT.varHandle(); + + public static final long[] DIMS = { }; + } + + /** + * Layout for variable: + * {@snippet lang=c : + * extern const char *const sys_errlist[] + * } + */ + public static SequenceLayout sys_errlist$layout() { + return sys_errlist$constants.LAYOUT; + } + + /** + * Dimensions for array variable: + * {@snippet lang=c : + * extern const char *const sys_errlist[] + * } + */ + public static long[] sys_errlist$dimensions() { + return sys_errlist$constants.DIMS; + } + + /** + * Getter for variable: + * {@snippet lang=c : + * extern const char *const sys_errlist[] + * } + */ + public static MemorySegment sys_errlist() { + return sys_errlist$constants.SEGMENT; + } + + /** + * Setter for variable: + * {@snippet lang=c : + * extern const char *const sys_errlist[] + * } + */ + public static void sys_errlist(MemorySegment varValue) { + MemorySegment.copy(varValue, 0L, sys_errlist$constants.SEGMENT, 0L, sys_errlist$constants.LAYOUT.byteSize()); + } + + /** + * Variadic invoker class for: + * {@snippet lang=c : + * int asprintf(char **restrict, const char *restrict, ...) + * } + */ + public static class asprintf { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("asprintf"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private asprintf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * int asprintf(char **restrict, const char *restrict, ...) + * } + */ + public static asprintf makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new asprintf(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public int apply(MemorySegment x0, MemorySegment x1, Object... x2) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("asprintf", x0, x1, x2); + } + return (int)spreader.invokeExact(x0, x1, x2); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static class ctermid_r { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("ctermid_r"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * char *ctermid_r(char *) + * } + */ + public static FunctionDescriptor ctermid_r$descriptor() { + return ctermid_r.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * char *ctermid_r(char *) + * } + */ + public static MethodHandle ctermid_r$handle() { + return ctermid_r.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * char *ctermid_r(char *) + * } + */ + public static MemorySegment ctermid_r$address() { + return ctermid_r.ADDR; + } + + /** + * {@snippet lang=c : + * char *ctermid_r(char *) + * } + */ + public static MemorySegment ctermid_r(MemorySegment x0) { + var mh$ = ctermid_r.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("ctermid_r", x0); + } + return (MemorySegment)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class fgetln { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("fgetln"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * char *fgetln(FILE *, size_t *) + * } + */ + public static FunctionDescriptor fgetln$descriptor() { + return fgetln.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * char *fgetln(FILE *, size_t *) + * } + */ + public static MethodHandle fgetln$handle() { + return fgetln.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * char *fgetln(FILE *, size_t *) + * } + */ + public static MemorySegment fgetln$address() { + return fgetln.ADDR; + } + + /** + * {@snippet lang=c : + * char *fgetln(FILE *, size_t *) + * } + */ + public static MemorySegment fgetln(MemorySegment x0, MemorySegment x1) { + var mh$ = fgetln.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fgetln", x0, x1); + } + return (MemorySegment)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class fmtcheck { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("fmtcheck"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * const char *fmtcheck(const char *, const char *) + * } + */ + public static FunctionDescriptor fmtcheck$descriptor() { + return fmtcheck.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * const char *fmtcheck(const char *, const char *) + * } + */ + public static MethodHandle fmtcheck$handle() { + return fmtcheck.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * const char *fmtcheck(const char *, const char *) + * } + */ + public static MemorySegment fmtcheck$address() { + return fmtcheck.ADDR; + } + + /** + * {@snippet lang=c : + * const char *fmtcheck(const char *, const char *) + * } + */ + public static MemorySegment fmtcheck(MemorySegment x0, MemorySegment x1) { + var mh$ = fmtcheck.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fmtcheck", x0, x1); + } + return (MemorySegment)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class fpurge { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("fpurge"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int fpurge(FILE *) + * } + */ + public static FunctionDescriptor fpurge$descriptor() { + return fpurge.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int fpurge(FILE *) + * } + */ + public static MethodHandle fpurge$handle() { + return fpurge.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int fpurge(FILE *) + * } + */ + public static MemorySegment fpurge$address() { + return fpurge.ADDR; + } + + /** + * {@snippet lang=c : + * int fpurge(FILE *) + * } + */ + public static int fpurge(MemorySegment x0) { + var mh$ = fpurge.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fpurge", x0); + } + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class setbuffer { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_INT + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("setbuffer"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void setbuffer(FILE *, char *, int) + * } + */ + public static FunctionDescriptor setbuffer$descriptor() { + return setbuffer.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void setbuffer(FILE *, char *, int) + * } + */ + public static MethodHandle setbuffer$handle() { + return setbuffer.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void setbuffer(FILE *, char *, int) + * } + */ + public static MemorySegment setbuffer$address() { + return setbuffer.ADDR; + } + + /** + * {@snippet lang=c : + * void setbuffer(FILE *, char *, int) + * } + */ + public static void setbuffer(MemorySegment x0, MemorySegment x1, int x2) { + var mh$ = setbuffer.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("setbuffer", x0, x1, x2); + } + mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class setlinebuf { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("setlinebuf"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int setlinebuf(FILE *) + * } + */ + public static FunctionDescriptor setlinebuf$descriptor() { + return setlinebuf.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int setlinebuf(FILE *) + * } + */ + public static MethodHandle setlinebuf$handle() { + return setlinebuf.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int setlinebuf(FILE *) + * } + */ + public static MemorySegment setlinebuf$address() { + return setlinebuf.ADDR; + } + + /** + * {@snippet lang=c : + * int setlinebuf(FILE *) + * } + */ + public static int setlinebuf(MemorySegment x0) { + var mh$ = setlinebuf.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("setlinebuf", x0); + } + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class vasprintf { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("vasprintf"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int vasprintf(char **restrict, const char *restrict, va_list) + * } + */ + public static FunctionDescriptor vasprintf$descriptor() { + return vasprintf.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int vasprintf(char **restrict, const char *restrict, va_list) + * } + */ + public static MethodHandle vasprintf$handle() { + return vasprintf.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int vasprintf(char **restrict, const char *restrict, va_list) + * } + */ + public static MemorySegment vasprintf$address() { + return vasprintf.ADDR; + } + + /** + * {@snippet lang=c : + * int vasprintf(char **restrict, const char *restrict, va_list) + * } + */ + public static int vasprintf(MemorySegment x0, MemorySegment x1, MemorySegment x2) { + var mh$ = vasprintf.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("vasprintf", x0, x1, x2); + } + return (int)mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class funopen { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("funopen"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * FILE *funopen(const void *, int (* _Nullable)(void *, char *, int), int (* _Nullable)(void *, const char *, int), fpos_t (* _Nullable)(void *, fpos_t, int), int (* _Nullable)(void *)) + * } + */ + public static FunctionDescriptor funopen$descriptor() { + return funopen.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * FILE *funopen(const void *, int (* _Nullable)(void *, char *, int), int (* _Nullable)(void *, const char *, int), fpos_t (* _Nullable)(void *, fpos_t, int), int (* _Nullable)(void *)) + * } + */ + public static MethodHandle funopen$handle() { + return funopen.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * FILE *funopen(const void *, int (* _Nullable)(void *, char *, int), int (* _Nullable)(void *, const char *, int), fpos_t (* _Nullable)(void *, fpos_t, int), int (* _Nullable)(void *)) + * } + */ + public static MemorySegment funopen$address() { + return funopen.ADDR; + } + + /** + * {@snippet lang=c : + * FILE *funopen(const void *, int (* _Nullable)(void *, char *, int), int (* _Nullable)(void *, const char *, int), fpos_t (* _Nullable)(void *, fpos_t, int), int (* _Nullable)(void *)) + * } + */ + public static MemorySegment funopen(MemorySegment x0, MemorySegment x1, MemorySegment x2, MemorySegment x3, MemorySegment x4) { + var mh$ = funopen.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("funopen", x0, x1, x2, x3, x4); + } + return (MemorySegment)mh$.invokeExact(x0, x1, x2, x3, x4); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + /** + * Variadic invoker class for: + * {@snippet lang=c : + * extern int __sprintf_chk(char *restrict, int, size_t, const char *restrict, ...) + * } + */ + public static class __sprintf_chk { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_INT, + somelib_h.C_LONG, + somelib_h.C_POINTER + ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("__sprintf_chk"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private __sprintf_chk(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * extern int __sprintf_chk(char *restrict, int, size_t, const char *restrict, ...) + * } + */ + public static __sprintf_chk makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new __sprintf_chk(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public int apply(MemorySegment x0, int x1, long x2, MemorySegment x3, Object... x4) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("__sprintf_chk", x0, x1, x2, x3, x4); + } + return (int)spreader.invokeExact(x0, x1, x2, x3, x4); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + /** + * Variadic invoker class for: + * {@snippet lang=c : + * extern int __snprintf_chk(char *restrict, size_t, int, size_t, const char *restrict, ...) + * } + */ + public static class __snprintf_chk { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_LONG, + somelib_h.C_INT, + somelib_h.C_LONG, + somelib_h.C_POINTER + ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("__snprintf_chk"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private __snprintf_chk(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * extern int __snprintf_chk(char *restrict, size_t, int, size_t, const char *restrict, ...) + * } + */ + public static __snprintf_chk makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new __snprintf_chk(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public int apply(MemorySegment x0, long x1, int x2, long x3, MemorySegment x4, Object... x5) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("__snprintf_chk", x0, x1, x2, x3, x4, x5); + } + return (int)spreader.invokeExact(x0, x1, x2, x3, x4, x5); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static class __vsprintf_chk { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_INT, + somelib_h.C_LONG, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("__vsprintf_chk"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern int __vsprintf_chk(char *restrict, int, size_t, const char *restrict, va_list) + * } + */ + public static FunctionDescriptor __vsprintf_chk$descriptor() { + return __vsprintf_chk.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern int __vsprintf_chk(char *restrict, int, size_t, const char *restrict, va_list) + * } + */ + public static MethodHandle __vsprintf_chk$handle() { + return __vsprintf_chk.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern int __vsprintf_chk(char *restrict, int, size_t, const char *restrict, va_list) + * } + */ + public static MemorySegment __vsprintf_chk$address() { + return __vsprintf_chk.ADDR; + } + + /** + * {@snippet lang=c : + * extern int __vsprintf_chk(char *restrict, int, size_t, const char *restrict, va_list) + * } + */ + public static int __vsprintf_chk(MemorySegment x0, int x1, long x2, MemorySegment x3, MemorySegment x4) { + var mh$ = __vsprintf_chk.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("__vsprintf_chk", x0, x1, x2, x3, x4); + } + return (int)mh$.invokeExact(x0, x1, x2, x3, x4); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class __vsnprintf_chk { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_LONG, + somelib_h.C_INT, + somelib_h.C_LONG, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("__vsnprintf_chk"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern int __vsnprintf_chk(char *restrict, size_t, int, size_t, const char *restrict, va_list) + * } + */ + public static FunctionDescriptor __vsnprintf_chk$descriptor() { + return __vsnprintf_chk.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern int __vsnprintf_chk(char *restrict, size_t, int, size_t, const char *restrict, va_list) + * } + */ + public static MethodHandle __vsnprintf_chk$handle() { + return __vsnprintf_chk.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern int __vsnprintf_chk(char *restrict, size_t, int, size_t, const char *restrict, va_list) + * } + */ + public static MemorySegment __vsnprintf_chk$address() { + return __vsnprintf_chk.ADDR; + } + + /** + * {@snippet lang=c : + * extern int __vsnprintf_chk(char *restrict, size_t, int, size_t, const char *restrict, va_list) + * } + */ + public static int __vsnprintf_chk(MemorySegment x0, long x1, int x2, long x3, MemorySegment x4, MemorySegment x5) { + var mh$ = __vsnprintf_chk.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("__vsnprintf_chk", x0, x1, x2, x3, x4, x5); + } + return (int)mh$.invokeExact(x0, x1, x2, x3, x4, x5); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + /** + * {@snippet lang=c : + * typedef unsigned char uint8_t + * } + */ + public static final OfByte uint8_t = somelib_h.C_CHAR; + /** + * {@snippet lang=c : + * typedef unsigned short uint16_t + * } + */ + public static final OfShort uint16_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef unsigned int uint32_t + * } + */ + public static final OfInt uint32_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef unsigned long long uint64_t + * } + */ + public static final OfLong uint64_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef int8_t int_least8_t + * } + */ + public static final OfByte int_least8_t = somelib_h.C_CHAR; + /** + * {@snippet lang=c : + * typedef int16_t int_least16_t + * } + */ + public static final OfShort int_least16_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef int32_t int_least32_t + * } + */ + public static final OfInt int_least32_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef int64_t int_least64_t + * } + */ + public static final OfLong int_least64_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef uint8_t uint_least8_t + * } + */ + public static final OfByte uint_least8_t = somelib_h.C_CHAR; + /** + * {@snippet lang=c : + * typedef uint16_t uint_least16_t + * } + */ + public static final OfShort uint_least16_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef uint32_t uint_least32_t + * } + */ + public static final OfInt uint_least32_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef uint64_t uint_least64_t + * } + */ + public static final OfLong uint_least64_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef int8_t int_fast8_t + * } + */ + public static final OfByte int_fast8_t = somelib_h.C_CHAR; + /** + * {@snippet lang=c : + * typedef int16_t int_fast16_t + * } + */ + public static final OfShort int_fast16_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef int32_t int_fast32_t + * } + */ + public static final OfInt int_fast32_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef int64_t int_fast64_t + * } + */ + public static final OfLong int_fast64_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef uint8_t uint_fast8_t + * } + */ + public static final OfByte uint_fast8_t = somelib_h.C_CHAR; + /** + * {@snippet lang=c : + * typedef uint16_t uint_fast16_t + * } + */ + public static final OfShort uint_fast16_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef uint32_t uint_fast32_t + * } + */ + public static final OfInt uint_fast32_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef uint64_t uint_fast64_t + * } + */ + public static final OfLong uint_fast64_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef long intmax_t + * } + */ + public static final OfLong intmax_t = somelib_h.C_LONG; + /** + * {@snippet lang=c : + * typedef unsigned long uintmax_t + * } + */ + public static final OfLong uintmax_t = somelib_h.C_LONG; + /** + * {@snippet lang=c : + * typedef long ptrdiff_t + * } + */ + public static final OfLong ptrdiff_t = somelib_h.C_LONG; + /** + * {@snippet lang=c : + * typedef unsigned long rsize_t + * } + */ + public static final OfLong rsize_t = somelib_h.C_LONG; + /** + * {@snippet lang=c : + * typedef int wchar_t + * } + */ + public static final OfInt wchar_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef unsigned char u_char + * } + */ + public static final OfByte u_char = somelib_h.C_CHAR; + /** + * {@snippet lang=c : + * typedef unsigned short u_short + * } + */ + public static final OfShort u_short = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef unsigned int u_int + * } + */ + public static final OfInt u_int = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef unsigned long u_long + * } + */ + public static final OfLong u_long = somelib_h.C_LONG; + /** + * {@snippet lang=c : + * typedef unsigned short ushort + * } + */ + public static final OfShort ushort = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef unsigned int uint + * } + */ + public static final OfInt uint = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef u_int64_t u_quad_t + * } + */ + public static final OfLong u_quad_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef int64_t quad_t + * } + */ + public static final OfLong quad_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef quad_t *qaddr_t + * } + */ + public static final AddressLayout qaddr_t = somelib_h.C_POINTER; + /** + * {@snippet lang=c : + * typedef char *caddr_t + * } + */ + public static final AddressLayout caddr_t = somelib_h.C_POINTER; + /** + * {@snippet lang=c : + * typedef int32_t daddr_t + * } + */ + public static final OfInt daddr_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef __darwin_dev_t dev_t + * } + */ + public static final OfInt dev_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef u_int32_t fixpt_t + * } + */ + public static final OfInt fixpt_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef __darwin_blkcnt_t blkcnt_t + * } + */ + public static final OfLong blkcnt_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef __darwin_blksize_t blksize_t + * } + */ + public static final OfInt blksize_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef __darwin_gid_t gid_t + * } + */ + public static final OfInt gid_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef __uint32_t in_addr_t + * } + */ + public static final OfInt in_addr_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef __uint16_t in_port_t + * } + */ + public static final OfShort in_port_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef __darwin_ino_t ino_t + * } + */ + public static final OfLong ino_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef __darwin_ino64_t ino64_t + * } + */ + public static final OfLong ino64_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef __int32_t key_t + * } + */ + public static final OfInt key_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef __darwin_mode_t mode_t + * } + */ + public static final OfShort mode_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef __uint16_t nlink_t + * } + */ + public static final OfShort nlink_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef __darwin_id_t id_t + * } + */ + public static final OfInt id_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef __darwin_pid_t pid_t + * } + */ + public static final OfInt pid_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef int32_t segsz_t + * } + */ + public static final OfInt segsz_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef int32_t swblk_t + * } + */ + public static final OfInt swblk_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef __darwin_uid_t uid_t + * } + */ + public static final OfInt uid_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef __darwin_clock_t clock_t + * } + */ + public static final OfLong clock_t = somelib_h.C_LONG; + /** + * {@snippet lang=c : + * typedef __darwin_time_t time_t + * } + */ + public static final OfLong time_t = somelib_h.C_LONG; + /** + * {@snippet lang=c : + * typedef __darwin_useconds_t useconds_t + * } + */ + public static final OfInt useconds_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef __darwin_suseconds_t suseconds_t + * } + */ + public static final OfInt suseconds_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef int errno_t + * } + */ + public static final OfInt errno_t = somelib_h.C_INT; + + private static class __darwin_check_fd_set_overflow { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_INT + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("__darwin_check_fd_set_overflow"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int __darwin_check_fd_set_overflow(int, const void *, int) + * } + */ + public static FunctionDescriptor __darwin_check_fd_set_overflow$descriptor() { + return __darwin_check_fd_set_overflow.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int __darwin_check_fd_set_overflow(int, const void *, int) + * } + */ + public static MethodHandle __darwin_check_fd_set_overflow$handle() { + return __darwin_check_fd_set_overflow.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int __darwin_check_fd_set_overflow(int, const void *, int) + * } + */ + public static MemorySegment __darwin_check_fd_set_overflow$address() { + return __darwin_check_fd_set_overflow.ADDR; + } + + /** + * {@snippet lang=c : + * int __darwin_check_fd_set_overflow(int, const void *, int) + * } + */ + public static int __darwin_check_fd_set_overflow(int x0, MemorySegment x1, int x2) { + var mh$ = __darwin_check_fd_set_overflow.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("__darwin_check_fd_set_overflow", x0, x1, x2); + } + return (int)mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + /** + * {@snippet lang=c : + * typedef __int32_t fd_mask + * } + */ + public static final OfInt fd_mask = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef __darwin_pthread_t pthread_t + * } + */ + public static final AddressLayout pthread_t = somelib_h.C_POINTER; + /** + * {@snippet lang=c : + * typedef __darwin_pthread_key_t pthread_key_t + * } + */ + public static final OfLong pthread_key_t = somelib_h.C_LONG; + /** + * {@snippet lang=c : + * typedef __darwin_fsblkcnt_t fsblkcnt_t + * } + */ + public static final OfInt fsblkcnt_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef __darwin_fsfilcnt_t fsfilcnt_t + * } + */ + public static final OfInt fsfilcnt_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef uint16_t char16_t + * } + */ + public static final OfShort char16_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef uint32_t char32_t + * } + */ + public static final OfInt char32_t = somelib_h.C_INT; + + private static class diplomat_simple_write { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + DiplomatWrite.layout(), + somelib_h.C_POINTER, + somelib_h.C_LONG + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_simple_write"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) + * } + */ + public static FunctionDescriptor diplomat_simple_write$descriptor() { + return diplomat_simple_write.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) + * } + */ + public static MethodHandle diplomat_simple_write$handle() { + return diplomat_simple_write.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) + * } + */ + public static MemorySegment diplomat_simple_write$address() { + return diplomat_simple_write.ADDR; + } + + /** + * {@snippet lang=c : + * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) + * } + */ + public static MemorySegment diplomat_simple_write(SegmentAllocator allocator, MemorySegment buf, long buf_size) { + var mh$ = diplomat_simple_write.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("diplomat_simple_write", allocator, buf, buf_size); + } + return (MemorySegment)mh$.invokeExact(allocator, buf, buf_size); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class diplomat_buffer_write_create { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_LONG + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_create"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * DiplomatWrite *diplomat_buffer_write_create(size_t cap) + * } + */ + public static FunctionDescriptor diplomat_buffer_write_create$descriptor() { + return diplomat_buffer_write_create.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * DiplomatWrite *diplomat_buffer_write_create(size_t cap) + * } + */ + public static MethodHandle diplomat_buffer_write_create$handle() { + return diplomat_buffer_write_create.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * DiplomatWrite *diplomat_buffer_write_create(size_t cap) + * } + */ + public static MemorySegment diplomat_buffer_write_create$address() { + return diplomat_buffer_write_create.ADDR; + } + + /** + * {@snippet lang=c : + * DiplomatWrite *diplomat_buffer_write_create(size_t cap) + * } + */ + public static MemorySegment diplomat_buffer_write_create(long cap) { + var mh$ = diplomat_buffer_write_create.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("diplomat_buffer_write_create", cap); + } + return (MemorySegment)mh$.invokeExact(cap); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class diplomat_buffer_write_get_bytes { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_get_bytes"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) + * } + */ + public static FunctionDescriptor diplomat_buffer_write_get_bytes$descriptor() { + return diplomat_buffer_write_get_bytes.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) + * } + */ + public static MethodHandle diplomat_buffer_write_get_bytes$handle() { + return diplomat_buffer_write_get_bytes.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) + * } + */ + public static MemorySegment diplomat_buffer_write_get_bytes$address() { + return diplomat_buffer_write_get_bytes.ADDR; + } + + /** + * {@snippet lang=c : + * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) + * } + */ + public static MemorySegment diplomat_buffer_write_get_bytes(MemorySegment t) { + var mh$ = diplomat_buffer_write_get_bytes.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("diplomat_buffer_write_get_bytes", t); + } + return (MemorySegment)mh$.invokeExact(t); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class diplomat_buffer_write_len { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_LONG, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_len"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * size_t diplomat_buffer_write_len(DiplomatWrite *t) + * } + */ + public static FunctionDescriptor diplomat_buffer_write_len$descriptor() { + return diplomat_buffer_write_len.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * size_t diplomat_buffer_write_len(DiplomatWrite *t) + * } + */ + public static MethodHandle diplomat_buffer_write_len$handle() { + return diplomat_buffer_write_len.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * size_t diplomat_buffer_write_len(DiplomatWrite *t) + * } + */ + public static MemorySegment diplomat_buffer_write_len$address() { + return diplomat_buffer_write_len.ADDR; + } + + /** + * {@snippet lang=c : + * size_t diplomat_buffer_write_len(DiplomatWrite *t) + * } + */ + public static long diplomat_buffer_write_len(MemorySegment t) { + var mh$ = diplomat_buffer_write_len.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("diplomat_buffer_write_len", t); + } + return (long)mh$.invokeExact(t); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class diplomat_buffer_write_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_destroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void diplomat_buffer_write_destroy(DiplomatWrite *t) + * } + */ + public static FunctionDescriptor diplomat_buffer_write_destroy$descriptor() { + return diplomat_buffer_write_destroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void diplomat_buffer_write_destroy(DiplomatWrite *t) + * } + */ + public static MethodHandle diplomat_buffer_write_destroy$handle() { + return diplomat_buffer_write_destroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void diplomat_buffer_write_destroy(DiplomatWrite *t) + * } + */ + public static MemorySegment diplomat_buffer_write_destroy$address() { + return diplomat_buffer_write_destroy.ADDR; + } + + /** + * {@snippet lang=c : + * void diplomat_buffer_write_destroy(DiplomatWrite *t) + * } + */ + public static void diplomat_buffer_write_destroy(MemorySegment t) { + var mh$ = diplomat_buffer_write_destroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("diplomat_buffer_write_destroy", t); + } + mh$.invokeExact(t); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class diplomat_is_str { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_BOOL, + somelib_h.C_POINTER, + somelib_h.C_LONG + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_is_str"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * bool diplomat_is_str(const char *buf, size_t len) + * } + */ + public static FunctionDescriptor diplomat_is_str$descriptor() { + return diplomat_is_str.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * bool diplomat_is_str(const char *buf, size_t len) + * } + */ + public static MethodHandle diplomat_is_str$handle() { + return diplomat_is_str.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * bool diplomat_is_str(const char *buf, size_t len) + * } + */ + public static MemorySegment diplomat_is_str$address() { + return diplomat_is_str.ADDR; + } + + /** + * {@snippet lang=c : + * bool diplomat_is_str(const char *buf, size_t len) + * } + */ + public static boolean diplomat_is_str(MemorySegment buf, long len) { + var mh$ = diplomat_is_str.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("diplomat_is_str", buf, len); + } + return (boolean)mh$.invokeExact(buf, len); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class Float64Vec_new { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * Float64Vec *Float64Vec_new(const double *v_data, size_t v_len) + * } + */ + public static FunctionDescriptor Float64Vec_new$descriptor() { + return Float64Vec_new.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * Float64Vec *Float64Vec_new(const double *v_data, size_t v_len) + * } + */ + public static MethodHandle Float64Vec_new$handle() { + return Float64Vec_new.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * Float64Vec *Float64Vec_new(const double *v_data, size_t v_len) + * } + */ + public static MemorySegment Float64Vec_new$address() { + return Float64Vec_new.ADDR; + } + + /** + * {@snippet lang=c : + * Float64Vec *Float64Vec_new(const double *v_data, size_t v_len) + * } + */ + public static MemorySegment Float64Vec_new(MemorySegment v_data, long v_len) { + var mh$ = Float64Vec_new.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Float64Vec_new", v_data, v_len); + } + return (MemorySegment)mh$.invokeExact(v_data, v_len); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class Float64Vec_new_bool { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_bool"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * Float64Vec *Float64Vec_new_bool(const bool *v_data, size_t v_len) + * } + */ + public static FunctionDescriptor Float64Vec_new_bool$descriptor() { + return Float64Vec_new_bool.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * Float64Vec *Float64Vec_new_bool(const bool *v_data, size_t v_len) + * } + */ + public static MethodHandle Float64Vec_new_bool$handle() { + return Float64Vec_new_bool.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * Float64Vec *Float64Vec_new_bool(const bool *v_data, size_t v_len) + * } + */ + public static MemorySegment Float64Vec_new_bool$address() { + return Float64Vec_new_bool.ADDR; + } + + /** + * {@snippet lang=c : + * Float64Vec *Float64Vec_new_bool(const bool *v_data, size_t v_len) + * } + */ + public static MemorySegment Float64Vec_new_bool(MemorySegment v_data, long v_len) { + var mh$ = Float64Vec_new_bool.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Float64Vec_new_bool", v_data, v_len); + } + return (MemorySegment)mh$.invokeExact(v_data, v_len); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class Float64Vec_new_i16 { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_i16"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * Float64Vec *Float64Vec_new_i16(const int16_t *v_data, size_t v_len) + * } + */ + public static FunctionDescriptor Float64Vec_new_i16$descriptor() { + return Float64Vec_new_i16.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * Float64Vec *Float64Vec_new_i16(const int16_t *v_data, size_t v_len) + * } + */ + public static MethodHandle Float64Vec_new_i16$handle() { + return Float64Vec_new_i16.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * Float64Vec *Float64Vec_new_i16(const int16_t *v_data, size_t v_len) + * } + */ + public static MemorySegment Float64Vec_new_i16$address() { + return Float64Vec_new_i16.ADDR; + } + + /** + * {@snippet lang=c : + * Float64Vec *Float64Vec_new_i16(const int16_t *v_data, size_t v_len) + * } + */ + public static MemorySegment Float64Vec_new_i16(MemorySegment v_data, long v_len) { + var mh$ = Float64Vec_new_i16.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Float64Vec_new_i16", v_data, v_len); + } + return (MemorySegment)mh$.invokeExact(v_data, v_len); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class Float64Vec_new_u16 { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_u16"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * Float64Vec *Float64Vec_new_u16(const uint16_t *v_data, size_t v_len) + * } + */ + public static FunctionDescriptor Float64Vec_new_u16$descriptor() { + return Float64Vec_new_u16.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * Float64Vec *Float64Vec_new_u16(const uint16_t *v_data, size_t v_len) + * } + */ + public static MethodHandle Float64Vec_new_u16$handle() { + return Float64Vec_new_u16.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * Float64Vec *Float64Vec_new_u16(const uint16_t *v_data, size_t v_len) + * } + */ + public static MemorySegment Float64Vec_new_u16$address() { + return Float64Vec_new_u16.ADDR; + } + + /** + * {@snippet lang=c : + * Float64Vec *Float64Vec_new_u16(const uint16_t *v_data, size_t v_len) + * } + */ + public static MemorySegment Float64Vec_new_u16(MemorySegment v_data, long v_len) { + var mh$ = Float64Vec_new_u16.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Float64Vec_new_u16", v_data, v_len); + } + return (MemorySegment)mh$.invokeExact(v_data, v_len); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class Float64Vec_new_isize { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_isize"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * Float64Vec *Float64Vec_new_isize(const intptr_t *v_data, size_t v_len) + * } + */ + public static FunctionDescriptor Float64Vec_new_isize$descriptor() { + return Float64Vec_new_isize.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * Float64Vec *Float64Vec_new_isize(const intptr_t *v_data, size_t v_len) + * } + */ + public static MethodHandle Float64Vec_new_isize$handle() { + return Float64Vec_new_isize.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * Float64Vec *Float64Vec_new_isize(const intptr_t *v_data, size_t v_len) + * } + */ + public static MemorySegment Float64Vec_new_isize$address() { + return Float64Vec_new_isize.ADDR; + } + + /** + * {@snippet lang=c : + * Float64Vec *Float64Vec_new_isize(const intptr_t *v_data, size_t v_len) + * } + */ + public static MemorySegment Float64Vec_new_isize(MemorySegment v_data, long v_len) { + var mh$ = Float64Vec_new_isize.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Float64Vec_new_isize", v_data, v_len); + } + return (MemorySegment)mh$.invokeExact(v_data, v_len); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class Float64Vec_new_usize { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_usize"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * Float64Vec *Float64Vec_new_usize(const size_t *v_data, size_t v_len) + * } + */ + public static FunctionDescriptor Float64Vec_new_usize$descriptor() { + return Float64Vec_new_usize.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * Float64Vec *Float64Vec_new_usize(const size_t *v_data, size_t v_len) + * } + */ + public static MethodHandle Float64Vec_new_usize$handle() { + return Float64Vec_new_usize.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * Float64Vec *Float64Vec_new_usize(const size_t *v_data, size_t v_len) + * } + */ + public static MemorySegment Float64Vec_new_usize$address() { + return Float64Vec_new_usize.ADDR; + } + + /** + * {@snippet lang=c : + * Float64Vec *Float64Vec_new_usize(const size_t *v_data, size_t v_len) + * } + */ + public static MemorySegment Float64Vec_new_usize(MemorySegment v_data, long v_len) { + var mh$ = Float64Vec_new_usize.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Float64Vec_new_usize", v_data, v_len); + } + return (MemorySegment)mh$.invokeExact(v_data, v_len); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class Float64Vec_new_f64_be_bytes { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_f64_be_bytes"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * Float64Vec *Float64Vec_new_f64_be_bytes(const uint8_t *v_data, size_t v_len) + * } + */ + public static FunctionDescriptor Float64Vec_new_f64_be_bytes$descriptor() { + return Float64Vec_new_f64_be_bytes.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * Float64Vec *Float64Vec_new_f64_be_bytes(const uint8_t *v_data, size_t v_len) + * } + */ + public static MethodHandle Float64Vec_new_f64_be_bytes$handle() { + return Float64Vec_new_f64_be_bytes.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * Float64Vec *Float64Vec_new_f64_be_bytes(const uint8_t *v_data, size_t v_len) + * } + */ + public static MemorySegment Float64Vec_new_f64_be_bytes$address() { + return Float64Vec_new_f64_be_bytes.ADDR; + } + + /** + * {@snippet lang=c : + * Float64Vec *Float64Vec_new_f64_be_bytes(const uint8_t *v_data, size_t v_len) + * } + */ + public static MemorySegment Float64Vec_new_f64_be_bytes(MemorySegment v_data, long v_len) { + var mh$ = Float64Vec_new_f64_be_bytes.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Float64Vec_new_f64_be_bytes", v_data, v_len); + } + return (MemorySegment)mh$.invokeExact(v_data, v_len); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class Float64Vec_as_boxed_slice { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + DiplomatF64View.layout(), + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_as_boxed_slice"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * DiplomatF64View Float64Vec_as_boxed_slice(const Float64Vec *self) + * } + */ + public static FunctionDescriptor Float64Vec_as_boxed_slice$descriptor() { + return Float64Vec_as_boxed_slice.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * DiplomatF64View Float64Vec_as_boxed_slice(const Float64Vec *self) + * } + */ + public static MethodHandle Float64Vec_as_boxed_slice$handle() { + return Float64Vec_as_boxed_slice.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * DiplomatF64View Float64Vec_as_boxed_slice(const Float64Vec *self) + * } + */ + public static MemorySegment Float64Vec_as_boxed_slice$address() { + return Float64Vec_as_boxed_slice.ADDR; + } + + /** + * {@snippet lang=c : + * DiplomatF64View Float64Vec_as_boxed_slice(const Float64Vec *self) + * } + */ + public static MemorySegment Float64Vec_as_boxed_slice(SegmentAllocator allocator, MemorySegment self) { + var mh$ = Float64Vec_as_boxed_slice.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Float64Vec_as_boxed_slice", allocator, self); + } + return (MemorySegment)mh$.invokeExact(allocator, self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class Float64Vec_as_slice { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + DiplomatF64View.layout(), + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_as_slice"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) + * } + */ + public static FunctionDescriptor Float64Vec_as_slice$descriptor() { + return Float64Vec_as_slice.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) + * } + */ + public static MethodHandle Float64Vec_as_slice$handle() { + return Float64Vec_as_slice.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) + * } + */ + public static MemorySegment Float64Vec_as_slice$address() { + return Float64Vec_as_slice.ADDR; + } + + /** + * {@snippet lang=c : + * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) + * } + */ + public static MemorySegment Float64Vec_as_slice(SegmentAllocator allocator, MemorySegment self) { + var mh$ = Float64Vec_as_slice.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Float64Vec_as_slice", allocator, self); + } + return (MemorySegment)mh$.invokeExact(allocator, self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class Float64Vec_fill_slice { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_fill_slice"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void Float64Vec_fill_slice(const Float64Vec *self, double *v_data, size_t v_len) + * } + */ + public static FunctionDescriptor Float64Vec_fill_slice$descriptor() { + return Float64Vec_fill_slice.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void Float64Vec_fill_slice(const Float64Vec *self, double *v_data, size_t v_len) + * } + */ + public static MethodHandle Float64Vec_fill_slice$handle() { + return Float64Vec_fill_slice.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void Float64Vec_fill_slice(const Float64Vec *self, double *v_data, size_t v_len) + * } + */ + public static MemorySegment Float64Vec_fill_slice$address() { + return Float64Vec_fill_slice.ADDR; + } + + /** + * {@snippet lang=c : + * void Float64Vec_fill_slice(const Float64Vec *self, double *v_data, size_t v_len) + * } + */ + public static void Float64Vec_fill_slice(MemorySegment self, MemorySegment v_data, long v_len) { + var mh$ = Float64Vec_fill_slice.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Float64Vec_fill_slice", self, v_data, v_len); + } + mh$.invokeExact(self, v_data, v_len); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class Float64Vec_set_value { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_set_value"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void Float64Vec_set_value(Float64Vec *self, const double *new_slice_data, size_t new_slice_len) + * } + */ + public static FunctionDescriptor Float64Vec_set_value$descriptor() { + return Float64Vec_set_value.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void Float64Vec_set_value(Float64Vec *self, const double *new_slice_data, size_t new_slice_len) + * } + */ + public static MethodHandle Float64Vec_set_value$handle() { + return Float64Vec_set_value.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void Float64Vec_set_value(Float64Vec *self, const double *new_slice_data, size_t new_slice_len) + * } + */ + public static MemorySegment Float64Vec_set_value$address() { + return Float64Vec_set_value.ADDR; + } + + /** + * {@snippet lang=c : + * void Float64Vec_set_value(Float64Vec *self, const double *new_slice_data, size_t new_slice_len) + * } + */ + public static void Float64Vec_set_value(MemorySegment self, MemorySegment new_slice_data, long new_slice_len) { + var mh$ = Float64Vec_set_value.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Float64Vec_set_value", self, new_slice_data, new_slice_len); + } + mh$.invokeExact(self, new_slice_data, new_slice_len); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class Float64Vec_to_string { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_to_string"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) + * } + */ + public static FunctionDescriptor Float64Vec_to_string$descriptor() { + return Float64Vec_to_string.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) + * } + */ + public static MethodHandle Float64Vec_to_string$handle() { + return Float64Vec_to_string.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) + * } + */ + public static MemorySegment Float64Vec_to_string$address() { + return Float64Vec_to_string.ADDR; + } + + /** + * {@snippet lang=c : + * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) + * } + */ + public static void Float64Vec_to_string(MemorySegment self, MemorySegment write) { + var mh$ = Float64Vec_to_string.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Float64Vec_to_string", self, write); + } + mh$.invokeExact(self, write); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class Float64Vec_borrow { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + DiplomatF64View.layout(), + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_borrow"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) + * } + */ + public static FunctionDescriptor Float64Vec_borrow$descriptor() { + return Float64Vec_borrow.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) + * } + */ + public static MethodHandle Float64Vec_borrow$handle() { + return Float64Vec_borrow.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) + * } + */ + public static MemorySegment Float64Vec_borrow$address() { + return Float64Vec_borrow.ADDR; + } + + /** + * {@snippet lang=c : + * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) + * } + */ + public static MemorySegment Float64Vec_borrow(SegmentAllocator allocator, MemorySegment self) { + var mh$ = Float64Vec_borrow.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Float64Vec_borrow", allocator, self); + } + return (MemorySegment)mh$.invokeExact(allocator, self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class Float64Vec_get { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + Float64Vec_get_result.layout(), + somelib_h.C_POINTER, + somelib_h.C_LONG + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_get"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * struct Float64Vec_get_result Float64Vec_get(const Float64Vec *self, size_t i) + * } + */ + public static FunctionDescriptor Float64Vec_get$descriptor() { + return Float64Vec_get.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * struct Float64Vec_get_result Float64Vec_get(const Float64Vec *self, size_t i) + * } + */ + public static MethodHandle Float64Vec_get$handle() { + return Float64Vec_get.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * struct Float64Vec_get_result Float64Vec_get(const Float64Vec *self, size_t i) + * } + */ + public static MemorySegment Float64Vec_get$address() { + return Float64Vec_get.ADDR; + } + + /** + * {@snippet lang=c : + * struct Float64Vec_get_result Float64Vec_get(const Float64Vec *self, size_t i) + * } + */ + public static MemorySegment Float64Vec_get(SegmentAllocator allocator, MemorySegment self, long i) { + var mh$ = Float64Vec_get.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Float64Vec_get", allocator, self, i); + } + return (MemorySegment)mh$.invokeExact(allocator, self, i); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class Float64Vec_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_destroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void Float64Vec_destroy(Float64Vec *self) + * } + */ + public static FunctionDescriptor Float64Vec_destroy$descriptor() { + return Float64Vec_destroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void Float64Vec_destroy(Float64Vec *self) + * } + */ + public static MethodHandle Float64Vec_destroy$handle() { + return Float64Vec_destroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void Float64Vec_destroy(Float64Vec *self) + * } + */ + public static MemorySegment Float64Vec_destroy$address() { + return Float64Vec_destroy.ADDR; + } + + /** + * {@snippet lang=c : + * void Float64Vec_destroy(Float64Vec *self) + * } + */ + public static void Float64Vec_destroy(MemorySegment self) { + var mh$ = Float64Vec_destroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Float64Vec_destroy", self); + } + mh$.invokeExact(self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + private static final int MyEnum_A = (int)-2L; + /** + * {@snippet lang=c : + * enum MyEnum.MyEnum_A = -2 + * } + */ + public static int MyEnum_A() { + return MyEnum_A; + } + private static final int MyEnum_B = (int)-1L; + /** + * {@snippet lang=c : + * enum MyEnum.MyEnum_B = -1 + * } + */ + public static int MyEnum_B() { + return MyEnum_B; + } + private static final int MyEnum_C = (int)0L; + /** + * {@snippet lang=c : + * enum MyEnum.MyEnum_C = 0 + * } + */ + public static int MyEnum_C() { + return MyEnum_C; + } + private static final int MyEnum_D = (int)1L; + /** + * {@snippet lang=c : + * enum MyEnum.MyEnum_D = 1 + * } + */ + public static int MyEnum_D() { + return MyEnum_D; + } + private static final int MyEnum_E = (int)2L; + /** + * {@snippet lang=c : + * enum MyEnum.MyEnum_E = 2 + * } + */ + public static int MyEnum_E() { + return MyEnum_E; + } + private static final int MyEnum_F = (int)3L; + /** + * {@snippet lang=c : + * enum MyEnum.MyEnum_F = 3 + * } + */ + public static int MyEnum_F() { + return MyEnum_F; + } + + /** + * Variadic invoker class for: + * {@snippet lang=c : + * MyStruct MyStruct_new() + * } + */ + public static class MyStruct_new { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + MyStruct.layout() ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("MyStruct_new"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private MyStruct_new(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * MyStruct MyStruct_new() + * } + */ + public static MyStruct_new makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new MyStruct_new(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public MemorySegment apply(SegmentAllocator allocator, Object... x0) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("MyStruct_new", allocator, x0); + } + return (MemorySegment)spreader.invokeExact(allocator, x0); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static class MyStruct_into_a { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_CHAR, + MyStruct.layout() + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyStruct_into_a"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * uint8_t MyStruct_into_a(MyStruct self) + * } + */ + public static FunctionDescriptor MyStruct_into_a$descriptor() { + return MyStruct_into_a.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * uint8_t MyStruct_into_a(MyStruct self) + * } + */ + public static MethodHandle MyStruct_into_a$handle() { + return MyStruct_into_a.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * uint8_t MyStruct_into_a(MyStruct self) + * } + */ + public static MemorySegment MyStruct_into_a$address() { + return MyStruct_into_a.ADDR; + } + + /** + * {@snippet lang=c : + * uint8_t MyStruct_into_a(MyStruct self) + * } + */ + public static byte MyStruct_into_a(MemorySegment self) { + var mh$ = MyStruct_into_a.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("MyStruct_into_a", self); + } + return (byte)mh$.invokeExact(self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + /** + * Variadic invoker class for: + * {@snippet lang=c : + * struct MyStruct_returns_zst_result_result MyStruct_returns_zst_result() + * } + */ + public static class MyStruct_returns_zst_result { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + MyStruct_returns_zst_result_result.layout() ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("MyStruct_returns_zst_result"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private MyStruct_returns_zst_result(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * struct MyStruct_returns_zst_result_result MyStruct_returns_zst_result() + * } + */ + public static MyStruct_returns_zst_result makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new MyStruct_returns_zst_result(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public MemorySegment apply(SegmentAllocator allocator, Object... x0) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("MyStruct_returns_zst_result", allocator, x0); + } + return (MemorySegment)spreader.invokeExact(allocator, x0); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static class namespace_AttrOpaque2_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_AttrOpaque2_destroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void namespace_AttrOpaque2_destroy(AttrOpaque2 *self) + * } + */ + public static FunctionDescriptor namespace_AttrOpaque2_destroy$descriptor() { + return namespace_AttrOpaque2_destroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void namespace_AttrOpaque2_destroy(AttrOpaque2 *self) + * } + */ + public static MethodHandle namespace_AttrOpaque2_destroy$handle() { + return namespace_AttrOpaque2_destroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void namespace_AttrOpaque2_destroy(AttrOpaque2 *self) + * } + */ + public static MemorySegment namespace_AttrOpaque2_destroy$address() { + return namespace_AttrOpaque2_destroy.ADDR; + } + + /** + * {@snippet lang=c : + * void namespace_AttrOpaque2_destroy(AttrOpaque2 *self) + * } + */ + public static void namespace_AttrOpaque2_destroy(MemorySegment self) { + var mh$ = namespace_AttrOpaque2_destroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("namespace_AttrOpaque2_destroy", self); + } + mh$.invokeExact(self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + private static final int AttrEnum_A = (int)0L; + /** + * {@snippet lang=c : + * enum AttrEnum.AttrEnum_A = 0 + * } + */ + public static int AttrEnum_A() { + return AttrEnum_A; + } + private static final int AttrEnum_B = (int)1L; + /** + * {@snippet lang=c : + * enum AttrEnum.AttrEnum_B = 1 + * } + */ + public static int AttrEnum_B() { + return AttrEnum_B; + } + private static final int AttrEnum_C = (int)2L; + /** + * {@snippet lang=c : + * enum AttrEnum.AttrEnum_C = 2 + * } + */ + public static int AttrEnum_C() { + return AttrEnum_C; + } + + private static class Foo_new { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_new"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * Foo *Foo_new(const char *x_data, size_t x_len) + * } + */ + public static FunctionDescriptor Foo_new$descriptor() { + return Foo_new.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * Foo *Foo_new(const char *x_data, size_t x_len) + * } + */ + public static MethodHandle Foo_new$handle() { + return Foo_new.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * Foo *Foo_new(const char *x_data, size_t x_len) + * } + */ + public static MemorySegment Foo_new$address() { + return Foo_new.ADDR; + } + + /** + * {@snippet lang=c : + * Foo *Foo_new(const char *x_data, size_t x_len) + * } + */ + public static MemorySegment Foo_new(MemorySegment x_data, long x_len) { + var mh$ = Foo_new.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Foo_new", x_data, x_len); + } + return (MemorySegment)mh$.invokeExact(x_data, x_len); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class Foo_get_bar { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_get_bar"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * Bar *Foo_get_bar(const Foo *self) + * } + */ + public static FunctionDescriptor Foo_get_bar$descriptor() { + return Foo_get_bar.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * Bar *Foo_get_bar(const Foo *self) + * } + */ + public static MethodHandle Foo_get_bar$handle() { + return Foo_get_bar.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * Bar *Foo_get_bar(const Foo *self) + * } + */ + public static MemorySegment Foo_get_bar$address() { + return Foo_get_bar.ADDR; + } + + /** + * {@snippet lang=c : + * Bar *Foo_get_bar(const Foo *self) + * } + */ + public static MemorySegment Foo_get_bar(MemorySegment self) { + var mh$ = Foo_get_bar.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Foo_get_bar", self); + } + return (MemorySegment)mh$.invokeExact(self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class Foo_new_static { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_new_static"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * Foo *Foo_new_static(const char *x_data, size_t x_len) + * } + */ + public static FunctionDescriptor Foo_new_static$descriptor() { + return Foo_new_static.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * Foo *Foo_new_static(const char *x_data, size_t x_len) + * } + */ + public static MethodHandle Foo_new_static$handle() { + return Foo_new_static.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * Foo *Foo_new_static(const char *x_data, size_t x_len) + * } + */ + public static MemorySegment Foo_new_static$address() { + return Foo_new_static.ADDR; + } + + /** + * {@snippet lang=c : + * Foo *Foo_new_static(const char *x_data, size_t x_len) + * } + */ + public static MemorySegment Foo_new_static(MemorySegment x_data, long x_len) { + var mh$ = Foo_new_static.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Foo_new_static", x_data, x_len); + } + return (MemorySegment)mh$.invokeExact(x_data, x_len); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class Foo_as_returning { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + BorrowedFieldsReturning.layout(), + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_as_returning"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * BorrowedFieldsReturning Foo_as_returning(const Foo *self) + * } + */ + public static FunctionDescriptor Foo_as_returning$descriptor() { + return Foo_as_returning.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * BorrowedFieldsReturning Foo_as_returning(const Foo *self) + * } + */ + public static MethodHandle Foo_as_returning$handle() { + return Foo_as_returning.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * BorrowedFieldsReturning Foo_as_returning(const Foo *self) + * } + */ + public static MemorySegment Foo_as_returning$address() { + return Foo_as_returning.ADDR; + } + + /** + * {@snippet lang=c : + * BorrowedFieldsReturning Foo_as_returning(const Foo *self) + * } + */ + public static MemorySegment Foo_as_returning(SegmentAllocator allocator, MemorySegment self) { + var mh$ = Foo_as_returning.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Foo_as_returning", allocator, self); + } + return (MemorySegment)mh$.invokeExact(allocator, self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class Foo_extract_from_fields { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + BorrowedFields.layout() + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_extract_from_fields"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * Foo *Foo_extract_from_fields(BorrowedFields fields) + * } + */ + public static FunctionDescriptor Foo_extract_from_fields$descriptor() { + return Foo_extract_from_fields.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * Foo *Foo_extract_from_fields(BorrowedFields fields) + * } + */ + public static MethodHandle Foo_extract_from_fields$handle() { + return Foo_extract_from_fields.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * Foo *Foo_extract_from_fields(BorrowedFields fields) + * } + */ + public static MemorySegment Foo_extract_from_fields$address() { + return Foo_extract_from_fields.ADDR; + } + + /** + * {@snippet lang=c : + * Foo *Foo_extract_from_fields(BorrowedFields fields) + * } + */ + public static MemorySegment Foo_extract_from_fields(MemorySegment fields) { + var mh$ = Foo_extract_from_fields.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Foo_extract_from_fields", fields); + } + return (MemorySegment)mh$.invokeExact(fields); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class Foo_extract_from_bounds { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + BorrowedFieldsWithBounds.layout(), + somelib_h.C_POINTER, + somelib_h.C_LONG + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_extract_from_bounds"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, const char *another_string_data, size_t another_string_len) + * } + */ + public static FunctionDescriptor Foo_extract_from_bounds$descriptor() { + return Foo_extract_from_bounds.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, const char *another_string_data, size_t another_string_len) + * } + */ + public static MethodHandle Foo_extract_from_bounds$handle() { + return Foo_extract_from_bounds.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, const char *another_string_data, size_t another_string_len) + * } + */ + public static MemorySegment Foo_extract_from_bounds$address() { + return Foo_extract_from_bounds.ADDR; + } + + /** + * {@snippet lang=c : + * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, const char *another_string_data, size_t another_string_len) + * } + */ + public static MemorySegment Foo_extract_from_bounds(MemorySegment bounds, MemorySegment another_string_data, long another_string_len) { + var mh$ = Foo_extract_from_bounds.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Foo_extract_from_bounds", bounds, another_string_data, another_string_len); + } + return (MemorySegment)mh$.invokeExact(bounds, another_string_data, another_string_len); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class Foo_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_destroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void Foo_destroy(Foo *self) + * } + */ + public static FunctionDescriptor Foo_destroy$descriptor() { + return Foo_destroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void Foo_destroy(Foo *self) + * } + */ + public static MethodHandle Foo_destroy$handle() { + return Foo_destroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void Foo_destroy(Foo *self) + * } + */ + public static MemorySegment Foo_destroy$address() { + return Foo_destroy.ADDR; + } + + /** + * {@snippet lang=c : + * void Foo_destroy(Foo *self) + * } + */ + public static void Foo_destroy(MemorySegment self) { + var mh$ = Foo_destroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Foo_destroy", self); + } + mh$.invokeExact(self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + /** + * Variadic invoker class for: + * {@snippet lang=c : + * AttrOpaque1 *namespace_AttrOpaque1_new() + * } + */ + public static class namespace_AttrOpaque1_new { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + somelib_h.C_POINTER ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_AttrOpaque1_new"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private namespace_AttrOpaque1_new(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * AttrOpaque1 *namespace_AttrOpaque1_new() + * } + */ + public static namespace_AttrOpaque1_new makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new namespace_AttrOpaque1_new(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public MemorySegment apply(Object... x0) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("namespace_AttrOpaque1_new", x0); + } + return (MemorySegment)spreader.invokeExact(x0); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static class namespace_AttrOpaque1_method { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_CHAR, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_AttrOpaque1_method"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * uint8_t namespace_AttrOpaque1_method(const AttrOpaque1 *self) + * } + */ + public static FunctionDescriptor namespace_AttrOpaque1_method$descriptor() { + return namespace_AttrOpaque1_method.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * uint8_t namespace_AttrOpaque1_method(const AttrOpaque1 *self) + * } + */ + public static MethodHandle namespace_AttrOpaque1_method$handle() { + return namespace_AttrOpaque1_method.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * uint8_t namespace_AttrOpaque1_method(const AttrOpaque1 *self) + * } + */ + public static MemorySegment namespace_AttrOpaque1_method$address() { + return namespace_AttrOpaque1_method.ADDR; + } + + /** + * {@snippet lang=c : + * uint8_t namespace_AttrOpaque1_method(const AttrOpaque1 *self) + * } + */ + public static byte namespace_AttrOpaque1_method(MemorySegment self) { + var mh$ = namespace_AttrOpaque1_method.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("namespace_AttrOpaque1_method", self); + } + return (byte)mh$.invokeExact(self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class renamed_on_abi_only { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_CHAR, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("renamed_on_abi_only"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * uint8_t renamed_on_abi_only(const AttrOpaque1 *self) + * } + */ + public static FunctionDescriptor renamed_on_abi_only$descriptor() { + return renamed_on_abi_only.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * uint8_t renamed_on_abi_only(const AttrOpaque1 *self) + * } + */ + public static MethodHandle renamed_on_abi_only$handle() { + return renamed_on_abi_only.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * uint8_t renamed_on_abi_only(const AttrOpaque1 *self) + * } + */ + public static MemorySegment renamed_on_abi_only$address() { + return renamed_on_abi_only.ADDR; + } + + /** + * {@snippet lang=c : + * uint8_t renamed_on_abi_only(const AttrOpaque1 *self) + * } + */ + public static byte renamed_on_abi_only(MemorySegment self) { + var mh$ = renamed_on_abi_only.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("renamed_on_abi_only", self); + } + return (byte)mh$.invokeExact(self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class namespace_AttrOpaque1_method_disabledcpp { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_AttrOpaque1_method_disabledcpp"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void namespace_AttrOpaque1_method_disabledcpp(const AttrOpaque1 *self) + * } + */ + public static FunctionDescriptor namespace_AttrOpaque1_method_disabledcpp$descriptor() { + return namespace_AttrOpaque1_method_disabledcpp.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void namespace_AttrOpaque1_method_disabledcpp(const AttrOpaque1 *self) + * } + */ + public static MethodHandle namespace_AttrOpaque1_method_disabledcpp$handle() { + return namespace_AttrOpaque1_method_disabledcpp.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void namespace_AttrOpaque1_method_disabledcpp(const AttrOpaque1 *self) + * } + */ + public static MemorySegment namespace_AttrOpaque1_method_disabledcpp$address() { + return namespace_AttrOpaque1_method_disabledcpp.ADDR; + } + + /** + * {@snippet lang=c : + * void namespace_AttrOpaque1_method_disabledcpp(const AttrOpaque1 *self) + * } + */ + public static void namespace_AttrOpaque1_method_disabledcpp(MemorySegment self) { + var mh$ = namespace_AttrOpaque1_method_disabledcpp.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("namespace_AttrOpaque1_method_disabledcpp", self); + } + mh$.invokeExact(self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class namespace_AttrOpaque1_use_unnamespaced { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_AttrOpaque1_use_unnamespaced"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void namespace_AttrOpaque1_use_unnamespaced(const AttrOpaque1 *self, const Unnamespaced *_un) + * } + */ + public static FunctionDescriptor namespace_AttrOpaque1_use_unnamespaced$descriptor() { + return namespace_AttrOpaque1_use_unnamespaced.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void namespace_AttrOpaque1_use_unnamespaced(const AttrOpaque1 *self, const Unnamespaced *_un) + * } + */ + public static MethodHandle namespace_AttrOpaque1_use_unnamespaced$handle() { + return namespace_AttrOpaque1_use_unnamespaced.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void namespace_AttrOpaque1_use_unnamespaced(const AttrOpaque1 *self, const Unnamespaced *_un) + * } + */ + public static MemorySegment namespace_AttrOpaque1_use_unnamespaced$address() { + return namespace_AttrOpaque1_use_unnamespaced.ADDR; + } + + /** + * {@snippet lang=c : + * void namespace_AttrOpaque1_use_unnamespaced(const AttrOpaque1 *self, const Unnamespaced *_un) + * } + */ + public static void namespace_AttrOpaque1_use_unnamespaced(MemorySegment self, MemorySegment _un) { + var mh$ = namespace_AttrOpaque1_use_unnamespaced.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("namespace_AttrOpaque1_use_unnamespaced", self, _un); + } + mh$.invokeExact(self, _un); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class namespace_AttrOpaque1_use_namespaced { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, + somelib_h.C_INT + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_AttrOpaque1_use_namespaced"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void namespace_AttrOpaque1_use_namespaced(const AttrOpaque1 *self, AttrEnum _n) + * } + */ + public static FunctionDescriptor namespace_AttrOpaque1_use_namespaced$descriptor() { + return namespace_AttrOpaque1_use_namespaced.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void namespace_AttrOpaque1_use_namespaced(const AttrOpaque1 *self, AttrEnum _n) + * } + */ + public static MethodHandle namespace_AttrOpaque1_use_namespaced$handle() { + return namespace_AttrOpaque1_use_namespaced.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void namespace_AttrOpaque1_use_namespaced(const AttrOpaque1 *self, AttrEnum _n) + * } + */ + public static MemorySegment namespace_AttrOpaque1_use_namespaced$address() { + return namespace_AttrOpaque1_use_namespaced.ADDR; + } + + /** + * {@snippet lang=c : + * void namespace_AttrOpaque1_use_namespaced(const AttrOpaque1 *self, AttrEnum _n) + * } + */ + public static void namespace_AttrOpaque1_use_namespaced(MemorySegment self, int _n) { + var mh$ = namespace_AttrOpaque1_use_namespaced.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("namespace_AttrOpaque1_use_namespaced", self, _n); + } + mh$.invokeExact(self, _n); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class namespace_AttrOpaque1_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_AttrOpaque1_destroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void namespace_AttrOpaque1_destroy(AttrOpaque1 *self) + * } + */ + public static FunctionDescriptor namespace_AttrOpaque1_destroy$descriptor() { + return namespace_AttrOpaque1_destroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void namespace_AttrOpaque1_destroy(AttrOpaque1 *self) + * } + */ + public static MethodHandle namespace_AttrOpaque1_destroy$handle() { + return namespace_AttrOpaque1_destroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void namespace_AttrOpaque1_destroy(AttrOpaque1 *self) + * } + */ + public static MemorySegment namespace_AttrOpaque1_destroy$address() { + return namespace_AttrOpaque1_destroy.ADDR; + } + + /** + * {@snippet lang=c : + * void namespace_AttrOpaque1_destroy(AttrOpaque1 *self) + * } + */ + public static void namespace_AttrOpaque1_destroy(MemorySegment self) { + var mh$ = namespace_AttrOpaque1_destroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("namespace_AttrOpaque1_destroy", self); + } + mh$.invokeExact(self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class Utf16Wrap_from_utf16 { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_from_utf16"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * Utf16Wrap *Utf16Wrap_from_utf16(const char16_t *input_data, size_t input_len) + * } + */ + public static FunctionDescriptor Utf16Wrap_from_utf16$descriptor() { + return Utf16Wrap_from_utf16.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * Utf16Wrap *Utf16Wrap_from_utf16(const char16_t *input_data, size_t input_len) + * } + */ + public static MethodHandle Utf16Wrap_from_utf16$handle() { + return Utf16Wrap_from_utf16.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * Utf16Wrap *Utf16Wrap_from_utf16(const char16_t *input_data, size_t input_len) + * } + */ + public static MemorySegment Utf16Wrap_from_utf16$address() { + return Utf16Wrap_from_utf16.ADDR; + } + + /** + * {@snippet lang=c : + * Utf16Wrap *Utf16Wrap_from_utf16(const char16_t *input_data, size_t input_len) + * } + */ + public static MemorySegment Utf16Wrap_from_utf16(MemorySegment input_data, long input_len) { + var mh$ = Utf16Wrap_from_utf16.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Utf16Wrap_from_utf16", input_data, input_len); + } + return (MemorySegment)mh$.invokeExact(input_data, input_len); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class Utf16Wrap_get_debug_str { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_get_debug_str"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) + * } + */ + public static FunctionDescriptor Utf16Wrap_get_debug_str$descriptor() { + return Utf16Wrap_get_debug_str.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) + * } + */ + public static MethodHandle Utf16Wrap_get_debug_str$handle() { + return Utf16Wrap_get_debug_str.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) + * } + */ + public static MemorySegment Utf16Wrap_get_debug_str$address() { + return Utf16Wrap_get_debug_str.ADDR; + } + + /** + * {@snippet lang=c : + * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) + * } + */ + public static void Utf16Wrap_get_debug_str(MemorySegment self, MemorySegment write) { + var mh$ = Utf16Wrap_get_debug_str.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Utf16Wrap_get_debug_str", self, write); + } + mh$.invokeExact(self, write); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class Utf16Wrap_borrow_cont { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + DiplomatString16View.layout(), + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_borrow_cont"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) + * } + */ + public static FunctionDescriptor Utf16Wrap_borrow_cont$descriptor() { + return Utf16Wrap_borrow_cont.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) + * } + */ + public static MethodHandle Utf16Wrap_borrow_cont$handle() { + return Utf16Wrap_borrow_cont.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) + * } + */ + public static MemorySegment Utf16Wrap_borrow_cont$address() { + return Utf16Wrap_borrow_cont.ADDR; + } + + /** + * {@snippet lang=c : + * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) + * } + */ + public static MemorySegment Utf16Wrap_borrow_cont(SegmentAllocator allocator, MemorySegment self) { + var mh$ = Utf16Wrap_borrow_cont.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Utf16Wrap_borrow_cont", allocator, self); + } + return (MemorySegment)mh$.invokeExact(allocator, self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class Utf16Wrap_owned { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + DiplomatString16View.layout(), + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_owned"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * DiplomatString16View Utf16Wrap_owned(const Utf16Wrap *self) + * } + */ + public static FunctionDescriptor Utf16Wrap_owned$descriptor() { + return Utf16Wrap_owned.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * DiplomatString16View Utf16Wrap_owned(const Utf16Wrap *self) + * } + */ + public static MethodHandle Utf16Wrap_owned$handle() { + return Utf16Wrap_owned.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * DiplomatString16View Utf16Wrap_owned(const Utf16Wrap *self) + * } + */ + public static MemorySegment Utf16Wrap_owned$address() { + return Utf16Wrap_owned.ADDR; + } + + /** + * {@snippet lang=c : + * DiplomatString16View Utf16Wrap_owned(const Utf16Wrap *self) + * } + */ + public static MemorySegment Utf16Wrap_owned(SegmentAllocator allocator, MemorySegment self) { + var mh$ = Utf16Wrap_owned.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Utf16Wrap_owned", allocator, self); + } + return (MemorySegment)mh$.invokeExact(allocator, self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class Utf16Wrap_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_destroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void Utf16Wrap_destroy(Utf16Wrap *self) + * } + */ + public static FunctionDescriptor Utf16Wrap_destroy$descriptor() { + return Utf16Wrap_destroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void Utf16Wrap_destroy(Utf16Wrap *self) + * } + */ + public static MethodHandle Utf16Wrap_destroy$handle() { + return Utf16Wrap_destroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void Utf16Wrap_destroy(Utf16Wrap *self) + * } + */ + public static MemorySegment Utf16Wrap_destroy$address() { + return Utf16Wrap_destroy.ADDR; + } + + /** + * {@snippet lang=c : + * void Utf16Wrap_destroy(Utf16Wrap *self) + * } + */ + public static void Utf16Wrap_destroy(MemorySegment self) { + var mh$ = Utf16Wrap_destroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Utf16Wrap_destroy", self); + } + mh$.invokeExact(self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class namespace_OpaqueIterable_iter { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_OpaqueIterable_iter"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * OpaqueIterator *namespace_OpaqueIterable_iter(const OpaqueIterable *self) + * } + */ + public static FunctionDescriptor namespace_OpaqueIterable_iter$descriptor() { + return namespace_OpaqueIterable_iter.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * OpaqueIterator *namespace_OpaqueIterable_iter(const OpaqueIterable *self) + * } + */ + public static MethodHandle namespace_OpaqueIterable_iter$handle() { + return namespace_OpaqueIterable_iter.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * OpaqueIterator *namespace_OpaqueIterable_iter(const OpaqueIterable *self) + * } + */ + public static MemorySegment namespace_OpaqueIterable_iter$address() { + return namespace_OpaqueIterable_iter.ADDR; + } + + /** + * {@snippet lang=c : + * OpaqueIterator *namespace_OpaqueIterable_iter(const OpaqueIterable *self) + * } + */ + public static MemorySegment namespace_OpaqueIterable_iter(MemorySegment self) { + var mh$ = namespace_OpaqueIterable_iter.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("namespace_OpaqueIterable_iter", self); + } + return (MemorySegment)mh$.invokeExact(self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class namespace_OpaqueIterable_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_OpaqueIterable_destroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void namespace_OpaqueIterable_destroy(OpaqueIterable *self) + * } + */ + public static FunctionDescriptor namespace_OpaqueIterable_destroy$descriptor() { + return namespace_OpaqueIterable_destroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void namespace_OpaqueIterable_destroy(OpaqueIterable *self) + * } + */ + public static MethodHandle namespace_OpaqueIterable_destroy$handle() { + return namespace_OpaqueIterable_destroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void namespace_OpaqueIterable_destroy(OpaqueIterable *self) + * } + */ + public static MemorySegment namespace_OpaqueIterable_destroy$address() { + return namespace_OpaqueIterable_destroy.ADDR; + } + + /** + * {@snippet lang=c : + * void namespace_OpaqueIterable_destroy(OpaqueIterable *self) + * } + */ + public static void namespace_OpaqueIterable_destroy(MemorySegment self) { + var mh$ = namespace_OpaqueIterable_destroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("namespace_OpaqueIterable_destroy", self); + } + mh$.invokeExact(self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class OpaqueMutexedString_from_usize { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_LONG + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_from_usize"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) + * } + */ + public static FunctionDescriptor OpaqueMutexedString_from_usize$descriptor() { + return OpaqueMutexedString_from_usize.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) + * } + */ + public static MethodHandle OpaqueMutexedString_from_usize$handle() { + return OpaqueMutexedString_from_usize.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) + * } + */ + public static MemorySegment OpaqueMutexedString_from_usize$address() { + return OpaqueMutexedString_from_usize.ADDR; + } + + /** + * {@snippet lang=c : + * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) + * } + */ + public static MemorySegment OpaqueMutexedString_from_usize(long number) { + var mh$ = OpaqueMutexedString_from_usize.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("OpaqueMutexedString_from_usize", number); + } + return (MemorySegment)mh$.invokeExact(number); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class OpaqueMutexedString_change { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, + somelib_h.C_LONG + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_change"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) + * } + */ + public static FunctionDescriptor OpaqueMutexedString_change$descriptor() { + return OpaqueMutexedString_change.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) + * } + */ + public static MethodHandle OpaqueMutexedString_change$handle() { + return OpaqueMutexedString_change.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) + * } + */ + public static MemorySegment OpaqueMutexedString_change$address() { + return OpaqueMutexedString_change.ADDR; + } + + /** + * {@snippet lang=c : + * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) + * } + */ + public static void OpaqueMutexedString_change(MemorySegment self, long number) { + var mh$ = OpaqueMutexedString_change.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("OpaqueMutexedString_change", self, number); + } + mh$.invokeExact(self, number); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class OpaqueMutexedString_borrow { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_borrow"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) + * } + */ + public static FunctionDescriptor OpaqueMutexedString_borrow$descriptor() { + return OpaqueMutexedString_borrow.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) + * } + */ + public static MethodHandle OpaqueMutexedString_borrow$handle() { + return OpaqueMutexedString_borrow.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) + * } + */ + public static MemorySegment OpaqueMutexedString_borrow$address() { + return OpaqueMutexedString_borrow.ADDR; + } + + /** + * {@snippet lang=c : + * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) + * } + */ + public static MemorySegment OpaqueMutexedString_borrow(MemorySegment self) { + var mh$ = OpaqueMutexedString_borrow.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("OpaqueMutexedString_borrow", self); + } + return (MemorySegment)mh$.invokeExact(self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class OpaqueMutexedString_borrow_other { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_borrow_other"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) + * } + */ + public static FunctionDescriptor OpaqueMutexedString_borrow_other$descriptor() { + return OpaqueMutexedString_borrow_other.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) + * } + */ + public static MethodHandle OpaqueMutexedString_borrow_other$handle() { + return OpaqueMutexedString_borrow_other.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) + * } + */ + public static MemorySegment OpaqueMutexedString_borrow_other$address() { + return OpaqueMutexedString_borrow_other.ADDR; + } + + /** + * {@snippet lang=c : + * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) + * } + */ + public static MemorySegment OpaqueMutexedString_borrow_other(MemorySegment other) { + var mh$ = OpaqueMutexedString_borrow_other.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("OpaqueMutexedString_borrow_other", other); + } + return (MemorySegment)mh$.invokeExact(other); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class OpaqueMutexedString_borrow_self_or_other { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_borrow_self_or_other"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) + * } + */ + public static FunctionDescriptor OpaqueMutexedString_borrow_self_or_other$descriptor() { + return OpaqueMutexedString_borrow_self_or_other.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) + * } + */ + public static MethodHandle OpaqueMutexedString_borrow_self_or_other$handle() { + return OpaqueMutexedString_borrow_self_or_other.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) + * } + */ + public static MemorySegment OpaqueMutexedString_borrow_self_or_other$address() { + return OpaqueMutexedString_borrow_self_or_other.ADDR; + } + + /** + * {@snippet lang=c : + * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) + * } + */ + public static MemorySegment OpaqueMutexedString_borrow_self_or_other(MemorySegment self, MemorySegment other) { + var mh$ = OpaqueMutexedString_borrow_self_or_other.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("OpaqueMutexedString_borrow_self_or_other", self, other); + } + return (MemorySegment)mh$.invokeExact(self, other); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class OpaqueMutexedString_get_len_and_add { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_LONG, + somelib_h.C_POINTER, + somelib_h.C_LONG + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_get_len_and_add"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) + * } + */ + public static FunctionDescriptor OpaqueMutexedString_get_len_and_add$descriptor() { + return OpaqueMutexedString_get_len_and_add.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) + * } + */ + public static MethodHandle OpaqueMutexedString_get_len_and_add$handle() { + return OpaqueMutexedString_get_len_and_add.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) + * } + */ + public static MemorySegment OpaqueMutexedString_get_len_and_add$address() { + return OpaqueMutexedString_get_len_and_add.ADDR; + } + + /** + * {@snippet lang=c : + * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) + * } + */ + public static long OpaqueMutexedString_get_len_and_add(MemorySegment self, long other) { + var mh$ = OpaqueMutexedString_get_len_and_add.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("OpaqueMutexedString_get_len_and_add", self, other); + } + return (long)mh$.invokeExact(self, other); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class OpaqueMutexedString_dummy_str { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + DiplomatStringView.layout(), + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_dummy_str"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) + * } + */ + public static FunctionDescriptor OpaqueMutexedString_dummy_str$descriptor() { + return OpaqueMutexedString_dummy_str.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) + * } + */ + public static MethodHandle OpaqueMutexedString_dummy_str$handle() { + return OpaqueMutexedString_dummy_str.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) + * } + */ + public static MemorySegment OpaqueMutexedString_dummy_str$address() { + return OpaqueMutexedString_dummy_str.ADDR; + } + + /** + * {@snippet lang=c : + * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) + * } + */ + public static MemorySegment OpaqueMutexedString_dummy_str(SegmentAllocator allocator, MemorySegment self) { + var mh$ = OpaqueMutexedString_dummy_str.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("OpaqueMutexedString_dummy_str", allocator, self); + } + return (MemorySegment)mh$.invokeExact(allocator, self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class OpaqueMutexedString_wrapper { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_wrapper"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) + * } + */ + public static FunctionDescriptor OpaqueMutexedString_wrapper$descriptor() { + return OpaqueMutexedString_wrapper.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) + * } + */ + public static MethodHandle OpaqueMutexedString_wrapper$handle() { + return OpaqueMutexedString_wrapper.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) + * } + */ + public static MemorySegment OpaqueMutexedString_wrapper$address() { + return OpaqueMutexedString_wrapper.ADDR; + } + + /** + * {@snippet lang=c : + * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) + * } + */ + public static MemorySegment OpaqueMutexedString_wrapper(MemorySegment self) { + var mh$ = OpaqueMutexedString_wrapper.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("OpaqueMutexedString_wrapper", self); + } + return (MemorySegment)mh$.invokeExact(self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class OpaqueMutexedString_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_destroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) + * } + */ + public static FunctionDescriptor OpaqueMutexedString_destroy$descriptor() { + return OpaqueMutexedString_destroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) + * } + */ + public static MethodHandle OpaqueMutexedString_destroy$handle() { + return OpaqueMutexedString_destroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) + * } + */ + public static MemorySegment OpaqueMutexedString_destroy$address() { + return OpaqueMutexedString_destroy.ADDR; + } + + /** + * {@snippet lang=c : + * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) + * } + */ + public static void OpaqueMutexedString_destroy(MemorySegment self) { + var mh$ = OpaqueMutexedString_destroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("OpaqueMutexedString_destroy", self); + } + mh$.invokeExact(self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class OptionString_new { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionString_new"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * OptionString *OptionString_new(const char *diplomat_str_data, size_t diplomat_str_len) + * } + */ + public static FunctionDescriptor OptionString_new$descriptor() { + return OptionString_new.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * OptionString *OptionString_new(const char *diplomat_str_data, size_t diplomat_str_len) + * } + */ + public static MethodHandle OptionString_new$handle() { + return OptionString_new.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * OptionString *OptionString_new(const char *diplomat_str_data, size_t diplomat_str_len) + * } + */ + public static MemorySegment OptionString_new$address() { + return OptionString_new.ADDR; + } + + /** + * {@snippet lang=c : + * OptionString *OptionString_new(const char *diplomat_str_data, size_t diplomat_str_len) + * } + */ + public static MemorySegment OptionString_new(MemorySegment diplomat_str_data, long diplomat_str_len) { + var mh$ = OptionString_new.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("OptionString_new", diplomat_str_data, diplomat_str_len); + } + return (MemorySegment)mh$.invokeExact(diplomat_str_data, diplomat_str_len); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class OptionString_write { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + OptionString_write_result.layout(), + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionString_write"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * struct OptionString_write_result OptionString_write(const OptionString *self, DiplomatWrite *write) + * } + */ + public static FunctionDescriptor OptionString_write$descriptor() { + return OptionString_write.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * struct OptionString_write_result OptionString_write(const OptionString *self, DiplomatWrite *write) + * } + */ + public static MethodHandle OptionString_write$handle() { + return OptionString_write.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * struct OptionString_write_result OptionString_write(const OptionString *self, DiplomatWrite *write) + * } + */ + public static MemorySegment OptionString_write$address() { + return OptionString_write.ADDR; + } + + /** + * {@snippet lang=c : + * struct OptionString_write_result OptionString_write(const OptionString *self, DiplomatWrite *write) + * } + */ + public static MemorySegment OptionString_write(SegmentAllocator allocator, MemorySegment self, MemorySegment write) { + var mh$ = OptionString_write.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("OptionString_write", allocator, self, write); + } + return (MemorySegment)mh$.invokeExact(allocator, self, write); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class OptionString_borrow { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + OptionString_borrow_result.layout(), + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionString_borrow"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * struct OptionString_borrow_result OptionString_borrow(const OptionString *self) + * } + */ + public static FunctionDescriptor OptionString_borrow$descriptor() { + return OptionString_borrow.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * struct OptionString_borrow_result OptionString_borrow(const OptionString *self) + * } + */ + public static MethodHandle OptionString_borrow$handle() { + return OptionString_borrow.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * struct OptionString_borrow_result OptionString_borrow(const OptionString *self) + * } + */ + public static MemorySegment OptionString_borrow$address() { + return OptionString_borrow.ADDR; + } + + /** + * {@snippet lang=c : + * struct OptionString_borrow_result OptionString_borrow(const OptionString *self) + * } + */ + public static MemorySegment OptionString_borrow(SegmentAllocator allocator, MemorySegment self) { + var mh$ = OptionString_borrow.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("OptionString_borrow", allocator, self); + } + return (MemorySegment)mh$.invokeExact(allocator, self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class OptionString_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionString_destroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void OptionString_destroy(OptionString *self) + * } + */ + public static FunctionDescriptor OptionString_destroy$descriptor() { + return OptionString_destroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void OptionString_destroy(OptionString *self) + * } + */ + public static MethodHandle OptionString_destroy$handle() { + return OptionString_destroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void OptionString_destroy(OptionString *self) + * } + */ + public static MemorySegment OptionString_destroy$address() { + return OptionString_destroy.ADDR; + } + + /** + * {@snippet lang=c : + * void OptionString_destroy(OptionString *self) + * } + */ + public static void OptionString_destroy(MemorySegment self) { + var mh$ = OptionString_destroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("OptionString_destroy", self); + } + mh$.invokeExact(self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + private static final int UnimportedEnum_A = (int)0L; + /** + * {@snippet lang=c : + * enum UnimportedEnum.UnimportedEnum_A = 0 + * } + */ + public static int UnimportedEnum_A() { + return UnimportedEnum_A; + } + private static final int UnimportedEnum_B = (int)1L; + /** + * {@snippet lang=c : + * enum UnimportedEnum.UnimportedEnum_B = 1 + * } + */ + public static int UnimportedEnum_B() { + return UnimportedEnum_B; + } + private static final int UnimportedEnum_C = (int)2L; + /** + * {@snippet lang=c : + * enum UnimportedEnum.UnimportedEnum_C = 2 + * } + */ + public static int UnimportedEnum_C() { + return UnimportedEnum_C; + } + private static final int ContiguousEnum_C = (int)0L; + /** + * {@snippet lang=c : + * enum ContiguousEnum.ContiguousEnum_C = 0 + * } + */ + public static int ContiguousEnum_C() { + return ContiguousEnum_C; + } + private static final int ContiguousEnum_D = (int)1L; + /** + * {@snippet lang=c : + * enum ContiguousEnum.ContiguousEnum_D = 1 + * } + */ + public static int ContiguousEnum_D() { + return ContiguousEnum_D; + } + private static final int ContiguousEnum_E = (int)2L; + /** + * {@snippet lang=c : + * enum ContiguousEnum.ContiguousEnum_E = 2 + * } + */ + public static int ContiguousEnum_E() { + return ContiguousEnum_E; + } + private static final int ContiguousEnum_F = (int)3L; + /** + * {@snippet lang=c : + * enum ContiguousEnum.ContiguousEnum_F = 3 + * } + */ + public static int ContiguousEnum_F() { + return ContiguousEnum_F; + } + + private static class namespace_MyIndexer_get { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + namespace_MyIndexer_get_result.layout(), + somelib_h.C_POINTER, + somelib_h.C_LONG + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_MyIndexer_get"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * struct namespace_MyIndexer_get_result namespace_MyIndexer_get(const MyIndexer *self, size_t i) + * } + */ + public static FunctionDescriptor namespace_MyIndexer_get$descriptor() { + return namespace_MyIndexer_get.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * struct namespace_MyIndexer_get_result namespace_MyIndexer_get(const MyIndexer *self, size_t i) + * } + */ + public static MethodHandle namespace_MyIndexer_get$handle() { + return namespace_MyIndexer_get.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * struct namespace_MyIndexer_get_result namespace_MyIndexer_get(const MyIndexer *self, size_t i) + * } + */ + public static MemorySegment namespace_MyIndexer_get$address() { + return namespace_MyIndexer_get.ADDR; + } + + /** + * {@snippet lang=c : + * struct namespace_MyIndexer_get_result namespace_MyIndexer_get(const MyIndexer *self, size_t i) + * } + */ + public static MemorySegment namespace_MyIndexer_get(SegmentAllocator allocator, MemorySegment self, long i) { + var mh$ = namespace_MyIndexer_get.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("namespace_MyIndexer_get", allocator, self, i); + } + return (MemorySegment)mh$.invokeExact(allocator, self, i); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class namespace_MyIndexer_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_MyIndexer_destroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void namespace_MyIndexer_destroy(MyIndexer *self) + * } + */ + public static FunctionDescriptor namespace_MyIndexer_destroy$descriptor() { + return namespace_MyIndexer_destroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void namespace_MyIndexer_destroy(MyIndexer *self) + * } + */ + public static MethodHandle namespace_MyIndexer_destroy$handle() { + return namespace_MyIndexer_destroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void namespace_MyIndexer_destroy(MyIndexer *self) + * } + */ + public static MemorySegment namespace_MyIndexer_destroy$address() { + return namespace_MyIndexer_destroy.ADDR; + } + + /** + * {@snippet lang=c : + * void namespace_MyIndexer_destroy(MyIndexer *self) + * } + */ + public static void namespace_MyIndexer_destroy(MemorySegment self) { + var mh$ = namespace_MyIndexer_destroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("namespace_MyIndexer_destroy", self); + } + mh$.invokeExact(self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class BorrowedFieldsWithBounds_from_foo_and_strings { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + BorrowedFieldsWithBounds.layout(), + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG, + somelib_h.C_POINTER, + somelib_h.C_LONG + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("BorrowedFieldsWithBounds_from_foo_and_strings"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char *utf8_str_z_data, size_t utf8_str_z_len) + * } + */ + public static FunctionDescriptor BorrowedFieldsWithBounds_from_foo_and_strings$descriptor() { + return BorrowedFieldsWithBounds_from_foo_and_strings.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char *utf8_str_z_data, size_t utf8_str_z_len) + * } + */ + public static MethodHandle BorrowedFieldsWithBounds_from_foo_and_strings$handle() { + return BorrowedFieldsWithBounds_from_foo_and_strings.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char *utf8_str_z_data, size_t utf8_str_z_len) + * } + */ + public static MemorySegment BorrowedFieldsWithBounds_from_foo_and_strings$address() { + return BorrowedFieldsWithBounds_from_foo_and_strings.ADDR; + } + + /** + * {@snippet lang=c : + * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char *utf8_str_z_data, size_t utf8_str_z_len) + * } + */ + public static MemorySegment BorrowedFieldsWithBounds_from_foo_and_strings(SegmentAllocator allocator, MemorySegment foo, MemorySegment dstr16_x_data, long dstr16_x_len, MemorySegment utf8_str_z_data, long utf8_str_z_len) { + var mh$ = BorrowedFieldsWithBounds_from_foo_and_strings.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("BorrowedFieldsWithBounds_from_foo_and_strings", allocator, foo, dstr16_x_data, dstr16_x_len, utf8_str_z_data, utf8_str_z_len); + } + return (MemorySegment)mh$.invokeExact(allocator, foo, dstr16_x_data, dstr16_x_len, utf8_str_z_data, utf8_str_z_len); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + /** + * Variadic invoker class for: + * {@snippet lang=c : + * Opaque *Opaque_new() + * } + */ + public static class Opaque_new { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + somelib_h.C_POINTER ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_new"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private Opaque_new(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * Opaque *Opaque_new() + * } + */ + public static Opaque_new makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new Opaque_new(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public MemorySegment apply(Object... x0) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Opaque_new", x0); + } + return (MemorySegment)spreader.invokeExact(x0); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static class Opaque_try_from_utf8 { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_try_from_utf8"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * Opaque *Opaque_try_from_utf8(const char *input_data, size_t input_len) + * } + */ + public static FunctionDescriptor Opaque_try_from_utf8$descriptor() { + return Opaque_try_from_utf8.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * Opaque *Opaque_try_from_utf8(const char *input_data, size_t input_len) + * } + */ + public static MethodHandle Opaque_try_from_utf8$handle() { + return Opaque_try_from_utf8.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * Opaque *Opaque_try_from_utf8(const char *input_data, size_t input_len) + * } + */ + public static MemorySegment Opaque_try_from_utf8$address() { + return Opaque_try_from_utf8.ADDR; + } + + /** + * {@snippet lang=c : + * Opaque *Opaque_try_from_utf8(const char *input_data, size_t input_len) + * } + */ + public static MemorySegment Opaque_try_from_utf8(MemorySegment input_data, long input_len) { + var mh$ = Opaque_try_from_utf8.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Opaque_try_from_utf8", input_data, input_len); + } + return (MemorySegment)mh$.invokeExact(input_data, input_len); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class Opaque_from_str { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_from_str"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * Opaque *Opaque_from_str(const char *input_data, size_t input_len) + * } + */ + public static FunctionDescriptor Opaque_from_str$descriptor() { + return Opaque_from_str.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * Opaque *Opaque_from_str(const char *input_data, size_t input_len) + * } + */ + public static MethodHandle Opaque_from_str$handle() { + return Opaque_from_str.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * Opaque *Opaque_from_str(const char *input_data, size_t input_len) + * } + */ + public static MemorySegment Opaque_from_str$address() { + return Opaque_from_str.ADDR; + } + + /** + * {@snippet lang=c : + * Opaque *Opaque_from_str(const char *input_data, size_t input_len) + * } + */ + public static MemorySegment Opaque_from_str(MemorySegment input_data, long input_len) { + var mh$ = Opaque_from_str.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Opaque_from_str", input_data, input_len); + } + return (MemorySegment)mh$.invokeExact(input_data, input_len); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class Opaque_get_debug_str { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_get_debug_str"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) + * } + */ + public static FunctionDescriptor Opaque_get_debug_str$descriptor() { + return Opaque_get_debug_str.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) + * } + */ + public static MethodHandle Opaque_get_debug_str$handle() { + return Opaque_get_debug_str.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) + * } + */ + public static MemorySegment Opaque_get_debug_str$address() { + return Opaque_get_debug_str.ADDR; + } + + /** + * {@snippet lang=c : + * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) + * } + */ + public static void Opaque_get_debug_str(MemorySegment self, MemorySegment write) { + var mh$ = Opaque_get_debug_str.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Opaque_get_debug_str", self, write); + } + mh$.invokeExact(self, write); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class Opaque_assert_struct { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, + MyStruct.layout() + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_assert_struct"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void Opaque_assert_struct(const Opaque *self, MyStruct s) + * } + */ + public static FunctionDescriptor Opaque_assert_struct$descriptor() { + return Opaque_assert_struct.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void Opaque_assert_struct(const Opaque *self, MyStruct s) + * } + */ + public static MethodHandle Opaque_assert_struct$handle() { + return Opaque_assert_struct.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void Opaque_assert_struct(const Opaque *self, MyStruct s) + * } + */ + public static MemorySegment Opaque_assert_struct$address() { + return Opaque_assert_struct.ADDR; + } + + /** + * {@snippet lang=c : + * void Opaque_assert_struct(const Opaque *self, MyStruct s) + * } + */ + public static void Opaque_assert_struct(MemorySegment self, MemorySegment s) { + var mh$ = Opaque_assert_struct.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Opaque_assert_struct", self, s); + } + mh$.invokeExact(self, s); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + /** + * Variadic invoker class for: + * {@snippet lang=c : + * size_t Opaque_returns_usize() + * } + */ + public static class Opaque_returns_usize { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + somelib_h.C_LONG ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_returns_usize"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private Opaque_returns_usize(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * size_t Opaque_returns_usize() + * } + */ + public static Opaque_returns_usize makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new Opaque_returns_usize(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public long apply(Object... x0) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Opaque_returns_usize", x0); + } + return (long)spreader.invokeExact(x0); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + /** + * Variadic invoker class for: + * {@snippet lang=c : + * ImportedStruct Opaque_returns_imported() + * } + */ + public static class Opaque_returns_imported { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + ImportedStruct.layout() ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_returns_imported"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private Opaque_returns_imported(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * ImportedStruct Opaque_returns_imported() + * } + */ + public static Opaque_returns_imported makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new Opaque_returns_imported(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public MemorySegment apply(SegmentAllocator allocator, Object... x0) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Opaque_returns_imported", allocator, x0); + } + return (MemorySegment)spreader.invokeExact(allocator, x0); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + /** + * Variadic invoker class for: + * {@snippet lang=c : + * int8_t Opaque_cmp() + * } + */ + public static class Opaque_cmp { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + somelib_h.C_CHAR ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_cmp"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private Opaque_cmp(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * int8_t Opaque_cmp() + * } + */ + public static Opaque_cmp makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new Opaque_cmp(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public byte apply(Object... x0) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Opaque_cmp", x0); + } + return (byte)spreader.invokeExact(x0); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static class Opaque_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_destroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void Opaque_destroy(Opaque *self) + * } + */ + public static FunctionDescriptor Opaque_destroy$descriptor() { + return Opaque_destroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void Opaque_destroy(Opaque *self) + * } + */ + public static MethodHandle Opaque_destroy$handle() { + return Opaque_destroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void Opaque_destroy(Opaque *self) + * } + */ + public static MemorySegment Opaque_destroy$address() { + return Opaque_destroy.ADDR; + } + + /** + * {@snippet lang=c : + * void Opaque_destroy(Opaque *self) + * } + */ + public static void Opaque_destroy(MemorySegment self) { + var mh$ = Opaque_destroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Opaque_destroy", self); + } + mh$.invokeExact(self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + private static final int ErrorEnum_Foo = (int)0L; + /** + * {@snippet lang=c : + * enum ErrorEnum.ErrorEnum_Foo = 0 + * } + */ + public static int ErrorEnum_Foo() { + return ErrorEnum_Foo; + } + private static final int ErrorEnum_Bar = (int)1L; + /** + * {@snippet lang=c : + * enum ErrorEnum.ErrorEnum_Bar = 1 + * } + */ + public static int ErrorEnum_Bar() { + return ErrorEnum_Bar; + } + + private static class MyString_new { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * MyString *MyString_new(const char *v_data, size_t v_len) + * } + */ + public static FunctionDescriptor MyString_new$descriptor() { + return MyString_new.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * MyString *MyString_new(const char *v_data, size_t v_len) + * } + */ + public static MethodHandle MyString_new$handle() { + return MyString_new.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * MyString *MyString_new(const char *v_data, size_t v_len) + * } + */ + public static MemorySegment MyString_new$address() { + return MyString_new.ADDR; + } + + /** + * {@snippet lang=c : + * MyString *MyString_new(const char *v_data, size_t v_len) + * } + */ + public static MemorySegment MyString_new(MemorySegment v_data, long v_len) { + var mh$ = MyString_new.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("MyString_new", v_data, v_len); + } + return (MemorySegment)mh$.invokeExact(v_data, v_len); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class MyString_new_unsafe { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new_unsafe"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * MyString *MyString_new_unsafe(const char *v_data, size_t v_len) + * } + */ + public static FunctionDescriptor MyString_new_unsafe$descriptor() { + return MyString_new_unsafe.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * MyString *MyString_new_unsafe(const char *v_data, size_t v_len) + * } + */ + public static MethodHandle MyString_new_unsafe$handle() { + return MyString_new_unsafe.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * MyString *MyString_new_unsafe(const char *v_data, size_t v_len) + * } + */ + public static MemorySegment MyString_new_unsafe$address() { + return MyString_new_unsafe.ADDR; + } + + /** + * {@snippet lang=c : + * MyString *MyString_new_unsafe(const char *v_data, size_t v_len) + * } + */ + public static MemorySegment MyString_new_unsafe(MemorySegment v_data, long v_len) { + var mh$ = MyString_new_unsafe.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("MyString_new_unsafe", v_data, v_len); + } + return (MemorySegment)mh$.invokeExact(v_data, v_len); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class MyString_new_owned { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new_owned"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * MyString *MyString_new_owned(const char *v_data, size_t v_len) + * } + */ + public static FunctionDescriptor MyString_new_owned$descriptor() { + return MyString_new_owned.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * MyString *MyString_new_owned(const char *v_data, size_t v_len) + * } + */ + public static MethodHandle MyString_new_owned$handle() { + return MyString_new_owned.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * MyString *MyString_new_owned(const char *v_data, size_t v_len) + * } + */ + public static MemorySegment MyString_new_owned$address() { + return MyString_new_owned.ADDR; + } + + /** + * {@snippet lang=c : + * MyString *MyString_new_owned(const char *v_data, size_t v_len) + * } + */ + public static MemorySegment MyString_new_owned(MemorySegment v_data, long v_len) { + var mh$ = MyString_new_owned.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("MyString_new_owned", v_data, v_len); + } + return (MemorySegment)mh$.invokeExact(v_data, v_len); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class MyString_new_from_first { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new_from_first"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * MyString *MyString_new_from_first(DiplomatStringsView *v_data, size_t v_len) + * } + */ + public static FunctionDescriptor MyString_new_from_first$descriptor() { + return MyString_new_from_first.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * MyString *MyString_new_from_first(DiplomatStringsView *v_data, size_t v_len) + * } + */ + public static MethodHandle MyString_new_from_first$handle() { + return MyString_new_from_first.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * MyString *MyString_new_from_first(DiplomatStringsView *v_data, size_t v_len) + * } + */ + public static MemorySegment MyString_new_from_first$address() { + return MyString_new_from_first.ADDR; + } + + /** + * {@snippet lang=c : + * MyString *MyString_new_from_first(DiplomatStringsView *v_data, size_t v_len) + * } + */ + public static MemorySegment MyString_new_from_first(MemorySegment v_data, long v_len) { + var mh$ = MyString_new_from_first.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("MyString_new_from_first", v_data, v_len); + } + return (MemorySegment)mh$.invokeExact(v_data, v_len); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class MyString_set_str { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_set_str"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void MyString_set_str(MyString *self, const char *new_str_data, size_t new_str_len) + * } + */ + public static FunctionDescriptor MyString_set_str$descriptor() { + return MyString_set_str.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void MyString_set_str(MyString *self, const char *new_str_data, size_t new_str_len) + * } + */ + public static MethodHandle MyString_set_str$handle() { + return MyString_set_str.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void MyString_set_str(MyString *self, const char *new_str_data, size_t new_str_len) + * } + */ + public static MemorySegment MyString_set_str$address() { + return MyString_set_str.ADDR; + } + + /** + * {@snippet lang=c : + * void MyString_set_str(MyString *self, const char *new_str_data, size_t new_str_len) + * } + */ + public static void MyString_set_str(MemorySegment self, MemorySegment new_str_data, long new_str_len) { + var mh$ = MyString_set_str.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("MyString_set_str", self, new_str_data, new_str_len); + } + mh$.invokeExact(self, new_str_data, new_str_len); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class MyString_get_str { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_get_str"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void MyString_get_str(const MyString *self, DiplomatWrite *write) + * } + */ + public static FunctionDescriptor MyString_get_str$descriptor() { + return MyString_get_str.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void MyString_get_str(const MyString *self, DiplomatWrite *write) + * } + */ + public static MethodHandle MyString_get_str$handle() { + return MyString_get_str.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void MyString_get_str(const MyString *self, DiplomatWrite *write) + * } + */ + public static MemorySegment MyString_get_str$address() { + return MyString_get_str.ADDR; + } + + /** + * {@snippet lang=c : + * void MyString_get_str(const MyString *self, DiplomatWrite *write) + * } + */ + public static void MyString_get_str(MemorySegment self, MemorySegment write) { + var mh$ = MyString_get_str.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("MyString_get_str", self, write); + } + mh$.invokeExact(self, write); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class MyString_get_boxed_str { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + DiplomatStringView.layout(), + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_get_boxed_str"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * DiplomatStringView MyString_get_boxed_str(const MyString *self) + * } + */ + public static FunctionDescriptor MyString_get_boxed_str$descriptor() { + return MyString_get_boxed_str.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * DiplomatStringView MyString_get_boxed_str(const MyString *self) + * } + */ + public static MethodHandle MyString_get_boxed_str$handle() { + return MyString_get_boxed_str.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * DiplomatStringView MyString_get_boxed_str(const MyString *self) + * } + */ + public static MemorySegment MyString_get_boxed_str$address() { + return MyString_get_boxed_str.ADDR; + } + + /** + * {@snippet lang=c : + * DiplomatStringView MyString_get_boxed_str(const MyString *self) + * } + */ + public static MemorySegment MyString_get_boxed_str(SegmentAllocator allocator, MemorySegment self) { + var mh$ = MyString_get_boxed_str.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("MyString_get_boxed_str", allocator, self); + } + return (MemorySegment)mh$.invokeExact(allocator, self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class MyString_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_destroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void MyString_destroy(MyString *self) + * } + */ + public static FunctionDescriptor MyString_destroy$descriptor() { + return MyString_destroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void MyString_destroy(MyString *self) + * } + */ + public static MethodHandle MyString_destroy$handle() { + return MyString_destroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void MyString_destroy(MyString *self) + * } + */ + public static MemorySegment MyString_destroy$address() { + return MyString_destroy.ADDR; + } + + /** + * {@snippet lang=c : + * void MyString_destroy(MyString *self) + * } + */ + public static void MyString_destroy(MemorySegment self) { + var mh$ = MyString_destroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("MyString_destroy", self); + } + mh$.invokeExact(self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class Two_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("Two_destroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void Two_destroy(Two *self) + * } + */ + public static FunctionDescriptor Two_destroy$descriptor() { + return Two_destroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void Two_destroy(Two *self) + * } + */ + public static MethodHandle Two_destroy$handle() { + return Two_destroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void Two_destroy(Two *self) + * } + */ + public static MemorySegment Two_destroy$address() { + return Two_destroy.ADDR; + } + + /** + * {@snippet lang=c : + * void Two_destroy(Two *self) + * } + */ + public static void Two_destroy(MemorySegment self) { + var mh$ = Two_destroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Two_destroy", self); + } + mh$.invokeExact(self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class NestedBorrowedFields_from_bar_and_foo_and_strings { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + NestedBorrowedFields.layout(), + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG, + somelib_h.C_POINTER, + somelib_h.C_LONG, + somelib_h.C_POINTER, + somelib_h.C_LONG, + somelib_h.C_POINTER, + somelib_h.C_LONG + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("NestedBorrowedFields_from_bar_and_foo_and_strings"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char16_t *dstr16_z_data, size_t dstr16_z_len, const char *utf8_str_y_data, size_t utf8_str_y_len, const char *utf8_str_z_data, size_t utf8_str_z_len) + * } + */ + public static FunctionDescriptor NestedBorrowedFields_from_bar_and_foo_and_strings$descriptor() { + return NestedBorrowedFields_from_bar_and_foo_and_strings.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char16_t *dstr16_z_data, size_t dstr16_z_len, const char *utf8_str_y_data, size_t utf8_str_y_len, const char *utf8_str_z_data, size_t utf8_str_z_len) + * } + */ + public static MethodHandle NestedBorrowedFields_from_bar_and_foo_and_strings$handle() { + return NestedBorrowedFields_from_bar_and_foo_and_strings.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char16_t *dstr16_z_data, size_t dstr16_z_len, const char *utf8_str_y_data, size_t utf8_str_y_len, const char *utf8_str_z_data, size_t utf8_str_z_len) + * } + */ + public static MemorySegment NestedBorrowedFields_from_bar_and_foo_and_strings$address() { + return NestedBorrowedFields_from_bar_and_foo_and_strings.ADDR; + } + + /** + * {@snippet lang=c : + * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char16_t *dstr16_z_data, size_t dstr16_z_len, const char *utf8_str_y_data, size_t utf8_str_y_len, const char *utf8_str_z_data, size_t utf8_str_z_len) + * } + */ + public static MemorySegment NestedBorrowedFields_from_bar_and_foo_and_strings(SegmentAllocator allocator, MemorySegment bar, MemorySegment foo, MemorySegment dstr16_x_data, long dstr16_x_len, MemorySegment dstr16_z_data, long dstr16_z_len, MemorySegment utf8_str_y_data, long utf8_str_y_len, MemorySegment utf8_str_z_data, long utf8_str_z_len) { + var mh$ = NestedBorrowedFields_from_bar_and_foo_and_strings.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("NestedBorrowedFields_from_bar_and_foo_and_strings", allocator, bar, foo, dstr16_x_data, dstr16_x_len, dstr16_z_data, dstr16_z_len, utf8_str_y_data, utf8_str_y_len, utf8_str_z_data, utf8_str_z_len); + } + return (MemorySegment)mh$.invokeExact(allocator, bar, foo, dstr16_x_data, dstr16_x_len, dstr16_z_data, dstr16_z_len, utf8_str_y_data, utf8_str_y_len, utf8_str_z_data, utf8_str_z_len); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class One_transitivity { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_transitivity"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * One *One_transitivity(const One *hold, const One *nohold) + * } + */ + public static FunctionDescriptor One_transitivity$descriptor() { + return One_transitivity.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * One *One_transitivity(const One *hold, const One *nohold) + * } + */ + public static MethodHandle One_transitivity$handle() { + return One_transitivity.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * One *One_transitivity(const One *hold, const One *nohold) + * } + */ + public static MemorySegment One_transitivity$address() { + return One_transitivity.ADDR; + } + + /** + * {@snippet lang=c : + * One *One_transitivity(const One *hold, const One *nohold) + * } + */ + public static MemorySegment One_transitivity(MemorySegment hold, MemorySegment nohold) { + var mh$ = One_transitivity.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("One_transitivity", hold, nohold); + } + return (MemorySegment)mh$.invokeExact(hold, nohold); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class One_cycle { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_cycle"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * One *One_cycle(const Two *hold, const One *nohold) + * } + */ + public static FunctionDescriptor One_cycle$descriptor() { + return One_cycle.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * One *One_cycle(const Two *hold, const One *nohold) + * } + */ + public static MethodHandle One_cycle$handle() { + return One_cycle.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * One *One_cycle(const Two *hold, const One *nohold) + * } + */ + public static MemorySegment One_cycle$address() { + return One_cycle.ADDR; + } + + /** + * {@snippet lang=c : + * One *One_cycle(const Two *hold, const One *nohold) + * } + */ + public static MemorySegment One_cycle(MemorySegment hold, MemorySegment nohold) { + var mh$ = One_cycle.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("One_cycle", hold, nohold); + } + return (MemorySegment)mh$.invokeExact(hold, nohold); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class One_many_dependents { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_many_dependents"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) + * } + */ + public static FunctionDescriptor One_many_dependents$descriptor() { + return One_many_dependents.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) + * } + */ + public static MethodHandle One_many_dependents$handle() { + return One_many_dependents.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) + * } + */ + public static MemorySegment One_many_dependents$address() { + return One_many_dependents.ADDR; + } + + /** + * {@snippet lang=c : + * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) + * } + */ + public static MemorySegment One_many_dependents(MemorySegment a, MemorySegment b, MemorySegment c, MemorySegment d, MemorySegment nohold) { + var mh$ = One_many_dependents.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("One_many_dependents", a, b, c, d, nohold); + } + return (MemorySegment)mh$.invokeExact(a, b, c, d, nohold); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class One_return_outlives_param { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_return_outlives_param"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * One *One_return_outlives_param(const Two *hold, const One *nohold) + * } + */ + public static FunctionDescriptor One_return_outlives_param$descriptor() { + return One_return_outlives_param.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * One *One_return_outlives_param(const Two *hold, const One *nohold) + * } + */ + public static MethodHandle One_return_outlives_param$handle() { + return One_return_outlives_param.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * One *One_return_outlives_param(const Two *hold, const One *nohold) + * } + */ + public static MemorySegment One_return_outlives_param$address() { + return One_return_outlives_param.ADDR; + } + + /** + * {@snippet lang=c : + * One *One_return_outlives_param(const Two *hold, const One *nohold) + * } + */ + public static MemorySegment One_return_outlives_param(MemorySegment hold, MemorySegment nohold) { + var mh$ = One_return_outlives_param.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("One_return_outlives_param", hold, nohold); + } + return (MemorySegment)mh$.invokeExact(hold, nohold); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class One_diamond_top { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_top"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) + * } + */ + public static FunctionDescriptor One_diamond_top$descriptor() { + return One_diamond_top.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) + * } + */ + public static MethodHandle One_diamond_top$handle() { + return One_diamond_top.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) + * } + */ + public static MemorySegment One_diamond_top$address() { + return One_diamond_top.ADDR; + } + + /** + * {@snippet lang=c : + * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) + * } + */ + public static MemorySegment One_diamond_top(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { + var mh$ = One_diamond_top.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("One_diamond_top", top, left, right, bottom); + } + return (MemorySegment)mh$.invokeExact(top, left, right, bottom); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class One_diamond_left { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_left"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) + * } + */ + public static FunctionDescriptor One_diamond_left$descriptor() { + return One_diamond_left.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) + * } + */ + public static MethodHandle One_diamond_left$handle() { + return One_diamond_left.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) + * } + */ + public static MemorySegment One_diamond_left$address() { + return One_diamond_left.ADDR; + } + + /** + * {@snippet lang=c : + * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) + * } + */ + public static MemorySegment One_diamond_left(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { + var mh$ = One_diamond_left.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("One_diamond_left", top, left, right, bottom); + } + return (MemorySegment)mh$.invokeExact(top, left, right, bottom); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class One_diamond_right { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_right"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) + * } + */ + public static FunctionDescriptor One_diamond_right$descriptor() { + return One_diamond_right.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) + * } + */ + public static MethodHandle One_diamond_right$handle() { + return One_diamond_right.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) + * } + */ + public static MemorySegment One_diamond_right$address() { + return One_diamond_right.ADDR; + } + + /** + * {@snippet lang=c : + * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) + * } + */ + public static MemorySegment One_diamond_right(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { + var mh$ = One_diamond_right.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("One_diamond_right", top, left, right, bottom); + } + return (MemorySegment)mh$.invokeExact(top, left, right, bottom); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class One_diamond_bottom { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_bottom"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) + * } + */ + public static FunctionDescriptor One_diamond_bottom$descriptor() { + return One_diamond_bottom.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) + * } + */ + public static MethodHandle One_diamond_bottom$handle() { + return One_diamond_bottom.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) + * } + */ + public static MemorySegment One_diamond_bottom$address() { + return One_diamond_bottom.ADDR; + } + + /** + * {@snippet lang=c : + * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) + * } + */ + public static MemorySegment One_diamond_bottom(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { + var mh$ = One_diamond_bottom.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("One_diamond_bottom", top, left, right, bottom); + } + return (MemorySegment)mh$.invokeExact(top, left, right, bottom); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class One_diamond_and_nested_types { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_and_nested_types"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) + * } + */ + public static FunctionDescriptor One_diamond_and_nested_types$descriptor() { + return One_diamond_and_nested_types.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) + * } + */ + public static MethodHandle One_diamond_and_nested_types$handle() { + return One_diamond_and_nested_types.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) + * } + */ + public static MemorySegment One_diamond_and_nested_types$address() { + return One_diamond_and_nested_types.ADDR; + } + + /** + * {@snippet lang=c : + * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) + * } + */ + public static MemorySegment One_diamond_and_nested_types(MemorySegment a, MemorySegment b, MemorySegment c, MemorySegment d, MemorySegment nohold) { + var mh$ = One_diamond_and_nested_types.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("One_diamond_and_nested_types", a, b, c, d, nohold); + } + return (MemorySegment)mh$.invokeExact(a, b, c, d, nohold); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class One_implicit_bounds { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_implicit_bounds"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) + * } + */ + public static FunctionDescriptor One_implicit_bounds$descriptor() { + return One_implicit_bounds.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) + * } + */ + public static MethodHandle One_implicit_bounds$handle() { + return One_implicit_bounds.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) + * } + */ + public static MemorySegment One_implicit_bounds$address() { + return One_implicit_bounds.ADDR; + } + + /** + * {@snippet lang=c : + * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) + * } + */ + public static MemorySegment One_implicit_bounds(MemorySegment explicit_hold, MemorySegment implicit_hold, MemorySegment nohold) { + var mh$ = One_implicit_bounds.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("One_implicit_bounds", explicit_hold, implicit_hold, nohold); + } + return (MemorySegment)mh$.invokeExact(explicit_hold, implicit_hold, nohold); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class One_implicit_bounds_deep { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_implicit_bounds_deep"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) + * } + */ + public static FunctionDescriptor One_implicit_bounds_deep$descriptor() { + return One_implicit_bounds_deep.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) + * } + */ + public static MethodHandle One_implicit_bounds_deep$handle() { + return One_implicit_bounds_deep.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) + * } + */ + public static MemorySegment One_implicit_bounds_deep$address() { + return One_implicit_bounds_deep.ADDR; + } + + /** + * {@snippet lang=c : + * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) + * } + */ + public static MemorySegment One_implicit_bounds_deep(MemorySegment explicit_, MemorySegment implicit_1, MemorySegment implicit_2, MemorySegment nohold) { + var mh$ = One_implicit_bounds_deep.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("One_implicit_bounds_deep", explicit_, implicit_1, implicit_2, nohold); + } + return (MemorySegment)mh$.invokeExact(explicit_, implicit_1, implicit_2, nohold); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class One_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_destroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void One_destroy(One *self) + * } + */ + public static FunctionDescriptor One_destroy$descriptor() { + return One_destroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void One_destroy(One *self) + * } + */ + public static MethodHandle One_destroy$handle() { + return One_destroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void One_destroy(One *self) + * } + */ + public static MemorySegment One_destroy$address() { + return One_destroy.ADDR; + } + + /** + * {@snippet lang=c : + * void One_destroy(One *self) + * } + */ + public static void One_destroy(MemorySegment self) { + var mh$ = One_destroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("One_destroy", self); + } + mh$.invokeExact(self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class MyEnum_into_value { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_CHAR, + somelib_h.C_INT + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyEnum_into_value"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int8_t MyEnum_into_value(MyEnum self) + * } + */ + public static FunctionDescriptor MyEnum_into_value$descriptor() { + return MyEnum_into_value.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int8_t MyEnum_into_value(MyEnum self) + * } + */ + public static MethodHandle MyEnum_into_value$handle() { + return MyEnum_into_value.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int8_t MyEnum_into_value(MyEnum self) + * } + */ + public static MemorySegment MyEnum_into_value$address() { + return MyEnum_into_value.ADDR; + } + + /** + * {@snippet lang=c : + * int8_t MyEnum_into_value(MyEnum self) + * } + */ + public static byte MyEnum_into_value(int self) { + var mh$ = MyEnum_into_value.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("MyEnum_into_value", self); + } + return (byte)mh$.invokeExact(self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + /** + * Variadic invoker class for: + * {@snippet lang=c : + * MyEnum MyEnum_get_a() + * } + */ + public static class MyEnum_get_a { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + somelib_h.C_INT ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("MyEnum_get_a"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private MyEnum_get_a(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * MyEnum MyEnum_get_a() + * } + */ + public static MyEnum_get_a makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new MyEnum_get_a(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public int apply(Object... x0) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("MyEnum_get_a", x0); + } + return (int)spreader.invokeExact(x0); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static class RefListParameter_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("RefListParameter_destroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void RefListParameter_destroy(RefListParameter *self) + * } + */ + public static FunctionDescriptor RefListParameter_destroy$descriptor() { + return RefListParameter_destroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void RefListParameter_destroy(RefListParameter *self) + * } + */ + public static MethodHandle RefListParameter_destroy$handle() { + return RefListParameter_destroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void RefListParameter_destroy(RefListParameter *self) + * } + */ + public static MemorySegment RefListParameter_destroy$address() { + return RefListParameter_destroy.ADDR; + } + + /** + * {@snippet lang=c : + * void RefListParameter_destroy(RefListParameter *self) + * } + */ + public static void RefListParameter_destroy(MemorySegment self) { + var mh$ = RefListParameter_destroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("RefListParameter_destroy", self); + } + mh$.invokeExact(self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class ResultOpaque_new { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + ResultOpaque_new_result.layout(), + somelib_h.C_INT + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("ResultOpaque_new"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * struct ResultOpaque_new_result ResultOpaque_new(int32_t i) + * } + */ + public static FunctionDescriptor ResultOpaque_new$descriptor() { + return ResultOpaque_new.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * struct ResultOpaque_new_result ResultOpaque_new(int32_t i) + * } + */ + public static MethodHandle ResultOpaque_new$handle() { + return ResultOpaque_new.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * struct ResultOpaque_new_result ResultOpaque_new(int32_t i) + * } + */ + public static MemorySegment ResultOpaque_new$address() { + return ResultOpaque_new.ADDR; + } + + /** + * {@snippet lang=c : + * struct ResultOpaque_new_result ResultOpaque_new(int32_t i) + * } + */ + public static MemorySegment ResultOpaque_new(SegmentAllocator allocator, int i) { + var mh$ = ResultOpaque_new.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("ResultOpaque_new", allocator, i); + } + return (MemorySegment)mh$.invokeExact(allocator, i); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + /** + * Variadic invoker class for: + * {@snippet lang=c : + * struct ResultOpaque_new_failing_foo_result ResultOpaque_new_failing_foo() + * } + */ + public static class ResultOpaque_new_failing_foo { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + ResultOpaque_new_failing_foo_result.layout() ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("ResultOpaque_new_failing_foo"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private ResultOpaque_new_failing_foo(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * struct ResultOpaque_new_failing_foo_result ResultOpaque_new_failing_foo() + * } + */ + public static ResultOpaque_new_failing_foo makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new ResultOpaque_new_failing_foo(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public MemorySegment apply(SegmentAllocator allocator, Object... x0) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("ResultOpaque_new_failing_foo", allocator, x0); + } + return (MemorySegment)spreader.invokeExact(allocator, x0); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + /** + * Variadic invoker class for: + * {@snippet lang=c : + * struct ResultOpaque_new_failing_bar_result ResultOpaque_new_failing_bar() + * } + */ + public static class ResultOpaque_new_failing_bar { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + ResultOpaque_new_failing_bar_result.layout() ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("ResultOpaque_new_failing_bar"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private ResultOpaque_new_failing_bar(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * struct ResultOpaque_new_failing_bar_result ResultOpaque_new_failing_bar() + * } + */ + public static ResultOpaque_new_failing_bar makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new ResultOpaque_new_failing_bar(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public MemorySegment apply(SegmentAllocator allocator, Object... x0) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("ResultOpaque_new_failing_bar", allocator, x0); + } + return (MemorySegment)spreader.invokeExact(allocator, x0); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + /** + * Variadic invoker class for: + * {@snippet lang=c : + * struct ResultOpaque_new_failing_unit_result ResultOpaque_new_failing_unit() + * } + */ + public static class ResultOpaque_new_failing_unit { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + ResultOpaque_new_failing_unit_result.layout() ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("ResultOpaque_new_failing_unit"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private ResultOpaque_new_failing_unit(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * struct ResultOpaque_new_failing_unit_result ResultOpaque_new_failing_unit() + * } + */ + public static ResultOpaque_new_failing_unit makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new ResultOpaque_new_failing_unit(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public MemorySegment apply(SegmentAllocator allocator, Object... x0) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("ResultOpaque_new_failing_unit", allocator, x0); + } + return (MemorySegment)spreader.invokeExact(allocator, x0); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static class ResultOpaque_new_failing_struct { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + ResultOpaque_new_failing_struct_result.layout(), + somelib_h.C_INT + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("ResultOpaque_new_failing_struct"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * struct ResultOpaque_new_failing_struct_result ResultOpaque_new_failing_struct(int32_t i) + * } + */ + public static FunctionDescriptor ResultOpaque_new_failing_struct$descriptor() { + return ResultOpaque_new_failing_struct.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * struct ResultOpaque_new_failing_struct_result ResultOpaque_new_failing_struct(int32_t i) + * } + */ + public static MethodHandle ResultOpaque_new_failing_struct$handle() { + return ResultOpaque_new_failing_struct.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * struct ResultOpaque_new_failing_struct_result ResultOpaque_new_failing_struct(int32_t i) + * } + */ + public static MemorySegment ResultOpaque_new_failing_struct$address() { + return ResultOpaque_new_failing_struct.ADDR; + } + + /** + * {@snippet lang=c : + * struct ResultOpaque_new_failing_struct_result ResultOpaque_new_failing_struct(int32_t i) + * } + */ + public static MemorySegment ResultOpaque_new_failing_struct(SegmentAllocator allocator, int i) { + var mh$ = ResultOpaque_new_failing_struct.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("ResultOpaque_new_failing_struct", allocator, i); + } + return (MemorySegment)mh$.invokeExact(allocator, i); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class ResultOpaque_new_in_err { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + ResultOpaque_new_in_err_result.layout(), + somelib_h.C_INT + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("ResultOpaque_new_in_err"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * struct ResultOpaque_new_in_err_result ResultOpaque_new_in_err(int32_t i) + * } + */ + public static FunctionDescriptor ResultOpaque_new_in_err$descriptor() { + return ResultOpaque_new_in_err.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * struct ResultOpaque_new_in_err_result ResultOpaque_new_in_err(int32_t i) + * } + */ + public static MethodHandle ResultOpaque_new_in_err$handle() { + return ResultOpaque_new_in_err.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * struct ResultOpaque_new_in_err_result ResultOpaque_new_in_err(int32_t i) + * } + */ + public static MemorySegment ResultOpaque_new_in_err$address() { + return ResultOpaque_new_in_err.ADDR; + } + + /** + * {@snippet lang=c : + * struct ResultOpaque_new_in_err_result ResultOpaque_new_in_err(int32_t i) + * } + */ + public static MemorySegment ResultOpaque_new_in_err(SegmentAllocator allocator, int i) { + var mh$ = ResultOpaque_new_in_err.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("ResultOpaque_new_in_err", allocator, i); + } + return (MemorySegment)mh$.invokeExact(allocator, i); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class ResultOpaque_new_int { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + ResultOpaque_new_int_result.layout(), + somelib_h.C_INT + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("ResultOpaque_new_int"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * struct ResultOpaque_new_int_result ResultOpaque_new_int(int32_t i) + * } + */ + public static FunctionDescriptor ResultOpaque_new_int$descriptor() { + return ResultOpaque_new_int.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * struct ResultOpaque_new_int_result ResultOpaque_new_int(int32_t i) + * } + */ + public static MethodHandle ResultOpaque_new_int$handle() { + return ResultOpaque_new_int.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * struct ResultOpaque_new_int_result ResultOpaque_new_int(int32_t i) + * } + */ + public static MemorySegment ResultOpaque_new_int$address() { + return ResultOpaque_new_int.ADDR; + } + + /** + * {@snippet lang=c : + * struct ResultOpaque_new_int_result ResultOpaque_new_int(int32_t i) + * } + */ + public static MemorySegment ResultOpaque_new_int(SegmentAllocator allocator, int i) { + var mh$ = ResultOpaque_new_int.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("ResultOpaque_new_int", allocator, i); + } + return (MemorySegment)mh$.invokeExact(allocator, i); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class ResultOpaque_new_in_enum_err { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + ResultOpaque_new_in_enum_err_result.layout(), + somelib_h.C_INT + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("ResultOpaque_new_in_enum_err"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * struct ResultOpaque_new_in_enum_err_result ResultOpaque_new_in_enum_err(int32_t i) + * } + */ + public static FunctionDescriptor ResultOpaque_new_in_enum_err$descriptor() { + return ResultOpaque_new_in_enum_err.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * struct ResultOpaque_new_in_enum_err_result ResultOpaque_new_in_enum_err(int32_t i) + * } + */ + public static MethodHandle ResultOpaque_new_in_enum_err$handle() { + return ResultOpaque_new_in_enum_err.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * struct ResultOpaque_new_in_enum_err_result ResultOpaque_new_in_enum_err(int32_t i) + * } + */ + public static MemorySegment ResultOpaque_new_in_enum_err$address() { + return ResultOpaque_new_in_enum_err.ADDR; + } + + /** + * {@snippet lang=c : + * struct ResultOpaque_new_in_enum_err_result ResultOpaque_new_in_enum_err(int32_t i) + * } + */ + public static MemorySegment ResultOpaque_new_in_enum_err(SegmentAllocator allocator, int i) { + var mh$ = ResultOpaque_new_in_enum_err.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("ResultOpaque_new_in_enum_err", allocator, i); + } + return (MemorySegment)mh$.invokeExact(allocator, i); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class ResultOpaque_assert_integer { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, + somelib_h.C_INT + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("ResultOpaque_assert_integer"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void ResultOpaque_assert_integer(const ResultOpaque *self, int32_t i) + * } + */ + public static FunctionDescriptor ResultOpaque_assert_integer$descriptor() { + return ResultOpaque_assert_integer.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void ResultOpaque_assert_integer(const ResultOpaque *self, int32_t i) + * } + */ + public static MethodHandle ResultOpaque_assert_integer$handle() { + return ResultOpaque_assert_integer.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void ResultOpaque_assert_integer(const ResultOpaque *self, int32_t i) + * } + */ + public static MemorySegment ResultOpaque_assert_integer$address() { + return ResultOpaque_assert_integer.ADDR; + } + + /** + * {@snippet lang=c : + * void ResultOpaque_assert_integer(const ResultOpaque *self, int32_t i) + * } + */ + public static void ResultOpaque_assert_integer(MemorySegment self, int i) { + var mh$ = ResultOpaque_assert_integer.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("ResultOpaque_assert_integer", self, i); + } + mh$.invokeExact(self, i); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class ResultOpaque_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("ResultOpaque_destroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void ResultOpaque_destroy(ResultOpaque *self) + * } + */ + public static FunctionDescriptor ResultOpaque_destroy$descriptor() { + return ResultOpaque_destroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void ResultOpaque_destroy(ResultOpaque *self) + * } + */ + public static MethodHandle ResultOpaque_destroy$handle() { + return ResultOpaque_destroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void ResultOpaque_destroy(ResultOpaque *self) + * } + */ + public static MemorySegment ResultOpaque_destroy$address() { + return ResultOpaque_destroy.ADDR; + } + + /** + * {@snippet lang=c : + * void ResultOpaque_destroy(ResultOpaque *self) + * } + */ + public static void ResultOpaque_destroy(MemorySegment self) { + var mh$ = ResultOpaque_destroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("ResultOpaque_destroy", self); + } + mh$.invokeExact(self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class RefList_node { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("RefList_node"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * RefList *RefList_node(const RefListParameter *data) + * } + */ + public static FunctionDescriptor RefList_node$descriptor() { + return RefList_node.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * RefList *RefList_node(const RefListParameter *data) + * } + */ + public static MethodHandle RefList_node$handle() { + return RefList_node.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * RefList *RefList_node(const RefListParameter *data) + * } + */ + public static MemorySegment RefList_node$address() { + return RefList_node.ADDR; + } + + /** + * {@snippet lang=c : + * RefList *RefList_node(const RefListParameter *data) + * } + */ + public static MemorySegment RefList_node(MemorySegment data) { + var mh$ = RefList_node.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("RefList_node", data); + } + return (MemorySegment)mh$.invokeExact(data); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class RefList_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("RefList_destroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void RefList_destroy(RefList *self) + * } + */ + public static FunctionDescriptor RefList_destroy$descriptor() { + return RefList_destroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void RefList_destroy(RefList *self) + * } + */ + public static MethodHandle RefList_destroy$handle() { + return RefList_destroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void RefList_destroy(RefList *self) + * } + */ + public static MemorySegment RefList_destroy$address() { + return RefList_destroy.ADDR; + } + + /** + * {@snippet lang=c : + * void RefList_destroy(RefList *self) + * } + */ + public static void RefList_destroy(MemorySegment self) { + var mh$ = RefList_destroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("RefList_destroy", self); + } + mh$.invokeExact(self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class namespace_Unnamespaced_make { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_INT + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_Unnamespaced_make"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * Unnamespaced *namespace_Unnamespaced_make(AttrEnum _e) + * } + */ + public static FunctionDescriptor namespace_Unnamespaced_make$descriptor() { + return namespace_Unnamespaced_make.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * Unnamespaced *namespace_Unnamespaced_make(AttrEnum _e) + * } + */ + public static MethodHandle namespace_Unnamespaced_make$handle() { + return namespace_Unnamespaced_make.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * Unnamespaced *namespace_Unnamespaced_make(AttrEnum _e) + * } + */ + public static MemorySegment namespace_Unnamespaced_make$address() { + return namespace_Unnamespaced_make.ADDR; + } + + /** + * {@snippet lang=c : + * Unnamespaced *namespace_Unnamespaced_make(AttrEnum _e) + * } + */ + public static MemorySegment namespace_Unnamespaced_make(int _e) { + var mh$ = namespace_Unnamespaced_make.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("namespace_Unnamespaced_make", _e); + } + return (MemorySegment)mh$.invokeExact(_e); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class namespace_Unnamespaced_use_namespaced { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_Unnamespaced_use_namespaced"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void namespace_Unnamespaced_use_namespaced(const Unnamespaced *self, const AttrOpaque1 *_n) + * } + */ + public static FunctionDescriptor namespace_Unnamespaced_use_namespaced$descriptor() { + return namespace_Unnamespaced_use_namespaced.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void namespace_Unnamespaced_use_namespaced(const Unnamespaced *self, const AttrOpaque1 *_n) + * } + */ + public static MethodHandle namespace_Unnamespaced_use_namespaced$handle() { + return namespace_Unnamespaced_use_namespaced.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void namespace_Unnamespaced_use_namespaced(const Unnamespaced *self, const AttrOpaque1 *_n) + * } + */ + public static MemorySegment namespace_Unnamespaced_use_namespaced$address() { + return namespace_Unnamespaced_use_namespaced.ADDR; + } + + /** + * {@snippet lang=c : + * void namespace_Unnamespaced_use_namespaced(const Unnamespaced *self, const AttrOpaque1 *_n) + * } + */ + public static void namespace_Unnamespaced_use_namespaced(MemorySegment self, MemorySegment _n) { + var mh$ = namespace_Unnamespaced_use_namespaced.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("namespace_Unnamespaced_use_namespaced", self, _n); + } + mh$.invokeExact(self, _n); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class namespace_Unnamespaced_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_Unnamespaced_destroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void namespace_Unnamespaced_destroy(Unnamespaced *self) + * } + */ + public static FunctionDescriptor namespace_Unnamespaced_destroy$descriptor() { + return namespace_Unnamespaced_destroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void namespace_Unnamespaced_destroy(Unnamespaced *self) + * } + */ + public static MethodHandle namespace_Unnamespaced_destroy$handle() { + return namespace_Unnamespaced_destroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void namespace_Unnamespaced_destroy(Unnamespaced *self) + * } + */ + public static MemorySegment namespace_Unnamespaced_destroy$address() { + return namespace_Unnamespaced_destroy.ADDR; + } + + /** + * {@snippet lang=c : + * void namespace_Unnamespaced_destroy(Unnamespaced *self) + * } + */ + public static void namespace_Unnamespaced_destroy(MemorySegment self) { + var mh$ = namespace_Unnamespaced_destroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("namespace_Unnamespaced_destroy", self); + } + mh$.invokeExact(self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class BorrowedFields_from_bar_and_strings { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + BorrowedFields.layout(), + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG, + somelib_h.C_POINTER, + somelib_h.C_LONG + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("BorrowedFields_from_bar_and_strings"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, const char16_t *dstr16_data, size_t dstr16_len, const char *utf8_str_data, size_t utf8_str_len) + * } + */ + public static FunctionDescriptor BorrowedFields_from_bar_and_strings$descriptor() { + return BorrowedFields_from_bar_and_strings.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, const char16_t *dstr16_data, size_t dstr16_len, const char *utf8_str_data, size_t utf8_str_len) + * } + */ + public static MethodHandle BorrowedFields_from_bar_and_strings$handle() { + return BorrowedFields_from_bar_and_strings.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, const char16_t *dstr16_data, size_t dstr16_len, const char *utf8_str_data, size_t utf8_str_len) + * } + */ + public static MemorySegment BorrowedFields_from_bar_and_strings$address() { + return BorrowedFields_from_bar_and_strings.ADDR; + } + + /** + * {@snippet lang=c : + * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, const char16_t *dstr16_data, size_t dstr16_len, const char *utf8_str_data, size_t utf8_str_len) + * } + */ + public static MemorySegment BorrowedFields_from_bar_and_strings(SegmentAllocator allocator, MemorySegment bar, MemorySegment dstr16_data, long dstr16_len, MemorySegment utf8_str_data, long utf8_str_len) { + var mh$ = BorrowedFields_from_bar_and_strings.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("BorrowedFields_from_bar_and_strings", allocator, bar, dstr16_data, dstr16_len, utf8_str_data, utf8_str_len); + } + return (MemorySegment)mh$.invokeExact(allocator, bar, dstr16_data, dstr16_len, utf8_str_data, utf8_str_len); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class OptionOpaqueChar_assert_char { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, + somelib_h.C_INT + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaqueChar_assert_char"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void OptionOpaqueChar_assert_char(const OptionOpaqueChar *self, char32_t ch) + * } + */ + public static FunctionDescriptor OptionOpaqueChar_assert_char$descriptor() { + return OptionOpaqueChar_assert_char.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void OptionOpaqueChar_assert_char(const OptionOpaqueChar *self, char32_t ch) + * } + */ + public static MethodHandle OptionOpaqueChar_assert_char$handle() { + return OptionOpaqueChar_assert_char.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void OptionOpaqueChar_assert_char(const OptionOpaqueChar *self, char32_t ch) + * } + */ + public static MemorySegment OptionOpaqueChar_assert_char$address() { + return OptionOpaqueChar_assert_char.ADDR; + } + + /** + * {@snippet lang=c : + * void OptionOpaqueChar_assert_char(const OptionOpaqueChar *self, char32_t ch) + * } + */ + public static void OptionOpaqueChar_assert_char(MemorySegment self, int ch) { + var mh$ = OptionOpaqueChar_assert_char.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("OptionOpaqueChar_assert_char", self, ch); + } + mh$.invokeExact(self, ch); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class OptionOpaqueChar_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaqueChar_destroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void OptionOpaqueChar_destroy(OptionOpaqueChar *self) + * } + */ + public static FunctionDescriptor OptionOpaqueChar_destroy$descriptor() { + return OptionOpaqueChar_destroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void OptionOpaqueChar_destroy(OptionOpaqueChar *self) + * } + */ + public static MethodHandle OptionOpaqueChar_destroy$handle() { + return OptionOpaqueChar_destroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void OptionOpaqueChar_destroy(OptionOpaqueChar *self) + * } + */ + public static MemorySegment OptionOpaqueChar_destroy$address() { + return OptionOpaqueChar_destroy.ADDR; + } + + /** + * {@snippet lang=c : + * void OptionOpaqueChar_destroy(OptionOpaqueChar *self) + * } + */ + public static void OptionOpaqueChar_destroy(MemorySegment self) { + var mh$ = OptionOpaqueChar_destroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("OptionOpaqueChar_destroy", self); + } + mh$.invokeExact(self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class namespace_MyIterable_new { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_MyIterable_new"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * MyIterable *namespace_MyIterable_new(const uint8_t *x_data, size_t x_len) + * } + */ + public static FunctionDescriptor namespace_MyIterable_new$descriptor() { + return namespace_MyIterable_new.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * MyIterable *namespace_MyIterable_new(const uint8_t *x_data, size_t x_len) + * } + */ + public static MethodHandle namespace_MyIterable_new$handle() { + return namespace_MyIterable_new.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * MyIterable *namespace_MyIterable_new(const uint8_t *x_data, size_t x_len) + * } + */ + public static MemorySegment namespace_MyIterable_new$address() { + return namespace_MyIterable_new.ADDR; + } + + /** + * {@snippet lang=c : + * MyIterable *namespace_MyIterable_new(const uint8_t *x_data, size_t x_len) + * } + */ + public static MemorySegment namespace_MyIterable_new(MemorySegment x_data, long x_len) { + var mh$ = namespace_MyIterable_new.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("namespace_MyIterable_new", x_data, x_len); + } + return (MemorySegment)mh$.invokeExact(x_data, x_len); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class namespace_MyIterable_iter { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_MyIterable_iter"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * MyIterator *namespace_MyIterable_iter(const MyIterable *self) + * } + */ + public static FunctionDescriptor namespace_MyIterable_iter$descriptor() { + return namespace_MyIterable_iter.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * MyIterator *namespace_MyIterable_iter(const MyIterable *self) + * } + */ + public static MethodHandle namespace_MyIterable_iter$handle() { + return namespace_MyIterable_iter.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * MyIterator *namespace_MyIterable_iter(const MyIterable *self) + * } + */ + public static MemorySegment namespace_MyIterable_iter$address() { + return namespace_MyIterable_iter.ADDR; + } + + /** + * {@snippet lang=c : + * MyIterator *namespace_MyIterable_iter(const MyIterable *self) + * } + */ + public static MemorySegment namespace_MyIterable_iter(MemorySegment self) { + var mh$ = namespace_MyIterable_iter.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("namespace_MyIterable_iter", self); + } + return (MemorySegment)mh$.invokeExact(self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class namespace_MyIterable_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_MyIterable_destroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void namespace_MyIterable_destroy(MyIterable *self) + * } + */ + public static FunctionDescriptor namespace_MyIterable_destroy$descriptor() { + return namespace_MyIterable_destroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void namespace_MyIterable_destroy(MyIterable *self) + * } + */ + public static MethodHandle namespace_MyIterable_destroy$handle() { + return namespace_MyIterable_destroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void namespace_MyIterable_destroy(MyIterable *self) + * } + */ + public static MemorySegment namespace_MyIterable_destroy$address() { + return namespace_MyIterable_destroy.ADDR; + } + + /** + * {@snippet lang=c : + * void namespace_MyIterable_destroy(MyIterable *self) + * } + */ + public static void namespace_MyIterable_destroy(MemorySegment self) { + var mh$ = namespace_MyIterable_destroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("namespace_MyIterable_destroy", self); + } + mh$.invokeExact(self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class namespace_OpaqueIterator_next { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_OpaqueIterator_next"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * AttrOpaque1 *namespace_OpaqueIterator_next(OpaqueIterator *self) + * } + */ + public static FunctionDescriptor namespace_OpaqueIterator_next$descriptor() { + return namespace_OpaqueIterator_next.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * AttrOpaque1 *namespace_OpaqueIterator_next(OpaqueIterator *self) + * } + */ + public static MethodHandle namespace_OpaqueIterator_next$handle() { + return namespace_OpaqueIterator_next.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * AttrOpaque1 *namespace_OpaqueIterator_next(OpaqueIterator *self) + * } + */ + public static MemorySegment namespace_OpaqueIterator_next$address() { + return namespace_OpaqueIterator_next.ADDR; + } + + /** + * {@snippet lang=c : + * AttrOpaque1 *namespace_OpaqueIterator_next(OpaqueIterator *self) + * } + */ + public static MemorySegment namespace_OpaqueIterator_next(MemorySegment self) { + var mh$ = namespace_OpaqueIterator_next.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("namespace_OpaqueIterator_next", self); + } + return (MemorySegment)mh$.invokeExact(self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class namespace_OpaqueIterator_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_OpaqueIterator_destroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void namespace_OpaqueIterator_destroy(OpaqueIterator *self) + * } + */ + public static FunctionDescriptor namespace_OpaqueIterator_destroy$descriptor() { + return namespace_OpaqueIterator_destroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void namespace_OpaqueIterator_destroy(OpaqueIterator *self) + * } + */ + public static MethodHandle namespace_OpaqueIterator_destroy$handle() { + return namespace_OpaqueIterator_destroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void namespace_OpaqueIterator_destroy(OpaqueIterator *self) + * } + */ + public static MemorySegment namespace_OpaqueIterator_destroy$address() { + return namespace_OpaqueIterator_destroy.ADDR; + } + + /** + * {@snippet lang=c : + * void namespace_OpaqueIterator_destroy(OpaqueIterator *self) + * } + */ + public static void namespace_OpaqueIterator_destroy(MemorySegment self) { + var mh$ = namespace_OpaqueIterator_destroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("namespace_OpaqueIterator_destroy", self); + } + mh$.invokeExact(self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class namespace_MyIterator_next { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + namespace_MyIterator_next_result.layout(), + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_MyIterator_next"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * struct namespace_MyIterator_next_result namespace_MyIterator_next(MyIterator *self) + * } + */ + public static FunctionDescriptor namespace_MyIterator_next$descriptor() { + return namespace_MyIterator_next.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * struct namespace_MyIterator_next_result namespace_MyIterator_next(MyIterator *self) + * } + */ + public static MethodHandle namespace_MyIterator_next$handle() { + return namespace_MyIterator_next.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * struct namespace_MyIterator_next_result namespace_MyIterator_next(MyIterator *self) + * } + */ + public static MemorySegment namespace_MyIterator_next$address() { + return namespace_MyIterator_next.ADDR; + } + + /** + * {@snippet lang=c : + * struct namespace_MyIterator_next_result namespace_MyIterator_next(MyIterator *self) + * } + */ + public static MemorySegment namespace_MyIterator_next(SegmentAllocator allocator, MemorySegment self) { + var mh$ = namespace_MyIterator_next.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("namespace_MyIterator_next", allocator, self); + } + return (MemorySegment)mh$.invokeExact(allocator, self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class namespace_MyIterator_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_MyIterator_destroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void namespace_MyIterator_destroy(MyIterator *self) + * } + */ + public static FunctionDescriptor namespace_MyIterator_destroy$descriptor() { + return namespace_MyIterator_destroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void namespace_MyIterator_destroy(MyIterator *self) + * } + */ + public static MethodHandle namespace_MyIterator_destroy$handle() { + return namespace_MyIterator_destroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void namespace_MyIterator_destroy(MyIterator *self) + * } + */ + public static MemorySegment namespace_MyIterator_destroy$address() { + return namespace_MyIterator_destroy.ADDR; + } + + /** + * {@snippet lang=c : + * void namespace_MyIterator_destroy(MyIterator *self) + * } + */ + public static void namespace_MyIterator_destroy(MemorySegment self) { + var mh$ = namespace_MyIterator_destroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("namespace_MyIterator_destroy", self); + } + mh$.invokeExact(self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class OptionOpaque_new { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_INT + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaque_new"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * OptionOpaque *OptionOpaque_new(int32_t i) + * } + */ + public static FunctionDescriptor OptionOpaque_new$descriptor() { + return OptionOpaque_new.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * OptionOpaque *OptionOpaque_new(int32_t i) + * } + */ + public static MethodHandle OptionOpaque_new$handle() { + return OptionOpaque_new.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * OptionOpaque *OptionOpaque_new(int32_t i) + * } + */ + public static MemorySegment OptionOpaque_new$address() { + return OptionOpaque_new.ADDR; + } + + /** + * {@snippet lang=c : + * OptionOpaque *OptionOpaque_new(int32_t i) + * } + */ + public static MemorySegment OptionOpaque_new(int i) { + var mh$ = OptionOpaque_new.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("OptionOpaque_new", i); + } + return (MemorySegment)mh$.invokeExact(i); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + /** + * Variadic invoker class for: + * {@snippet lang=c : + * OptionOpaque *OptionOpaque_new_none() + * } + */ + public static class OptionOpaque_new_none { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + somelib_h.C_POINTER ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaque_new_none"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private OptionOpaque_new_none(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * OptionOpaque *OptionOpaque_new_none() + * } + */ + public static OptionOpaque_new_none makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new OptionOpaque_new_none(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public MemorySegment apply(Object... x0) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("OptionOpaque_new_none", x0); + } + return (MemorySegment)spreader.invokeExact(x0); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + /** + * Variadic invoker class for: + * {@snippet lang=c : + * struct OptionOpaque_returns_result OptionOpaque_returns() + * } + */ + public static class OptionOpaque_returns { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + OptionOpaque_returns_result.layout() ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaque_returns"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private OptionOpaque_returns(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * struct OptionOpaque_returns_result OptionOpaque_returns() + * } + */ + public static OptionOpaque_returns makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new OptionOpaque_returns(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public MemorySegment apply(SegmentAllocator allocator, Object... x0) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("OptionOpaque_returns", allocator, x0); + } + return (MemorySegment)spreader.invokeExact(allocator, x0); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static class OptionOpaque_option_isize { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + OptionOpaque_option_isize_result.layout(), + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaque_option_isize"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * struct OptionOpaque_option_isize_result OptionOpaque_option_isize(const OptionOpaque *self) + * } + */ + public static FunctionDescriptor OptionOpaque_option_isize$descriptor() { + return OptionOpaque_option_isize.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * struct OptionOpaque_option_isize_result OptionOpaque_option_isize(const OptionOpaque *self) + * } + */ + public static MethodHandle OptionOpaque_option_isize$handle() { + return OptionOpaque_option_isize.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * struct OptionOpaque_option_isize_result OptionOpaque_option_isize(const OptionOpaque *self) + * } + */ + public static MemorySegment OptionOpaque_option_isize$address() { + return OptionOpaque_option_isize.ADDR; + } + + /** + * {@snippet lang=c : + * struct OptionOpaque_option_isize_result OptionOpaque_option_isize(const OptionOpaque *self) + * } + */ + public static MemorySegment OptionOpaque_option_isize(SegmentAllocator allocator, MemorySegment self) { + var mh$ = OptionOpaque_option_isize.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("OptionOpaque_option_isize", allocator, self); + } + return (MemorySegment)mh$.invokeExact(allocator, self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class OptionOpaque_option_usize { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + OptionOpaque_option_usize_result.layout(), + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaque_option_usize"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * struct OptionOpaque_option_usize_result OptionOpaque_option_usize(const OptionOpaque *self) + * } + */ + public static FunctionDescriptor OptionOpaque_option_usize$descriptor() { + return OptionOpaque_option_usize.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * struct OptionOpaque_option_usize_result OptionOpaque_option_usize(const OptionOpaque *self) + * } + */ + public static MethodHandle OptionOpaque_option_usize$handle() { + return OptionOpaque_option_usize.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * struct OptionOpaque_option_usize_result OptionOpaque_option_usize(const OptionOpaque *self) + * } + */ + public static MemorySegment OptionOpaque_option_usize$address() { + return OptionOpaque_option_usize.ADDR; + } + + /** + * {@snippet lang=c : + * struct OptionOpaque_option_usize_result OptionOpaque_option_usize(const OptionOpaque *self) + * } + */ + public static MemorySegment OptionOpaque_option_usize(SegmentAllocator allocator, MemorySegment self) { + var mh$ = OptionOpaque_option_usize.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("OptionOpaque_option_usize", allocator, self); + } + return (MemorySegment)mh$.invokeExact(allocator, self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class OptionOpaque_option_i32 { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + OptionOpaque_option_i32_result.layout(), + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaque_option_i32"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * struct OptionOpaque_option_i32_result OptionOpaque_option_i32(const OptionOpaque *self) + * } + */ + public static FunctionDescriptor OptionOpaque_option_i32$descriptor() { + return OptionOpaque_option_i32.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * struct OptionOpaque_option_i32_result OptionOpaque_option_i32(const OptionOpaque *self) + * } + */ + public static MethodHandle OptionOpaque_option_i32$handle() { + return OptionOpaque_option_i32.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * struct OptionOpaque_option_i32_result OptionOpaque_option_i32(const OptionOpaque *self) + * } + */ + public static MemorySegment OptionOpaque_option_i32$address() { + return OptionOpaque_option_i32.ADDR; + } + + /** + * {@snippet lang=c : + * struct OptionOpaque_option_i32_result OptionOpaque_option_i32(const OptionOpaque *self) + * } + */ + public static MemorySegment OptionOpaque_option_i32(SegmentAllocator allocator, MemorySegment self) { + var mh$ = OptionOpaque_option_i32.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("OptionOpaque_option_i32", allocator, self); + } + return (MemorySegment)mh$.invokeExact(allocator, self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class OptionOpaque_option_u32 { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + OptionOpaque_option_u32_result.layout(), + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaque_option_u32"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * struct OptionOpaque_option_u32_result OptionOpaque_option_u32(const OptionOpaque *self) + * } + */ + public static FunctionDescriptor OptionOpaque_option_u32$descriptor() { + return OptionOpaque_option_u32.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * struct OptionOpaque_option_u32_result OptionOpaque_option_u32(const OptionOpaque *self) + * } + */ + public static MethodHandle OptionOpaque_option_u32$handle() { + return OptionOpaque_option_u32.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * struct OptionOpaque_option_u32_result OptionOpaque_option_u32(const OptionOpaque *self) + * } + */ + public static MemorySegment OptionOpaque_option_u32$address() { + return OptionOpaque_option_u32.ADDR; + } + + /** + * {@snippet lang=c : + * struct OptionOpaque_option_u32_result OptionOpaque_option_u32(const OptionOpaque *self) + * } + */ + public static MemorySegment OptionOpaque_option_u32(SegmentAllocator allocator, MemorySegment self) { + var mh$ = OptionOpaque_option_u32.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("OptionOpaque_option_u32", allocator, self); + } + return (MemorySegment)mh$.invokeExact(allocator, self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + /** + * Variadic invoker class for: + * {@snippet lang=c : + * OptionStruct OptionOpaque_new_struct() + * } + */ + public static class OptionOpaque_new_struct { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + OptionStruct.layout() ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaque_new_struct"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private OptionOpaque_new_struct(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * OptionStruct OptionOpaque_new_struct() + * } + */ + public static OptionOpaque_new_struct makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new OptionOpaque_new_struct(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public MemorySegment apply(SegmentAllocator allocator, Object... x0) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("OptionOpaque_new_struct", allocator, x0); + } + return (MemorySegment)spreader.invokeExact(allocator, x0); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + /** + * Variadic invoker class for: + * {@snippet lang=c : + * OptionStruct OptionOpaque_new_struct_nones() + * } + */ + public static class OptionOpaque_new_struct_nones { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + OptionStruct.layout() ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaque_new_struct_nones"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private OptionOpaque_new_struct_nones(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * OptionStruct OptionOpaque_new_struct_nones() + * } + */ + public static OptionOpaque_new_struct_nones makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new OptionOpaque_new_struct_nones(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public MemorySegment apply(SegmentAllocator allocator, Object... x0) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("OptionOpaque_new_struct_nones", allocator, x0); + } + return (MemorySegment)spreader.invokeExact(allocator, x0); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static class OptionOpaque_assert_integer { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, + somelib_h.C_INT + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaque_assert_integer"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void OptionOpaque_assert_integer(const OptionOpaque *self, int32_t i) + * } + */ + public static FunctionDescriptor OptionOpaque_assert_integer$descriptor() { + return OptionOpaque_assert_integer.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void OptionOpaque_assert_integer(const OptionOpaque *self, int32_t i) + * } + */ + public static MethodHandle OptionOpaque_assert_integer$handle() { + return OptionOpaque_assert_integer.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void OptionOpaque_assert_integer(const OptionOpaque *self, int32_t i) + * } + */ + public static MemorySegment OptionOpaque_assert_integer$address() { + return OptionOpaque_assert_integer.ADDR; + } + + /** + * {@snippet lang=c : + * void OptionOpaque_assert_integer(const OptionOpaque *self, int32_t i) + * } + */ + public static void OptionOpaque_assert_integer(MemorySegment self, int i) { + var mh$ = OptionOpaque_assert_integer.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("OptionOpaque_assert_integer", self, i); + } + mh$.invokeExact(self, i); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class OptionOpaque_option_opaque_argument { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_BOOL, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaque_option_opaque_argument"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * bool OptionOpaque_option_opaque_argument(const OptionOpaque *arg) + * } + */ + public static FunctionDescriptor OptionOpaque_option_opaque_argument$descriptor() { + return OptionOpaque_option_opaque_argument.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * bool OptionOpaque_option_opaque_argument(const OptionOpaque *arg) + * } + */ + public static MethodHandle OptionOpaque_option_opaque_argument$handle() { + return OptionOpaque_option_opaque_argument.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * bool OptionOpaque_option_opaque_argument(const OptionOpaque *arg) + * } + */ + public static MemorySegment OptionOpaque_option_opaque_argument$address() { + return OptionOpaque_option_opaque_argument.ADDR; + } + + /** + * {@snippet lang=c : + * bool OptionOpaque_option_opaque_argument(const OptionOpaque *arg) + * } + */ + public static boolean OptionOpaque_option_opaque_argument(MemorySegment arg) { + var mh$ = OptionOpaque_option_opaque_argument.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("OptionOpaque_option_opaque_argument", arg); + } + return (boolean)mh$.invokeExact(arg); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class OptionOpaque_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaque_destroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void OptionOpaque_destroy(OptionOpaque *self) + * } + */ + public static FunctionDescriptor OptionOpaque_destroy$descriptor() { + return OptionOpaque_destroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void OptionOpaque_destroy(OptionOpaque *self) + * } + */ + public static MethodHandle OptionOpaque_destroy$handle() { + return OptionOpaque_destroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void OptionOpaque_destroy(OptionOpaque *self) + * } + */ + public static MemorySegment OptionOpaque_destroy$address() { + return OptionOpaque_destroy.ADDR; + } + + /** + * {@snippet lang=c : + * void OptionOpaque_destroy(OptionOpaque *self) + * } + */ + public static void OptionOpaque_destroy(MemorySegment self) { + var mh$ = OptionOpaque_destroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("OptionOpaque_destroy", self); + } + mh$.invokeExact(self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class Bar_foo { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("Bar_foo"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * const Foo *Bar_foo(const Bar *self) + * } + */ + public static FunctionDescriptor Bar_foo$descriptor() { + return Bar_foo.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * const Foo *Bar_foo(const Bar *self) + * } + */ + public static MethodHandle Bar_foo$handle() { + return Bar_foo.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * const Foo *Bar_foo(const Bar *self) + * } + */ + public static MemorySegment Bar_foo$address() { + return Bar_foo.ADDR; + } + + /** + * {@snippet lang=c : + * const Foo *Bar_foo(const Bar *self) + * } + */ + public static MemorySegment Bar_foo(MemorySegment self) { + var mh$ = Bar_foo.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Bar_foo", self); + } + return (MemorySegment)mh$.invokeExact(self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class Bar_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("Bar_destroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void Bar_destroy(Bar *self) + * } + */ + public static FunctionDescriptor Bar_destroy$descriptor() { + return Bar_destroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void Bar_destroy(Bar *self) + * } + */ + public static MethodHandle Bar_destroy$handle() { + return Bar_destroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void Bar_destroy(Bar *self) + * } + */ + public static MemorySegment Bar_destroy$address() { + return Bar_destroy.ADDR; + } + + /** + * {@snippet lang=c : + * void Bar_destroy(Bar *self) + * } + */ + public static void Bar_destroy(MemorySegment self) { + var mh$ = Bar_destroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Bar_destroy", self); + } + mh$.invokeExact(self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + /** + * {@snippet lang=c : + * #define __DARWIN_SUF_EXTSN "$DARWIN_EXTSN" + * } + */ + public static MemorySegment __DARWIN_SUF_EXTSN() { + class Holder { + static final MemorySegment __DARWIN_SUF_EXTSN + = somelib_h.LIBRARY_ARENA.allocateFrom("$DARWIN_EXTSN"); + } + return Holder.__DARWIN_SUF_EXTSN; + } + private static final long __DARWIN_C_ANSI = 4096L; + /** + * {@snippet lang=c : + * #define __DARWIN_C_ANSI 4096 + * } + */ + public static long __DARWIN_C_ANSI() { + return __DARWIN_C_ANSI; + } + private static final long __DARWIN_C_FULL = 900000L; + /** + * {@snippet lang=c : + * #define __DARWIN_C_FULL 900000 + * } + */ + public static long __DARWIN_C_FULL() { + return __DARWIN_C_FULL; + } + private static final long __DARWIN_C_LEVEL = 900000L; + /** + * {@snippet lang=c : + * #define __DARWIN_C_LEVEL 900000 + * } + */ + public static long __DARWIN_C_LEVEL() { + return __DARWIN_C_LEVEL; + } + private static final int MAC_OS_X_VERSION_10_0 = (int)1000L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_0 1000 + * } + */ + public static int MAC_OS_X_VERSION_10_0() { + return MAC_OS_X_VERSION_10_0; + } + private static final int MAC_OS_X_VERSION_10_1 = (int)1010L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_1 1010 + * } + */ + public static int MAC_OS_X_VERSION_10_1() { + return MAC_OS_X_VERSION_10_1; + } + private static final int MAC_OS_X_VERSION_10_2 = (int)1020L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_2 1020 + * } + */ + public static int MAC_OS_X_VERSION_10_2() { + return MAC_OS_X_VERSION_10_2; + } + private static final int MAC_OS_X_VERSION_10_3 = (int)1030L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_3 1030 + * } + */ + public static int MAC_OS_X_VERSION_10_3() { + return MAC_OS_X_VERSION_10_3; + } + private static final int MAC_OS_X_VERSION_10_4 = (int)1040L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_4 1040 + * } + */ + public static int MAC_OS_X_VERSION_10_4() { + return MAC_OS_X_VERSION_10_4; + } + private static final int MAC_OS_X_VERSION_10_5 = (int)1050L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_5 1050 + * } + */ + public static int MAC_OS_X_VERSION_10_5() { + return MAC_OS_X_VERSION_10_5; + } + private static final int MAC_OS_X_VERSION_10_6 = (int)1060L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_6 1060 + * } + */ + public static int MAC_OS_X_VERSION_10_6() { + return MAC_OS_X_VERSION_10_6; + } + private static final int MAC_OS_X_VERSION_10_7 = (int)1070L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_7 1070 + * } + */ + public static int MAC_OS_X_VERSION_10_7() { + return MAC_OS_X_VERSION_10_7; + } + private static final int MAC_OS_X_VERSION_10_8 = (int)1080L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_8 1080 + * } + */ + public static int MAC_OS_X_VERSION_10_8() { + return MAC_OS_X_VERSION_10_8; + } + private static final int MAC_OS_X_VERSION_10_9 = (int)1090L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_9 1090 + * } + */ + public static int MAC_OS_X_VERSION_10_9() { + return MAC_OS_X_VERSION_10_9; + } + private static final int MAC_OS_X_VERSION_10_10 = (int)101000L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_10 101000 + * } + */ + public static int MAC_OS_X_VERSION_10_10() { + return MAC_OS_X_VERSION_10_10; + } + private static final int MAC_OS_X_VERSION_10_10_2 = (int)101002L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_10_2 101002 + * } + */ + public static int MAC_OS_X_VERSION_10_10_2() { + return MAC_OS_X_VERSION_10_10_2; + } + private static final int MAC_OS_X_VERSION_10_10_3 = (int)101003L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_10_3 101003 + * } + */ + public static int MAC_OS_X_VERSION_10_10_3() { + return MAC_OS_X_VERSION_10_10_3; + } + private static final int MAC_OS_X_VERSION_10_11 = (int)101100L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_11 101100 + * } + */ + public static int MAC_OS_X_VERSION_10_11() { + return MAC_OS_X_VERSION_10_11; + } + private static final int MAC_OS_X_VERSION_10_11_2 = (int)101102L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_11_2 101102 + * } + */ + public static int MAC_OS_X_VERSION_10_11_2() { + return MAC_OS_X_VERSION_10_11_2; + } + private static final int MAC_OS_X_VERSION_10_11_3 = (int)101103L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_11_3 101103 + * } + */ + public static int MAC_OS_X_VERSION_10_11_3() { + return MAC_OS_X_VERSION_10_11_3; + } + private static final int MAC_OS_X_VERSION_10_11_4 = (int)101104L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_11_4 101104 + * } + */ + public static int MAC_OS_X_VERSION_10_11_4() { + return MAC_OS_X_VERSION_10_11_4; + } + private static final int MAC_OS_X_VERSION_10_12 = (int)101200L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_12 101200 + * } + */ + public static int MAC_OS_X_VERSION_10_12() { + return MAC_OS_X_VERSION_10_12; + } + private static final int MAC_OS_X_VERSION_10_12_1 = (int)101201L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_12_1 101201 + * } + */ + public static int MAC_OS_X_VERSION_10_12_1() { + return MAC_OS_X_VERSION_10_12_1; + } + private static final int MAC_OS_X_VERSION_10_12_2 = (int)101202L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_12_2 101202 + * } + */ + public static int MAC_OS_X_VERSION_10_12_2() { + return MAC_OS_X_VERSION_10_12_2; + } + private static final int MAC_OS_X_VERSION_10_12_4 = (int)101204L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_12_4 101204 + * } + */ + public static int MAC_OS_X_VERSION_10_12_4() { + return MAC_OS_X_VERSION_10_12_4; + } + private static final int MAC_OS_X_VERSION_10_13 = (int)101300L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_13 101300 + * } + */ + public static int MAC_OS_X_VERSION_10_13() { + return MAC_OS_X_VERSION_10_13; + } + private static final int MAC_OS_X_VERSION_10_13_1 = (int)101301L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_13_1 101301 + * } + */ + public static int MAC_OS_X_VERSION_10_13_1() { + return MAC_OS_X_VERSION_10_13_1; + } + private static final int MAC_OS_X_VERSION_10_13_2 = (int)101302L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_13_2 101302 + * } + */ + public static int MAC_OS_X_VERSION_10_13_2() { + return MAC_OS_X_VERSION_10_13_2; + } + private static final int MAC_OS_X_VERSION_10_13_4 = (int)101304L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_13_4 101304 + * } + */ + public static int MAC_OS_X_VERSION_10_13_4() { + return MAC_OS_X_VERSION_10_13_4; + } + private static final int MAC_OS_X_VERSION_10_14 = (int)101400L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_14 101400 + * } + */ + public static int MAC_OS_X_VERSION_10_14() { + return MAC_OS_X_VERSION_10_14; + } + private static final int MAC_OS_X_VERSION_10_14_1 = (int)101401L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_14_1 101401 + * } + */ + public static int MAC_OS_X_VERSION_10_14_1() { + return MAC_OS_X_VERSION_10_14_1; + } + private static final int MAC_OS_X_VERSION_10_14_4 = (int)101404L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_14_4 101404 + * } + */ + public static int MAC_OS_X_VERSION_10_14_4() { + return MAC_OS_X_VERSION_10_14_4; + } + private static final int MAC_OS_X_VERSION_10_14_5 = (int)101405L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_14_5 101405 + * } + */ + public static int MAC_OS_X_VERSION_10_14_5() { + return MAC_OS_X_VERSION_10_14_5; + } + private static final int MAC_OS_X_VERSION_10_14_6 = (int)101406L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_14_6 101406 + * } + */ + public static int MAC_OS_X_VERSION_10_14_6() { + return MAC_OS_X_VERSION_10_14_6; + } + private static final int MAC_OS_X_VERSION_10_15 = (int)101500L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_15 101500 + * } + */ + public static int MAC_OS_X_VERSION_10_15() { + return MAC_OS_X_VERSION_10_15; + } + private static final int MAC_OS_X_VERSION_10_15_1 = (int)101501L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_15_1 101501 + * } + */ + public static int MAC_OS_X_VERSION_10_15_1() { + return MAC_OS_X_VERSION_10_15_1; + } + private static final int MAC_OS_X_VERSION_10_15_4 = (int)101504L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_15_4 101504 + * } + */ + public static int MAC_OS_X_VERSION_10_15_4() { + return MAC_OS_X_VERSION_10_15_4; + } + private static final int MAC_OS_X_VERSION_10_16 = (int)101600L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_16 101600 + * } + */ + public static int MAC_OS_X_VERSION_10_16() { + return MAC_OS_X_VERSION_10_16; + } + private static final int MAC_OS_VERSION_11_0 = (int)110000L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_11_0 110000 + * } + */ + public static int MAC_OS_VERSION_11_0() { + return MAC_OS_VERSION_11_0; + } + private static final int MAC_OS_VERSION_11_1 = (int)110100L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_11_1 110100 + * } + */ + public static int MAC_OS_VERSION_11_1() { + return MAC_OS_VERSION_11_1; + } + private static final int MAC_OS_VERSION_11_3 = (int)110300L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_11_3 110300 + * } + */ + public static int MAC_OS_VERSION_11_3() { + return MAC_OS_VERSION_11_3; + } + private static final int MAC_OS_VERSION_11_4 = (int)110400L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_11_4 110400 + * } + */ + public static int MAC_OS_VERSION_11_4() { + return MAC_OS_VERSION_11_4; + } + private static final int MAC_OS_VERSION_11_5 = (int)110500L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_11_5 110500 + * } + */ + public static int MAC_OS_VERSION_11_5() { + return MAC_OS_VERSION_11_5; + } + private static final int MAC_OS_VERSION_11_6 = (int)110600L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_11_6 110600 + * } + */ + public static int MAC_OS_VERSION_11_6() { + return MAC_OS_VERSION_11_6; + } + private static final int MAC_OS_VERSION_12_0 = (int)120000L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_12_0 120000 + * } + */ + public static int MAC_OS_VERSION_12_0() { + return MAC_OS_VERSION_12_0; + } + private static final int MAC_OS_VERSION_12_1 = (int)120100L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_12_1 120100 + * } + */ + public static int MAC_OS_VERSION_12_1() { + return MAC_OS_VERSION_12_1; + } + private static final int MAC_OS_VERSION_12_2 = (int)120200L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_12_2 120200 + * } + */ + public static int MAC_OS_VERSION_12_2() { + return MAC_OS_VERSION_12_2; + } + private static final int MAC_OS_VERSION_12_3 = (int)120300L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_12_3 120300 + * } + */ + public static int MAC_OS_VERSION_12_3() { + return MAC_OS_VERSION_12_3; + } + private static final int MAC_OS_VERSION_12_4 = (int)120400L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_12_4 120400 + * } + */ + public static int MAC_OS_VERSION_12_4() { + return MAC_OS_VERSION_12_4; + } + private static final int MAC_OS_VERSION_12_5 = (int)120500L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_12_5 120500 + * } + */ + public static int MAC_OS_VERSION_12_5() { + return MAC_OS_VERSION_12_5; + } + private static final int MAC_OS_VERSION_12_6 = (int)120600L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_12_6 120600 + * } + */ + public static int MAC_OS_VERSION_12_6() { + return MAC_OS_VERSION_12_6; + } + private static final int MAC_OS_VERSION_12_7 = (int)120700L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_12_7 120700 + * } + */ + public static int MAC_OS_VERSION_12_7() { + return MAC_OS_VERSION_12_7; + } + private static final int MAC_OS_VERSION_13_0 = (int)130000L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_13_0 130000 + * } + */ + public static int MAC_OS_VERSION_13_0() { + return MAC_OS_VERSION_13_0; + } + private static final int MAC_OS_VERSION_13_1 = (int)130100L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_13_1 130100 + * } + */ + public static int MAC_OS_VERSION_13_1() { + return MAC_OS_VERSION_13_1; + } + private static final int MAC_OS_VERSION_13_2 = (int)130200L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_13_2 130200 + * } + */ + public static int MAC_OS_VERSION_13_2() { + return MAC_OS_VERSION_13_2; + } + private static final int MAC_OS_VERSION_13_3 = (int)130300L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_13_3 130300 + * } + */ + public static int MAC_OS_VERSION_13_3() { + return MAC_OS_VERSION_13_3; + } + private static final int MAC_OS_VERSION_13_4 = (int)130400L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_13_4 130400 + * } + */ + public static int MAC_OS_VERSION_13_4() { + return MAC_OS_VERSION_13_4; + } + private static final int MAC_OS_VERSION_13_5 = (int)130500L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_13_5 130500 + * } + */ + public static int MAC_OS_VERSION_13_5() { + return MAC_OS_VERSION_13_5; + } + private static final int MAC_OS_VERSION_13_6 = (int)130600L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_13_6 130600 + * } + */ + public static int MAC_OS_VERSION_13_6() { + return MAC_OS_VERSION_13_6; + } + private static final int MAC_OS_VERSION_14_0 = (int)140000L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_14_0 140000 + * } + */ + public static int MAC_OS_VERSION_14_0() { + return MAC_OS_VERSION_14_0; + } + private static final int MAC_OS_VERSION_14_1 = (int)140100L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_14_1 140100 + * } + */ + public static int MAC_OS_VERSION_14_1() { + return MAC_OS_VERSION_14_1; + } + private static final int MAC_OS_VERSION_14_2 = (int)140200L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_14_2 140200 + * } + */ + public static int MAC_OS_VERSION_14_2() { + return MAC_OS_VERSION_14_2; + } + private static final int MAC_OS_VERSION_14_3 = (int)140300L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_14_3 140300 + * } + */ + public static int MAC_OS_VERSION_14_3() { + return MAC_OS_VERSION_14_3; + } + private static final int MAC_OS_VERSION_14_4 = (int)140400L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_14_4 140400 + * } + */ + public static int MAC_OS_VERSION_14_4() { + return MAC_OS_VERSION_14_4; + } + private static final int MAC_OS_VERSION_14_5 = (int)140500L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_14_5 140500 + * } + */ + public static int MAC_OS_VERSION_14_5() { + return MAC_OS_VERSION_14_5; + } + private static final int __MAC_OS_X_VERSION_MAX_ALLOWED = (int)140500L; + /** + * {@snippet lang=c : + * #define __MAC_OS_X_VERSION_MAX_ALLOWED 140500 + * } + */ + public static int __MAC_OS_X_VERSION_MAX_ALLOWED() { + return __MAC_OS_X_VERSION_MAX_ALLOWED; + } + private static final MemorySegment __DARWIN_NULL = MemorySegment.ofAddress(0L); + /** + * {@snippet lang=c : + * #define __DARWIN_NULL (void*) 0 + * } + */ + public static MemorySegment __DARWIN_NULL() { + return __DARWIN_NULL; + } + private static final int __DARWIN_WCHAR_MAX = (int)2147483647L; + /** + * {@snippet lang=c : + * #define __DARWIN_WCHAR_MAX 2147483647 + * } + */ + public static int __DARWIN_WCHAR_MAX() { + return __DARWIN_WCHAR_MAX; + } + private static final int __DARWIN_WCHAR_MIN = (int)-2147483648L; + /** + * {@snippet lang=c : + * #define __DARWIN_WCHAR_MIN -2147483648 + * } + */ + public static int __DARWIN_WCHAR_MIN() { + return __DARWIN_WCHAR_MIN; + } + private static final int __DARWIN_WEOF = (int)-1L; + /** + * {@snippet lang=c : + * #define __DARWIN_WEOF -1 + * } + */ + public static int __DARWIN_WEOF() { + return __DARWIN_WEOF; + } + private static final long USER_ADDR_NULL = 0L; + /** + * {@snippet lang=c : + * #define USER_ADDR_NULL 0 + * } + */ + public static long USER_ADDR_NULL() { + return USER_ADDR_NULL; + } + private static final MemorySegment NULL = MemorySegment.ofAddress(0L); + /** + * {@snippet lang=c : + * #define NULL (void*) 0 + * } + */ + public static MemorySegment NULL() { + return NULL; + } + private static final int EOF = (int)-1L; + /** + * {@snippet lang=c : + * #define EOF -1 + * } + */ + public static int EOF() { + return EOF; + } + /** + * {@snippet lang=c : + * #define P_tmpdir "/var/tmp/" + * } + */ + public static MemorySegment P_tmpdir() { + class Holder { + static final MemorySegment P_tmpdir + = somelib_h.LIBRARY_ARENA.allocateFrom("/var/tmp/"); + } + return Holder.P_tmpdir; + } + private static final long INT64_MAX = 9223372036854775807L; + /** + * {@snippet lang=c : + * #define INT64_MAX 9223372036854775807 + * } + */ + public static long INT64_MAX() { + return INT64_MAX; + } + private static final int INT8_MIN = (int)-128L; + /** + * {@snippet lang=c : + * #define INT8_MIN -128 + * } + */ + public static int INT8_MIN() { + return INT8_MIN; + } + private static final int INT16_MIN = (int)-32768L; + /** + * {@snippet lang=c : + * #define INT16_MIN -32768 + * } + */ + public static int INT16_MIN() { + return INT16_MIN; + } + private static final int INT32_MIN = (int)-2147483648L; + /** + * {@snippet lang=c : + * #define INT32_MIN -2147483648 + * } + */ + public static int INT32_MIN() { + return INT32_MIN; + } + private static final long INT64_MIN = -9223372036854775808L; + /** + * {@snippet lang=c : + * #define INT64_MIN -9223372036854775808 + * } + */ + public static long INT64_MIN() { + return INT64_MIN; + } + private static final int UINT32_MAX = (int)4294967295L; + /** + * {@snippet lang=c : + * #define UINT32_MAX 4294967295 + * } + */ + public static int UINT32_MAX() { + return UINT32_MAX; + } + private static final long UINT64_MAX = -1L; + /** + * {@snippet lang=c : + * #define UINT64_MAX -1 + * } + */ + public static long UINT64_MAX() { + return UINT64_MAX; + } + private static final int INT_LEAST8_MIN = (int)-128L; + /** + * {@snippet lang=c : + * #define INT_LEAST8_MIN -128 + * } + */ + public static int INT_LEAST8_MIN() { + return INT_LEAST8_MIN; + } + private static final int INT_LEAST16_MIN = (int)-32768L; + /** + * {@snippet lang=c : + * #define INT_LEAST16_MIN -32768 + * } + */ + public static int INT_LEAST16_MIN() { + return INT_LEAST16_MIN; + } + private static final int INT_LEAST32_MIN = (int)-2147483648L; + /** + * {@snippet lang=c : + * #define INT_LEAST32_MIN -2147483648 + * } + */ + public static int INT_LEAST32_MIN() { + return INT_LEAST32_MIN; + } + private static final long INT_LEAST64_MIN = -9223372036854775808L; + /** + * {@snippet lang=c : + * #define INT_LEAST64_MIN -9223372036854775808 + * } + */ + public static long INT_LEAST64_MIN() { + return INT_LEAST64_MIN; + } + private static final int INT_LEAST8_MAX = (int)127L; + /** + * {@snippet lang=c : + * #define INT_LEAST8_MAX 127 + * } + */ + public static int INT_LEAST8_MAX() { + return INT_LEAST8_MAX; + } + private static final int INT_LEAST16_MAX = (int)32767L; + /** + * {@snippet lang=c : + * #define INT_LEAST16_MAX 32767 + * } + */ + public static int INT_LEAST16_MAX() { + return INT_LEAST16_MAX; + } + private static final int INT_LEAST32_MAX = (int)2147483647L; + /** + * {@snippet lang=c : + * #define INT_LEAST32_MAX 2147483647 + * } + */ + public static int INT_LEAST32_MAX() { + return INT_LEAST32_MAX; + } + private static final long INT_LEAST64_MAX = 9223372036854775807L; + /** + * {@snippet lang=c : + * #define INT_LEAST64_MAX 9223372036854775807 + * } + */ + public static long INT_LEAST64_MAX() { + return INT_LEAST64_MAX; + } + private static final int UINT_LEAST8_MAX = (int)255L; + /** + * {@snippet lang=c : + * #define UINT_LEAST8_MAX 255 + * } + */ + public static int UINT_LEAST8_MAX() { + return UINT_LEAST8_MAX; + } + private static final int UINT_LEAST16_MAX = (int)65535L; + /** + * {@snippet lang=c : + * #define UINT_LEAST16_MAX 65535 + * } + */ + public static int UINT_LEAST16_MAX() { + return UINT_LEAST16_MAX; + } + private static final int UINT_LEAST32_MAX = (int)4294967295L; + /** + * {@snippet lang=c : + * #define UINT_LEAST32_MAX 4294967295 + * } + */ + public static int UINT_LEAST32_MAX() { + return UINT_LEAST32_MAX; + } + private static final long UINT_LEAST64_MAX = -1L; + /** + * {@snippet lang=c : + * #define UINT_LEAST64_MAX -1 + * } + */ + public static long UINT_LEAST64_MAX() { + return UINT_LEAST64_MAX; + } + private static final int INT_FAST8_MIN = (int)-128L; + /** + * {@snippet lang=c : + * #define INT_FAST8_MIN -128 + * } + */ + public static int INT_FAST8_MIN() { + return INT_FAST8_MIN; + } + private static final int INT_FAST16_MIN = (int)-32768L; + /** + * {@snippet lang=c : + * #define INT_FAST16_MIN -32768 + * } + */ + public static int INT_FAST16_MIN() { + return INT_FAST16_MIN; + } + private static final int INT_FAST32_MIN = (int)-2147483648L; + /** + * {@snippet lang=c : + * #define INT_FAST32_MIN -2147483648 + * } + */ + public static int INT_FAST32_MIN() { + return INT_FAST32_MIN; + } + private static final long INT_FAST64_MIN = -9223372036854775808L; + /** + * {@snippet lang=c : + * #define INT_FAST64_MIN -9223372036854775808 + * } + */ + public static long INT_FAST64_MIN() { + return INT_FAST64_MIN; + } + private static final int INT_FAST8_MAX = (int)127L; + /** + * {@snippet lang=c : + * #define INT_FAST8_MAX 127 + * } + */ + public static int INT_FAST8_MAX() { + return INT_FAST8_MAX; + } + private static final int INT_FAST16_MAX = (int)32767L; + /** + * {@snippet lang=c : + * #define INT_FAST16_MAX 32767 + * } + */ + public static int INT_FAST16_MAX() { + return INT_FAST16_MAX; + } + private static final int INT_FAST32_MAX = (int)2147483647L; + /** + * {@snippet lang=c : + * #define INT_FAST32_MAX 2147483647 + * } + */ + public static int INT_FAST32_MAX() { + return INT_FAST32_MAX; + } + private static final long INT_FAST64_MAX = 9223372036854775807L; + /** + * {@snippet lang=c : + * #define INT_FAST64_MAX 9223372036854775807 + * } + */ + public static long INT_FAST64_MAX() { + return INT_FAST64_MAX; + } + private static final int UINT_FAST8_MAX = (int)255L; + /** + * {@snippet lang=c : + * #define UINT_FAST8_MAX 255 + * } + */ + public static int UINT_FAST8_MAX() { + return UINT_FAST8_MAX; + } + private static final int UINT_FAST16_MAX = (int)65535L; + /** + * {@snippet lang=c : + * #define UINT_FAST16_MAX 65535 + * } + */ + public static int UINT_FAST16_MAX() { + return UINT_FAST16_MAX; + } + private static final int UINT_FAST32_MAX = (int)4294967295L; + /** + * {@snippet lang=c : + * #define UINT_FAST32_MAX 4294967295 + * } + */ + public static int UINT_FAST32_MAX() { + return UINT_FAST32_MAX; + } + private static final long UINT_FAST64_MAX = -1L; + /** + * {@snippet lang=c : + * #define UINT_FAST64_MAX -1 + * } + */ + public static long UINT_FAST64_MAX() { + return UINT_FAST64_MAX; + } + private static final long INTPTR_MAX = 9223372036854775807L; + /** + * {@snippet lang=c : + * #define INTPTR_MAX 9223372036854775807 + * } + */ + public static long INTPTR_MAX() { + return INTPTR_MAX; + } + private static final long INTPTR_MIN = -9223372036854775808L; + /** + * {@snippet lang=c : + * #define INTPTR_MIN -9223372036854775808 + * } + */ + public static long INTPTR_MIN() { + return INTPTR_MIN; + } + private static final long UINTPTR_MAX = -1L; + /** + * {@snippet lang=c : + * #define UINTPTR_MAX -1 + * } + */ + public static long UINTPTR_MAX() { + return UINTPTR_MAX; + } + private static final long INTMAX_MAX = 9223372036854775807L; + /** + * {@snippet lang=c : + * #define INTMAX_MAX 9223372036854775807 + * } + */ + public static long INTMAX_MAX() { + return INTMAX_MAX; + } + private static final long UINTMAX_MAX = -1L; + /** + * {@snippet lang=c : + * #define UINTMAX_MAX -1 + * } + */ + public static long UINTMAX_MAX() { + return UINTMAX_MAX; + } + private static final long INTMAX_MIN = -9223372036854775808L; + /** + * {@snippet lang=c : + * #define INTMAX_MIN -9223372036854775808 + * } + */ + public static long INTMAX_MIN() { + return INTMAX_MIN; + } + private static final long PTRDIFF_MIN = -9223372036854775808L; + /** + * {@snippet lang=c : + * #define PTRDIFF_MIN -9223372036854775808 + * } + */ + public static long PTRDIFF_MIN() { + return PTRDIFF_MIN; + } + private static final long PTRDIFF_MAX = 9223372036854775807L; + /** + * {@snippet lang=c : + * #define PTRDIFF_MAX 9223372036854775807 + * } + */ + public static long PTRDIFF_MAX() { + return PTRDIFF_MAX; + } + private static final long SIZE_MAX = -1L; + /** + * {@snippet lang=c : + * #define SIZE_MAX -1 + * } + */ + public static long SIZE_MAX() { + return SIZE_MAX; + } + private static final long RSIZE_MAX = 9223372036854775807L; + /** + * {@snippet lang=c : + * #define RSIZE_MAX 9223372036854775807 + * } + */ + public static long RSIZE_MAX() { + return RSIZE_MAX; + } + private static final int WCHAR_MAX = (int)2147483647L; + /** + * {@snippet lang=c : + * #define WCHAR_MAX 2147483647 + * } + */ + public static int WCHAR_MAX() { + return WCHAR_MAX; + } + private static final int WCHAR_MIN = (int)-2147483648L; + /** + * {@snippet lang=c : + * #define WCHAR_MIN -2147483648 + * } + */ + public static int WCHAR_MIN() { + return WCHAR_MIN; + } + private static final int WINT_MIN = (int)-2147483648L; + /** + * {@snippet lang=c : + * #define WINT_MIN -2147483648 + * } + */ + public static int WINT_MIN() { + return WINT_MIN; + } + private static final int WINT_MAX = (int)2147483647L; + /** + * {@snippet lang=c : + * #define WINT_MAX 2147483647 + * } + */ + public static int WINT_MAX() { + return WINT_MAX; + } + private static final int SIG_ATOMIC_MIN = (int)-2147483648L; + /** + * {@snippet lang=c : + * #define SIG_ATOMIC_MIN -2147483648 + * } + */ + public static int SIG_ATOMIC_MIN() { + return SIG_ATOMIC_MIN; + } + private static final int SIG_ATOMIC_MAX = (int)2147483647L; + /** + * {@snippet lang=c : + * #define SIG_ATOMIC_MAX 2147483647 + * } + */ + public static int SIG_ATOMIC_MAX() { + return SIG_ATOMIC_MAX; + } + private static final int __DARWIN_BYTE_ORDER = (int)1234L; + /** + * {@snippet lang=c : + * #define __DARWIN_BYTE_ORDER 1234 + * } + */ + public static int __DARWIN_BYTE_ORDER() { + return __DARWIN_BYTE_ORDER; + } + private static final int LITTLE_ENDIAN = (int)1234L; + /** + * {@snippet lang=c : + * #define LITTLE_ENDIAN 1234 + * } + */ + public static int LITTLE_ENDIAN() { + return LITTLE_ENDIAN; + } + private static final int BIG_ENDIAN = (int)4321L; + /** + * {@snippet lang=c : + * #define BIG_ENDIAN 4321 + * } + */ + public static int BIG_ENDIAN() { + return BIG_ENDIAN; + } + private static final int PDP_ENDIAN = (int)3412L; + /** + * {@snippet lang=c : + * #define PDP_ENDIAN 3412 + * } + */ + public static int PDP_ENDIAN() { + return PDP_ENDIAN; + } + private static final int BYTE_ORDER = (int)1234L; + /** + * {@snippet lang=c : + * #define BYTE_ORDER 1234 + * } + */ + public static int BYTE_ORDER() { + return BYTE_ORDER; + } + private static final long __DARWIN_NFDBITS = 32L; + /** + * {@snippet lang=c : + * #define __DARWIN_NFDBITS 32 + * } + */ + public static long __DARWIN_NFDBITS() { + return __DARWIN_NFDBITS; + } + private static final int NBBY = (int)8L; + /** + * {@snippet lang=c : + * #define NBBY 8 + * } + */ + public static int NBBY() { + return NBBY; + } + private static final long NFDBITS = 32L; + /** + * {@snippet lang=c : + * #define NFDBITS 32 + * } + */ + public static long NFDBITS() { + return NFDBITS; + } + private static final int FD_SETSIZE = (int)1024L; + /** + * {@snippet lang=c : + * #define FD_SETSIZE 1024 + * } + */ + public static int FD_SETSIZE() { + return FD_SETSIZE; + } +} + diff --git a/tool/src/java/mod.rs b/tool/src/java/mod.rs new file mode 100644 index 000000000..55d0a19f4 --- /dev/null +++ b/tool/src/java/mod.rs @@ -0,0 +1,104 @@ +use std::collections::HashSet; +use std::fs::File; +use std::io::Write; +use std::path::Path; + +use diplomat_core::hir::TypeContext; + +use crate::c2; +use crate::common::FileMap; + +const TMP_C_DIR: &str = "tmp"; +const LIBRARY: &str = "somelib"; // todo: build from conf. Ensure that name is not the same as any + // type +const GROUP: &str = "dev.diplomattest"; // todo: config +const TMP_LIB_NAME: &str = "dev/diplomattest/somelib"; // todo: build from conf +const JAVA_DIR: &str = "src/main/java/"; + +pub fn run( + tcx: &TypeContext, + _conf_path: Option<&Path>, + out_folder: &Path, +) -> std::io::Result { + let files = FileMap::default(); + let mut context = c2::CContext::new(tcx, files, false); + context.run(); + + let errors = context.errors.take_all(); + + if !errors.is_empty() { + eprintln!("Found errors when generating c code"); + for error in errors { + eprintln!("\t{}: {}", error.0, error.1); + } + } + + let out_files = context.files.take_files(); + + let tmp_path = out_folder.join(TMP_C_DIR); + std::fs::create_dir(&tmp_path)?; + let mut include_files = HashSet::new(); + for (subpath, text) in out_files { + let out_path = tmp_path.join(&subpath); + if !subpath.ends_with(".d.h") && subpath.ends_with(".h") { + include_files.insert(subpath); + } + let parent = out_path + .parent() + .expect("Cannot create files at top level dir /"); + std::fs::create_dir_all(parent)?; + let mut out_file = File::create(&out_path)?; + out_file.write_all(text.as_bytes())?; + } + + let lib_path = tmp_path.join(format!("{LIBRARY}.h")); + + let mut lib_file = File::create(&lib_path)?; + for include in include_files { + writeln!(lib_file, "#include \"{include}\"")?; + } + + // jextract \ + // --include-dir /path/to/mylib/include \ + // --output src \ + // --target-package org.jextract.mylib \ + // --library mylib \ + // /path/to/mylib/include/mylib.h + + let package = format!("{GROUP}.{LIBRARY}.ntv"); + let mut command = std::process::Command::new("jextract"); + command + .arg("--include-dir") + .arg(&tmp_path) + .arg("--output") + .arg(out_folder) + .arg("--target-package") + .arg(package) + .arg("--library") + .arg(LIBRARY) + .arg(lib_path); + + println!("Running: {:?}", command); + + // todo: delete directory + + match command.output() { + Err(err) => match err.kind() { + std::io::ErrorKind::NotFound => { + eprintln!("Check that jextract is in your path and all directories exist. See https://github.com/openjdk/jextract/blob/5715737be0a1a9de24cce3ee7190881cfc8b1350/doc/GUIDE.md"); + return Err(err); + } + _ => return Err(err), + }, + Ok(ok) => { + let stdout = String::from_utf8_lossy(&ok.stdout); + println!("Output from jextract:\n{stdout}"); + + let stderr = String::from_utf8_lossy(&ok.stderr); + println!("Std Err from jextract:\n{stderr}"); + } + } + + let files = FileMap::default(); + Ok(files) +} diff --git a/tool/src/lib.rs b/tool/src/lib.rs index e23dfd410..217bb088a 100644 --- a/tool/src/lib.rs +++ b/tool/src/lib.rs @@ -16,6 +16,8 @@ pub mod dart; #[doc(hidden)] pub mod dotnet; #[doc(hidden)] +pub mod java; +#[doc(hidden)] pub mod js; #[doc(hidden)] pub mod kotlin; @@ -76,6 +78,30 @@ pub fn gen( match target_language { "js" => js::gen_bindings(&env, &mut out_texts, Some(docs_url_gen)).unwrap(), + "java" => { + let mut attr_validator = hir::BasicAttributeValidator::new("true"); + attr_validator.support.renaming = true; + attr_validator.support.disabling = true; + attr_validator.support.iterators = true; + attr_validator.support.iterables = true; + attr_validator.support.indexing = true; + attr_validator.support.constructors = true; + attr_validator.support.named_constructors = true; + attr_validator.support.memory_sharing = true; + attr_validator.support.accessors = true; + let tcx = match hir::TypeContext::from_ast(&env, attr_validator) { + Ok(context) => context, + + Err(e) => { + for (ctx, err) in e { + eprintln!("Lowering error in {ctx}: {err}"); + } + std::process::exit(1); + } + }; + + out_texts = java::run(&tcx, library_config, out_folder)?.take_files(); + } "kotlin" => { let mut attr_validator = hir::BasicAttributeValidator::new("kotlin"); attr_validator.support.renaming = true; From 7c5b60da2c0d42b744de2c89df9fcb83d7febd97 Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Fri, 14 Jun 2024 23:14:24 +0200 Subject: [PATCH 02/69] panama-backend - bench / test / and cleaning --- feature_tests/java/somelib/.gitignore | 8 +++- feature_tests/java/somelib/.idea/.gitignore | 3 ++ feature_tests/java/somelib/pom.xml | 19 +++++++++ .../dev/diplomattest/somelib/OpaqueBench.java | 26 ++++++++++++ .../java/dev/diplomattest/somelib/Main.java | 3 ++ .../dev/diplomattest/somelib/MyStruct.java | 18 ++++++++ .../java/dev/diplomattest/somelib/Opaque.java | 41 +++++++++++++++++++ .../dev/diplomattest/somelib/OpaqueTest.java | 25 +++++++++++ 8 files changed, 142 insertions(+), 1 deletion(-) create mode 100644 feature_tests/java/somelib/.idea/.gitignore create mode 100644 feature_tests/java/somelib/src/jmh/java/dev/diplomattest/somelib/OpaqueBench.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyStruct.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Opaque.java create mode 100644 feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/OpaqueTest.java diff --git a/feature_tests/java/somelib/.gitignore b/feature_tests/java/somelib/.gitignore index 5ff6309b7..a3a6a6a70 100644 --- a/feature_tests/java/somelib/.gitignore +++ b/feature_tests/java/somelib/.gitignore @@ -8,6 +8,10 @@ target/ .idea/jarRepositories.xml .idea/compiler.xml .idea/libraries/ +.idea/encodings.xml +.idea/misc.xml +.idea/vcs.xml +.idea/codeStyles *.iws *.iml *.ipr @@ -35,4 +39,6 @@ build/ .vscode/ ### Mac OS ### -.DS_Store \ No newline at end of file +.DS_Store + +libsomelib.dylib diff --git a/feature_tests/java/somelib/.idea/.gitignore b/feature_tests/java/somelib/.idea/.gitignore new file mode 100644 index 000000000..26d33521a --- /dev/null +++ b/feature_tests/java/somelib/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/feature_tests/java/somelib/pom.xml b/feature_tests/java/somelib/pom.xml index 24ef5d0e8..09a239864 100644 --- a/feature_tests/java/somelib/pom.xml +++ b/feature_tests/java/somelib/pom.xml @@ -13,5 +13,24 @@ 22 UTF-8 + + + org.junit.jupiter + junit-jupiter + RELEASE + test + + + org.openjdk.jmh + jmh-core + RELEASE + + + org.openjdk.jmh + jmh-generator-annprocess + RELEASE + provided + + \ No newline at end of file diff --git a/feature_tests/java/somelib/src/jmh/java/dev/diplomattest/somelib/OpaqueBench.java b/feature_tests/java/somelib/src/jmh/java/dev/diplomattest/somelib/OpaqueBench.java new file mode 100644 index 000000000..d5cee67c4 --- /dev/null +++ b/feature_tests/java/somelib/src/jmh/java/dev/diplomattest/somelib/OpaqueBench.java @@ -0,0 +1,26 @@ +package dev.diplomattest.somelib; + +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.infra.Blackhole; +import org.openjdk.jmh.runner.Runner; +import org.openjdk.jmh.runner.RunnerException; +import org.openjdk.jmh.runner.options.Options; +import org.openjdk.jmh.runner.options.OptionsBuilder; + +public class OpaqueBench { + @Benchmark + public static void benchOpaque(Blackhole bh) { + var opaque = new Opaque(); + bh.consume(opaque); + // opaque.delete(); + } + + public static void main(String[] args) throws RunnerException { + Options opt = new OptionsBuilder() + .include(OpaqueBench.class.getSimpleName()) + .forks(1) + .build(); + + new Runner(opt).run(); + } +} diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Main.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Main.java index e290a1398..df98c7b19 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Main.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Main.java @@ -1,8 +1,11 @@ package dev.diplomattest.somelib; +import java.lang.ref.Cleaner; + //TIP To Run code, press or // click the icon in the gutter. public class Main { + static final Cleaner cleaner = Cleaner.create(); public static void main(String[] args) { //TIP Press with your caret at the highlighted text // to see how IntelliJ IDEA suggests fixing it. diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyStruct.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyStruct.java new file mode 100644 index 000000000..ca0670c44 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyStruct.java @@ -0,0 +1,18 @@ +package dev.diplomattest.somelib; + +import dev.diplomattest.somelib.ntv.somelib_h; + +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; + +public class MyStruct { + MemorySegment nativeStruct$; + public MyStruct(SegmentAllocator alloc) { + var function = somelib_h.MyStruct_new.makeInvoker(); + this.nativeStruct$ = function.apply(alloc); + } + + MemorySegment getNativeStruct$() { + return nativeStruct$; + } +} diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Opaque.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Opaque.java new file mode 100644 index 000000000..a6c5cd31b --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Opaque.java @@ -0,0 +1,41 @@ +package dev.diplomattest.somelib; + +import dev.diplomattest.somelib.ntv.somelib_h; +import dev.diplomattest.somelib.ntv.somelib_h; + +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; + +public class Opaque { + private MemorySegment internal; + private final Cleaner.Cleanable cleanable; + static class OpaqueCleaner implements Runnable { + MemorySegment segment; + OpaqueCleaner(MemorySegment segment) { + this.segment = segment; + } + public void run() { + somelib_h.Opaque_destroy(this.segment); + } + } + public Opaque() { + var invoker = somelib_h.Opaque_new.makeInvoker(); + var segment = invoker.apply(); + this.internal = segment; + var opaqueCleaner = new OpaqueCleaner(segment); + this.cleanable = Main.cleaner.register(this, opaqueCleaner); + } + + public long pointer() { + return internal.address(); + } + + public void delete() { + somelib_h.Opaque_destroy(this.internal); + } + + public void assertStruct(MyStruct struct) { + somelib_h.Opaque_assert_struct(internal, struct.getNativeStruct$()); + } +} diff --git a/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/OpaqueTest.java b/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/OpaqueTest.java new file mode 100644 index 000000000..0cf6ab6a1 --- /dev/null +++ b/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/OpaqueTest.java @@ -0,0 +1,25 @@ +package dev.diplomattest.somelib; + +import org.junit.jupiter.api.Test; + +import java.lang.foreign.Arena; +import java.lang.foreign.SegmentAllocator; + +import static org.junit.jupiter.api.Assertions.*; + +class OpaqueTest { + @Test + void testOpaque() { + var opaque = new Opaque(); + + assert opaque.pointer() != 0L; + + try (var arena = Arena.ofConfined()) { + var myStruct = new MyStruct(arena); + opaque.assertStruct(myStruct); + } + + opaque.delete(); + assert true; + } +} \ No newline at end of file From 037aacfe4ccf06abddfcc5fe7bf763c774f5c5cd Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Fri, 28 Jun 2024 14:05:22 +0200 Subject: [PATCH 03/69] panama-backend - add generated code for ICU4X / basic opaque generation --- example/java/ICU4X4J/.gitignore | 39 + example/java/ICU4X4J/pom.xml | 17 + .../src/main/java/dev/diplomattest/Main.java | 17 + .../somelib/ntv/DiplomatBoolArray.java | 173 + .../somelib/ntv/DiplomatBoolView.java | 173 + .../somelib/ntv/DiplomatCharArray.java | 173 + .../somelib/ntv/DiplomatCharView.java | 173 + .../somelib/ntv/DiplomatF32Array.java | 173 + .../somelib/ntv/DiplomatF32View.java | 173 + .../somelib/ntv/DiplomatF64Array.java | 173 + .../somelib/ntv/DiplomatF64View.java | 173 + .../somelib/ntv/DiplomatI16Array.java | 173 + .../somelib/ntv/DiplomatI16View.java | 173 + .../somelib/ntv/DiplomatI32Array.java | 173 + .../somelib/ntv/DiplomatI32View.java | 173 + .../somelib/ntv/DiplomatI64Array.java | 173 + .../somelib/ntv/DiplomatI64View.java | 173 + .../somelib/ntv/DiplomatI8Array.java | 173 + .../somelib/ntv/DiplomatI8View.java | 173 + .../somelib/ntv/DiplomatIsizeArray.java | 173 + .../somelib/ntv/DiplomatIsizeView.java | 173 + .../somelib/ntv/DiplomatString16Array.java | 173 + .../somelib/ntv/DiplomatString16View.java | 173 + .../somelib/ntv/DiplomatStringArray.java | 173 + .../somelib/ntv/DiplomatStringView.java | 173 + .../somelib/ntv/DiplomatStrings16Array.java | 173 + .../somelib/ntv/DiplomatStrings16View.java | 173 + .../somelib/ntv/DiplomatStringsArray.java | 173 + .../somelib/ntv/DiplomatStringsView.java | 173 + .../somelib/ntv/DiplomatU16Array.java | 173 + .../somelib/ntv/DiplomatU16View.java | 173 + .../somelib/ntv/DiplomatU32Array.java | 173 + .../somelib/ntv/DiplomatU32View.java | 173 + .../somelib/ntv/DiplomatU64Array.java | 173 + .../somelib/ntv/DiplomatU64View.java | 173 + .../somelib/ntv/DiplomatU8Array.java | 173 + .../somelib/ntv/DiplomatU8View.java | 173 + .../somelib/ntv/DiplomatUsizeArray.java | 173 + .../somelib/ntv/DiplomatUsizeView.java | 173 + .../somelib/ntv/DiplomatWrite.java | 512 + .../dev/diplomattest/somelib/ntv/FILE.java | 47 + ...U4XDataProvider_returns_result_result.java | 127 + .../ICU4XFixedDecimalFormatterOptions.java | 174 + ...XFixedDecimalFormatter_try_new_result.java | 178 + .../ICU4XFixedDecimal_to_string_result.java | 127 + .../somelib/ntv/_OSUnalignedU16.java | 127 + .../somelib/ntv/_OSUnalignedU32.java | 127 + .../somelib/ntv/_OSUnalignedU64.java | 127 + .../somelib/ntv/__darwin_mbstate_t.java | 26 + .../somelib/ntv/__darwin_pthread_attr_t.java | 29 + .../somelib/ntv/__darwin_pthread_cond_t.java | 29 + .../ntv/__darwin_pthread_condattr_t.java | 29 + .../ntv/__darwin_pthread_handler_rec.java | 272 + .../somelib/ntv/__darwin_pthread_mutex_t.java | 29 + .../ntv/__darwin_pthread_mutexattr_t.java | 29 + .../somelib/ntv/__darwin_pthread_once_t.java | 29 + .../ntv/__darwin_pthread_rwlock_t.java | 29 + .../ntv/__darwin_pthread_rwlockattr_t.java | 29 + .../diplomattest/somelib/ntv/__mbstate_t.java | 206 + .../dev/diplomattest/somelib/ntv/__sFILE.java | 1292 ++ .../dev/diplomattest/somelib/ntv/__sbuf.java | 174 + .../somelib/ntv/_opaque_pthread_attr_t.java | 206 + .../somelib/ntv/_opaque_pthread_cond_t.java | 206 + .../ntv/_opaque_pthread_condattr_t.java | 206 + .../somelib/ntv/_opaque_pthread_mutex_t.java | 206 + .../ntv/_opaque_pthread_mutexattr_t.java | 206 + .../somelib/ntv/_opaque_pthread_once_t.java | 206 + .../somelib/ntv/_opaque_pthread_rwlock_t.java | 206 + .../ntv/_opaque_pthread_rwlockattr_t.java | 206 + .../somelib/ntv/_opaque_pthread_t.java | 252 + .../dev/diplomattest/somelib/ntv/fd_set.java | 160 + .../diplomattest/somelib/ntv/funopen$x0.java | 70 + .../diplomattest/somelib/ntv/funopen$x1.java | 70 + .../diplomattest/somelib/ntv/funopen$x2.java | 70 + .../diplomattest/somelib/ntv/funopen$x3.java | 68 + .../somelib/ntv/pthread_attr_t.java | 26 + .../somelib/ntv/pthread_cond_t.java | 26 + .../somelib/ntv/pthread_condattr_t.java | 26 + .../somelib/ntv/pthread_mutex_t.java | 26 + .../somelib/ntv/pthread_mutexattr_t.java | 26 + .../somelib/ntv/pthread_once_t.java | 26 + .../somelib/ntv/pthread_rwlock_t.java | 26 + .../somelib/ntv/pthread_rwlockattr_t.java | 26 + .../diplomattest/somelib/ntv/somelib_h.java | 12136 ++++++++++++++++ feature_tests/java/somelib/.gitignore | 1 + .../dev/diplomattest/somelib/OpaqueBench.java | 6 +- .../java/dev/diplomattest/somelib/Main.java | 3 + .../java/dev/diplomattest/somelib/Opaque.java | 60 +- .../diplomattest/somelib/ntv/somelib_h.java | 6364 ++++---- .../dev/diplomattest/somelib/OpaqueTest.java | 14 +- feature_tests/src/structs.rs | 4 + tool/src/java/README.md | 37 + tool/src/java/formatter.rs | 106 + tool/src/java/mod.rs | 385 +- .../diplomat_tool__java__test__opaque.snap | 69 + ...lomat_tool__java__test__opaque_render.snap | 34 + tool/src/kotlin/formatter.rs | 27 +- tool/src/kotlin/mod.rs | 2 +- tool/src/lib.rs | 32 + tool/templates/java/Main.java.jinja | 5 + tool/templates/java/Method.java.jinja | 40 + tool/templates/java/Opaque.java.jinja | 34 + .../java/OpaqueConstructor.java.jinja | 3 + tool/templates/java/OpaqueReturn.java.jinja | 5 + 104 files changed, 28747 insertions(+), 3215 deletions(-) create mode 100644 example/java/ICU4X4J/.gitignore create mode 100644 example/java/ICU4X4J/pom.xml create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/Main.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatBoolArray.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatBoolView.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatCharArray.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatCharView.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF32Array.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF32View.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF64Array.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF64View.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI16Array.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI16View.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI32Array.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI32View.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI64Array.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI64View.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI8Array.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI8View.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatIsizeArray.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatIsizeView.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatString16Array.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatString16View.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringArray.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringView.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStrings16Array.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStrings16View.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringsArray.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringsView.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU16Array.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU16View.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU32Array.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU32View.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU64Array.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU64View.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU8Array.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU8View.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatUsizeArray.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatUsizeView.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatWrite.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/FILE.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/ICU4XDataProvider_returns_result_result.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/ICU4XFixedDecimalFormatterOptions.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/ICU4XFixedDecimalFormatter_try_new_result.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/ICU4XFixedDecimal_to_string_result.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_OSUnalignedU16.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_OSUnalignedU32.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_OSUnalignedU64.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_mbstate_t.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_attr_t.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_cond_t.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_condattr_t.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_handler_rec.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_mutex_t.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_mutexattr_t.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_once_t.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_rwlock_t.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_rwlockattr_t.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__mbstate_t.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__sFILE.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__sbuf.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_attr_t.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_cond_t.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_condattr_t.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_mutex_t.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_mutexattr_t.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_once_t.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_rwlock_t.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_rwlockattr_t.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_t.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/fd_set.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/funopen$x0.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/funopen$x1.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/funopen$x2.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/funopen$x3.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_attr_t.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_cond_t.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_condattr_t.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_mutex_t.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_mutexattr_t.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_once_t.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_rwlock_t.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_rwlockattr_t.java create mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java create mode 100644 tool/src/java/README.md create mode 100644 tool/src/java/formatter.rs create mode 100644 tool/src/java/snapshots/diplomat_tool__java__test__opaque.snap create mode 100644 tool/src/java/snapshots/diplomat_tool__java__test__opaque_render.snap create mode 100644 tool/templates/java/Main.java.jinja create mode 100644 tool/templates/java/Method.java.jinja create mode 100644 tool/templates/java/Opaque.java.jinja create mode 100644 tool/templates/java/OpaqueConstructor.java.jinja create mode 100644 tool/templates/java/OpaqueReturn.java.jinja diff --git a/example/java/ICU4X4J/.gitignore b/example/java/ICU4X4J/.gitignore new file mode 100644 index 000000000..4bc86d39c --- /dev/null +++ b/example/java/ICU4X4J/.gitignore @@ -0,0 +1,39 @@ +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### IntelliJ IDEA ### +.idea/modules.xml +.idea/jarRepositories.xml +.idea/compiler.xml +.idea/libraries/ +.idea/* +*.iws +*.iml +*.ipr + +### Eclipse ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ + +### Mac OS ### +.DS_Store diff --git a/example/java/ICU4X4J/pom.xml b/example/java/ICU4X4J/pom.xml new file mode 100644 index 000000000..9bcb61e50 --- /dev/null +++ b/example/java/ICU4X4J/pom.xml @@ -0,0 +1,17 @@ + + + 4.0.0 + + dev.diplomattest + ICU4X4J + 1.0-SNAPSHOT + + + 22 + 22 + UTF-8 + + + \ No newline at end of file diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/Main.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/Main.java new file mode 100644 index 000000000..79b4286fb --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/Main.java @@ -0,0 +1,17 @@ +package dev.diplomattest; + +//TIP To Run code, press or +// click the icon in the gutter. +public class Main { + public static void main(String[] args) { + //TIP Press with your caret at the highlighted text + // to see how IntelliJ IDEA suggests fixing it. + System.out.printf("Hello and welcome!"); + + for (int i = 1; i <= 5; i++) { + //TIP Press to start debugging your code. We have set one breakpoint + // for you, but you can always add more by pressing . + System.out.println("i = " + i); + } + } +} \ No newline at end of file diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatBoolArray.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatBoolArray.java new file mode 100644 index 000000000..b4d33578a --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatBoolArray.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatBoolArray { + * const bool *data; + * size_t len; + * } + * } + */ +public class DiplomatBoolArray { + + DiplomatBoolArray() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatBoolArray"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const bool *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const bool *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const bool *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const bool *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatBoolView.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatBoolView.java new file mode 100644 index 000000000..f72f81bda --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatBoolView.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatBoolView { + * const bool *data; + * size_t len; + * } + * } + */ +public class DiplomatBoolView { + + DiplomatBoolView() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatBoolView"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const bool *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const bool *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const bool *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const bool *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatCharArray.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatCharArray.java new file mode 100644 index 000000000..ad43f41a1 --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatCharArray.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatCharArray { + * const char32_t *data; + * size_t len; + * } + * } + */ +public class DiplomatCharArray { + + DiplomatCharArray() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatCharArray"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const char32_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const char32_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const char32_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const char32_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatCharView.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatCharView.java new file mode 100644 index 000000000..6dc3f0ec4 --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatCharView.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatCharView { + * const char32_t *data; + * size_t len; + * } + * } + */ +public class DiplomatCharView { + + DiplomatCharView() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatCharView"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const char32_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const char32_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const char32_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const char32_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF32Array.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF32Array.java new file mode 100644 index 000000000..3483f6970 --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF32Array.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatF32Array { + * const float *data; + * size_t len; + * } + * } + */ +public class DiplomatF32Array { + + DiplomatF32Array() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatF32Array"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const float *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const float *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const float *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const float *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF32View.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF32View.java new file mode 100644 index 000000000..ef9439b3d --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF32View.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatF32View { + * const float *data; + * size_t len; + * } + * } + */ +public class DiplomatF32View { + + DiplomatF32View() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatF32View"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const float *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const float *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const float *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const float *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF64Array.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF64Array.java new file mode 100644 index 000000000..f31fa2fa2 --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF64Array.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatF64Array { + * const double *data; + * size_t len; + * } + * } + */ +public class DiplomatF64Array { + + DiplomatF64Array() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatF64Array"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const double *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const double *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const double *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const double *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF64View.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF64View.java new file mode 100644 index 000000000..d1960966d --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF64View.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatF64View { + * const double *data; + * size_t len; + * } + * } + */ +public class DiplomatF64View { + + DiplomatF64View() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatF64View"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const double *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const double *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const double *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const double *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI16Array.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI16Array.java new file mode 100644 index 000000000..08f04934b --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI16Array.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatI16Array { + * const int16_t *data; + * size_t len; + * } + * } + */ +public class DiplomatI16Array { + + DiplomatI16Array() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatI16Array"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const int16_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const int16_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const int16_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const int16_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI16View.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI16View.java new file mode 100644 index 000000000..265552cd6 --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI16View.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatI16View { + * const int16_t *data; + * size_t len; + * } + * } + */ +public class DiplomatI16View { + + DiplomatI16View() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatI16View"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const int16_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const int16_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const int16_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const int16_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI32Array.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI32Array.java new file mode 100644 index 000000000..a33abc59b --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI32Array.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatI32Array { + * const int32_t *data; + * size_t len; + * } + * } + */ +public class DiplomatI32Array { + + DiplomatI32Array() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatI32Array"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const int32_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const int32_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const int32_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const int32_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI32View.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI32View.java new file mode 100644 index 000000000..d5c0eff9f --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI32View.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatI32View { + * const int32_t *data; + * size_t len; + * } + * } + */ +public class DiplomatI32View { + + DiplomatI32View() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatI32View"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const int32_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const int32_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const int32_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const int32_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI64Array.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI64Array.java new file mode 100644 index 000000000..db760366f --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI64Array.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatI64Array { + * const int64_t *data; + * size_t len; + * } + * } + */ +public class DiplomatI64Array { + + DiplomatI64Array() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatI64Array"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const int64_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const int64_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const int64_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const int64_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI64View.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI64View.java new file mode 100644 index 000000000..2ae01c5e3 --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI64View.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatI64View { + * const int64_t *data; + * size_t len; + * } + * } + */ +public class DiplomatI64View { + + DiplomatI64View() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatI64View"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const int64_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const int64_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const int64_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const int64_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI8Array.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI8Array.java new file mode 100644 index 000000000..cea362b51 --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI8Array.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatI8Array { + * const int8_t *data; + * size_t len; + * } + * } + */ +public class DiplomatI8Array { + + DiplomatI8Array() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatI8Array"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const int8_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const int8_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const int8_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const int8_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI8View.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI8View.java new file mode 100644 index 000000000..c8240e123 --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI8View.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatI8View { + * const int8_t *data; + * size_t len; + * } + * } + */ +public class DiplomatI8View { + + DiplomatI8View() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatI8View"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const int8_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const int8_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const int8_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const int8_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatIsizeArray.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatIsizeArray.java new file mode 100644 index 000000000..4e4b5a287 --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatIsizeArray.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatIsizeArray { + * const intptr_t *data; + * size_t len; + * } + * } + */ +public class DiplomatIsizeArray { + + DiplomatIsizeArray() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatIsizeArray"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const intptr_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const intptr_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const intptr_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const intptr_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatIsizeView.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatIsizeView.java new file mode 100644 index 000000000..953f1aacd --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatIsizeView.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatIsizeView { + * const intptr_t *data; + * size_t len; + * } + * } + */ +public class DiplomatIsizeView { + + DiplomatIsizeView() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatIsizeView"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const intptr_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const intptr_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const intptr_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const intptr_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatString16Array.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatString16Array.java new file mode 100644 index 000000000..d69cc5c7d --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatString16Array.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatString16Array { + * const char16_t *data; + * size_t len; + * } + * } + */ +public class DiplomatString16Array { + + DiplomatString16Array() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatString16Array"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const char16_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const char16_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const char16_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const char16_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatString16View.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatString16View.java new file mode 100644 index 000000000..192de994e --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatString16View.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatString16View { + * const char16_t *data; + * size_t len; + * } + * } + */ +public class DiplomatString16View { + + DiplomatString16View() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatString16View"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const char16_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const char16_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const char16_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const char16_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringArray.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringArray.java new file mode 100644 index 000000000..d7aa9f6ff --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringArray.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatStringArray { + * const char *data; + * size_t len; + * } + * } + */ +public class DiplomatStringArray { + + DiplomatStringArray() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatStringArray"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const char *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const char *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const char *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const char *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringView.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringView.java new file mode 100644 index 000000000..185d5aff6 --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringView.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatStringView { + * const char *data; + * size_t len; + * } + * } + */ +public class DiplomatStringView { + + DiplomatStringView() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatStringView"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const char *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const char *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const char *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const char *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStrings16Array.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStrings16Array.java new file mode 100644 index 000000000..b2c9354d1 --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStrings16Array.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatStrings16Array { + * const DiplomatString16View *data; + * size_t len; + * } + * } + */ +public class DiplomatStrings16Array { + + DiplomatStrings16Array() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatStrings16Array"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const DiplomatString16View *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const DiplomatString16View *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const DiplomatString16View *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const DiplomatString16View *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStrings16View.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStrings16View.java new file mode 100644 index 000000000..3e10bbeba --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStrings16View.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatStrings16View { + * const DiplomatString16View *data; + * size_t len; + * } + * } + */ +public class DiplomatStrings16View { + + DiplomatStrings16View() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatStrings16View"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const DiplomatString16View *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const DiplomatString16View *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const DiplomatString16View *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const DiplomatString16View *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringsArray.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringsArray.java new file mode 100644 index 000000000..bef36d353 --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringsArray.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatStringsArray { + * const DiplomatStringView *data; + * size_t len; + * } + * } + */ +public class DiplomatStringsArray { + + DiplomatStringsArray() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatStringsArray"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const DiplomatStringView *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const DiplomatStringView *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const DiplomatStringView *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const DiplomatStringView *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringsView.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringsView.java new file mode 100644 index 000000000..9e16e26b7 --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringsView.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatStringsView { + * const DiplomatStringView *data; + * size_t len; + * } + * } + */ +public class DiplomatStringsView { + + DiplomatStringsView() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatStringsView"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const DiplomatStringView *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const DiplomatStringView *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const DiplomatStringView *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const DiplomatStringView *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU16Array.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU16Array.java new file mode 100644 index 000000000..482eea704 --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU16Array.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatU16Array { + * const uint16_t *data; + * size_t len; + * } + * } + */ +public class DiplomatU16Array { + + DiplomatU16Array() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatU16Array"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const uint16_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const uint16_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const uint16_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const uint16_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU16View.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU16View.java new file mode 100644 index 000000000..a8c75ea49 --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU16View.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatU16View { + * const uint16_t *data; + * size_t len; + * } + * } + */ +public class DiplomatU16View { + + DiplomatU16View() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatU16View"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const uint16_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const uint16_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const uint16_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const uint16_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU32Array.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU32Array.java new file mode 100644 index 000000000..8ecc93d8b --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU32Array.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatU32Array { + * const uint32_t *data; + * size_t len; + * } + * } + */ +public class DiplomatU32Array { + + DiplomatU32Array() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatU32Array"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const uint32_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const uint32_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const uint32_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const uint32_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU32View.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU32View.java new file mode 100644 index 000000000..5b0e57b04 --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU32View.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatU32View { + * const uint32_t *data; + * size_t len; + * } + * } + */ +public class DiplomatU32View { + + DiplomatU32View() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatU32View"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const uint32_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const uint32_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const uint32_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const uint32_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU64Array.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU64Array.java new file mode 100644 index 000000000..5b407a970 --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU64Array.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatU64Array { + * const uint64_t *data; + * size_t len; + * } + * } + */ +public class DiplomatU64Array { + + DiplomatU64Array() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatU64Array"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const uint64_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const uint64_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const uint64_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const uint64_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU64View.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU64View.java new file mode 100644 index 000000000..2ec76ae90 --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU64View.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatU64View { + * const uint64_t *data; + * size_t len; + * } + * } + */ +public class DiplomatU64View { + + DiplomatU64View() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatU64View"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const uint64_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const uint64_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const uint64_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const uint64_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU8Array.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU8Array.java new file mode 100644 index 000000000..66872b949 --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU8Array.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatU8Array { + * const uint8_t *data; + * size_t len; + * } + * } + */ +public class DiplomatU8Array { + + DiplomatU8Array() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatU8Array"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const uint8_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const uint8_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const uint8_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const uint8_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU8View.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU8View.java new file mode 100644 index 000000000..3c6671156 --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU8View.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatU8View { + * const uint8_t *data; + * size_t len; + * } + * } + */ +public class DiplomatU8View { + + DiplomatU8View() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatU8View"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const uint8_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const uint8_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const uint8_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const uint8_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatUsizeArray.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatUsizeArray.java new file mode 100644 index 000000000..21b119c6a --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatUsizeArray.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatUsizeArray { + * const size_t *data; + * size_t len; + * } + * } + */ +public class DiplomatUsizeArray { + + DiplomatUsizeArray() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatUsizeArray"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const size_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const size_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const size_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const size_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatUsizeView.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatUsizeView.java new file mode 100644 index 000000000..ba9b410d6 --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatUsizeView.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatUsizeView { + * const size_t *data; + * size_t len; + * } + * } + */ +public class DiplomatUsizeView { + + DiplomatUsizeView() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatUsizeView"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * const size_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const size_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const size_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const size_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatWrite.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatWrite.java new file mode 100644 index 000000000..6da2825dd --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatWrite.java @@ -0,0 +1,512 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatWrite { + * void *context; + * char *buf; + * size_t len; + * size_t cap; + * bool grow_failed; + * void (*flush)(struct DiplomatWrite *); + * bool (*grow)(struct DiplomatWrite *, size_t); + * } + * } + */ +public class DiplomatWrite { + + DiplomatWrite() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("context"), + somelib_h.C_POINTER.withName("buf"), + somelib_h.C_LONG.withName("len"), + somelib_h.C_LONG.withName("cap"), + somelib_h.C_BOOL.withName("grow_failed"), + MemoryLayout.paddingLayout(7), + somelib_h.C_POINTER.withName("flush"), + somelib_h.C_POINTER.withName("grow") + ).withName("DiplomatWrite"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout context$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("context")); + + /** + * Layout for field: + * {@snippet lang=c : + * void *context + * } + */ + public static final AddressLayout context$layout() { + return context$LAYOUT; + } + + private static final long context$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * void *context + * } + */ + public static final long context$offset() { + return context$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * void *context + * } + */ + public static MemorySegment context(MemorySegment struct) { + return struct.get(context$LAYOUT, context$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * void *context + * } + */ + public static void context(MemorySegment struct, MemorySegment fieldValue) { + struct.set(context$LAYOUT, context$OFFSET, fieldValue); + } + + private static final AddressLayout buf$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("buf")); + + /** + * Layout for field: + * {@snippet lang=c : + * char *buf + * } + */ + public static final AddressLayout buf$layout() { + return buf$LAYOUT; + } + + private static final long buf$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * char *buf + * } + */ + public static final long buf$offset() { + return buf$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * char *buf + * } + */ + public static MemorySegment buf(MemorySegment struct) { + return struct.get(buf$LAYOUT, buf$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * char *buf + * } + */ + public static void buf(MemorySegment struct, MemorySegment fieldValue) { + struct.set(buf$LAYOUT, buf$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + private static final OfLong cap$LAYOUT = (OfLong)$LAYOUT.select(groupElement("cap")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t cap + * } + */ + public static final OfLong cap$layout() { + return cap$LAYOUT; + } + + private static final long cap$OFFSET = 24; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t cap + * } + */ + public static final long cap$offset() { + return cap$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t cap + * } + */ + public static long cap(MemorySegment struct) { + return struct.get(cap$LAYOUT, cap$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t cap + * } + */ + public static void cap(MemorySegment struct, long fieldValue) { + struct.set(cap$LAYOUT, cap$OFFSET, fieldValue); + } + + private static final OfBoolean grow_failed$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("grow_failed")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool grow_failed + * } + */ + public static final OfBoolean grow_failed$layout() { + return grow_failed$LAYOUT; + } + + private static final long grow_failed$OFFSET = 32; + + /** + * Offset for field: + * {@snippet lang=c : + * bool grow_failed + * } + */ + public static final long grow_failed$offset() { + return grow_failed$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool grow_failed + * } + */ + public static boolean grow_failed(MemorySegment struct) { + return struct.get(grow_failed$LAYOUT, grow_failed$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool grow_failed + * } + */ + public static void grow_failed(MemorySegment struct, boolean fieldValue) { + struct.set(grow_failed$LAYOUT, grow_failed$OFFSET, fieldValue); + } + + /** + * {@snippet lang=c : + * void (*flush)(struct DiplomatWrite *) + * } + */ + public static class flush { + + flush() { + // Should not be called directly + } + + /** + * The function pointer signature, expressed as a functional interface + */ + public interface Function { + void apply(MemorySegment _x0); + } + + private static final FunctionDescriptor $DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); + + /** + * The descriptor of this function pointer + */ + public static FunctionDescriptor descriptor() { + return $DESC; + } + + private static final MethodHandle UP$MH = somelib_h.upcallHandle(flush.Function.class, "apply", $DESC); + + /** + * Allocates a new upcall stub, whose implementation is defined by {@code fi}. + * The lifetime of the returned segment is managed by {@code arena} + */ + public static MemorySegment allocate(flush.Function fi, Arena arena) { + return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena); + } + + private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC); + + /** + * Invoke the upcall stub {@code funcPtr}, with given parameters + */ + public static void invoke(MemorySegment funcPtr,MemorySegment _x0) { + try { + DOWN$MH.invokeExact(funcPtr, _x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static final AddressLayout flush$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("flush")); + + /** + * Layout for field: + * {@snippet lang=c : + * void (*flush)(struct DiplomatWrite *) + * } + */ + public static final AddressLayout flush$layout() { + return flush$LAYOUT; + } + + private static final long flush$OFFSET = 40; + + /** + * Offset for field: + * {@snippet lang=c : + * void (*flush)(struct DiplomatWrite *) + * } + */ + public static final long flush$offset() { + return flush$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * void (*flush)(struct DiplomatWrite *) + * } + */ + public static MemorySegment flush(MemorySegment struct) { + return struct.get(flush$LAYOUT, flush$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * void (*flush)(struct DiplomatWrite *) + * } + */ + public static void flush(MemorySegment struct, MemorySegment fieldValue) { + struct.set(flush$LAYOUT, flush$OFFSET, fieldValue); + } + + /** + * {@snippet lang=c : + * bool (*grow)(struct DiplomatWrite *, size_t) + * } + */ + public static class grow { + + grow() { + // Should not be called directly + } + + /** + * The function pointer signature, expressed as a functional interface + */ + public interface Function { + boolean apply(MemorySegment _x0, long _x1); + } + + private static final FunctionDescriptor $DESC = FunctionDescriptor.of( + somelib_h.C_BOOL, + somelib_h.C_POINTER, + somelib_h.C_LONG + ); + + /** + * The descriptor of this function pointer + */ + public static FunctionDescriptor descriptor() { + return $DESC; + } + + private static final MethodHandle UP$MH = somelib_h.upcallHandle(grow.Function.class, "apply", $DESC); + + /** + * Allocates a new upcall stub, whose implementation is defined by {@code fi}. + * The lifetime of the returned segment is managed by {@code arena} + */ + public static MemorySegment allocate(grow.Function fi, Arena arena) { + return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena); + } + + private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC); + + /** + * Invoke the upcall stub {@code funcPtr}, with given parameters + */ + public static boolean invoke(MemorySegment funcPtr,MemorySegment _x0, long _x1) { + try { + return (boolean) DOWN$MH.invokeExact(funcPtr, _x0, _x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static final AddressLayout grow$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("grow")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool (*grow)(struct DiplomatWrite *, size_t) + * } + */ + public static final AddressLayout grow$layout() { + return grow$LAYOUT; + } + + private static final long grow$OFFSET = 48; + + /** + * Offset for field: + * {@snippet lang=c : + * bool (*grow)(struct DiplomatWrite *, size_t) + * } + */ + public static final long grow$offset() { + return grow$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool (*grow)(struct DiplomatWrite *, size_t) + * } + */ + public static MemorySegment grow(MemorySegment struct) { + return struct.get(grow$LAYOUT, grow$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool (*grow)(struct DiplomatWrite *, size_t) + * } + */ + public static void grow(MemorySegment struct, MemorySegment fieldValue) { + struct.set(grow$LAYOUT, grow$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/FILE.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/FILE.java new file mode 100644 index 000000000..c73dc11c2 --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/FILE.java @@ -0,0 +1,47 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef struct __sFILE { + * unsigned char *_p; + * int _r; + * int _w; + * short _flags; + * short _file; + * struct __sbuf _bf; + * int _lbfsize; + * void *_cookie; + * int (* _Nullable _close)(void *); + * int (* _Nullable _read)(void *, char *, int); + * fpos_t (* _Nullable _seek)(void *, fpos_t, int); + * int (* _Nullable _write)(void *, const char *, int); + * struct __sbuf _ub; + * struct __sFILEX *_extra; + * int _ur; + * unsigned char _ubuf[3]; + * unsigned char _nbuf[1]; + * struct __sbuf _lb; + * int _blksize; + * fpos_t _offset; + * } FILE + * } + */ +public class FILE extends __sFILE { + + FILE() { + // Should not be called directly + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/ICU4XDataProvider_returns_result_result.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/ICU4XDataProvider_returns_result_result.java new file mode 100644 index 000000000..19cbf6237 --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/ICU4XDataProvider_returns_result_result.java @@ -0,0 +1,127 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct ICU4XDataProvider_returns_result_result { + * bool is_ok; + * } + * } + */ +public class ICU4XDataProvider_returns_result_result { + + ICU4XDataProvider_returns_result_result() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_BOOL.withName("is_ok") + ).withName("ICU4XDataProvider_returns_result_result"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final OfBoolean is_ok$layout() { + return is_ok$LAYOUT; + } + + private static final long is_ok$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final long is_ok$offset() { + return is_ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static boolean is_ok(MemorySegment struct) { + return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static void is_ok(MemorySegment struct, boolean fieldValue) { + struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/ICU4XFixedDecimalFormatterOptions.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/ICU4XFixedDecimalFormatterOptions.java new file mode 100644 index 000000000..ddb172209 --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/ICU4XFixedDecimalFormatterOptions.java @@ -0,0 +1,174 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct ICU4XFixedDecimalFormatterOptions { + * ICU4XFixedDecimalGroupingStrategy grouping_strategy; + * bool some_other_config; + * } + * } + */ +public class ICU4XFixedDecimalFormatterOptions { + + ICU4XFixedDecimalFormatterOptions() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_INT.withName("grouping_strategy"), + somelib_h.C_BOOL.withName("some_other_config"), + MemoryLayout.paddingLayout(3) + ).withName("ICU4XFixedDecimalFormatterOptions"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt grouping_strategy$LAYOUT = (OfInt)$LAYOUT.select(groupElement("grouping_strategy")); + + /** + * Layout for field: + * {@snippet lang=c : + * ICU4XFixedDecimalGroupingStrategy grouping_strategy + * } + */ + public static final OfInt grouping_strategy$layout() { + return grouping_strategy$LAYOUT; + } + + private static final long grouping_strategy$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * ICU4XFixedDecimalGroupingStrategy grouping_strategy + * } + */ + public static final long grouping_strategy$offset() { + return grouping_strategy$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * ICU4XFixedDecimalGroupingStrategy grouping_strategy + * } + */ + public static int grouping_strategy(MemorySegment struct) { + return struct.get(grouping_strategy$LAYOUT, grouping_strategy$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * ICU4XFixedDecimalGroupingStrategy grouping_strategy + * } + */ + public static void grouping_strategy(MemorySegment struct, int fieldValue) { + struct.set(grouping_strategy$LAYOUT, grouping_strategy$OFFSET, fieldValue); + } + + private static final OfBoolean some_other_config$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("some_other_config")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool some_other_config + * } + */ + public static final OfBoolean some_other_config$layout() { + return some_other_config$LAYOUT; + } + + private static final long some_other_config$OFFSET = 4; + + /** + * Offset for field: + * {@snippet lang=c : + * bool some_other_config + * } + */ + public static final long some_other_config$offset() { + return some_other_config$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool some_other_config + * } + */ + public static boolean some_other_config(MemorySegment struct) { + return struct.get(some_other_config$LAYOUT, some_other_config$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool some_other_config + * } + */ + public static void some_other_config(MemorySegment struct, boolean fieldValue) { + struct.set(some_other_config$LAYOUT, some_other_config$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/ICU4XFixedDecimalFormatter_try_new_result.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/ICU4XFixedDecimalFormatter_try_new_result.java new file mode 100644 index 000000000..21c683836 --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/ICU4XFixedDecimalFormatter_try_new_result.java @@ -0,0 +1,178 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct ICU4XFixedDecimalFormatter_try_new_result { + * union { + * ICU4XFixedDecimalFormatter *ok; + * }; + * bool is_ok; + * } + * } + */ +public class ICU4XFixedDecimalFormatter_try_new_result { + + ICU4XFixedDecimalFormatter_try_new_result() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.unionLayout( + somelib_h.C_POINTER.withName("ok") + ).withName("$anon$22:51"), + somelib_h.C_BOOL.withName("is_ok"), + MemoryLayout.paddingLayout(7) + ).withName("ICU4XFixedDecimalFormatter_try_new_result"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout ok$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("$anon$22:51"), groupElement("ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * ICU4XFixedDecimalFormatter *ok + * } + */ + public static final AddressLayout ok$layout() { + return ok$LAYOUT; + } + + private static final long ok$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * ICU4XFixedDecimalFormatter *ok + * } + */ + public static final long ok$offset() { + return ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * ICU4XFixedDecimalFormatter *ok + * } + */ + public static MemorySegment ok(MemorySegment struct) { + return struct.get(ok$LAYOUT, ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * ICU4XFixedDecimalFormatter *ok + * } + */ + public static void ok(MemorySegment struct, MemorySegment fieldValue) { + struct.set(ok$LAYOUT, ok$OFFSET, fieldValue); + } + + private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final OfBoolean is_ok$layout() { + return is_ok$LAYOUT; + } + + private static final long is_ok$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final long is_ok$offset() { + return is_ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static boolean is_ok(MemorySegment struct) { + return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static void is_ok(MemorySegment struct, boolean fieldValue) { + struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/ICU4XFixedDecimal_to_string_result.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/ICU4XFixedDecimal_to_string_result.java new file mode 100644 index 000000000..dc86523e9 --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/ICU4XFixedDecimal_to_string_result.java @@ -0,0 +1,127 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct ICU4XFixedDecimal_to_string_result { + * bool is_ok; + * } + * } + */ +public class ICU4XFixedDecimal_to_string_result { + + ICU4XFixedDecimal_to_string_result() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_BOOL.withName("is_ok") + ).withName("ICU4XFixedDecimal_to_string_result"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final OfBoolean is_ok$layout() { + return is_ok$LAYOUT; + } + + private static final long is_ok$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final long is_ok$offset() { + return is_ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static boolean is_ok(MemorySegment struct) { + return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static void is_ok(MemorySegment struct, boolean fieldValue) { + struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_OSUnalignedU16.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_OSUnalignedU16.java new file mode 100644 index 000000000..7d88e1de8 --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_OSUnalignedU16.java @@ -0,0 +1,127 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct _OSUnalignedU16 { + * volatile uint16_t __val; + * } + * } + */ +public class _OSUnalignedU16 { + + _OSUnalignedU16() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.align(somelib_h.C_SHORT, 1).withName("__val") + ).withName("_OSUnalignedU16"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfShort __val$LAYOUT = (OfShort)$LAYOUT.select(groupElement("__val")); + + /** + * Layout for field: + * {@snippet lang=c : + * volatile uint16_t __val + * } + */ + public static final OfShort __val$layout() { + return __val$LAYOUT; + } + + private static final long __val$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * volatile uint16_t __val + * } + */ + public static final long __val$offset() { + return __val$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * volatile uint16_t __val + * } + */ + public static short __val(MemorySegment struct) { + return struct.get(__val$LAYOUT, __val$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * volatile uint16_t __val + * } + */ + public static void __val(MemorySegment struct, short fieldValue) { + struct.set(__val$LAYOUT, __val$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_OSUnalignedU32.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_OSUnalignedU32.java new file mode 100644 index 000000000..e92d4f122 --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_OSUnalignedU32.java @@ -0,0 +1,127 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct _OSUnalignedU32 { + * volatile uint32_t __val; + * } + * } + */ +public class _OSUnalignedU32 { + + _OSUnalignedU32() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.align(somelib_h.C_INT, 1).withName("__val") + ).withName("_OSUnalignedU32"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt __val$LAYOUT = (OfInt)$LAYOUT.select(groupElement("__val")); + + /** + * Layout for field: + * {@snippet lang=c : + * volatile uint32_t __val + * } + */ + public static final OfInt __val$layout() { + return __val$LAYOUT; + } + + private static final long __val$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * volatile uint32_t __val + * } + */ + public static final long __val$offset() { + return __val$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * volatile uint32_t __val + * } + */ + public static int __val(MemorySegment struct) { + return struct.get(__val$LAYOUT, __val$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * volatile uint32_t __val + * } + */ + public static void __val(MemorySegment struct, int fieldValue) { + struct.set(__val$LAYOUT, __val$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_OSUnalignedU64.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_OSUnalignedU64.java new file mode 100644 index 000000000..3c28f93f5 --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_OSUnalignedU64.java @@ -0,0 +1,127 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct _OSUnalignedU64 { + * volatile uint64_t __val; + * } + * } + */ +public class _OSUnalignedU64 { + + _OSUnalignedU64() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.align(somelib_h.C_LONG_LONG, 1).withName("__val") + ).withName("_OSUnalignedU64"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong __val$LAYOUT = (OfLong)$LAYOUT.select(groupElement("__val")); + + /** + * Layout for field: + * {@snippet lang=c : + * volatile uint64_t __val + * } + */ + public static final OfLong __val$layout() { + return __val$LAYOUT; + } + + private static final long __val$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * volatile uint64_t __val + * } + */ + public static final long __val$offset() { + return __val$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * volatile uint64_t __val + * } + */ + public static long __val(MemorySegment struct) { + return struct.get(__val$LAYOUT, __val$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * volatile uint64_t __val + * } + */ + public static void __val(MemorySegment struct, long fieldValue) { + struct.set(__val$LAYOUT, __val$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_mbstate_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_mbstate_t.java new file mode 100644 index 000000000..53cbe9810 --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_mbstate_t.java @@ -0,0 +1,26 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef __mbstate_t __darwin_mbstate_t + * } + */ +public class __darwin_mbstate_t extends __mbstate_t { + + __darwin_mbstate_t() { + // Should not be called directly + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_attr_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_attr_t.java new file mode 100644 index 000000000..5ec0ad420 --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_attr_t.java @@ -0,0 +1,29 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef struct _opaque_pthread_attr_t { + * long __sig; + * char __opaque[56]; + * } __darwin_pthread_attr_t + * } + */ +public class __darwin_pthread_attr_t extends _opaque_pthread_attr_t { + + __darwin_pthread_attr_t() { + // Should not be called directly + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_cond_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_cond_t.java new file mode 100644 index 000000000..82e1d131b --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_cond_t.java @@ -0,0 +1,29 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef struct _opaque_pthread_cond_t { + * long __sig; + * char __opaque[40]; + * } __darwin_pthread_cond_t + * } + */ +public class __darwin_pthread_cond_t extends _opaque_pthread_cond_t { + + __darwin_pthread_cond_t() { + // Should not be called directly + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_condattr_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_condattr_t.java new file mode 100644 index 000000000..598f5a21f --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_condattr_t.java @@ -0,0 +1,29 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef struct _opaque_pthread_condattr_t { + * long __sig; + * char __opaque[8]; + * } __darwin_pthread_condattr_t + * } + */ +public class __darwin_pthread_condattr_t extends _opaque_pthread_condattr_t { + + __darwin_pthread_condattr_t() { + // Should not be called directly + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_handler_rec.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_handler_rec.java new file mode 100644 index 000000000..ea9c9af0b --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_handler_rec.java @@ -0,0 +1,272 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct __darwin_pthread_handler_rec { + * void (*__routine)(void *); + * void *__arg; + * struct __darwin_pthread_handler_rec *__next; + * } + * } + */ +public class __darwin_pthread_handler_rec { + + __darwin_pthread_handler_rec() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("__routine"), + somelib_h.C_POINTER.withName("__arg"), + somelib_h.C_POINTER.withName("__next") + ).withName("__darwin_pthread_handler_rec"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + /** + * {@snippet lang=c : + * void (*__routine)(void *) + * } + */ + public static class __routine { + + __routine() { + // Should not be called directly + } + + /** + * The function pointer signature, expressed as a functional interface + */ + public interface Function { + void apply(MemorySegment _x0); + } + + private static final FunctionDescriptor $DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); + + /** + * The descriptor of this function pointer + */ + public static FunctionDescriptor descriptor() { + return $DESC; + } + + private static final MethodHandle UP$MH = somelib_h.upcallHandle(__routine.Function.class, "apply", $DESC); + + /** + * Allocates a new upcall stub, whose implementation is defined by {@code fi}. + * The lifetime of the returned segment is managed by {@code arena} + */ + public static MemorySegment allocate(__routine.Function fi, Arena arena) { + return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena); + } + + private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC); + + /** + * Invoke the upcall stub {@code funcPtr}, with given parameters + */ + public static void invoke(MemorySegment funcPtr,MemorySegment _x0) { + try { + DOWN$MH.invokeExact(funcPtr, _x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static final AddressLayout __routine$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("__routine")); + + /** + * Layout for field: + * {@snippet lang=c : + * void (*__routine)(void *) + * } + */ + public static final AddressLayout __routine$layout() { + return __routine$LAYOUT; + } + + private static final long __routine$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * void (*__routine)(void *) + * } + */ + public static final long __routine$offset() { + return __routine$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * void (*__routine)(void *) + * } + */ + public static MemorySegment __routine(MemorySegment struct) { + return struct.get(__routine$LAYOUT, __routine$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * void (*__routine)(void *) + * } + */ + public static void __routine(MemorySegment struct, MemorySegment fieldValue) { + struct.set(__routine$LAYOUT, __routine$OFFSET, fieldValue); + } + + private static final AddressLayout __arg$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("__arg")); + + /** + * Layout for field: + * {@snippet lang=c : + * void *__arg + * } + */ + public static final AddressLayout __arg$layout() { + return __arg$LAYOUT; + } + + private static final long __arg$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * void *__arg + * } + */ + public static final long __arg$offset() { + return __arg$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * void *__arg + * } + */ + public static MemorySegment __arg(MemorySegment struct) { + return struct.get(__arg$LAYOUT, __arg$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * void *__arg + * } + */ + public static void __arg(MemorySegment struct, MemorySegment fieldValue) { + struct.set(__arg$LAYOUT, __arg$OFFSET, fieldValue); + } + + private static final AddressLayout __next$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("__next")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct __darwin_pthread_handler_rec *__next + * } + */ + public static final AddressLayout __next$layout() { + return __next$LAYOUT; + } + + private static final long __next$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * struct __darwin_pthread_handler_rec *__next + * } + */ + public static final long __next$offset() { + return __next$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct __darwin_pthread_handler_rec *__next + * } + */ + public static MemorySegment __next(MemorySegment struct) { + return struct.get(__next$LAYOUT, __next$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct __darwin_pthread_handler_rec *__next + * } + */ + public static void __next(MemorySegment struct, MemorySegment fieldValue) { + struct.set(__next$LAYOUT, __next$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_mutex_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_mutex_t.java new file mode 100644 index 000000000..60a2fde5e --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_mutex_t.java @@ -0,0 +1,29 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef struct _opaque_pthread_mutex_t { + * long __sig; + * char __opaque[56]; + * } __darwin_pthread_mutex_t + * } + */ +public class __darwin_pthread_mutex_t extends _opaque_pthread_mutex_t { + + __darwin_pthread_mutex_t() { + // Should not be called directly + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_mutexattr_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_mutexattr_t.java new file mode 100644 index 000000000..d0212cad8 --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_mutexattr_t.java @@ -0,0 +1,29 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef struct _opaque_pthread_mutexattr_t { + * long __sig; + * char __opaque[8]; + * } __darwin_pthread_mutexattr_t + * } + */ +public class __darwin_pthread_mutexattr_t extends _opaque_pthread_mutexattr_t { + + __darwin_pthread_mutexattr_t() { + // Should not be called directly + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_once_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_once_t.java new file mode 100644 index 000000000..7bd98a64e --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_once_t.java @@ -0,0 +1,29 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef struct _opaque_pthread_once_t { + * long __sig; + * char __opaque[8]; + * } __darwin_pthread_once_t + * } + */ +public class __darwin_pthread_once_t extends _opaque_pthread_once_t { + + __darwin_pthread_once_t() { + // Should not be called directly + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_rwlock_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_rwlock_t.java new file mode 100644 index 000000000..b39afdd2b --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_rwlock_t.java @@ -0,0 +1,29 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef struct _opaque_pthread_rwlock_t { + * long __sig; + * char __opaque[192]; + * } __darwin_pthread_rwlock_t + * } + */ +public class __darwin_pthread_rwlock_t extends _opaque_pthread_rwlock_t { + + __darwin_pthread_rwlock_t() { + // Should not be called directly + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_rwlockattr_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_rwlockattr_t.java new file mode 100644 index 000000000..1c415ffc7 --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_rwlockattr_t.java @@ -0,0 +1,29 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef struct _opaque_pthread_rwlockattr_t { + * long __sig; + * char __opaque[16]; + * } __darwin_pthread_rwlockattr_t + * } + */ +public class __darwin_pthread_rwlockattr_t extends _opaque_pthread_rwlockattr_t { + + __darwin_pthread_rwlockattr_t() { + // Should not be called directly + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__mbstate_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__mbstate_t.java new file mode 100644 index 000000000..b83bd44db --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__mbstate_t.java @@ -0,0 +1,206 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * union { + * char __mbstate8[128]; + * long long _mbstateL; + * } + * } + */ +public class __mbstate_t { + + __mbstate_t() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.unionLayout( + MemoryLayout.sequenceLayout(128, somelib_h.C_CHAR).withName("__mbstate8"), + somelib_h.C_LONG_LONG.withName("_mbstateL") + ).withName("$anon$54:9"); + + /** + * The layout of this union + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final SequenceLayout __mbstate8$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("__mbstate8")); + + /** + * Layout for field: + * {@snippet lang=c : + * char __mbstate8[128] + * } + */ + public static final SequenceLayout __mbstate8$layout() { + return __mbstate8$LAYOUT; + } + + private static final long __mbstate8$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * char __mbstate8[128] + * } + */ + public static final long __mbstate8$offset() { + return __mbstate8$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * char __mbstate8[128] + * } + */ + public static MemorySegment __mbstate8(MemorySegment union) { + return union.asSlice(__mbstate8$OFFSET, __mbstate8$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * char __mbstate8[128] + * } + */ + public static void __mbstate8(MemorySegment union, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, union, __mbstate8$OFFSET, __mbstate8$LAYOUT.byteSize()); + } + + private static long[] __mbstate8$DIMS = { 128 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * char __mbstate8[128] + * } + */ + public static long[] __mbstate8$dimensions() { + return __mbstate8$DIMS; + } + private static final VarHandle __mbstate8$ELEM_HANDLE = __mbstate8$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * char __mbstate8[128] + * } + */ + public static byte __mbstate8(MemorySegment union, long index0) { + return (byte)__mbstate8$ELEM_HANDLE.get(union, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * char __mbstate8[128] + * } + */ + public static void __mbstate8(MemorySegment union, long index0, byte fieldValue) { + __mbstate8$ELEM_HANDLE.set(union, 0L, index0, fieldValue); + } + + private static final OfLong _mbstateL$LAYOUT = (OfLong)$LAYOUT.select(groupElement("_mbstateL")); + + /** + * Layout for field: + * {@snippet lang=c : + * long long _mbstateL + * } + */ + public static final OfLong _mbstateL$layout() { + return _mbstateL$LAYOUT; + } + + private static final long _mbstateL$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * long long _mbstateL + * } + */ + public static final long _mbstateL$offset() { + return _mbstateL$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * long long _mbstateL + * } + */ + public static long _mbstateL(MemorySegment union) { + return union.get(_mbstateL$LAYOUT, _mbstateL$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * long long _mbstateL + * } + */ + public static void _mbstateL(MemorySegment union, long fieldValue) { + union.set(_mbstateL$LAYOUT, _mbstateL$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this union + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__sFILE.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__sFILE.java new file mode 100644 index 000000000..2da0db2d6 --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__sFILE.java @@ -0,0 +1,1292 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct __sFILE { + * unsigned char *_p; + * int _r; + * int _w; + * short _flags; + * short _file; + * struct __sbuf _bf; + * int _lbfsize; + * void *_cookie; + * int (* _Nullable _close)(void *); + * int (* _Nullable _read)(void *, char *, int); + * fpos_t (* _Nullable _seek)(void *, fpos_t, int); + * int (* _Nullable _write)(void *, const char *, int); + * struct __sbuf _ub; + * struct __sFILEX *_extra; + * int _ur; + * unsigned char _ubuf[3]; + * unsigned char _nbuf[1]; + * struct __sbuf _lb; + * int _blksize; + * fpos_t _offset; + * } + * } + */ +public class __sFILE { + + __sFILE() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("_p"), + somelib_h.C_INT.withName("_r"), + somelib_h.C_INT.withName("_w"), + somelib_h.C_SHORT.withName("_flags"), + somelib_h.C_SHORT.withName("_file"), + MemoryLayout.paddingLayout(4), + __sbuf.layout().withName("_bf"), + somelib_h.C_INT.withName("_lbfsize"), + MemoryLayout.paddingLayout(4), + somelib_h.C_POINTER.withName("_cookie"), + somelib_h.C_POINTER.withName("_close"), + somelib_h.C_POINTER.withName("_read"), + somelib_h.C_POINTER.withName("_seek"), + somelib_h.C_POINTER.withName("_write"), + __sbuf.layout().withName("_ub"), + somelib_h.C_POINTER.withName("_extra"), + somelib_h.C_INT.withName("_ur"), + MemoryLayout.sequenceLayout(3, somelib_h.C_CHAR).withName("_ubuf"), + MemoryLayout.sequenceLayout(1, somelib_h.C_CHAR).withName("_nbuf"), + __sbuf.layout().withName("_lb"), + somelib_h.C_INT.withName("_blksize"), + MemoryLayout.paddingLayout(4), + somelib_h.C_LONG_LONG.withName("_offset") + ).withName("__sFILE"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout _p$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("_p")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned char *_p + * } + */ + public static final AddressLayout _p$layout() { + return _p$LAYOUT; + } + + private static final long _p$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned char *_p + * } + */ + public static final long _p$offset() { + return _p$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned char *_p + * } + */ + public static MemorySegment _p(MemorySegment struct) { + return struct.get(_p$LAYOUT, _p$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned char *_p + * } + */ + public static void _p(MemorySegment struct, MemorySegment fieldValue) { + struct.set(_p$LAYOUT, _p$OFFSET, fieldValue); + } + + private static final OfInt _r$LAYOUT = (OfInt)$LAYOUT.select(groupElement("_r")); + + /** + * Layout for field: + * {@snippet lang=c : + * int _r + * } + */ + public static final OfInt _r$layout() { + return _r$LAYOUT; + } + + private static final long _r$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * int _r + * } + */ + public static final long _r$offset() { + return _r$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int _r + * } + */ + public static int _r(MemorySegment struct) { + return struct.get(_r$LAYOUT, _r$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int _r + * } + */ + public static void _r(MemorySegment struct, int fieldValue) { + struct.set(_r$LAYOUT, _r$OFFSET, fieldValue); + } + + private static final OfInt _w$LAYOUT = (OfInt)$LAYOUT.select(groupElement("_w")); + + /** + * Layout for field: + * {@snippet lang=c : + * int _w + * } + */ + public static final OfInt _w$layout() { + return _w$LAYOUT; + } + + private static final long _w$OFFSET = 12; + + /** + * Offset for field: + * {@snippet lang=c : + * int _w + * } + */ + public static final long _w$offset() { + return _w$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int _w + * } + */ + public static int _w(MemorySegment struct) { + return struct.get(_w$LAYOUT, _w$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int _w + * } + */ + public static void _w(MemorySegment struct, int fieldValue) { + struct.set(_w$LAYOUT, _w$OFFSET, fieldValue); + } + + private static final OfShort _flags$LAYOUT = (OfShort)$LAYOUT.select(groupElement("_flags")); + + /** + * Layout for field: + * {@snippet lang=c : + * short _flags + * } + */ + public static final OfShort _flags$layout() { + return _flags$LAYOUT; + } + + private static final long _flags$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * short _flags + * } + */ + public static final long _flags$offset() { + return _flags$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * short _flags + * } + */ + public static short _flags(MemorySegment struct) { + return struct.get(_flags$LAYOUT, _flags$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * short _flags + * } + */ + public static void _flags(MemorySegment struct, short fieldValue) { + struct.set(_flags$LAYOUT, _flags$OFFSET, fieldValue); + } + + private static final OfShort _file$LAYOUT = (OfShort)$LAYOUT.select(groupElement("_file")); + + /** + * Layout for field: + * {@snippet lang=c : + * short _file + * } + */ + public static final OfShort _file$layout() { + return _file$LAYOUT; + } + + private static final long _file$OFFSET = 18; + + /** + * Offset for field: + * {@snippet lang=c : + * short _file + * } + */ + public static final long _file$offset() { + return _file$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * short _file + * } + */ + public static short _file(MemorySegment struct) { + return struct.get(_file$LAYOUT, _file$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * short _file + * } + */ + public static void _file(MemorySegment struct, short fieldValue) { + struct.set(_file$LAYOUT, _file$OFFSET, fieldValue); + } + + private static final GroupLayout _bf$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("_bf")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct __sbuf _bf + * } + */ + public static final GroupLayout _bf$layout() { + return _bf$LAYOUT; + } + + private static final long _bf$OFFSET = 24; + + /** + * Offset for field: + * {@snippet lang=c : + * struct __sbuf _bf + * } + */ + public static final long _bf$offset() { + return _bf$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct __sbuf _bf + * } + */ + public static MemorySegment _bf(MemorySegment struct) { + return struct.asSlice(_bf$OFFSET, _bf$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct __sbuf _bf + * } + */ + public static void _bf(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, _bf$OFFSET, _bf$LAYOUT.byteSize()); + } + + private static final OfInt _lbfsize$LAYOUT = (OfInt)$LAYOUT.select(groupElement("_lbfsize")); + + /** + * Layout for field: + * {@snippet lang=c : + * int _lbfsize + * } + */ + public static final OfInt _lbfsize$layout() { + return _lbfsize$LAYOUT; + } + + private static final long _lbfsize$OFFSET = 40; + + /** + * Offset for field: + * {@snippet lang=c : + * int _lbfsize + * } + */ + public static final long _lbfsize$offset() { + return _lbfsize$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int _lbfsize + * } + */ + public static int _lbfsize(MemorySegment struct) { + return struct.get(_lbfsize$LAYOUT, _lbfsize$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int _lbfsize + * } + */ + public static void _lbfsize(MemorySegment struct, int fieldValue) { + struct.set(_lbfsize$LAYOUT, _lbfsize$OFFSET, fieldValue); + } + + private static final AddressLayout _cookie$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("_cookie")); + + /** + * Layout for field: + * {@snippet lang=c : + * void *_cookie + * } + */ + public static final AddressLayout _cookie$layout() { + return _cookie$LAYOUT; + } + + private static final long _cookie$OFFSET = 48; + + /** + * Offset for field: + * {@snippet lang=c : + * void *_cookie + * } + */ + public static final long _cookie$offset() { + return _cookie$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * void *_cookie + * } + */ + public static MemorySegment _cookie(MemorySegment struct) { + return struct.get(_cookie$LAYOUT, _cookie$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * void *_cookie + * } + */ + public static void _cookie(MemorySegment struct, MemorySegment fieldValue) { + struct.set(_cookie$LAYOUT, _cookie$OFFSET, fieldValue); + } + + /** + * {@snippet lang=c : + * int (* _Nullable _close)(void *) + * } + */ + public static class _close { + + _close() { + // Should not be called directly + } + + /** + * The function pointer signature, expressed as a functional interface + */ + public interface Function { + int apply(MemorySegment _x0); + } + + private static final FunctionDescriptor $DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + /** + * The descriptor of this function pointer + */ + public static FunctionDescriptor descriptor() { + return $DESC; + } + + private static final MethodHandle UP$MH = somelib_h.upcallHandle(_close.Function.class, "apply", $DESC); + + /** + * Allocates a new upcall stub, whose implementation is defined by {@code fi}. + * The lifetime of the returned segment is managed by {@code arena} + */ + public static MemorySegment allocate(_close.Function fi, Arena arena) { + return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena); + } + + private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC); + + /** + * Invoke the upcall stub {@code funcPtr}, with given parameters + */ + public static int invoke(MemorySegment funcPtr,MemorySegment _x0) { + try { + return (int) DOWN$MH.invokeExact(funcPtr, _x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static final AddressLayout _close$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("_close")); + + /** + * Layout for field: + * {@snippet lang=c : + * int (* _Nullable _close)(void *) + * } + */ + public static final AddressLayout _close$layout() { + return _close$LAYOUT; + } + + private static final long _close$OFFSET = 56; + + /** + * Offset for field: + * {@snippet lang=c : + * int (* _Nullable _close)(void *) + * } + */ + public static final long _close$offset() { + return _close$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int (* _Nullable _close)(void *) + * } + */ + public static MemorySegment _close(MemorySegment struct) { + return struct.get(_close$LAYOUT, _close$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int (* _Nullable _close)(void *) + * } + */ + public static void _close(MemorySegment struct, MemorySegment fieldValue) { + struct.set(_close$LAYOUT, _close$OFFSET, fieldValue); + } + + /** + * {@snippet lang=c : + * int (* _Nullable _read)(void *, char *, int) + * } + */ + public static class _read { + + _read() { + // Should not be called directly + } + + /** + * The function pointer signature, expressed as a functional interface + */ + public interface Function { + int apply(MemorySegment _x0, MemorySegment _x1, int _x2); + } + + private static final FunctionDescriptor $DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_INT + ); + + /** + * The descriptor of this function pointer + */ + public static FunctionDescriptor descriptor() { + return $DESC; + } + + private static final MethodHandle UP$MH = somelib_h.upcallHandle(_read.Function.class, "apply", $DESC); + + /** + * Allocates a new upcall stub, whose implementation is defined by {@code fi}. + * The lifetime of the returned segment is managed by {@code arena} + */ + public static MemorySegment allocate(_read.Function fi, Arena arena) { + return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena); + } + + private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC); + + /** + * Invoke the upcall stub {@code funcPtr}, with given parameters + */ + public static int invoke(MemorySegment funcPtr,MemorySegment _x0, MemorySegment _x1, int _x2) { + try { + return (int) DOWN$MH.invokeExact(funcPtr, _x0, _x1, _x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static final AddressLayout _read$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("_read")); + + /** + * Layout for field: + * {@snippet lang=c : + * int (* _Nullable _read)(void *, char *, int) + * } + */ + public static final AddressLayout _read$layout() { + return _read$LAYOUT; + } + + private static final long _read$OFFSET = 64; + + /** + * Offset for field: + * {@snippet lang=c : + * int (* _Nullable _read)(void *, char *, int) + * } + */ + public static final long _read$offset() { + return _read$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int (* _Nullable _read)(void *, char *, int) + * } + */ + public static MemorySegment _read(MemorySegment struct) { + return struct.get(_read$LAYOUT, _read$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int (* _Nullable _read)(void *, char *, int) + * } + */ + public static void _read(MemorySegment struct, MemorySegment fieldValue) { + struct.set(_read$LAYOUT, _read$OFFSET, fieldValue); + } + + /** + * {@snippet lang=c : + * fpos_t (* _Nullable _seek)(void *, fpos_t, int) + * } + */ + public static class _seek { + + _seek() { + // Should not be called directly + } + + /** + * The function pointer signature, expressed as a functional interface + */ + public interface Function { + long apply(MemorySegment _x0, long _x1, int _x2); + } + + private static final FunctionDescriptor $DESC = FunctionDescriptor.of( + somelib_h.C_LONG_LONG, + somelib_h.C_POINTER, + somelib_h.C_LONG_LONG, + somelib_h.C_INT + ); + + /** + * The descriptor of this function pointer + */ + public static FunctionDescriptor descriptor() { + return $DESC; + } + + private static final MethodHandle UP$MH = somelib_h.upcallHandle(_seek.Function.class, "apply", $DESC); + + /** + * Allocates a new upcall stub, whose implementation is defined by {@code fi}. + * The lifetime of the returned segment is managed by {@code arena} + */ + public static MemorySegment allocate(_seek.Function fi, Arena arena) { + return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena); + } + + private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC); + + /** + * Invoke the upcall stub {@code funcPtr}, with given parameters + */ + public static long invoke(MemorySegment funcPtr,MemorySegment _x0, long _x1, int _x2) { + try { + return (long) DOWN$MH.invokeExact(funcPtr, _x0, _x1, _x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static final AddressLayout _seek$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("_seek")); + + /** + * Layout for field: + * {@snippet lang=c : + * fpos_t (* _Nullable _seek)(void *, fpos_t, int) + * } + */ + public static final AddressLayout _seek$layout() { + return _seek$LAYOUT; + } + + private static final long _seek$OFFSET = 72; + + /** + * Offset for field: + * {@snippet lang=c : + * fpos_t (* _Nullable _seek)(void *, fpos_t, int) + * } + */ + public static final long _seek$offset() { + return _seek$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * fpos_t (* _Nullable _seek)(void *, fpos_t, int) + * } + */ + public static MemorySegment _seek(MemorySegment struct) { + return struct.get(_seek$LAYOUT, _seek$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * fpos_t (* _Nullable _seek)(void *, fpos_t, int) + * } + */ + public static void _seek(MemorySegment struct, MemorySegment fieldValue) { + struct.set(_seek$LAYOUT, _seek$OFFSET, fieldValue); + } + + /** + * {@snippet lang=c : + * int (* _Nullable _write)(void *, const char *, int) + * } + */ + public static class _write { + + _write() { + // Should not be called directly + } + + /** + * The function pointer signature, expressed as a functional interface + */ + public interface Function { + int apply(MemorySegment _x0, MemorySegment _x1, int _x2); + } + + private static final FunctionDescriptor $DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_INT + ); + + /** + * The descriptor of this function pointer + */ + public static FunctionDescriptor descriptor() { + return $DESC; + } + + private static final MethodHandle UP$MH = somelib_h.upcallHandle(_write.Function.class, "apply", $DESC); + + /** + * Allocates a new upcall stub, whose implementation is defined by {@code fi}. + * The lifetime of the returned segment is managed by {@code arena} + */ + public static MemorySegment allocate(_write.Function fi, Arena arena) { + return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena); + } + + private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC); + + /** + * Invoke the upcall stub {@code funcPtr}, with given parameters + */ + public static int invoke(MemorySegment funcPtr,MemorySegment _x0, MemorySegment _x1, int _x2) { + try { + return (int) DOWN$MH.invokeExact(funcPtr, _x0, _x1, _x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static final AddressLayout _write$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("_write")); + + /** + * Layout for field: + * {@snippet lang=c : + * int (* _Nullable _write)(void *, const char *, int) + * } + */ + public static final AddressLayout _write$layout() { + return _write$LAYOUT; + } + + private static final long _write$OFFSET = 80; + + /** + * Offset for field: + * {@snippet lang=c : + * int (* _Nullable _write)(void *, const char *, int) + * } + */ + public static final long _write$offset() { + return _write$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int (* _Nullable _write)(void *, const char *, int) + * } + */ + public static MemorySegment _write(MemorySegment struct) { + return struct.get(_write$LAYOUT, _write$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int (* _Nullable _write)(void *, const char *, int) + * } + */ + public static void _write(MemorySegment struct, MemorySegment fieldValue) { + struct.set(_write$LAYOUT, _write$OFFSET, fieldValue); + } + + private static final GroupLayout _ub$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("_ub")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct __sbuf _ub + * } + */ + public static final GroupLayout _ub$layout() { + return _ub$LAYOUT; + } + + private static final long _ub$OFFSET = 88; + + /** + * Offset for field: + * {@snippet lang=c : + * struct __sbuf _ub + * } + */ + public static final long _ub$offset() { + return _ub$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct __sbuf _ub + * } + */ + public static MemorySegment _ub(MemorySegment struct) { + return struct.asSlice(_ub$OFFSET, _ub$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct __sbuf _ub + * } + */ + public static void _ub(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, _ub$OFFSET, _ub$LAYOUT.byteSize()); + } + + private static final AddressLayout _extra$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("_extra")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct __sFILEX *_extra + * } + */ + public static final AddressLayout _extra$layout() { + return _extra$LAYOUT; + } + + private static final long _extra$OFFSET = 104; + + /** + * Offset for field: + * {@snippet lang=c : + * struct __sFILEX *_extra + * } + */ + public static final long _extra$offset() { + return _extra$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct __sFILEX *_extra + * } + */ + public static MemorySegment _extra(MemorySegment struct) { + return struct.get(_extra$LAYOUT, _extra$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct __sFILEX *_extra + * } + */ + public static void _extra(MemorySegment struct, MemorySegment fieldValue) { + struct.set(_extra$LAYOUT, _extra$OFFSET, fieldValue); + } + + private static final OfInt _ur$LAYOUT = (OfInt)$LAYOUT.select(groupElement("_ur")); + + /** + * Layout for field: + * {@snippet lang=c : + * int _ur + * } + */ + public static final OfInt _ur$layout() { + return _ur$LAYOUT; + } + + private static final long _ur$OFFSET = 112; + + /** + * Offset for field: + * {@snippet lang=c : + * int _ur + * } + */ + public static final long _ur$offset() { + return _ur$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int _ur + * } + */ + public static int _ur(MemorySegment struct) { + return struct.get(_ur$LAYOUT, _ur$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int _ur + * } + */ + public static void _ur(MemorySegment struct, int fieldValue) { + struct.set(_ur$LAYOUT, _ur$OFFSET, fieldValue); + } + + private static final SequenceLayout _ubuf$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("_ubuf")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned char _ubuf[3] + * } + */ + public static final SequenceLayout _ubuf$layout() { + return _ubuf$LAYOUT; + } + + private static final long _ubuf$OFFSET = 116; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned char _ubuf[3] + * } + */ + public static final long _ubuf$offset() { + return _ubuf$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned char _ubuf[3] + * } + */ + public static MemorySegment _ubuf(MemorySegment struct) { + return struct.asSlice(_ubuf$OFFSET, _ubuf$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned char _ubuf[3] + * } + */ + public static void _ubuf(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, _ubuf$OFFSET, _ubuf$LAYOUT.byteSize()); + } + + private static long[] _ubuf$DIMS = { 3 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * unsigned char _ubuf[3] + * } + */ + public static long[] _ubuf$dimensions() { + return _ubuf$DIMS; + } + private static final VarHandle _ubuf$ELEM_HANDLE = _ubuf$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * unsigned char _ubuf[3] + * } + */ + public static byte _ubuf(MemorySegment struct, long index0) { + return (byte)_ubuf$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * unsigned char _ubuf[3] + * } + */ + public static void _ubuf(MemorySegment struct, long index0, byte fieldValue) { + _ubuf$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + private static final SequenceLayout _nbuf$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("_nbuf")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned char _nbuf[1] + * } + */ + public static final SequenceLayout _nbuf$layout() { + return _nbuf$LAYOUT; + } + + private static final long _nbuf$OFFSET = 119; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned char _nbuf[1] + * } + */ + public static final long _nbuf$offset() { + return _nbuf$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned char _nbuf[1] + * } + */ + public static MemorySegment _nbuf(MemorySegment struct) { + return struct.asSlice(_nbuf$OFFSET, _nbuf$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned char _nbuf[1] + * } + */ + public static void _nbuf(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, _nbuf$OFFSET, _nbuf$LAYOUT.byteSize()); + } + + private static long[] _nbuf$DIMS = { 1 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * unsigned char _nbuf[1] + * } + */ + public static long[] _nbuf$dimensions() { + return _nbuf$DIMS; + } + private static final VarHandle _nbuf$ELEM_HANDLE = _nbuf$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * unsigned char _nbuf[1] + * } + */ + public static byte _nbuf(MemorySegment struct, long index0) { + return (byte)_nbuf$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * unsigned char _nbuf[1] + * } + */ + public static void _nbuf(MemorySegment struct, long index0, byte fieldValue) { + _nbuf$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + private static final GroupLayout _lb$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("_lb")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct __sbuf _lb + * } + */ + public static final GroupLayout _lb$layout() { + return _lb$LAYOUT; + } + + private static final long _lb$OFFSET = 120; + + /** + * Offset for field: + * {@snippet lang=c : + * struct __sbuf _lb + * } + */ + public static final long _lb$offset() { + return _lb$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct __sbuf _lb + * } + */ + public static MemorySegment _lb(MemorySegment struct) { + return struct.asSlice(_lb$OFFSET, _lb$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct __sbuf _lb + * } + */ + public static void _lb(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, _lb$OFFSET, _lb$LAYOUT.byteSize()); + } + + private static final OfInt _blksize$LAYOUT = (OfInt)$LAYOUT.select(groupElement("_blksize")); + + /** + * Layout for field: + * {@snippet lang=c : + * int _blksize + * } + */ + public static final OfInt _blksize$layout() { + return _blksize$LAYOUT; + } + + private static final long _blksize$OFFSET = 136; + + /** + * Offset for field: + * {@snippet lang=c : + * int _blksize + * } + */ + public static final long _blksize$offset() { + return _blksize$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int _blksize + * } + */ + public static int _blksize(MemorySegment struct) { + return struct.get(_blksize$LAYOUT, _blksize$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int _blksize + * } + */ + public static void _blksize(MemorySegment struct, int fieldValue) { + struct.set(_blksize$LAYOUT, _blksize$OFFSET, fieldValue); + } + + private static final OfLong _offset$LAYOUT = (OfLong)$LAYOUT.select(groupElement("_offset")); + + /** + * Layout for field: + * {@snippet lang=c : + * fpos_t _offset + * } + */ + public static final OfLong _offset$layout() { + return _offset$LAYOUT; + } + + private static final long _offset$OFFSET = 144; + + /** + * Offset for field: + * {@snippet lang=c : + * fpos_t _offset + * } + */ + public static final long _offset$offset() { + return _offset$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * fpos_t _offset + * } + */ + public static long _offset(MemorySegment struct) { + return struct.get(_offset$LAYOUT, _offset$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * fpos_t _offset + * } + */ + public static void _offset(MemorySegment struct, long fieldValue) { + struct.set(_offset$LAYOUT, _offset$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__sbuf.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__sbuf.java new file mode 100644 index 000000000..c4fd8a3c7 --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__sbuf.java @@ -0,0 +1,174 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct __sbuf { + * unsigned char *_base; + * int _size; + * } + * } + */ +public class __sbuf { + + __sbuf() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("_base"), + somelib_h.C_INT.withName("_size"), + MemoryLayout.paddingLayout(4) + ).withName("__sbuf"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout _base$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("_base")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned char *_base + * } + */ + public static final AddressLayout _base$layout() { + return _base$LAYOUT; + } + + private static final long _base$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned char *_base + * } + */ + public static final long _base$offset() { + return _base$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned char *_base + * } + */ + public static MemorySegment _base(MemorySegment struct) { + return struct.get(_base$LAYOUT, _base$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned char *_base + * } + */ + public static void _base(MemorySegment struct, MemorySegment fieldValue) { + struct.set(_base$LAYOUT, _base$OFFSET, fieldValue); + } + + private static final OfInt _size$LAYOUT = (OfInt)$LAYOUT.select(groupElement("_size")); + + /** + * Layout for field: + * {@snippet lang=c : + * int _size + * } + */ + public static final OfInt _size$layout() { + return _size$LAYOUT; + } + + private static final long _size$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * int _size + * } + */ + public static final long _size$offset() { + return _size$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int _size + * } + */ + public static int _size(MemorySegment struct) { + return struct.get(_size$LAYOUT, _size$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int _size + * } + */ + public static void _size(MemorySegment struct, int fieldValue) { + struct.set(_size$LAYOUT, _size$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_attr_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_attr_t.java new file mode 100644 index 000000000..1da474a48 --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_attr_t.java @@ -0,0 +1,206 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct _opaque_pthread_attr_t { + * long __sig; + * char __opaque[56]; + * } + * } + */ +public class _opaque_pthread_attr_t { + + _opaque_pthread_attr_t() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_LONG.withName("__sig"), + MemoryLayout.sequenceLayout(56, somelib_h.C_CHAR).withName("__opaque") + ).withName("_opaque_pthread_attr_t"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong __sig$LAYOUT = (OfLong)$LAYOUT.select(groupElement("__sig")); + + /** + * Layout for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static final OfLong __sig$layout() { + return __sig$LAYOUT; + } + + private static final long __sig$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static final long __sig$offset() { + return __sig$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static long __sig(MemorySegment struct) { + return struct.get(__sig$LAYOUT, __sig$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static void __sig(MemorySegment struct, long fieldValue) { + struct.set(__sig$LAYOUT, __sig$OFFSET, fieldValue); + } + + private static final SequenceLayout __opaque$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("__opaque")); + + /** + * Layout for field: + * {@snippet lang=c : + * char __opaque[56] + * } + */ + public static final SequenceLayout __opaque$layout() { + return __opaque$LAYOUT; + } + + private static final long __opaque$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * char __opaque[56] + * } + */ + public static final long __opaque$offset() { + return __opaque$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * char __opaque[56] + * } + */ + public static MemorySegment __opaque(MemorySegment struct) { + return struct.asSlice(__opaque$OFFSET, __opaque$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * char __opaque[56] + * } + */ + public static void __opaque(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, __opaque$OFFSET, __opaque$LAYOUT.byteSize()); + } + + private static long[] __opaque$DIMS = { 56 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * char __opaque[56] + * } + */ + public static long[] __opaque$dimensions() { + return __opaque$DIMS; + } + private static final VarHandle __opaque$ELEM_HANDLE = __opaque$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * char __opaque[56] + * } + */ + public static byte __opaque(MemorySegment struct, long index0) { + return (byte)__opaque$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * char __opaque[56] + * } + */ + public static void __opaque(MemorySegment struct, long index0, byte fieldValue) { + __opaque$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_cond_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_cond_t.java new file mode 100644 index 000000000..d558a7c41 --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_cond_t.java @@ -0,0 +1,206 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct _opaque_pthread_cond_t { + * long __sig; + * char __opaque[40]; + * } + * } + */ +public class _opaque_pthread_cond_t { + + _opaque_pthread_cond_t() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_LONG.withName("__sig"), + MemoryLayout.sequenceLayout(40, somelib_h.C_CHAR).withName("__opaque") + ).withName("_opaque_pthread_cond_t"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong __sig$LAYOUT = (OfLong)$LAYOUT.select(groupElement("__sig")); + + /** + * Layout for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static final OfLong __sig$layout() { + return __sig$LAYOUT; + } + + private static final long __sig$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static final long __sig$offset() { + return __sig$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static long __sig(MemorySegment struct) { + return struct.get(__sig$LAYOUT, __sig$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static void __sig(MemorySegment struct, long fieldValue) { + struct.set(__sig$LAYOUT, __sig$OFFSET, fieldValue); + } + + private static final SequenceLayout __opaque$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("__opaque")); + + /** + * Layout for field: + * {@snippet lang=c : + * char __opaque[40] + * } + */ + public static final SequenceLayout __opaque$layout() { + return __opaque$LAYOUT; + } + + private static final long __opaque$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * char __opaque[40] + * } + */ + public static final long __opaque$offset() { + return __opaque$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * char __opaque[40] + * } + */ + public static MemorySegment __opaque(MemorySegment struct) { + return struct.asSlice(__opaque$OFFSET, __opaque$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * char __opaque[40] + * } + */ + public static void __opaque(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, __opaque$OFFSET, __opaque$LAYOUT.byteSize()); + } + + private static long[] __opaque$DIMS = { 40 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * char __opaque[40] + * } + */ + public static long[] __opaque$dimensions() { + return __opaque$DIMS; + } + private static final VarHandle __opaque$ELEM_HANDLE = __opaque$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * char __opaque[40] + * } + */ + public static byte __opaque(MemorySegment struct, long index0) { + return (byte)__opaque$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * char __opaque[40] + * } + */ + public static void __opaque(MemorySegment struct, long index0, byte fieldValue) { + __opaque$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_condattr_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_condattr_t.java new file mode 100644 index 000000000..02538b060 --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_condattr_t.java @@ -0,0 +1,206 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct _opaque_pthread_condattr_t { + * long __sig; + * char __opaque[8]; + * } + * } + */ +public class _opaque_pthread_condattr_t { + + _opaque_pthread_condattr_t() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_LONG.withName("__sig"), + MemoryLayout.sequenceLayout(8, somelib_h.C_CHAR).withName("__opaque") + ).withName("_opaque_pthread_condattr_t"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong __sig$LAYOUT = (OfLong)$LAYOUT.select(groupElement("__sig")); + + /** + * Layout for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static final OfLong __sig$layout() { + return __sig$LAYOUT; + } + + private static final long __sig$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static final long __sig$offset() { + return __sig$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static long __sig(MemorySegment struct) { + return struct.get(__sig$LAYOUT, __sig$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static void __sig(MemorySegment struct, long fieldValue) { + struct.set(__sig$LAYOUT, __sig$OFFSET, fieldValue); + } + + private static final SequenceLayout __opaque$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("__opaque")); + + /** + * Layout for field: + * {@snippet lang=c : + * char __opaque[8] + * } + */ + public static final SequenceLayout __opaque$layout() { + return __opaque$LAYOUT; + } + + private static final long __opaque$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * char __opaque[8] + * } + */ + public static final long __opaque$offset() { + return __opaque$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * char __opaque[8] + * } + */ + public static MemorySegment __opaque(MemorySegment struct) { + return struct.asSlice(__opaque$OFFSET, __opaque$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * char __opaque[8] + * } + */ + public static void __opaque(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, __opaque$OFFSET, __opaque$LAYOUT.byteSize()); + } + + private static long[] __opaque$DIMS = { 8 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * char __opaque[8] + * } + */ + public static long[] __opaque$dimensions() { + return __opaque$DIMS; + } + private static final VarHandle __opaque$ELEM_HANDLE = __opaque$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * char __opaque[8] + * } + */ + public static byte __opaque(MemorySegment struct, long index0) { + return (byte)__opaque$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * char __opaque[8] + * } + */ + public static void __opaque(MemorySegment struct, long index0, byte fieldValue) { + __opaque$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_mutex_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_mutex_t.java new file mode 100644 index 000000000..6d772cce2 --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_mutex_t.java @@ -0,0 +1,206 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct _opaque_pthread_mutex_t { + * long __sig; + * char __opaque[56]; + * } + * } + */ +public class _opaque_pthread_mutex_t { + + _opaque_pthread_mutex_t() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_LONG.withName("__sig"), + MemoryLayout.sequenceLayout(56, somelib_h.C_CHAR).withName("__opaque") + ).withName("_opaque_pthread_mutex_t"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong __sig$LAYOUT = (OfLong)$LAYOUT.select(groupElement("__sig")); + + /** + * Layout for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static final OfLong __sig$layout() { + return __sig$LAYOUT; + } + + private static final long __sig$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static final long __sig$offset() { + return __sig$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static long __sig(MemorySegment struct) { + return struct.get(__sig$LAYOUT, __sig$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static void __sig(MemorySegment struct, long fieldValue) { + struct.set(__sig$LAYOUT, __sig$OFFSET, fieldValue); + } + + private static final SequenceLayout __opaque$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("__opaque")); + + /** + * Layout for field: + * {@snippet lang=c : + * char __opaque[56] + * } + */ + public static final SequenceLayout __opaque$layout() { + return __opaque$LAYOUT; + } + + private static final long __opaque$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * char __opaque[56] + * } + */ + public static final long __opaque$offset() { + return __opaque$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * char __opaque[56] + * } + */ + public static MemorySegment __opaque(MemorySegment struct) { + return struct.asSlice(__opaque$OFFSET, __opaque$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * char __opaque[56] + * } + */ + public static void __opaque(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, __opaque$OFFSET, __opaque$LAYOUT.byteSize()); + } + + private static long[] __opaque$DIMS = { 56 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * char __opaque[56] + * } + */ + public static long[] __opaque$dimensions() { + return __opaque$DIMS; + } + private static final VarHandle __opaque$ELEM_HANDLE = __opaque$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * char __opaque[56] + * } + */ + public static byte __opaque(MemorySegment struct, long index0) { + return (byte)__opaque$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * char __opaque[56] + * } + */ + public static void __opaque(MemorySegment struct, long index0, byte fieldValue) { + __opaque$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_mutexattr_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_mutexattr_t.java new file mode 100644 index 000000000..5910bf334 --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_mutexattr_t.java @@ -0,0 +1,206 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct _opaque_pthread_mutexattr_t { + * long __sig; + * char __opaque[8]; + * } + * } + */ +public class _opaque_pthread_mutexattr_t { + + _opaque_pthread_mutexattr_t() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_LONG.withName("__sig"), + MemoryLayout.sequenceLayout(8, somelib_h.C_CHAR).withName("__opaque") + ).withName("_opaque_pthread_mutexattr_t"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong __sig$LAYOUT = (OfLong)$LAYOUT.select(groupElement("__sig")); + + /** + * Layout for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static final OfLong __sig$layout() { + return __sig$LAYOUT; + } + + private static final long __sig$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static final long __sig$offset() { + return __sig$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static long __sig(MemorySegment struct) { + return struct.get(__sig$LAYOUT, __sig$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static void __sig(MemorySegment struct, long fieldValue) { + struct.set(__sig$LAYOUT, __sig$OFFSET, fieldValue); + } + + private static final SequenceLayout __opaque$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("__opaque")); + + /** + * Layout for field: + * {@snippet lang=c : + * char __opaque[8] + * } + */ + public static final SequenceLayout __opaque$layout() { + return __opaque$LAYOUT; + } + + private static final long __opaque$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * char __opaque[8] + * } + */ + public static final long __opaque$offset() { + return __opaque$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * char __opaque[8] + * } + */ + public static MemorySegment __opaque(MemorySegment struct) { + return struct.asSlice(__opaque$OFFSET, __opaque$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * char __opaque[8] + * } + */ + public static void __opaque(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, __opaque$OFFSET, __opaque$LAYOUT.byteSize()); + } + + private static long[] __opaque$DIMS = { 8 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * char __opaque[8] + * } + */ + public static long[] __opaque$dimensions() { + return __opaque$DIMS; + } + private static final VarHandle __opaque$ELEM_HANDLE = __opaque$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * char __opaque[8] + * } + */ + public static byte __opaque(MemorySegment struct, long index0) { + return (byte)__opaque$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * char __opaque[8] + * } + */ + public static void __opaque(MemorySegment struct, long index0, byte fieldValue) { + __opaque$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_once_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_once_t.java new file mode 100644 index 000000000..b64f81dd4 --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_once_t.java @@ -0,0 +1,206 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct _opaque_pthread_once_t { + * long __sig; + * char __opaque[8]; + * } + * } + */ +public class _opaque_pthread_once_t { + + _opaque_pthread_once_t() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_LONG.withName("__sig"), + MemoryLayout.sequenceLayout(8, somelib_h.C_CHAR).withName("__opaque") + ).withName("_opaque_pthread_once_t"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong __sig$LAYOUT = (OfLong)$LAYOUT.select(groupElement("__sig")); + + /** + * Layout for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static final OfLong __sig$layout() { + return __sig$LAYOUT; + } + + private static final long __sig$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static final long __sig$offset() { + return __sig$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static long __sig(MemorySegment struct) { + return struct.get(__sig$LAYOUT, __sig$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static void __sig(MemorySegment struct, long fieldValue) { + struct.set(__sig$LAYOUT, __sig$OFFSET, fieldValue); + } + + private static final SequenceLayout __opaque$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("__opaque")); + + /** + * Layout for field: + * {@snippet lang=c : + * char __opaque[8] + * } + */ + public static final SequenceLayout __opaque$layout() { + return __opaque$LAYOUT; + } + + private static final long __opaque$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * char __opaque[8] + * } + */ + public static final long __opaque$offset() { + return __opaque$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * char __opaque[8] + * } + */ + public static MemorySegment __opaque(MemorySegment struct) { + return struct.asSlice(__opaque$OFFSET, __opaque$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * char __opaque[8] + * } + */ + public static void __opaque(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, __opaque$OFFSET, __opaque$LAYOUT.byteSize()); + } + + private static long[] __opaque$DIMS = { 8 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * char __opaque[8] + * } + */ + public static long[] __opaque$dimensions() { + return __opaque$DIMS; + } + private static final VarHandle __opaque$ELEM_HANDLE = __opaque$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * char __opaque[8] + * } + */ + public static byte __opaque(MemorySegment struct, long index0) { + return (byte)__opaque$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * char __opaque[8] + * } + */ + public static void __opaque(MemorySegment struct, long index0, byte fieldValue) { + __opaque$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_rwlock_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_rwlock_t.java new file mode 100644 index 000000000..8341224b0 --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_rwlock_t.java @@ -0,0 +1,206 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct _opaque_pthread_rwlock_t { + * long __sig; + * char __opaque[192]; + * } + * } + */ +public class _opaque_pthread_rwlock_t { + + _opaque_pthread_rwlock_t() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_LONG.withName("__sig"), + MemoryLayout.sequenceLayout(192, somelib_h.C_CHAR).withName("__opaque") + ).withName("_opaque_pthread_rwlock_t"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong __sig$LAYOUT = (OfLong)$LAYOUT.select(groupElement("__sig")); + + /** + * Layout for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static final OfLong __sig$layout() { + return __sig$LAYOUT; + } + + private static final long __sig$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static final long __sig$offset() { + return __sig$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static long __sig(MemorySegment struct) { + return struct.get(__sig$LAYOUT, __sig$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static void __sig(MemorySegment struct, long fieldValue) { + struct.set(__sig$LAYOUT, __sig$OFFSET, fieldValue); + } + + private static final SequenceLayout __opaque$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("__opaque")); + + /** + * Layout for field: + * {@snippet lang=c : + * char __opaque[192] + * } + */ + public static final SequenceLayout __opaque$layout() { + return __opaque$LAYOUT; + } + + private static final long __opaque$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * char __opaque[192] + * } + */ + public static final long __opaque$offset() { + return __opaque$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * char __opaque[192] + * } + */ + public static MemorySegment __opaque(MemorySegment struct) { + return struct.asSlice(__opaque$OFFSET, __opaque$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * char __opaque[192] + * } + */ + public static void __opaque(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, __opaque$OFFSET, __opaque$LAYOUT.byteSize()); + } + + private static long[] __opaque$DIMS = { 192 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * char __opaque[192] + * } + */ + public static long[] __opaque$dimensions() { + return __opaque$DIMS; + } + private static final VarHandle __opaque$ELEM_HANDLE = __opaque$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * char __opaque[192] + * } + */ + public static byte __opaque(MemorySegment struct, long index0) { + return (byte)__opaque$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * char __opaque[192] + * } + */ + public static void __opaque(MemorySegment struct, long index0, byte fieldValue) { + __opaque$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_rwlockattr_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_rwlockattr_t.java new file mode 100644 index 000000000..ef84d9724 --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_rwlockattr_t.java @@ -0,0 +1,206 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct _opaque_pthread_rwlockattr_t { + * long __sig; + * char __opaque[16]; + * } + * } + */ +public class _opaque_pthread_rwlockattr_t { + + _opaque_pthread_rwlockattr_t() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_LONG.withName("__sig"), + MemoryLayout.sequenceLayout(16, somelib_h.C_CHAR).withName("__opaque") + ).withName("_opaque_pthread_rwlockattr_t"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong __sig$LAYOUT = (OfLong)$LAYOUT.select(groupElement("__sig")); + + /** + * Layout for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static final OfLong __sig$layout() { + return __sig$LAYOUT; + } + + private static final long __sig$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static final long __sig$offset() { + return __sig$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static long __sig(MemorySegment struct) { + return struct.get(__sig$LAYOUT, __sig$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static void __sig(MemorySegment struct, long fieldValue) { + struct.set(__sig$LAYOUT, __sig$OFFSET, fieldValue); + } + + private static final SequenceLayout __opaque$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("__opaque")); + + /** + * Layout for field: + * {@snippet lang=c : + * char __opaque[16] + * } + */ + public static final SequenceLayout __opaque$layout() { + return __opaque$LAYOUT; + } + + private static final long __opaque$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * char __opaque[16] + * } + */ + public static final long __opaque$offset() { + return __opaque$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * char __opaque[16] + * } + */ + public static MemorySegment __opaque(MemorySegment struct) { + return struct.asSlice(__opaque$OFFSET, __opaque$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * char __opaque[16] + * } + */ + public static void __opaque(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, __opaque$OFFSET, __opaque$LAYOUT.byteSize()); + } + + private static long[] __opaque$DIMS = { 16 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * char __opaque[16] + * } + */ + public static long[] __opaque$dimensions() { + return __opaque$DIMS; + } + private static final VarHandle __opaque$ELEM_HANDLE = __opaque$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * char __opaque[16] + * } + */ + public static byte __opaque(MemorySegment struct, long index0) { + return (byte)__opaque$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * char __opaque[16] + * } + */ + public static void __opaque(MemorySegment struct, long index0, byte fieldValue) { + __opaque$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_t.java new file mode 100644 index 000000000..1fe6ceda3 --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_t.java @@ -0,0 +1,252 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct _opaque_pthread_t { + * long __sig; + * struct __darwin_pthread_handler_rec *__cleanup_stack; + * char __opaque[8176]; + * } + * } + */ +public class _opaque_pthread_t { + + _opaque_pthread_t() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_LONG.withName("__sig"), + somelib_h.C_POINTER.withName("__cleanup_stack"), + MemoryLayout.sequenceLayout(8176, somelib_h.C_CHAR).withName("__opaque") + ).withName("_opaque_pthread_t"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong __sig$LAYOUT = (OfLong)$LAYOUT.select(groupElement("__sig")); + + /** + * Layout for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static final OfLong __sig$layout() { + return __sig$LAYOUT; + } + + private static final long __sig$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static final long __sig$offset() { + return __sig$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static long __sig(MemorySegment struct) { + return struct.get(__sig$LAYOUT, __sig$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * long __sig + * } + */ + public static void __sig(MemorySegment struct, long fieldValue) { + struct.set(__sig$LAYOUT, __sig$OFFSET, fieldValue); + } + + private static final AddressLayout __cleanup_stack$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("__cleanup_stack")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct __darwin_pthread_handler_rec *__cleanup_stack + * } + */ + public static final AddressLayout __cleanup_stack$layout() { + return __cleanup_stack$LAYOUT; + } + + private static final long __cleanup_stack$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * struct __darwin_pthread_handler_rec *__cleanup_stack + * } + */ + public static final long __cleanup_stack$offset() { + return __cleanup_stack$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct __darwin_pthread_handler_rec *__cleanup_stack + * } + */ + public static MemorySegment __cleanup_stack(MemorySegment struct) { + return struct.get(__cleanup_stack$LAYOUT, __cleanup_stack$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct __darwin_pthread_handler_rec *__cleanup_stack + * } + */ + public static void __cleanup_stack(MemorySegment struct, MemorySegment fieldValue) { + struct.set(__cleanup_stack$LAYOUT, __cleanup_stack$OFFSET, fieldValue); + } + + private static final SequenceLayout __opaque$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("__opaque")); + + /** + * Layout for field: + * {@snippet lang=c : + * char __opaque[8176] + * } + */ + public static final SequenceLayout __opaque$layout() { + return __opaque$LAYOUT; + } + + private static final long __opaque$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * char __opaque[8176] + * } + */ + public static final long __opaque$offset() { + return __opaque$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * char __opaque[8176] + * } + */ + public static MemorySegment __opaque(MemorySegment struct) { + return struct.asSlice(__opaque$OFFSET, __opaque$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * char __opaque[8176] + * } + */ + public static void __opaque(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, __opaque$OFFSET, __opaque$LAYOUT.byteSize()); + } + + private static long[] __opaque$DIMS = { 8176 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * char __opaque[8176] + * } + */ + public static long[] __opaque$dimensions() { + return __opaque$DIMS; + } + private static final VarHandle __opaque$ELEM_HANDLE = __opaque$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * char __opaque[8176] + * } + */ + public static byte __opaque(MemorySegment struct, long index0) { + return (byte)__opaque$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * char __opaque[8176] + * } + */ + public static void __opaque(MemorySegment struct, long index0, byte fieldValue) { + __opaque$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/fd_set.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/fd_set.java new file mode 100644 index 000000000..618dad751 --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/fd_set.java @@ -0,0 +1,160 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct fd_set { + * __int32_t fds_bits[32]; + * } + * } + */ +public class fd_set { + + fd_set() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.sequenceLayout(32, somelib_h.C_INT).withName("fds_bits") + ).withName("fd_set"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final SequenceLayout fds_bits$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("fds_bits")); + + /** + * Layout for field: + * {@snippet lang=c : + * __int32_t fds_bits[32] + * } + */ + public static final SequenceLayout fds_bits$layout() { + return fds_bits$LAYOUT; + } + + private static final long fds_bits$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * __int32_t fds_bits[32] + * } + */ + public static final long fds_bits$offset() { + return fds_bits$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * __int32_t fds_bits[32] + * } + */ + public static MemorySegment fds_bits(MemorySegment struct) { + return struct.asSlice(fds_bits$OFFSET, fds_bits$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * __int32_t fds_bits[32] + * } + */ + public static void fds_bits(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, fds_bits$OFFSET, fds_bits$LAYOUT.byteSize()); + } + + private static long[] fds_bits$DIMS = { 32 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * __int32_t fds_bits[32] + * } + */ + public static long[] fds_bits$dimensions() { + return fds_bits$DIMS; + } + private static final VarHandle fds_bits$ELEM_HANDLE = fds_bits$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * __int32_t fds_bits[32] + * } + */ + public static int fds_bits(MemorySegment struct, long index0) { + return (int)fds_bits$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * __int32_t fds_bits[32] + * } + */ + public static void fds_bits(MemorySegment struct, long index0, int fieldValue) { + fds_bits$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/funopen$x0.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/funopen$x0.java new file mode 100644 index 000000000..1afd8820d --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/funopen$x0.java @@ -0,0 +1,70 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * int (* _Nullable)(void *, char *, int) + * } + */ +public class funopen$x0 { + + funopen$x0() { + // Should not be called directly + } + + /** + * The function pointer signature, expressed as a functional interface + */ + public interface Function { + int apply(MemorySegment _x0, MemorySegment _x1, int _x2); + } + + private static final FunctionDescriptor $DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_INT + ); + + /** + * The descriptor of this function pointer + */ + public static FunctionDescriptor descriptor() { + return $DESC; + } + + private static final MethodHandle UP$MH = somelib_h.upcallHandle(funopen$x0.Function.class, "apply", $DESC); + + /** + * Allocates a new upcall stub, whose implementation is defined by {@code fi}. + * The lifetime of the returned segment is managed by {@code arena} + */ + public static MemorySegment allocate(funopen$x0.Function fi, Arena arena) { + return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena); + } + + private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC); + + /** + * Invoke the upcall stub {@code funcPtr}, with given parameters + */ + public static int invoke(MemorySegment funcPtr,MemorySegment _x0, MemorySegment _x1, int _x2) { + try { + return (int) DOWN$MH.invokeExact(funcPtr, _x0, _x1, _x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/funopen$x1.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/funopen$x1.java new file mode 100644 index 000000000..3dca88784 --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/funopen$x1.java @@ -0,0 +1,70 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * int (* _Nullable)(void *, const char *, int) + * } + */ +public class funopen$x1 { + + funopen$x1() { + // Should not be called directly + } + + /** + * The function pointer signature, expressed as a functional interface + */ + public interface Function { + int apply(MemorySegment _x0, MemorySegment _x1, int _x2); + } + + private static final FunctionDescriptor $DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_INT + ); + + /** + * The descriptor of this function pointer + */ + public static FunctionDescriptor descriptor() { + return $DESC; + } + + private static final MethodHandle UP$MH = somelib_h.upcallHandle(funopen$x1.Function.class, "apply", $DESC); + + /** + * Allocates a new upcall stub, whose implementation is defined by {@code fi}. + * The lifetime of the returned segment is managed by {@code arena} + */ + public static MemorySegment allocate(funopen$x1.Function fi, Arena arena) { + return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena); + } + + private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC); + + /** + * Invoke the upcall stub {@code funcPtr}, with given parameters + */ + public static int invoke(MemorySegment funcPtr,MemorySegment _x0, MemorySegment _x1, int _x2) { + try { + return (int) DOWN$MH.invokeExact(funcPtr, _x0, _x1, _x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/funopen$x2.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/funopen$x2.java new file mode 100644 index 000000000..0fe263b6a --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/funopen$x2.java @@ -0,0 +1,70 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * fpos_t (* _Nullable)(void *, fpos_t, int) + * } + */ +public class funopen$x2 { + + funopen$x2() { + // Should not be called directly + } + + /** + * The function pointer signature, expressed as a functional interface + */ + public interface Function { + long apply(MemorySegment _x0, long _x1, int _x2); + } + + private static final FunctionDescriptor $DESC = FunctionDescriptor.of( + somelib_h.C_LONG_LONG, + somelib_h.C_POINTER, + somelib_h.C_LONG_LONG, + somelib_h.C_INT + ); + + /** + * The descriptor of this function pointer + */ + public static FunctionDescriptor descriptor() { + return $DESC; + } + + private static final MethodHandle UP$MH = somelib_h.upcallHandle(funopen$x2.Function.class, "apply", $DESC); + + /** + * Allocates a new upcall stub, whose implementation is defined by {@code fi}. + * The lifetime of the returned segment is managed by {@code arena} + */ + public static MemorySegment allocate(funopen$x2.Function fi, Arena arena) { + return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena); + } + + private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC); + + /** + * Invoke the upcall stub {@code funcPtr}, with given parameters + */ + public static long invoke(MemorySegment funcPtr,MemorySegment _x0, long _x1, int _x2) { + try { + return (long) DOWN$MH.invokeExact(funcPtr, _x0, _x1, _x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/funopen$x3.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/funopen$x3.java new file mode 100644 index 000000000..dd516ce4c --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/funopen$x3.java @@ -0,0 +1,68 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * int (* _Nullable)(void *) + * } + */ +public class funopen$x3 { + + funopen$x3() { + // Should not be called directly + } + + /** + * The function pointer signature, expressed as a functional interface + */ + public interface Function { + int apply(MemorySegment _x0); + } + + private static final FunctionDescriptor $DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + /** + * The descriptor of this function pointer + */ + public static FunctionDescriptor descriptor() { + return $DESC; + } + + private static final MethodHandle UP$MH = somelib_h.upcallHandle(funopen$x3.Function.class, "apply", $DESC); + + /** + * Allocates a new upcall stub, whose implementation is defined by {@code fi}. + * The lifetime of the returned segment is managed by {@code arena} + */ + public static MemorySegment allocate(funopen$x3.Function fi, Arena arena) { + return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena); + } + + private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC); + + /** + * Invoke the upcall stub {@code funcPtr}, with given parameters + */ + public static int invoke(MemorySegment funcPtr,MemorySegment _x0) { + try { + return (int) DOWN$MH.invokeExact(funcPtr, _x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_attr_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_attr_t.java new file mode 100644 index 000000000..e4bfe4bbf --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_attr_t.java @@ -0,0 +1,26 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef __darwin_pthread_attr_t pthread_attr_t + * } + */ +public class pthread_attr_t extends _opaque_pthread_attr_t { + + pthread_attr_t() { + // Should not be called directly + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_cond_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_cond_t.java new file mode 100644 index 000000000..ad8ee80cb --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_cond_t.java @@ -0,0 +1,26 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef __darwin_pthread_cond_t pthread_cond_t + * } + */ +public class pthread_cond_t extends _opaque_pthread_cond_t { + + pthread_cond_t() { + // Should not be called directly + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_condattr_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_condattr_t.java new file mode 100644 index 000000000..b3b04c732 --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_condattr_t.java @@ -0,0 +1,26 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef __darwin_pthread_condattr_t pthread_condattr_t + * } + */ +public class pthread_condattr_t extends _opaque_pthread_condattr_t { + + pthread_condattr_t() { + // Should not be called directly + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_mutex_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_mutex_t.java new file mode 100644 index 000000000..41e191b4b --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_mutex_t.java @@ -0,0 +1,26 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef __darwin_pthread_mutex_t pthread_mutex_t + * } + */ +public class pthread_mutex_t extends _opaque_pthread_mutex_t { + + pthread_mutex_t() { + // Should not be called directly + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_mutexattr_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_mutexattr_t.java new file mode 100644 index 000000000..f7bb8b17d --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_mutexattr_t.java @@ -0,0 +1,26 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef __darwin_pthread_mutexattr_t pthread_mutexattr_t + * } + */ +public class pthread_mutexattr_t extends _opaque_pthread_mutexattr_t { + + pthread_mutexattr_t() { + // Should not be called directly + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_once_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_once_t.java new file mode 100644 index 000000000..cc2bf572b --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_once_t.java @@ -0,0 +1,26 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef __darwin_pthread_once_t pthread_once_t + * } + */ +public class pthread_once_t extends _opaque_pthread_once_t { + + pthread_once_t() { + // Should not be called directly + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_rwlock_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_rwlock_t.java new file mode 100644 index 000000000..4e774a4c2 --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_rwlock_t.java @@ -0,0 +1,26 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef __darwin_pthread_rwlock_t pthread_rwlock_t + * } + */ +public class pthread_rwlock_t extends _opaque_pthread_rwlock_t { + + pthread_rwlock_t() { + // Should not be called directly + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_rwlockattr_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_rwlockattr_t.java new file mode 100644 index 000000000..a674c0acf --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_rwlockattr_t.java @@ -0,0 +1,26 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef __darwin_pthread_rwlockattr_t pthread_rwlockattr_t + * } + */ +public class pthread_rwlockattr_t extends _opaque_pthread_rwlockattr_t { + + pthread_rwlockattr_t() { + // Should not be called directly + } +} + diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java new file mode 100644 index 000000000..9683d5616 --- /dev/null +++ b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java @@ -0,0 +1,12136 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +public class somelib_h { + + somelib_h() { + // Should not be called directly + } + + static final Arena LIBRARY_ARENA = Arena.ofAuto(); + static final boolean TRACE_DOWNCALLS = Boolean.getBoolean("jextract.trace.downcalls"); + + static void traceDowncall(String name, Object... args) { + String traceArgs = Arrays.stream(args) + .map(Object::toString) + .collect(Collectors.joining(", ")); + System.out.printf("%s(%s)\n", name, traceArgs); + } + + static MemorySegment findOrThrow(String symbol) { + return SYMBOL_LOOKUP.find(symbol) + .orElseThrow(() -> new UnsatisfiedLinkError("unresolved symbol: " + symbol)); + } + + static MethodHandle upcallHandle(Class fi, String name, FunctionDescriptor fdesc) { + try { + return MethodHandles.lookup().findVirtual(fi, name, fdesc.toMethodType()); + } catch (ReflectiveOperationException ex) { + throw new AssertionError(ex); + } + } + + static MemoryLayout align(MemoryLayout layout, long align) { + return switch (layout) { + case PaddingLayout p -> p; + case ValueLayout v -> v.withByteAlignment(align); + case GroupLayout g -> { + MemoryLayout[] alignedMembers = g.memberLayouts().stream() + .map(m -> align(m, align)).toArray(MemoryLayout[]::new); + yield g instanceof StructLayout ? + MemoryLayout.structLayout(alignedMembers) : MemoryLayout.unionLayout(alignedMembers); + } + case SequenceLayout s -> MemoryLayout.sequenceLayout(s.elementCount(), align(s.elementLayout(), align)); + }; + } + + static final SymbolLookup SYMBOL_LOOKUP = SymbolLookup.libraryLookup(System.mapLibraryName("somelib"), LIBRARY_ARENA) + .or(SymbolLookup.loaderLookup()) + .or(Linker.nativeLinker().defaultLookup()); + + public static final ValueLayout.OfBoolean C_BOOL = ValueLayout.JAVA_BOOLEAN; + public static final ValueLayout.OfByte C_CHAR = ValueLayout.JAVA_BYTE; + public static final ValueLayout.OfShort C_SHORT = ValueLayout.JAVA_SHORT; + public static final ValueLayout.OfInt C_INT = ValueLayout.JAVA_INT; + public static final ValueLayout.OfLong C_LONG_LONG = ValueLayout.JAVA_LONG; + public static final ValueLayout.OfFloat C_FLOAT = ValueLayout.JAVA_FLOAT; + public static final ValueLayout.OfDouble C_DOUBLE = ValueLayout.JAVA_DOUBLE; + public static final AddressLayout C_POINTER = ValueLayout.ADDRESS + .withTargetLayout(MemoryLayout.sequenceLayout(java.lang.Long.MAX_VALUE, JAVA_BYTE)); + public static final ValueLayout.OfLong C_LONG = ValueLayout.JAVA_LONG; + private static final int __has_safe_buffers = (int)0L; + /** + * {@snippet lang=c : + * #define __has_safe_buffers 0 + * } + */ + public static int __has_safe_buffers() { + return __has_safe_buffers; + } + private static final int __DARWIN_ONLY_64_BIT_INO_T = (int)1L; + /** + * {@snippet lang=c : + * #define __DARWIN_ONLY_64_BIT_INO_T 1 + * } + */ + public static int __DARWIN_ONLY_64_BIT_INO_T() { + return __DARWIN_ONLY_64_BIT_INO_T; + } + private static final int __DARWIN_ONLY_UNIX_CONFORMANCE = (int)1L; + /** + * {@snippet lang=c : + * #define __DARWIN_ONLY_UNIX_CONFORMANCE 1 + * } + */ + public static int __DARWIN_ONLY_UNIX_CONFORMANCE() { + return __DARWIN_ONLY_UNIX_CONFORMANCE; + } + private static final int __DARWIN_ONLY_VERS_1050 = (int)1L; + /** + * {@snippet lang=c : + * #define __DARWIN_ONLY_VERS_1050 1 + * } + */ + public static int __DARWIN_ONLY_VERS_1050() { + return __DARWIN_ONLY_VERS_1050; + } + private static final int __DARWIN_UNIX03 = (int)1L; + /** + * {@snippet lang=c : + * #define __DARWIN_UNIX03 1 + * } + */ + public static int __DARWIN_UNIX03() { + return __DARWIN_UNIX03; + } + private static final int __DARWIN_64_BIT_INO_T = (int)1L; + /** + * {@snippet lang=c : + * #define __DARWIN_64_BIT_INO_T 1 + * } + */ + public static int __DARWIN_64_BIT_INO_T() { + return __DARWIN_64_BIT_INO_T; + } + private static final int __DARWIN_VERS_1050 = (int)1L; + /** + * {@snippet lang=c : + * #define __DARWIN_VERS_1050 1 + * } + */ + public static int __DARWIN_VERS_1050() { + return __DARWIN_VERS_1050; + } + private static final int __DARWIN_NON_CANCELABLE = (int)0L; + /** + * {@snippet lang=c : + * #define __DARWIN_NON_CANCELABLE 0 + * } + */ + public static int __DARWIN_NON_CANCELABLE() { + return __DARWIN_NON_CANCELABLE; + } + private static final int __STDC_WANT_LIB_EXT1__ = (int)1L; + /** + * {@snippet lang=c : + * #define __STDC_WANT_LIB_EXT1__ 1 + * } + */ + public static int __STDC_WANT_LIB_EXT1__() { + return __STDC_WANT_LIB_EXT1__; + } + private static final int __DARWIN_NO_LONG_LONG = (int)0L; + /** + * {@snippet lang=c : + * #define __DARWIN_NO_LONG_LONG 0 + * } + */ + public static int __DARWIN_NO_LONG_LONG() { + return __DARWIN_NO_LONG_LONG; + } + private static final int _DARWIN_FEATURE_64_BIT_INODE = (int)1L; + /** + * {@snippet lang=c : + * #define _DARWIN_FEATURE_64_BIT_INODE 1 + * } + */ + public static int _DARWIN_FEATURE_64_BIT_INODE() { + return _DARWIN_FEATURE_64_BIT_INODE; + } + private static final int _DARWIN_FEATURE_ONLY_64_BIT_INODE = (int)1L; + /** + * {@snippet lang=c : + * #define _DARWIN_FEATURE_ONLY_64_BIT_INODE 1 + * } + */ + public static int _DARWIN_FEATURE_ONLY_64_BIT_INODE() { + return _DARWIN_FEATURE_ONLY_64_BIT_INODE; + } + private static final int _DARWIN_FEATURE_ONLY_VERS_1050 = (int)1L; + /** + * {@snippet lang=c : + * #define _DARWIN_FEATURE_ONLY_VERS_1050 1 + * } + */ + public static int _DARWIN_FEATURE_ONLY_VERS_1050() { + return _DARWIN_FEATURE_ONLY_VERS_1050; + } + private static final int _DARWIN_FEATURE_ONLY_UNIX_CONFORMANCE = (int)1L; + /** + * {@snippet lang=c : + * #define _DARWIN_FEATURE_ONLY_UNIX_CONFORMANCE 1 + * } + */ + public static int _DARWIN_FEATURE_ONLY_UNIX_CONFORMANCE() { + return _DARWIN_FEATURE_ONLY_UNIX_CONFORMANCE; + } + private static final int _DARWIN_FEATURE_UNIX_CONFORMANCE = (int)3L; + /** + * {@snippet lang=c : + * #define _DARWIN_FEATURE_UNIX_CONFORMANCE 3 + * } + */ + public static int _DARWIN_FEATURE_UNIX_CONFORMANCE() { + return _DARWIN_FEATURE_UNIX_CONFORMANCE; + } + private static final int __has_ptrcheck = (int)0L; + /** + * {@snippet lang=c : + * #define __has_ptrcheck 0 + * } + */ + public static int __has_ptrcheck() { + return __has_ptrcheck; + } + private static final int __API_TO_BE_DEPRECATED = (int)100000L; + /** + * {@snippet lang=c : + * #define __API_TO_BE_DEPRECATED 100000 + * } + */ + public static int __API_TO_BE_DEPRECATED() { + return __API_TO_BE_DEPRECATED; + } + private static final int __API_TO_BE_DEPRECATED_MACOS = (int)100000L; + /** + * {@snippet lang=c : + * #define __API_TO_BE_DEPRECATED_MACOS 100000 + * } + */ + public static int __API_TO_BE_DEPRECATED_MACOS() { + return __API_TO_BE_DEPRECATED_MACOS; + } + private static final int __API_TO_BE_DEPRECATED_IOS = (int)100000L; + /** + * {@snippet lang=c : + * #define __API_TO_BE_DEPRECATED_IOS 100000 + * } + */ + public static int __API_TO_BE_DEPRECATED_IOS() { + return __API_TO_BE_DEPRECATED_IOS; + } + private static final int __API_TO_BE_DEPRECATED_MACCATALYST = (int)100000L; + /** + * {@snippet lang=c : + * #define __API_TO_BE_DEPRECATED_MACCATALYST 100000 + * } + */ + public static int __API_TO_BE_DEPRECATED_MACCATALYST() { + return __API_TO_BE_DEPRECATED_MACCATALYST; + } + private static final int __API_TO_BE_DEPRECATED_WATCHOS = (int)100000L; + /** + * {@snippet lang=c : + * #define __API_TO_BE_DEPRECATED_WATCHOS 100000 + * } + */ + public static int __API_TO_BE_DEPRECATED_WATCHOS() { + return __API_TO_BE_DEPRECATED_WATCHOS; + } + private static final int __API_TO_BE_DEPRECATED_TVOS = (int)100000L; + /** + * {@snippet lang=c : + * #define __API_TO_BE_DEPRECATED_TVOS 100000 + * } + */ + public static int __API_TO_BE_DEPRECATED_TVOS() { + return __API_TO_BE_DEPRECATED_TVOS; + } + private static final int __API_TO_BE_DEPRECATED_DRIVERKIT = (int)100000L; + /** + * {@snippet lang=c : + * #define __API_TO_BE_DEPRECATED_DRIVERKIT 100000 + * } + */ + public static int __API_TO_BE_DEPRECATED_DRIVERKIT() { + return __API_TO_BE_DEPRECATED_DRIVERKIT; + } + private static final int __API_TO_BE_DEPRECATED_VISIONOS = (int)100000L; + /** + * {@snippet lang=c : + * #define __API_TO_BE_DEPRECATED_VISIONOS 100000 + * } + */ + public static int __API_TO_BE_DEPRECATED_VISIONOS() { + return __API_TO_BE_DEPRECATED_VISIONOS; + } + private static final int __MAC_10_0 = (int)1000L; + /** + * {@snippet lang=c : + * #define __MAC_10_0 1000 + * } + */ + public static int __MAC_10_0() { + return __MAC_10_0; + } + private static final int __MAC_10_1 = (int)1010L; + /** + * {@snippet lang=c : + * #define __MAC_10_1 1010 + * } + */ + public static int __MAC_10_1() { + return __MAC_10_1; + } + private static final int __MAC_10_2 = (int)1020L; + /** + * {@snippet lang=c : + * #define __MAC_10_2 1020 + * } + */ + public static int __MAC_10_2() { + return __MAC_10_2; + } + private static final int __MAC_10_3 = (int)1030L; + /** + * {@snippet lang=c : + * #define __MAC_10_3 1030 + * } + */ + public static int __MAC_10_3() { + return __MAC_10_3; + } + private static final int __MAC_10_4 = (int)1040L; + /** + * {@snippet lang=c : + * #define __MAC_10_4 1040 + * } + */ + public static int __MAC_10_4() { + return __MAC_10_4; + } + private static final int __MAC_10_5 = (int)1050L; + /** + * {@snippet lang=c : + * #define __MAC_10_5 1050 + * } + */ + public static int __MAC_10_5() { + return __MAC_10_5; + } + private static final int __MAC_10_6 = (int)1060L; + /** + * {@snippet lang=c : + * #define __MAC_10_6 1060 + * } + */ + public static int __MAC_10_6() { + return __MAC_10_6; + } + private static final int __MAC_10_7 = (int)1070L; + /** + * {@snippet lang=c : + * #define __MAC_10_7 1070 + * } + */ + public static int __MAC_10_7() { + return __MAC_10_7; + } + private static final int __MAC_10_8 = (int)1080L; + /** + * {@snippet lang=c : + * #define __MAC_10_8 1080 + * } + */ + public static int __MAC_10_8() { + return __MAC_10_8; + } + private static final int __MAC_10_9 = (int)1090L; + /** + * {@snippet lang=c : + * #define __MAC_10_9 1090 + * } + */ + public static int __MAC_10_9() { + return __MAC_10_9; + } + private static final int __MAC_10_10 = (int)101000L; + /** + * {@snippet lang=c : + * #define __MAC_10_10 101000 + * } + */ + public static int __MAC_10_10() { + return __MAC_10_10; + } + private static final int __MAC_10_10_2 = (int)101002L; + /** + * {@snippet lang=c : + * #define __MAC_10_10_2 101002 + * } + */ + public static int __MAC_10_10_2() { + return __MAC_10_10_2; + } + private static final int __MAC_10_10_3 = (int)101003L; + /** + * {@snippet lang=c : + * #define __MAC_10_10_3 101003 + * } + */ + public static int __MAC_10_10_3() { + return __MAC_10_10_3; + } + private static final int __MAC_10_11 = (int)101100L; + /** + * {@snippet lang=c : + * #define __MAC_10_11 101100 + * } + */ + public static int __MAC_10_11() { + return __MAC_10_11; + } + private static final int __MAC_10_11_2 = (int)101102L; + /** + * {@snippet lang=c : + * #define __MAC_10_11_2 101102 + * } + */ + public static int __MAC_10_11_2() { + return __MAC_10_11_2; + } + private static final int __MAC_10_11_3 = (int)101103L; + /** + * {@snippet lang=c : + * #define __MAC_10_11_3 101103 + * } + */ + public static int __MAC_10_11_3() { + return __MAC_10_11_3; + } + private static final int __MAC_10_11_4 = (int)101104L; + /** + * {@snippet lang=c : + * #define __MAC_10_11_4 101104 + * } + */ + public static int __MAC_10_11_4() { + return __MAC_10_11_4; + } + private static final int __MAC_10_12 = (int)101200L; + /** + * {@snippet lang=c : + * #define __MAC_10_12 101200 + * } + */ + public static int __MAC_10_12() { + return __MAC_10_12; + } + private static final int __MAC_10_12_1 = (int)101201L; + /** + * {@snippet lang=c : + * #define __MAC_10_12_1 101201 + * } + */ + public static int __MAC_10_12_1() { + return __MAC_10_12_1; + } + private static final int __MAC_10_12_2 = (int)101202L; + /** + * {@snippet lang=c : + * #define __MAC_10_12_2 101202 + * } + */ + public static int __MAC_10_12_2() { + return __MAC_10_12_2; + } + private static final int __MAC_10_12_4 = (int)101204L; + /** + * {@snippet lang=c : + * #define __MAC_10_12_4 101204 + * } + */ + public static int __MAC_10_12_4() { + return __MAC_10_12_4; + } + private static final int __MAC_10_13 = (int)101300L; + /** + * {@snippet lang=c : + * #define __MAC_10_13 101300 + * } + */ + public static int __MAC_10_13() { + return __MAC_10_13; + } + private static final int __MAC_10_13_1 = (int)101301L; + /** + * {@snippet lang=c : + * #define __MAC_10_13_1 101301 + * } + */ + public static int __MAC_10_13_1() { + return __MAC_10_13_1; + } + private static final int __MAC_10_13_2 = (int)101302L; + /** + * {@snippet lang=c : + * #define __MAC_10_13_2 101302 + * } + */ + public static int __MAC_10_13_2() { + return __MAC_10_13_2; + } + private static final int __MAC_10_13_4 = (int)101304L; + /** + * {@snippet lang=c : + * #define __MAC_10_13_4 101304 + * } + */ + public static int __MAC_10_13_4() { + return __MAC_10_13_4; + } + private static final int __MAC_10_14 = (int)101400L; + /** + * {@snippet lang=c : + * #define __MAC_10_14 101400 + * } + */ + public static int __MAC_10_14() { + return __MAC_10_14; + } + private static final int __MAC_10_14_1 = (int)101401L; + /** + * {@snippet lang=c : + * #define __MAC_10_14_1 101401 + * } + */ + public static int __MAC_10_14_1() { + return __MAC_10_14_1; + } + private static final int __MAC_10_14_4 = (int)101404L; + /** + * {@snippet lang=c : + * #define __MAC_10_14_4 101404 + * } + */ + public static int __MAC_10_14_4() { + return __MAC_10_14_4; + } + private static final int __MAC_10_14_5 = (int)101405L; + /** + * {@snippet lang=c : + * #define __MAC_10_14_5 101405 + * } + */ + public static int __MAC_10_14_5() { + return __MAC_10_14_5; + } + private static final int __MAC_10_14_6 = (int)101406L; + /** + * {@snippet lang=c : + * #define __MAC_10_14_6 101406 + * } + */ + public static int __MAC_10_14_6() { + return __MAC_10_14_6; + } + private static final int __MAC_10_15 = (int)101500L; + /** + * {@snippet lang=c : + * #define __MAC_10_15 101500 + * } + */ + public static int __MAC_10_15() { + return __MAC_10_15; + } + private static final int __MAC_10_15_1 = (int)101501L; + /** + * {@snippet lang=c : + * #define __MAC_10_15_1 101501 + * } + */ + public static int __MAC_10_15_1() { + return __MAC_10_15_1; + } + private static final int __MAC_10_15_4 = (int)101504L; + /** + * {@snippet lang=c : + * #define __MAC_10_15_4 101504 + * } + */ + public static int __MAC_10_15_4() { + return __MAC_10_15_4; + } + private static final int __MAC_10_16 = (int)101600L; + /** + * {@snippet lang=c : + * #define __MAC_10_16 101600 + * } + */ + public static int __MAC_10_16() { + return __MAC_10_16; + } + private static final int __MAC_11_0 = (int)110000L; + /** + * {@snippet lang=c : + * #define __MAC_11_0 110000 + * } + */ + public static int __MAC_11_0() { + return __MAC_11_0; + } + private static final int __MAC_11_1 = (int)110100L; + /** + * {@snippet lang=c : + * #define __MAC_11_1 110100 + * } + */ + public static int __MAC_11_1() { + return __MAC_11_1; + } + private static final int __MAC_11_3 = (int)110300L; + /** + * {@snippet lang=c : + * #define __MAC_11_3 110300 + * } + */ + public static int __MAC_11_3() { + return __MAC_11_3; + } + private static final int __MAC_11_4 = (int)110400L; + /** + * {@snippet lang=c : + * #define __MAC_11_4 110400 + * } + */ + public static int __MAC_11_4() { + return __MAC_11_4; + } + private static final int __MAC_11_5 = (int)110500L; + /** + * {@snippet lang=c : + * #define __MAC_11_5 110500 + * } + */ + public static int __MAC_11_5() { + return __MAC_11_5; + } + private static final int __MAC_11_6 = (int)110600L; + /** + * {@snippet lang=c : + * #define __MAC_11_6 110600 + * } + */ + public static int __MAC_11_6() { + return __MAC_11_6; + } + private static final int __MAC_12_0 = (int)120000L; + /** + * {@snippet lang=c : + * #define __MAC_12_0 120000 + * } + */ + public static int __MAC_12_0() { + return __MAC_12_0; + } + private static final int __MAC_12_1 = (int)120100L; + /** + * {@snippet lang=c : + * #define __MAC_12_1 120100 + * } + */ + public static int __MAC_12_1() { + return __MAC_12_1; + } + private static final int __MAC_12_2 = (int)120200L; + /** + * {@snippet lang=c : + * #define __MAC_12_2 120200 + * } + */ + public static int __MAC_12_2() { + return __MAC_12_2; + } + private static final int __MAC_12_3 = (int)120300L; + /** + * {@snippet lang=c : + * #define __MAC_12_3 120300 + * } + */ + public static int __MAC_12_3() { + return __MAC_12_3; + } + private static final int __MAC_12_4 = (int)120400L; + /** + * {@snippet lang=c : + * #define __MAC_12_4 120400 + * } + */ + public static int __MAC_12_4() { + return __MAC_12_4; + } + private static final int __MAC_12_5 = (int)120500L; + /** + * {@snippet lang=c : + * #define __MAC_12_5 120500 + * } + */ + public static int __MAC_12_5() { + return __MAC_12_5; + } + private static final int __MAC_12_6 = (int)120600L; + /** + * {@snippet lang=c : + * #define __MAC_12_6 120600 + * } + */ + public static int __MAC_12_6() { + return __MAC_12_6; + } + private static final int __MAC_12_7 = (int)120700L; + /** + * {@snippet lang=c : + * #define __MAC_12_7 120700 + * } + */ + public static int __MAC_12_7() { + return __MAC_12_7; + } + private static final int __MAC_13_0 = (int)130000L; + /** + * {@snippet lang=c : + * #define __MAC_13_0 130000 + * } + */ + public static int __MAC_13_0() { + return __MAC_13_0; + } + private static final int __MAC_13_1 = (int)130100L; + /** + * {@snippet lang=c : + * #define __MAC_13_1 130100 + * } + */ + public static int __MAC_13_1() { + return __MAC_13_1; + } + private static final int __MAC_13_2 = (int)130200L; + /** + * {@snippet lang=c : + * #define __MAC_13_2 130200 + * } + */ + public static int __MAC_13_2() { + return __MAC_13_2; + } + private static final int __MAC_13_3 = (int)130300L; + /** + * {@snippet lang=c : + * #define __MAC_13_3 130300 + * } + */ + public static int __MAC_13_3() { + return __MAC_13_3; + } + private static final int __MAC_13_4 = (int)130400L; + /** + * {@snippet lang=c : + * #define __MAC_13_4 130400 + * } + */ + public static int __MAC_13_4() { + return __MAC_13_4; + } + private static final int __MAC_13_5 = (int)130500L; + /** + * {@snippet lang=c : + * #define __MAC_13_5 130500 + * } + */ + public static int __MAC_13_5() { + return __MAC_13_5; + } + private static final int __MAC_13_6 = (int)130600L; + /** + * {@snippet lang=c : + * #define __MAC_13_6 130600 + * } + */ + public static int __MAC_13_6() { + return __MAC_13_6; + } + private static final int __MAC_14_0 = (int)140000L; + /** + * {@snippet lang=c : + * #define __MAC_14_0 140000 + * } + */ + public static int __MAC_14_0() { + return __MAC_14_0; + } + private static final int __MAC_14_1 = (int)140100L; + /** + * {@snippet lang=c : + * #define __MAC_14_1 140100 + * } + */ + public static int __MAC_14_1() { + return __MAC_14_1; + } + private static final int __MAC_14_2 = (int)140200L; + /** + * {@snippet lang=c : + * #define __MAC_14_2 140200 + * } + */ + public static int __MAC_14_2() { + return __MAC_14_2; + } + private static final int __MAC_14_3 = (int)140300L; + /** + * {@snippet lang=c : + * #define __MAC_14_3 140300 + * } + */ + public static int __MAC_14_3() { + return __MAC_14_3; + } + private static final int __MAC_14_4 = (int)140400L; + /** + * {@snippet lang=c : + * #define __MAC_14_4 140400 + * } + */ + public static int __MAC_14_4() { + return __MAC_14_4; + } + private static final int __MAC_14_5 = (int)140500L; + /** + * {@snippet lang=c : + * #define __MAC_14_5 140500 + * } + */ + public static int __MAC_14_5() { + return __MAC_14_5; + } + private static final int __IPHONE_2_0 = (int)20000L; + /** + * {@snippet lang=c : + * #define __IPHONE_2_0 20000 + * } + */ + public static int __IPHONE_2_0() { + return __IPHONE_2_0; + } + private static final int __IPHONE_2_1 = (int)20100L; + /** + * {@snippet lang=c : + * #define __IPHONE_2_1 20100 + * } + */ + public static int __IPHONE_2_1() { + return __IPHONE_2_1; + } + private static final int __IPHONE_2_2 = (int)20200L; + /** + * {@snippet lang=c : + * #define __IPHONE_2_2 20200 + * } + */ + public static int __IPHONE_2_2() { + return __IPHONE_2_2; + } + private static final int __IPHONE_3_0 = (int)30000L; + /** + * {@snippet lang=c : + * #define __IPHONE_3_0 30000 + * } + */ + public static int __IPHONE_3_0() { + return __IPHONE_3_0; + } + private static final int __IPHONE_3_1 = (int)30100L; + /** + * {@snippet lang=c : + * #define __IPHONE_3_1 30100 + * } + */ + public static int __IPHONE_3_1() { + return __IPHONE_3_1; + } + private static final int __IPHONE_3_2 = (int)30200L; + /** + * {@snippet lang=c : + * #define __IPHONE_3_2 30200 + * } + */ + public static int __IPHONE_3_2() { + return __IPHONE_3_2; + } + private static final int __IPHONE_4_0 = (int)40000L; + /** + * {@snippet lang=c : + * #define __IPHONE_4_0 40000 + * } + */ + public static int __IPHONE_4_0() { + return __IPHONE_4_0; + } + private static final int __IPHONE_4_1 = (int)40100L; + /** + * {@snippet lang=c : + * #define __IPHONE_4_1 40100 + * } + */ + public static int __IPHONE_4_1() { + return __IPHONE_4_1; + } + private static final int __IPHONE_4_2 = (int)40200L; + /** + * {@snippet lang=c : + * #define __IPHONE_4_2 40200 + * } + */ + public static int __IPHONE_4_2() { + return __IPHONE_4_2; + } + private static final int __IPHONE_4_3 = (int)40300L; + /** + * {@snippet lang=c : + * #define __IPHONE_4_3 40300 + * } + */ + public static int __IPHONE_4_3() { + return __IPHONE_4_3; + } + private static final int __IPHONE_5_0 = (int)50000L; + /** + * {@snippet lang=c : + * #define __IPHONE_5_0 50000 + * } + */ + public static int __IPHONE_5_0() { + return __IPHONE_5_0; + } + private static final int __IPHONE_5_1 = (int)50100L; + /** + * {@snippet lang=c : + * #define __IPHONE_5_1 50100 + * } + */ + public static int __IPHONE_5_1() { + return __IPHONE_5_1; + } + private static final int __IPHONE_6_0 = (int)60000L; + /** + * {@snippet lang=c : + * #define __IPHONE_6_0 60000 + * } + */ + public static int __IPHONE_6_0() { + return __IPHONE_6_0; + } + private static final int __IPHONE_6_1 = (int)60100L; + /** + * {@snippet lang=c : + * #define __IPHONE_6_1 60100 + * } + */ + public static int __IPHONE_6_1() { + return __IPHONE_6_1; + } + private static final int __IPHONE_7_0 = (int)70000L; + /** + * {@snippet lang=c : + * #define __IPHONE_7_0 70000 + * } + */ + public static int __IPHONE_7_0() { + return __IPHONE_7_0; + } + private static final int __IPHONE_7_1 = (int)70100L; + /** + * {@snippet lang=c : + * #define __IPHONE_7_1 70100 + * } + */ + public static int __IPHONE_7_1() { + return __IPHONE_7_1; + } + private static final int __IPHONE_8_0 = (int)80000L; + /** + * {@snippet lang=c : + * #define __IPHONE_8_0 80000 + * } + */ + public static int __IPHONE_8_0() { + return __IPHONE_8_0; + } + private static final int __IPHONE_8_1 = (int)80100L; + /** + * {@snippet lang=c : + * #define __IPHONE_8_1 80100 + * } + */ + public static int __IPHONE_8_1() { + return __IPHONE_8_1; + } + private static final int __IPHONE_8_2 = (int)80200L; + /** + * {@snippet lang=c : + * #define __IPHONE_8_2 80200 + * } + */ + public static int __IPHONE_8_2() { + return __IPHONE_8_2; + } + private static final int __IPHONE_8_3 = (int)80300L; + /** + * {@snippet lang=c : + * #define __IPHONE_8_3 80300 + * } + */ + public static int __IPHONE_8_3() { + return __IPHONE_8_3; + } + private static final int __IPHONE_8_4 = (int)80400L; + /** + * {@snippet lang=c : + * #define __IPHONE_8_4 80400 + * } + */ + public static int __IPHONE_8_4() { + return __IPHONE_8_4; + } + private static final int __IPHONE_9_0 = (int)90000L; + /** + * {@snippet lang=c : + * #define __IPHONE_9_0 90000 + * } + */ + public static int __IPHONE_9_0() { + return __IPHONE_9_0; + } + private static final int __IPHONE_9_1 = (int)90100L; + /** + * {@snippet lang=c : + * #define __IPHONE_9_1 90100 + * } + */ + public static int __IPHONE_9_1() { + return __IPHONE_9_1; + } + private static final int __IPHONE_9_2 = (int)90200L; + /** + * {@snippet lang=c : + * #define __IPHONE_9_2 90200 + * } + */ + public static int __IPHONE_9_2() { + return __IPHONE_9_2; + } + private static final int __IPHONE_9_3 = (int)90300L; + /** + * {@snippet lang=c : + * #define __IPHONE_9_3 90300 + * } + */ + public static int __IPHONE_9_3() { + return __IPHONE_9_3; + } + private static final int __IPHONE_10_0 = (int)100000L; + /** + * {@snippet lang=c : + * #define __IPHONE_10_0 100000 + * } + */ + public static int __IPHONE_10_0() { + return __IPHONE_10_0; + } + private static final int __IPHONE_10_1 = (int)100100L; + /** + * {@snippet lang=c : + * #define __IPHONE_10_1 100100 + * } + */ + public static int __IPHONE_10_1() { + return __IPHONE_10_1; + } + private static final int __IPHONE_10_2 = (int)100200L; + /** + * {@snippet lang=c : + * #define __IPHONE_10_2 100200 + * } + */ + public static int __IPHONE_10_2() { + return __IPHONE_10_2; + } + private static final int __IPHONE_10_3 = (int)100300L; + /** + * {@snippet lang=c : + * #define __IPHONE_10_3 100300 + * } + */ + public static int __IPHONE_10_3() { + return __IPHONE_10_3; + } + private static final int __IPHONE_11_0 = (int)110000L; + /** + * {@snippet lang=c : + * #define __IPHONE_11_0 110000 + * } + */ + public static int __IPHONE_11_0() { + return __IPHONE_11_0; + } + private static final int __IPHONE_11_1 = (int)110100L; + /** + * {@snippet lang=c : + * #define __IPHONE_11_1 110100 + * } + */ + public static int __IPHONE_11_1() { + return __IPHONE_11_1; + } + private static final int __IPHONE_11_2 = (int)110200L; + /** + * {@snippet lang=c : + * #define __IPHONE_11_2 110200 + * } + */ + public static int __IPHONE_11_2() { + return __IPHONE_11_2; + } + private static final int __IPHONE_11_3 = (int)110300L; + /** + * {@snippet lang=c : + * #define __IPHONE_11_3 110300 + * } + */ + public static int __IPHONE_11_3() { + return __IPHONE_11_3; + } + private static final int __IPHONE_11_4 = (int)110400L; + /** + * {@snippet lang=c : + * #define __IPHONE_11_4 110400 + * } + */ + public static int __IPHONE_11_4() { + return __IPHONE_11_4; + } + private static final int __IPHONE_12_0 = (int)120000L; + /** + * {@snippet lang=c : + * #define __IPHONE_12_0 120000 + * } + */ + public static int __IPHONE_12_0() { + return __IPHONE_12_0; + } + private static final int __IPHONE_12_1 = (int)120100L; + /** + * {@snippet lang=c : + * #define __IPHONE_12_1 120100 + * } + */ + public static int __IPHONE_12_1() { + return __IPHONE_12_1; + } + private static final int __IPHONE_12_2 = (int)120200L; + /** + * {@snippet lang=c : + * #define __IPHONE_12_2 120200 + * } + */ + public static int __IPHONE_12_2() { + return __IPHONE_12_2; + } + private static final int __IPHONE_12_3 = (int)120300L; + /** + * {@snippet lang=c : + * #define __IPHONE_12_3 120300 + * } + */ + public static int __IPHONE_12_3() { + return __IPHONE_12_3; + } + private static final int __IPHONE_12_4 = (int)120400L; + /** + * {@snippet lang=c : + * #define __IPHONE_12_4 120400 + * } + */ + public static int __IPHONE_12_4() { + return __IPHONE_12_4; + } + private static final int __IPHONE_13_0 = (int)130000L; + /** + * {@snippet lang=c : + * #define __IPHONE_13_0 130000 + * } + */ + public static int __IPHONE_13_0() { + return __IPHONE_13_0; + } + private static final int __IPHONE_13_1 = (int)130100L; + /** + * {@snippet lang=c : + * #define __IPHONE_13_1 130100 + * } + */ + public static int __IPHONE_13_1() { + return __IPHONE_13_1; + } + private static final int __IPHONE_13_2 = (int)130200L; + /** + * {@snippet lang=c : + * #define __IPHONE_13_2 130200 + * } + */ + public static int __IPHONE_13_2() { + return __IPHONE_13_2; + } + private static final int __IPHONE_13_3 = (int)130300L; + /** + * {@snippet lang=c : + * #define __IPHONE_13_3 130300 + * } + */ + public static int __IPHONE_13_3() { + return __IPHONE_13_3; + } + private static final int __IPHONE_13_4 = (int)130400L; + /** + * {@snippet lang=c : + * #define __IPHONE_13_4 130400 + * } + */ + public static int __IPHONE_13_4() { + return __IPHONE_13_4; + } + private static final int __IPHONE_13_5 = (int)130500L; + /** + * {@snippet lang=c : + * #define __IPHONE_13_5 130500 + * } + */ + public static int __IPHONE_13_5() { + return __IPHONE_13_5; + } + private static final int __IPHONE_13_6 = (int)130600L; + /** + * {@snippet lang=c : + * #define __IPHONE_13_6 130600 + * } + */ + public static int __IPHONE_13_6() { + return __IPHONE_13_6; + } + private static final int __IPHONE_13_7 = (int)130700L; + /** + * {@snippet lang=c : + * #define __IPHONE_13_7 130700 + * } + */ + public static int __IPHONE_13_7() { + return __IPHONE_13_7; + } + private static final int __IPHONE_14_0 = (int)140000L; + /** + * {@snippet lang=c : + * #define __IPHONE_14_0 140000 + * } + */ + public static int __IPHONE_14_0() { + return __IPHONE_14_0; + } + private static final int __IPHONE_14_1 = (int)140100L; + /** + * {@snippet lang=c : + * #define __IPHONE_14_1 140100 + * } + */ + public static int __IPHONE_14_1() { + return __IPHONE_14_1; + } + private static final int __IPHONE_14_2 = (int)140200L; + /** + * {@snippet lang=c : + * #define __IPHONE_14_2 140200 + * } + */ + public static int __IPHONE_14_2() { + return __IPHONE_14_2; + } + private static final int __IPHONE_14_3 = (int)140300L; + /** + * {@snippet lang=c : + * #define __IPHONE_14_3 140300 + * } + */ + public static int __IPHONE_14_3() { + return __IPHONE_14_3; + } + private static final int __IPHONE_14_5 = (int)140500L; + /** + * {@snippet lang=c : + * #define __IPHONE_14_5 140500 + * } + */ + public static int __IPHONE_14_5() { + return __IPHONE_14_5; + } + private static final int __IPHONE_14_4 = (int)140400L; + /** + * {@snippet lang=c : + * #define __IPHONE_14_4 140400 + * } + */ + public static int __IPHONE_14_4() { + return __IPHONE_14_4; + } + private static final int __IPHONE_14_6 = (int)140600L; + /** + * {@snippet lang=c : + * #define __IPHONE_14_6 140600 + * } + */ + public static int __IPHONE_14_6() { + return __IPHONE_14_6; + } + private static final int __IPHONE_14_7 = (int)140700L; + /** + * {@snippet lang=c : + * #define __IPHONE_14_7 140700 + * } + */ + public static int __IPHONE_14_7() { + return __IPHONE_14_7; + } + private static final int __IPHONE_14_8 = (int)140800L; + /** + * {@snippet lang=c : + * #define __IPHONE_14_8 140800 + * } + */ + public static int __IPHONE_14_8() { + return __IPHONE_14_8; + } + private static final int __IPHONE_15_0 = (int)150000L; + /** + * {@snippet lang=c : + * #define __IPHONE_15_0 150000 + * } + */ + public static int __IPHONE_15_0() { + return __IPHONE_15_0; + } + private static final int __IPHONE_15_1 = (int)150100L; + /** + * {@snippet lang=c : + * #define __IPHONE_15_1 150100 + * } + */ + public static int __IPHONE_15_1() { + return __IPHONE_15_1; + } + private static final int __IPHONE_15_2 = (int)150200L; + /** + * {@snippet lang=c : + * #define __IPHONE_15_2 150200 + * } + */ + public static int __IPHONE_15_2() { + return __IPHONE_15_2; + } + private static final int __IPHONE_15_3 = (int)150300L; + /** + * {@snippet lang=c : + * #define __IPHONE_15_3 150300 + * } + */ + public static int __IPHONE_15_3() { + return __IPHONE_15_3; + } + private static final int __IPHONE_15_4 = (int)150400L; + /** + * {@snippet lang=c : + * #define __IPHONE_15_4 150400 + * } + */ + public static int __IPHONE_15_4() { + return __IPHONE_15_4; + } + private static final int __IPHONE_15_5 = (int)150500L; + /** + * {@snippet lang=c : + * #define __IPHONE_15_5 150500 + * } + */ + public static int __IPHONE_15_5() { + return __IPHONE_15_5; + } + private static final int __IPHONE_15_6 = (int)150600L; + /** + * {@snippet lang=c : + * #define __IPHONE_15_6 150600 + * } + */ + public static int __IPHONE_15_6() { + return __IPHONE_15_6; + } + private static final int __IPHONE_15_7 = (int)150700L; + /** + * {@snippet lang=c : + * #define __IPHONE_15_7 150700 + * } + */ + public static int __IPHONE_15_7() { + return __IPHONE_15_7; + } + private static final int __IPHONE_15_8 = (int)150800L; + /** + * {@snippet lang=c : + * #define __IPHONE_15_8 150800 + * } + */ + public static int __IPHONE_15_8() { + return __IPHONE_15_8; + } + private static final int __IPHONE_16_0 = (int)160000L; + /** + * {@snippet lang=c : + * #define __IPHONE_16_0 160000 + * } + */ + public static int __IPHONE_16_0() { + return __IPHONE_16_0; + } + private static final int __IPHONE_16_1 = (int)160100L; + /** + * {@snippet lang=c : + * #define __IPHONE_16_1 160100 + * } + */ + public static int __IPHONE_16_1() { + return __IPHONE_16_1; + } + private static final int __IPHONE_16_2 = (int)160200L; + /** + * {@snippet lang=c : + * #define __IPHONE_16_2 160200 + * } + */ + public static int __IPHONE_16_2() { + return __IPHONE_16_2; + } + private static final int __IPHONE_16_3 = (int)160300L; + /** + * {@snippet lang=c : + * #define __IPHONE_16_3 160300 + * } + */ + public static int __IPHONE_16_3() { + return __IPHONE_16_3; + } + private static final int __IPHONE_16_4 = (int)160400L; + /** + * {@snippet lang=c : + * #define __IPHONE_16_4 160400 + * } + */ + public static int __IPHONE_16_4() { + return __IPHONE_16_4; + } + private static final int __IPHONE_16_5 = (int)160500L; + /** + * {@snippet lang=c : + * #define __IPHONE_16_5 160500 + * } + */ + public static int __IPHONE_16_5() { + return __IPHONE_16_5; + } + private static final int __IPHONE_16_6 = (int)160600L; + /** + * {@snippet lang=c : + * #define __IPHONE_16_6 160600 + * } + */ + public static int __IPHONE_16_6() { + return __IPHONE_16_6; + } + private static final int __IPHONE_16_7 = (int)160700L; + /** + * {@snippet lang=c : + * #define __IPHONE_16_7 160700 + * } + */ + public static int __IPHONE_16_7() { + return __IPHONE_16_7; + } + private static final int __IPHONE_17_0 = (int)170000L; + /** + * {@snippet lang=c : + * #define __IPHONE_17_0 170000 + * } + */ + public static int __IPHONE_17_0() { + return __IPHONE_17_0; + } + private static final int __IPHONE_17_1 = (int)170100L; + /** + * {@snippet lang=c : + * #define __IPHONE_17_1 170100 + * } + */ + public static int __IPHONE_17_1() { + return __IPHONE_17_1; + } + private static final int __IPHONE_17_2 = (int)170200L; + /** + * {@snippet lang=c : + * #define __IPHONE_17_2 170200 + * } + */ + public static int __IPHONE_17_2() { + return __IPHONE_17_2; + } + private static final int __IPHONE_17_3 = (int)170300L; + /** + * {@snippet lang=c : + * #define __IPHONE_17_3 170300 + * } + */ + public static int __IPHONE_17_3() { + return __IPHONE_17_3; + } + private static final int __IPHONE_17_4 = (int)170400L; + /** + * {@snippet lang=c : + * #define __IPHONE_17_4 170400 + * } + */ + public static int __IPHONE_17_4() { + return __IPHONE_17_4; + } + private static final int __IPHONE_17_5 = (int)170500L; + /** + * {@snippet lang=c : + * #define __IPHONE_17_5 170500 + * } + */ + public static int __IPHONE_17_5() { + return __IPHONE_17_5; + } + private static final int __WATCHOS_1_0 = (int)10000L; + /** + * {@snippet lang=c : + * #define __WATCHOS_1_0 10000 + * } + */ + public static int __WATCHOS_1_0() { + return __WATCHOS_1_0; + } + private static final int __WATCHOS_2_0 = (int)20000L; + /** + * {@snippet lang=c : + * #define __WATCHOS_2_0 20000 + * } + */ + public static int __WATCHOS_2_0() { + return __WATCHOS_2_0; + } + private static final int __WATCHOS_2_1 = (int)20100L; + /** + * {@snippet lang=c : + * #define __WATCHOS_2_1 20100 + * } + */ + public static int __WATCHOS_2_1() { + return __WATCHOS_2_1; + } + private static final int __WATCHOS_2_2 = (int)20200L; + /** + * {@snippet lang=c : + * #define __WATCHOS_2_2 20200 + * } + */ + public static int __WATCHOS_2_2() { + return __WATCHOS_2_2; + } + private static final int __WATCHOS_3_0 = (int)30000L; + /** + * {@snippet lang=c : + * #define __WATCHOS_3_0 30000 + * } + */ + public static int __WATCHOS_3_0() { + return __WATCHOS_3_0; + } + private static final int __WATCHOS_3_1 = (int)30100L; + /** + * {@snippet lang=c : + * #define __WATCHOS_3_1 30100 + * } + */ + public static int __WATCHOS_3_1() { + return __WATCHOS_3_1; + } + private static final int __WATCHOS_3_1_1 = (int)30101L; + /** + * {@snippet lang=c : + * #define __WATCHOS_3_1_1 30101 + * } + */ + public static int __WATCHOS_3_1_1() { + return __WATCHOS_3_1_1; + } + private static final int __WATCHOS_3_2 = (int)30200L; + /** + * {@snippet lang=c : + * #define __WATCHOS_3_2 30200 + * } + */ + public static int __WATCHOS_3_2() { + return __WATCHOS_3_2; + } + private static final int __WATCHOS_4_0 = (int)40000L; + /** + * {@snippet lang=c : + * #define __WATCHOS_4_0 40000 + * } + */ + public static int __WATCHOS_4_0() { + return __WATCHOS_4_0; + } + private static final int __WATCHOS_4_1 = (int)40100L; + /** + * {@snippet lang=c : + * #define __WATCHOS_4_1 40100 + * } + */ + public static int __WATCHOS_4_1() { + return __WATCHOS_4_1; + } + private static final int __WATCHOS_4_2 = (int)40200L; + /** + * {@snippet lang=c : + * #define __WATCHOS_4_2 40200 + * } + */ + public static int __WATCHOS_4_2() { + return __WATCHOS_4_2; + } + private static final int __WATCHOS_4_3 = (int)40300L; + /** + * {@snippet lang=c : + * #define __WATCHOS_4_3 40300 + * } + */ + public static int __WATCHOS_4_3() { + return __WATCHOS_4_3; + } + private static final int __WATCHOS_5_0 = (int)50000L; + /** + * {@snippet lang=c : + * #define __WATCHOS_5_0 50000 + * } + */ + public static int __WATCHOS_5_0() { + return __WATCHOS_5_0; + } + private static final int __WATCHOS_5_1 = (int)50100L; + /** + * {@snippet lang=c : + * #define __WATCHOS_5_1 50100 + * } + */ + public static int __WATCHOS_5_1() { + return __WATCHOS_5_1; + } + private static final int __WATCHOS_5_2 = (int)50200L; + /** + * {@snippet lang=c : + * #define __WATCHOS_5_2 50200 + * } + */ + public static int __WATCHOS_5_2() { + return __WATCHOS_5_2; + } + private static final int __WATCHOS_5_3 = (int)50300L; + /** + * {@snippet lang=c : + * #define __WATCHOS_5_3 50300 + * } + */ + public static int __WATCHOS_5_3() { + return __WATCHOS_5_3; + } + private static final int __WATCHOS_6_0 = (int)60000L; + /** + * {@snippet lang=c : + * #define __WATCHOS_6_0 60000 + * } + */ + public static int __WATCHOS_6_0() { + return __WATCHOS_6_0; + } + private static final int __WATCHOS_6_1 = (int)60100L; + /** + * {@snippet lang=c : + * #define __WATCHOS_6_1 60100 + * } + */ + public static int __WATCHOS_6_1() { + return __WATCHOS_6_1; + } + private static final int __WATCHOS_6_2 = (int)60200L; + /** + * {@snippet lang=c : + * #define __WATCHOS_6_2 60200 + * } + */ + public static int __WATCHOS_6_2() { + return __WATCHOS_6_2; + } + private static final int __WATCHOS_7_0 = (int)70000L; + /** + * {@snippet lang=c : + * #define __WATCHOS_7_0 70000 + * } + */ + public static int __WATCHOS_7_0() { + return __WATCHOS_7_0; + } + private static final int __WATCHOS_7_1 = (int)70100L; + /** + * {@snippet lang=c : + * #define __WATCHOS_7_1 70100 + * } + */ + public static int __WATCHOS_7_1() { + return __WATCHOS_7_1; + } + private static final int __WATCHOS_7_2 = (int)70200L; + /** + * {@snippet lang=c : + * #define __WATCHOS_7_2 70200 + * } + */ + public static int __WATCHOS_7_2() { + return __WATCHOS_7_2; + } + private static final int __WATCHOS_7_3 = (int)70300L; + /** + * {@snippet lang=c : + * #define __WATCHOS_7_3 70300 + * } + */ + public static int __WATCHOS_7_3() { + return __WATCHOS_7_3; + } + private static final int __WATCHOS_7_4 = (int)70400L; + /** + * {@snippet lang=c : + * #define __WATCHOS_7_4 70400 + * } + */ + public static int __WATCHOS_7_4() { + return __WATCHOS_7_4; + } + private static final int __WATCHOS_7_5 = (int)70500L; + /** + * {@snippet lang=c : + * #define __WATCHOS_7_5 70500 + * } + */ + public static int __WATCHOS_7_5() { + return __WATCHOS_7_5; + } + private static final int __WATCHOS_7_6 = (int)70600L; + /** + * {@snippet lang=c : + * #define __WATCHOS_7_6 70600 + * } + */ + public static int __WATCHOS_7_6() { + return __WATCHOS_7_6; + } + private static final int __WATCHOS_8_0 = (int)80000L; + /** + * {@snippet lang=c : + * #define __WATCHOS_8_0 80000 + * } + */ + public static int __WATCHOS_8_0() { + return __WATCHOS_8_0; + } + private static final int __WATCHOS_8_1 = (int)80100L; + /** + * {@snippet lang=c : + * #define __WATCHOS_8_1 80100 + * } + */ + public static int __WATCHOS_8_1() { + return __WATCHOS_8_1; + } + private static final int __WATCHOS_8_3 = (int)80300L; + /** + * {@snippet lang=c : + * #define __WATCHOS_8_3 80300 + * } + */ + public static int __WATCHOS_8_3() { + return __WATCHOS_8_3; + } + private static final int __WATCHOS_8_4 = (int)80400L; + /** + * {@snippet lang=c : + * #define __WATCHOS_8_4 80400 + * } + */ + public static int __WATCHOS_8_4() { + return __WATCHOS_8_4; + } + private static final int __WATCHOS_8_5 = (int)80500L; + /** + * {@snippet lang=c : + * #define __WATCHOS_8_5 80500 + * } + */ + public static int __WATCHOS_8_5() { + return __WATCHOS_8_5; + } + private static final int __WATCHOS_8_6 = (int)80600L; + /** + * {@snippet lang=c : + * #define __WATCHOS_8_6 80600 + * } + */ + public static int __WATCHOS_8_6() { + return __WATCHOS_8_6; + } + private static final int __WATCHOS_8_7 = (int)80700L; + /** + * {@snippet lang=c : + * #define __WATCHOS_8_7 80700 + * } + */ + public static int __WATCHOS_8_7() { + return __WATCHOS_8_7; + } + private static final int __WATCHOS_8_8 = (int)80800L; + /** + * {@snippet lang=c : + * #define __WATCHOS_8_8 80800 + * } + */ + public static int __WATCHOS_8_8() { + return __WATCHOS_8_8; + } + private static final int __WATCHOS_9_0 = (int)90000L; + /** + * {@snippet lang=c : + * #define __WATCHOS_9_0 90000 + * } + */ + public static int __WATCHOS_9_0() { + return __WATCHOS_9_0; + } + private static final int __WATCHOS_9_1 = (int)90100L; + /** + * {@snippet lang=c : + * #define __WATCHOS_9_1 90100 + * } + */ + public static int __WATCHOS_9_1() { + return __WATCHOS_9_1; + } + private static final int __WATCHOS_9_2 = (int)90200L; + /** + * {@snippet lang=c : + * #define __WATCHOS_9_2 90200 + * } + */ + public static int __WATCHOS_9_2() { + return __WATCHOS_9_2; + } + private static final int __WATCHOS_9_3 = (int)90300L; + /** + * {@snippet lang=c : + * #define __WATCHOS_9_3 90300 + * } + */ + public static int __WATCHOS_9_3() { + return __WATCHOS_9_3; + } + private static final int __WATCHOS_9_4 = (int)90400L; + /** + * {@snippet lang=c : + * #define __WATCHOS_9_4 90400 + * } + */ + public static int __WATCHOS_9_4() { + return __WATCHOS_9_4; + } + private static final int __WATCHOS_9_5 = (int)90500L; + /** + * {@snippet lang=c : + * #define __WATCHOS_9_5 90500 + * } + */ + public static int __WATCHOS_9_5() { + return __WATCHOS_9_5; + } + private static final int __WATCHOS_9_6 = (int)90600L; + /** + * {@snippet lang=c : + * #define __WATCHOS_9_6 90600 + * } + */ + public static int __WATCHOS_9_6() { + return __WATCHOS_9_6; + } + private static final int __WATCHOS_10_0 = (int)100000L; + /** + * {@snippet lang=c : + * #define __WATCHOS_10_0 100000 + * } + */ + public static int __WATCHOS_10_0() { + return __WATCHOS_10_0; + } + private static final int __WATCHOS_10_1 = (int)100100L; + /** + * {@snippet lang=c : + * #define __WATCHOS_10_1 100100 + * } + */ + public static int __WATCHOS_10_1() { + return __WATCHOS_10_1; + } + private static final int __WATCHOS_10_2 = (int)100200L; + /** + * {@snippet lang=c : + * #define __WATCHOS_10_2 100200 + * } + */ + public static int __WATCHOS_10_2() { + return __WATCHOS_10_2; + } + private static final int __WATCHOS_10_3 = (int)100300L; + /** + * {@snippet lang=c : + * #define __WATCHOS_10_3 100300 + * } + */ + public static int __WATCHOS_10_3() { + return __WATCHOS_10_3; + } + private static final int __WATCHOS_10_4 = (int)100400L; + /** + * {@snippet lang=c : + * #define __WATCHOS_10_4 100400 + * } + */ + public static int __WATCHOS_10_4() { + return __WATCHOS_10_4; + } + private static final int __WATCHOS_10_5 = (int)100500L; + /** + * {@snippet lang=c : + * #define __WATCHOS_10_5 100500 + * } + */ + public static int __WATCHOS_10_5() { + return __WATCHOS_10_5; + } + private static final int __TVOS_9_0 = (int)90000L; + /** + * {@snippet lang=c : + * #define __TVOS_9_0 90000 + * } + */ + public static int __TVOS_9_0() { + return __TVOS_9_0; + } + private static final int __TVOS_9_1 = (int)90100L; + /** + * {@snippet lang=c : + * #define __TVOS_9_1 90100 + * } + */ + public static int __TVOS_9_1() { + return __TVOS_9_1; + } + private static final int __TVOS_9_2 = (int)90200L; + /** + * {@snippet lang=c : + * #define __TVOS_9_2 90200 + * } + */ + public static int __TVOS_9_2() { + return __TVOS_9_2; + } + private static final int __TVOS_10_0 = (int)100000L; + /** + * {@snippet lang=c : + * #define __TVOS_10_0 100000 + * } + */ + public static int __TVOS_10_0() { + return __TVOS_10_0; + } + private static final int __TVOS_10_0_1 = (int)100001L; + /** + * {@snippet lang=c : + * #define __TVOS_10_0_1 100001 + * } + */ + public static int __TVOS_10_0_1() { + return __TVOS_10_0_1; + } + private static final int __TVOS_10_1 = (int)100100L; + /** + * {@snippet lang=c : + * #define __TVOS_10_1 100100 + * } + */ + public static int __TVOS_10_1() { + return __TVOS_10_1; + } + private static final int __TVOS_10_2 = (int)100200L; + /** + * {@snippet lang=c : + * #define __TVOS_10_2 100200 + * } + */ + public static int __TVOS_10_2() { + return __TVOS_10_2; + } + private static final int __TVOS_11_0 = (int)110000L; + /** + * {@snippet lang=c : + * #define __TVOS_11_0 110000 + * } + */ + public static int __TVOS_11_0() { + return __TVOS_11_0; + } + private static final int __TVOS_11_1 = (int)110100L; + /** + * {@snippet lang=c : + * #define __TVOS_11_1 110100 + * } + */ + public static int __TVOS_11_1() { + return __TVOS_11_1; + } + private static final int __TVOS_11_2 = (int)110200L; + /** + * {@snippet lang=c : + * #define __TVOS_11_2 110200 + * } + */ + public static int __TVOS_11_2() { + return __TVOS_11_2; + } + private static final int __TVOS_11_3 = (int)110300L; + /** + * {@snippet lang=c : + * #define __TVOS_11_3 110300 + * } + */ + public static int __TVOS_11_3() { + return __TVOS_11_3; + } + private static final int __TVOS_11_4 = (int)110400L; + /** + * {@snippet lang=c : + * #define __TVOS_11_4 110400 + * } + */ + public static int __TVOS_11_4() { + return __TVOS_11_4; + } + private static final int __TVOS_12_0 = (int)120000L; + /** + * {@snippet lang=c : + * #define __TVOS_12_0 120000 + * } + */ + public static int __TVOS_12_0() { + return __TVOS_12_0; + } + private static final int __TVOS_12_1 = (int)120100L; + /** + * {@snippet lang=c : + * #define __TVOS_12_1 120100 + * } + */ + public static int __TVOS_12_1() { + return __TVOS_12_1; + } + private static final int __TVOS_12_2 = (int)120200L; + /** + * {@snippet lang=c : + * #define __TVOS_12_2 120200 + * } + */ + public static int __TVOS_12_2() { + return __TVOS_12_2; + } + private static final int __TVOS_12_3 = (int)120300L; + /** + * {@snippet lang=c : + * #define __TVOS_12_3 120300 + * } + */ + public static int __TVOS_12_3() { + return __TVOS_12_3; + } + private static final int __TVOS_12_4 = (int)120400L; + /** + * {@snippet lang=c : + * #define __TVOS_12_4 120400 + * } + */ + public static int __TVOS_12_4() { + return __TVOS_12_4; + } + private static final int __TVOS_13_0 = (int)130000L; + /** + * {@snippet lang=c : + * #define __TVOS_13_0 130000 + * } + */ + public static int __TVOS_13_0() { + return __TVOS_13_0; + } + private static final int __TVOS_13_2 = (int)130200L; + /** + * {@snippet lang=c : + * #define __TVOS_13_2 130200 + * } + */ + public static int __TVOS_13_2() { + return __TVOS_13_2; + } + private static final int __TVOS_13_3 = (int)130300L; + /** + * {@snippet lang=c : + * #define __TVOS_13_3 130300 + * } + */ + public static int __TVOS_13_3() { + return __TVOS_13_3; + } + private static final int __TVOS_13_4 = (int)130400L; + /** + * {@snippet lang=c : + * #define __TVOS_13_4 130400 + * } + */ + public static int __TVOS_13_4() { + return __TVOS_13_4; + } + private static final int __TVOS_14_0 = (int)140000L; + /** + * {@snippet lang=c : + * #define __TVOS_14_0 140000 + * } + */ + public static int __TVOS_14_0() { + return __TVOS_14_0; + } + private static final int __TVOS_14_1 = (int)140100L; + /** + * {@snippet lang=c : + * #define __TVOS_14_1 140100 + * } + */ + public static int __TVOS_14_1() { + return __TVOS_14_1; + } + private static final int __TVOS_14_2 = (int)140200L; + /** + * {@snippet lang=c : + * #define __TVOS_14_2 140200 + * } + */ + public static int __TVOS_14_2() { + return __TVOS_14_2; + } + private static final int __TVOS_14_3 = (int)140300L; + /** + * {@snippet lang=c : + * #define __TVOS_14_3 140300 + * } + */ + public static int __TVOS_14_3() { + return __TVOS_14_3; + } + private static final int __TVOS_14_5 = (int)140500L; + /** + * {@snippet lang=c : + * #define __TVOS_14_5 140500 + * } + */ + public static int __TVOS_14_5() { + return __TVOS_14_5; + } + private static final int __TVOS_14_6 = (int)140600L; + /** + * {@snippet lang=c : + * #define __TVOS_14_6 140600 + * } + */ + public static int __TVOS_14_6() { + return __TVOS_14_6; + } + private static final int __TVOS_14_7 = (int)140700L; + /** + * {@snippet lang=c : + * #define __TVOS_14_7 140700 + * } + */ + public static int __TVOS_14_7() { + return __TVOS_14_7; + } + private static final int __TVOS_15_0 = (int)150000L; + /** + * {@snippet lang=c : + * #define __TVOS_15_0 150000 + * } + */ + public static int __TVOS_15_0() { + return __TVOS_15_0; + } + private static final int __TVOS_15_1 = (int)150100L; + /** + * {@snippet lang=c : + * #define __TVOS_15_1 150100 + * } + */ + public static int __TVOS_15_1() { + return __TVOS_15_1; + } + private static final int __TVOS_15_2 = (int)150200L; + /** + * {@snippet lang=c : + * #define __TVOS_15_2 150200 + * } + */ + public static int __TVOS_15_2() { + return __TVOS_15_2; + } + private static final int __TVOS_15_3 = (int)150300L; + /** + * {@snippet lang=c : + * #define __TVOS_15_3 150300 + * } + */ + public static int __TVOS_15_3() { + return __TVOS_15_3; + } + private static final int __TVOS_15_4 = (int)150400L; + /** + * {@snippet lang=c : + * #define __TVOS_15_4 150400 + * } + */ + public static int __TVOS_15_4() { + return __TVOS_15_4; + } + private static final int __TVOS_15_5 = (int)150500L; + /** + * {@snippet lang=c : + * #define __TVOS_15_5 150500 + * } + */ + public static int __TVOS_15_5() { + return __TVOS_15_5; + } + private static final int __TVOS_15_6 = (int)150600L; + /** + * {@snippet lang=c : + * #define __TVOS_15_6 150600 + * } + */ + public static int __TVOS_15_6() { + return __TVOS_15_6; + } + private static final int __TVOS_16_0 = (int)160000L; + /** + * {@snippet lang=c : + * #define __TVOS_16_0 160000 + * } + */ + public static int __TVOS_16_0() { + return __TVOS_16_0; + } + private static final int __TVOS_16_1 = (int)160100L; + /** + * {@snippet lang=c : + * #define __TVOS_16_1 160100 + * } + */ + public static int __TVOS_16_1() { + return __TVOS_16_1; + } + private static final int __TVOS_16_2 = (int)160200L; + /** + * {@snippet lang=c : + * #define __TVOS_16_2 160200 + * } + */ + public static int __TVOS_16_2() { + return __TVOS_16_2; + } + private static final int __TVOS_16_3 = (int)160300L; + /** + * {@snippet lang=c : + * #define __TVOS_16_3 160300 + * } + */ + public static int __TVOS_16_3() { + return __TVOS_16_3; + } + private static final int __TVOS_16_4 = (int)160400L; + /** + * {@snippet lang=c : + * #define __TVOS_16_4 160400 + * } + */ + public static int __TVOS_16_4() { + return __TVOS_16_4; + } + private static final int __TVOS_16_5 = (int)160500L; + /** + * {@snippet lang=c : + * #define __TVOS_16_5 160500 + * } + */ + public static int __TVOS_16_5() { + return __TVOS_16_5; + } + private static final int __TVOS_16_6 = (int)160600L; + /** + * {@snippet lang=c : + * #define __TVOS_16_6 160600 + * } + */ + public static int __TVOS_16_6() { + return __TVOS_16_6; + } + private static final int __TVOS_17_0 = (int)170000L; + /** + * {@snippet lang=c : + * #define __TVOS_17_0 170000 + * } + */ + public static int __TVOS_17_0() { + return __TVOS_17_0; + } + private static final int __TVOS_17_1 = (int)170100L; + /** + * {@snippet lang=c : + * #define __TVOS_17_1 170100 + * } + */ + public static int __TVOS_17_1() { + return __TVOS_17_1; + } + private static final int __TVOS_17_2 = (int)170200L; + /** + * {@snippet lang=c : + * #define __TVOS_17_2 170200 + * } + */ + public static int __TVOS_17_2() { + return __TVOS_17_2; + } + private static final int __TVOS_17_3 = (int)170300L; + /** + * {@snippet lang=c : + * #define __TVOS_17_3 170300 + * } + */ + public static int __TVOS_17_3() { + return __TVOS_17_3; + } + private static final int __TVOS_17_4 = (int)170400L; + /** + * {@snippet lang=c : + * #define __TVOS_17_4 170400 + * } + */ + public static int __TVOS_17_4() { + return __TVOS_17_4; + } + private static final int __TVOS_17_5 = (int)170500L; + /** + * {@snippet lang=c : + * #define __TVOS_17_5 170500 + * } + */ + public static int __TVOS_17_5() { + return __TVOS_17_5; + } + private static final int __BRIDGEOS_2_0 = (int)20000L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_2_0 20000 + * } + */ + public static int __BRIDGEOS_2_0() { + return __BRIDGEOS_2_0; + } + private static final int __BRIDGEOS_3_0 = (int)30000L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_3_0 30000 + * } + */ + public static int __BRIDGEOS_3_0() { + return __BRIDGEOS_3_0; + } + private static final int __BRIDGEOS_3_1 = (int)30100L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_3_1 30100 + * } + */ + public static int __BRIDGEOS_3_1() { + return __BRIDGEOS_3_1; + } + private static final int __BRIDGEOS_3_4 = (int)30400L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_3_4 30400 + * } + */ + public static int __BRIDGEOS_3_4() { + return __BRIDGEOS_3_4; + } + private static final int __BRIDGEOS_4_0 = (int)40000L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_4_0 40000 + * } + */ + public static int __BRIDGEOS_4_0() { + return __BRIDGEOS_4_0; + } + private static final int __BRIDGEOS_4_1 = (int)40100L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_4_1 40100 + * } + */ + public static int __BRIDGEOS_4_1() { + return __BRIDGEOS_4_1; + } + private static final int __BRIDGEOS_5_0 = (int)50000L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_5_0 50000 + * } + */ + public static int __BRIDGEOS_5_0() { + return __BRIDGEOS_5_0; + } + private static final int __BRIDGEOS_5_1 = (int)50100L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_5_1 50100 + * } + */ + public static int __BRIDGEOS_5_1() { + return __BRIDGEOS_5_1; + } + private static final int __BRIDGEOS_5_3 = (int)50300L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_5_3 50300 + * } + */ + public static int __BRIDGEOS_5_3() { + return __BRIDGEOS_5_3; + } + private static final int __BRIDGEOS_6_0 = (int)60000L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_6_0 60000 + * } + */ + public static int __BRIDGEOS_6_0() { + return __BRIDGEOS_6_0; + } + private static final int __BRIDGEOS_6_2 = (int)60200L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_6_2 60200 + * } + */ + public static int __BRIDGEOS_6_2() { + return __BRIDGEOS_6_2; + } + private static final int __BRIDGEOS_6_4 = (int)60400L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_6_4 60400 + * } + */ + public static int __BRIDGEOS_6_4() { + return __BRIDGEOS_6_4; + } + private static final int __BRIDGEOS_6_5 = (int)60500L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_6_5 60500 + * } + */ + public static int __BRIDGEOS_6_5() { + return __BRIDGEOS_6_5; + } + private static final int __BRIDGEOS_6_6 = (int)60600L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_6_6 60600 + * } + */ + public static int __BRIDGEOS_6_6() { + return __BRIDGEOS_6_6; + } + private static final int __BRIDGEOS_7_0 = (int)70000L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_7_0 70000 + * } + */ + public static int __BRIDGEOS_7_0() { + return __BRIDGEOS_7_0; + } + private static final int __BRIDGEOS_7_1 = (int)70100L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_7_1 70100 + * } + */ + public static int __BRIDGEOS_7_1() { + return __BRIDGEOS_7_1; + } + private static final int __BRIDGEOS_7_2 = (int)70200L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_7_2 70200 + * } + */ + public static int __BRIDGEOS_7_2() { + return __BRIDGEOS_7_2; + } + private static final int __BRIDGEOS_7_3 = (int)70300L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_7_3 70300 + * } + */ + public static int __BRIDGEOS_7_3() { + return __BRIDGEOS_7_3; + } + private static final int __BRIDGEOS_7_4 = (int)70400L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_7_4 70400 + * } + */ + public static int __BRIDGEOS_7_4() { + return __BRIDGEOS_7_4; + } + private static final int __BRIDGEOS_7_6 = (int)70600L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_7_6 70600 + * } + */ + public static int __BRIDGEOS_7_6() { + return __BRIDGEOS_7_6; + } + private static final int __BRIDGEOS_8_0 = (int)80000L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_8_0 80000 + * } + */ + public static int __BRIDGEOS_8_0() { + return __BRIDGEOS_8_0; + } + private static final int __BRIDGEOS_8_1 = (int)80100L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_8_1 80100 + * } + */ + public static int __BRIDGEOS_8_1() { + return __BRIDGEOS_8_1; + } + private static final int __BRIDGEOS_8_2 = (int)80200L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_8_2 80200 + * } + */ + public static int __BRIDGEOS_8_2() { + return __BRIDGEOS_8_2; + } + private static final int __BRIDGEOS_8_3 = (int)80300L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_8_3 80300 + * } + */ + public static int __BRIDGEOS_8_3() { + return __BRIDGEOS_8_3; + } + private static final int __BRIDGEOS_8_4 = (int)80400L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_8_4 80400 + * } + */ + public static int __BRIDGEOS_8_4() { + return __BRIDGEOS_8_4; + } + private static final int __BRIDGEOS_8_5 = (int)80500L; + /** + * {@snippet lang=c : + * #define __BRIDGEOS_8_5 80500 + * } + */ + public static int __BRIDGEOS_8_5() { + return __BRIDGEOS_8_5; + } + private static final int __DRIVERKIT_19_0 = (int)190000L; + /** + * {@snippet lang=c : + * #define __DRIVERKIT_19_0 190000 + * } + */ + public static int __DRIVERKIT_19_0() { + return __DRIVERKIT_19_0; + } + private static final int __DRIVERKIT_20_0 = (int)200000L; + /** + * {@snippet lang=c : + * #define __DRIVERKIT_20_0 200000 + * } + */ + public static int __DRIVERKIT_20_0() { + return __DRIVERKIT_20_0; + } + private static final int __DRIVERKIT_21_0 = (int)210000L; + /** + * {@snippet lang=c : + * #define __DRIVERKIT_21_0 210000 + * } + */ + public static int __DRIVERKIT_21_0() { + return __DRIVERKIT_21_0; + } + private static final int __DRIVERKIT_22_0 = (int)220000L; + /** + * {@snippet lang=c : + * #define __DRIVERKIT_22_0 220000 + * } + */ + public static int __DRIVERKIT_22_0() { + return __DRIVERKIT_22_0; + } + private static final int __DRIVERKIT_22_4 = (int)220400L; + /** + * {@snippet lang=c : + * #define __DRIVERKIT_22_4 220400 + * } + */ + public static int __DRIVERKIT_22_4() { + return __DRIVERKIT_22_4; + } + private static final int __DRIVERKIT_22_5 = (int)220500L; + /** + * {@snippet lang=c : + * #define __DRIVERKIT_22_5 220500 + * } + */ + public static int __DRIVERKIT_22_5() { + return __DRIVERKIT_22_5; + } + private static final int __DRIVERKIT_22_6 = (int)220600L; + /** + * {@snippet lang=c : + * #define __DRIVERKIT_22_6 220600 + * } + */ + public static int __DRIVERKIT_22_6() { + return __DRIVERKIT_22_6; + } + private static final int __DRIVERKIT_23_0 = (int)230000L; + /** + * {@snippet lang=c : + * #define __DRIVERKIT_23_0 230000 + * } + */ + public static int __DRIVERKIT_23_0() { + return __DRIVERKIT_23_0; + } + private static final int __DRIVERKIT_23_1 = (int)230100L; + /** + * {@snippet lang=c : + * #define __DRIVERKIT_23_1 230100 + * } + */ + public static int __DRIVERKIT_23_1() { + return __DRIVERKIT_23_1; + } + private static final int __DRIVERKIT_23_2 = (int)230200L; + /** + * {@snippet lang=c : + * #define __DRIVERKIT_23_2 230200 + * } + */ + public static int __DRIVERKIT_23_2() { + return __DRIVERKIT_23_2; + } + private static final int __DRIVERKIT_23_3 = (int)230300L; + /** + * {@snippet lang=c : + * #define __DRIVERKIT_23_3 230300 + * } + */ + public static int __DRIVERKIT_23_3() { + return __DRIVERKIT_23_3; + } + private static final int __DRIVERKIT_23_4 = (int)230400L; + /** + * {@snippet lang=c : + * #define __DRIVERKIT_23_4 230400 + * } + */ + public static int __DRIVERKIT_23_4() { + return __DRIVERKIT_23_4; + } + private static final int __DRIVERKIT_23_5 = (int)230500L; + /** + * {@snippet lang=c : + * #define __DRIVERKIT_23_5 230500 + * } + */ + public static int __DRIVERKIT_23_5() { + return __DRIVERKIT_23_5; + } + private static final int __VISIONOS_1_0 = (int)10000L; + /** + * {@snippet lang=c : + * #define __VISIONOS_1_0 10000 + * } + */ + public static int __VISIONOS_1_0() { + return __VISIONOS_1_0; + } + private static final int __VISIONOS_1_1 = (int)10100L; + /** + * {@snippet lang=c : + * #define __VISIONOS_1_1 10100 + * } + */ + public static int __VISIONOS_1_1() { + return __VISIONOS_1_1; + } + private static final int __VISIONOS_1_2 = (int)10200L; + /** + * {@snippet lang=c : + * #define __VISIONOS_1_2 10200 + * } + */ + public static int __VISIONOS_1_2() { + return __VISIONOS_1_2; + } + private static final int __ENABLE_LEGACY_MAC_AVAILABILITY = (int)1L; + /** + * {@snippet lang=c : + * #define __ENABLE_LEGACY_MAC_AVAILABILITY 1 + * } + */ + public static int __ENABLE_LEGACY_MAC_AVAILABILITY() { + return __ENABLE_LEGACY_MAC_AVAILABILITY; + } + private static final int __PTHREAD_SIZE__ = (int)8176L; + /** + * {@snippet lang=c : + * #define __PTHREAD_SIZE__ 8176 + * } + */ + public static int __PTHREAD_SIZE__() { + return __PTHREAD_SIZE__; + } + private static final int __PTHREAD_ATTR_SIZE__ = (int)56L; + /** + * {@snippet lang=c : + * #define __PTHREAD_ATTR_SIZE__ 56 + * } + */ + public static int __PTHREAD_ATTR_SIZE__() { + return __PTHREAD_ATTR_SIZE__; + } + private static final int __PTHREAD_MUTEXATTR_SIZE__ = (int)8L; + /** + * {@snippet lang=c : + * #define __PTHREAD_MUTEXATTR_SIZE__ 8 + * } + */ + public static int __PTHREAD_MUTEXATTR_SIZE__() { + return __PTHREAD_MUTEXATTR_SIZE__; + } + private static final int __PTHREAD_MUTEX_SIZE__ = (int)56L; + /** + * {@snippet lang=c : + * #define __PTHREAD_MUTEX_SIZE__ 56 + * } + */ + public static int __PTHREAD_MUTEX_SIZE__() { + return __PTHREAD_MUTEX_SIZE__; + } + private static final int __PTHREAD_CONDATTR_SIZE__ = (int)8L; + /** + * {@snippet lang=c : + * #define __PTHREAD_CONDATTR_SIZE__ 8 + * } + */ + public static int __PTHREAD_CONDATTR_SIZE__() { + return __PTHREAD_CONDATTR_SIZE__; + } + private static final int __PTHREAD_COND_SIZE__ = (int)40L; + /** + * {@snippet lang=c : + * #define __PTHREAD_COND_SIZE__ 40 + * } + */ + public static int __PTHREAD_COND_SIZE__() { + return __PTHREAD_COND_SIZE__; + } + private static final int __PTHREAD_ONCE_SIZE__ = (int)8L; + /** + * {@snippet lang=c : + * #define __PTHREAD_ONCE_SIZE__ 8 + * } + */ + public static int __PTHREAD_ONCE_SIZE__() { + return __PTHREAD_ONCE_SIZE__; + } + private static final int __PTHREAD_RWLOCK_SIZE__ = (int)192L; + /** + * {@snippet lang=c : + * #define __PTHREAD_RWLOCK_SIZE__ 192 + * } + */ + public static int __PTHREAD_RWLOCK_SIZE__() { + return __PTHREAD_RWLOCK_SIZE__; + } + private static final int __PTHREAD_RWLOCKATTR_SIZE__ = (int)16L; + /** + * {@snippet lang=c : + * #define __PTHREAD_RWLOCKATTR_SIZE__ 16 + * } + */ + public static int __PTHREAD_RWLOCKATTR_SIZE__() { + return __PTHREAD_RWLOCKATTR_SIZE__; + } + private static final int _FORTIFY_SOURCE = (int)2L; + /** + * {@snippet lang=c : + * #define _FORTIFY_SOURCE 2 + * } + */ + public static int _FORTIFY_SOURCE() { + return _FORTIFY_SOURCE; + } + private static final int RENAME_SECLUDE = (int)1L; + /** + * {@snippet lang=c : + * #define RENAME_SECLUDE 1 + * } + */ + public static int RENAME_SECLUDE() { + return RENAME_SECLUDE; + } + private static final int RENAME_SWAP = (int)2L; + /** + * {@snippet lang=c : + * #define RENAME_SWAP 2 + * } + */ + public static int RENAME_SWAP() { + return RENAME_SWAP; + } + private static final int RENAME_EXCL = (int)4L; + /** + * {@snippet lang=c : + * #define RENAME_EXCL 4 + * } + */ + public static int RENAME_EXCL() { + return RENAME_EXCL; + } + private static final int RENAME_RESERVED1 = (int)8L; + /** + * {@snippet lang=c : + * #define RENAME_RESERVED1 8 + * } + */ + public static int RENAME_RESERVED1() { + return RENAME_RESERVED1; + } + private static final int RENAME_NOFOLLOW_ANY = (int)16L; + /** + * {@snippet lang=c : + * #define RENAME_NOFOLLOW_ANY 16 + * } + */ + public static int RENAME_NOFOLLOW_ANY() { + return RENAME_NOFOLLOW_ANY; + } + private static final int SEEK_SET = (int)0L; + /** + * {@snippet lang=c : + * #define SEEK_SET 0 + * } + */ + public static int SEEK_SET() { + return SEEK_SET; + } + private static final int SEEK_CUR = (int)1L; + /** + * {@snippet lang=c : + * #define SEEK_CUR 1 + * } + */ + public static int SEEK_CUR() { + return SEEK_CUR; + } + private static final int SEEK_END = (int)2L; + /** + * {@snippet lang=c : + * #define SEEK_END 2 + * } + */ + public static int SEEK_END() { + return SEEK_END; + } + private static final int SEEK_HOLE = (int)3L; + /** + * {@snippet lang=c : + * #define SEEK_HOLE 3 + * } + */ + public static int SEEK_HOLE() { + return SEEK_HOLE; + } + private static final int SEEK_DATA = (int)4L; + /** + * {@snippet lang=c : + * #define SEEK_DATA 4 + * } + */ + public static int SEEK_DATA() { + return SEEK_DATA; + } + private static final int __SLBF = (int)1L; + /** + * {@snippet lang=c : + * #define __SLBF 1 + * } + */ + public static int __SLBF() { + return __SLBF; + } + private static final int __SNBF = (int)2L; + /** + * {@snippet lang=c : + * #define __SNBF 2 + * } + */ + public static int __SNBF() { + return __SNBF; + } + private static final int __SRD = (int)4L; + /** + * {@snippet lang=c : + * #define __SRD 4 + * } + */ + public static int __SRD() { + return __SRD; + } + private static final int __SWR = (int)8L; + /** + * {@snippet lang=c : + * #define __SWR 8 + * } + */ + public static int __SWR() { + return __SWR; + } + private static final int __SRW = (int)16L; + /** + * {@snippet lang=c : + * #define __SRW 16 + * } + */ + public static int __SRW() { + return __SRW; + } + private static final int __SEOF = (int)32L; + /** + * {@snippet lang=c : + * #define __SEOF 32 + * } + */ + public static int __SEOF() { + return __SEOF; + } + private static final int __SERR = (int)64L; + /** + * {@snippet lang=c : + * #define __SERR 64 + * } + */ + public static int __SERR() { + return __SERR; + } + private static final int __SMBF = (int)128L; + /** + * {@snippet lang=c : + * #define __SMBF 128 + * } + */ + public static int __SMBF() { + return __SMBF; + } + private static final int __SAPP = (int)256L; + /** + * {@snippet lang=c : + * #define __SAPP 256 + * } + */ + public static int __SAPP() { + return __SAPP; + } + private static final int __SSTR = (int)512L; + /** + * {@snippet lang=c : + * #define __SSTR 512 + * } + */ + public static int __SSTR() { + return __SSTR; + } + private static final int __SOPT = (int)1024L; + /** + * {@snippet lang=c : + * #define __SOPT 1024 + * } + */ + public static int __SOPT() { + return __SOPT; + } + private static final int __SNPT = (int)2048L; + /** + * {@snippet lang=c : + * #define __SNPT 2048 + * } + */ + public static int __SNPT() { + return __SNPT; + } + private static final int __SOFF = (int)4096L; + /** + * {@snippet lang=c : + * #define __SOFF 4096 + * } + */ + public static int __SOFF() { + return __SOFF; + } + private static final int __SMOD = (int)8192L; + /** + * {@snippet lang=c : + * #define __SMOD 8192 + * } + */ + public static int __SMOD() { + return __SMOD; + } + private static final int __SALC = (int)16384L; + /** + * {@snippet lang=c : + * #define __SALC 16384 + * } + */ + public static int __SALC() { + return __SALC; + } + private static final int __SIGN = (int)32768L; + /** + * {@snippet lang=c : + * #define __SIGN 32768 + * } + */ + public static int __SIGN() { + return __SIGN; + } + private static final int _IOFBF = (int)0L; + /** + * {@snippet lang=c : + * #define _IOFBF 0 + * } + */ + public static int _IOFBF() { + return _IOFBF; + } + private static final int _IOLBF = (int)1L; + /** + * {@snippet lang=c : + * #define _IOLBF 1 + * } + */ + public static int _IOLBF() { + return _IOLBF; + } + private static final int _IONBF = (int)2L; + /** + * {@snippet lang=c : + * #define _IONBF 2 + * } + */ + public static int _IONBF() { + return _IONBF; + } + private static final int BUFSIZ = (int)1024L; + /** + * {@snippet lang=c : + * #define BUFSIZ 1024 + * } + */ + public static int BUFSIZ() { + return BUFSIZ; + } + private static final int FOPEN_MAX = (int)20L; + /** + * {@snippet lang=c : + * #define FOPEN_MAX 20 + * } + */ + public static int FOPEN_MAX() { + return FOPEN_MAX; + } + private static final int FILENAME_MAX = (int)1024L; + /** + * {@snippet lang=c : + * #define FILENAME_MAX 1024 + * } + */ + public static int FILENAME_MAX() { + return FILENAME_MAX; + } + private static final int L_tmpnam = (int)1024L; + /** + * {@snippet lang=c : + * #define L_tmpnam 1024 + * } + */ + public static int L_tmpnam() { + return L_tmpnam; + } + private static final int TMP_MAX = (int)308915776L; + /** + * {@snippet lang=c : + * #define TMP_MAX 308915776 + * } + */ + public static int TMP_MAX() { + return TMP_MAX; + } + private static final int L_ctermid = (int)1024L; + /** + * {@snippet lang=c : + * #define L_ctermid 1024 + * } + */ + public static int L_ctermid() { + return L_ctermid; + } + private static final int _USE_FORTIFY_LEVEL = (int)2L; + /** + * {@snippet lang=c : + * #define _USE_FORTIFY_LEVEL 2 + * } + */ + public static int _USE_FORTIFY_LEVEL() { + return _USE_FORTIFY_LEVEL; + } + private static final int __WORDSIZE = (int)64L; + /** + * {@snippet lang=c : + * #define __WORDSIZE 64 + * } + */ + public static int __WORDSIZE() { + return __WORDSIZE; + } + private static final int INT8_MAX = (int)127L; + /** + * {@snippet lang=c : + * #define INT8_MAX 127 + * } + */ + public static int INT8_MAX() { + return INT8_MAX; + } + private static final int INT16_MAX = (int)32767L; + /** + * {@snippet lang=c : + * #define INT16_MAX 32767 + * } + */ + public static int INT16_MAX() { + return INT16_MAX; + } + private static final int INT32_MAX = (int)2147483647L; + /** + * {@snippet lang=c : + * #define INT32_MAX 2147483647 + * } + */ + public static int INT32_MAX() { + return INT32_MAX; + } + private static final int UINT8_MAX = (int)255L; + /** + * {@snippet lang=c : + * #define UINT8_MAX 255 + * } + */ + public static int UINT8_MAX() { + return UINT8_MAX; + } + private static final int UINT16_MAX = (int)65535L; + /** + * {@snippet lang=c : + * #define UINT16_MAX 65535 + * } + */ + public static int UINT16_MAX() { + return UINT16_MAX; + } + private static final int true_ = (int)1L; + /** + * {@snippet lang=c : + * #define true 1 + * } + */ + public static int true_() { + return true_; + } + private static final int false_ = (int)0L; + /** + * {@snippet lang=c : + * #define false 0 + * } + */ + public static int false_() { + return false_; + } + private static final int __bool_true_false_are_defined = (int)1L; + /** + * {@snippet lang=c : + * #define __bool_true_false_are_defined 1 + * } + */ + public static int __bool_true_false_are_defined() { + return __bool_true_false_are_defined; + } + private static final int _QUAD_HIGHWORD = (int)1L; + /** + * {@snippet lang=c : + * #define _QUAD_HIGHWORD 1 + * } + */ + public static int _QUAD_HIGHWORD() { + return _QUAD_HIGHWORD; + } + private static final int _QUAD_LOWWORD = (int)0L; + /** + * {@snippet lang=c : + * #define _QUAD_LOWWORD 0 + * } + */ + public static int _QUAD_LOWWORD() { + return _QUAD_LOWWORD; + } + private static final int __DARWIN_LITTLE_ENDIAN = (int)1234L; + /** + * {@snippet lang=c : + * #define __DARWIN_LITTLE_ENDIAN 1234 + * } + */ + public static int __DARWIN_LITTLE_ENDIAN() { + return __DARWIN_LITTLE_ENDIAN; + } + private static final int __DARWIN_BIG_ENDIAN = (int)4321L; + /** + * {@snippet lang=c : + * #define __DARWIN_BIG_ENDIAN 4321 + * } + */ + public static int __DARWIN_BIG_ENDIAN() { + return __DARWIN_BIG_ENDIAN; + } + private static final int __DARWIN_PDP_ENDIAN = (int)3412L; + /** + * {@snippet lang=c : + * #define __DARWIN_PDP_ENDIAN 3412 + * } + */ + public static int __DARWIN_PDP_ENDIAN() { + return __DARWIN_PDP_ENDIAN; + } + private static final int __DARWIN_FD_SETSIZE = (int)1024L; + /** + * {@snippet lang=c : + * #define __DARWIN_FD_SETSIZE 1024 + * } + */ + public static int __DARWIN_FD_SETSIZE() { + return __DARWIN_FD_SETSIZE; + } + private static final int __DARWIN_NBBY = (int)8L; + /** + * {@snippet lang=c : + * #define __DARWIN_NBBY 8 + * } + */ + public static int __DARWIN_NBBY() { + return __DARWIN_NBBY; + } + /** + * {@snippet lang=c : + * typedef signed char __int8_t + * } + */ + public static final OfByte __int8_t = somelib_h.C_CHAR; + /** + * {@snippet lang=c : + * typedef unsigned char __uint8_t + * } + */ + public static final OfByte __uint8_t = somelib_h.C_CHAR; + /** + * {@snippet lang=c : + * typedef short __int16_t + * } + */ + public static final OfShort __int16_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef unsigned short __uint16_t + * } + */ + public static final OfShort __uint16_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef int __int32_t + * } + */ + public static final OfInt __int32_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef unsigned int __uint32_t + * } + */ + public static final OfInt __uint32_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef long long __int64_t + * } + */ + public static final OfLong __int64_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef unsigned long long __uint64_t + * } + */ + public static final OfLong __uint64_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef long __darwin_intptr_t + * } + */ + public static final OfLong __darwin_intptr_t = somelib_h.C_LONG; + /** + * {@snippet lang=c : + * typedef unsigned int __darwin_natural_t + * } + */ + public static final OfInt __darwin_natural_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef int __darwin_ct_rune_t + * } + */ + public static final OfInt __darwin_ct_rune_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef long __darwin_ptrdiff_t + * } + */ + public static final OfLong __darwin_ptrdiff_t = somelib_h.C_LONG; + /** + * {@snippet lang=c : + * typedef unsigned long __darwin_size_t + * } + */ + public static final OfLong __darwin_size_t = somelib_h.C_LONG; + /** + * {@snippet lang=c : + * typedef __builtin_va_list __darwin_va_list + * } + */ + public static final AddressLayout __darwin_va_list = somelib_h.C_POINTER; + /** + * {@snippet lang=c : + * typedef int __darwin_wchar_t + * } + */ + public static final OfInt __darwin_wchar_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef __darwin_wchar_t __darwin_rune_t + * } + */ + public static final OfInt __darwin_rune_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef int __darwin_wint_t + * } + */ + public static final OfInt __darwin_wint_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef unsigned long __darwin_clock_t + * } + */ + public static final OfLong __darwin_clock_t = somelib_h.C_LONG; + /** + * {@snippet lang=c : + * typedef __uint32_t __darwin_socklen_t + * } + */ + public static final OfInt __darwin_socklen_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef long __darwin_ssize_t + * } + */ + public static final OfLong __darwin_ssize_t = somelib_h.C_LONG; + /** + * {@snippet lang=c : + * typedef long __darwin_time_t + * } + */ + public static final OfLong __darwin_time_t = somelib_h.C_LONG; + /** + * {@snippet lang=c : + * typedef __int64_t __darwin_blkcnt_t + * } + */ + public static final OfLong __darwin_blkcnt_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef __int32_t __darwin_blksize_t + * } + */ + public static final OfInt __darwin_blksize_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef __int32_t __darwin_dev_t + * } + */ + public static final OfInt __darwin_dev_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef unsigned int __darwin_fsblkcnt_t + * } + */ + public static final OfInt __darwin_fsblkcnt_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef unsigned int __darwin_fsfilcnt_t + * } + */ + public static final OfInt __darwin_fsfilcnt_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef __uint32_t __darwin_gid_t + * } + */ + public static final OfInt __darwin_gid_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef __uint32_t __darwin_id_t + * } + */ + public static final OfInt __darwin_id_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef __uint64_t __darwin_ino64_t + * } + */ + public static final OfLong __darwin_ino64_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef __darwin_ino64_t __darwin_ino_t + * } + */ + public static final OfLong __darwin_ino_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef __darwin_natural_t __darwin_mach_port_name_t + * } + */ + public static final OfInt __darwin_mach_port_name_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef __darwin_mach_port_name_t __darwin_mach_port_t + * } + */ + public static final OfInt __darwin_mach_port_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef __uint16_t __darwin_mode_t + * } + */ + public static final OfShort __darwin_mode_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef __int64_t __darwin_off_t + * } + */ + public static final OfLong __darwin_off_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef __int32_t __darwin_pid_t + * } + */ + public static final OfInt __darwin_pid_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef __uint32_t __darwin_sigset_t + * } + */ + public static final OfInt __darwin_sigset_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef __int32_t __darwin_suseconds_t + * } + */ + public static final OfInt __darwin_suseconds_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef __uint32_t __darwin_uid_t + * } + */ + public static final OfInt __darwin_uid_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef __uint32_t __darwin_useconds_t + * } + */ + public static final OfInt __darwin_useconds_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef unsigned long __darwin_pthread_key_t + * } + */ + public static final OfLong __darwin_pthread_key_t = somelib_h.C_LONG; + /** + * {@snippet lang=c : + * typedef struct _opaque_pthread_t { + * long __sig; + * struct __darwin_pthread_handler_rec *__cleanup_stack; + * char __opaque[8176]; + * } *__darwin_pthread_t + * } + */ + public static final AddressLayout __darwin_pthread_t = somelib_h.C_POINTER; + /** + * {@snippet lang=c : + * typedef int __darwin_nl_item + * } + */ + public static final OfInt __darwin_nl_item = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef int __darwin_wctrans_t + * } + */ + public static final OfInt __darwin_wctrans_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef __uint32_t __darwin_wctype_t + * } + */ + public static final OfInt __darwin_wctype_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef signed char int8_t + * } + */ + public static final OfByte int8_t = somelib_h.C_CHAR; + /** + * {@snippet lang=c : + * typedef short int16_t + * } + */ + public static final OfShort int16_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef int int32_t + * } + */ + public static final OfInt int32_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef long long int64_t + * } + */ + public static final OfLong int64_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef unsigned char u_int8_t + * } + */ + public static final OfByte u_int8_t = somelib_h.C_CHAR; + /** + * {@snippet lang=c : + * typedef unsigned short u_int16_t + * } + */ + public static final OfShort u_int16_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef unsigned int u_int32_t + * } + */ + public static final OfInt u_int32_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef unsigned long long u_int64_t + * } + */ + public static final OfLong u_int64_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef int64_t register_t + * } + */ + public static final OfLong register_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef __darwin_intptr_t intptr_t + * } + */ + public static final OfLong intptr_t = somelib_h.C_LONG; + /** + * {@snippet lang=c : + * typedef unsigned long uintptr_t + * } + */ + public static final OfLong uintptr_t = somelib_h.C_LONG; + /** + * {@snippet lang=c : + * typedef u_int64_t user_addr_t + * } + */ + public static final OfLong user_addr_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef u_int64_t user_size_t + * } + */ + public static final OfLong user_size_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef int64_t user_ssize_t + * } + */ + public static final OfLong user_ssize_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef int64_t user_long_t + * } + */ + public static final OfLong user_long_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef u_int64_t user_ulong_t + * } + */ + public static final OfLong user_ulong_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef int64_t user_time_t + * } + */ + public static final OfLong user_time_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef int64_t user_off_t + * } + */ + public static final OfLong user_off_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef u_int64_t syscall_arg_t + * } + */ + public static final OfLong syscall_arg_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef __darwin_va_list va_list + * } + */ + public static final AddressLayout va_list = somelib_h.C_POINTER; + /** + * {@snippet lang=c : + * typedef __darwin_size_t size_t + * } + */ + public static final OfLong size_t = somelib_h.C_LONG; + + private static class renameat { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("renameat"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int renameat(int, const char *, int, const char *) + * } + */ + public static FunctionDescriptor renameat$descriptor() { + return renameat.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int renameat(int, const char *, int, const char *) + * } + */ + public static MethodHandle renameat$handle() { + return renameat.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int renameat(int, const char *, int, const char *) + * } + */ + public static MemorySegment renameat$address() { + return renameat.ADDR; + } + + /** + * {@snippet lang=c : + * int renameat(int, const char *, int, const char *) + * } + */ + public static int renameat(int x0, MemorySegment x1, int x2, MemorySegment x3) { + var mh$ = renameat.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("renameat", x0, x1, x2, x3); + } + return (int)mh$.invokeExact(x0, x1, x2, x3); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class renamex_np { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_INT + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("renamex_np"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int renamex_np(const char *, const char *, unsigned int) + * } + */ + public static FunctionDescriptor renamex_np$descriptor() { + return renamex_np.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int renamex_np(const char *, const char *, unsigned int) + * } + */ + public static MethodHandle renamex_np$handle() { + return renamex_np.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int renamex_np(const char *, const char *, unsigned int) + * } + */ + public static MemorySegment renamex_np$address() { + return renamex_np.ADDR; + } + + /** + * {@snippet lang=c : + * int renamex_np(const char *, const char *, unsigned int) + * } + */ + public static int renamex_np(MemorySegment x0, MemorySegment x1, int x2) { + var mh$ = renamex_np.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("renamex_np", x0, x1, x2); + } + return (int)mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class renameatx_np { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_INT + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("renameatx_np"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int renameatx_np(int, const char *, int, const char *, unsigned int) + * } + */ + public static FunctionDescriptor renameatx_np$descriptor() { + return renameatx_np.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int renameatx_np(int, const char *, int, const char *, unsigned int) + * } + */ + public static MethodHandle renameatx_np$handle() { + return renameatx_np.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int renameatx_np(int, const char *, int, const char *, unsigned int) + * } + */ + public static MemorySegment renameatx_np$address() { + return renameatx_np.ADDR; + } + + /** + * {@snippet lang=c : + * int renameatx_np(int, const char *, int, const char *, unsigned int) + * } + */ + public static int renameatx_np(int x0, MemorySegment x1, int x2, MemorySegment x3, int x4) { + var mh$ = renameatx_np.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("renameatx_np", x0, x1, x2, x3, x4); + } + return (int)mh$.invokeExact(x0, x1, x2, x3, x4); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + /** + * {@snippet lang=c : + * typedef __darwin_off_t fpos_t + * } + */ + public static final OfLong fpos_t = somelib_h.C_LONG_LONG; + + private static class __stdinp$constants { + public static final AddressLayout LAYOUT = somelib_h.C_POINTER; + public static final MemorySegment SEGMENT = somelib_h.findOrThrow("__stdinp").reinterpret(LAYOUT.byteSize()); + } + + /** + * Layout for variable: + * {@snippet lang=c : + * extern FILE *__stdinp + * } + */ + public static AddressLayout __stdinp$layout() { + return __stdinp$constants.LAYOUT; + } + + /** + * Segment for variable: + * {@snippet lang=c : + * extern FILE *__stdinp + * } + */ + public static MemorySegment __stdinp$segment() { + return __stdinp$constants.SEGMENT; + } + + /** + * Getter for variable: + * {@snippet lang=c : + * extern FILE *__stdinp + * } + */ + public static MemorySegment __stdinp() { + return __stdinp$constants.SEGMENT.get(__stdinp$constants.LAYOUT, 0L); + } + + /** + * Setter for variable: + * {@snippet lang=c : + * extern FILE *__stdinp + * } + */ + public static void __stdinp(MemorySegment varValue) { + __stdinp$constants.SEGMENT.set(__stdinp$constants.LAYOUT, 0L, varValue); + } + + private static class __stdoutp$constants { + public static final AddressLayout LAYOUT = somelib_h.C_POINTER; + public static final MemorySegment SEGMENT = somelib_h.findOrThrow("__stdoutp").reinterpret(LAYOUT.byteSize()); + } + + /** + * Layout for variable: + * {@snippet lang=c : + * extern FILE *__stdoutp + * } + */ + public static AddressLayout __stdoutp$layout() { + return __stdoutp$constants.LAYOUT; + } + + /** + * Segment for variable: + * {@snippet lang=c : + * extern FILE *__stdoutp + * } + */ + public static MemorySegment __stdoutp$segment() { + return __stdoutp$constants.SEGMENT; + } + + /** + * Getter for variable: + * {@snippet lang=c : + * extern FILE *__stdoutp + * } + */ + public static MemorySegment __stdoutp() { + return __stdoutp$constants.SEGMENT.get(__stdoutp$constants.LAYOUT, 0L); + } + + /** + * Setter for variable: + * {@snippet lang=c : + * extern FILE *__stdoutp + * } + */ + public static void __stdoutp(MemorySegment varValue) { + __stdoutp$constants.SEGMENT.set(__stdoutp$constants.LAYOUT, 0L, varValue); + } + + private static class __stderrp$constants { + public static final AddressLayout LAYOUT = somelib_h.C_POINTER; + public static final MemorySegment SEGMENT = somelib_h.findOrThrow("__stderrp").reinterpret(LAYOUT.byteSize()); + } + + /** + * Layout for variable: + * {@snippet lang=c : + * extern FILE *__stderrp + * } + */ + public static AddressLayout __stderrp$layout() { + return __stderrp$constants.LAYOUT; + } + + /** + * Segment for variable: + * {@snippet lang=c : + * extern FILE *__stderrp + * } + */ + public static MemorySegment __stderrp$segment() { + return __stderrp$constants.SEGMENT; + } + + /** + * Getter for variable: + * {@snippet lang=c : + * extern FILE *__stderrp + * } + */ + public static MemorySegment __stderrp() { + return __stderrp$constants.SEGMENT.get(__stderrp$constants.LAYOUT, 0L); + } + + /** + * Setter for variable: + * {@snippet lang=c : + * extern FILE *__stderrp + * } + */ + public static void __stderrp(MemorySegment varValue) { + __stderrp$constants.SEGMENT.set(__stderrp$constants.LAYOUT, 0L, varValue); + } + + private static class clearerr { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("clearerr"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void clearerr(FILE *) + * } + */ + public static FunctionDescriptor clearerr$descriptor() { + return clearerr.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void clearerr(FILE *) + * } + */ + public static MethodHandle clearerr$handle() { + return clearerr.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void clearerr(FILE *) + * } + */ + public static MemorySegment clearerr$address() { + return clearerr.ADDR; + } + + /** + * {@snippet lang=c : + * void clearerr(FILE *) + * } + */ + public static void clearerr(MemorySegment x0) { + var mh$ = clearerr.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("clearerr", x0); + } + mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class fclose { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("fclose"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int fclose(FILE *) + * } + */ + public static FunctionDescriptor fclose$descriptor() { + return fclose.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int fclose(FILE *) + * } + */ + public static MethodHandle fclose$handle() { + return fclose.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int fclose(FILE *) + * } + */ + public static MemorySegment fclose$address() { + return fclose.ADDR; + } + + /** + * {@snippet lang=c : + * int fclose(FILE *) + * } + */ + public static int fclose(MemorySegment x0) { + var mh$ = fclose.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fclose", x0); + } + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class feof { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("feof"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int feof(FILE *) + * } + */ + public static FunctionDescriptor feof$descriptor() { + return feof.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int feof(FILE *) + * } + */ + public static MethodHandle feof$handle() { + return feof.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int feof(FILE *) + * } + */ + public static MemorySegment feof$address() { + return feof.ADDR; + } + + /** + * {@snippet lang=c : + * int feof(FILE *) + * } + */ + public static int feof(MemorySegment x0) { + var mh$ = feof.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("feof", x0); + } + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class ferror { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("ferror"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int ferror(FILE *) + * } + */ + public static FunctionDescriptor ferror$descriptor() { + return ferror.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int ferror(FILE *) + * } + */ + public static MethodHandle ferror$handle() { + return ferror.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int ferror(FILE *) + * } + */ + public static MemorySegment ferror$address() { + return ferror.ADDR; + } + + /** + * {@snippet lang=c : + * int ferror(FILE *) + * } + */ + public static int ferror(MemorySegment x0) { + var mh$ = ferror.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("ferror", x0); + } + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class fflush { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("fflush"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int fflush(FILE *) + * } + */ + public static FunctionDescriptor fflush$descriptor() { + return fflush.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int fflush(FILE *) + * } + */ + public static MethodHandle fflush$handle() { + return fflush.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int fflush(FILE *) + * } + */ + public static MemorySegment fflush$address() { + return fflush.ADDR; + } + + /** + * {@snippet lang=c : + * int fflush(FILE *) + * } + */ + public static int fflush(MemorySegment x0) { + var mh$ = fflush.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fflush", x0); + } + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class fgetc { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("fgetc"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int fgetc(FILE *) + * } + */ + public static FunctionDescriptor fgetc$descriptor() { + return fgetc.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int fgetc(FILE *) + * } + */ + public static MethodHandle fgetc$handle() { + return fgetc.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int fgetc(FILE *) + * } + */ + public static MemorySegment fgetc$address() { + return fgetc.ADDR; + } + + /** + * {@snippet lang=c : + * int fgetc(FILE *) + * } + */ + public static int fgetc(MemorySegment x0) { + var mh$ = fgetc.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fgetc", x0); + } + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class fgetpos { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("fgetpos"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int fgetpos(FILE *restrict, fpos_t *) + * } + */ + public static FunctionDescriptor fgetpos$descriptor() { + return fgetpos.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int fgetpos(FILE *restrict, fpos_t *) + * } + */ + public static MethodHandle fgetpos$handle() { + return fgetpos.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int fgetpos(FILE *restrict, fpos_t *) + * } + */ + public static MemorySegment fgetpos$address() { + return fgetpos.ADDR; + } + + /** + * {@snippet lang=c : + * int fgetpos(FILE *restrict, fpos_t *) + * } + */ + public static int fgetpos(MemorySegment x0, MemorySegment x1) { + var mh$ = fgetpos.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fgetpos", x0, x1); + } + return (int)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class fgets { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("fgets"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * char *fgets(char *restrict, int, FILE *) + * } + */ + public static FunctionDescriptor fgets$descriptor() { + return fgets.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * char *fgets(char *restrict, int, FILE *) + * } + */ + public static MethodHandle fgets$handle() { + return fgets.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * char *fgets(char *restrict, int, FILE *) + * } + */ + public static MemorySegment fgets$address() { + return fgets.ADDR; + } + + /** + * {@snippet lang=c : + * char *fgets(char *restrict, int, FILE *) + * } + */ + public static MemorySegment fgets(MemorySegment x0, int x1, MemorySegment x2) { + var mh$ = fgets.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fgets", x0, x1, x2); + } + return (MemorySegment)mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class fopen { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("fopen"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * FILE *fopen(const char *restrict __filename, const char *restrict __mode) + * } + */ + public static FunctionDescriptor fopen$descriptor() { + return fopen.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * FILE *fopen(const char *restrict __filename, const char *restrict __mode) + * } + */ + public static MethodHandle fopen$handle() { + return fopen.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * FILE *fopen(const char *restrict __filename, const char *restrict __mode) + * } + */ + public static MemorySegment fopen$address() { + return fopen.ADDR; + } + + /** + * {@snippet lang=c : + * FILE *fopen(const char *restrict __filename, const char *restrict __mode) + * } + */ + public static MemorySegment fopen(MemorySegment __filename, MemorySegment __mode) { + var mh$ = fopen.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fopen", __filename, __mode); + } + return (MemorySegment)mh$.invokeExact(__filename, __mode); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + /** + * Variadic invoker class for: + * {@snippet lang=c : + * int fprintf(FILE *restrict, const char *restrict, ...) + * } + */ + public static class fprintf { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("fprintf"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private fprintf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * int fprintf(FILE *restrict, const char *restrict, ...) + * } + */ + public static fprintf makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new fprintf(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public int apply(MemorySegment x0, MemorySegment x1, Object... x2) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fprintf", x0, x1, x2); + } + return (int)spreader.invokeExact(x0, x1, x2); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static class fputc { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("fputc"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int fputc(int, FILE *) + * } + */ + public static FunctionDescriptor fputc$descriptor() { + return fputc.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int fputc(int, FILE *) + * } + */ + public static MethodHandle fputc$handle() { + return fputc.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int fputc(int, FILE *) + * } + */ + public static MemorySegment fputc$address() { + return fputc.ADDR; + } + + /** + * {@snippet lang=c : + * int fputc(int, FILE *) + * } + */ + public static int fputc(int x0, MemorySegment x1) { + var mh$ = fputc.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fputc", x0, x1); + } + return (int)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class fputs { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("fputs"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int fputs(const char *restrict, FILE *restrict) + * } + */ + public static FunctionDescriptor fputs$descriptor() { + return fputs.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int fputs(const char *restrict, FILE *restrict) + * } + */ + public static MethodHandle fputs$handle() { + return fputs.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int fputs(const char *restrict, FILE *restrict) + * } + */ + public static MemorySegment fputs$address() { + return fputs.ADDR; + } + + /** + * {@snippet lang=c : + * int fputs(const char *restrict, FILE *restrict) + * } + */ + public static int fputs(MemorySegment x0, MemorySegment x1) { + var mh$ = fputs.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fputs", x0, x1); + } + return (int)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class fread { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_LONG, + somelib_h.C_POINTER, + somelib_h.C_LONG, + somelib_h.C_LONG, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("fread"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * unsigned long fread(void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) + * } + */ + public static FunctionDescriptor fread$descriptor() { + return fread.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * unsigned long fread(void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) + * } + */ + public static MethodHandle fread$handle() { + return fread.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * unsigned long fread(void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) + * } + */ + public static MemorySegment fread$address() { + return fread.ADDR; + } + + /** + * {@snippet lang=c : + * unsigned long fread(void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) + * } + */ + public static long fread(MemorySegment __ptr, long __size, long __nitems, MemorySegment __stream) { + var mh$ = fread.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fread", __ptr, __size, __nitems, __stream); + } + return (long)mh$.invokeExact(__ptr, __size, __nitems, __stream); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class freopen { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("freopen"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * FILE *freopen(const char *restrict, const char *restrict, FILE *restrict) + * } + */ + public static FunctionDescriptor freopen$descriptor() { + return freopen.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * FILE *freopen(const char *restrict, const char *restrict, FILE *restrict) + * } + */ + public static MethodHandle freopen$handle() { + return freopen.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * FILE *freopen(const char *restrict, const char *restrict, FILE *restrict) + * } + */ + public static MemorySegment freopen$address() { + return freopen.ADDR; + } + + /** + * {@snippet lang=c : + * FILE *freopen(const char *restrict, const char *restrict, FILE *restrict) + * } + */ + public static MemorySegment freopen(MemorySegment x0, MemorySegment x1, MemorySegment x2) { + var mh$ = freopen.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("freopen", x0, x1, x2); + } + return (MemorySegment)mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + /** + * Variadic invoker class for: + * {@snippet lang=c : + * int fscanf(FILE *restrict, const char *restrict, ...) + * } + */ + public static class fscanf { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("fscanf"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private fscanf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * int fscanf(FILE *restrict, const char *restrict, ...) + * } + */ + public static fscanf makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new fscanf(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public int apply(MemorySegment x0, MemorySegment x1, Object... x2) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fscanf", x0, x1, x2); + } + return (int)spreader.invokeExact(x0, x1, x2); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static class fseek { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_LONG, + somelib_h.C_INT + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("fseek"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int fseek(FILE *, long, int) + * } + */ + public static FunctionDescriptor fseek$descriptor() { + return fseek.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int fseek(FILE *, long, int) + * } + */ + public static MethodHandle fseek$handle() { + return fseek.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int fseek(FILE *, long, int) + * } + */ + public static MemorySegment fseek$address() { + return fseek.ADDR; + } + + /** + * {@snippet lang=c : + * int fseek(FILE *, long, int) + * } + */ + public static int fseek(MemorySegment x0, long x1, int x2) { + var mh$ = fseek.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fseek", x0, x1, x2); + } + return (int)mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class fsetpos { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("fsetpos"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int fsetpos(FILE *, const fpos_t *) + * } + */ + public static FunctionDescriptor fsetpos$descriptor() { + return fsetpos.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int fsetpos(FILE *, const fpos_t *) + * } + */ + public static MethodHandle fsetpos$handle() { + return fsetpos.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int fsetpos(FILE *, const fpos_t *) + * } + */ + public static MemorySegment fsetpos$address() { + return fsetpos.ADDR; + } + + /** + * {@snippet lang=c : + * int fsetpos(FILE *, const fpos_t *) + * } + */ + public static int fsetpos(MemorySegment x0, MemorySegment x1) { + var mh$ = fsetpos.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fsetpos", x0, x1); + } + return (int)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class ftell { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_LONG, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("ftell"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * long ftell(FILE *) + * } + */ + public static FunctionDescriptor ftell$descriptor() { + return ftell.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * long ftell(FILE *) + * } + */ + public static MethodHandle ftell$handle() { + return ftell.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * long ftell(FILE *) + * } + */ + public static MemorySegment ftell$address() { + return ftell.ADDR; + } + + /** + * {@snippet lang=c : + * long ftell(FILE *) + * } + */ + public static long ftell(MemorySegment x0) { + var mh$ = ftell.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("ftell", x0); + } + return (long)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class fwrite { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_LONG, + somelib_h.C_POINTER, + somelib_h.C_LONG, + somelib_h.C_LONG, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("fwrite"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * unsigned long fwrite(const void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) + * } + */ + public static FunctionDescriptor fwrite$descriptor() { + return fwrite.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * unsigned long fwrite(const void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) + * } + */ + public static MethodHandle fwrite$handle() { + return fwrite.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * unsigned long fwrite(const void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) + * } + */ + public static MemorySegment fwrite$address() { + return fwrite.ADDR; + } + + /** + * {@snippet lang=c : + * unsigned long fwrite(const void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) + * } + */ + public static long fwrite(MemorySegment __ptr, long __size, long __nitems, MemorySegment __stream) { + var mh$ = fwrite.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fwrite", __ptr, __size, __nitems, __stream); + } + return (long)mh$.invokeExact(__ptr, __size, __nitems, __stream); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class getc { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("getc"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int getc(FILE *) + * } + */ + public static FunctionDescriptor getc$descriptor() { + return getc.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int getc(FILE *) + * } + */ + public static MethodHandle getc$handle() { + return getc.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int getc(FILE *) + * } + */ + public static MemorySegment getc$address() { + return getc.ADDR; + } + + /** + * {@snippet lang=c : + * int getc(FILE *) + * } + */ + public static int getc(MemorySegment x0) { + var mh$ = getc.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("getc", x0); + } + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class getchar { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("getchar"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int getchar() + * } + */ + public static FunctionDescriptor getchar$descriptor() { + return getchar.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int getchar() + * } + */ + public static MethodHandle getchar$handle() { + return getchar.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int getchar() + * } + */ + public static MemorySegment getchar$address() { + return getchar.ADDR; + } + + /** + * {@snippet lang=c : + * int getchar() + * } + */ + public static int getchar() { + var mh$ = getchar.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("getchar"); + } + return (int)mh$.invokeExact(); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class gets { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("gets"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * char *gets(char *) + * } + */ + public static FunctionDescriptor gets$descriptor() { + return gets.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * char *gets(char *) + * } + */ + public static MethodHandle gets$handle() { + return gets.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * char *gets(char *) + * } + */ + public static MemorySegment gets$address() { + return gets.ADDR; + } + + /** + * {@snippet lang=c : + * char *gets(char *) + * } + */ + public static MemorySegment gets(MemorySegment x0) { + var mh$ = gets.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("gets", x0); + } + return (MemorySegment)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class perror { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("perror"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void perror(const char *) + * } + */ + public static FunctionDescriptor perror$descriptor() { + return perror.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void perror(const char *) + * } + */ + public static MethodHandle perror$handle() { + return perror.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void perror(const char *) + * } + */ + public static MemorySegment perror$address() { + return perror.ADDR; + } + + /** + * {@snippet lang=c : + * void perror(const char *) + * } + */ + public static void perror(MemorySegment x0) { + var mh$ = perror.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("perror", x0); + } + mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + /** + * Variadic invoker class for: + * {@snippet lang=c : + * int printf(const char *restrict, ...) + * } + */ + public static class printf { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER + ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("printf"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private printf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * int printf(const char *restrict, ...) + * } + */ + public static printf makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new printf(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public int apply(MemorySegment x0, Object... x1) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("printf", x0, x1); + } + return (int)spreader.invokeExact(x0, x1); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static class putc { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("putc"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int putc(int, FILE *) + * } + */ + public static FunctionDescriptor putc$descriptor() { + return putc.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int putc(int, FILE *) + * } + */ + public static MethodHandle putc$handle() { + return putc.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int putc(int, FILE *) + * } + */ + public static MemorySegment putc$address() { + return putc.ADDR; + } + + /** + * {@snippet lang=c : + * int putc(int, FILE *) + * } + */ + public static int putc(int x0, MemorySegment x1) { + var mh$ = putc.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("putc", x0, x1); + } + return (int)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class putchar { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_INT + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("putchar"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int putchar(int) + * } + */ + public static FunctionDescriptor putchar$descriptor() { + return putchar.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int putchar(int) + * } + */ + public static MethodHandle putchar$handle() { + return putchar.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int putchar(int) + * } + */ + public static MemorySegment putchar$address() { + return putchar.ADDR; + } + + /** + * {@snippet lang=c : + * int putchar(int) + * } + */ + public static int putchar(int x0) { + var mh$ = putchar.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("putchar", x0); + } + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class puts { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("puts"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int puts(const char *) + * } + */ + public static FunctionDescriptor puts$descriptor() { + return puts.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int puts(const char *) + * } + */ + public static MethodHandle puts$handle() { + return puts.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int puts(const char *) + * } + */ + public static MemorySegment puts$address() { + return puts.ADDR; + } + + /** + * {@snippet lang=c : + * int puts(const char *) + * } + */ + public static int puts(MemorySegment x0) { + var mh$ = puts.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("puts", x0); + } + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class remove { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("remove"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int remove(const char *) + * } + */ + public static FunctionDescriptor remove$descriptor() { + return remove.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int remove(const char *) + * } + */ + public static MethodHandle remove$handle() { + return remove.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int remove(const char *) + * } + */ + public static MemorySegment remove$address() { + return remove.ADDR; + } + + /** + * {@snippet lang=c : + * int remove(const char *) + * } + */ + public static int remove(MemorySegment x0) { + var mh$ = remove.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("remove", x0); + } + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class rename { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("rename"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int rename(const char *__old, const char *__new) + * } + */ + public static FunctionDescriptor rename$descriptor() { + return rename.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int rename(const char *__old, const char *__new) + * } + */ + public static MethodHandle rename$handle() { + return rename.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int rename(const char *__old, const char *__new) + * } + */ + public static MemorySegment rename$address() { + return rename.ADDR; + } + + /** + * {@snippet lang=c : + * int rename(const char *__old, const char *__new) + * } + */ + public static int rename(MemorySegment __old, MemorySegment __new) { + var mh$ = rename.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("rename", __old, __new); + } + return (int)mh$.invokeExact(__old, __new); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class rewind { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("rewind"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void rewind(FILE *) + * } + */ + public static FunctionDescriptor rewind$descriptor() { + return rewind.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void rewind(FILE *) + * } + */ + public static MethodHandle rewind$handle() { + return rewind.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void rewind(FILE *) + * } + */ + public static MemorySegment rewind$address() { + return rewind.ADDR; + } + + /** + * {@snippet lang=c : + * void rewind(FILE *) + * } + */ + public static void rewind(MemorySegment x0) { + var mh$ = rewind.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("rewind", x0); + } + mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + /** + * Variadic invoker class for: + * {@snippet lang=c : + * int scanf(const char *restrict, ...) + * } + */ + public static class scanf { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER + ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("scanf"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private scanf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * int scanf(const char *restrict, ...) + * } + */ + public static scanf makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new scanf(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public int apply(MemorySegment x0, Object... x1) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("scanf", x0, x1); + } + return (int)spreader.invokeExact(x0, x1); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static class setbuf { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("setbuf"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void setbuf(FILE *restrict, char *restrict) + * } + */ + public static FunctionDescriptor setbuf$descriptor() { + return setbuf.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void setbuf(FILE *restrict, char *restrict) + * } + */ + public static MethodHandle setbuf$handle() { + return setbuf.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void setbuf(FILE *restrict, char *restrict) + * } + */ + public static MemorySegment setbuf$address() { + return setbuf.ADDR; + } + + /** + * {@snippet lang=c : + * void setbuf(FILE *restrict, char *restrict) + * } + */ + public static void setbuf(MemorySegment x0, MemorySegment x1) { + var mh$ = setbuf.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("setbuf", x0, x1); + } + mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class setvbuf { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_INT, + somelib_h.C_LONG + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("setvbuf"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int setvbuf(FILE *restrict, char *restrict, int, size_t) + * } + */ + public static FunctionDescriptor setvbuf$descriptor() { + return setvbuf.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int setvbuf(FILE *restrict, char *restrict, int, size_t) + * } + */ + public static MethodHandle setvbuf$handle() { + return setvbuf.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int setvbuf(FILE *restrict, char *restrict, int, size_t) + * } + */ + public static MemorySegment setvbuf$address() { + return setvbuf.ADDR; + } + + /** + * {@snippet lang=c : + * int setvbuf(FILE *restrict, char *restrict, int, size_t) + * } + */ + public static int setvbuf(MemorySegment x0, MemorySegment x1, int x2, long x3) { + var mh$ = setvbuf.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("setvbuf", x0, x1, x2, x3); + } + return (int)mh$.invokeExact(x0, x1, x2, x3); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + /** + * Variadic invoker class for: + * {@snippet lang=c : + * int sprintf(char *restrict, const char *restrict, ...) + * } + */ + public static class sprintf { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("sprintf"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private sprintf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * int sprintf(char *restrict, const char *restrict, ...) + * } + */ + public static sprintf makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new sprintf(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public int apply(MemorySegment x0, MemorySegment x1, Object... x2) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("sprintf", x0, x1, x2); + } + return (int)spreader.invokeExact(x0, x1, x2); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + /** + * Variadic invoker class for: + * {@snippet lang=c : + * int sscanf(const char *restrict, const char *restrict, ...) + * } + */ + public static class sscanf { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("sscanf"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private sscanf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * int sscanf(const char *restrict, const char *restrict, ...) + * } + */ + public static sscanf makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new sscanf(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public int apply(MemorySegment x0, MemorySegment x1, Object... x2) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("sscanf", x0, x1, x2); + } + return (int)spreader.invokeExact(x0, x1, x2); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static class tmpfile { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("tmpfile"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * FILE *tmpfile() + * } + */ + public static FunctionDescriptor tmpfile$descriptor() { + return tmpfile.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * FILE *tmpfile() + * } + */ + public static MethodHandle tmpfile$handle() { + return tmpfile.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * FILE *tmpfile() + * } + */ + public static MemorySegment tmpfile$address() { + return tmpfile.ADDR; + } + + /** + * {@snippet lang=c : + * FILE *tmpfile() + * } + */ + public static MemorySegment tmpfile() { + var mh$ = tmpfile.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("tmpfile"); + } + return (MemorySegment)mh$.invokeExact(); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class tmpnam { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("tmpnam"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * char *tmpnam(char *) + * } + */ + public static FunctionDescriptor tmpnam$descriptor() { + return tmpnam.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * char *tmpnam(char *) + * } + */ + public static MethodHandle tmpnam$handle() { + return tmpnam.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * char *tmpnam(char *) + * } + */ + public static MemorySegment tmpnam$address() { + return tmpnam.ADDR; + } + + /** + * {@snippet lang=c : + * char *tmpnam(char *) + * } + */ + public static MemorySegment tmpnam(MemorySegment x0) { + var mh$ = tmpnam.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("tmpnam", x0); + } + return (MemorySegment)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class ungetc { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("ungetc"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int ungetc(int, FILE *) + * } + */ + public static FunctionDescriptor ungetc$descriptor() { + return ungetc.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int ungetc(int, FILE *) + * } + */ + public static MethodHandle ungetc$handle() { + return ungetc.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int ungetc(int, FILE *) + * } + */ + public static MemorySegment ungetc$address() { + return ungetc.ADDR; + } + + /** + * {@snippet lang=c : + * int ungetc(int, FILE *) + * } + */ + public static int ungetc(int x0, MemorySegment x1) { + var mh$ = ungetc.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("ungetc", x0, x1); + } + return (int)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class vfprintf { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("vfprintf"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int vfprintf(FILE *restrict, const char *restrict, va_list) + * } + */ + public static FunctionDescriptor vfprintf$descriptor() { + return vfprintf.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int vfprintf(FILE *restrict, const char *restrict, va_list) + * } + */ + public static MethodHandle vfprintf$handle() { + return vfprintf.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int vfprintf(FILE *restrict, const char *restrict, va_list) + * } + */ + public static MemorySegment vfprintf$address() { + return vfprintf.ADDR; + } + + /** + * {@snippet lang=c : + * int vfprintf(FILE *restrict, const char *restrict, va_list) + * } + */ + public static int vfprintf(MemorySegment x0, MemorySegment x1, MemorySegment x2) { + var mh$ = vfprintf.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("vfprintf", x0, x1, x2); + } + return (int)mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class vprintf { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("vprintf"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int vprintf(const char *restrict, va_list) + * } + */ + public static FunctionDescriptor vprintf$descriptor() { + return vprintf.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int vprintf(const char *restrict, va_list) + * } + */ + public static MethodHandle vprintf$handle() { + return vprintf.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int vprintf(const char *restrict, va_list) + * } + */ + public static MemorySegment vprintf$address() { + return vprintf.ADDR; + } + + /** + * {@snippet lang=c : + * int vprintf(const char *restrict, va_list) + * } + */ + public static int vprintf(MemorySegment x0, MemorySegment x1) { + var mh$ = vprintf.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("vprintf", x0, x1); + } + return (int)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class vsprintf { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("vsprintf"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int vsprintf(char *restrict, const char *restrict, va_list) + * } + */ + public static FunctionDescriptor vsprintf$descriptor() { + return vsprintf.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int vsprintf(char *restrict, const char *restrict, va_list) + * } + */ + public static MethodHandle vsprintf$handle() { + return vsprintf.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int vsprintf(char *restrict, const char *restrict, va_list) + * } + */ + public static MemorySegment vsprintf$address() { + return vsprintf.ADDR; + } + + /** + * {@snippet lang=c : + * int vsprintf(char *restrict, const char *restrict, va_list) + * } + */ + public static int vsprintf(MemorySegment x0, MemorySegment x1, MemorySegment x2) { + var mh$ = vsprintf.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("vsprintf", x0, x1, x2); + } + return (int)mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class ctermid { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("ctermid"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * char *ctermid(char *) + * } + */ + public static FunctionDescriptor ctermid$descriptor() { + return ctermid.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * char *ctermid(char *) + * } + */ + public static MethodHandle ctermid$handle() { + return ctermid.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * char *ctermid(char *) + * } + */ + public static MemorySegment ctermid$address() { + return ctermid.ADDR; + } + + /** + * {@snippet lang=c : + * char *ctermid(char *) + * } + */ + public static MemorySegment ctermid(MemorySegment x0) { + var mh$ = ctermid.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("ctermid", x0); + } + return (MemorySegment)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class fdopen { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("fdopen"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * FILE *fdopen(int, const char *) + * } + */ + public static FunctionDescriptor fdopen$descriptor() { + return fdopen.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * FILE *fdopen(int, const char *) + * } + */ + public static MethodHandle fdopen$handle() { + return fdopen.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * FILE *fdopen(int, const char *) + * } + */ + public static MemorySegment fdopen$address() { + return fdopen.ADDR; + } + + /** + * {@snippet lang=c : + * FILE *fdopen(int, const char *) + * } + */ + public static MemorySegment fdopen(int x0, MemorySegment x1) { + var mh$ = fdopen.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fdopen", x0, x1); + } + return (MemorySegment)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class fileno { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("fileno"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int fileno(FILE *) + * } + */ + public static FunctionDescriptor fileno$descriptor() { + return fileno.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int fileno(FILE *) + * } + */ + public static MethodHandle fileno$handle() { + return fileno.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int fileno(FILE *) + * } + */ + public static MemorySegment fileno$address() { + return fileno.ADDR; + } + + /** + * {@snippet lang=c : + * int fileno(FILE *) + * } + */ + public static int fileno(MemorySegment x0) { + var mh$ = fileno.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fileno", x0); + } + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class pclose { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("pclose"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int pclose(FILE *) + * } + */ + public static FunctionDescriptor pclose$descriptor() { + return pclose.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int pclose(FILE *) + * } + */ + public static MethodHandle pclose$handle() { + return pclose.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int pclose(FILE *) + * } + */ + public static MemorySegment pclose$address() { + return pclose.ADDR; + } + + /** + * {@snippet lang=c : + * int pclose(FILE *) + * } + */ + public static int pclose(MemorySegment x0) { + var mh$ = pclose.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("pclose", x0); + } + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class popen { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("popen"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * FILE *popen(const char *, const char *) + * } + */ + public static FunctionDescriptor popen$descriptor() { + return popen.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * FILE *popen(const char *, const char *) + * } + */ + public static MethodHandle popen$handle() { + return popen.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * FILE *popen(const char *, const char *) + * } + */ + public static MemorySegment popen$address() { + return popen.ADDR; + } + + /** + * {@snippet lang=c : + * FILE *popen(const char *, const char *) + * } + */ + public static MemorySegment popen(MemorySegment x0, MemorySegment x1) { + var mh$ = popen.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("popen", x0, x1); + } + return (MemorySegment)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class __srget { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("__srget"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int __srget(FILE *) + * } + */ + public static FunctionDescriptor __srget$descriptor() { + return __srget.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int __srget(FILE *) + * } + */ + public static MethodHandle __srget$handle() { + return __srget.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int __srget(FILE *) + * } + */ + public static MemorySegment __srget$address() { + return __srget.ADDR; + } + + /** + * {@snippet lang=c : + * int __srget(FILE *) + * } + */ + public static int __srget(MemorySegment x0) { + var mh$ = __srget.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("__srget", x0); + } + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class __svfscanf { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("__svfscanf"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int __svfscanf(FILE *, const char *, va_list) + * } + */ + public static FunctionDescriptor __svfscanf$descriptor() { + return __svfscanf.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int __svfscanf(FILE *, const char *, va_list) + * } + */ + public static MethodHandle __svfscanf$handle() { + return __svfscanf.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int __svfscanf(FILE *, const char *, va_list) + * } + */ + public static MemorySegment __svfscanf$address() { + return __svfscanf.ADDR; + } + + /** + * {@snippet lang=c : + * int __svfscanf(FILE *, const char *, va_list) + * } + */ + public static int __svfscanf(MemorySegment x0, MemorySegment x1, MemorySegment x2) { + var mh$ = __svfscanf.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("__svfscanf", x0, x1, x2); + } + return (int)mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class __swbuf { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("__swbuf"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int __swbuf(int, FILE *) + * } + */ + public static FunctionDescriptor __swbuf$descriptor() { + return __swbuf.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int __swbuf(int, FILE *) + * } + */ + public static MethodHandle __swbuf$handle() { + return __swbuf.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int __swbuf(int, FILE *) + * } + */ + public static MemorySegment __swbuf$address() { + return __swbuf.ADDR; + } + + /** + * {@snippet lang=c : + * int __swbuf(int, FILE *) + * } + */ + public static int __swbuf(int x0, MemorySegment x1) { + var mh$ = __swbuf.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("__swbuf", x0, x1); + } + return (int)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class flockfile { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("flockfile"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void flockfile(FILE *) + * } + */ + public static FunctionDescriptor flockfile$descriptor() { + return flockfile.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void flockfile(FILE *) + * } + */ + public static MethodHandle flockfile$handle() { + return flockfile.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void flockfile(FILE *) + * } + */ + public static MemorySegment flockfile$address() { + return flockfile.ADDR; + } + + /** + * {@snippet lang=c : + * void flockfile(FILE *) + * } + */ + public static void flockfile(MemorySegment x0) { + var mh$ = flockfile.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("flockfile", x0); + } + mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class ftrylockfile { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("ftrylockfile"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int ftrylockfile(FILE *) + * } + */ + public static FunctionDescriptor ftrylockfile$descriptor() { + return ftrylockfile.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int ftrylockfile(FILE *) + * } + */ + public static MethodHandle ftrylockfile$handle() { + return ftrylockfile.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int ftrylockfile(FILE *) + * } + */ + public static MemorySegment ftrylockfile$address() { + return ftrylockfile.ADDR; + } + + /** + * {@snippet lang=c : + * int ftrylockfile(FILE *) + * } + */ + public static int ftrylockfile(MemorySegment x0) { + var mh$ = ftrylockfile.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("ftrylockfile", x0); + } + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class funlockfile { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("funlockfile"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void funlockfile(FILE *) + * } + */ + public static FunctionDescriptor funlockfile$descriptor() { + return funlockfile.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void funlockfile(FILE *) + * } + */ + public static MethodHandle funlockfile$handle() { + return funlockfile.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void funlockfile(FILE *) + * } + */ + public static MemorySegment funlockfile$address() { + return funlockfile.ADDR; + } + + /** + * {@snippet lang=c : + * void funlockfile(FILE *) + * } + */ + public static void funlockfile(MemorySegment x0) { + var mh$ = funlockfile.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("funlockfile", x0); + } + mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class getc_unlocked { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("getc_unlocked"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int getc_unlocked(FILE *) + * } + */ + public static FunctionDescriptor getc_unlocked$descriptor() { + return getc_unlocked.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int getc_unlocked(FILE *) + * } + */ + public static MethodHandle getc_unlocked$handle() { + return getc_unlocked.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int getc_unlocked(FILE *) + * } + */ + public static MemorySegment getc_unlocked$address() { + return getc_unlocked.ADDR; + } + + /** + * {@snippet lang=c : + * int getc_unlocked(FILE *) + * } + */ + public static int getc_unlocked(MemorySegment x0) { + var mh$ = getc_unlocked.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("getc_unlocked", x0); + } + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class getchar_unlocked { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("getchar_unlocked"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int getchar_unlocked() + * } + */ + public static FunctionDescriptor getchar_unlocked$descriptor() { + return getchar_unlocked.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int getchar_unlocked() + * } + */ + public static MethodHandle getchar_unlocked$handle() { + return getchar_unlocked.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int getchar_unlocked() + * } + */ + public static MemorySegment getchar_unlocked$address() { + return getchar_unlocked.ADDR; + } + + /** + * {@snippet lang=c : + * int getchar_unlocked() + * } + */ + public static int getchar_unlocked() { + var mh$ = getchar_unlocked.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("getchar_unlocked"); + } + return (int)mh$.invokeExact(); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class putc_unlocked { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("putc_unlocked"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int putc_unlocked(int, FILE *) + * } + */ + public static FunctionDescriptor putc_unlocked$descriptor() { + return putc_unlocked.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int putc_unlocked(int, FILE *) + * } + */ + public static MethodHandle putc_unlocked$handle() { + return putc_unlocked.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int putc_unlocked(int, FILE *) + * } + */ + public static MemorySegment putc_unlocked$address() { + return putc_unlocked.ADDR; + } + + /** + * {@snippet lang=c : + * int putc_unlocked(int, FILE *) + * } + */ + public static int putc_unlocked(int x0, MemorySegment x1) { + var mh$ = putc_unlocked.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("putc_unlocked", x0, x1); + } + return (int)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class putchar_unlocked { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_INT + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("putchar_unlocked"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int putchar_unlocked(int) + * } + */ + public static FunctionDescriptor putchar_unlocked$descriptor() { + return putchar_unlocked.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int putchar_unlocked(int) + * } + */ + public static MethodHandle putchar_unlocked$handle() { + return putchar_unlocked.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int putchar_unlocked(int) + * } + */ + public static MemorySegment putchar_unlocked$address() { + return putchar_unlocked.ADDR; + } + + /** + * {@snippet lang=c : + * int putchar_unlocked(int) + * } + */ + public static int putchar_unlocked(int x0) { + var mh$ = putchar_unlocked.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("putchar_unlocked", x0); + } + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class getw { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("getw"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int getw(FILE *) + * } + */ + public static FunctionDescriptor getw$descriptor() { + return getw.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int getw(FILE *) + * } + */ + public static MethodHandle getw$handle() { + return getw.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int getw(FILE *) + * } + */ + public static MemorySegment getw$address() { + return getw.ADDR; + } + + /** + * {@snippet lang=c : + * int getw(FILE *) + * } + */ + public static int getw(MemorySegment x0) { + var mh$ = getw.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("getw", x0); + } + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class putw { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("putw"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int putw(int, FILE *) + * } + */ + public static FunctionDescriptor putw$descriptor() { + return putw.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int putw(int, FILE *) + * } + */ + public static MethodHandle putw$handle() { + return putw.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int putw(int, FILE *) + * } + */ + public static MemorySegment putw$address() { + return putw.ADDR; + } + + /** + * {@snippet lang=c : + * int putw(int, FILE *) + * } + */ + public static int putw(int x0, MemorySegment x1) { + var mh$ = putw.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("putw", x0, x1); + } + return (int)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class tempnam { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("tempnam"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * char *tempnam(const char *__dir, const char *__prefix) + * } + */ + public static FunctionDescriptor tempnam$descriptor() { + return tempnam.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * char *tempnam(const char *__dir, const char *__prefix) + * } + */ + public static MethodHandle tempnam$handle() { + return tempnam.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * char *tempnam(const char *__dir, const char *__prefix) + * } + */ + public static MemorySegment tempnam$address() { + return tempnam.ADDR; + } + + /** + * {@snippet lang=c : + * char *tempnam(const char *__dir, const char *__prefix) + * } + */ + public static MemorySegment tempnam(MemorySegment __dir, MemorySegment __prefix) { + var mh$ = tempnam.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("tempnam", __dir, __prefix); + } + return (MemorySegment)mh$.invokeExact(__dir, __prefix); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + /** + * {@snippet lang=c : + * typedef __darwin_off_t off_t + * } + */ + public static final OfLong off_t = somelib_h.C_LONG_LONG; + + private static class fseeko { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_LONG_LONG, + somelib_h.C_INT + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("fseeko"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int fseeko(FILE *__stream, off_t __offset, int __whence) + * } + */ + public static FunctionDescriptor fseeko$descriptor() { + return fseeko.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int fseeko(FILE *__stream, off_t __offset, int __whence) + * } + */ + public static MethodHandle fseeko$handle() { + return fseeko.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int fseeko(FILE *__stream, off_t __offset, int __whence) + * } + */ + public static MemorySegment fseeko$address() { + return fseeko.ADDR; + } + + /** + * {@snippet lang=c : + * int fseeko(FILE *__stream, off_t __offset, int __whence) + * } + */ + public static int fseeko(MemorySegment __stream, long __offset, int __whence) { + var mh$ = fseeko.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fseeko", __stream, __offset, __whence); + } + return (int)mh$.invokeExact(__stream, __offset, __whence); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class ftello { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_LONG_LONG, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("ftello"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * off_t ftello(FILE *__stream) + * } + */ + public static FunctionDescriptor ftello$descriptor() { + return ftello.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * off_t ftello(FILE *__stream) + * } + */ + public static MethodHandle ftello$handle() { + return ftello.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * off_t ftello(FILE *__stream) + * } + */ + public static MemorySegment ftello$address() { + return ftello.ADDR; + } + + /** + * {@snippet lang=c : + * off_t ftello(FILE *__stream) + * } + */ + public static long ftello(MemorySegment __stream) { + var mh$ = ftello.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("ftello", __stream); + } + return (long)mh$.invokeExact(__stream); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + /** + * Variadic invoker class for: + * {@snippet lang=c : + * int snprintf(char *restrict __str, size_t __size, const char *restrict __format, ...) + * } + */ + public static class snprintf { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_LONG, + somelib_h.C_POINTER + ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("snprintf"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private snprintf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * int snprintf(char *restrict __str, size_t __size, const char *restrict __format, ...) + * } + */ + public static snprintf makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new snprintf(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public int apply(MemorySegment __str, long __size, MemorySegment __format, Object... x3) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("snprintf", __str, __size, __format, x3); + } + return (int)spreader.invokeExact(__str, __size, __format, x3); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static class vfscanf { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("vfscanf"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int vfscanf(FILE *restrict __stream, const char *restrict __format, va_list) + * } + */ + public static FunctionDescriptor vfscanf$descriptor() { + return vfscanf.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int vfscanf(FILE *restrict __stream, const char *restrict __format, va_list) + * } + */ + public static MethodHandle vfscanf$handle() { + return vfscanf.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int vfscanf(FILE *restrict __stream, const char *restrict __format, va_list) + * } + */ + public static MemorySegment vfscanf$address() { + return vfscanf.ADDR; + } + + /** + * {@snippet lang=c : + * int vfscanf(FILE *restrict __stream, const char *restrict __format, va_list) + * } + */ + public static int vfscanf(MemorySegment __stream, MemorySegment __format, MemorySegment x2) { + var mh$ = vfscanf.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("vfscanf", __stream, __format, x2); + } + return (int)mh$.invokeExact(__stream, __format, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class vscanf { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("vscanf"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int vscanf(const char *restrict __format, va_list) + * } + */ + public static FunctionDescriptor vscanf$descriptor() { + return vscanf.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int vscanf(const char *restrict __format, va_list) + * } + */ + public static MethodHandle vscanf$handle() { + return vscanf.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int vscanf(const char *restrict __format, va_list) + * } + */ + public static MemorySegment vscanf$address() { + return vscanf.ADDR; + } + + /** + * {@snippet lang=c : + * int vscanf(const char *restrict __format, va_list) + * } + */ + public static int vscanf(MemorySegment __format, MemorySegment x1) { + var mh$ = vscanf.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("vscanf", __format, x1); + } + return (int)mh$.invokeExact(__format, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class vsnprintf { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_LONG, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("vsnprintf"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int vsnprintf(char *restrict __str, size_t __size, const char *restrict __format, va_list) + * } + */ + public static FunctionDescriptor vsnprintf$descriptor() { + return vsnprintf.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int vsnprintf(char *restrict __str, size_t __size, const char *restrict __format, va_list) + * } + */ + public static MethodHandle vsnprintf$handle() { + return vsnprintf.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int vsnprintf(char *restrict __str, size_t __size, const char *restrict __format, va_list) + * } + */ + public static MemorySegment vsnprintf$address() { + return vsnprintf.ADDR; + } + + /** + * {@snippet lang=c : + * int vsnprintf(char *restrict __str, size_t __size, const char *restrict __format, va_list) + * } + */ + public static int vsnprintf(MemorySegment __str, long __size, MemorySegment __format, MemorySegment x3) { + var mh$ = vsnprintf.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("vsnprintf", __str, __size, __format, x3); + } + return (int)mh$.invokeExact(__str, __size, __format, x3); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class vsscanf { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("vsscanf"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int vsscanf(const char *restrict __str, const char *restrict __format, va_list) + * } + */ + public static FunctionDescriptor vsscanf$descriptor() { + return vsscanf.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int vsscanf(const char *restrict __str, const char *restrict __format, va_list) + * } + */ + public static MethodHandle vsscanf$handle() { + return vsscanf.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int vsscanf(const char *restrict __str, const char *restrict __format, va_list) + * } + */ + public static MemorySegment vsscanf$address() { + return vsscanf.ADDR; + } + + /** + * {@snippet lang=c : + * int vsscanf(const char *restrict __str, const char *restrict __format, va_list) + * } + */ + public static int vsscanf(MemorySegment __str, MemorySegment __format, MemorySegment x2) { + var mh$ = vsscanf.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("vsscanf", __str, __format, x2); + } + return (int)mh$.invokeExact(__str, __format, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + /** + * {@snippet lang=c : + * typedef __darwin_ssize_t ssize_t + * } + */ + public static final OfLong ssize_t = somelib_h.C_LONG; + + /** + * Variadic invoker class for: + * {@snippet lang=c : + * int dprintf(int, const char *restrict, ...) + * } + */ + public static class dprintf { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_INT, + somelib_h.C_POINTER + ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("dprintf"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private dprintf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * int dprintf(int, const char *restrict, ...) + * } + */ + public static dprintf makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new dprintf(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public int apply(int x0, MemorySegment x1, Object... x2) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("dprintf", x0, x1, x2); + } + return (int)spreader.invokeExact(x0, x1, x2); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static class vdprintf { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("vdprintf"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int vdprintf(int, const char *restrict, va_list) + * } + */ + public static FunctionDescriptor vdprintf$descriptor() { + return vdprintf.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int vdprintf(int, const char *restrict, va_list) + * } + */ + public static MethodHandle vdprintf$handle() { + return vdprintf.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int vdprintf(int, const char *restrict, va_list) + * } + */ + public static MemorySegment vdprintf$address() { + return vdprintf.ADDR; + } + + /** + * {@snippet lang=c : + * int vdprintf(int, const char *restrict, va_list) + * } + */ + public static int vdprintf(int x0, MemorySegment x1, MemorySegment x2) { + var mh$ = vdprintf.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("vdprintf", x0, x1, x2); + } + return (int)mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class getdelim { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_LONG, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("getdelim"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * ssize_t getdelim(char **restrict __linep, size_t *restrict __linecapp, int __delimiter, FILE *restrict __stream) + * } + */ + public static FunctionDescriptor getdelim$descriptor() { + return getdelim.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * ssize_t getdelim(char **restrict __linep, size_t *restrict __linecapp, int __delimiter, FILE *restrict __stream) + * } + */ + public static MethodHandle getdelim$handle() { + return getdelim.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * ssize_t getdelim(char **restrict __linep, size_t *restrict __linecapp, int __delimiter, FILE *restrict __stream) + * } + */ + public static MemorySegment getdelim$address() { + return getdelim.ADDR; + } + + /** + * {@snippet lang=c : + * ssize_t getdelim(char **restrict __linep, size_t *restrict __linecapp, int __delimiter, FILE *restrict __stream) + * } + */ + public static long getdelim(MemorySegment __linep, MemorySegment __linecapp, int __delimiter, MemorySegment __stream) { + var mh$ = getdelim.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("getdelim", __linep, __linecapp, __delimiter, __stream); + } + return (long)mh$.invokeExact(__linep, __linecapp, __delimiter, __stream); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class getline { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_LONG, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("getline"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * ssize_t getline(char **restrict __linep, size_t *restrict __linecapp, FILE *restrict __stream) + * } + */ + public static FunctionDescriptor getline$descriptor() { + return getline.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * ssize_t getline(char **restrict __linep, size_t *restrict __linecapp, FILE *restrict __stream) + * } + */ + public static MethodHandle getline$handle() { + return getline.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * ssize_t getline(char **restrict __linep, size_t *restrict __linecapp, FILE *restrict __stream) + * } + */ + public static MemorySegment getline$address() { + return getline.ADDR; + } + + /** + * {@snippet lang=c : + * ssize_t getline(char **restrict __linep, size_t *restrict __linecapp, FILE *restrict __stream) + * } + */ + public static long getline(MemorySegment __linep, MemorySegment __linecapp, MemorySegment __stream) { + var mh$ = getline.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("getline", __linep, __linecapp, __stream); + } + return (long)mh$.invokeExact(__linep, __linecapp, __stream); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class fmemopen { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("fmemopen"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * FILE *fmemopen(void *restrict __buf, size_t __size, const char *restrict __mode) + * } + */ + public static FunctionDescriptor fmemopen$descriptor() { + return fmemopen.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * FILE *fmemopen(void *restrict __buf, size_t __size, const char *restrict __mode) + * } + */ + public static MethodHandle fmemopen$handle() { + return fmemopen.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * FILE *fmemopen(void *restrict __buf, size_t __size, const char *restrict __mode) + * } + */ + public static MemorySegment fmemopen$address() { + return fmemopen.ADDR; + } + + /** + * {@snippet lang=c : + * FILE *fmemopen(void *restrict __buf, size_t __size, const char *restrict __mode) + * } + */ + public static MemorySegment fmemopen(MemorySegment __buf, long __size, MemorySegment __mode) { + var mh$ = fmemopen.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fmemopen", __buf, __size, __mode); + } + return (MemorySegment)mh$.invokeExact(__buf, __size, __mode); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class open_memstream { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("open_memstream"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * FILE *open_memstream(char **__bufp, size_t *__sizep) + * } + */ + public static FunctionDescriptor open_memstream$descriptor() { + return open_memstream.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * FILE *open_memstream(char **__bufp, size_t *__sizep) + * } + */ + public static MethodHandle open_memstream$handle() { + return open_memstream.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * FILE *open_memstream(char **__bufp, size_t *__sizep) + * } + */ + public static MemorySegment open_memstream$address() { + return open_memstream.ADDR; + } + + /** + * {@snippet lang=c : + * FILE *open_memstream(char **__bufp, size_t *__sizep) + * } + */ + public static MemorySegment open_memstream(MemorySegment __bufp, MemorySegment __sizep) { + var mh$ = open_memstream.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("open_memstream", __bufp, __sizep); + } + return (MemorySegment)mh$.invokeExact(__bufp, __sizep); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class sys_nerr$constants { + public static final OfInt LAYOUT = somelib_h.C_INT; + public static final MemorySegment SEGMENT = somelib_h.findOrThrow("sys_nerr").reinterpret(LAYOUT.byteSize()); + } + + /** + * Layout for variable: + * {@snippet lang=c : + * extern const int sys_nerr + * } + */ + public static OfInt sys_nerr$layout() { + return sys_nerr$constants.LAYOUT; + } + + /** + * Segment for variable: + * {@snippet lang=c : + * extern const int sys_nerr + * } + */ + public static MemorySegment sys_nerr$segment() { + return sys_nerr$constants.SEGMENT; + } + + /** + * Getter for variable: + * {@snippet lang=c : + * extern const int sys_nerr + * } + */ + public static int sys_nerr() { + return sys_nerr$constants.SEGMENT.get(sys_nerr$constants.LAYOUT, 0L); + } + + /** + * Setter for variable: + * {@snippet lang=c : + * extern const int sys_nerr + * } + */ + public static void sys_nerr(int varValue) { + sys_nerr$constants.SEGMENT.set(sys_nerr$constants.LAYOUT, 0L, varValue); + } + + private static class sys_errlist$constants { + public static final SequenceLayout LAYOUT = MemoryLayout.sequenceLayout(0, somelib_h.C_POINTER); + public static final MemorySegment SEGMENT = somelib_h.findOrThrow("sys_errlist").reinterpret(LAYOUT.byteSize()); + public static final VarHandle HANDLE = LAYOUT.varHandle(); + + public static final long[] DIMS = { }; + } + + /** + * Layout for variable: + * {@snippet lang=c : + * extern const char *const sys_errlist[] + * } + */ + public static SequenceLayout sys_errlist$layout() { + return sys_errlist$constants.LAYOUT; + } + + /** + * Dimensions for array variable: + * {@snippet lang=c : + * extern const char *const sys_errlist[] + * } + */ + public static long[] sys_errlist$dimensions() { + return sys_errlist$constants.DIMS; + } + + /** + * Getter for variable: + * {@snippet lang=c : + * extern const char *const sys_errlist[] + * } + */ + public static MemorySegment sys_errlist() { + return sys_errlist$constants.SEGMENT; + } + + /** + * Setter for variable: + * {@snippet lang=c : + * extern const char *const sys_errlist[] + * } + */ + public static void sys_errlist(MemorySegment varValue) { + MemorySegment.copy(varValue, 0L, sys_errlist$constants.SEGMENT, 0L, sys_errlist$constants.LAYOUT.byteSize()); + } + + /** + * Variadic invoker class for: + * {@snippet lang=c : + * int asprintf(char **restrict, const char *restrict, ...) + * } + */ + public static class asprintf { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("asprintf"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private asprintf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * int asprintf(char **restrict, const char *restrict, ...) + * } + */ + public static asprintf makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new asprintf(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public int apply(MemorySegment x0, MemorySegment x1, Object... x2) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("asprintf", x0, x1, x2); + } + return (int)spreader.invokeExact(x0, x1, x2); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static class ctermid_r { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("ctermid_r"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * char *ctermid_r(char *) + * } + */ + public static FunctionDescriptor ctermid_r$descriptor() { + return ctermid_r.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * char *ctermid_r(char *) + * } + */ + public static MethodHandle ctermid_r$handle() { + return ctermid_r.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * char *ctermid_r(char *) + * } + */ + public static MemorySegment ctermid_r$address() { + return ctermid_r.ADDR; + } + + /** + * {@snippet lang=c : + * char *ctermid_r(char *) + * } + */ + public static MemorySegment ctermid_r(MemorySegment x0) { + var mh$ = ctermid_r.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("ctermid_r", x0); + } + return (MemorySegment)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class fgetln { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("fgetln"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * char *fgetln(FILE *, size_t *) + * } + */ + public static FunctionDescriptor fgetln$descriptor() { + return fgetln.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * char *fgetln(FILE *, size_t *) + * } + */ + public static MethodHandle fgetln$handle() { + return fgetln.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * char *fgetln(FILE *, size_t *) + * } + */ + public static MemorySegment fgetln$address() { + return fgetln.ADDR; + } + + /** + * {@snippet lang=c : + * char *fgetln(FILE *, size_t *) + * } + */ + public static MemorySegment fgetln(MemorySegment x0, MemorySegment x1) { + var mh$ = fgetln.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fgetln", x0, x1); + } + return (MemorySegment)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class fmtcheck { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("fmtcheck"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * const char *fmtcheck(const char *, const char *) + * } + */ + public static FunctionDescriptor fmtcheck$descriptor() { + return fmtcheck.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * const char *fmtcheck(const char *, const char *) + * } + */ + public static MethodHandle fmtcheck$handle() { + return fmtcheck.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * const char *fmtcheck(const char *, const char *) + * } + */ + public static MemorySegment fmtcheck$address() { + return fmtcheck.ADDR; + } + + /** + * {@snippet lang=c : + * const char *fmtcheck(const char *, const char *) + * } + */ + public static MemorySegment fmtcheck(MemorySegment x0, MemorySegment x1) { + var mh$ = fmtcheck.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fmtcheck", x0, x1); + } + return (MemorySegment)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class fpurge { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("fpurge"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int fpurge(FILE *) + * } + */ + public static FunctionDescriptor fpurge$descriptor() { + return fpurge.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int fpurge(FILE *) + * } + */ + public static MethodHandle fpurge$handle() { + return fpurge.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int fpurge(FILE *) + * } + */ + public static MemorySegment fpurge$address() { + return fpurge.ADDR; + } + + /** + * {@snippet lang=c : + * int fpurge(FILE *) + * } + */ + public static int fpurge(MemorySegment x0) { + var mh$ = fpurge.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fpurge", x0); + } + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class setbuffer { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_INT + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("setbuffer"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void setbuffer(FILE *, char *, int) + * } + */ + public static FunctionDescriptor setbuffer$descriptor() { + return setbuffer.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void setbuffer(FILE *, char *, int) + * } + */ + public static MethodHandle setbuffer$handle() { + return setbuffer.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void setbuffer(FILE *, char *, int) + * } + */ + public static MemorySegment setbuffer$address() { + return setbuffer.ADDR; + } + + /** + * {@snippet lang=c : + * void setbuffer(FILE *, char *, int) + * } + */ + public static void setbuffer(MemorySegment x0, MemorySegment x1, int x2) { + var mh$ = setbuffer.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("setbuffer", x0, x1, x2); + } + mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class setlinebuf { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("setlinebuf"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int setlinebuf(FILE *) + * } + */ + public static FunctionDescriptor setlinebuf$descriptor() { + return setlinebuf.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int setlinebuf(FILE *) + * } + */ + public static MethodHandle setlinebuf$handle() { + return setlinebuf.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int setlinebuf(FILE *) + * } + */ + public static MemorySegment setlinebuf$address() { + return setlinebuf.ADDR; + } + + /** + * {@snippet lang=c : + * int setlinebuf(FILE *) + * } + */ + public static int setlinebuf(MemorySegment x0) { + var mh$ = setlinebuf.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("setlinebuf", x0); + } + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class vasprintf { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("vasprintf"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int vasprintf(char **restrict, const char *restrict, va_list) + * } + */ + public static FunctionDescriptor vasprintf$descriptor() { + return vasprintf.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int vasprintf(char **restrict, const char *restrict, va_list) + * } + */ + public static MethodHandle vasprintf$handle() { + return vasprintf.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int vasprintf(char **restrict, const char *restrict, va_list) + * } + */ + public static MemorySegment vasprintf$address() { + return vasprintf.ADDR; + } + + /** + * {@snippet lang=c : + * int vasprintf(char **restrict, const char *restrict, va_list) + * } + */ + public static int vasprintf(MemorySegment x0, MemorySegment x1, MemorySegment x2) { + var mh$ = vasprintf.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("vasprintf", x0, x1, x2); + } + return (int)mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class funopen { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("funopen"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * FILE *funopen(const void *, int (* _Nullable)(void *, char *, int), int (* _Nullable)(void *, const char *, int), fpos_t (* _Nullable)(void *, fpos_t, int), int (* _Nullable)(void *)) + * } + */ + public static FunctionDescriptor funopen$descriptor() { + return funopen.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * FILE *funopen(const void *, int (* _Nullable)(void *, char *, int), int (* _Nullable)(void *, const char *, int), fpos_t (* _Nullable)(void *, fpos_t, int), int (* _Nullable)(void *)) + * } + */ + public static MethodHandle funopen$handle() { + return funopen.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * FILE *funopen(const void *, int (* _Nullable)(void *, char *, int), int (* _Nullable)(void *, const char *, int), fpos_t (* _Nullable)(void *, fpos_t, int), int (* _Nullable)(void *)) + * } + */ + public static MemorySegment funopen$address() { + return funopen.ADDR; + } + + /** + * {@snippet lang=c : + * FILE *funopen(const void *, int (* _Nullable)(void *, char *, int), int (* _Nullable)(void *, const char *, int), fpos_t (* _Nullable)(void *, fpos_t, int), int (* _Nullable)(void *)) + * } + */ + public static MemorySegment funopen(MemorySegment x0, MemorySegment x1, MemorySegment x2, MemorySegment x3, MemorySegment x4) { + var mh$ = funopen.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("funopen", x0, x1, x2, x3, x4); + } + return (MemorySegment)mh$.invokeExact(x0, x1, x2, x3, x4); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + /** + * Variadic invoker class for: + * {@snippet lang=c : + * extern int __sprintf_chk(char *restrict, int, size_t, const char *restrict, ...) + * } + */ + public static class __sprintf_chk { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_INT, + somelib_h.C_LONG, + somelib_h.C_POINTER + ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("__sprintf_chk"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private __sprintf_chk(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * extern int __sprintf_chk(char *restrict, int, size_t, const char *restrict, ...) + * } + */ + public static __sprintf_chk makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new __sprintf_chk(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public int apply(MemorySegment x0, int x1, long x2, MemorySegment x3, Object... x4) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("__sprintf_chk", x0, x1, x2, x3, x4); + } + return (int)spreader.invokeExact(x0, x1, x2, x3, x4); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + /** + * Variadic invoker class for: + * {@snippet lang=c : + * extern int __snprintf_chk(char *restrict, size_t, int, size_t, const char *restrict, ...) + * } + */ + public static class __snprintf_chk { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_LONG, + somelib_h.C_INT, + somelib_h.C_LONG, + somelib_h.C_POINTER + ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("__snprintf_chk"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private __snprintf_chk(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * extern int __snprintf_chk(char *restrict, size_t, int, size_t, const char *restrict, ...) + * } + */ + public static __snprintf_chk makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new __snprintf_chk(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public int apply(MemorySegment x0, long x1, int x2, long x3, MemorySegment x4, Object... x5) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("__snprintf_chk", x0, x1, x2, x3, x4, x5); + } + return (int)spreader.invokeExact(x0, x1, x2, x3, x4, x5); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static class __vsprintf_chk { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_INT, + somelib_h.C_LONG, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("__vsprintf_chk"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern int __vsprintf_chk(char *restrict, int, size_t, const char *restrict, va_list) + * } + */ + public static FunctionDescriptor __vsprintf_chk$descriptor() { + return __vsprintf_chk.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern int __vsprintf_chk(char *restrict, int, size_t, const char *restrict, va_list) + * } + */ + public static MethodHandle __vsprintf_chk$handle() { + return __vsprintf_chk.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern int __vsprintf_chk(char *restrict, int, size_t, const char *restrict, va_list) + * } + */ + public static MemorySegment __vsprintf_chk$address() { + return __vsprintf_chk.ADDR; + } + + /** + * {@snippet lang=c : + * extern int __vsprintf_chk(char *restrict, int, size_t, const char *restrict, va_list) + * } + */ + public static int __vsprintf_chk(MemorySegment x0, int x1, long x2, MemorySegment x3, MemorySegment x4) { + var mh$ = __vsprintf_chk.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("__vsprintf_chk", x0, x1, x2, x3, x4); + } + return (int)mh$.invokeExact(x0, x1, x2, x3, x4); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class __vsnprintf_chk { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_LONG, + somelib_h.C_INT, + somelib_h.C_LONG, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("__vsnprintf_chk"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern int __vsnprintf_chk(char *restrict, size_t, int, size_t, const char *restrict, va_list) + * } + */ + public static FunctionDescriptor __vsnprintf_chk$descriptor() { + return __vsnprintf_chk.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern int __vsnprintf_chk(char *restrict, size_t, int, size_t, const char *restrict, va_list) + * } + */ + public static MethodHandle __vsnprintf_chk$handle() { + return __vsnprintf_chk.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern int __vsnprintf_chk(char *restrict, size_t, int, size_t, const char *restrict, va_list) + * } + */ + public static MemorySegment __vsnprintf_chk$address() { + return __vsnprintf_chk.ADDR; + } + + /** + * {@snippet lang=c : + * extern int __vsnprintf_chk(char *restrict, size_t, int, size_t, const char *restrict, va_list) + * } + */ + public static int __vsnprintf_chk(MemorySegment x0, long x1, int x2, long x3, MemorySegment x4, MemorySegment x5) { + var mh$ = __vsnprintf_chk.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("__vsnprintf_chk", x0, x1, x2, x3, x4, x5); + } + return (int)mh$.invokeExact(x0, x1, x2, x3, x4, x5); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + /** + * {@snippet lang=c : + * typedef unsigned char uint8_t + * } + */ + public static final OfByte uint8_t = somelib_h.C_CHAR; + /** + * {@snippet lang=c : + * typedef unsigned short uint16_t + * } + */ + public static final OfShort uint16_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef unsigned int uint32_t + * } + */ + public static final OfInt uint32_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef unsigned long long uint64_t + * } + */ + public static final OfLong uint64_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef int8_t int_least8_t + * } + */ + public static final OfByte int_least8_t = somelib_h.C_CHAR; + /** + * {@snippet lang=c : + * typedef int16_t int_least16_t + * } + */ + public static final OfShort int_least16_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef int32_t int_least32_t + * } + */ + public static final OfInt int_least32_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef int64_t int_least64_t + * } + */ + public static final OfLong int_least64_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef uint8_t uint_least8_t + * } + */ + public static final OfByte uint_least8_t = somelib_h.C_CHAR; + /** + * {@snippet lang=c : + * typedef uint16_t uint_least16_t + * } + */ + public static final OfShort uint_least16_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef uint32_t uint_least32_t + * } + */ + public static final OfInt uint_least32_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef uint64_t uint_least64_t + * } + */ + public static final OfLong uint_least64_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef int8_t int_fast8_t + * } + */ + public static final OfByte int_fast8_t = somelib_h.C_CHAR; + /** + * {@snippet lang=c : + * typedef int16_t int_fast16_t + * } + */ + public static final OfShort int_fast16_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef int32_t int_fast32_t + * } + */ + public static final OfInt int_fast32_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef int64_t int_fast64_t + * } + */ + public static final OfLong int_fast64_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef uint8_t uint_fast8_t + * } + */ + public static final OfByte uint_fast8_t = somelib_h.C_CHAR; + /** + * {@snippet lang=c : + * typedef uint16_t uint_fast16_t + * } + */ + public static final OfShort uint_fast16_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef uint32_t uint_fast32_t + * } + */ + public static final OfInt uint_fast32_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef uint64_t uint_fast64_t + * } + */ + public static final OfLong uint_fast64_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef long intmax_t + * } + */ + public static final OfLong intmax_t = somelib_h.C_LONG; + /** + * {@snippet lang=c : + * typedef unsigned long uintmax_t + * } + */ + public static final OfLong uintmax_t = somelib_h.C_LONG; + /** + * {@snippet lang=c : + * typedef long ptrdiff_t + * } + */ + public static final OfLong ptrdiff_t = somelib_h.C_LONG; + /** + * {@snippet lang=c : + * typedef unsigned long rsize_t + * } + */ + public static final OfLong rsize_t = somelib_h.C_LONG; + /** + * {@snippet lang=c : + * typedef int wchar_t + * } + */ + public static final OfInt wchar_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef unsigned char u_char + * } + */ + public static final OfByte u_char = somelib_h.C_CHAR; + /** + * {@snippet lang=c : + * typedef unsigned short u_short + * } + */ + public static final OfShort u_short = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef unsigned int u_int + * } + */ + public static final OfInt u_int = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef unsigned long u_long + * } + */ + public static final OfLong u_long = somelib_h.C_LONG; + /** + * {@snippet lang=c : + * typedef unsigned short ushort + * } + */ + public static final OfShort ushort = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef unsigned int uint + * } + */ + public static final OfInt uint = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef u_int64_t u_quad_t + * } + */ + public static final OfLong u_quad_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef int64_t quad_t + * } + */ + public static final OfLong quad_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef quad_t *qaddr_t + * } + */ + public static final AddressLayout qaddr_t = somelib_h.C_POINTER; + /** + * {@snippet lang=c : + * typedef char *caddr_t + * } + */ + public static final AddressLayout caddr_t = somelib_h.C_POINTER; + /** + * {@snippet lang=c : + * typedef int32_t daddr_t + * } + */ + public static final OfInt daddr_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef __darwin_dev_t dev_t + * } + */ + public static final OfInt dev_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef u_int32_t fixpt_t + * } + */ + public static final OfInt fixpt_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef __darwin_blkcnt_t blkcnt_t + * } + */ + public static final OfLong blkcnt_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef __darwin_blksize_t blksize_t + * } + */ + public static final OfInt blksize_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef __darwin_gid_t gid_t + * } + */ + public static final OfInt gid_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef __uint32_t in_addr_t + * } + */ + public static final OfInt in_addr_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef __uint16_t in_port_t + * } + */ + public static final OfShort in_port_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef __darwin_ino_t ino_t + * } + */ + public static final OfLong ino_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef __darwin_ino64_t ino64_t + * } + */ + public static final OfLong ino64_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef __int32_t key_t + * } + */ + public static final OfInt key_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef __darwin_mode_t mode_t + * } + */ + public static final OfShort mode_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef __uint16_t nlink_t + * } + */ + public static final OfShort nlink_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef __darwin_id_t id_t + * } + */ + public static final OfInt id_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef __darwin_pid_t pid_t + * } + */ + public static final OfInt pid_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef int32_t segsz_t + * } + */ + public static final OfInt segsz_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef int32_t swblk_t + * } + */ + public static final OfInt swblk_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef __darwin_uid_t uid_t + * } + */ + public static final OfInt uid_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef __darwin_clock_t clock_t + * } + */ + public static final OfLong clock_t = somelib_h.C_LONG; + /** + * {@snippet lang=c : + * typedef __darwin_time_t time_t + * } + */ + public static final OfLong time_t = somelib_h.C_LONG; + /** + * {@snippet lang=c : + * typedef __darwin_useconds_t useconds_t + * } + */ + public static final OfInt useconds_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef __darwin_suseconds_t suseconds_t + * } + */ + public static final OfInt suseconds_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef int errno_t + * } + */ + public static final OfInt errno_t = somelib_h.C_INT; + + private static class __darwin_check_fd_set_overflow { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_INT + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("__darwin_check_fd_set_overflow"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int __darwin_check_fd_set_overflow(int, const void *, int) + * } + */ + public static FunctionDescriptor __darwin_check_fd_set_overflow$descriptor() { + return __darwin_check_fd_set_overflow.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int __darwin_check_fd_set_overflow(int, const void *, int) + * } + */ + public static MethodHandle __darwin_check_fd_set_overflow$handle() { + return __darwin_check_fd_set_overflow.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int __darwin_check_fd_set_overflow(int, const void *, int) + * } + */ + public static MemorySegment __darwin_check_fd_set_overflow$address() { + return __darwin_check_fd_set_overflow.ADDR; + } + + /** + * {@snippet lang=c : + * int __darwin_check_fd_set_overflow(int, const void *, int) + * } + */ + public static int __darwin_check_fd_set_overflow(int x0, MemorySegment x1, int x2) { + var mh$ = __darwin_check_fd_set_overflow.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("__darwin_check_fd_set_overflow", x0, x1, x2); + } + return (int)mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + /** + * {@snippet lang=c : + * typedef __int32_t fd_mask + * } + */ + public static final OfInt fd_mask = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef __darwin_pthread_t pthread_t + * } + */ + public static final AddressLayout pthread_t = somelib_h.C_POINTER; + /** + * {@snippet lang=c : + * typedef __darwin_pthread_key_t pthread_key_t + * } + */ + public static final OfLong pthread_key_t = somelib_h.C_LONG; + /** + * {@snippet lang=c : + * typedef __darwin_fsblkcnt_t fsblkcnt_t + * } + */ + public static final OfInt fsblkcnt_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef __darwin_fsfilcnt_t fsfilcnt_t + * } + */ + public static final OfInt fsfilcnt_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef uint16_t char16_t + * } + */ + public static final OfShort char16_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef uint32_t char32_t + * } + */ + public static final OfInt char32_t = somelib_h.C_INT; + + private static class diplomat_simple_write { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + DiplomatWrite.layout(), + somelib_h.C_POINTER, + somelib_h.C_LONG + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_simple_write"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) + * } + */ + public static FunctionDescriptor diplomat_simple_write$descriptor() { + return diplomat_simple_write.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) + * } + */ + public static MethodHandle diplomat_simple_write$handle() { + return diplomat_simple_write.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) + * } + */ + public static MemorySegment diplomat_simple_write$address() { + return diplomat_simple_write.ADDR; + } + + /** + * {@snippet lang=c : + * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) + * } + */ + public static MemorySegment diplomat_simple_write(SegmentAllocator allocator, MemorySegment buf, long buf_size) { + var mh$ = diplomat_simple_write.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("diplomat_simple_write", allocator, buf, buf_size); + } + return (MemorySegment)mh$.invokeExact(allocator, buf, buf_size); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class diplomat_buffer_write_create { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_LONG + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_create"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * DiplomatWrite *diplomat_buffer_write_create(size_t cap) + * } + */ + public static FunctionDescriptor diplomat_buffer_write_create$descriptor() { + return diplomat_buffer_write_create.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * DiplomatWrite *diplomat_buffer_write_create(size_t cap) + * } + */ + public static MethodHandle diplomat_buffer_write_create$handle() { + return diplomat_buffer_write_create.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * DiplomatWrite *diplomat_buffer_write_create(size_t cap) + * } + */ + public static MemorySegment diplomat_buffer_write_create$address() { + return diplomat_buffer_write_create.ADDR; + } + + /** + * {@snippet lang=c : + * DiplomatWrite *diplomat_buffer_write_create(size_t cap) + * } + */ + public static MemorySegment diplomat_buffer_write_create(long cap) { + var mh$ = diplomat_buffer_write_create.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("diplomat_buffer_write_create", cap); + } + return (MemorySegment)mh$.invokeExact(cap); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class diplomat_buffer_write_get_bytes { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_get_bytes"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) + * } + */ + public static FunctionDescriptor diplomat_buffer_write_get_bytes$descriptor() { + return diplomat_buffer_write_get_bytes.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) + * } + */ + public static MethodHandle diplomat_buffer_write_get_bytes$handle() { + return diplomat_buffer_write_get_bytes.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) + * } + */ + public static MemorySegment diplomat_buffer_write_get_bytes$address() { + return diplomat_buffer_write_get_bytes.ADDR; + } + + /** + * {@snippet lang=c : + * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) + * } + */ + public static MemorySegment diplomat_buffer_write_get_bytes(MemorySegment t) { + var mh$ = diplomat_buffer_write_get_bytes.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("diplomat_buffer_write_get_bytes", t); + } + return (MemorySegment)mh$.invokeExact(t); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class diplomat_buffer_write_len { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_LONG, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_len"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * size_t diplomat_buffer_write_len(DiplomatWrite *t) + * } + */ + public static FunctionDescriptor diplomat_buffer_write_len$descriptor() { + return diplomat_buffer_write_len.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * size_t diplomat_buffer_write_len(DiplomatWrite *t) + * } + */ + public static MethodHandle diplomat_buffer_write_len$handle() { + return diplomat_buffer_write_len.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * size_t diplomat_buffer_write_len(DiplomatWrite *t) + * } + */ + public static MemorySegment diplomat_buffer_write_len$address() { + return diplomat_buffer_write_len.ADDR; + } + + /** + * {@snippet lang=c : + * size_t diplomat_buffer_write_len(DiplomatWrite *t) + * } + */ + public static long diplomat_buffer_write_len(MemorySegment t) { + var mh$ = diplomat_buffer_write_len.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("diplomat_buffer_write_len", t); + } + return (long)mh$.invokeExact(t); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class diplomat_buffer_write_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_destroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void diplomat_buffer_write_destroy(DiplomatWrite *t) + * } + */ + public static FunctionDescriptor diplomat_buffer_write_destroy$descriptor() { + return diplomat_buffer_write_destroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void diplomat_buffer_write_destroy(DiplomatWrite *t) + * } + */ + public static MethodHandle diplomat_buffer_write_destroy$handle() { + return diplomat_buffer_write_destroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void diplomat_buffer_write_destroy(DiplomatWrite *t) + * } + */ + public static MemorySegment diplomat_buffer_write_destroy$address() { + return diplomat_buffer_write_destroy.ADDR; + } + + /** + * {@snippet lang=c : + * void diplomat_buffer_write_destroy(DiplomatWrite *t) + * } + */ + public static void diplomat_buffer_write_destroy(MemorySegment t) { + var mh$ = diplomat_buffer_write_destroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("diplomat_buffer_write_destroy", t); + } + mh$.invokeExact(t); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class diplomat_is_str { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_BOOL, + somelib_h.C_POINTER, + somelib_h.C_LONG + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_is_str"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * bool diplomat_is_str(const char *buf, size_t len) + * } + */ + public static FunctionDescriptor diplomat_is_str$descriptor() { + return diplomat_is_str.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * bool diplomat_is_str(const char *buf, size_t len) + * } + */ + public static MethodHandle diplomat_is_str$handle() { + return diplomat_is_str.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * bool diplomat_is_str(const char *buf, size_t len) + * } + */ + public static MemorySegment diplomat_is_str$address() { + return diplomat_is_str.ADDR; + } + + /** + * {@snippet lang=c : + * bool diplomat_is_str(const char *buf, size_t len) + * } + */ + public static boolean diplomat_is_str(MemorySegment buf, long len) { + var mh$ = diplomat_is_str.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("diplomat_is_str", buf, len); + } + return (boolean)mh$.invokeExact(buf, len); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + private static final int ICU4XFixedDecimalGroupingStrategy_Auto = (int)0L; + /** + * {@snippet lang=c : + * enum ICU4XFixedDecimalGroupingStrategy.ICU4XFixedDecimalGroupingStrategy_Auto = 0 + * } + */ + public static int ICU4XFixedDecimalGroupingStrategy_Auto() { + return ICU4XFixedDecimalGroupingStrategy_Auto; + } + private static final int ICU4XFixedDecimalGroupingStrategy_Never = (int)1L; + /** + * {@snippet lang=c : + * enum ICU4XFixedDecimalGroupingStrategy.ICU4XFixedDecimalGroupingStrategy_Never = 1 + * } + */ + public static int ICU4XFixedDecimalGroupingStrategy_Never() { + return ICU4XFixedDecimalGroupingStrategy_Never; + } + private static final int ICU4XFixedDecimalGroupingStrategy_Always = (int)2L; + /** + * {@snippet lang=c : + * enum ICU4XFixedDecimalGroupingStrategy.ICU4XFixedDecimalGroupingStrategy_Always = 2 + * } + */ + public static int ICU4XFixedDecimalGroupingStrategy_Always() { + return ICU4XFixedDecimalGroupingStrategy_Always; + } + private static final int ICU4XFixedDecimalGroupingStrategy_Min2 = (int)3L; + /** + * {@snippet lang=c : + * enum ICU4XFixedDecimalGroupingStrategy.ICU4XFixedDecimalGroupingStrategy_Min2 = 3 + * } + */ + public static int ICU4XFixedDecimalGroupingStrategy_Min2() { + return ICU4XFixedDecimalGroupingStrategy_Min2; + } + + /** + * Variadic invoker class for: + * {@snippet lang=c : + * ICU4XFixedDecimalFormatterOptions ICU4XFixedDecimalFormatterOptions_default() + * } + */ + public static class ICU4XFixedDecimalFormatterOptions_default { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + ICU4XFixedDecimalFormatterOptions.layout() ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("ICU4XFixedDecimalFormatterOptions_default"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private ICU4XFixedDecimalFormatterOptions_default(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * ICU4XFixedDecimalFormatterOptions ICU4XFixedDecimalFormatterOptions_default() + * } + */ + public static ICU4XFixedDecimalFormatterOptions_default makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new ICU4XFixedDecimalFormatterOptions_default(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public MemorySegment apply(SegmentAllocator allocator, Object... x0) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("ICU4XFixedDecimalFormatterOptions_default", allocator, x0); + } + return (MemorySegment)spreader.invokeExact(allocator, x0); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static class ICU4XFixedDecimalFormatter_try_new { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + ICU4XFixedDecimalFormatter_try_new_result.layout(), + somelib_h.C_POINTER, + somelib_h.C_POINTER, + ICU4XFixedDecimalFormatterOptions.layout() + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("ICU4XFixedDecimalFormatter_try_new"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * struct ICU4XFixedDecimalFormatter_try_new_result ICU4XFixedDecimalFormatter_try_new(const ICU4XLocale *locale, const ICU4XDataProvider *provider, ICU4XFixedDecimalFormatterOptions options) + * } + */ + public static FunctionDescriptor ICU4XFixedDecimalFormatter_try_new$descriptor() { + return ICU4XFixedDecimalFormatter_try_new.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * struct ICU4XFixedDecimalFormatter_try_new_result ICU4XFixedDecimalFormatter_try_new(const ICU4XLocale *locale, const ICU4XDataProvider *provider, ICU4XFixedDecimalFormatterOptions options) + * } + */ + public static MethodHandle ICU4XFixedDecimalFormatter_try_new$handle() { + return ICU4XFixedDecimalFormatter_try_new.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * struct ICU4XFixedDecimalFormatter_try_new_result ICU4XFixedDecimalFormatter_try_new(const ICU4XLocale *locale, const ICU4XDataProvider *provider, ICU4XFixedDecimalFormatterOptions options) + * } + */ + public static MemorySegment ICU4XFixedDecimalFormatter_try_new$address() { + return ICU4XFixedDecimalFormatter_try_new.ADDR; + } + + /** + * {@snippet lang=c : + * struct ICU4XFixedDecimalFormatter_try_new_result ICU4XFixedDecimalFormatter_try_new(const ICU4XLocale *locale, const ICU4XDataProvider *provider, ICU4XFixedDecimalFormatterOptions options) + * } + */ + public static MemorySegment ICU4XFixedDecimalFormatter_try_new(SegmentAllocator allocator, MemorySegment locale, MemorySegment provider, MemorySegment options) { + var mh$ = ICU4XFixedDecimalFormatter_try_new.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("ICU4XFixedDecimalFormatter_try_new", allocator, locale, provider, options); + } + return (MemorySegment)mh$.invokeExact(allocator, locale, provider, options); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class ICU4XFixedDecimalFormatter_format_write { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("ICU4XFixedDecimalFormatter_format_write"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void ICU4XFixedDecimalFormatter_format_write(const ICU4XFixedDecimalFormatter *self, const ICU4XFixedDecimal *value, DiplomatWrite *write) + * } + */ + public static FunctionDescriptor ICU4XFixedDecimalFormatter_format_write$descriptor() { + return ICU4XFixedDecimalFormatter_format_write.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void ICU4XFixedDecimalFormatter_format_write(const ICU4XFixedDecimalFormatter *self, const ICU4XFixedDecimal *value, DiplomatWrite *write) + * } + */ + public static MethodHandle ICU4XFixedDecimalFormatter_format_write$handle() { + return ICU4XFixedDecimalFormatter_format_write.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void ICU4XFixedDecimalFormatter_format_write(const ICU4XFixedDecimalFormatter *self, const ICU4XFixedDecimal *value, DiplomatWrite *write) + * } + */ + public static MemorySegment ICU4XFixedDecimalFormatter_format_write$address() { + return ICU4XFixedDecimalFormatter_format_write.ADDR; + } + + /** + * {@snippet lang=c : + * void ICU4XFixedDecimalFormatter_format_write(const ICU4XFixedDecimalFormatter *self, const ICU4XFixedDecimal *value, DiplomatWrite *write) + * } + */ + public static void ICU4XFixedDecimalFormatter_format_write(MemorySegment self, MemorySegment value, MemorySegment write) { + var mh$ = ICU4XFixedDecimalFormatter_format_write.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("ICU4XFixedDecimalFormatter_format_write", self, value, write); + } + mh$.invokeExact(self, value, write); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class ICU4XFixedDecimalFormatter_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("ICU4XFixedDecimalFormatter_destroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void ICU4XFixedDecimalFormatter_destroy(ICU4XFixedDecimalFormatter *self) + * } + */ + public static FunctionDescriptor ICU4XFixedDecimalFormatter_destroy$descriptor() { + return ICU4XFixedDecimalFormatter_destroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void ICU4XFixedDecimalFormatter_destroy(ICU4XFixedDecimalFormatter *self) + * } + */ + public static MethodHandle ICU4XFixedDecimalFormatter_destroy$handle() { + return ICU4XFixedDecimalFormatter_destroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void ICU4XFixedDecimalFormatter_destroy(ICU4XFixedDecimalFormatter *self) + * } + */ + public static MemorySegment ICU4XFixedDecimalFormatter_destroy$address() { + return ICU4XFixedDecimalFormatter_destroy.ADDR; + } + + /** + * {@snippet lang=c : + * void ICU4XFixedDecimalFormatter_destroy(ICU4XFixedDecimalFormatter *self) + * } + */ + public static void ICU4XFixedDecimalFormatter_destroy(MemorySegment self) { + var mh$ = ICU4XFixedDecimalFormatter_destroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("ICU4XFixedDecimalFormatter_destroy", self); + } + mh$.invokeExact(self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class ICU4XLocale_new { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("ICU4XLocale_new"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * ICU4XLocale *ICU4XLocale_new(const char *name_data, size_t name_len) + * } + */ + public static FunctionDescriptor ICU4XLocale_new$descriptor() { + return ICU4XLocale_new.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * ICU4XLocale *ICU4XLocale_new(const char *name_data, size_t name_len) + * } + */ + public static MethodHandle ICU4XLocale_new$handle() { + return ICU4XLocale_new.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * ICU4XLocale *ICU4XLocale_new(const char *name_data, size_t name_len) + * } + */ + public static MemorySegment ICU4XLocale_new$address() { + return ICU4XLocale_new.ADDR; + } + + /** + * {@snippet lang=c : + * ICU4XLocale *ICU4XLocale_new(const char *name_data, size_t name_len) + * } + */ + public static MemorySegment ICU4XLocale_new(MemorySegment name_data, long name_len) { + var mh$ = ICU4XLocale_new.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("ICU4XLocale_new", name_data, name_len); + } + return (MemorySegment)mh$.invokeExact(name_data, name_len); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class ICU4XLocale_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("ICU4XLocale_destroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void ICU4XLocale_destroy(ICU4XLocale *self) + * } + */ + public static FunctionDescriptor ICU4XLocale_destroy$descriptor() { + return ICU4XLocale_destroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void ICU4XLocale_destroy(ICU4XLocale *self) + * } + */ + public static MethodHandle ICU4XLocale_destroy$handle() { + return ICU4XLocale_destroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void ICU4XLocale_destroy(ICU4XLocale *self) + * } + */ + public static MemorySegment ICU4XLocale_destroy$address() { + return ICU4XLocale_destroy.ADDR; + } + + /** + * {@snippet lang=c : + * void ICU4XLocale_destroy(ICU4XLocale *self) + * } + */ + public static void ICU4XLocale_destroy(MemorySegment self) { + var mh$ = ICU4XLocale_destroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("ICU4XLocale_destroy", self); + } + mh$.invokeExact(self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + /** + * Variadic invoker class for: + * {@snippet lang=c : + * ICU4XDataProvider *ICU4XDataProvider_new_static() + * } + */ + public static class ICU4XDataProvider_new_static { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + somelib_h.C_POINTER ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("ICU4XDataProvider_new_static"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private ICU4XDataProvider_new_static(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * ICU4XDataProvider *ICU4XDataProvider_new_static() + * } + */ + public static ICU4XDataProvider_new_static makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new ICU4XDataProvider_new_static(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public MemorySegment apply(Object... x0) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("ICU4XDataProvider_new_static", x0); + } + return (MemorySegment)spreader.invokeExact(x0); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + /** + * Variadic invoker class for: + * {@snippet lang=c : + * struct ICU4XDataProvider_returns_result_result ICU4XDataProvider_returns_result() + * } + */ + public static class ICU4XDataProvider_returns_result { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + ICU4XDataProvider_returns_result_result.layout() ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("ICU4XDataProvider_returns_result"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private ICU4XDataProvider_returns_result(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * struct ICU4XDataProvider_returns_result_result ICU4XDataProvider_returns_result() + * } + */ + public static ICU4XDataProvider_returns_result makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new ICU4XDataProvider_returns_result(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public MemorySegment apply(SegmentAllocator allocator, Object... x0) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("ICU4XDataProvider_returns_result", allocator, x0); + } + return (MemorySegment)spreader.invokeExact(allocator, x0); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static class ICU4XDataProvider_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("ICU4XDataProvider_destroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void ICU4XDataProvider_destroy(ICU4XDataProvider *self) + * } + */ + public static FunctionDescriptor ICU4XDataProvider_destroy$descriptor() { + return ICU4XDataProvider_destroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void ICU4XDataProvider_destroy(ICU4XDataProvider *self) + * } + */ + public static MethodHandle ICU4XDataProvider_destroy$handle() { + return ICU4XDataProvider_destroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void ICU4XDataProvider_destroy(ICU4XDataProvider *self) + * } + */ + public static MemorySegment ICU4XDataProvider_destroy$address() { + return ICU4XDataProvider_destroy.ADDR; + } + + /** + * {@snippet lang=c : + * void ICU4XDataProvider_destroy(ICU4XDataProvider *self) + * } + */ + public static void ICU4XDataProvider_destroy(MemorySegment self) { + var mh$ = ICU4XDataProvider_destroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("ICU4XDataProvider_destroy", self); + } + mh$.invokeExact(self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class ICU4XFixedDecimal_new { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_INT + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("ICU4XFixedDecimal_new"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * ICU4XFixedDecimal *ICU4XFixedDecimal_new(int32_t v) + * } + */ + public static FunctionDescriptor ICU4XFixedDecimal_new$descriptor() { + return ICU4XFixedDecimal_new.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * ICU4XFixedDecimal *ICU4XFixedDecimal_new(int32_t v) + * } + */ + public static MethodHandle ICU4XFixedDecimal_new$handle() { + return ICU4XFixedDecimal_new.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * ICU4XFixedDecimal *ICU4XFixedDecimal_new(int32_t v) + * } + */ + public static MemorySegment ICU4XFixedDecimal_new$address() { + return ICU4XFixedDecimal_new.ADDR; + } + + /** + * {@snippet lang=c : + * ICU4XFixedDecimal *ICU4XFixedDecimal_new(int32_t v) + * } + */ + public static MemorySegment ICU4XFixedDecimal_new(int v) { + var mh$ = ICU4XFixedDecimal_new.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("ICU4XFixedDecimal_new", v); + } + return (MemorySegment)mh$.invokeExact(v); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class ICU4XFixedDecimal_multiply_pow10 { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, + somelib_h.C_SHORT + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("ICU4XFixedDecimal_multiply_pow10"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void ICU4XFixedDecimal_multiply_pow10(ICU4XFixedDecimal *self, int16_t power) + * } + */ + public static FunctionDescriptor ICU4XFixedDecimal_multiply_pow10$descriptor() { + return ICU4XFixedDecimal_multiply_pow10.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void ICU4XFixedDecimal_multiply_pow10(ICU4XFixedDecimal *self, int16_t power) + * } + */ + public static MethodHandle ICU4XFixedDecimal_multiply_pow10$handle() { + return ICU4XFixedDecimal_multiply_pow10.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void ICU4XFixedDecimal_multiply_pow10(ICU4XFixedDecimal *self, int16_t power) + * } + */ + public static MemorySegment ICU4XFixedDecimal_multiply_pow10$address() { + return ICU4XFixedDecimal_multiply_pow10.ADDR; + } + + /** + * {@snippet lang=c : + * void ICU4XFixedDecimal_multiply_pow10(ICU4XFixedDecimal *self, int16_t power) + * } + */ + public static void ICU4XFixedDecimal_multiply_pow10(MemorySegment self, short power) { + var mh$ = ICU4XFixedDecimal_multiply_pow10.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("ICU4XFixedDecimal_multiply_pow10", self, power); + } + mh$.invokeExact(self, power); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class ICU4XFixedDecimal_to_string { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + ICU4XFixedDecimal_to_string_result.layout(), + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("ICU4XFixedDecimal_to_string"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * struct ICU4XFixedDecimal_to_string_result ICU4XFixedDecimal_to_string(const ICU4XFixedDecimal *self, DiplomatWrite *write) + * } + */ + public static FunctionDescriptor ICU4XFixedDecimal_to_string$descriptor() { + return ICU4XFixedDecimal_to_string.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * struct ICU4XFixedDecimal_to_string_result ICU4XFixedDecimal_to_string(const ICU4XFixedDecimal *self, DiplomatWrite *write) + * } + */ + public static MethodHandle ICU4XFixedDecimal_to_string$handle() { + return ICU4XFixedDecimal_to_string.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * struct ICU4XFixedDecimal_to_string_result ICU4XFixedDecimal_to_string(const ICU4XFixedDecimal *self, DiplomatWrite *write) + * } + */ + public static MemorySegment ICU4XFixedDecimal_to_string$address() { + return ICU4XFixedDecimal_to_string.ADDR; + } + + /** + * {@snippet lang=c : + * struct ICU4XFixedDecimal_to_string_result ICU4XFixedDecimal_to_string(const ICU4XFixedDecimal *self, DiplomatWrite *write) + * } + */ + public static MemorySegment ICU4XFixedDecimal_to_string(SegmentAllocator allocator, MemorySegment self, MemorySegment write) { + var mh$ = ICU4XFixedDecimal_to_string.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("ICU4XFixedDecimal_to_string", allocator, self, write); + } + return (MemorySegment)mh$.invokeExact(allocator, self, write); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class ICU4XFixedDecimal_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("ICU4XFixedDecimal_destroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void ICU4XFixedDecimal_destroy(ICU4XFixedDecimal *self) + * } + */ + public static FunctionDescriptor ICU4XFixedDecimal_destroy$descriptor() { + return ICU4XFixedDecimal_destroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void ICU4XFixedDecimal_destroy(ICU4XFixedDecimal *self) + * } + */ + public static MethodHandle ICU4XFixedDecimal_destroy$handle() { + return ICU4XFixedDecimal_destroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void ICU4XFixedDecimal_destroy(ICU4XFixedDecimal *self) + * } + */ + public static MemorySegment ICU4XFixedDecimal_destroy$address() { + return ICU4XFixedDecimal_destroy.ADDR; + } + + /** + * {@snippet lang=c : + * void ICU4XFixedDecimal_destroy(ICU4XFixedDecimal *self) + * } + */ + public static void ICU4XFixedDecimal_destroy(MemorySegment self) { + var mh$ = ICU4XFixedDecimal_destroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("ICU4XFixedDecimal_destroy", self); + } + mh$.invokeExact(self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + /** + * {@snippet lang=c : + * #define __DARWIN_SUF_EXTSN "$DARWIN_EXTSN" + * } + */ + public static MemorySegment __DARWIN_SUF_EXTSN() { + class Holder { + static final MemorySegment __DARWIN_SUF_EXTSN + = somelib_h.LIBRARY_ARENA.allocateFrom("$DARWIN_EXTSN"); + } + return Holder.__DARWIN_SUF_EXTSN; + } + private static final long __DARWIN_C_ANSI = 4096L; + /** + * {@snippet lang=c : + * #define __DARWIN_C_ANSI 4096 + * } + */ + public static long __DARWIN_C_ANSI() { + return __DARWIN_C_ANSI; + } + private static final long __DARWIN_C_FULL = 900000L; + /** + * {@snippet lang=c : + * #define __DARWIN_C_FULL 900000 + * } + */ + public static long __DARWIN_C_FULL() { + return __DARWIN_C_FULL; + } + private static final long __DARWIN_C_LEVEL = 900000L; + /** + * {@snippet lang=c : + * #define __DARWIN_C_LEVEL 900000 + * } + */ + public static long __DARWIN_C_LEVEL() { + return __DARWIN_C_LEVEL; + } + private static final int MAC_OS_X_VERSION_10_0 = (int)1000L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_0 1000 + * } + */ + public static int MAC_OS_X_VERSION_10_0() { + return MAC_OS_X_VERSION_10_0; + } + private static final int MAC_OS_X_VERSION_10_1 = (int)1010L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_1 1010 + * } + */ + public static int MAC_OS_X_VERSION_10_1() { + return MAC_OS_X_VERSION_10_1; + } + private static final int MAC_OS_X_VERSION_10_2 = (int)1020L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_2 1020 + * } + */ + public static int MAC_OS_X_VERSION_10_2() { + return MAC_OS_X_VERSION_10_2; + } + private static final int MAC_OS_X_VERSION_10_3 = (int)1030L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_3 1030 + * } + */ + public static int MAC_OS_X_VERSION_10_3() { + return MAC_OS_X_VERSION_10_3; + } + private static final int MAC_OS_X_VERSION_10_4 = (int)1040L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_4 1040 + * } + */ + public static int MAC_OS_X_VERSION_10_4() { + return MAC_OS_X_VERSION_10_4; + } + private static final int MAC_OS_X_VERSION_10_5 = (int)1050L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_5 1050 + * } + */ + public static int MAC_OS_X_VERSION_10_5() { + return MAC_OS_X_VERSION_10_5; + } + private static final int MAC_OS_X_VERSION_10_6 = (int)1060L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_6 1060 + * } + */ + public static int MAC_OS_X_VERSION_10_6() { + return MAC_OS_X_VERSION_10_6; + } + private static final int MAC_OS_X_VERSION_10_7 = (int)1070L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_7 1070 + * } + */ + public static int MAC_OS_X_VERSION_10_7() { + return MAC_OS_X_VERSION_10_7; + } + private static final int MAC_OS_X_VERSION_10_8 = (int)1080L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_8 1080 + * } + */ + public static int MAC_OS_X_VERSION_10_8() { + return MAC_OS_X_VERSION_10_8; + } + private static final int MAC_OS_X_VERSION_10_9 = (int)1090L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_9 1090 + * } + */ + public static int MAC_OS_X_VERSION_10_9() { + return MAC_OS_X_VERSION_10_9; + } + private static final int MAC_OS_X_VERSION_10_10 = (int)101000L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_10 101000 + * } + */ + public static int MAC_OS_X_VERSION_10_10() { + return MAC_OS_X_VERSION_10_10; + } + private static final int MAC_OS_X_VERSION_10_10_2 = (int)101002L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_10_2 101002 + * } + */ + public static int MAC_OS_X_VERSION_10_10_2() { + return MAC_OS_X_VERSION_10_10_2; + } + private static final int MAC_OS_X_VERSION_10_10_3 = (int)101003L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_10_3 101003 + * } + */ + public static int MAC_OS_X_VERSION_10_10_3() { + return MAC_OS_X_VERSION_10_10_3; + } + private static final int MAC_OS_X_VERSION_10_11 = (int)101100L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_11 101100 + * } + */ + public static int MAC_OS_X_VERSION_10_11() { + return MAC_OS_X_VERSION_10_11; + } + private static final int MAC_OS_X_VERSION_10_11_2 = (int)101102L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_11_2 101102 + * } + */ + public static int MAC_OS_X_VERSION_10_11_2() { + return MAC_OS_X_VERSION_10_11_2; + } + private static final int MAC_OS_X_VERSION_10_11_3 = (int)101103L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_11_3 101103 + * } + */ + public static int MAC_OS_X_VERSION_10_11_3() { + return MAC_OS_X_VERSION_10_11_3; + } + private static final int MAC_OS_X_VERSION_10_11_4 = (int)101104L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_11_4 101104 + * } + */ + public static int MAC_OS_X_VERSION_10_11_4() { + return MAC_OS_X_VERSION_10_11_4; + } + private static final int MAC_OS_X_VERSION_10_12 = (int)101200L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_12 101200 + * } + */ + public static int MAC_OS_X_VERSION_10_12() { + return MAC_OS_X_VERSION_10_12; + } + private static final int MAC_OS_X_VERSION_10_12_1 = (int)101201L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_12_1 101201 + * } + */ + public static int MAC_OS_X_VERSION_10_12_1() { + return MAC_OS_X_VERSION_10_12_1; + } + private static final int MAC_OS_X_VERSION_10_12_2 = (int)101202L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_12_2 101202 + * } + */ + public static int MAC_OS_X_VERSION_10_12_2() { + return MAC_OS_X_VERSION_10_12_2; + } + private static final int MAC_OS_X_VERSION_10_12_4 = (int)101204L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_12_4 101204 + * } + */ + public static int MAC_OS_X_VERSION_10_12_4() { + return MAC_OS_X_VERSION_10_12_4; + } + private static final int MAC_OS_X_VERSION_10_13 = (int)101300L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_13 101300 + * } + */ + public static int MAC_OS_X_VERSION_10_13() { + return MAC_OS_X_VERSION_10_13; + } + private static final int MAC_OS_X_VERSION_10_13_1 = (int)101301L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_13_1 101301 + * } + */ + public static int MAC_OS_X_VERSION_10_13_1() { + return MAC_OS_X_VERSION_10_13_1; + } + private static final int MAC_OS_X_VERSION_10_13_2 = (int)101302L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_13_2 101302 + * } + */ + public static int MAC_OS_X_VERSION_10_13_2() { + return MAC_OS_X_VERSION_10_13_2; + } + private static final int MAC_OS_X_VERSION_10_13_4 = (int)101304L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_13_4 101304 + * } + */ + public static int MAC_OS_X_VERSION_10_13_4() { + return MAC_OS_X_VERSION_10_13_4; + } + private static final int MAC_OS_X_VERSION_10_14 = (int)101400L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_14 101400 + * } + */ + public static int MAC_OS_X_VERSION_10_14() { + return MAC_OS_X_VERSION_10_14; + } + private static final int MAC_OS_X_VERSION_10_14_1 = (int)101401L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_14_1 101401 + * } + */ + public static int MAC_OS_X_VERSION_10_14_1() { + return MAC_OS_X_VERSION_10_14_1; + } + private static final int MAC_OS_X_VERSION_10_14_4 = (int)101404L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_14_4 101404 + * } + */ + public static int MAC_OS_X_VERSION_10_14_4() { + return MAC_OS_X_VERSION_10_14_4; + } + private static final int MAC_OS_X_VERSION_10_14_5 = (int)101405L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_14_5 101405 + * } + */ + public static int MAC_OS_X_VERSION_10_14_5() { + return MAC_OS_X_VERSION_10_14_5; + } + private static final int MAC_OS_X_VERSION_10_14_6 = (int)101406L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_14_6 101406 + * } + */ + public static int MAC_OS_X_VERSION_10_14_6() { + return MAC_OS_X_VERSION_10_14_6; + } + private static final int MAC_OS_X_VERSION_10_15 = (int)101500L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_15 101500 + * } + */ + public static int MAC_OS_X_VERSION_10_15() { + return MAC_OS_X_VERSION_10_15; + } + private static final int MAC_OS_X_VERSION_10_15_1 = (int)101501L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_15_1 101501 + * } + */ + public static int MAC_OS_X_VERSION_10_15_1() { + return MAC_OS_X_VERSION_10_15_1; + } + private static final int MAC_OS_X_VERSION_10_15_4 = (int)101504L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_15_4 101504 + * } + */ + public static int MAC_OS_X_VERSION_10_15_4() { + return MAC_OS_X_VERSION_10_15_4; + } + private static final int MAC_OS_X_VERSION_10_16 = (int)101600L; + /** + * {@snippet lang=c : + * #define MAC_OS_X_VERSION_10_16 101600 + * } + */ + public static int MAC_OS_X_VERSION_10_16() { + return MAC_OS_X_VERSION_10_16; + } + private static final int MAC_OS_VERSION_11_0 = (int)110000L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_11_0 110000 + * } + */ + public static int MAC_OS_VERSION_11_0() { + return MAC_OS_VERSION_11_0; + } + private static final int MAC_OS_VERSION_11_1 = (int)110100L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_11_1 110100 + * } + */ + public static int MAC_OS_VERSION_11_1() { + return MAC_OS_VERSION_11_1; + } + private static final int MAC_OS_VERSION_11_3 = (int)110300L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_11_3 110300 + * } + */ + public static int MAC_OS_VERSION_11_3() { + return MAC_OS_VERSION_11_3; + } + private static final int MAC_OS_VERSION_11_4 = (int)110400L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_11_4 110400 + * } + */ + public static int MAC_OS_VERSION_11_4() { + return MAC_OS_VERSION_11_4; + } + private static final int MAC_OS_VERSION_11_5 = (int)110500L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_11_5 110500 + * } + */ + public static int MAC_OS_VERSION_11_5() { + return MAC_OS_VERSION_11_5; + } + private static final int MAC_OS_VERSION_11_6 = (int)110600L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_11_6 110600 + * } + */ + public static int MAC_OS_VERSION_11_6() { + return MAC_OS_VERSION_11_6; + } + private static final int MAC_OS_VERSION_12_0 = (int)120000L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_12_0 120000 + * } + */ + public static int MAC_OS_VERSION_12_0() { + return MAC_OS_VERSION_12_0; + } + private static final int MAC_OS_VERSION_12_1 = (int)120100L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_12_1 120100 + * } + */ + public static int MAC_OS_VERSION_12_1() { + return MAC_OS_VERSION_12_1; + } + private static final int MAC_OS_VERSION_12_2 = (int)120200L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_12_2 120200 + * } + */ + public static int MAC_OS_VERSION_12_2() { + return MAC_OS_VERSION_12_2; + } + private static final int MAC_OS_VERSION_12_3 = (int)120300L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_12_3 120300 + * } + */ + public static int MAC_OS_VERSION_12_3() { + return MAC_OS_VERSION_12_3; + } + private static final int MAC_OS_VERSION_12_4 = (int)120400L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_12_4 120400 + * } + */ + public static int MAC_OS_VERSION_12_4() { + return MAC_OS_VERSION_12_4; + } + private static final int MAC_OS_VERSION_12_5 = (int)120500L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_12_5 120500 + * } + */ + public static int MAC_OS_VERSION_12_5() { + return MAC_OS_VERSION_12_5; + } + private static final int MAC_OS_VERSION_12_6 = (int)120600L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_12_6 120600 + * } + */ + public static int MAC_OS_VERSION_12_6() { + return MAC_OS_VERSION_12_6; + } + private static final int MAC_OS_VERSION_12_7 = (int)120700L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_12_7 120700 + * } + */ + public static int MAC_OS_VERSION_12_7() { + return MAC_OS_VERSION_12_7; + } + private static final int MAC_OS_VERSION_13_0 = (int)130000L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_13_0 130000 + * } + */ + public static int MAC_OS_VERSION_13_0() { + return MAC_OS_VERSION_13_0; + } + private static final int MAC_OS_VERSION_13_1 = (int)130100L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_13_1 130100 + * } + */ + public static int MAC_OS_VERSION_13_1() { + return MAC_OS_VERSION_13_1; + } + private static final int MAC_OS_VERSION_13_2 = (int)130200L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_13_2 130200 + * } + */ + public static int MAC_OS_VERSION_13_2() { + return MAC_OS_VERSION_13_2; + } + private static final int MAC_OS_VERSION_13_3 = (int)130300L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_13_3 130300 + * } + */ + public static int MAC_OS_VERSION_13_3() { + return MAC_OS_VERSION_13_3; + } + private static final int MAC_OS_VERSION_13_4 = (int)130400L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_13_4 130400 + * } + */ + public static int MAC_OS_VERSION_13_4() { + return MAC_OS_VERSION_13_4; + } + private static final int MAC_OS_VERSION_13_5 = (int)130500L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_13_5 130500 + * } + */ + public static int MAC_OS_VERSION_13_5() { + return MAC_OS_VERSION_13_5; + } + private static final int MAC_OS_VERSION_13_6 = (int)130600L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_13_6 130600 + * } + */ + public static int MAC_OS_VERSION_13_6() { + return MAC_OS_VERSION_13_6; + } + private static final int MAC_OS_VERSION_14_0 = (int)140000L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_14_0 140000 + * } + */ + public static int MAC_OS_VERSION_14_0() { + return MAC_OS_VERSION_14_0; + } + private static final int MAC_OS_VERSION_14_1 = (int)140100L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_14_1 140100 + * } + */ + public static int MAC_OS_VERSION_14_1() { + return MAC_OS_VERSION_14_1; + } + private static final int MAC_OS_VERSION_14_2 = (int)140200L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_14_2 140200 + * } + */ + public static int MAC_OS_VERSION_14_2() { + return MAC_OS_VERSION_14_2; + } + private static final int MAC_OS_VERSION_14_3 = (int)140300L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_14_3 140300 + * } + */ + public static int MAC_OS_VERSION_14_3() { + return MAC_OS_VERSION_14_3; + } + private static final int MAC_OS_VERSION_14_4 = (int)140400L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_14_4 140400 + * } + */ + public static int MAC_OS_VERSION_14_4() { + return MAC_OS_VERSION_14_4; + } + private static final int MAC_OS_VERSION_14_5 = (int)140500L; + /** + * {@snippet lang=c : + * #define MAC_OS_VERSION_14_5 140500 + * } + */ + public static int MAC_OS_VERSION_14_5() { + return MAC_OS_VERSION_14_5; + } + private static final int __MAC_OS_X_VERSION_MAX_ALLOWED = (int)140500L; + /** + * {@snippet lang=c : + * #define __MAC_OS_X_VERSION_MAX_ALLOWED 140500 + * } + */ + public static int __MAC_OS_X_VERSION_MAX_ALLOWED() { + return __MAC_OS_X_VERSION_MAX_ALLOWED; + } + private static final MemorySegment __DARWIN_NULL = MemorySegment.ofAddress(0L); + /** + * {@snippet lang=c : + * #define __DARWIN_NULL (void*) 0 + * } + */ + public static MemorySegment __DARWIN_NULL() { + return __DARWIN_NULL; + } + private static final int __DARWIN_WCHAR_MAX = (int)2147483647L; + /** + * {@snippet lang=c : + * #define __DARWIN_WCHAR_MAX 2147483647 + * } + */ + public static int __DARWIN_WCHAR_MAX() { + return __DARWIN_WCHAR_MAX; + } + private static final int __DARWIN_WCHAR_MIN = (int)-2147483648L; + /** + * {@snippet lang=c : + * #define __DARWIN_WCHAR_MIN -2147483648 + * } + */ + public static int __DARWIN_WCHAR_MIN() { + return __DARWIN_WCHAR_MIN; + } + private static final int __DARWIN_WEOF = (int)-1L; + /** + * {@snippet lang=c : + * #define __DARWIN_WEOF -1 + * } + */ + public static int __DARWIN_WEOF() { + return __DARWIN_WEOF; + } + private static final long USER_ADDR_NULL = 0L; + /** + * {@snippet lang=c : + * #define USER_ADDR_NULL 0 + * } + */ + public static long USER_ADDR_NULL() { + return USER_ADDR_NULL; + } + private static final MemorySegment NULL = MemorySegment.ofAddress(0L); + /** + * {@snippet lang=c : + * #define NULL (void*) 0 + * } + */ + public static MemorySegment NULL() { + return NULL; + } + private static final int EOF = (int)-1L; + /** + * {@snippet lang=c : + * #define EOF -1 + * } + */ + public static int EOF() { + return EOF; + } + /** + * {@snippet lang=c : + * #define P_tmpdir "/var/tmp/" + * } + */ + public static MemorySegment P_tmpdir() { + class Holder { + static final MemorySegment P_tmpdir + = somelib_h.LIBRARY_ARENA.allocateFrom("/var/tmp/"); + } + return Holder.P_tmpdir; + } + private static final long INT64_MAX = 9223372036854775807L; + /** + * {@snippet lang=c : + * #define INT64_MAX 9223372036854775807 + * } + */ + public static long INT64_MAX() { + return INT64_MAX; + } + private static final int INT8_MIN = (int)-128L; + /** + * {@snippet lang=c : + * #define INT8_MIN -128 + * } + */ + public static int INT8_MIN() { + return INT8_MIN; + } + private static final int INT16_MIN = (int)-32768L; + /** + * {@snippet lang=c : + * #define INT16_MIN -32768 + * } + */ + public static int INT16_MIN() { + return INT16_MIN; + } + private static final int INT32_MIN = (int)-2147483648L; + /** + * {@snippet lang=c : + * #define INT32_MIN -2147483648 + * } + */ + public static int INT32_MIN() { + return INT32_MIN; + } + private static final long INT64_MIN = -9223372036854775808L; + /** + * {@snippet lang=c : + * #define INT64_MIN -9223372036854775808 + * } + */ + public static long INT64_MIN() { + return INT64_MIN; + } + private static final int UINT32_MAX = (int)4294967295L; + /** + * {@snippet lang=c : + * #define UINT32_MAX 4294967295 + * } + */ + public static int UINT32_MAX() { + return UINT32_MAX; + } + private static final long UINT64_MAX = -1L; + /** + * {@snippet lang=c : + * #define UINT64_MAX -1 + * } + */ + public static long UINT64_MAX() { + return UINT64_MAX; + } + private static final int INT_LEAST8_MIN = (int)-128L; + /** + * {@snippet lang=c : + * #define INT_LEAST8_MIN -128 + * } + */ + public static int INT_LEAST8_MIN() { + return INT_LEAST8_MIN; + } + private static final int INT_LEAST16_MIN = (int)-32768L; + /** + * {@snippet lang=c : + * #define INT_LEAST16_MIN -32768 + * } + */ + public static int INT_LEAST16_MIN() { + return INT_LEAST16_MIN; + } + private static final int INT_LEAST32_MIN = (int)-2147483648L; + /** + * {@snippet lang=c : + * #define INT_LEAST32_MIN -2147483648 + * } + */ + public static int INT_LEAST32_MIN() { + return INT_LEAST32_MIN; + } + private static final long INT_LEAST64_MIN = -9223372036854775808L; + /** + * {@snippet lang=c : + * #define INT_LEAST64_MIN -9223372036854775808 + * } + */ + public static long INT_LEAST64_MIN() { + return INT_LEAST64_MIN; + } + private static final int INT_LEAST8_MAX = (int)127L; + /** + * {@snippet lang=c : + * #define INT_LEAST8_MAX 127 + * } + */ + public static int INT_LEAST8_MAX() { + return INT_LEAST8_MAX; + } + private static final int INT_LEAST16_MAX = (int)32767L; + /** + * {@snippet lang=c : + * #define INT_LEAST16_MAX 32767 + * } + */ + public static int INT_LEAST16_MAX() { + return INT_LEAST16_MAX; + } + private static final int INT_LEAST32_MAX = (int)2147483647L; + /** + * {@snippet lang=c : + * #define INT_LEAST32_MAX 2147483647 + * } + */ + public static int INT_LEAST32_MAX() { + return INT_LEAST32_MAX; + } + private static final long INT_LEAST64_MAX = 9223372036854775807L; + /** + * {@snippet lang=c : + * #define INT_LEAST64_MAX 9223372036854775807 + * } + */ + public static long INT_LEAST64_MAX() { + return INT_LEAST64_MAX; + } + private static final int UINT_LEAST8_MAX = (int)255L; + /** + * {@snippet lang=c : + * #define UINT_LEAST8_MAX 255 + * } + */ + public static int UINT_LEAST8_MAX() { + return UINT_LEAST8_MAX; + } + private static final int UINT_LEAST16_MAX = (int)65535L; + /** + * {@snippet lang=c : + * #define UINT_LEAST16_MAX 65535 + * } + */ + public static int UINT_LEAST16_MAX() { + return UINT_LEAST16_MAX; + } + private static final int UINT_LEAST32_MAX = (int)4294967295L; + /** + * {@snippet lang=c : + * #define UINT_LEAST32_MAX 4294967295 + * } + */ + public static int UINT_LEAST32_MAX() { + return UINT_LEAST32_MAX; + } + private static final long UINT_LEAST64_MAX = -1L; + /** + * {@snippet lang=c : + * #define UINT_LEAST64_MAX -1 + * } + */ + public static long UINT_LEAST64_MAX() { + return UINT_LEAST64_MAX; + } + private static final int INT_FAST8_MIN = (int)-128L; + /** + * {@snippet lang=c : + * #define INT_FAST8_MIN -128 + * } + */ + public static int INT_FAST8_MIN() { + return INT_FAST8_MIN; + } + private static final int INT_FAST16_MIN = (int)-32768L; + /** + * {@snippet lang=c : + * #define INT_FAST16_MIN -32768 + * } + */ + public static int INT_FAST16_MIN() { + return INT_FAST16_MIN; + } + private static final int INT_FAST32_MIN = (int)-2147483648L; + /** + * {@snippet lang=c : + * #define INT_FAST32_MIN -2147483648 + * } + */ + public static int INT_FAST32_MIN() { + return INT_FAST32_MIN; + } + private static final long INT_FAST64_MIN = -9223372036854775808L; + /** + * {@snippet lang=c : + * #define INT_FAST64_MIN -9223372036854775808 + * } + */ + public static long INT_FAST64_MIN() { + return INT_FAST64_MIN; + } + private static final int INT_FAST8_MAX = (int)127L; + /** + * {@snippet lang=c : + * #define INT_FAST8_MAX 127 + * } + */ + public static int INT_FAST8_MAX() { + return INT_FAST8_MAX; + } + private static final int INT_FAST16_MAX = (int)32767L; + /** + * {@snippet lang=c : + * #define INT_FAST16_MAX 32767 + * } + */ + public static int INT_FAST16_MAX() { + return INT_FAST16_MAX; + } + private static final int INT_FAST32_MAX = (int)2147483647L; + /** + * {@snippet lang=c : + * #define INT_FAST32_MAX 2147483647 + * } + */ + public static int INT_FAST32_MAX() { + return INT_FAST32_MAX; + } + private static final long INT_FAST64_MAX = 9223372036854775807L; + /** + * {@snippet lang=c : + * #define INT_FAST64_MAX 9223372036854775807 + * } + */ + public static long INT_FAST64_MAX() { + return INT_FAST64_MAX; + } + private static final int UINT_FAST8_MAX = (int)255L; + /** + * {@snippet lang=c : + * #define UINT_FAST8_MAX 255 + * } + */ + public static int UINT_FAST8_MAX() { + return UINT_FAST8_MAX; + } + private static final int UINT_FAST16_MAX = (int)65535L; + /** + * {@snippet lang=c : + * #define UINT_FAST16_MAX 65535 + * } + */ + public static int UINT_FAST16_MAX() { + return UINT_FAST16_MAX; + } + private static final int UINT_FAST32_MAX = (int)4294967295L; + /** + * {@snippet lang=c : + * #define UINT_FAST32_MAX 4294967295 + * } + */ + public static int UINT_FAST32_MAX() { + return UINT_FAST32_MAX; + } + private static final long UINT_FAST64_MAX = -1L; + /** + * {@snippet lang=c : + * #define UINT_FAST64_MAX -1 + * } + */ + public static long UINT_FAST64_MAX() { + return UINT_FAST64_MAX; + } + private static final long INTPTR_MAX = 9223372036854775807L; + /** + * {@snippet lang=c : + * #define INTPTR_MAX 9223372036854775807 + * } + */ + public static long INTPTR_MAX() { + return INTPTR_MAX; + } + private static final long INTPTR_MIN = -9223372036854775808L; + /** + * {@snippet lang=c : + * #define INTPTR_MIN -9223372036854775808 + * } + */ + public static long INTPTR_MIN() { + return INTPTR_MIN; + } + private static final long UINTPTR_MAX = -1L; + /** + * {@snippet lang=c : + * #define UINTPTR_MAX -1 + * } + */ + public static long UINTPTR_MAX() { + return UINTPTR_MAX; + } + private static final long INTMAX_MAX = 9223372036854775807L; + /** + * {@snippet lang=c : + * #define INTMAX_MAX 9223372036854775807 + * } + */ + public static long INTMAX_MAX() { + return INTMAX_MAX; + } + private static final long UINTMAX_MAX = -1L; + /** + * {@snippet lang=c : + * #define UINTMAX_MAX -1 + * } + */ + public static long UINTMAX_MAX() { + return UINTMAX_MAX; + } + private static final long INTMAX_MIN = -9223372036854775808L; + /** + * {@snippet lang=c : + * #define INTMAX_MIN -9223372036854775808 + * } + */ + public static long INTMAX_MIN() { + return INTMAX_MIN; + } + private static final long PTRDIFF_MIN = -9223372036854775808L; + /** + * {@snippet lang=c : + * #define PTRDIFF_MIN -9223372036854775808 + * } + */ + public static long PTRDIFF_MIN() { + return PTRDIFF_MIN; + } + private static final long PTRDIFF_MAX = 9223372036854775807L; + /** + * {@snippet lang=c : + * #define PTRDIFF_MAX 9223372036854775807 + * } + */ + public static long PTRDIFF_MAX() { + return PTRDIFF_MAX; + } + private static final long SIZE_MAX = -1L; + /** + * {@snippet lang=c : + * #define SIZE_MAX -1 + * } + */ + public static long SIZE_MAX() { + return SIZE_MAX; + } + private static final long RSIZE_MAX = 9223372036854775807L; + /** + * {@snippet lang=c : + * #define RSIZE_MAX 9223372036854775807 + * } + */ + public static long RSIZE_MAX() { + return RSIZE_MAX; + } + private static final int WCHAR_MAX = (int)2147483647L; + /** + * {@snippet lang=c : + * #define WCHAR_MAX 2147483647 + * } + */ + public static int WCHAR_MAX() { + return WCHAR_MAX; + } + private static final int WCHAR_MIN = (int)-2147483648L; + /** + * {@snippet lang=c : + * #define WCHAR_MIN -2147483648 + * } + */ + public static int WCHAR_MIN() { + return WCHAR_MIN; + } + private static final int WINT_MIN = (int)-2147483648L; + /** + * {@snippet lang=c : + * #define WINT_MIN -2147483648 + * } + */ + public static int WINT_MIN() { + return WINT_MIN; + } + private static final int WINT_MAX = (int)2147483647L; + /** + * {@snippet lang=c : + * #define WINT_MAX 2147483647 + * } + */ + public static int WINT_MAX() { + return WINT_MAX; + } + private static final int SIG_ATOMIC_MIN = (int)-2147483648L; + /** + * {@snippet lang=c : + * #define SIG_ATOMIC_MIN -2147483648 + * } + */ + public static int SIG_ATOMIC_MIN() { + return SIG_ATOMIC_MIN; + } + private static final int SIG_ATOMIC_MAX = (int)2147483647L; + /** + * {@snippet lang=c : + * #define SIG_ATOMIC_MAX 2147483647 + * } + */ + public static int SIG_ATOMIC_MAX() { + return SIG_ATOMIC_MAX; + } + private static final int __DARWIN_BYTE_ORDER = (int)1234L; + /** + * {@snippet lang=c : + * #define __DARWIN_BYTE_ORDER 1234 + * } + */ + public static int __DARWIN_BYTE_ORDER() { + return __DARWIN_BYTE_ORDER; + } + private static final int LITTLE_ENDIAN = (int)1234L; + /** + * {@snippet lang=c : + * #define LITTLE_ENDIAN 1234 + * } + */ + public static int LITTLE_ENDIAN() { + return LITTLE_ENDIAN; + } + private static final int BIG_ENDIAN = (int)4321L; + /** + * {@snippet lang=c : + * #define BIG_ENDIAN 4321 + * } + */ + public static int BIG_ENDIAN() { + return BIG_ENDIAN; + } + private static final int PDP_ENDIAN = (int)3412L; + /** + * {@snippet lang=c : + * #define PDP_ENDIAN 3412 + * } + */ + public static int PDP_ENDIAN() { + return PDP_ENDIAN; + } + private static final int BYTE_ORDER = (int)1234L; + /** + * {@snippet lang=c : + * #define BYTE_ORDER 1234 + * } + */ + public static int BYTE_ORDER() { + return BYTE_ORDER; + } + private static final long __DARWIN_NFDBITS = 32L; + /** + * {@snippet lang=c : + * #define __DARWIN_NFDBITS 32 + * } + */ + public static long __DARWIN_NFDBITS() { + return __DARWIN_NFDBITS; + } + private static final int NBBY = (int)8L; + /** + * {@snippet lang=c : + * #define NBBY 8 + * } + */ + public static int NBBY() { + return NBBY; + } + private static final long NFDBITS = 32L; + /** + * {@snippet lang=c : + * #define NFDBITS 32 + * } + */ + public static long NFDBITS() { + return NFDBITS; + } + private static final int FD_SETSIZE = (int)1024L; + /** + * {@snippet lang=c : + * #define FD_SETSIZE 1024 + * } + */ + public static int FD_SETSIZE() { + return FD_SETSIZE; + } +} + diff --git a/feature_tests/java/somelib/.gitignore b/feature_tests/java/somelib/.gitignore index a3a6a6a70..98eb56d8d 100644 --- a/feature_tests/java/somelib/.gitignore +++ b/feature_tests/java/somelib/.gitignore @@ -12,6 +12,7 @@ target/ .idea/misc.xml .idea/vcs.xml .idea/codeStyles +.idea/* *.iws *.iml *.ipr diff --git a/feature_tests/java/somelib/src/jmh/java/dev/diplomattest/somelib/OpaqueBench.java b/feature_tests/java/somelib/src/jmh/java/dev/diplomattest/somelib/OpaqueBench.java index d5cee67c4..8a337396f 100644 --- a/feature_tests/java/somelib/src/jmh/java/dev/diplomattest/somelib/OpaqueBench.java +++ b/feature_tests/java/somelib/src/jmh/java/dev/diplomattest/somelib/OpaqueBench.java @@ -10,14 +10,16 @@ public class OpaqueBench { @Benchmark public static void benchOpaque(Blackhole bh) { - var opaque = new Opaque(); + var opaque = Opaque.fromStr("it's amazing to be here"); bh.consume(opaque); - // opaque.delete(); + // opaque.destroy(); } public static void main(String[] args) throws RunnerException { Options opt = new OptionsBuilder() .include(OpaqueBench.class.getSimpleName()) + .warmupIterations(2) + .measurementIterations(2) .forks(1) .build(); diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Main.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Main.java index df98c7b19..296b51f53 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Main.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Main.java @@ -7,6 +7,8 @@ public class Main { static final Cleaner cleaner = Cleaner.create(); public static void main(String[] args) { + var str = "Whaddap G"; + var opaque = Opaque.fromStr(str); //TIP Press with your caret at the highlighted text // to see how IntelliJ IDEA suggests fixing it. System.out.printf("Hello and welcome!"); @@ -17,4 +19,5 @@ public static void main(String[] args) { System.out.println("i = " + i); } } + } \ No newline at end of file diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Opaque.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Opaque.java index a6c5cd31b..a5ebbfec9 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Opaque.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Opaque.java @@ -1,41 +1,67 @@ package dev.diplomattest.somelib; -import dev.diplomattest.somelib.ntv.somelib_h; -import dev.diplomattest.somelib.ntv.somelib_h; +import dev.diplomattest.somelib.ntv.*; -import java.lang.foreign.MemoryLayout; + +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; import java.lang.ref.Cleaner; +import java.nio.charset.StandardCharsets; + public class Opaque { - private MemorySegment internal; - private final Cleaner.Cleanable cleanable; + + MemorySegment internal; + Cleaner.Cleanable cleanable; + static class OpaqueCleaner implements Runnable { + MemorySegment segment; OpaqueCleaner(MemorySegment segment) { this.segment = segment; } + public void run() { somelib_h.Opaque_destroy(this.segment); } } - public Opaque() { - var invoker = somelib_h.Opaque_new.makeInvoker(); - var segment = invoker.apply(); - this.internal = segment; - var opaqueCleaner = new OpaqueCleaner(segment); - this.cleanable = Main.cleaner.register(this, opaqueCleaner); + + Opaque() {} + + public static Opaque new_() { + var nativeInvoker = somelib_h.Opaque_new.makeInvoker(); + var nativeVal = nativeInvoker.apply(); + var returnVal = new Opaque(); + returnVal.internal = nativeVal; + var cleaner = new Opaque.OpaqueCleaner(nativeVal); + returnVal.cleanable = Main.cleaner.register(returnVal, cleaner); + return returnVal; } - public long pointer() { - return internal.address(); + public static Opaque fromStr(String input) { + try (var arena = Arena.ofConfined()) { + var inputMemSeg = arena.allocateFrom(input, StandardCharsets.UTF_8); + var inputLen = inputMemSeg.byteSize(); + var nativeVal = somelib_h.Opaque_from_str(inputMemSeg, inputLen); + var returnVal = new Opaque(); + returnVal.internal = nativeVal; + var cleaner = new Opaque.OpaqueCleaner(nativeVal); + returnVal.cleanable = Main.cleaner.register(returnVal, cleaner); + return returnVal; + } } - public void delete() { - somelib_h.Opaque_destroy(this.internal); + public static long returnsUsize() { + var nativeInvoker = somelib_h.Opaque_returns_usize.makeInvoker(); + var nativeVal = nativeInvoker.apply(); + return nativeVal; } - public void assertStruct(MyStruct struct) { - somelib_h.Opaque_assert_struct(internal, struct.getNativeStruct$()); + + public long internalLen() { + + var nativeVal = somelib_h.Opaque_internal_len(internal); + return nativeVal; } + } diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java index 024437bfe..2025a2023 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java @@ -10130,14 +10130,13 @@ public static boolean diplomat_is_str(MemorySegment buf, long len) { } } - private static class Float64Vec_new { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, + private static class OptionOpaqueChar_assert_char { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_INT ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaqueChar_assert_char"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10145,58 +10144,56 @@ private static class Float64Vec_new { /** * Function descriptor for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new(const double *v_data, size_t v_len) + * void OptionOpaqueChar_assert_char(const OptionOpaqueChar *self, char32_t ch) * } */ - public static FunctionDescriptor Float64Vec_new$descriptor() { - return Float64Vec_new.DESC; + public static FunctionDescriptor OptionOpaqueChar_assert_char$descriptor() { + return OptionOpaqueChar_assert_char.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new(const double *v_data, size_t v_len) + * void OptionOpaqueChar_assert_char(const OptionOpaqueChar *self, char32_t ch) * } */ - public static MethodHandle Float64Vec_new$handle() { - return Float64Vec_new.HANDLE; + public static MethodHandle OptionOpaqueChar_assert_char$handle() { + return OptionOpaqueChar_assert_char.HANDLE; } /** * Address for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new(const double *v_data, size_t v_len) + * void OptionOpaqueChar_assert_char(const OptionOpaqueChar *self, char32_t ch) * } */ - public static MemorySegment Float64Vec_new$address() { - return Float64Vec_new.ADDR; + public static MemorySegment OptionOpaqueChar_assert_char$address() { + return OptionOpaqueChar_assert_char.ADDR; } /** * {@snippet lang=c : - * Float64Vec *Float64Vec_new(const double *v_data, size_t v_len) + * void OptionOpaqueChar_assert_char(const OptionOpaqueChar *self, char32_t ch) * } */ - public static MemorySegment Float64Vec_new(MemorySegment v_data, long v_len) { - var mh$ = Float64Vec_new.HANDLE; + public static void OptionOpaqueChar_assert_char(MemorySegment self, int ch) { + var mh$ = OptionOpaqueChar_assert_char.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_new", v_data, v_len); + traceDowncall("OptionOpaqueChar_assert_char", self, ch); } - return (MemorySegment)mh$.invokeExact(v_data, v_len); + mh$.invokeExact(self, ch); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_new_bool { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG + private static class OptionOpaqueChar_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_bool"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaqueChar_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10204,58 +10201,56 @@ private static class Float64Vec_new_bool { /** * Function descriptor for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_bool(const bool *v_data, size_t v_len) + * void OptionOpaqueChar_destroy(OptionOpaqueChar *self) * } */ - public static FunctionDescriptor Float64Vec_new_bool$descriptor() { - return Float64Vec_new_bool.DESC; + public static FunctionDescriptor OptionOpaqueChar_destroy$descriptor() { + return OptionOpaqueChar_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_bool(const bool *v_data, size_t v_len) + * void OptionOpaqueChar_destroy(OptionOpaqueChar *self) * } */ - public static MethodHandle Float64Vec_new_bool$handle() { - return Float64Vec_new_bool.HANDLE; + public static MethodHandle OptionOpaqueChar_destroy$handle() { + return OptionOpaqueChar_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_bool(const bool *v_data, size_t v_len) + * void OptionOpaqueChar_destroy(OptionOpaqueChar *self) * } */ - public static MemorySegment Float64Vec_new_bool$address() { - return Float64Vec_new_bool.ADDR; + public static MemorySegment OptionOpaqueChar_destroy$address() { + return OptionOpaqueChar_destroy.ADDR; } /** * {@snippet lang=c : - * Float64Vec *Float64Vec_new_bool(const bool *v_data, size_t v_len) + * void OptionOpaqueChar_destroy(OptionOpaqueChar *self) * } */ - public static MemorySegment Float64Vec_new_bool(MemorySegment v_data, long v_len) { - var mh$ = Float64Vec_new_bool.HANDLE; + public static void OptionOpaqueChar_destroy(MemorySegment self) { + var mh$ = OptionOpaqueChar_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_new_bool", v_data, v_len); + traceDowncall("OptionOpaqueChar_destroy", self); } - return (MemorySegment)mh$.invokeExact(v_data, v_len); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_new_i16 { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG + private static class Two_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_i16"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Two_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10263,58 +10258,57 @@ private static class Float64Vec_new_i16 { /** * Function descriptor for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_i16(const int16_t *v_data, size_t v_len) + * void Two_destroy(Two *self) * } */ - public static FunctionDescriptor Float64Vec_new_i16$descriptor() { - return Float64Vec_new_i16.DESC; + public static FunctionDescriptor Two_destroy$descriptor() { + return Two_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_i16(const int16_t *v_data, size_t v_len) + * void Two_destroy(Two *self) * } */ - public static MethodHandle Float64Vec_new_i16$handle() { - return Float64Vec_new_i16.HANDLE; + public static MethodHandle Two_destroy$handle() { + return Two_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_i16(const int16_t *v_data, size_t v_len) + * void Two_destroy(Two *self) * } */ - public static MemorySegment Float64Vec_new_i16$address() { - return Float64Vec_new_i16.ADDR; + public static MemorySegment Two_destroy$address() { + return Two_destroy.ADDR; } /** * {@snippet lang=c : - * Float64Vec *Float64Vec_new_i16(const int16_t *v_data, size_t v_len) + * void Two_destroy(Two *self) * } */ - public static MemorySegment Float64Vec_new_i16(MemorySegment v_data, long v_len) { - var mh$ = Float64Vec_new_i16.HANDLE; + public static void Two_destroy(MemorySegment self) { + var mh$ = Two_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_new_i16", v_data, v_len); + traceDowncall("Two_destroy", self); } - return (MemorySegment)mh$.invokeExact(v_data, v_len); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_new_u16 { + private static class namespace_OpaqueIterable_iter { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_u16"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_OpaqueIterable_iter"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10322,58 +10316,56 @@ private static class Float64Vec_new_u16 { /** * Function descriptor for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_u16(const uint16_t *v_data, size_t v_len) + * OpaqueIterator *namespace_OpaqueIterable_iter(const OpaqueIterable *self) * } */ - public static FunctionDescriptor Float64Vec_new_u16$descriptor() { - return Float64Vec_new_u16.DESC; + public static FunctionDescriptor namespace_OpaqueIterable_iter$descriptor() { + return namespace_OpaqueIterable_iter.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_u16(const uint16_t *v_data, size_t v_len) + * OpaqueIterator *namespace_OpaqueIterable_iter(const OpaqueIterable *self) * } */ - public static MethodHandle Float64Vec_new_u16$handle() { - return Float64Vec_new_u16.HANDLE; + public static MethodHandle namespace_OpaqueIterable_iter$handle() { + return namespace_OpaqueIterable_iter.HANDLE; } /** * Address for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_u16(const uint16_t *v_data, size_t v_len) + * OpaqueIterator *namespace_OpaqueIterable_iter(const OpaqueIterable *self) * } */ - public static MemorySegment Float64Vec_new_u16$address() { - return Float64Vec_new_u16.ADDR; + public static MemorySegment namespace_OpaqueIterable_iter$address() { + return namespace_OpaqueIterable_iter.ADDR; } /** * {@snippet lang=c : - * Float64Vec *Float64Vec_new_u16(const uint16_t *v_data, size_t v_len) + * OpaqueIterator *namespace_OpaqueIterable_iter(const OpaqueIterable *self) * } */ - public static MemorySegment Float64Vec_new_u16(MemorySegment v_data, long v_len) { - var mh$ = Float64Vec_new_u16.HANDLE; + public static MemorySegment namespace_OpaqueIterable_iter(MemorySegment self) { + var mh$ = namespace_OpaqueIterable_iter.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_new_u16", v_data, v_len); + traceDowncall("namespace_OpaqueIterable_iter", self); } - return (MemorySegment)mh$.invokeExact(v_data, v_len); + return (MemorySegment)mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_new_isize { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG + private static class namespace_OpaqueIterable_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_isize"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_OpaqueIterable_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10381,58 +10373,85 @@ private static class Float64Vec_new_isize { /** * Function descriptor for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_isize(const intptr_t *v_data, size_t v_len) + * void namespace_OpaqueIterable_destroy(OpaqueIterable *self) * } */ - public static FunctionDescriptor Float64Vec_new_isize$descriptor() { - return Float64Vec_new_isize.DESC; + public static FunctionDescriptor namespace_OpaqueIterable_destroy$descriptor() { + return namespace_OpaqueIterable_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_isize(const intptr_t *v_data, size_t v_len) + * void namespace_OpaqueIterable_destroy(OpaqueIterable *self) * } */ - public static MethodHandle Float64Vec_new_isize$handle() { - return Float64Vec_new_isize.HANDLE; + public static MethodHandle namespace_OpaqueIterable_destroy$handle() { + return namespace_OpaqueIterable_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_isize(const intptr_t *v_data, size_t v_len) + * void namespace_OpaqueIterable_destroy(OpaqueIterable *self) * } */ - public static MemorySegment Float64Vec_new_isize$address() { - return Float64Vec_new_isize.ADDR; + public static MemorySegment namespace_OpaqueIterable_destroy$address() { + return namespace_OpaqueIterable_destroy.ADDR; } /** * {@snippet lang=c : - * Float64Vec *Float64Vec_new_isize(const intptr_t *v_data, size_t v_len) + * void namespace_OpaqueIterable_destroy(OpaqueIterable *self) * } */ - public static MemorySegment Float64Vec_new_isize(MemorySegment v_data, long v_len) { - var mh$ = Float64Vec_new_isize.HANDLE; + public static void namespace_OpaqueIterable_destroy(MemorySegment self) { + var mh$ = namespace_OpaqueIterable_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_new_isize", v_data, v_len); + traceDowncall("namespace_OpaqueIterable_destroy", self); } - return (MemorySegment)mh$.invokeExact(v_data, v_len); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } + private static final int UnimportedEnum_A = (int)0L; + /** + * {@snippet lang=c : + * enum UnimportedEnum.UnimportedEnum_A = 0 + * } + */ + public static int UnimportedEnum_A() { + return UnimportedEnum_A; + } + private static final int UnimportedEnum_B = (int)1L; + /** + * {@snippet lang=c : + * enum UnimportedEnum.UnimportedEnum_B = 1 + * } + */ + public static int UnimportedEnum_B() { + return UnimportedEnum_B; + } + private static final int UnimportedEnum_C = (int)2L; + /** + * {@snippet lang=c : + * enum UnimportedEnum.UnimportedEnum_C = 2 + * } + */ + public static int UnimportedEnum_C() { + return UnimportedEnum_C; + } - private static class Float64Vec_new_usize { + private static class MyString_new { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_usize"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10440,43 +10459,43 @@ private static class Float64Vec_new_usize { /** * Function descriptor for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_usize(const size_t *v_data, size_t v_len) + * MyString *MyString_new(const char *v_data, size_t v_len) * } */ - public static FunctionDescriptor Float64Vec_new_usize$descriptor() { - return Float64Vec_new_usize.DESC; + public static FunctionDescriptor MyString_new$descriptor() { + return MyString_new.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_usize(const size_t *v_data, size_t v_len) + * MyString *MyString_new(const char *v_data, size_t v_len) * } */ - public static MethodHandle Float64Vec_new_usize$handle() { - return Float64Vec_new_usize.HANDLE; + public static MethodHandle MyString_new$handle() { + return MyString_new.HANDLE; } /** * Address for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_usize(const size_t *v_data, size_t v_len) + * MyString *MyString_new(const char *v_data, size_t v_len) * } */ - public static MemorySegment Float64Vec_new_usize$address() { - return Float64Vec_new_usize.ADDR; + public static MemorySegment MyString_new$address() { + return MyString_new.ADDR; } /** * {@snippet lang=c : - * Float64Vec *Float64Vec_new_usize(const size_t *v_data, size_t v_len) + * MyString *MyString_new(const char *v_data, size_t v_len) * } */ - public static MemorySegment Float64Vec_new_usize(MemorySegment v_data, long v_len) { - var mh$ = Float64Vec_new_usize.HANDLE; + public static MemorySegment MyString_new(MemorySegment v_data, long v_len) { + var mh$ = MyString_new.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_new_usize", v_data, v_len); + traceDowncall("MyString_new", v_data, v_len); } return (MemorySegment)mh$.invokeExact(v_data, v_len); } catch (Throwable ex$) { @@ -10484,14 +10503,14 @@ public static MemorySegment Float64Vec_new_usize(MemorySegment v_data, long v_le } } - private static class Float64Vec_new_f64_be_bytes { + private static class MyString_new_unsafe { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_f64_be_bytes"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new_unsafe"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10499,43 +10518,43 @@ private static class Float64Vec_new_f64_be_bytes { /** * Function descriptor for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_f64_be_bytes(const uint8_t *v_data, size_t v_len) + * MyString *MyString_new_unsafe(const char *v_data, size_t v_len) * } */ - public static FunctionDescriptor Float64Vec_new_f64_be_bytes$descriptor() { - return Float64Vec_new_f64_be_bytes.DESC; + public static FunctionDescriptor MyString_new_unsafe$descriptor() { + return MyString_new_unsafe.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_f64_be_bytes(const uint8_t *v_data, size_t v_len) + * MyString *MyString_new_unsafe(const char *v_data, size_t v_len) * } */ - public static MethodHandle Float64Vec_new_f64_be_bytes$handle() { - return Float64Vec_new_f64_be_bytes.HANDLE; + public static MethodHandle MyString_new_unsafe$handle() { + return MyString_new_unsafe.HANDLE; } /** * Address for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_f64_be_bytes(const uint8_t *v_data, size_t v_len) + * MyString *MyString_new_unsafe(const char *v_data, size_t v_len) * } */ - public static MemorySegment Float64Vec_new_f64_be_bytes$address() { - return Float64Vec_new_f64_be_bytes.ADDR; + public static MemorySegment MyString_new_unsafe$address() { + return MyString_new_unsafe.ADDR; } /** * {@snippet lang=c : - * Float64Vec *Float64Vec_new_f64_be_bytes(const uint8_t *v_data, size_t v_len) + * MyString *MyString_new_unsafe(const char *v_data, size_t v_len) * } */ - public static MemorySegment Float64Vec_new_f64_be_bytes(MemorySegment v_data, long v_len) { - var mh$ = Float64Vec_new_f64_be_bytes.HANDLE; + public static MemorySegment MyString_new_unsafe(MemorySegment v_data, long v_len) { + var mh$ = MyString_new_unsafe.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_new_f64_be_bytes", v_data, v_len); + traceDowncall("MyString_new_unsafe", v_data, v_len); } return (MemorySegment)mh$.invokeExact(v_data, v_len); } catch (Throwable ex$) { @@ -10543,13 +10562,14 @@ public static MemorySegment Float64Vec_new_f64_be_bytes(MemorySegment v_data, lo } } - private static class Float64Vec_as_boxed_slice { + private static class MyString_new_owned { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - DiplomatF64View.layout(), - somelib_h.C_POINTER + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_as_boxed_slice"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new_owned"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10557,57 +10577,58 @@ private static class Float64Vec_as_boxed_slice { /** * Function descriptor for: * {@snippet lang=c : - * DiplomatF64View Float64Vec_as_boxed_slice(const Float64Vec *self) + * MyString *MyString_new_owned(const char *v_data, size_t v_len) * } */ - public static FunctionDescriptor Float64Vec_as_boxed_slice$descriptor() { - return Float64Vec_as_boxed_slice.DESC; + public static FunctionDescriptor MyString_new_owned$descriptor() { + return MyString_new_owned.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * DiplomatF64View Float64Vec_as_boxed_slice(const Float64Vec *self) + * MyString *MyString_new_owned(const char *v_data, size_t v_len) * } */ - public static MethodHandle Float64Vec_as_boxed_slice$handle() { - return Float64Vec_as_boxed_slice.HANDLE; + public static MethodHandle MyString_new_owned$handle() { + return MyString_new_owned.HANDLE; } /** * Address for: * {@snippet lang=c : - * DiplomatF64View Float64Vec_as_boxed_slice(const Float64Vec *self) + * MyString *MyString_new_owned(const char *v_data, size_t v_len) * } */ - public static MemorySegment Float64Vec_as_boxed_slice$address() { - return Float64Vec_as_boxed_slice.ADDR; + public static MemorySegment MyString_new_owned$address() { + return MyString_new_owned.ADDR; } /** * {@snippet lang=c : - * DiplomatF64View Float64Vec_as_boxed_slice(const Float64Vec *self) + * MyString *MyString_new_owned(const char *v_data, size_t v_len) * } */ - public static MemorySegment Float64Vec_as_boxed_slice(SegmentAllocator allocator, MemorySegment self) { - var mh$ = Float64Vec_as_boxed_slice.HANDLE; + public static MemorySegment MyString_new_owned(MemorySegment v_data, long v_len) { + var mh$ = MyString_new_owned.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_as_boxed_slice", allocator, self); + traceDowncall("MyString_new_owned", v_data, v_len); } - return (MemorySegment)mh$.invokeExact(allocator, self); + return (MemorySegment)mh$.invokeExact(v_data, v_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_as_slice { + private static class MyString_new_from_first { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - DiplomatF64View.layout(), - somelib_h.C_POINTER + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_as_slice"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new_from_first"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10615,58 +10636,58 @@ private static class Float64Vec_as_slice { /** * Function descriptor for: * {@snippet lang=c : - * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) + * MyString *MyString_new_from_first(DiplomatStringsView *v_data, size_t v_len) * } */ - public static FunctionDescriptor Float64Vec_as_slice$descriptor() { - return Float64Vec_as_slice.DESC; + public static FunctionDescriptor MyString_new_from_first$descriptor() { + return MyString_new_from_first.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) + * MyString *MyString_new_from_first(DiplomatStringsView *v_data, size_t v_len) * } */ - public static MethodHandle Float64Vec_as_slice$handle() { - return Float64Vec_as_slice.HANDLE; + public static MethodHandle MyString_new_from_first$handle() { + return MyString_new_from_first.HANDLE; } /** * Address for: * {@snippet lang=c : - * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) + * MyString *MyString_new_from_first(DiplomatStringsView *v_data, size_t v_len) * } */ - public static MemorySegment Float64Vec_as_slice$address() { - return Float64Vec_as_slice.ADDR; + public static MemorySegment MyString_new_from_first$address() { + return MyString_new_from_first.ADDR; } /** * {@snippet lang=c : - * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) + * MyString *MyString_new_from_first(DiplomatStringsView *v_data, size_t v_len) * } */ - public static MemorySegment Float64Vec_as_slice(SegmentAllocator allocator, MemorySegment self) { - var mh$ = Float64Vec_as_slice.HANDLE; + public static MemorySegment MyString_new_from_first(MemorySegment v_data, long v_len) { + var mh$ = MyString_new_from_first.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_as_slice", allocator, self); + traceDowncall("MyString_new_from_first", v_data, v_len); } - return (MemorySegment)mh$.invokeExact(allocator, self); + return (MemorySegment)mh$.invokeExact(v_data, v_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_fill_slice { + private static class MyString_set_str { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_fill_slice"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_set_str"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10674,58 +10695,57 @@ private static class Float64Vec_fill_slice { /** * Function descriptor for: * {@snippet lang=c : - * void Float64Vec_fill_slice(const Float64Vec *self, double *v_data, size_t v_len) + * void MyString_set_str(MyString *self, const char *new_str_data, size_t new_str_len) * } */ - public static FunctionDescriptor Float64Vec_fill_slice$descriptor() { - return Float64Vec_fill_slice.DESC; + public static FunctionDescriptor MyString_set_str$descriptor() { + return MyString_set_str.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Float64Vec_fill_slice(const Float64Vec *self, double *v_data, size_t v_len) + * void MyString_set_str(MyString *self, const char *new_str_data, size_t new_str_len) * } */ - public static MethodHandle Float64Vec_fill_slice$handle() { - return Float64Vec_fill_slice.HANDLE; + public static MethodHandle MyString_set_str$handle() { + return MyString_set_str.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Float64Vec_fill_slice(const Float64Vec *self, double *v_data, size_t v_len) + * void MyString_set_str(MyString *self, const char *new_str_data, size_t new_str_len) * } */ - public static MemorySegment Float64Vec_fill_slice$address() { - return Float64Vec_fill_slice.ADDR; + public static MemorySegment MyString_set_str$address() { + return MyString_set_str.ADDR; } /** * {@snippet lang=c : - * void Float64Vec_fill_slice(const Float64Vec *self, double *v_data, size_t v_len) + * void MyString_set_str(MyString *self, const char *new_str_data, size_t new_str_len) * } */ - public static void Float64Vec_fill_slice(MemorySegment self, MemorySegment v_data, long v_len) { - var mh$ = Float64Vec_fill_slice.HANDLE; + public static void MyString_set_str(MemorySegment self, MemorySegment new_str_data, long new_str_len) { + var mh$ = MyString_set_str.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_fill_slice", self, v_data, v_len); + traceDowncall("MyString_set_str", self, new_str_data, new_str_len); } - mh$.invokeExact(self, v_data, v_len); + mh$.invokeExact(self, new_str_data, new_str_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_set_value { + private static class MyString_get_str { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_set_value"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_get_str"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10733,57 +10753,57 @@ private static class Float64Vec_set_value { /** * Function descriptor for: * {@snippet lang=c : - * void Float64Vec_set_value(Float64Vec *self, const double *new_slice_data, size_t new_slice_len) + * void MyString_get_str(const MyString *self, DiplomatWrite *write) * } */ - public static FunctionDescriptor Float64Vec_set_value$descriptor() { - return Float64Vec_set_value.DESC; + public static FunctionDescriptor MyString_get_str$descriptor() { + return MyString_get_str.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Float64Vec_set_value(Float64Vec *self, const double *new_slice_data, size_t new_slice_len) + * void MyString_get_str(const MyString *self, DiplomatWrite *write) * } */ - public static MethodHandle Float64Vec_set_value$handle() { - return Float64Vec_set_value.HANDLE; + public static MethodHandle MyString_get_str$handle() { + return MyString_get_str.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Float64Vec_set_value(Float64Vec *self, const double *new_slice_data, size_t new_slice_len) + * void MyString_get_str(const MyString *self, DiplomatWrite *write) * } */ - public static MemorySegment Float64Vec_set_value$address() { - return Float64Vec_set_value.ADDR; + public static MemorySegment MyString_get_str$address() { + return MyString_get_str.ADDR; } /** * {@snippet lang=c : - * void Float64Vec_set_value(Float64Vec *self, const double *new_slice_data, size_t new_slice_len) + * void MyString_get_str(const MyString *self, DiplomatWrite *write) * } */ - public static void Float64Vec_set_value(MemorySegment self, MemorySegment new_slice_data, long new_slice_len) { - var mh$ = Float64Vec_set_value.HANDLE; + public static void MyString_get_str(MemorySegment self, MemorySegment write) { + var mh$ = MyString_get_str.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_set_value", self, new_slice_data, new_slice_len); + traceDowncall("MyString_get_str", self, write); } - mh$.invokeExact(self, new_slice_data, new_slice_len); + mh$.invokeExact(self, write); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_to_string { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER, + private static class MyString_get_boxed_str { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + DiplomatStringView.layout(), somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_to_string"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_get_boxed_str"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10791,57 +10811,56 @@ private static class Float64Vec_to_string { /** * Function descriptor for: * {@snippet lang=c : - * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) + * DiplomatStringView MyString_get_boxed_str(const MyString *self) * } */ - public static FunctionDescriptor Float64Vec_to_string$descriptor() { - return Float64Vec_to_string.DESC; + public static FunctionDescriptor MyString_get_boxed_str$descriptor() { + return MyString_get_boxed_str.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) + * DiplomatStringView MyString_get_boxed_str(const MyString *self) * } */ - public static MethodHandle Float64Vec_to_string$handle() { - return Float64Vec_to_string.HANDLE; + public static MethodHandle MyString_get_boxed_str$handle() { + return MyString_get_boxed_str.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) + * DiplomatStringView MyString_get_boxed_str(const MyString *self) * } */ - public static MemorySegment Float64Vec_to_string$address() { - return Float64Vec_to_string.ADDR; + public static MemorySegment MyString_get_boxed_str$address() { + return MyString_get_boxed_str.ADDR; } /** * {@snippet lang=c : - * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) + * DiplomatStringView MyString_get_boxed_str(const MyString *self) * } */ - public static void Float64Vec_to_string(MemorySegment self, MemorySegment write) { - var mh$ = Float64Vec_to_string.HANDLE; + public static MemorySegment MyString_get_boxed_str(SegmentAllocator allocator, MemorySegment self) { + var mh$ = MyString_get_boxed_str.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_to_string", self, write); + traceDowncall("MyString_get_boxed_str", allocator, self); } - mh$.invokeExact(self, write); + return (MemorySegment)mh$.invokeExact(allocator, self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_borrow { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - DiplomatF64View.layout(), + private static class MyString_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_borrow"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10849,58 +10868,57 @@ private static class Float64Vec_borrow { /** * Function descriptor for: * {@snippet lang=c : - * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) + * void MyString_destroy(MyString *self) * } */ - public static FunctionDescriptor Float64Vec_borrow$descriptor() { - return Float64Vec_borrow.DESC; + public static FunctionDescriptor MyString_destroy$descriptor() { + return MyString_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) + * void MyString_destroy(MyString *self) * } */ - public static MethodHandle Float64Vec_borrow$handle() { - return Float64Vec_borrow.HANDLE; + public static MethodHandle MyString_destroy$handle() { + return MyString_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) + * void MyString_destroy(MyString *self) * } */ - public static MemorySegment Float64Vec_borrow$address() { - return Float64Vec_borrow.ADDR; + public static MemorySegment MyString_destroy$address() { + return MyString_destroy.ADDR; } /** * {@snippet lang=c : - * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) + * void MyString_destroy(MyString *self) * } */ - public static MemorySegment Float64Vec_borrow(SegmentAllocator allocator, MemorySegment self) { - var mh$ = Float64Vec_borrow.HANDLE; + public static void MyString_destroy(MemorySegment self) { + var mh$ = MyString_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_borrow", allocator, self); + traceDowncall("MyString_destroy", self); } - return (MemorySegment)mh$.invokeExact(allocator, self); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_get { + private static class namespace_MyIterator_next { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - Float64Vec_get_result.layout(), - somelib_h.C_POINTER, - somelib_h.C_LONG + namespace_MyIterator_next_result.layout(), + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_get"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_MyIterator_next"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10908,56 +10926,56 @@ private static class Float64Vec_get { /** * Function descriptor for: * {@snippet lang=c : - * struct Float64Vec_get_result Float64Vec_get(const Float64Vec *self, size_t i) + * struct namespace_MyIterator_next_result namespace_MyIterator_next(MyIterator *self) * } */ - public static FunctionDescriptor Float64Vec_get$descriptor() { - return Float64Vec_get.DESC; + public static FunctionDescriptor namespace_MyIterator_next$descriptor() { + return namespace_MyIterator_next.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * struct Float64Vec_get_result Float64Vec_get(const Float64Vec *self, size_t i) + * struct namespace_MyIterator_next_result namespace_MyIterator_next(MyIterator *self) * } */ - public static MethodHandle Float64Vec_get$handle() { - return Float64Vec_get.HANDLE; + public static MethodHandle namespace_MyIterator_next$handle() { + return namespace_MyIterator_next.HANDLE; } /** * Address for: * {@snippet lang=c : - * struct Float64Vec_get_result Float64Vec_get(const Float64Vec *self, size_t i) + * struct namespace_MyIterator_next_result namespace_MyIterator_next(MyIterator *self) * } */ - public static MemorySegment Float64Vec_get$address() { - return Float64Vec_get.ADDR; + public static MemorySegment namespace_MyIterator_next$address() { + return namespace_MyIterator_next.ADDR; } /** * {@snippet lang=c : - * struct Float64Vec_get_result Float64Vec_get(const Float64Vec *self, size_t i) + * struct namespace_MyIterator_next_result namespace_MyIterator_next(MyIterator *self) * } */ - public static MemorySegment Float64Vec_get(SegmentAllocator allocator, MemorySegment self, long i) { - var mh$ = Float64Vec_get.HANDLE; + public static MemorySegment namespace_MyIterator_next(SegmentAllocator allocator, MemorySegment self) { + var mh$ = namespace_MyIterator_next.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_get", allocator, self, i); + traceDowncall("namespace_MyIterator_next", allocator, self); } - return (MemorySegment)mh$.invokeExact(allocator, self, i); + return (MemorySegment)mh$.invokeExact(allocator, self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_destroy { + private static class namespace_MyIterator_destroy { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_MyIterator_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10965,43 +10983,158 @@ private static class Float64Vec_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void Float64Vec_destroy(Float64Vec *self) + * void namespace_MyIterator_destroy(MyIterator *self) * } */ - public static FunctionDescriptor Float64Vec_destroy$descriptor() { - return Float64Vec_destroy.DESC; + public static FunctionDescriptor namespace_MyIterator_destroy$descriptor() { + return namespace_MyIterator_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Float64Vec_destroy(Float64Vec *self) + * void namespace_MyIterator_destroy(MyIterator *self) * } */ - public static MethodHandle Float64Vec_destroy$handle() { - return Float64Vec_destroy.HANDLE; + public static MethodHandle namespace_MyIterator_destroy$handle() { + return namespace_MyIterator_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Float64Vec_destroy(Float64Vec *self) + * void namespace_MyIterator_destroy(MyIterator *self) * } */ - public static MemorySegment Float64Vec_destroy$address() { - return Float64Vec_destroy.ADDR; + public static MemorySegment namespace_MyIterator_destroy$address() { + return namespace_MyIterator_destroy.ADDR; } /** * {@snippet lang=c : - * void Float64Vec_destroy(Float64Vec *self) + * void namespace_MyIterator_destroy(MyIterator *self) * } */ - public static void Float64Vec_destroy(MemorySegment self) { - var mh$ = Float64Vec_destroy.HANDLE; + public static void namespace_MyIterator_destroy(MemorySegment self) { + var mh$ = namespace_MyIterator_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_destroy", self); + traceDowncall("namespace_MyIterator_destroy", self); + } + mh$.invokeExact(self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class Bar_foo { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("Bar_foo"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * const Foo *Bar_foo(const Bar *self) + * } + */ + public static FunctionDescriptor Bar_foo$descriptor() { + return Bar_foo.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * const Foo *Bar_foo(const Bar *self) + * } + */ + public static MethodHandle Bar_foo$handle() { + return Bar_foo.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * const Foo *Bar_foo(const Bar *self) + * } + */ + public static MemorySegment Bar_foo$address() { + return Bar_foo.ADDR; + } + + /** + * {@snippet lang=c : + * const Foo *Bar_foo(const Bar *self) + * } + */ + public static MemorySegment Bar_foo(MemorySegment self) { + var mh$ = Bar_foo.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Bar_foo", self); + } + return (MemorySegment)mh$.invokeExact(self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class Bar_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("Bar_destroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void Bar_destroy(Bar *self) + * } + */ + public static FunctionDescriptor Bar_destroy$descriptor() { + return Bar_destroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void Bar_destroy(Bar *self) + * } + */ + public static MethodHandle Bar_destroy$handle() { + return Bar_destroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void Bar_destroy(Bar *self) + * } + */ + public static MemorySegment Bar_destroy$address() { + return Bar_destroy.ADDR; + } + + /** + * {@snippet lang=c : + * void Bar_destroy(Bar *self) + * } + */ + public static void Bar_destroy(MemorySegment self) { + var mh$ = Bar_destroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Bar_destroy", self); } mh$.invokeExact(self); } catch (Throwable ex$) { @@ -11063,22 +11196,80 @@ public static int MyEnum_F() { return MyEnum_F; } + private static class MyEnum_into_value { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_CHAR, + somelib_h.C_INT + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyEnum_into_value"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int8_t MyEnum_into_value(MyEnum self) + * } + */ + public static FunctionDescriptor MyEnum_into_value$descriptor() { + return MyEnum_into_value.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int8_t MyEnum_into_value(MyEnum self) + * } + */ + public static MethodHandle MyEnum_into_value$handle() { + return MyEnum_into_value.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int8_t MyEnum_into_value(MyEnum self) + * } + */ + public static MemorySegment MyEnum_into_value$address() { + return MyEnum_into_value.ADDR; + } + + /** + * {@snippet lang=c : + * int8_t MyEnum_into_value(MyEnum self) + * } + */ + public static byte MyEnum_into_value(int self) { + var mh$ = MyEnum_into_value.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("MyEnum_into_value", self); + } + return (byte)mh$.invokeExact(self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + /** * Variadic invoker class for: * {@snippet lang=c : - * MyStruct MyStruct_new() + * MyEnum MyEnum_get_a() * } */ - public static class MyStruct_new { + public static class MyEnum_get_a { private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - MyStruct.layout() ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("MyStruct_new"); + somelib_h.C_INT ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("MyEnum_get_a"); private final MethodHandle handle; private final FunctionDescriptor descriptor; private final MethodHandle spreader; - private MyStruct_new(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + private MyEnum_get_a(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { this.handle = handle; this.descriptor = descriptor; this.spreader = spreader; @@ -11087,15 +11278,15 @@ private MyStruct_new(MethodHandle handle, FunctionDescriptor descriptor, MethodH /** * Variadic invoker factory for: * {@snippet lang=c : - * MyStruct MyStruct_new() + * MyEnum MyEnum_get_a() * } */ - public static MyStruct_new makeInvoker(MemoryLayout... layouts) { + public static MyEnum_get_a makeInvoker(MemoryLayout... layouts) { FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new MyStruct_new(mh$, desc$, spreader$); + return new MyEnum_get_a(mh$, desc$, spreader$); } /** @@ -11119,12 +11310,12 @@ public FunctionDescriptor descriptor() { return descriptor; } - public MemorySegment apply(SegmentAllocator allocator, Object... x0) { + public int apply(Object... x0) { try { if (TRACE_DOWNCALLS) { - traceDowncall("MyStruct_new", allocator, x0); + traceDowncall("MyEnum_get_a", x0); } - return (MemorySegment)spreader.invokeExact(allocator, x0); + return (int)spreader.invokeExact(x0); } catch(IllegalArgumentException | ClassCastException ex$) { throw ex$; // rethrow IAE from passing wrong number/type of args } catch (Throwable ex$) { @@ -11133,13 +11324,14 @@ public MemorySegment apply(SegmentAllocator allocator, Object... x0) { } } - private static class MyStruct_into_a { + private static class OptionString_new { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_CHAR, - MyStruct.layout() + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyStruct_into_a"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionString_new"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11147,126 +11339,173 @@ private static class MyStruct_into_a { /** * Function descriptor for: * {@snippet lang=c : - * uint8_t MyStruct_into_a(MyStruct self) + * OptionString *OptionString_new(const char *diplomat_str_data, size_t diplomat_str_len) * } */ - public static FunctionDescriptor MyStruct_into_a$descriptor() { - return MyStruct_into_a.DESC; + public static FunctionDescriptor OptionString_new$descriptor() { + return OptionString_new.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * uint8_t MyStruct_into_a(MyStruct self) + * OptionString *OptionString_new(const char *diplomat_str_data, size_t diplomat_str_len) * } */ - public static MethodHandle MyStruct_into_a$handle() { - return MyStruct_into_a.HANDLE; + public static MethodHandle OptionString_new$handle() { + return OptionString_new.HANDLE; } /** * Address for: * {@snippet lang=c : - * uint8_t MyStruct_into_a(MyStruct self) + * OptionString *OptionString_new(const char *diplomat_str_data, size_t diplomat_str_len) * } */ - public static MemorySegment MyStruct_into_a$address() { - return MyStruct_into_a.ADDR; + public static MemorySegment OptionString_new$address() { + return OptionString_new.ADDR; } /** * {@snippet lang=c : - * uint8_t MyStruct_into_a(MyStruct self) + * OptionString *OptionString_new(const char *diplomat_str_data, size_t diplomat_str_len) * } */ - public static byte MyStruct_into_a(MemorySegment self) { - var mh$ = MyStruct_into_a.HANDLE; + public static MemorySegment OptionString_new(MemorySegment diplomat_str_data, long diplomat_str_len) { + var mh$ = OptionString_new.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyStruct_into_a", self); + traceDowncall("OptionString_new", diplomat_str_data, diplomat_str_len); } - return (byte)mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(diplomat_str_data, diplomat_str_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } + private static class OptionString_write { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + OptionString_write_result.layout(), + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionString_write"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + /** - * Variadic invoker class for: + * Function descriptor for: * {@snippet lang=c : - * struct MyStruct_returns_zst_result_result MyStruct_returns_zst_result() + * struct OptionString_write_result OptionString_write(const OptionString *self, DiplomatWrite *write) * } */ - public static class MyStruct_returns_zst_result { - private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - MyStruct_returns_zst_result_result.layout() ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("MyStruct_returns_zst_result"); + public static FunctionDescriptor OptionString_write$descriptor() { + return OptionString_write.DESC; + } - private final MethodHandle handle; - private final FunctionDescriptor descriptor; - private final MethodHandle spreader; + /** + * Downcall method handle for: + * {@snippet lang=c : + * struct OptionString_write_result OptionString_write(const OptionString *self, DiplomatWrite *write) + * } + */ + public static MethodHandle OptionString_write$handle() { + return OptionString_write.HANDLE; + } - private MyStruct_returns_zst_result(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { - this.handle = handle; - this.descriptor = descriptor; - this.spreader = spreader; - } + /** + * Address for: + * {@snippet lang=c : + * struct OptionString_write_result OptionString_write(const OptionString *self, DiplomatWrite *write) + * } + */ + public static MemorySegment OptionString_write$address() { + return OptionString_write.ADDR; + } - /** - * Variadic invoker factory for: - * {@snippet lang=c : - * struct MyStruct_returns_zst_result_result MyStruct_returns_zst_result() - * } - */ - public static MyStruct_returns_zst_result makeInvoker(MemoryLayout... layouts) { - FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); - Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); - var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); - var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new MyStruct_returns_zst_result(mh$, desc$, spreader$); + /** + * {@snippet lang=c : + * struct OptionString_write_result OptionString_write(const OptionString *self, DiplomatWrite *write) + * } + */ + public static MemorySegment OptionString_write(SegmentAllocator allocator, MemorySegment self, MemorySegment write) { + var mh$ = OptionString_write.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("OptionString_write", allocator, self, write); + } + return (MemorySegment)mh$.invokeExact(allocator, self, write); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); } + } - /** - * {@return the address} - */ - public static MemorySegment address() { - return ADDR; - } + private static class OptionString_borrow { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + OptionString_borrow_result.layout(), + somelib_h.C_POINTER + ); - /** - * {@return the specialized method handle} - */ - public MethodHandle handle() { - return handle; - } + public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionString_borrow"); - /** - * {@return the specialized descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } - public MemorySegment apply(SegmentAllocator allocator, Object... x0) { - try { - if (TRACE_DOWNCALLS) { - traceDowncall("MyStruct_returns_zst_result", allocator, x0); - } - return (MemorySegment)spreader.invokeExact(allocator, x0); - } catch(IllegalArgumentException | ClassCastException ex$) { - throw ex$; // rethrow IAE from passing wrong number/type of args - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); + /** + * Function descriptor for: + * {@snippet lang=c : + * struct OptionString_borrow_result OptionString_borrow(const OptionString *self) + * } + */ + public static FunctionDescriptor OptionString_borrow$descriptor() { + return OptionString_borrow.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * struct OptionString_borrow_result OptionString_borrow(const OptionString *self) + * } + */ + public static MethodHandle OptionString_borrow$handle() { + return OptionString_borrow.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * struct OptionString_borrow_result OptionString_borrow(const OptionString *self) + * } + */ + public static MemorySegment OptionString_borrow$address() { + return OptionString_borrow.ADDR; + } + + /** + * {@snippet lang=c : + * struct OptionString_borrow_result OptionString_borrow(const OptionString *self) + * } + */ + public static MemorySegment OptionString_borrow(SegmentAllocator allocator, MemorySegment self) { + var mh$ = OptionString_borrow.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("OptionString_borrow", allocator, self); } + return (MemorySegment)mh$.invokeExact(allocator, self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); } } - private static class namespace_AttrOpaque2_destroy { + private static class OptionString_destroy { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_AttrOpaque2_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionString_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11274,43 +11513,43 @@ private static class namespace_AttrOpaque2_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void namespace_AttrOpaque2_destroy(AttrOpaque2 *self) + * void OptionString_destroy(OptionString *self) * } */ - public static FunctionDescriptor namespace_AttrOpaque2_destroy$descriptor() { - return namespace_AttrOpaque2_destroy.DESC; + public static FunctionDescriptor OptionString_destroy$descriptor() { + return OptionString_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void namespace_AttrOpaque2_destroy(AttrOpaque2 *self) + * void OptionString_destroy(OptionString *self) * } */ - public static MethodHandle namespace_AttrOpaque2_destroy$handle() { - return namespace_AttrOpaque2_destroy.HANDLE; + public static MethodHandle OptionString_destroy$handle() { + return OptionString_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * void namespace_AttrOpaque2_destroy(AttrOpaque2 *self) + * void OptionString_destroy(OptionString *self) * } */ - public static MemorySegment namespace_AttrOpaque2_destroy$address() { - return namespace_AttrOpaque2_destroy.ADDR; + public static MemorySegment OptionString_destroy$address() { + return OptionString_destroy.ADDR; } /** * {@snippet lang=c : - * void namespace_AttrOpaque2_destroy(AttrOpaque2 *self) + * void OptionString_destroy(OptionString *self) * } */ - public static void namespace_AttrOpaque2_destroy(MemorySegment self) { - var mh$ = namespace_AttrOpaque2_destroy.HANDLE; + public static void OptionString_destroy(MemorySegment self) { + var mh$ = OptionString_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("namespace_AttrOpaque2_destroy", self); + traceDowncall("OptionString_destroy", self); } mh$.invokeExact(self); } catch (Throwable ex$) { @@ -11345,14 +11584,13 @@ public static int AttrEnum_C() { return AttrEnum_C; } - private static class Foo_new { + private static class namespace_Unnamespaced_make { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_INT ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_new"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_Unnamespaced_make"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11360,57 +11598,57 @@ private static class Foo_new { /** * Function descriptor for: * {@snippet lang=c : - * Foo *Foo_new(const char *x_data, size_t x_len) + * Unnamespaced *namespace_Unnamespaced_make(AttrEnum _e) * } */ - public static FunctionDescriptor Foo_new$descriptor() { - return Foo_new.DESC; + public static FunctionDescriptor namespace_Unnamespaced_make$descriptor() { + return namespace_Unnamespaced_make.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Foo *Foo_new(const char *x_data, size_t x_len) + * Unnamespaced *namespace_Unnamespaced_make(AttrEnum _e) * } */ - public static MethodHandle Foo_new$handle() { - return Foo_new.HANDLE; + public static MethodHandle namespace_Unnamespaced_make$handle() { + return namespace_Unnamespaced_make.HANDLE; } /** * Address for: * {@snippet lang=c : - * Foo *Foo_new(const char *x_data, size_t x_len) + * Unnamespaced *namespace_Unnamespaced_make(AttrEnum _e) * } */ - public static MemorySegment Foo_new$address() { - return Foo_new.ADDR; + public static MemorySegment namespace_Unnamespaced_make$address() { + return namespace_Unnamespaced_make.ADDR; } /** * {@snippet lang=c : - * Foo *Foo_new(const char *x_data, size_t x_len) + * Unnamespaced *namespace_Unnamespaced_make(AttrEnum _e) * } */ - public static MemorySegment Foo_new(MemorySegment x_data, long x_len) { - var mh$ = Foo_new.HANDLE; + public static MemorySegment namespace_Unnamespaced_make(int _e) { + var mh$ = namespace_Unnamespaced_make.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Foo_new", x_data, x_len); + traceDowncall("namespace_Unnamespaced_make", _e); } - return (MemorySegment)mh$.invokeExact(x_data, x_len); + return (MemorySegment)mh$.invokeExact(_e); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Foo_get_bar { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( + private static class namespace_Unnamespaced_use_namespaced { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_get_bar"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_Unnamespaced_use_namespaced"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11418,58 +11656,56 @@ private static class Foo_get_bar { /** * Function descriptor for: * {@snippet lang=c : - * Bar *Foo_get_bar(const Foo *self) + * void namespace_Unnamespaced_use_namespaced(const Unnamespaced *self, const AttrOpaque1 *_n) * } */ - public static FunctionDescriptor Foo_get_bar$descriptor() { - return Foo_get_bar.DESC; + public static FunctionDescriptor namespace_Unnamespaced_use_namespaced$descriptor() { + return namespace_Unnamespaced_use_namespaced.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Bar *Foo_get_bar(const Foo *self) + * void namespace_Unnamespaced_use_namespaced(const Unnamespaced *self, const AttrOpaque1 *_n) * } */ - public static MethodHandle Foo_get_bar$handle() { - return Foo_get_bar.HANDLE; + public static MethodHandle namespace_Unnamespaced_use_namespaced$handle() { + return namespace_Unnamespaced_use_namespaced.HANDLE; } /** * Address for: * {@snippet lang=c : - * Bar *Foo_get_bar(const Foo *self) + * void namespace_Unnamespaced_use_namespaced(const Unnamespaced *self, const AttrOpaque1 *_n) * } */ - public static MemorySegment Foo_get_bar$address() { - return Foo_get_bar.ADDR; + public static MemorySegment namespace_Unnamespaced_use_namespaced$address() { + return namespace_Unnamespaced_use_namespaced.ADDR; } /** * {@snippet lang=c : - * Bar *Foo_get_bar(const Foo *self) + * void namespace_Unnamespaced_use_namespaced(const Unnamespaced *self, const AttrOpaque1 *_n) * } */ - public static MemorySegment Foo_get_bar(MemorySegment self) { - var mh$ = Foo_get_bar.HANDLE; + public static void namespace_Unnamespaced_use_namespaced(MemorySegment self, MemorySegment _n) { + var mh$ = namespace_Unnamespaced_use_namespaced.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Foo_get_bar", self); + traceDowncall("namespace_Unnamespaced_use_namespaced", self, _n); } - return (MemorySegment)mh$.invokeExact(self); + mh$.invokeExact(self, _n); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Foo_new_static { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG + private static class namespace_Unnamespaced_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_new_static"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_Unnamespaced_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11477,57 +11713,128 @@ private static class Foo_new_static { /** * Function descriptor for: * {@snippet lang=c : - * Foo *Foo_new_static(const char *x_data, size_t x_len) + * void namespace_Unnamespaced_destroy(Unnamespaced *self) * } */ - public static FunctionDescriptor Foo_new_static$descriptor() { - return Foo_new_static.DESC; + public static FunctionDescriptor namespace_Unnamespaced_destroy$descriptor() { + return namespace_Unnamespaced_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Foo *Foo_new_static(const char *x_data, size_t x_len) + * void namespace_Unnamespaced_destroy(Unnamespaced *self) * } */ - public static MethodHandle Foo_new_static$handle() { - return Foo_new_static.HANDLE; + public static MethodHandle namespace_Unnamespaced_destroy$handle() { + return namespace_Unnamespaced_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * Foo *Foo_new_static(const char *x_data, size_t x_len) + * void namespace_Unnamespaced_destroy(Unnamespaced *self) * } */ - public static MemorySegment Foo_new_static$address() { - return Foo_new_static.ADDR; + public static MemorySegment namespace_Unnamespaced_destroy$address() { + return namespace_Unnamespaced_destroy.ADDR; } /** * {@snippet lang=c : - * Foo *Foo_new_static(const char *x_data, size_t x_len) + * void namespace_Unnamespaced_destroy(Unnamespaced *self) * } */ - public static MemorySegment Foo_new_static(MemorySegment x_data, long x_len) { - var mh$ = Foo_new_static.HANDLE; + public static void namespace_Unnamespaced_destroy(MemorySegment self) { + var mh$ = namespace_Unnamespaced_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Foo_new_static", x_data, x_len); + traceDowncall("namespace_Unnamespaced_destroy", self); } - return (MemorySegment)mh$.invokeExact(x_data, x_len); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Foo_as_returning { + /** + * Variadic invoker class for: + * {@snippet lang=c : + * Opaque *Opaque_new() + * } + */ + public static class Opaque_new { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + somelib_h.C_POINTER ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_new"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private Opaque_new(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * Opaque *Opaque_new() + * } + */ + public static Opaque_new makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new Opaque_new(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public MemorySegment apply(Object... x0) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Opaque_new", x0); + } + return (MemorySegment)spreader.invokeExact(x0); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static class Opaque_try_from_utf8 { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - BorrowedFieldsReturning.layout(), - somelib_h.C_POINTER + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_as_returning"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_try_from_utf8"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11535,57 +11842,58 @@ private static class Foo_as_returning { /** * Function descriptor for: * {@snippet lang=c : - * BorrowedFieldsReturning Foo_as_returning(const Foo *self) + * Opaque *Opaque_try_from_utf8(const char *input_data, size_t input_len) * } */ - public static FunctionDescriptor Foo_as_returning$descriptor() { - return Foo_as_returning.DESC; + public static FunctionDescriptor Opaque_try_from_utf8$descriptor() { + return Opaque_try_from_utf8.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * BorrowedFieldsReturning Foo_as_returning(const Foo *self) + * Opaque *Opaque_try_from_utf8(const char *input_data, size_t input_len) * } */ - public static MethodHandle Foo_as_returning$handle() { - return Foo_as_returning.HANDLE; + public static MethodHandle Opaque_try_from_utf8$handle() { + return Opaque_try_from_utf8.HANDLE; } /** * Address for: * {@snippet lang=c : - * BorrowedFieldsReturning Foo_as_returning(const Foo *self) + * Opaque *Opaque_try_from_utf8(const char *input_data, size_t input_len) * } */ - public static MemorySegment Foo_as_returning$address() { - return Foo_as_returning.ADDR; + public static MemorySegment Opaque_try_from_utf8$address() { + return Opaque_try_from_utf8.ADDR; } /** * {@snippet lang=c : - * BorrowedFieldsReturning Foo_as_returning(const Foo *self) + * Opaque *Opaque_try_from_utf8(const char *input_data, size_t input_len) * } */ - public static MemorySegment Foo_as_returning(SegmentAllocator allocator, MemorySegment self) { - var mh$ = Foo_as_returning.HANDLE; + public static MemorySegment Opaque_try_from_utf8(MemorySegment input_data, long input_len) { + var mh$ = Opaque_try_from_utf8.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Foo_as_returning", allocator, self); + traceDowncall("Opaque_try_from_utf8", input_data, input_len); } - return (MemorySegment)mh$.invokeExact(allocator, self); + return (MemorySegment)mh$.invokeExact(input_data, input_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Foo_extract_from_fields { + private static class Opaque_from_str { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - BorrowedFields.layout() + somelib_h.C_POINTER, + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_extract_from_fields"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_from_str"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11593,59 +11901,57 @@ private static class Foo_extract_from_fields { /** * Function descriptor for: * {@snippet lang=c : - * Foo *Foo_extract_from_fields(BorrowedFields fields) + * Opaque *Opaque_from_str(const char *input_data, size_t input_len) * } */ - public static FunctionDescriptor Foo_extract_from_fields$descriptor() { - return Foo_extract_from_fields.DESC; + public static FunctionDescriptor Opaque_from_str$descriptor() { + return Opaque_from_str.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Foo *Foo_extract_from_fields(BorrowedFields fields) + * Opaque *Opaque_from_str(const char *input_data, size_t input_len) * } */ - public static MethodHandle Foo_extract_from_fields$handle() { - return Foo_extract_from_fields.HANDLE; + public static MethodHandle Opaque_from_str$handle() { + return Opaque_from_str.HANDLE; } /** * Address for: * {@snippet lang=c : - * Foo *Foo_extract_from_fields(BorrowedFields fields) + * Opaque *Opaque_from_str(const char *input_data, size_t input_len) * } */ - public static MemorySegment Foo_extract_from_fields$address() { - return Foo_extract_from_fields.ADDR; + public static MemorySegment Opaque_from_str$address() { + return Opaque_from_str.ADDR; } /** * {@snippet lang=c : - * Foo *Foo_extract_from_fields(BorrowedFields fields) + * Opaque *Opaque_from_str(const char *input_data, size_t input_len) * } */ - public static MemorySegment Foo_extract_from_fields(MemorySegment fields) { - var mh$ = Foo_extract_from_fields.HANDLE; + public static MemorySegment Opaque_from_str(MemorySegment input_data, long input_len) { + var mh$ = Opaque_from_str.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Foo_extract_from_fields", fields); + traceDowncall("Opaque_from_str", input_data, input_len); } - return (MemorySegment)mh$.invokeExact(fields); + return (MemorySegment)mh$.invokeExact(input_data, input_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Foo_extract_from_bounds { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - BorrowedFieldsWithBounds.layout(), + private static class Opaque_get_debug_str { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_extract_from_bounds"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_get_debug_str"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11653,56 +11959,57 @@ private static class Foo_extract_from_bounds { /** * Function descriptor for: * {@snippet lang=c : - * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, const char *another_string_data, size_t another_string_len) + * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) * } */ - public static FunctionDescriptor Foo_extract_from_bounds$descriptor() { - return Foo_extract_from_bounds.DESC; + public static FunctionDescriptor Opaque_get_debug_str$descriptor() { + return Opaque_get_debug_str.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, const char *another_string_data, size_t another_string_len) + * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) * } */ - public static MethodHandle Foo_extract_from_bounds$handle() { - return Foo_extract_from_bounds.HANDLE; + public static MethodHandle Opaque_get_debug_str$handle() { + return Opaque_get_debug_str.HANDLE; } /** * Address for: * {@snippet lang=c : - * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, const char *another_string_data, size_t another_string_len) + * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) * } */ - public static MemorySegment Foo_extract_from_bounds$address() { - return Foo_extract_from_bounds.ADDR; + public static MemorySegment Opaque_get_debug_str$address() { + return Opaque_get_debug_str.ADDR; } /** * {@snippet lang=c : - * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, const char *another_string_data, size_t another_string_len) + * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) * } */ - public static MemorySegment Foo_extract_from_bounds(MemorySegment bounds, MemorySegment another_string_data, long another_string_len) { - var mh$ = Foo_extract_from_bounds.HANDLE; + public static void Opaque_get_debug_str(MemorySegment self, MemorySegment write) { + var mh$ = Opaque_get_debug_str.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Foo_extract_from_bounds", bounds, another_string_data, another_string_len); + traceDowncall("Opaque_get_debug_str", self, write); } - return (MemorySegment)mh$.invokeExact(bounds, another_string_data, another_string_len); + mh$.invokeExact(self, write); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Foo_destroy { + private static class Opaque_assert_struct { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER + somelib_h.C_POINTER, + MyStruct.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_assert_struct"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11710,45 +12017,45 @@ private static class Foo_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void Foo_destroy(Foo *self) + * void Opaque_assert_struct(const Opaque *self, MyStruct s) * } */ - public static FunctionDescriptor Foo_destroy$descriptor() { - return Foo_destroy.DESC; + public static FunctionDescriptor Opaque_assert_struct$descriptor() { + return Opaque_assert_struct.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Foo_destroy(Foo *self) + * void Opaque_assert_struct(const Opaque *self, MyStruct s) * } */ - public static MethodHandle Foo_destroy$handle() { - return Foo_destroy.HANDLE; + public static MethodHandle Opaque_assert_struct$handle() { + return Opaque_assert_struct.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Foo_destroy(Foo *self) + * void Opaque_assert_struct(const Opaque *self, MyStruct s) * } */ - public static MemorySegment Foo_destroy$address() { - return Foo_destroy.ADDR; - } + public static MemorySegment Opaque_assert_struct$address() { + return Opaque_assert_struct.ADDR; + } /** * {@snippet lang=c : - * void Foo_destroy(Foo *self) + * void Opaque_assert_struct(const Opaque *self, MyStruct s) * } */ - public static void Foo_destroy(MemorySegment self) { - var mh$ = Foo_destroy.HANDLE; + public static void Opaque_assert_struct(MemorySegment self, MemorySegment s) { + var mh$ = Opaque_assert_struct.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Foo_destroy", self); + traceDowncall("Opaque_assert_struct", self, s); } - mh$.invokeExact(self); + mh$.invokeExact(self, s); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -11757,19 +12064,19 @@ public static void Foo_destroy(MemorySegment self) { /** * Variadic invoker class for: * {@snippet lang=c : - * AttrOpaque1 *namespace_AttrOpaque1_new() + * size_t Opaque_returns_usize() * } */ - public static class namespace_AttrOpaque1_new { + public static class Opaque_returns_usize { private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - somelib_h.C_POINTER ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_AttrOpaque1_new"); + somelib_h.C_LONG ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_returns_usize"); private final MethodHandle handle; private final FunctionDescriptor descriptor; private final MethodHandle spreader; - private namespace_AttrOpaque1_new(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + private Opaque_returns_usize(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { this.handle = handle; this.descriptor = descriptor; this.spreader = spreader; @@ -11778,15 +12085,15 @@ private namespace_AttrOpaque1_new(MethodHandle handle, FunctionDescriptor descri /** * Variadic invoker factory for: * {@snippet lang=c : - * AttrOpaque1 *namespace_AttrOpaque1_new() + * size_t Opaque_returns_usize() * } */ - public static namespace_AttrOpaque1_new makeInvoker(MemoryLayout... layouts) { + public static Opaque_returns_usize makeInvoker(MemoryLayout... layouts) { FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new namespace_AttrOpaque1_new(mh$, desc$, spreader$); + return new Opaque_returns_usize(mh$, desc$, spreader$); } /** @@ -11810,12 +12117,12 @@ public FunctionDescriptor descriptor() { return descriptor; } - public MemorySegment apply(Object... x0) { + public long apply(Object... x0) { try { if (TRACE_DOWNCALLS) { - traceDowncall("namespace_AttrOpaque1_new", x0); + traceDowncall("Opaque_returns_usize", x0); } - return (MemorySegment)spreader.invokeExact(x0); + return (long)spreader.invokeExact(x0); } catch(IllegalArgumentException | ClassCastException ex$) { throw ex$; // rethrow IAE from passing wrong number/type of args } catch (Throwable ex$) { @@ -11824,13 +12131,13 @@ public MemorySegment apply(Object... x0) { } } - private static class namespace_AttrOpaque1_method { + private static class Opaque_internal_len { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_CHAR, + somelib_h.C_LONG, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_AttrOpaque1_method"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_internal_len"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11838,114 +12145,196 @@ private static class namespace_AttrOpaque1_method { /** * Function descriptor for: * {@snippet lang=c : - * uint8_t namespace_AttrOpaque1_method(const AttrOpaque1 *self) + * size_t Opaque_internal_len(const Opaque *self) * } */ - public static FunctionDescriptor namespace_AttrOpaque1_method$descriptor() { - return namespace_AttrOpaque1_method.DESC; + public static FunctionDescriptor Opaque_internal_len$descriptor() { + return Opaque_internal_len.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * uint8_t namespace_AttrOpaque1_method(const AttrOpaque1 *self) + * size_t Opaque_internal_len(const Opaque *self) * } */ - public static MethodHandle namespace_AttrOpaque1_method$handle() { - return namespace_AttrOpaque1_method.HANDLE; + public static MethodHandle Opaque_internal_len$handle() { + return Opaque_internal_len.HANDLE; } /** * Address for: * {@snippet lang=c : - * uint8_t namespace_AttrOpaque1_method(const AttrOpaque1 *self) + * size_t Opaque_internal_len(const Opaque *self) * } */ - public static MemorySegment namespace_AttrOpaque1_method$address() { - return namespace_AttrOpaque1_method.ADDR; + public static MemorySegment Opaque_internal_len$address() { + return Opaque_internal_len.ADDR; } /** * {@snippet lang=c : - * uint8_t namespace_AttrOpaque1_method(const AttrOpaque1 *self) + * size_t Opaque_internal_len(const Opaque *self) * } */ - public static byte namespace_AttrOpaque1_method(MemorySegment self) { - var mh$ = namespace_AttrOpaque1_method.HANDLE; + public static long Opaque_internal_len(MemorySegment self) { + var mh$ = Opaque_internal_len.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("namespace_AttrOpaque1_method", self); + traceDowncall("Opaque_internal_len", self); } - return (byte)mh$.invokeExact(self); + return (long)mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class renamed_on_abi_only { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_CHAR, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("renamed_on_abi_only"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - /** - * Function descriptor for: + * Variadic invoker class for: * {@snippet lang=c : - * uint8_t renamed_on_abi_only(const AttrOpaque1 *self) + * ImportedStruct Opaque_returns_imported() * } */ - public static FunctionDescriptor renamed_on_abi_only$descriptor() { - return renamed_on_abi_only.DESC; - } + public static class Opaque_returns_imported { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + ImportedStruct.layout() ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_returns_imported"); - /** - * Downcall method handle for: - * {@snippet lang=c : - * uint8_t renamed_on_abi_only(const AttrOpaque1 *self) - * } - */ - public static MethodHandle renamed_on_abi_only$handle() { - return renamed_on_abi_only.HANDLE; - } + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; - /** - * Address for: - * {@snippet lang=c : - * uint8_t renamed_on_abi_only(const AttrOpaque1 *self) - * } - */ - public static MemorySegment renamed_on_abi_only$address() { - return renamed_on_abi_only.ADDR; + private Opaque_returns_imported(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * ImportedStruct Opaque_returns_imported() + * } + */ + public static Opaque_returns_imported makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new Opaque_returns_imported(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public MemorySegment apply(SegmentAllocator allocator, Object... x0) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Opaque_returns_imported", allocator, x0); + } + return (MemorySegment)spreader.invokeExact(allocator, x0); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } } /** + * Variadic invoker class for: * {@snippet lang=c : - * uint8_t renamed_on_abi_only(const AttrOpaque1 *self) + * int8_t Opaque_cmp() * } */ - public static byte renamed_on_abi_only(MemorySegment self) { - var mh$ = renamed_on_abi_only.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("renamed_on_abi_only", self); + public static class Opaque_cmp { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + somelib_h.C_CHAR ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_cmp"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private Opaque_cmp(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * int8_t Opaque_cmp() + * } + */ + public static Opaque_cmp makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new Opaque_cmp(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public byte apply(Object... x0) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Opaque_cmp", x0); + } + return (byte)spreader.invokeExact(x0); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); } - return (byte)mh$.invokeExact(self); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); } } - private static class namespace_AttrOpaque1_method_disabledcpp { + private static class Opaque_destroy { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_AttrOpaque1_method_disabledcpp"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11953,115 +12342,93 @@ private static class namespace_AttrOpaque1_method_disabledcpp { /** * Function descriptor for: * {@snippet lang=c : - * void namespace_AttrOpaque1_method_disabledcpp(const AttrOpaque1 *self) + * void Opaque_destroy(Opaque *self) * } */ - public static FunctionDescriptor namespace_AttrOpaque1_method_disabledcpp$descriptor() { - return namespace_AttrOpaque1_method_disabledcpp.DESC; + public static FunctionDescriptor Opaque_destroy$descriptor() { + return Opaque_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void namespace_AttrOpaque1_method_disabledcpp(const AttrOpaque1 *self) + * void Opaque_destroy(Opaque *self) * } */ - public static MethodHandle namespace_AttrOpaque1_method_disabledcpp$handle() { - return namespace_AttrOpaque1_method_disabledcpp.HANDLE; + public static MethodHandle Opaque_destroy$handle() { + return Opaque_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * void namespace_AttrOpaque1_method_disabledcpp(const AttrOpaque1 *self) + * void Opaque_destroy(Opaque *self) * } */ - public static MemorySegment namespace_AttrOpaque1_method_disabledcpp$address() { - return namespace_AttrOpaque1_method_disabledcpp.ADDR; + public static MemorySegment Opaque_destroy$address() { + return Opaque_destroy.ADDR; } /** * {@snippet lang=c : - * void namespace_AttrOpaque1_method_disabledcpp(const AttrOpaque1 *self) + * void Opaque_destroy(Opaque *self) * } */ - public static void namespace_AttrOpaque1_method_disabledcpp(MemorySegment self) { - var mh$ = namespace_AttrOpaque1_method_disabledcpp.HANDLE; + public static void Opaque_destroy(MemorySegment self) { + var mh$ = Opaque_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("namespace_AttrOpaque1_method_disabledcpp", self); + traceDowncall("Opaque_destroy", self); } mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - - private static class namespace_AttrOpaque1_use_unnamespaced { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_AttrOpaque1_use_unnamespaced"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - + private static final int ContiguousEnum_C = (int)0L; /** - * Function descriptor for: * {@snippet lang=c : - * void namespace_AttrOpaque1_use_unnamespaced(const AttrOpaque1 *self, const Unnamespaced *_un) + * enum ContiguousEnum.ContiguousEnum_C = 0 * } */ - public static FunctionDescriptor namespace_AttrOpaque1_use_unnamespaced$descriptor() { - return namespace_AttrOpaque1_use_unnamespaced.DESC; + public static int ContiguousEnum_C() { + return ContiguousEnum_C; } - + private static final int ContiguousEnum_D = (int)1L; /** - * Downcall method handle for: * {@snippet lang=c : - * void namespace_AttrOpaque1_use_unnamespaced(const AttrOpaque1 *self, const Unnamespaced *_un) + * enum ContiguousEnum.ContiguousEnum_D = 1 * } */ - public static MethodHandle namespace_AttrOpaque1_use_unnamespaced$handle() { - return namespace_AttrOpaque1_use_unnamespaced.HANDLE; + public static int ContiguousEnum_D() { + return ContiguousEnum_D; } - + private static final int ContiguousEnum_E = (int)2L; /** - * Address for: * {@snippet lang=c : - * void namespace_AttrOpaque1_use_unnamespaced(const AttrOpaque1 *self, const Unnamespaced *_un) + * enum ContiguousEnum.ContiguousEnum_E = 2 * } */ - public static MemorySegment namespace_AttrOpaque1_use_unnamespaced$address() { - return namespace_AttrOpaque1_use_unnamespaced.ADDR; + public static int ContiguousEnum_E() { + return ContiguousEnum_E; } - + private static final int ContiguousEnum_F = (int)3L; /** * {@snippet lang=c : - * void namespace_AttrOpaque1_use_unnamespaced(const AttrOpaque1 *self, const Unnamespaced *_un) + * enum ContiguousEnum.ContiguousEnum_F = 3 * } */ - public static void namespace_AttrOpaque1_use_unnamespaced(MemorySegment self, MemorySegment _un) { - var mh$ = namespace_AttrOpaque1_use_unnamespaced.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("namespace_AttrOpaque1_use_unnamespaced", self, _un); - } - mh$.invokeExact(self, _un); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } + public static int ContiguousEnum_F() { + return ContiguousEnum_F; } - private static class namespace_AttrOpaque1_use_namespaced { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class OpaqueMutexedString_from_usize { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - somelib_h.C_INT + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_AttrOpaque1_use_namespaced"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_from_usize"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12069,56 +12436,57 @@ private static class namespace_AttrOpaque1_use_namespaced { /** * Function descriptor for: * {@snippet lang=c : - * void namespace_AttrOpaque1_use_namespaced(const AttrOpaque1 *self, AttrEnum _n) + * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) * } */ - public static FunctionDescriptor namespace_AttrOpaque1_use_namespaced$descriptor() { - return namespace_AttrOpaque1_use_namespaced.DESC; + public static FunctionDescriptor OpaqueMutexedString_from_usize$descriptor() { + return OpaqueMutexedString_from_usize.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void namespace_AttrOpaque1_use_namespaced(const AttrOpaque1 *self, AttrEnum _n) + * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) * } */ - public static MethodHandle namespace_AttrOpaque1_use_namespaced$handle() { - return namespace_AttrOpaque1_use_namespaced.HANDLE; + public static MethodHandle OpaqueMutexedString_from_usize$handle() { + return OpaqueMutexedString_from_usize.HANDLE; } /** * Address for: * {@snippet lang=c : - * void namespace_AttrOpaque1_use_namespaced(const AttrOpaque1 *self, AttrEnum _n) + * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) * } */ - public static MemorySegment namespace_AttrOpaque1_use_namespaced$address() { - return namespace_AttrOpaque1_use_namespaced.ADDR; + public static MemorySegment OpaqueMutexedString_from_usize$address() { + return OpaqueMutexedString_from_usize.ADDR; } /** * {@snippet lang=c : - * void namespace_AttrOpaque1_use_namespaced(const AttrOpaque1 *self, AttrEnum _n) + * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) * } */ - public static void namespace_AttrOpaque1_use_namespaced(MemorySegment self, int _n) { - var mh$ = namespace_AttrOpaque1_use_namespaced.HANDLE; + public static MemorySegment OpaqueMutexedString_from_usize(long number) { + var mh$ = OpaqueMutexedString_from_usize.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("namespace_AttrOpaque1_use_namespaced", self, _n); + traceDowncall("OpaqueMutexedString_from_usize", number); } - mh$.invokeExact(self, _n); + return (MemorySegment)mh$.invokeExact(number); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class namespace_AttrOpaque1_destroy { + private static class OpaqueMutexedString_change { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER + somelib_h.C_POINTER, + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_AttrOpaque1_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_change"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12126,58 +12494,57 @@ private static class namespace_AttrOpaque1_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void namespace_AttrOpaque1_destroy(AttrOpaque1 *self) + * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) * } */ - public static FunctionDescriptor namespace_AttrOpaque1_destroy$descriptor() { - return namespace_AttrOpaque1_destroy.DESC; + public static FunctionDescriptor OpaqueMutexedString_change$descriptor() { + return OpaqueMutexedString_change.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void namespace_AttrOpaque1_destroy(AttrOpaque1 *self) + * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) * } */ - public static MethodHandle namespace_AttrOpaque1_destroy$handle() { - return namespace_AttrOpaque1_destroy.HANDLE; + public static MethodHandle OpaqueMutexedString_change$handle() { + return OpaqueMutexedString_change.HANDLE; } /** * Address for: * {@snippet lang=c : - * void namespace_AttrOpaque1_destroy(AttrOpaque1 *self) + * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) * } */ - public static MemorySegment namespace_AttrOpaque1_destroy$address() { - return namespace_AttrOpaque1_destroy.ADDR; + public static MemorySegment OpaqueMutexedString_change$address() { + return OpaqueMutexedString_change.ADDR; } /** * {@snippet lang=c : - * void namespace_AttrOpaque1_destroy(AttrOpaque1 *self) + * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) * } */ - public static void namespace_AttrOpaque1_destroy(MemorySegment self) { - var mh$ = namespace_AttrOpaque1_destroy.HANDLE; + public static void OpaqueMutexedString_change(MemorySegment self, long number) { + var mh$ = OpaqueMutexedString_change.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("namespace_AttrOpaque1_destroy", self); + traceDowncall("OpaqueMutexedString_change", self, number); } - mh$.invokeExact(self); + mh$.invokeExact(self, number); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Utf16Wrap_from_utf16 { + private static class OpaqueMutexedString_borrow { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_from_utf16"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_borrow"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12185,57 +12552,57 @@ private static class Utf16Wrap_from_utf16 { /** * Function descriptor for: * {@snippet lang=c : - * Utf16Wrap *Utf16Wrap_from_utf16(const char16_t *input_data, size_t input_len) + * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) * } */ - public static FunctionDescriptor Utf16Wrap_from_utf16$descriptor() { - return Utf16Wrap_from_utf16.DESC; + public static FunctionDescriptor OpaqueMutexedString_borrow$descriptor() { + return OpaqueMutexedString_borrow.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Utf16Wrap *Utf16Wrap_from_utf16(const char16_t *input_data, size_t input_len) + * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) * } */ - public static MethodHandle Utf16Wrap_from_utf16$handle() { - return Utf16Wrap_from_utf16.HANDLE; + public static MethodHandle OpaqueMutexedString_borrow$handle() { + return OpaqueMutexedString_borrow.HANDLE; } /** * Address for: * {@snippet lang=c : - * Utf16Wrap *Utf16Wrap_from_utf16(const char16_t *input_data, size_t input_len) + * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) * } */ - public static MemorySegment Utf16Wrap_from_utf16$address() { - return Utf16Wrap_from_utf16.ADDR; + public static MemorySegment OpaqueMutexedString_borrow$address() { + return OpaqueMutexedString_borrow.ADDR; } /** * {@snippet lang=c : - * Utf16Wrap *Utf16Wrap_from_utf16(const char16_t *input_data, size_t input_len) + * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) * } */ - public static MemorySegment Utf16Wrap_from_utf16(MemorySegment input_data, long input_len) { - var mh$ = Utf16Wrap_from_utf16.HANDLE; + public static MemorySegment OpaqueMutexedString_borrow(MemorySegment self) { + var mh$ = OpaqueMutexedString_borrow.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Utf16Wrap_from_utf16", input_data, input_len); + traceDowncall("OpaqueMutexedString_borrow", self); } - return (MemorySegment)mh$.invokeExact(input_data, input_len); + return (MemorySegment)mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Utf16Wrap_get_debug_str { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class OpaqueMutexedString_borrow_other { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_get_debug_str"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_borrow_other"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12243,57 +12610,58 @@ private static class Utf16Wrap_get_debug_str { /** * Function descriptor for: * {@snippet lang=c : - * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) + * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) * } */ - public static FunctionDescriptor Utf16Wrap_get_debug_str$descriptor() { - return Utf16Wrap_get_debug_str.DESC; + public static FunctionDescriptor OpaqueMutexedString_borrow_other$descriptor() { + return OpaqueMutexedString_borrow_other.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) + * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) * } */ - public static MethodHandle Utf16Wrap_get_debug_str$handle() { - return Utf16Wrap_get_debug_str.HANDLE; + public static MethodHandle OpaqueMutexedString_borrow_other$handle() { + return OpaqueMutexedString_borrow_other.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) + * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) * } */ - public static MemorySegment Utf16Wrap_get_debug_str$address() { - return Utf16Wrap_get_debug_str.ADDR; + public static MemorySegment OpaqueMutexedString_borrow_other$address() { + return OpaqueMutexedString_borrow_other.ADDR; } /** * {@snippet lang=c : - * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) + * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) * } */ - public static void Utf16Wrap_get_debug_str(MemorySegment self, MemorySegment write) { - var mh$ = Utf16Wrap_get_debug_str.HANDLE; + public static MemorySegment OpaqueMutexedString_borrow_other(MemorySegment other) { + var mh$ = OpaqueMutexedString_borrow_other.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Utf16Wrap_get_debug_str", self, write); + traceDowncall("OpaqueMutexedString_borrow_other", other); } - mh$.invokeExact(self, write); + return (MemorySegment)mh$.invokeExact(other); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Utf16Wrap_borrow_cont { + private static class OpaqueMutexedString_borrow_self_or_other { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - DiplomatString16View.layout(), + somelib_h.C_POINTER, + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_borrow_cont"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_borrow_self_or_other"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12301,57 +12669,58 @@ private static class Utf16Wrap_borrow_cont { /** * Function descriptor for: * {@snippet lang=c : - * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) + * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) * } */ - public static FunctionDescriptor Utf16Wrap_borrow_cont$descriptor() { - return Utf16Wrap_borrow_cont.DESC; + public static FunctionDescriptor OpaqueMutexedString_borrow_self_or_other$descriptor() { + return OpaqueMutexedString_borrow_self_or_other.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) + * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) * } */ - public static MethodHandle Utf16Wrap_borrow_cont$handle() { - return Utf16Wrap_borrow_cont.HANDLE; + public static MethodHandle OpaqueMutexedString_borrow_self_or_other$handle() { + return OpaqueMutexedString_borrow_self_or_other.HANDLE; } /** * Address for: * {@snippet lang=c : - * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) + * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) * } */ - public static MemorySegment Utf16Wrap_borrow_cont$address() { - return Utf16Wrap_borrow_cont.ADDR; + public static MemorySegment OpaqueMutexedString_borrow_self_or_other$address() { + return OpaqueMutexedString_borrow_self_or_other.ADDR; } /** * {@snippet lang=c : - * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) + * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) * } */ - public static MemorySegment Utf16Wrap_borrow_cont(SegmentAllocator allocator, MemorySegment self) { - var mh$ = Utf16Wrap_borrow_cont.HANDLE; + public static MemorySegment OpaqueMutexedString_borrow_self_or_other(MemorySegment self, MemorySegment other) { + var mh$ = OpaqueMutexedString_borrow_self_or_other.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Utf16Wrap_borrow_cont", allocator, self); + traceDowncall("OpaqueMutexedString_borrow_self_or_other", self, other); } - return (MemorySegment)mh$.invokeExact(allocator, self); + return (MemorySegment)mh$.invokeExact(self, other); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Utf16Wrap_owned { + private static class OpaqueMutexedString_get_len_and_add { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - DiplomatString16View.layout(), - somelib_h.C_POINTER + somelib_h.C_LONG, + somelib_h.C_POINTER, + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_owned"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_get_len_and_add"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12359,56 +12728,57 @@ private static class Utf16Wrap_owned { /** * Function descriptor for: * {@snippet lang=c : - * DiplomatString16View Utf16Wrap_owned(const Utf16Wrap *self) + * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) * } */ - public static FunctionDescriptor Utf16Wrap_owned$descriptor() { - return Utf16Wrap_owned.DESC; + public static FunctionDescriptor OpaqueMutexedString_get_len_and_add$descriptor() { + return OpaqueMutexedString_get_len_and_add.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * DiplomatString16View Utf16Wrap_owned(const Utf16Wrap *self) + * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) * } */ - public static MethodHandle Utf16Wrap_owned$handle() { - return Utf16Wrap_owned.HANDLE; + public static MethodHandle OpaqueMutexedString_get_len_and_add$handle() { + return OpaqueMutexedString_get_len_and_add.HANDLE; } /** * Address for: * {@snippet lang=c : - * DiplomatString16View Utf16Wrap_owned(const Utf16Wrap *self) + * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) * } */ - public static MemorySegment Utf16Wrap_owned$address() { - return Utf16Wrap_owned.ADDR; + public static MemorySegment OpaqueMutexedString_get_len_and_add$address() { + return OpaqueMutexedString_get_len_and_add.ADDR; } /** * {@snippet lang=c : - * DiplomatString16View Utf16Wrap_owned(const Utf16Wrap *self) + * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) * } */ - public static MemorySegment Utf16Wrap_owned(SegmentAllocator allocator, MemorySegment self) { - var mh$ = Utf16Wrap_owned.HANDLE; + public static long OpaqueMutexedString_get_len_and_add(MemorySegment self, long other) { + var mh$ = OpaqueMutexedString_get_len_and_add.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Utf16Wrap_owned", allocator, self); + traceDowncall("OpaqueMutexedString_get_len_and_add", self, other); } - return (MemorySegment)mh$.invokeExact(allocator, self); + return (long)mh$.invokeExact(self, other); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Utf16Wrap_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class OpaqueMutexedString_dummy_str { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + DiplomatStringView.layout(), somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_dummy_str"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12416,57 +12786,57 @@ private static class Utf16Wrap_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void Utf16Wrap_destroy(Utf16Wrap *self) + * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) * } */ - public static FunctionDescriptor Utf16Wrap_destroy$descriptor() { - return Utf16Wrap_destroy.DESC; + public static FunctionDescriptor OpaqueMutexedString_dummy_str$descriptor() { + return OpaqueMutexedString_dummy_str.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Utf16Wrap_destroy(Utf16Wrap *self) + * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) * } */ - public static MethodHandle Utf16Wrap_destroy$handle() { - return Utf16Wrap_destroy.HANDLE; + public static MethodHandle OpaqueMutexedString_dummy_str$handle() { + return OpaqueMutexedString_dummy_str.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Utf16Wrap_destroy(Utf16Wrap *self) + * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) * } */ - public static MemorySegment Utf16Wrap_destroy$address() { - return Utf16Wrap_destroy.ADDR; + public static MemorySegment OpaqueMutexedString_dummy_str$address() { + return OpaqueMutexedString_dummy_str.ADDR; } /** * {@snippet lang=c : - * void Utf16Wrap_destroy(Utf16Wrap *self) + * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) * } */ - public static void Utf16Wrap_destroy(MemorySegment self) { - var mh$ = Utf16Wrap_destroy.HANDLE; + public static MemorySegment OpaqueMutexedString_dummy_str(SegmentAllocator allocator, MemorySegment self) { + var mh$ = OpaqueMutexedString_dummy_str.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Utf16Wrap_destroy", self); + traceDowncall("OpaqueMutexedString_dummy_str", allocator, self); } - mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(allocator, self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class namespace_OpaqueIterable_iter { + private static class OpaqueMutexedString_wrapper { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_OpaqueIterable_iter"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_wrapper"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12474,43 +12844,43 @@ private static class namespace_OpaqueIterable_iter { /** * Function descriptor for: * {@snippet lang=c : - * OpaqueIterator *namespace_OpaqueIterable_iter(const OpaqueIterable *self) + * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) * } */ - public static FunctionDescriptor namespace_OpaqueIterable_iter$descriptor() { - return namespace_OpaqueIterable_iter.DESC; + public static FunctionDescriptor OpaqueMutexedString_wrapper$descriptor() { + return OpaqueMutexedString_wrapper.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * OpaqueIterator *namespace_OpaqueIterable_iter(const OpaqueIterable *self) + * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) * } */ - public static MethodHandle namespace_OpaqueIterable_iter$handle() { - return namespace_OpaqueIterable_iter.HANDLE; + public static MethodHandle OpaqueMutexedString_wrapper$handle() { + return OpaqueMutexedString_wrapper.HANDLE; } /** * Address for: * {@snippet lang=c : - * OpaqueIterator *namespace_OpaqueIterable_iter(const OpaqueIterable *self) + * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) * } */ - public static MemorySegment namespace_OpaqueIterable_iter$address() { - return namespace_OpaqueIterable_iter.ADDR; + public static MemorySegment OpaqueMutexedString_wrapper$address() { + return OpaqueMutexedString_wrapper.ADDR; } /** * {@snippet lang=c : - * OpaqueIterator *namespace_OpaqueIterable_iter(const OpaqueIterable *self) + * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) * } */ - public static MemorySegment namespace_OpaqueIterable_iter(MemorySegment self) { - var mh$ = namespace_OpaqueIterable_iter.HANDLE; + public static MemorySegment OpaqueMutexedString_wrapper(MemorySegment self) { + var mh$ = OpaqueMutexedString_wrapper.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("namespace_OpaqueIterable_iter", self); + traceDowncall("OpaqueMutexedString_wrapper", self); } return (MemorySegment)mh$.invokeExact(self); } catch (Throwable ex$) { @@ -12518,12 +12888,12 @@ public static MemorySegment namespace_OpaqueIterable_iter(MemorySegment self) { } } - private static class namespace_OpaqueIterable_destroy { + private static class OpaqueMutexedString_destroy { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_OpaqueIterable_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12531,43 +12901,43 @@ private static class namespace_OpaqueIterable_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void namespace_OpaqueIterable_destroy(OpaqueIterable *self) + * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) * } */ - public static FunctionDescriptor namespace_OpaqueIterable_destroy$descriptor() { - return namespace_OpaqueIterable_destroy.DESC; + public static FunctionDescriptor OpaqueMutexedString_destroy$descriptor() { + return OpaqueMutexedString_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void namespace_OpaqueIterable_destroy(OpaqueIterable *self) + * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) * } */ - public static MethodHandle namespace_OpaqueIterable_destroy$handle() { - return namespace_OpaqueIterable_destroy.HANDLE; + public static MethodHandle OpaqueMutexedString_destroy$handle() { + return OpaqueMutexedString_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * void namespace_OpaqueIterable_destroy(OpaqueIterable *self) + * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) * } */ - public static MemorySegment namespace_OpaqueIterable_destroy$address() { - return namespace_OpaqueIterable_destroy.ADDR; + public static MemorySegment OpaqueMutexedString_destroy$address() { + return OpaqueMutexedString_destroy.ADDR; } /** * {@snippet lang=c : - * void namespace_OpaqueIterable_destroy(OpaqueIterable *self) + * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) * } */ - public static void namespace_OpaqueIterable_destroy(MemorySegment self) { - var mh$ = namespace_OpaqueIterable_destroy.HANDLE; + public static void OpaqueMutexedString_destroy(MemorySegment self) { + var mh$ = OpaqueMutexedString_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("namespace_OpaqueIterable_destroy", self); + traceDowncall("OpaqueMutexedString_destroy", self); } mh$.invokeExact(self); } catch (Throwable ex$) { @@ -12575,13 +12945,14 @@ public static void namespace_OpaqueIterable_destroy(MemorySegment self) { } } - private static class OpaqueMutexedString_from_usize { + private static class Foo_new { public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_from_usize"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_new"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12589,57 +12960,57 @@ private static class OpaqueMutexedString_from_usize { /** * Function descriptor for: * {@snippet lang=c : - * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) + * Foo *Foo_new(const char *x_data, size_t x_len) * } */ - public static FunctionDescriptor OpaqueMutexedString_from_usize$descriptor() { - return OpaqueMutexedString_from_usize.DESC; + public static FunctionDescriptor Foo_new$descriptor() { + return Foo_new.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) + * Foo *Foo_new(const char *x_data, size_t x_len) * } */ - public static MethodHandle OpaqueMutexedString_from_usize$handle() { - return OpaqueMutexedString_from_usize.HANDLE; + public static MethodHandle Foo_new$handle() { + return Foo_new.HANDLE; } /** * Address for: * {@snippet lang=c : - * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) + * Foo *Foo_new(const char *x_data, size_t x_len) * } */ - public static MemorySegment OpaqueMutexedString_from_usize$address() { - return OpaqueMutexedString_from_usize.ADDR; + public static MemorySegment Foo_new$address() { + return Foo_new.ADDR; } /** * {@snippet lang=c : - * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) + * Foo *Foo_new(const char *x_data, size_t x_len) * } */ - public static MemorySegment OpaqueMutexedString_from_usize(long number) { - var mh$ = OpaqueMutexedString_from_usize.HANDLE; + public static MemorySegment Foo_new(MemorySegment x_data, long x_len) { + var mh$ = Foo_new.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_from_usize", number); + traceDowncall("Foo_new", x_data, x_len); } - return (MemorySegment)mh$.invokeExact(number); + return (MemorySegment)mh$.invokeExact(x_data, x_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OpaqueMutexedString_change { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class Foo_get_bar { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_change"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_get_bar"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12647,57 +13018,58 @@ private static class OpaqueMutexedString_change { /** * Function descriptor for: * {@snippet lang=c : - * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) + * Bar *Foo_get_bar(const Foo *self) * } */ - public static FunctionDescriptor OpaqueMutexedString_change$descriptor() { - return OpaqueMutexedString_change.DESC; + public static FunctionDescriptor Foo_get_bar$descriptor() { + return Foo_get_bar.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) + * Bar *Foo_get_bar(const Foo *self) * } */ - public static MethodHandle OpaqueMutexedString_change$handle() { - return OpaqueMutexedString_change.HANDLE; + public static MethodHandle Foo_get_bar$handle() { + return Foo_get_bar.HANDLE; } /** * Address for: * {@snippet lang=c : - * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) + * Bar *Foo_get_bar(const Foo *self) * } */ - public static MemorySegment OpaqueMutexedString_change$address() { - return OpaqueMutexedString_change.ADDR; + public static MemorySegment Foo_get_bar$address() { + return Foo_get_bar.ADDR; } /** * {@snippet lang=c : - * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) + * Bar *Foo_get_bar(const Foo *self) * } */ - public static void OpaqueMutexedString_change(MemorySegment self, long number) { - var mh$ = OpaqueMutexedString_change.HANDLE; + public static MemorySegment Foo_get_bar(MemorySegment self) { + var mh$ = Foo_get_bar.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_change", self, number); + traceDowncall("Foo_get_bar", self); } - mh$.invokeExact(self, number); + return (MemorySegment)mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OpaqueMutexedString_borrow { + private static class Foo_new_static { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - somelib_h.C_POINTER + somelib_h.C_POINTER, + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_borrow"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_new_static"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12705,57 +13077,57 @@ private static class OpaqueMutexedString_borrow { /** * Function descriptor for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) + * Foo *Foo_new_static(const char *x_data, size_t x_len) * } */ - public static FunctionDescriptor OpaqueMutexedString_borrow$descriptor() { - return OpaqueMutexedString_borrow.DESC; + public static FunctionDescriptor Foo_new_static$descriptor() { + return Foo_new_static.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) + * Foo *Foo_new_static(const char *x_data, size_t x_len) * } */ - public static MethodHandle OpaqueMutexedString_borrow$handle() { - return OpaqueMutexedString_borrow.HANDLE; + public static MethodHandle Foo_new_static$handle() { + return Foo_new_static.HANDLE; } /** * Address for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) + * Foo *Foo_new_static(const char *x_data, size_t x_len) * } */ - public static MemorySegment OpaqueMutexedString_borrow$address() { - return OpaqueMutexedString_borrow.ADDR; + public static MemorySegment Foo_new_static$address() { + return Foo_new_static.ADDR; } /** * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) + * Foo *Foo_new_static(const char *x_data, size_t x_len) * } */ - public static MemorySegment OpaqueMutexedString_borrow(MemorySegment self) { - var mh$ = OpaqueMutexedString_borrow.HANDLE; + public static MemorySegment Foo_new_static(MemorySegment x_data, long x_len) { + var mh$ = Foo_new_static.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_borrow", self); + traceDowncall("Foo_new_static", x_data, x_len); } - return (MemorySegment)mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(x_data, x_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OpaqueMutexedString_borrow_other { + private static class Foo_as_returning { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, + BorrowedFieldsReturning.layout(), somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_borrow_other"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_as_returning"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12763,58 +13135,57 @@ private static class OpaqueMutexedString_borrow_other { /** * Function descriptor for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) + * BorrowedFieldsReturning Foo_as_returning(const Foo *self) * } */ - public static FunctionDescriptor OpaqueMutexedString_borrow_other$descriptor() { - return OpaqueMutexedString_borrow_other.DESC; + public static FunctionDescriptor Foo_as_returning$descriptor() { + return Foo_as_returning.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) + * BorrowedFieldsReturning Foo_as_returning(const Foo *self) * } */ - public static MethodHandle OpaqueMutexedString_borrow_other$handle() { - return OpaqueMutexedString_borrow_other.HANDLE; + public static MethodHandle Foo_as_returning$handle() { + return Foo_as_returning.HANDLE; } /** * Address for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) + * BorrowedFieldsReturning Foo_as_returning(const Foo *self) * } */ - public static MemorySegment OpaqueMutexedString_borrow_other$address() { - return OpaqueMutexedString_borrow_other.ADDR; + public static MemorySegment Foo_as_returning$address() { + return Foo_as_returning.ADDR; } /** * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) + * BorrowedFieldsReturning Foo_as_returning(const Foo *self) * } */ - public static MemorySegment OpaqueMutexedString_borrow_other(MemorySegment other) { - var mh$ = OpaqueMutexedString_borrow_other.HANDLE; + public static MemorySegment Foo_as_returning(SegmentAllocator allocator, MemorySegment self) { + var mh$ = Foo_as_returning.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_borrow_other", other); + traceDowncall("Foo_as_returning", allocator, self); } - return (MemorySegment)mh$.invokeExact(other); + return (MemorySegment)mh$.invokeExact(allocator, self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OpaqueMutexedString_borrow_self_or_other { + private static class Foo_extract_from_fields { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER + BorrowedFields.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_borrow_self_or_other"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_extract_from_fields"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12822,58 +13193,59 @@ private static class OpaqueMutexedString_borrow_self_or_other { /** * Function descriptor for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) + * Foo *Foo_extract_from_fields(BorrowedFields fields) * } */ - public static FunctionDescriptor OpaqueMutexedString_borrow_self_or_other$descriptor() { - return OpaqueMutexedString_borrow_self_or_other.DESC; + public static FunctionDescriptor Foo_extract_from_fields$descriptor() { + return Foo_extract_from_fields.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) + * Foo *Foo_extract_from_fields(BorrowedFields fields) * } */ - public static MethodHandle OpaqueMutexedString_borrow_self_or_other$handle() { - return OpaqueMutexedString_borrow_self_or_other.HANDLE; + public static MethodHandle Foo_extract_from_fields$handle() { + return Foo_extract_from_fields.HANDLE; } /** * Address for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) + * Foo *Foo_extract_from_fields(BorrowedFields fields) * } */ - public static MemorySegment OpaqueMutexedString_borrow_self_or_other$address() { - return OpaqueMutexedString_borrow_self_or_other.ADDR; + public static MemorySegment Foo_extract_from_fields$address() { + return Foo_extract_from_fields.ADDR; } /** * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) + * Foo *Foo_extract_from_fields(BorrowedFields fields) * } */ - public static MemorySegment OpaqueMutexedString_borrow_self_or_other(MemorySegment self, MemorySegment other) { - var mh$ = OpaqueMutexedString_borrow_self_or_other.HANDLE; + public static MemorySegment Foo_extract_from_fields(MemorySegment fields) { + var mh$ = Foo_extract_from_fields.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_borrow_self_or_other", self, other); + traceDowncall("Foo_extract_from_fields", fields); } - return (MemorySegment)mh$.invokeExact(self, other); + return (MemorySegment)mh$.invokeExact(fields); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OpaqueMutexedString_get_len_and_add { + private static class Foo_extract_from_bounds { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_LONG, + somelib_h.C_POINTER, + BorrowedFieldsWithBounds.layout(), somelib_h.C_POINTER, somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_get_len_and_add"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_extract_from_bounds"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12881,57 +13253,56 @@ private static class OpaqueMutexedString_get_len_and_add { /** * Function descriptor for: * {@snippet lang=c : - * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) + * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, const char *another_string_data, size_t another_string_len) * } */ - public static FunctionDescriptor OpaqueMutexedString_get_len_and_add$descriptor() { - return OpaqueMutexedString_get_len_and_add.DESC; + public static FunctionDescriptor Foo_extract_from_bounds$descriptor() { + return Foo_extract_from_bounds.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) + * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, const char *another_string_data, size_t another_string_len) * } */ - public static MethodHandle OpaqueMutexedString_get_len_and_add$handle() { - return OpaqueMutexedString_get_len_and_add.HANDLE; + public static MethodHandle Foo_extract_from_bounds$handle() { + return Foo_extract_from_bounds.HANDLE; } /** * Address for: * {@snippet lang=c : - * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) + * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, const char *another_string_data, size_t another_string_len) * } */ - public static MemorySegment OpaqueMutexedString_get_len_and_add$address() { - return OpaqueMutexedString_get_len_and_add.ADDR; + public static MemorySegment Foo_extract_from_bounds$address() { + return Foo_extract_from_bounds.ADDR; } /** * {@snippet lang=c : - * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) + * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, const char *another_string_data, size_t another_string_len) * } */ - public static long OpaqueMutexedString_get_len_and_add(MemorySegment self, long other) { - var mh$ = OpaqueMutexedString_get_len_and_add.HANDLE; + public static MemorySegment Foo_extract_from_bounds(MemorySegment bounds, MemorySegment another_string_data, long another_string_len) { + var mh$ = Foo_extract_from_bounds.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_get_len_and_add", self, other); + traceDowncall("Foo_extract_from_bounds", bounds, another_string_data, another_string_len); } - return (long)mh$.invokeExact(self, other); + return (MemorySegment)mh$.invokeExact(bounds, another_string_data, another_string_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OpaqueMutexedString_dummy_str { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - DiplomatStringView.layout(), + private static class Foo_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_dummy_str"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12939,57 +13310,76 @@ private static class OpaqueMutexedString_dummy_str { /** * Function descriptor for: * {@snippet lang=c : - * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) + * void Foo_destroy(Foo *self) * } */ - public static FunctionDescriptor OpaqueMutexedString_dummy_str$descriptor() { - return OpaqueMutexedString_dummy_str.DESC; + public static FunctionDescriptor Foo_destroy$descriptor() { + return Foo_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) + * void Foo_destroy(Foo *self) * } */ - public static MethodHandle OpaqueMutexedString_dummy_str$handle() { - return OpaqueMutexedString_dummy_str.HANDLE; + public static MethodHandle Foo_destroy$handle() { + return Foo_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) + * void Foo_destroy(Foo *self) * } */ - public static MemorySegment OpaqueMutexedString_dummy_str$address() { - return OpaqueMutexedString_dummy_str.ADDR; + public static MemorySegment Foo_destroy$address() { + return Foo_destroy.ADDR; } /** * {@snippet lang=c : - * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) + * void Foo_destroy(Foo *self) * } */ - public static MemorySegment OpaqueMutexedString_dummy_str(SegmentAllocator allocator, MemorySegment self) { - var mh$ = OpaqueMutexedString_dummy_str.HANDLE; + public static void Foo_destroy(MemorySegment self) { + var mh$ = Foo_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_dummy_str", allocator, self); + traceDowncall("Foo_destroy", self); } - return (MemorySegment)mh$.invokeExact(allocator, self); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } + private static final int ErrorEnum_Foo = (int)0L; + /** + * {@snippet lang=c : + * enum ErrorEnum.ErrorEnum_Foo = 0 + * } + */ + public static int ErrorEnum_Foo() { + return ErrorEnum_Foo; + } + private static final int ErrorEnum_Bar = (int)1L; + /** + * {@snippet lang=c : + * enum ErrorEnum.ErrorEnum_Bar = 1 + * } + */ + public static int ErrorEnum_Bar() { + return ErrorEnum_Bar; + } - private static class OpaqueMutexedString_wrapper { + private static class namespace_MyIndexer_get { public static final FunctionDescriptor DESC = FunctionDescriptor.of( + namespace_MyIndexer_get_result.layout(), somelib_h.C_POINTER, - somelib_h.C_POINTER + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_wrapper"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_MyIndexer_get"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12997,56 +13387,56 @@ private static class OpaqueMutexedString_wrapper { /** * Function descriptor for: * {@snippet lang=c : - * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) + * struct namespace_MyIndexer_get_result namespace_MyIndexer_get(const MyIndexer *self, size_t i) * } */ - public static FunctionDescriptor OpaqueMutexedString_wrapper$descriptor() { - return OpaqueMutexedString_wrapper.DESC; + public static FunctionDescriptor namespace_MyIndexer_get$descriptor() { + return namespace_MyIndexer_get.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) + * struct namespace_MyIndexer_get_result namespace_MyIndexer_get(const MyIndexer *self, size_t i) * } */ - public static MethodHandle OpaqueMutexedString_wrapper$handle() { - return OpaqueMutexedString_wrapper.HANDLE; + public static MethodHandle namespace_MyIndexer_get$handle() { + return namespace_MyIndexer_get.HANDLE; } /** * Address for: * {@snippet lang=c : - * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) + * struct namespace_MyIndexer_get_result namespace_MyIndexer_get(const MyIndexer *self, size_t i) * } */ - public static MemorySegment OpaqueMutexedString_wrapper$address() { - return OpaqueMutexedString_wrapper.ADDR; + public static MemorySegment namespace_MyIndexer_get$address() { + return namespace_MyIndexer_get.ADDR; } /** * {@snippet lang=c : - * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) + * struct namespace_MyIndexer_get_result namespace_MyIndexer_get(const MyIndexer *self, size_t i) * } */ - public static MemorySegment OpaqueMutexedString_wrapper(MemorySegment self) { - var mh$ = OpaqueMutexedString_wrapper.HANDLE; + public static MemorySegment namespace_MyIndexer_get(SegmentAllocator allocator, MemorySegment self, long i) { + var mh$ = namespace_MyIndexer_get.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_wrapper", self); + traceDowncall("namespace_MyIndexer_get", allocator, self, i); } - return (MemorySegment)mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(allocator, self, i); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OpaqueMutexedString_destroy { + private static class namespace_MyIndexer_destroy { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_MyIndexer_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13054,43 +13444,43 @@ private static class OpaqueMutexedString_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) + * void namespace_MyIndexer_destroy(MyIndexer *self) * } */ - public static FunctionDescriptor OpaqueMutexedString_destroy$descriptor() { - return OpaqueMutexedString_destroy.DESC; + public static FunctionDescriptor namespace_MyIndexer_destroy$descriptor() { + return namespace_MyIndexer_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) + * void namespace_MyIndexer_destroy(MyIndexer *self) * } */ - public static MethodHandle OpaqueMutexedString_destroy$handle() { - return OpaqueMutexedString_destroy.HANDLE; + public static MethodHandle namespace_MyIndexer_destroy$handle() { + return namespace_MyIndexer_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) + * void namespace_MyIndexer_destroy(MyIndexer *self) * } */ - public static MemorySegment OpaqueMutexedString_destroy$address() { - return OpaqueMutexedString_destroy.ADDR; + public static MemorySegment namespace_MyIndexer_destroy$address() { + return namespace_MyIndexer_destroy.ADDR; } /** * {@snippet lang=c : - * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) + * void namespace_MyIndexer_destroy(MyIndexer *self) * } */ - public static void OpaqueMutexedString_destroy(MemorySegment self) { - var mh$ = OpaqueMutexedString_destroy.HANDLE; + public static void namespace_MyIndexer_destroy(MemorySegment self) { + var mh$ = namespace_MyIndexer_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_destroy", self); + traceDowncall("namespace_MyIndexer_destroy", self); } mh$.invokeExact(self); } catch (Throwable ex$) { @@ -13098,14 +13488,14 @@ public static void OpaqueMutexedString_destroy(MemorySegment self) { } } - private static class OptionString_new { + private static class One_transitivity { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionString_new"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_transitivity"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13113,58 +13503,58 @@ private static class OptionString_new { /** * Function descriptor for: * {@snippet lang=c : - * OptionString *OptionString_new(const char *diplomat_str_data, size_t diplomat_str_len) + * One *One_transitivity(const One *hold, const One *nohold) * } */ - public static FunctionDescriptor OptionString_new$descriptor() { - return OptionString_new.DESC; + public static FunctionDescriptor One_transitivity$descriptor() { + return One_transitivity.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * OptionString *OptionString_new(const char *diplomat_str_data, size_t diplomat_str_len) + * One *One_transitivity(const One *hold, const One *nohold) * } */ - public static MethodHandle OptionString_new$handle() { - return OptionString_new.HANDLE; + public static MethodHandle One_transitivity$handle() { + return One_transitivity.HANDLE; } /** * Address for: * {@snippet lang=c : - * OptionString *OptionString_new(const char *diplomat_str_data, size_t diplomat_str_len) + * One *One_transitivity(const One *hold, const One *nohold) * } */ - public static MemorySegment OptionString_new$address() { - return OptionString_new.ADDR; + public static MemorySegment One_transitivity$address() { + return One_transitivity.ADDR; } /** * {@snippet lang=c : - * OptionString *OptionString_new(const char *diplomat_str_data, size_t diplomat_str_len) + * One *One_transitivity(const One *hold, const One *nohold) * } */ - public static MemorySegment OptionString_new(MemorySegment diplomat_str_data, long diplomat_str_len) { - var mh$ = OptionString_new.HANDLE; + public static MemorySegment One_transitivity(MemorySegment hold, MemorySegment nohold) { + var mh$ = One_transitivity.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OptionString_new", diplomat_str_data, diplomat_str_len); + traceDowncall("One_transitivity", hold, nohold); } - return (MemorySegment)mh$.invokeExact(diplomat_str_data, diplomat_str_len); + return (MemorySegment)mh$.invokeExact(hold, nohold); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OptionString_write { + private static class One_cycle { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - OptionString_write_result.layout(), + somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionString_write"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_cycle"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13172,57 +13562,61 @@ private static class OptionString_write { /** * Function descriptor for: * {@snippet lang=c : - * struct OptionString_write_result OptionString_write(const OptionString *self, DiplomatWrite *write) + * One *One_cycle(const Two *hold, const One *nohold) * } */ - public static FunctionDescriptor OptionString_write$descriptor() { - return OptionString_write.DESC; + public static FunctionDescriptor One_cycle$descriptor() { + return One_cycle.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * struct OptionString_write_result OptionString_write(const OptionString *self, DiplomatWrite *write) + * One *One_cycle(const Two *hold, const One *nohold) * } */ - public static MethodHandle OptionString_write$handle() { - return OptionString_write.HANDLE; + public static MethodHandle One_cycle$handle() { + return One_cycle.HANDLE; } /** * Address for: * {@snippet lang=c : - * struct OptionString_write_result OptionString_write(const OptionString *self, DiplomatWrite *write) + * One *One_cycle(const Two *hold, const One *nohold) * } */ - public static MemorySegment OptionString_write$address() { - return OptionString_write.ADDR; + public static MemorySegment One_cycle$address() { + return One_cycle.ADDR; } /** * {@snippet lang=c : - * struct OptionString_write_result OptionString_write(const OptionString *self, DiplomatWrite *write) + * One *One_cycle(const Two *hold, const One *nohold) * } */ - public static MemorySegment OptionString_write(SegmentAllocator allocator, MemorySegment self, MemorySegment write) { - var mh$ = OptionString_write.HANDLE; + public static MemorySegment One_cycle(MemorySegment hold, MemorySegment nohold) { + var mh$ = One_cycle.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OptionString_write", allocator, self, write); + traceDowncall("One_cycle", hold, nohold); } - return (MemorySegment)mh$.invokeExact(allocator, self, write); + return (MemorySegment)mh$.invokeExact(hold, nohold); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OptionString_borrow { + private static class One_many_dependents { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - OptionString_borrow_result.layout(), + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionString_borrow"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_many_dependents"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13230,56 +13624,58 @@ private static class OptionString_borrow { /** * Function descriptor for: * {@snippet lang=c : - * struct OptionString_borrow_result OptionString_borrow(const OptionString *self) + * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) * } */ - public static FunctionDescriptor OptionString_borrow$descriptor() { - return OptionString_borrow.DESC; + public static FunctionDescriptor One_many_dependents$descriptor() { + return One_many_dependents.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * struct OptionString_borrow_result OptionString_borrow(const OptionString *self) + * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) * } */ - public static MethodHandle OptionString_borrow$handle() { - return OptionString_borrow.HANDLE; + public static MethodHandle One_many_dependents$handle() { + return One_many_dependents.HANDLE; } /** * Address for: * {@snippet lang=c : - * struct OptionString_borrow_result OptionString_borrow(const OptionString *self) + * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) * } */ - public static MemorySegment OptionString_borrow$address() { - return OptionString_borrow.ADDR; + public static MemorySegment One_many_dependents$address() { + return One_many_dependents.ADDR; } /** * {@snippet lang=c : - * struct OptionString_borrow_result OptionString_borrow(const OptionString *self) + * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) * } */ - public static MemorySegment OptionString_borrow(SegmentAllocator allocator, MemorySegment self) { - var mh$ = OptionString_borrow.HANDLE; + public static MemorySegment One_many_dependents(MemorySegment a, MemorySegment b, MemorySegment c, MemorySegment d, MemorySegment nohold) { + var mh$ = One_many_dependents.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OptionString_borrow", allocator, self); + traceDowncall("One_many_dependents", a, b, c, d, nohold); } - return (MemorySegment)mh$.invokeExact(allocator, self); + return (MemorySegment)mh$.invokeExact(a, b, c, d, nohold); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OptionString_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class One_return_outlives_param { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionString_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_return_outlives_param"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13287,121 +13683,121 @@ private static class OptionString_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void OptionString_destroy(OptionString *self) + * One *One_return_outlives_param(const Two *hold, const One *nohold) * } */ - public static FunctionDescriptor OptionString_destroy$descriptor() { - return OptionString_destroy.DESC; + public static FunctionDescriptor One_return_outlives_param$descriptor() { + return One_return_outlives_param.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void OptionString_destroy(OptionString *self) + * One *One_return_outlives_param(const Two *hold, const One *nohold) * } */ - public static MethodHandle OptionString_destroy$handle() { - return OptionString_destroy.HANDLE; + public static MethodHandle One_return_outlives_param$handle() { + return One_return_outlives_param.HANDLE; } /** * Address for: * {@snippet lang=c : - * void OptionString_destroy(OptionString *self) + * One *One_return_outlives_param(const Two *hold, const One *nohold) * } */ - public static MemorySegment OptionString_destroy$address() { - return OptionString_destroy.ADDR; + public static MemorySegment One_return_outlives_param$address() { + return One_return_outlives_param.ADDR; } /** * {@snippet lang=c : - * void OptionString_destroy(OptionString *self) + * One *One_return_outlives_param(const Two *hold, const One *nohold) * } */ - public static void OptionString_destroy(MemorySegment self) { - var mh$ = OptionString_destroy.HANDLE; + public static MemorySegment One_return_outlives_param(MemorySegment hold, MemorySegment nohold) { + var mh$ = One_return_outlives_param.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OptionString_destroy", self); + traceDowncall("One_return_outlives_param", hold, nohold); } - mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(hold, nohold); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static final int UnimportedEnum_A = (int)0L; - /** - * {@snippet lang=c : - * enum UnimportedEnum.UnimportedEnum_A = 0 - * } - */ - public static int UnimportedEnum_A() { - return UnimportedEnum_A; - } - private static final int UnimportedEnum_B = (int)1L; - /** - * {@snippet lang=c : - * enum UnimportedEnum.UnimportedEnum_B = 1 - * } - */ - public static int UnimportedEnum_B() { - return UnimportedEnum_B; - } - private static final int UnimportedEnum_C = (int)2L; - /** - * {@snippet lang=c : - * enum UnimportedEnum.UnimportedEnum_C = 2 - * } - */ - public static int UnimportedEnum_C() { - return UnimportedEnum_C; + + private static class One_diamond_top { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_top"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } - private static final int ContiguousEnum_C = (int)0L; + /** + * Function descriptor for: * {@snippet lang=c : - * enum ContiguousEnum.ContiguousEnum_C = 0 + * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static int ContiguousEnum_C() { - return ContiguousEnum_C; + public static FunctionDescriptor One_diamond_top$descriptor() { + return One_diamond_top.DESC; } - private static final int ContiguousEnum_D = (int)1L; + /** + * Downcall method handle for: * {@snippet lang=c : - * enum ContiguousEnum.ContiguousEnum_D = 1 + * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static int ContiguousEnum_D() { - return ContiguousEnum_D; + public static MethodHandle One_diamond_top$handle() { + return One_diamond_top.HANDLE; } - private static final int ContiguousEnum_E = (int)2L; + /** + * Address for: * {@snippet lang=c : - * enum ContiguousEnum.ContiguousEnum_E = 2 + * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static int ContiguousEnum_E() { - return ContiguousEnum_E; + public static MemorySegment One_diamond_top$address() { + return One_diamond_top.ADDR; } - private static final int ContiguousEnum_F = (int)3L; + /** * {@snippet lang=c : - * enum ContiguousEnum.ContiguousEnum_F = 3 + * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static int ContiguousEnum_F() { - return ContiguousEnum_F; + public static MemorySegment One_diamond_top(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { + var mh$ = One_diamond_top.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("One_diamond_top", top, left, right, bottom); + } + return (MemorySegment)mh$.invokeExact(top, left, right, bottom); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } } - private static class namespace_MyIndexer_get { + private static class One_diamond_left { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - namespace_MyIndexer_get_result.layout(), somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_MyIndexer_get"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_left"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13409,56 +13805,60 @@ private static class namespace_MyIndexer_get { /** * Function descriptor for: * {@snippet lang=c : - * struct namespace_MyIndexer_get_result namespace_MyIndexer_get(const MyIndexer *self, size_t i) + * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static FunctionDescriptor namespace_MyIndexer_get$descriptor() { - return namespace_MyIndexer_get.DESC; + public static FunctionDescriptor One_diamond_left$descriptor() { + return One_diamond_left.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * struct namespace_MyIndexer_get_result namespace_MyIndexer_get(const MyIndexer *self, size_t i) + * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MethodHandle namespace_MyIndexer_get$handle() { - return namespace_MyIndexer_get.HANDLE; + public static MethodHandle One_diamond_left$handle() { + return One_diamond_left.HANDLE; } /** * Address for: * {@snippet lang=c : - * struct namespace_MyIndexer_get_result namespace_MyIndexer_get(const MyIndexer *self, size_t i) + * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MemorySegment namespace_MyIndexer_get$address() { - return namespace_MyIndexer_get.ADDR; + public static MemorySegment One_diamond_left$address() { + return One_diamond_left.ADDR; } /** * {@snippet lang=c : - * struct namespace_MyIndexer_get_result namespace_MyIndexer_get(const MyIndexer *self, size_t i) + * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MemorySegment namespace_MyIndexer_get(SegmentAllocator allocator, MemorySegment self, long i) { - var mh$ = namespace_MyIndexer_get.HANDLE; + public static MemorySegment One_diamond_left(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { + var mh$ = One_diamond_left.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("namespace_MyIndexer_get", allocator, self, i); + traceDowncall("One_diamond_left", top, left, right, bottom); } - return (MemorySegment)mh$.invokeExact(allocator, self, i); + return (MemorySegment)mh$.invokeExact(top, left, right, bottom); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class namespace_MyIndexer_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class One_diamond_right { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_MyIndexer_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_right"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13466,61 +13866,60 @@ private static class namespace_MyIndexer_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void namespace_MyIndexer_destroy(MyIndexer *self) + * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static FunctionDescriptor namespace_MyIndexer_destroy$descriptor() { - return namespace_MyIndexer_destroy.DESC; + public static FunctionDescriptor One_diamond_right$descriptor() { + return One_diamond_right.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void namespace_MyIndexer_destroy(MyIndexer *self) + * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MethodHandle namespace_MyIndexer_destroy$handle() { - return namespace_MyIndexer_destroy.HANDLE; + public static MethodHandle One_diamond_right$handle() { + return One_diamond_right.HANDLE; } /** * Address for: * {@snippet lang=c : - * void namespace_MyIndexer_destroy(MyIndexer *self) + * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MemorySegment namespace_MyIndexer_destroy$address() { - return namespace_MyIndexer_destroy.ADDR; + public static MemorySegment One_diamond_right$address() { + return One_diamond_right.ADDR; } /** * {@snippet lang=c : - * void namespace_MyIndexer_destroy(MyIndexer *self) + * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static void namespace_MyIndexer_destroy(MemorySegment self) { - var mh$ = namespace_MyIndexer_destroy.HANDLE; + public static MemorySegment One_diamond_right(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { + var mh$ = One_diamond_right.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("namespace_MyIndexer_destroy", self); + traceDowncall("One_diamond_right", top, left, right, bottom); } - mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(top, left, right, bottom); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class BorrowedFieldsWithBounds_from_foo_and_strings { + private static class One_diamond_bottom { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - BorrowedFieldsWithBounds.layout(), somelib_h.C_POINTER, somelib_h.C_POINTER, - somelib_h.C_LONG, somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_POINTER, + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("BorrowedFieldsWithBounds_from_foo_and_strings"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_bottom"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13528,128 +13927,121 @@ private static class BorrowedFieldsWithBounds_from_foo_and_strings { /** * Function descriptor for: * {@snippet lang=c : - * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char *utf8_str_z_data, size_t utf8_str_z_len) + * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static FunctionDescriptor BorrowedFieldsWithBounds_from_foo_and_strings$descriptor() { - return BorrowedFieldsWithBounds_from_foo_and_strings.DESC; + public static FunctionDescriptor One_diamond_bottom$descriptor() { + return One_diamond_bottom.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char *utf8_str_z_data, size_t utf8_str_z_len) + * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MethodHandle BorrowedFieldsWithBounds_from_foo_and_strings$handle() { - return BorrowedFieldsWithBounds_from_foo_and_strings.HANDLE; + public static MethodHandle One_diamond_bottom$handle() { + return One_diamond_bottom.HANDLE; } /** * Address for: * {@snippet lang=c : - * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char *utf8_str_z_data, size_t utf8_str_z_len) + * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MemorySegment BorrowedFieldsWithBounds_from_foo_and_strings$address() { - return BorrowedFieldsWithBounds_from_foo_and_strings.ADDR; + public static MemorySegment One_diamond_bottom$address() { + return One_diamond_bottom.ADDR; } /** * {@snippet lang=c : - * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char *utf8_str_z_data, size_t utf8_str_z_len) + * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MemorySegment BorrowedFieldsWithBounds_from_foo_and_strings(SegmentAllocator allocator, MemorySegment foo, MemorySegment dstr16_x_data, long dstr16_x_len, MemorySegment utf8_str_z_data, long utf8_str_z_len) { - var mh$ = BorrowedFieldsWithBounds_from_foo_and_strings.HANDLE; + public static MemorySegment One_diamond_bottom(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { + var mh$ = One_diamond_bottom.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("BorrowedFieldsWithBounds_from_foo_and_strings", allocator, foo, dstr16_x_data, dstr16_x_len, utf8_str_z_data, utf8_str_z_len); + traceDowncall("One_diamond_bottom", top, left, right, bottom); } - return (MemorySegment)mh$.invokeExact(allocator, foo, dstr16_x_data, dstr16_x_len, utf8_str_z_data, utf8_str_z_len); + return (MemorySegment)mh$.invokeExact(top, left, right, bottom); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - /** - * Variadic invoker class for: - * {@snippet lang=c : - * Opaque *Opaque_new() - * } - */ - public static class Opaque_new { - private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - somelib_h.C_POINTER ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_new"); - - private final MethodHandle handle; - private final FunctionDescriptor descriptor; - private final MethodHandle spreader; + private static class One_diamond_and_nested_types { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); - private Opaque_new(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { - this.handle = handle; - this.descriptor = descriptor; - this.spreader = spreader; - } + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_and_nested_types"); - /** - * Variadic invoker factory for: - * {@snippet lang=c : - * Opaque *Opaque_new() - * } - */ - public static Opaque_new makeInvoker(MemoryLayout... layouts) { - FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); - Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); - var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); - var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new Opaque_new(mh$, desc$, spreader$); - } + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } - /** - * {@return the address} - */ - public static MemorySegment address() { - return ADDR; - } + /** + * Function descriptor for: + * {@snippet lang=c : + * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) + * } + */ + public static FunctionDescriptor One_diamond_and_nested_types$descriptor() { + return One_diamond_and_nested_types.DESC; + } - /** - * {@return the specialized method handle} - */ - public MethodHandle handle() { - return handle; - } + /** + * Downcall method handle for: + * {@snippet lang=c : + * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) + * } + */ + public static MethodHandle One_diamond_and_nested_types$handle() { + return One_diamond_and_nested_types.HANDLE; + } - /** - * {@return the specialized descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } + /** + * Address for: + * {@snippet lang=c : + * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) + * } + */ + public static MemorySegment One_diamond_and_nested_types$address() { + return One_diamond_and_nested_types.ADDR; + } - public MemorySegment apply(Object... x0) { - try { - if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_new", x0); - } - return (MemorySegment)spreader.invokeExact(x0); - } catch(IllegalArgumentException | ClassCastException ex$) { - throw ex$; // rethrow IAE from passing wrong number/type of args - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); + /** + * {@snippet lang=c : + * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) + * } + */ + public static MemorySegment One_diamond_and_nested_types(MemorySegment a, MemorySegment b, MemorySegment c, MemorySegment d, MemorySegment nohold) { + var mh$ = One_diamond_and_nested_types.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("One_diamond_and_nested_types", a, b, c, d, nohold); } + return (MemorySegment)mh$.invokeExact(a, b, c, d, nohold); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); } } - private static class Opaque_try_from_utf8 { + private static class One_implicit_bounds { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_POINTER, + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_try_from_utf8"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_implicit_bounds"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13657,58 +14049,60 @@ private static class Opaque_try_from_utf8 { /** * Function descriptor for: * {@snippet lang=c : - * Opaque *Opaque_try_from_utf8(const char *input_data, size_t input_len) + * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) * } */ - public static FunctionDescriptor Opaque_try_from_utf8$descriptor() { - return Opaque_try_from_utf8.DESC; + public static FunctionDescriptor One_implicit_bounds$descriptor() { + return One_implicit_bounds.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Opaque *Opaque_try_from_utf8(const char *input_data, size_t input_len) + * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) * } */ - public static MethodHandle Opaque_try_from_utf8$handle() { - return Opaque_try_from_utf8.HANDLE; + public static MethodHandle One_implicit_bounds$handle() { + return One_implicit_bounds.HANDLE; } /** * Address for: * {@snippet lang=c : - * Opaque *Opaque_try_from_utf8(const char *input_data, size_t input_len) + * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) * } */ - public static MemorySegment Opaque_try_from_utf8$address() { - return Opaque_try_from_utf8.ADDR; + public static MemorySegment One_implicit_bounds$address() { + return One_implicit_bounds.ADDR; } /** * {@snippet lang=c : - * Opaque *Opaque_try_from_utf8(const char *input_data, size_t input_len) + * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) * } */ - public static MemorySegment Opaque_try_from_utf8(MemorySegment input_data, long input_len) { - var mh$ = Opaque_try_from_utf8.HANDLE; + public static MemorySegment One_implicit_bounds(MemorySegment explicit_hold, MemorySegment implicit_hold, MemorySegment nohold) { + var mh$ = One_implicit_bounds.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_try_from_utf8", input_data, input_len); + traceDowncall("One_implicit_bounds", explicit_hold, implicit_hold, nohold); } - return (MemorySegment)mh$.invokeExact(input_data, input_len); + return (MemorySegment)mh$.invokeExact(explicit_hold, implicit_hold, nohold); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Opaque_from_str { + private static class One_implicit_bounds_deep { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_from_str"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_implicit_bounds_deep"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13716,57 +14110,56 @@ private static class Opaque_from_str { /** * Function descriptor for: * {@snippet lang=c : - * Opaque *Opaque_from_str(const char *input_data, size_t input_len) + * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) * } */ - public static FunctionDescriptor Opaque_from_str$descriptor() { - return Opaque_from_str.DESC; + public static FunctionDescriptor One_implicit_bounds_deep$descriptor() { + return One_implicit_bounds_deep.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Opaque *Opaque_from_str(const char *input_data, size_t input_len) + * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) * } */ - public static MethodHandle Opaque_from_str$handle() { - return Opaque_from_str.HANDLE; + public static MethodHandle One_implicit_bounds_deep$handle() { + return One_implicit_bounds_deep.HANDLE; } /** * Address for: * {@snippet lang=c : - * Opaque *Opaque_from_str(const char *input_data, size_t input_len) + * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) * } */ - public static MemorySegment Opaque_from_str$address() { - return Opaque_from_str.ADDR; + public static MemorySegment One_implicit_bounds_deep$address() { + return One_implicit_bounds_deep.ADDR; } /** * {@snippet lang=c : - * Opaque *Opaque_from_str(const char *input_data, size_t input_len) + * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) * } */ - public static MemorySegment Opaque_from_str(MemorySegment input_data, long input_len) { - var mh$ = Opaque_from_str.HANDLE; + public static MemorySegment One_implicit_bounds_deep(MemorySegment explicit_, MemorySegment implicit_1, MemorySegment implicit_2, MemorySegment nohold) { + var mh$ = One_implicit_bounds_deep.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_from_str", input_data, input_len); + traceDowncall("One_implicit_bounds_deep", explicit_, implicit_1, implicit_2, nohold); } - return (MemorySegment)mh$.invokeExact(input_data, input_len); + return (MemorySegment)mh$.invokeExact(explicit_, implicit_1, implicit_2, nohold); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Opaque_get_debug_str { + private static class One_destroy { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_get_debug_str"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13774,57 +14167,58 @@ private static class Opaque_get_debug_str { /** * Function descriptor for: * {@snippet lang=c : - * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) + * void One_destroy(One *self) * } */ - public static FunctionDescriptor Opaque_get_debug_str$descriptor() { - return Opaque_get_debug_str.DESC; + public static FunctionDescriptor One_destroy$descriptor() { + return One_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) + * void One_destroy(One *self) * } */ - public static MethodHandle Opaque_get_debug_str$handle() { - return Opaque_get_debug_str.HANDLE; + public static MethodHandle One_destroy$handle() { + return One_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) + * void One_destroy(One *self) * } */ - public static MemorySegment Opaque_get_debug_str$address() { - return Opaque_get_debug_str.ADDR; + public static MemorySegment One_destroy$address() { + return One_destroy.ADDR; } /** * {@snippet lang=c : - * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) + * void One_destroy(One *self) * } */ - public static void Opaque_get_debug_str(MemorySegment self, MemorySegment write) { - var mh$ = Opaque_get_debug_str.HANDLE; + public static void One_destroy(MemorySegment self) { + var mh$ = One_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_get_debug_str", self, write); + traceDowncall("One_destroy", self); } - mh$.invokeExact(self, write); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Opaque_assert_struct { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class Utf16Wrap_from_utf16 { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - MyStruct.layout() + somelib_h.C_POINTER, + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_assert_struct"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_from_utf16"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13832,876 +14226,57 @@ private static class Opaque_assert_struct { /** * Function descriptor for: * {@snippet lang=c : - * void Opaque_assert_struct(const Opaque *self, MyStruct s) + * Utf16Wrap *Utf16Wrap_from_utf16(const char16_t *input_data, size_t input_len) * } */ - public static FunctionDescriptor Opaque_assert_struct$descriptor() { - return Opaque_assert_struct.DESC; + public static FunctionDescriptor Utf16Wrap_from_utf16$descriptor() { + return Utf16Wrap_from_utf16.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Opaque_assert_struct(const Opaque *self, MyStruct s) + * Utf16Wrap *Utf16Wrap_from_utf16(const char16_t *input_data, size_t input_len) * } */ - public static MethodHandle Opaque_assert_struct$handle() { - return Opaque_assert_struct.HANDLE; + public static MethodHandle Utf16Wrap_from_utf16$handle() { + return Utf16Wrap_from_utf16.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Opaque_assert_struct(const Opaque *self, MyStruct s) + * Utf16Wrap *Utf16Wrap_from_utf16(const char16_t *input_data, size_t input_len) * } */ - public static MemorySegment Opaque_assert_struct$address() { - return Opaque_assert_struct.ADDR; + public static MemorySegment Utf16Wrap_from_utf16$address() { + return Utf16Wrap_from_utf16.ADDR; } /** * {@snippet lang=c : - * void Opaque_assert_struct(const Opaque *self, MyStruct s) + * Utf16Wrap *Utf16Wrap_from_utf16(const char16_t *input_data, size_t input_len) * } */ - public static void Opaque_assert_struct(MemorySegment self, MemorySegment s) { - var mh$ = Opaque_assert_struct.HANDLE; + public static MemorySegment Utf16Wrap_from_utf16(MemorySegment input_data, long input_len) { + var mh$ = Utf16Wrap_from_utf16.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_assert_struct", self, s); + traceDowncall("Utf16Wrap_from_utf16", input_data, input_len); } - mh$.invokeExact(self, s); + return (MemorySegment)mh$.invokeExact(input_data, input_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - /** - * Variadic invoker class for: - * {@snippet lang=c : - * size_t Opaque_returns_usize() - * } - */ - public static class Opaque_returns_usize { - private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - somelib_h.C_LONG ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_returns_usize"); - - private final MethodHandle handle; - private final FunctionDescriptor descriptor; - private final MethodHandle spreader; - - private Opaque_returns_usize(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { - this.handle = handle; - this.descriptor = descriptor; - this.spreader = spreader; - } - - /** - * Variadic invoker factory for: - * {@snippet lang=c : - * size_t Opaque_returns_usize() - * } - */ - public static Opaque_returns_usize makeInvoker(MemoryLayout... layouts) { - FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); - Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); - var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); - var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new Opaque_returns_usize(mh$, desc$, spreader$); - } - - /** - * {@return the address} - */ - public static MemorySegment address() { - return ADDR; - } - - /** - * {@return the specialized method handle} - */ - public MethodHandle handle() { - return handle; - } - - /** - * {@return the specialized descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } - - public long apply(Object... x0) { - try { - if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_returns_usize", x0); - } - return (long)spreader.invokeExact(x0); - } catch(IllegalArgumentException | ClassCastException ex$) { - throw ex$; // rethrow IAE from passing wrong number/type of args - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - } - - /** - * Variadic invoker class for: - * {@snippet lang=c : - * ImportedStruct Opaque_returns_imported() - * } - */ - public static class Opaque_returns_imported { - private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - ImportedStruct.layout() ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_returns_imported"); - - private final MethodHandle handle; - private final FunctionDescriptor descriptor; - private final MethodHandle spreader; - - private Opaque_returns_imported(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { - this.handle = handle; - this.descriptor = descriptor; - this.spreader = spreader; - } - - /** - * Variadic invoker factory for: - * {@snippet lang=c : - * ImportedStruct Opaque_returns_imported() - * } - */ - public static Opaque_returns_imported makeInvoker(MemoryLayout... layouts) { - FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); - Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); - var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); - var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new Opaque_returns_imported(mh$, desc$, spreader$); - } - - /** - * {@return the address} - */ - public static MemorySegment address() { - return ADDR; - } - - /** - * {@return the specialized method handle} - */ - public MethodHandle handle() { - return handle; - } - - /** - * {@return the specialized descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } - - public MemorySegment apply(SegmentAllocator allocator, Object... x0) { - try { - if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_returns_imported", allocator, x0); - } - return (MemorySegment)spreader.invokeExact(allocator, x0); - } catch(IllegalArgumentException | ClassCastException ex$) { - throw ex$; // rethrow IAE from passing wrong number/type of args - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - } - - /** - * Variadic invoker class for: - * {@snippet lang=c : - * int8_t Opaque_cmp() - * } - */ - public static class Opaque_cmp { - private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - somelib_h.C_CHAR ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_cmp"); - - private final MethodHandle handle; - private final FunctionDescriptor descriptor; - private final MethodHandle spreader; - - private Opaque_cmp(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { - this.handle = handle; - this.descriptor = descriptor; - this.spreader = spreader; - } - - /** - * Variadic invoker factory for: - * {@snippet lang=c : - * int8_t Opaque_cmp() - * } - */ - public static Opaque_cmp makeInvoker(MemoryLayout... layouts) { - FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); - Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); - var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); - var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new Opaque_cmp(mh$, desc$, spreader$); - } - - /** - * {@return the address} - */ - public static MemorySegment address() { - return ADDR; - } - - /** - * {@return the specialized method handle} - */ - public MethodHandle handle() { - return handle; - } - - /** - * {@return the specialized descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } - - public byte apply(Object... x0) { - try { - if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_cmp", x0); - } - return (byte)spreader.invokeExact(x0); - } catch(IllegalArgumentException | ClassCastException ex$) { - throw ex$; // rethrow IAE from passing wrong number/type of args - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - } - - private static class Opaque_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_destroy"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * void Opaque_destroy(Opaque *self) - * } - */ - public static FunctionDescriptor Opaque_destroy$descriptor() { - return Opaque_destroy.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * void Opaque_destroy(Opaque *self) - * } - */ - public static MethodHandle Opaque_destroy$handle() { - return Opaque_destroy.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * void Opaque_destroy(Opaque *self) - * } - */ - public static MemorySegment Opaque_destroy$address() { - return Opaque_destroy.ADDR; - } - - /** - * {@snippet lang=c : - * void Opaque_destroy(Opaque *self) - * } - */ - public static void Opaque_destroy(MemorySegment self) { - var mh$ = Opaque_destroy.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_destroy", self); - } - mh$.invokeExact(self); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - private static final int ErrorEnum_Foo = (int)0L; - /** - * {@snippet lang=c : - * enum ErrorEnum.ErrorEnum_Foo = 0 - * } - */ - public static int ErrorEnum_Foo() { - return ErrorEnum_Foo; - } - private static final int ErrorEnum_Bar = (int)1L; - /** - * {@snippet lang=c : - * enum ErrorEnum.ErrorEnum_Bar = 1 - * } - */ - public static int ErrorEnum_Bar() { - return ErrorEnum_Bar; - } - - private static class MyString_new { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * MyString *MyString_new(const char *v_data, size_t v_len) - * } - */ - public static FunctionDescriptor MyString_new$descriptor() { - return MyString_new.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * MyString *MyString_new(const char *v_data, size_t v_len) - * } - */ - public static MethodHandle MyString_new$handle() { - return MyString_new.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * MyString *MyString_new(const char *v_data, size_t v_len) - * } - */ - public static MemorySegment MyString_new$address() { - return MyString_new.ADDR; - } - - /** - * {@snippet lang=c : - * MyString *MyString_new(const char *v_data, size_t v_len) - * } - */ - public static MemorySegment MyString_new(MemorySegment v_data, long v_len) { - var mh$ = MyString_new.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("MyString_new", v_data, v_len); - } - return (MemorySegment)mh$.invokeExact(v_data, v_len); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class MyString_new_unsafe { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new_unsafe"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * MyString *MyString_new_unsafe(const char *v_data, size_t v_len) - * } - */ - public static FunctionDescriptor MyString_new_unsafe$descriptor() { - return MyString_new_unsafe.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * MyString *MyString_new_unsafe(const char *v_data, size_t v_len) - * } - */ - public static MethodHandle MyString_new_unsafe$handle() { - return MyString_new_unsafe.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * MyString *MyString_new_unsafe(const char *v_data, size_t v_len) - * } - */ - public static MemorySegment MyString_new_unsafe$address() { - return MyString_new_unsafe.ADDR; - } - - /** - * {@snippet lang=c : - * MyString *MyString_new_unsafe(const char *v_data, size_t v_len) - * } - */ - public static MemorySegment MyString_new_unsafe(MemorySegment v_data, long v_len) { - var mh$ = MyString_new_unsafe.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("MyString_new_unsafe", v_data, v_len); - } - return (MemorySegment)mh$.invokeExact(v_data, v_len); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class MyString_new_owned { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new_owned"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * MyString *MyString_new_owned(const char *v_data, size_t v_len) - * } - */ - public static FunctionDescriptor MyString_new_owned$descriptor() { - return MyString_new_owned.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * MyString *MyString_new_owned(const char *v_data, size_t v_len) - * } - */ - public static MethodHandle MyString_new_owned$handle() { - return MyString_new_owned.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * MyString *MyString_new_owned(const char *v_data, size_t v_len) - * } - */ - public static MemorySegment MyString_new_owned$address() { - return MyString_new_owned.ADDR; - } - - /** - * {@snippet lang=c : - * MyString *MyString_new_owned(const char *v_data, size_t v_len) - * } - */ - public static MemorySegment MyString_new_owned(MemorySegment v_data, long v_len) { - var mh$ = MyString_new_owned.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("MyString_new_owned", v_data, v_len); - } - return (MemorySegment)mh$.invokeExact(v_data, v_len); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class MyString_new_from_first { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new_from_first"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * MyString *MyString_new_from_first(DiplomatStringsView *v_data, size_t v_len) - * } - */ - public static FunctionDescriptor MyString_new_from_first$descriptor() { - return MyString_new_from_first.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * MyString *MyString_new_from_first(DiplomatStringsView *v_data, size_t v_len) - * } - */ - public static MethodHandle MyString_new_from_first$handle() { - return MyString_new_from_first.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * MyString *MyString_new_from_first(DiplomatStringsView *v_data, size_t v_len) - * } - */ - public static MemorySegment MyString_new_from_first$address() { - return MyString_new_from_first.ADDR; - } - - /** - * {@snippet lang=c : - * MyString *MyString_new_from_first(DiplomatStringsView *v_data, size_t v_len) - * } - */ - public static MemorySegment MyString_new_from_first(MemorySegment v_data, long v_len) { - var mh$ = MyString_new_from_first.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("MyString_new_from_first", v_data, v_len); - } - return (MemorySegment)mh$.invokeExact(v_data, v_len); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class MyString_set_str { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_set_str"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * void MyString_set_str(MyString *self, const char *new_str_data, size_t new_str_len) - * } - */ - public static FunctionDescriptor MyString_set_str$descriptor() { - return MyString_set_str.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * void MyString_set_str(MyString *self, const char *new_str_data, size_t new_str_len) - * } - */ - public static MethodHandle MyString_set_str$handle() { - return MyString_set_str.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * void MyString_set_str(MyString *self, const char *new_str_data, size_t new_str_len) - * } - */ - public static MemorySegment MyString_set_str$address() { - return MyString_set_str.ADDR; - } - - /** - * {@snippet lang=c : - * void MyString_set_str(MyString *self, const char *new_str_data, size_t new_str_len) - * } - */ - public static void MyString_set_str(MemorySegment self, MemorySegment new_str_data, long new_str_len) { - var mh$ = MyString_set_str.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("MyString_set_str", self, new_str_data, new_str_len); - } - mh$.invokeExact(self, new_str_data, new_str_len); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class MyString_get_str { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_get_str"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * void MyString_get_str(const MyString *self, DiplomatWrite *write) - * } - */ - public static FunctionDescriptor MyString_get_str$descriptor() { - return MyString_get_str.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * void MyString_get_str(const MyString *self, DiplomatWrite *write) - * } - */ - public static MethodHandle MyString_get_str$handle() { - return MyString_get_str.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * void MyString_get_str(const MyString *self, DiplomatWrite *write) - * } - */ - public static MemorySegment MyString_get_str$address() { - return MyString_get_str.ADDR; - } - - /** - * {@snippet lang=c : - * void MyString_get_str(const MyString *self, DiplomatWrite *write) - * } - */ - public static void MyString_get_str(MemorySegment self, MemorySegment write) { - var mh$ = MyString_get_str.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("MyString_get_str", self, write); - } - mh$.invokeExact(self, write); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class MyString_get_boxed_str { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - DiplomatStringView.layout(), - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_get_boxed_str"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * DiplomatStringView MyString_get_boxed_str(const MyString *self) - * } - */ - public static FunctionDescriptor MyString_get_boxed_str$descriptor() { - return MyString_get_boxed_str.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * DiplomatStringView MyString_get_boxed_str(const MyString *self) - * } - */ - public static MethodHandle MyString_get_boxed_str$handle() { - return MyString_get_boxed_str.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * DiplomatStringView MyString_get_boxed_str(const MyString *self) - * } - */ - public static MemorySegment MyString_get_boxed_str$address() { - return MyString_get_boxed_str.ADDR; - } - - /** - * {@snippet lang=c : - * DiplomatStringView MyString_get_boxed_str(const MyString *self) - * } - */ - public static MemorySegment MyString_get_boxed_str(SegmentAllocator allocator, MemorySegment self) { - var mh$ = MyString_get_boxed_str.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("MyString_get_boxed_str", allocator, self); - } - return (MemorySegment)mh$.invokeExact(allocator, self); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class MyString_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_destroy"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * void MyString_destroy(MyString *self) - * } - */ - public static FunctionDescriptor MyString_destroy$descriptor() { - return MyString_destroy.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * void MyString_destroy(MyString *self) - * } - */ - public static MethodHandle MyString_destroy$handle() { - return MyString_destroy.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * void MyString_destroy(MyString *self) - * } - */ - public static MemorySegment MyString_destroy$address() { - return MyString_destroy.ADDR; - } - - /** - * {@snippet lang=c : - * void MyString_destroy(MyString *self) - * } - */ - public static void MyString_destroy(MemorySegment self) { - var mh$ = MyString_destroy.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("MyString_destroy", self); - } - mh$.invokeExact(self); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class Two_destroy { + private static class Utf16Wrap_get_debug_str { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("Two_destroy"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * void Two_destroy(Two *self) - * } - */ - public static FunctionDescriptor Two_destroy$descriptor() { - return Two_destroy.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * void Two_destroy(Two *self) - * } - */ - public static MethodHandle Two_destroy$handle() { - return Two_destroy.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * void Two_destroy(Two *self) - * } - */ - public static MemorySegment Two_destroy$address() { - return Two_destroy.ADDR; - } - - /** - * {@snippet lang=c : - * void Two_destroy(Two *self) - * } - */ - public static void Two_destroy(MemorySegment self) { - var mh$ = Two_destroy.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("Two_destroy", self); - } - mh$.invokeExact(self); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class NestedBorrowedFields_from_bar_and_foo_and_strings { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - NestedBorrowedFields.layout(), - somelib_h.C_POINTER, somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG, - somelib_h.C_POINTER, - somelib_h.C_LONG, - somelib_h.C_POINTER, - somelib_h.C_LONG, - somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("NestedBorrowedFields_from_bar_and_foo_and_strings"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_get_debug_str"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14709,58 +14284,57 @@ private static class NestedBorrowedFields_from_bar_and_foo_and_strings { /** * Function descriptor for: * {@snippet lang=c : - * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char16_t *dstr16_z_data, size_t dstr16_z_len, const char *utf8_str_y_data, size_t utf8_str_y_len, const char *utf8_str_z_data, size_t utf8_str_z_len) + * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) * } */ - public static FunctionDescriptor NestedBorrowedFields_from_bar_and_foo_and_strings$descriptor() { - return NestedBorrowedFields_from_bar_and_foo_and_strings.DESC; + public static FunctionDescriptor Utf16Wrap_get_debug_str$descriptor() { + return Utf16Wrap_get_debug_str.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char16_t *dstr16_z_data, size_t dstr16_z_len, const char *utf8_str_y_data, size_t utf8_str_y_len, const char *utf8_str_z_data, size_t utf8_str_z_len) + * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) * } */ - public static MethodHandle NestedBorrowedFields_from_bar_and_foo_and_strings$handle() { - return NestedBorrowedFields_from_bar_and_foo_and_strings.HANDLE; + public static MethodHandle Utf16Wrap_get_debug_str$handle() { + return Utf16Wrap_get_debug_str.HANDLE; } /** * Address for: * {@snippet lang=c : - * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char16_t *dstr16_z_data, size_t dstr16_z_len, const char *utf8_str_y_data, size_t utf8_str_y_len, const char *utf8_str_z_data, size_t utf8_str_z_len) + * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) * } */ - public static MemorySegment NestedBorrowedFields_from_bar_and_foo_and_strings$address() { - return NestedBorrowedFields_from_bar_and_foo_and_strings.ADDR; + public static MemorySegment Utf16Wrap_get_debug_str$address() { + return Utf16Wrap_get_debug_str.ADDR; } /** * {@snippet lang=c : - * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char16_t *dstr16_z_data, size_t dstr16_z_len, const char *utf8_str_y_data, size_t utf8_str_y_len, const char *utf8_str_z_data, size_t utf8_str_z_len) + * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) * } */ - public static MemorySegment NestedBorrowedFields_from_bar_and_foo_and_strings(SegmentAllocator allocator, MemorySegment bar, MemorySegment foo, MemorySegment dstr16_x_data, long dstr16_x_len, MemorySegment dstr16_z_data, long dstr16_z_len, MemorySegment utf8_str_y_data, long utf8_str_y_len, MemorySegment utf8_str_z_data, long utf8_str_z_len) { - var mh$ = NestedBorrowedFields_from_bar_and_foo_and_strings.HANDLE; + public static void Utf16Wrap_get_debug_str(MemorySegment self, MemorySegment write) { + var mh$ = Utf16Wrap_get_debug_str.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("NestedBorrowedFields_from_bar_and_foo_and_strings", allocator, bar, foo, dstr16_x_data, dstr16_x_len, dstr16_z_data, dstr16_z_len, utf8_str_y_data, utf8_str_y_len, utf8_str_z_data, utf8_str_z_len); + traceDowncall("Utf16Wrap_get_debug_str", self, write); } - return (MemorySegment)mh$.invokeExact(allocator, bar, foo, dstr16_x_data, dstr16_x_len, dstr16_z_data, dstr16_z_len, utf8_str_y_data, utf8_str_y_len, utf8_str_z_data, utf8_str_z_len); + mh$.invokeExact(self, write); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_transitivity { + private static class Utf16Wrap_borrow_cont { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, + DiplomatString16View.layout(), somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_transitivity"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_borrow_cont"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14768,58 +14342,57 @@ private static class One_transitivity { /** * Function descriptor for: * {@snippet lang=c : - * One *One_transitivity(const One *hold, const One *nohold) + * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) * } */ - public static FunctionDescriptor One_transitivity$descriptor() { - return One_transitivity.DESC; + public static FunctionDescriptor Utf16Wrap_borrow_cont$descriptor() { + return Utf16Wrap_borrow_cont.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_transitivity(const One *hold, const One *nohold) + * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) * } */ - public static MethodHandle One_transitivity$handle() { - return One_transitivity.HANDLE; + public static MethodHandle Utf16Wrap_borrow_cont$handle() { + return Utf16Wrap_borrow_cont.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_transitivity(const One *hold, const One *nohold) + * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) * } */ - public static MemorySegment One_transitivity$address() { - return One_transitivity.ADDR; + public static MemorySegment Utf16Wrap_borrow_cont$address() { + return Utf16Wrap_borrow_cont.ADDR; } /** * {@snippet lang=c : - * One *One_transitivity(const One *hold, const One *nohold) + * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) * } */ - public static MemorySegment One_transitivity(MemorySegment hold, MemorySegment nohold) { - var mh$ = One_transitivity.HANDLE; + public static MemorySegment Utf16Wrap_borrow_cont(SegmentAllocator allocator, MemorySegment self) { + var mh$ = Utf16Wrap_borrow_cont.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_transitivity", hold, nohold); + traceDowncall("Utf16Wrap_borrow_cont", allocator, self); } - return (MemorySegment)mh$.invokeExact(hold, nohold); + return (MemorySegment)mh$.invokeExact(allocator, self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_cycle { + private static class Utf16Wrap_owned { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, + DiplomatString16View.layout(), somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_cycle"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_owned"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14827,61 +14400,56 @@ private static class One_cycle { /** * Function descriptor for: * {@snippet lang=c : - * One *One_cycle(const Two *hold, const One *nohold) + * DiplomatString16View Utf16Wrap_owned(const Utf16Wrap *self) * } */ - public static FunctionDescriptor One_cycle$descriptor() { - return One_cycle.DESC; + public static FunctionDescriptor Utf16Wrap_owned$descriptor() { + return Utf16Wrap_owned.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_cycle(const Two *hold, const One *nohold) + * DiplomatString16View Utf16Wrap_owned(const Utf16Wrap *self) * } */ - public static MethodHandle One_cycle$handle() { - return One_cycle.HANDLE; + public static MethodHandle Utf16Wrap_owned$handle() { + return Utf16Wrap_owned.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_cycle(const Two *hold, const One *nohold) + * DiplomatString16View Utf16Wrap_owned(const Utf16Wrap *self) * } */ - public static MemorySegment One_cycle$address() { - return One_cycle.ADDR; + public static MemorySegment Utf16Wrap_owned$address() { + return Utf16Wrap_owned.ADDR; } /** * {@snippet lang=c : - * One *One_cycle(const Two *hold, const One *nohold) + * DiplomatString16View Utf16Wrap_owned(const Utf16Wrap *self) * } */ - public static MemorySegment One_cycle(MemorySegment hold, MemorySegment nohold) { - var mh$ = One_cycle.HANDLE; + public static MemorySegment Utf16Wrap_owned(SegmentAllocator allocator, MemorySegment self) { + var mh$ = Utf16Wrap_owned.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_cycle", hold, nohold); + traceDowncall("Utf16Wrap_owned", allocator, self); } - return (MemorySegment)mh$.invokeExact(hold, nohold); + return (MemorySegment)mh$.invokeExact(allocator, self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_many_dependents { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, + private static class Utf16Wrap_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_many_dependents"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14889,58 +14457,56 @@ private static class One_many_dependents { /** * Function descriptor for: * {@snippet lang=c : - * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) + * void Utf16Wrap_destroy(Utf16Wrap *self) * } */ - public static FunctionDescriptor One_many_dependents$descriptor() { - return One_many_dependents.DESC; + public static FunctionDescriptor Utf16Wrap_destroy$descriptor() { + return Utf16Wrap_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) + * void Utf16Wrap_destroy(Utf16Wrap *self) * } */ - public static MethodHandle One_many_dependents$handle() { - return One_many_dependents.HANDLE; + public static MethodHandle Utf16Wrap_destroy$handle() { + return Utf16Wrap_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) + * void Utf16Wrap_destroy(Utf16Wrap *self) * } */ - public static MemorySegment One_many_dependents$address() { - return One_many_dependents.ADDR; + public static MemorySegment Utf16Wrap_destroy$address() { + return Utf16Wrap_destroy.ADDR; } /** * {@snippet lang=c : - * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) + * void Utf16Wrap_destroy(Utf16Wrap *self) * } */ - public static MemorySegment One_many_dependents(MemorySegment a, MemorySegment b, MemorySegment c, MemorySegment d, MemorySegment nohold) { - var mh$ = One_many_dependents.HANDLE; + public static void Utf16Wrap_destroy(MemorySegment self) { + var mh$ = Utf16Wrap_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_many_dependents", a, b, c, d, nohold); + traceDowncall("Utf16Wrap_destroy", self); } - return (MemorySegment)mh$.invokeExact(a, b, c, d, nohold); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_return_outlives_param { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, + private static class namespace_AttrOpaque2_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_return_outlives_param"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_AttrOpaque2_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14948,60 +14514,57 @@ private static class One_return_outlives_param { /** * Function descriptor for: * {@snippet lang=c : - * One *One_return_outlives_param(const Two *hold, const One *nohold) + * void namespace_AttrOpaque2_destroy(AttrOpaque2 *self) * } */ - public static FunctionDescriptor One_return_outlives_param$descriptor() { - return One_return_outlives_param.DESC; + public static FunctionDescriptor namespace_AttrOpaque2_destroy$descriptor() { + return namespace_AttrOpaque2_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_return_outlives_param(const Two *hold, const One *nohold) + * void namespace_AttrOpaque2_destroy(AttrOpaque2 *self) * } */ - public static MethodHandle One_return_outlives_param$handle() { - return One_return_outlives_param.HANDLE; + public static MethodHandle namespace_AttrOpaque2_destroy$handle() { + return namespace_AttrOpaque2_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_return_outlives_param(const Two *hold, const One *nohold) + * void namespace_AttrOpaque2_destroy(AttrOpaque2 *self) * } */ - public static MemorySegment One_return_outlives_param$address() { - return One_return_outlives_param.ADDR; + public static MemorySegment namespace_AttrOpaque2_destroy$address() { + return namespace_AttrOpaque2_destroy.ADDR; } /** * {@snippet lang=c : - * One *One_return_outlives_param(const Two *hold, const One *nohold) + * void namespace_AttrOpaque2_destroy(AttrOpaque2 *self) * } */ - public static MemorySegment One_return_outlives_param(MemorySegment hold, MemorySegment nohold) { - var mh$ = One_return_outlives_param.HANDLE; + public static void namespace_AttrOpaque2_destroy(MemorySegment self) { + var mh$ = namespace_AttrOpaque2_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_return_outlives_param", hold, nohold); + traceDowncall("namespace_AttrOpaque2_destroy", self); } - return (MemorySegment)mh$.invokeExact(hold, nohold); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_diamond_top { + private static class RefList_node { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_top"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("RefList_node"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -15009,60 +14572,56 @@ private static class One_diamond_top { /** * Function descriptor for: * {@snippet lang=c : - * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) + * RefList *RefList_node(const RefListParameter *data) * } */ - public static FunctionDescriptor One_diamond_top$descriptor() { - return One_diamond_top.DESC; + public static FunctionDescriptor RefList_node$descriptor() { + return RefList_node.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) + * RefList *RefList_node(const RefListParameter *data) * } */ - public static MethodHandle One_diamond_top$handle() { - return One_diamond_top.HANDLE; + public static MethodHandle RefList_node$handle() { + return RefList_node.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) + * RefList *RefList_node(const RefListParameter *data) * } */ - public static MemorySegment One_diamond_top$address() { - return One_diamond_top.ADDR; + public static MemorySegment RefList_node$address() { + return RefList_node.ADDR; } /** * {@snippet lang=c : - * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) + * RefList *RefList_node(const RefListParameter *data) * } */ - public static MemorySegment One_diamond_top(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { - var mh$ = One_diamond_top.HANDLE; + public static MemorySegment RefList_node(MemorySegment data) { + var mh$ = RefList_node.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_diamond_top", top, left, right, bottom); + traceDowncall("RefList_node", data); } - return (MemorySegment)mh$.invokeExact(top, left, right, bottom); + return (MemorySegment)mh$.invokeExact(data); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_diamond_left { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, + private static class RefList_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_left"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("RefList_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -15070,60 +14629,61 @@ private static class One_diamond_left { /** * Function descriptor for: * {@snippet lang=c : - * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) + * void RefList_destroy(RefList *self) * } */ - public static FunctionDescriptor One_diamond_left$descriptor() { - return One_diamond_left.DESC; + public static FunctionDescriptor RefList_destroy$descriptor() { + return RefList_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) + * void RefList_destroy(RefList *self) * } */ - public static MethodHandle One_diamond_left$handle() { - return One_diamond_left.HANDLE; + public static MethodHandle RefList_destroy$handle() { + return RefList_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) + * void RefList_destroy(RefList *self) * } */ - public static MemorySegment One_diamond_left$address() { - return One_diamond_left.ADDR; + public static MemorySegment RefList_destroy$address() { + return RefList_destroy.ADDR; } /** * {@snippet lang=c : - * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) + * void RefList_destroy(RefList *self) * } */ - public static MemorySegment One_diamond_left(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { - var mh$ = One_diamond_left.HANDLE; + public static void RefList_destroy(MemorySegment self) { + var mh$ = RefList_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_diamond_left", top, left, right, bottom); + traceDowncall("RefList_destroy", self); } - return (MemorySegment)mh$.invokeExact(top, left, right, bottom); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_diamond_right { + private static class BorrowedFields_from_bar_and_strings { public static final FunctionDescriptor DESC = FunctionDescriptor.of( + BorrowedFields.layout(), somelib_h.C_POINTER, somelib_h.C_POINTER, + somelib_h.C_LONG, somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_right"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("BorrowedFields_from_bar_and_strings"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -15131,60 +14691,56 @@ private static class One_diamond_right { /** * Function descriptor for: * {@snippet lang=c : - * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) + * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, const char16_t *dstr16_data, size_t dstr16_len, const char *utf8_str_data, size_t utf8_str_len) * } */ - public static FunctionDescriptor One_diamond_right$descriptor() { - return One_diamond_right.DESC; + public static FunctionDescriptor BorrowedFields_from_bar_and_strings$descriptor() { + return BorrowedFields_from_bar_and_strings.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) + * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, const char16_t *dstr16_data, size_t dstr16_len, const char *utf8_str_data, size_t utf8_str_len) * } */ - public static MethodHandle One_diamond_right$handle() { - return One_diamond_right.HANDLE; + public static MethodHandle BorrowedFields_from_bar_and_strings$handle() { + return BorrowedFields_from_bar_and_strings.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) + * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, const char16_t *dstr16_data, size_t dstr16_len, const char *utf8_str_data, size_t utf8_str_len) * } */ - public static MemorySegment One_diamond_right$address() { - return One_diamond_right.ADDR; + public static MemorySegment BorrowedFields_from_bar_and_strings$address() { + return BorrowedFields_from_bar_and_strings.ADDR; } /** * {@snippet lang=c : - * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) + * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, const char16_t *dstr16_data, size_t dstr16_len, const char *utf8_str_data, size_t utf8_str_len) * } */ - public static MemorySegment One_diamond_right(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { - var mh$ = One_diamond_right.HANDLE; + public static MemorySegment BorrowedFields_from_bar_and_strings(SegmentAllocator allocator, MemorySegment bar, MemorySegment dstr16_data, long dstr16_len, MemorySegment utf8_str_data, long utf8_str_len) { + var mh$ = BorrowedFields_from_bar_and_strings.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_diamond_right", top, left, right, bottom); + traceDowncall("BorrowedFields_from_bar_and_strings", allocator, bar, dstr16_data, dstr16_len, utf8_str_data, utf8_str_len); } - return (MemorySegment)mh$.invokeExact(top, left, right, bottom); + return (MemorySegment)mh$.invokeExact(allocator, bar, dstr16_data, dstr16_len, utf8_str_data, utf8_str_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_diamond_bottom { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, + private static class RefListParameter_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_bottom"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("RefListParameter_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -15192,61 +14748,127 @@ private static class One_diamond_bottom { /** * Function descriptor for: * {@snippet lang=c : - * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) + * void RefListParameter_destroy(RefListParameter *self) * } */ - public static FunctionDescriptor One_diamond_bottom$descriptor() { - return One_diamond_bottom.DESC; + public static FunctionDescriptor RefListParameter_destroy$descriptor() { + return RefListParameter_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) + * void RefListParameter_destroy(RefListParameter *self) * } */ - public static MethodHandle One_diamond_bottom$handle() { - return One_diamond_bottom.HANDLE; + public static MethodHandle RefListParameter_destroy$handle() { + return RefListParameter_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) + * void RefListParameter_destroy(RefListParameter *self) * } */ - public static MemorySegment One_diamond_bottom$address() { - return One_diamond_bottom.ADDR; + public static MemorySegment RefListParameter_destroy$address() { + return RefListParameter_destroy.ADDR; } /** * {@snippet lang=c : - * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) + * void RefListParameter_destroy(RefListParameter *self) * } */ - public static MemorySegment One_diamond_bottom(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { - var mh$ = One_diamond_bottom.HANDLE; + public static void RefListParameter_destroy(MemorySegment self) { + var mh$ = RefListParameter_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_diamond_bottom", top, left, right, bottom); + traceDowncall("RefListParameter_destroy", self); } - return (MemorySegment)mh$.invokeExact(top, left, right, bottom); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_diamond_and_nested_types { + /** + * Variadic invoker class for: + * {@snippet lang=c : + * AttrOpaque1 *namespace_AttrOpaque1_new() + * } + */ + public static class namespace_AttrOpaque1_new { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + somelib_h.C_POINTER ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_AttrOpaque1_new"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private namespace_AttrOpaque1_new(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * AttrOpaque1 *namespace_AttrOpaque1_new() + * } + */ + public static namespace_AttrOpaque1_new makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new namespace_AttrOpaque1_new(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public MemorySegment apply(Object... x0) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("namespace_AttrOpaque1_new", x0); + } + return (MemorySegment)spreader.invokeExact(x0); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static class namespace_AttrOpaque1_method { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, + somelib_h.C_CHAR, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_and_nested_types"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_AttrOpaque1_method"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -15254,59 +14876,57 @@ private static class One_diamond_and_nested_types { /** * Function descriptor for: * {@snippet lang=c : - * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) + * uint8_t namespace_AttrOpaque1_method(const AttrOpaque1 *self) * } */ - public static FunctionDescriptor One_diamond_and_nested_types$descriptor() { - return One_diamond_and_nested_types.DESC; + public static FunctionDescriptor namespace_AttrOpaque1_method$descriptor() { + return namespace_AttrOpaque1_method.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) + * uint8_t namespace_AttrOpaque1_method(const AttrOpaque1 *self) * } */ - public static MethodHandle One_diamond_and_nested_types$handle() { - return One_diamond_and_nested_types.HANDLE; + public static MethodHandle namespace_AttrOpaque1_method$handle() { + return namespace_AttrOpaque1_method.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) + * uint8_t namespace_AttrOpaque1_method(const AttrOpaque1 *self) * } */ - public static MemorySegment One_diamond_and_nested_types$address() { - return One_diamond_and_nested_types.ADDR; + public static MemorySegment namespace_AttrOpaque1_method$address() { + return namespace_AttrOpaque1_method.ADDR; } /** * {@snippet lang=c : - * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) + * uint8_t namespace_AttrOpaque1_method(const AttrOpaque1 *self) * } */ - public static MemorySegment One_diamond_and_nested_types(MemorySegment a, MemorySegment b, MemorySegment c, MemorySegment d, MemorySegment nohold) { - var mh$ = One_diamond_and_nested_types.HANDLE; + public static byte namespace_AttrOpaque1_method(MemorySegment self) { + var mh$ = namespace_AttrOpaque1_method.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_diamond_and_nested_types", a, b, c, d, nohold); + traceDowncall("namespace_AttrOpaque1_method", self); } - return (MemorySegment)mh$.invokeExact(a, b, c, d, nohold); + return (byte)mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_implicit_bounds { + private static class renamed_on_abi_only { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, + somelib_h.C_CHAR, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_implicit_bounds"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("renamed_on_abi_only"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -15314,60 +14934,56 @@ private static class One_implicit_bounds { /** * Function descriptor for: * {@snippet lang=c : - * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) + * uint8_t renamed_on_abi_only(const AttrOpaque1 *self) * } */ - public static FunctionDescriptor One_implicit_bounds$descriptor() { - return One_implicit_bounds.DESC; + public static FunctionDescriptor renamed_on_abi_only$descriptor() { + return renamed_on_abi_only.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) + * uint8_t renamed_on_abi_only(const AttrOpaque1 *self) * } */ - public static MethodHandle One_implicit_bounds$handle() { - return One_implicit_bounds.HANDLE; + public static MethodHandle renamed_on_abi_only$handle() { + return renamed_on_abi_only.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) + * uint8_t renamed_on_abi_only(const AttrOpaque1 *self) * } */ - public static MemorySegment One_implicit_bounds$address() { - return One_implicit_bounds.ADDR; + public static MemorySegment renamed_on_abi_only$address() { + return renamed_on_abi_only.ADDR; } /** * {@snippet lang=c : - * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) + * uint8_t renamed_on_abi_only(const AttrOpaque1 *self) * } */ - public static MemorySegment One_implicit_bounds(MemorySegment explicit_hold, MemorySegment implicit_hold, MemorySegment nohold) { - var mh$ = One_implicit_bounds.HANDLE; + public static byte renamed_on_abi_only(MemorySegment self) { + var mh$ = renamed_on_abi_only.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_implicit_bounds", explicit_hold, implicit_hold, nohold); + traceDowncall("renamed_on_abi_only", self); } - return (MemorySegment)mh$.invokeExact(explicit_hold, implicit_hold, nohold); + return (byte)mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_implicit_bounds_deep { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, + private static class namespace_AttrOpaque1_method_disabledcpp { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_implicit_bounds_deep"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_AttrOpaque1_method_disabledcpp"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -15375,56 +14991,57 @@ private static class One_implicit_bounds_deep { /** * Function descriptor for: * {@snippet lang=c : - * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) + * void namespace_AttrOpaque1_method_disabledcpp(const AttrOpaque1 *self) * } */ - public static FunctionDescriptor One_implicit_bounds_deep$descriptor() { - return One_implicit_bounds_deep.DESC; + public static FunctionDescriptor namespace_AttrOpaque1_method_disabledcpp$descriptor() { + return namespace_AttrOpaque1_method_disabledcpp.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) + * void namespace_AttrOpaque1_method_disabledcpp(const AttrOpaque1 *self) * } */ - public static MethodHandle One_implicit_bounds_deep$handle() { - return One_implicit_bounds_deep.HANDLE; + public static MethodHandle namespace_AttrOpaque1_method_disabledcpp$handle() { + return namespace_AttrOpaque1_method_disabledcpp.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) + * void namespace_AttrOpaque1_method_disabledcpp(const AttrOpaque1 *self) * } */ - public static MemorySegment One_implicit_bounds_deep$address() { - return One_implicit_bounds_deep.ADDR; + public static MemorySegment namespace_AttrOpaque1_method_disabledcpp$address() { + return namespace_AttrOpaque1_method_disabledcpp.ADDR; } /** * {@snippet lang=c : - * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) + * void namespace_AttrOpaque1_method_disabledcpp(const AttrOpaque1 *self) * } */ - public static MemorySegment One_implicit_bounds_deep(MemorySegment explicit_, MemorySegment implicit_1, MemorySegment implicit_2, MemorySegment nohold) { - var mh$ = One_implicit_bounds_deep.HANDLE; + public static void namespace_AttrOpaque1_method_disabledcpp(MemorySegment self) { + var mh$ = namespace_AttrOpaque1_method_disabledcpp.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_implicit_bounds_deep", explicit_, implicit_1, implicit_2, nohold); + traceDowncall("namespace_AttrOpaque1_method_disabledcpp", self); } - return (MemorySegment)mh$.invokeExact(explicit_, implicit_1, implicit_2, nohold); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_destroy { + private static class namespace_AttrOpaque1_use_unnamespaced { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_AttrOpaque1_use_unnamespaced"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -15432,57 +15049,57 @@ private static class One_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void One_destroy(One *self) + * void namespace_AttrOpaque1_use_unnamespaced(const AttrOpaque1 *self, const Unnamespaced *_un) * } */ - public static FunctionDescriptor One_destroy$descriptor() { - return One_destroy.DESC; + public static FunctionDescriptor namespace_AttrOpaque1_use_unnamespaced$descriptor() { + return namespace_AttrOpaque1_use_unnamespaced.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void One_destroy(One *self) + * void namespace_AttrOpaque1_use_unnamespaced(const AttrOpaque1 *self, const Unnamespaced *_un) * } */ - public static MethodHandle One_destroy$handle() { - return One_destroy.HANDLE; + public static MethodHandle namespace_AttrOpaque1_use_unnamespaced$handle() { + return namespace_AttrOpaque1_use_unnamespaced.HANDLE; } /** * Address for: * {@snippet lang=c : - * void One_destroy(One *self) + * void namespace_AttrOpaque1_use_unnamespaced(const AttrOpaque1 *self, const Unnamespaced *_un) * } */ - public static MemorySegment One_destroy$address() { - return One_destroy.ADDR; + public static MemorySegment namespace_AttrOpaque1_use_unnamespaced$address() { + return namespace_AttrOpaque1_use_unnamespaced.ADDR; } /** * {@snippet lang=c : - * void One_destroy(One *self) + * void namespace_AttrOpaque1_use_unnamespaced(const AttrOpaque1 *self, const Unnamespaced *_un) * } */ - public static void One_destroy(MemorySegment self) { - var mh$ = One_destroy.HANDLE; + public static void namespace_AttrOpaque1_use_unnamespaced(MemorySegment self, MemorySegment _un) { + var mh$ = namespace_AttrOpaque1_use_unnamespaced.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_destroy", self); + traceDowncall("namespace_AttrOpaque1_use_unnamespaced", self, _un); } - mh$.invokeExact(self); + mh$.invokeExact(self, _un); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyEnum_into_value { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_CHAR, + private static class namespace_AttrOpaque1_use_namespaced { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, somelib_h.C_INT ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyEnum_into_value"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_AttrOpaque1_use_namespaced"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -15490,126 +15107,56 @@ private static class MyEnum_into_value { /** * Function descriptor for: * {@snippet lang=c : - * int8_t MyEnum_into_value(MyEnum self) + * void namespace_AttrOpaque1_use_namespaced(const AttrOpaque1 *self, AttrEnum _n) * } */ - public static FunctionDescriptor MyEnum_into_value$descriptor() { - return MyEnum_into_value.DESC; + public static FunctionDescriptor namespace_AttrOpaque1_use_namespaced$descriptor() { + return namespace_AttrOpaque1_use_namespaced.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int8_t MyEnum_into_value(MyEnum self) + * void namespace_AttrOpaque1_use_namespaced(const AttrOpaque1 *self, AttrEnum _n) * } */ - public static MethodHandle MyEnum_into_value$handle() { - return MyEnum_into_value.HANDLE; + public static MethodHandle namespace_AttrOpaque1_use_namespaced$handle() { + return namespace_AttrOpaque1_use_namespaced.HANDLE; } /** * Address for: * {@snippet lang=c : - * int8_t MyEnum_into_value(MyEnum self) + * void namespace_AttrOpaque1_use_namespaced(const AttrOpaque1 *self, AttrEnum _n) * } */ - public static MemorySegment MyEnum_into_value$address() { - return MyEnum_into_value.ADDR; + public static MemorySegment namespace_AttrOpaque1_use_namespaced$address() { + return namespace_AttrOpaque1_use_namespaced.ADDR; } /** * {@snippet lang=c : - * int8_t MyEnum_into_value(MyEnum self) + * void namespace_AttrOpaque1_use_namespaced(const AttrOpaque1 *self, AttrEnum _n) * } */ - public static byte MyEnum_into_value(int self) { - var mh$ = MyEnum_into_value.HANDLE; + public static void namespace_AttrOpaque1_use_namespaced(MemorySegment self, int _n) { + var mh$ = namespace_AttrOpaque1_use_namespaced.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyEnum_into_value", self); + traceDowncall("namespace_AttrOpaque1_use_namespaced", self, _n); } - return (byte)mh$.invokeExact(self); + mh$.invokeExact(self, _n); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - /** - * Variadic invoker class for: - * {@snippet lang=c : - * MyEnum MyEnum_get_a() - * } - */ - public static class MyEnum_get_a { - private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - somelib_h.C_INT ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("MyEnum_get_a"); - - private final MethodHandle handle; - private final FunctionDescriptor descriptor; - private final MethodHandle spreader; - - private MyEnum_get_a(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { - this.handle = handle; - this.descriptor = descriptor; - this.spreader = spreader; - } - - /** - * Variadic invoker factory for: - * {@snippet lang=c : - * MyEnum MyEnum_get_a() - * } - */ - public static MyEnum_get_a makeInvoker(MemoryLayout... layouts) { - FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); - Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); - var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); - var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new MyEnum_get_a(mh$, desc$, spreader$); - } - - /** - * {@return the address} - */ - public static MemorySegment address() { - return ADDR; - } - - /** - * {@return the specialized method handle} - */ - public MethodHandle handle() { - return handle; - } - - /** - * {@return the specialized descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } - - public int apply(Object... x0) { - try { - if (TRACE_DOWNCALLS) { - traceDowncall("MyEnum_get_a", x0); - } - return (int)spreader.invokeExact(x0); - } catch(IllegalArgumentException | ClassCastException ex$) { - throw ex$; // rethrow IAE from passing wrong number/type of args - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - } - - private static class RefListParameter_destroy { + private static class namespace_AttrOpaque1_destroy { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("RefListParameter_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_AttrOpaque1_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -15617,43 +15164,43 @@ private static class RefListParameter_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void RefListParameter_destroy(RefListParameter *self) + * void namespace_AttrOpaque1_destroy(AttrOpaque1 *self) * } */ - public static FunctionDescriptor RefListParameter_destroy$descriptor() { - return RefListParameter_destroy.DESC; + public static FunctionDescriptor namespace_AttrOpaque1_destroy$descriptor() { + return namespace_AttrOpaque1_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void RefListParameter_destroy(RefListParameter *self) + * void namespace_AttrOpaque1_destroy(AttrOpaque1 *self) * } */ - public static MethodHandle RefListParameter_destroy$handle() { - return RefListParameter_destroy.HANDLE; + public static MethodHandle namespace_AttrOpaque1_destroy$handle() { + return namespace_AttrOpaque1_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * void RefListParameter_destroy(RefListParameter *self) + * void namespace_AttrOpaque1_destroy(AttrOpaque1 *self) * } */ - public static MemorySegment RefListParameter_destroy$address() { - return RefListParameter_destroy.ADDR; + public static MemorySegment namespace_AttrOpaque1_destroy$address() { + return namespace_AttrOpaque1_destroy.ADDR; } /** * {@snippet lang=c : - * void RefListParameter_destroy(RefListParameter *self) + * void namespace_AttrOpaque1_destroy(AttrOpaque1 *self) * } - */ - public static void RefListParameter_destroy(MemorySegment self) { - var mh$ = RefListParameter_destroy.HANDLE; + */ + public static void namespace_AttrOpaque1_destroy(MemorySegment self) { + var mh$ = namespace_AttrOpaque1_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("RefListParameter_destroy", self); + traceDowncall("namespace_AttrOpaque1_destroy", self); } mh$.invokeExact(self); } catch (Throwable ex$) { @@ -16062,54 +15609,425 @@ private static class ResultOpaque_new_int { * struct ResultOpaque_new_int_result ResultOpaque_new_int(int32_t i) * } */ - public static FunctionDescriptor ResultOpaque_new_int$descriptor() { - return ResultOpaque_new_int.DESC; + public static FunctionDescriptor ResultOpaque_new_int$descriptor() { + return ResultOpaque_new_int.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * struct ResultOpaque_new_int_result ResultOpaque_new_int(int32_t i) + * } + */ + public static MethodHandle ResultOpaque_new_int$handle() { + return ResultOpaque_new_int.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * struct ResultOpaque_new_int_result ResultOpaque_new_int(int32_t i) + * } + */ + public static MemorySegment ResultOpaque_new_int$address() { + return ResultOpaque_new_int.ADDR; + } + + /** + * {@snippet lang=c : + * struct ResultOpaque_new_int_result ResultOpaque_new_int(int32_t i) + * } + */ + public static MemorySegment ResultOpaque_new_int(SegmentAllocator allocator, int i) { + var mh$ = ResultOpaque_new_int.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("ResultOpaque_new_int", allocator, i); + } + return (MemorySegment)mh$.invokeExact(allocator, i); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class ResultOpaque_new_in_enum_err { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + ResultOpaque_new_in_enum_err_result.layout(), + somelib_h.C_INT + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("ResultOpaque_new_in_enum_err"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * struct ResultOpaque_new_in_enum_err_result ResultOpaque_new_in_enum_err(int32_t i) + * } + */ + public static FunctionDescriptor ResultOpaque_new_in_enum_err$descriptor() { + return ResultOpaque_new_in_enum_err.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * struct ResultOpaque_new_in_enum_err_result ResultOpaque_new_in_enum_err(int32_t i) + * } + */ + public static MethodHandle ResultOpaque_new_in_enum_err$handle() { + return ResultOpaque_new_in_enum_err.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * struct ResultOpaque_new_in_enum_err_result ResultOpaque_new_in_enum_err(int32_t i) + * } + */ + public static MemorySegment ResultOpaque_new_in_enum_err$address() { + return ResultOpaque_new_in_enum_err.ADDR; + } + + /** + * {@snippet lang=c : + * struct ResultOpaque_new_in_enum_err_result ResultOpaque_new_in_enum_err(int32_t i) + * } + */ + public static MemorySegment ResultOpaque_new_in_enum_err(SegmentAllocator allocator, int i) { + var mh$ = ResultOpaque_new_in_enum_err.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("ResultOpaque_new_in_enum_err", allocator, i); + } + return (MemorySegment)mh$.invokeExact(allocator, i); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class ResultOpaque_assert_integer { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, + somelib_h.C_INT + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("ResultOpaque_assert_integer"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void ResultOpaque_assert_integer(const ResultOpaque *self, int32_t i) + * } + */ + public static FunctionDescriptor ResultOpaque_assert_integer$descriptor() { + return ResultOpaque_assert_integer.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void ResultOpaque_assert_integer(const ResultOpaque *self, int32_t i) + * } + */ + public static MethodHandle ResultOpaque_assert_integer$handle() { + return ResultOpaque_assert_integer.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void ResultOpaque_assert_integer(const ResultOpaque *self, int32_t i) + * } + */ + public static MemorySegment ResultOpaque_assert_integer$address() { + return ResultOpaque_assert_integer.ADDR; + } + + /** + * {@snippet lang=c : + * void ResultOpaque_assert_integer(const ResultOpaque *self, int32_t i) + * } + */ + public static void ResultOpaque_assert_integer(MemorySegment self, int i) { + var mh$ = ResultOpaque_assert_integer.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("ResultOpaque_assert_integer", self, i); + } + mh$.invokeExact(self, i); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class ResultOpaque_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("ResultOpaque_destroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void ResultOpaque_destroy(ResultOpaque *self) + * } + */ + public static FunctionDescriptor ResultOpaque_destroy$descriptor() { + return ResultOpaque_destroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void ResultOpaque_destroy(ResultOpaque *self) + * } + */ + public static MethodHandle ResultOpaque_destroy$handle() { + return ResultOpaque_destroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void ResultOpaque_destroy(ResultOpaque *self) + * } + */ + public static MemorySegment ResultOpaque_destroy$address() { + return ResultOpaque_destroy.ADDR; + } + + /** + * {@snippet lang=c : + * void ResultOpaque_destroy(ResultOpaque *self) + * } + */ + public static void ResultOpaque_destroy(MemorySegment self) { + var mh$ = ResultOpaque_destroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("ResultOpaque_destroy", self); + } + mh$.invokeExact(self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class OptionOpaque_new { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_INT + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaque_new"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * OptionOpaque *OptionOpaque_new(int32_t i) + * } + */ + public static FunctionDescriptor OptionOpaque_new$descriptor() { + return OptionOpaque_new.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * OptionOpaque *OptionOpaque_new(int32_t i) + * } + */ + public static MethodHandle OptionOpaque_new$handle() { + return OptionOpaque_new.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * OptionOpaque *OptionOpaque_new(int32_t i) + * } + */ + public static MemorySegment OptionOpaque_new$address() { + return OptionOpaque_new.ADDR; } /** - * Downcall method handle for: * {@snippet lang=c : - * struct ResultOpaque_new_int_result ResultOpaque_new_int(int32_t i) + * OptionOpaque *OptionOpaque_new(int32_t i) * } */ - public static MethodHandle ResultOpaque_new_int$handle() { - return ResultOpaque_new_int.HANDLE; + public static MemorySegment OptionOpaque_new(int i) { + var mh$ = OptionOpaque_new.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("OptionOpaque_new", i); + } + return (MemorySegment)mh$.invokeExact(i); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } } /** - * Address for: + * Variadic invoker class for: * {@snippet lang=c : - * struct ResultOpaque_new_int_result ResultOpaque_new_int(int32_t i) + * OptionOpaque *OptionOpaque_new_none() * } */ - public static MemorySegment ResultOpaque_new_int$address() { - return ResultOpaque_new_int.ADDR; + public static class OptionOpaque_new_none { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + somelib_h.C_POINTER ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaque_new_none"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private OptionOpaque_new_none(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * OptionOpaque *OptionOpaque_new_none() + * } + */ + public static OptionOpaque_new_none makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new OptionOpaque_new_none(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public MemorySegment apply(Object... x0) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("OptionOpaque_new_none", x0); + } + return (MemorySegment)spreader.invokeExact(x0); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } } /** + * Variadic invoker class for: * {@snippet lang=c : - * struct ResultOpaque_new_int_result ResultOpaque_new_int(int32_t i) + * struct OptionOpaque_returns_result OptionOpaque_returns() * } */ - public static MemorySegment ResultOpaque_new_int(SegmentAllocator allocator, int i) { - var mh$ = ResultOpaque_new_int.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("ResultOpaque_new_int", allocator, i); + public static class OptionOpaque_returns { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + OptionOpaque_returns_result.layout() ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaque_returns"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private OptionOpaque_returns(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * struct OptionOpaque_returns_result OptionOpaque_returns() + * } + */ + public static OptionOpaque_returns makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new OptionOpaque_returns(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public MemorySegment apply(SegmentAllocator allocator, Object... x0) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("OptionOpaque_returns", allocator, x0); + } + return (MemorySegment)spreader.invokeExact(allocator, x0); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); } - return (MemorySegment)mh$.invokeExact(allocator, i); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); } } - private static class ResultOpaque_new_in_enum_err { + private static class OptionOpaque_option_isize { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - ResultOpaque_new_in_enum_err_result.layout(), - somelib_h.C_INT + OptionOpaque_option_isize_result.layout(), + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("ResultOpaque_new_in_enum_err"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaque_option_isize"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -16117,57 +16035,57 @@ private static class ResultOpaque_new_in_enum_err { /** * Function descriptor for: * {@snippet lang=c : - * struct ResultOpaque_new_in_enum_err_result ResultOpaque_new_in_enum_err(int32_t i) + * struct OptionOpaque_option_isize_result OptionOpaque_option_isize(const OptionOpaque *self) * } */ - public static FunctionDescriptor ResultOpaque_new_in_enum_err$descriptor() { - return ResultOpaque_new_in_enum_err.DESC; + public static FunctionDescriptor OptionOpaque_option_isize$descriptor() { + return OptionOpaque_option_isize.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * struct ResultOpaque_new_in_enum_err_result ResultOpaque_new_in_enum_err(int32_t i) + * struct OptionOpaque_option_isize_result OptionOpaque_option_isize(const OptionOpaque *self) * } */ - public static MethodHandle ResultOpaque_new_in_enum_err$handle() { - return ResultOpaque_new_in_enum_err.HANDLE; + public static MethodHandle OptionOpaque_option_isize$handle() { + return OptionOpaque_option_isize.HANDLE; } /** * Address for: * {@snippet lang=c : - * struct ResultOpaque_new_in_enum_err_result ResultOpaque_new_in_enum_err(int32_t i) + * struct OptionOpaque_option_isize_result OptionOpaque_option_isize(const OptionOpaque *self) * } */ - public static MemorySegment ResultOpaque_new_in_enum_err$address() { - return ResultOpaque_new_in_enum_err.ADDR; + public static MemorySegment OptionOpaque_option_isize$address() { + return OptionOpaque_option_isize.ADDR; } /** * {@snippet lang=c : - * struct ResultOpaque_new_in_enum_err_result ResultOpaque_new_in_enum_err(int32_t i) + * struct OptionOpaque_option_isize_result OptionOpaque_option_isize(const OptionOpaque *self) * } */ - public static MemorySegment ResultOpaque_new_in_enum_err(SegmentAllocator allocator, int i) { - var mh$ = ResultOpaque_new_in_enum_err.HANDLE; + public static MemorySegment OptionOpaque_option_isize(SegmentAllocator allocator, MemorySegment self) { + var mh$ = OptionOpaque_option_isize.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("ResultOpaque_new_in_enum_err", allocator, i); + traceDowncall("OptionOpaque_option_isize", allocator, self); } - return (MemorySegment)mh$.invokeExact(allocator, i); + return (MemorySegment)mh$.invokeExact(allocator, self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class ResultOpaque_assert_integer { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER, - somelib_h.C_INT + private static class OptionOpaque_option_usize { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + OptionOpaque_option_usize_result.layout(), + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("ResultOpaque_assert_integer"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaque_option_usize"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -16175,56 +16093,57 @@ private static class ResultOpaque_assert_integer { /** * Function descriptor for: * {@snippet lang=c : - * void ResultOpaque_assert_integer(const ResultOpaque *self, int32_t i) + * struct OptionOpaque_option_usize_result OptionOpaque_option_usize(const OptionOpaque *self) * } */ - public static FunctionDescriptor ResultOpaque_assert_integer$descriptor() { - return ResultOpaque_assert_integer.DESC; + public static FunctionDescriptor OptionOpaque_option_usize$descriptor() { + return OptionOpaque_option_usize.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void ResultOpaque_assert_integer(const ResultOpaque *self, int32_t i) + * struct OptionOpaque_option_usize_result OptionOpaque_option_usize(const OptionOpaque *self) * } */ - public static MethodHandle ResultOpaque_assert_integer$handle() { - return ResultOpaque_assert_integer.HANDLE; + public static MethodHandle OptionOpaque_option_usize$handle() { + return OptionOpaque_option_usize.HANDLE; } /** * Address for: * {@snippet lang=c : - * void ResultOpaque_assert_integer(const ResultOpaque *self, int32_t i) + * struct OptionOpaque_option_usize_result OptionOpaque_option_usize(const OptionOpaque *self) * } */ - public static MemorySegment ResultOpaque_assert_integer$address() { - return ResultOpaque_assert_integer.ADDR; + public static MemorySegment OptionOpaque_option_usize$address() { + return OptionOpaque_option_usize.ADDR; } /** * {@snippet lang=c : - * void ResultOpaque_assert_integer(const ResultOpaque *self, int32_t i) + * struct OptionOpaque_option_usize_result OptionOpaque_option_usize(const OptionOpaque *self) * } */ - public static void ResultOpaque_assert_integer(MemorySegment self, int i) { - var mh$ = ResultOpaque_assert_integer.HANDLE; + public static MemorySegment OptionOpaque_option_usize(SegmentAllocator allocator, MemorySegment self) { + var mh$ = OptionOpaque_option_usize.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("ResultOpaque_assert_integer", self, i); + traceDowncall("OptionOpaque_option_usize", allocator, self); } - mh$.invokeExact(self, i); + return (MemorySegment)mh$.invokeExact(allocator, self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class ResultOpaque_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class OptionOpaque_option_i32 { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + OptionOpaque_option_i32_result.layout(), somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("ResultOpaque_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaque_option_i32"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -16232,57 +16151,57 @@ private static class ResultOpaque_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void ResultOpaque_destroy(ResultOpaque *self) + * struct OptionOpaque_option_i32_result OptionOpaque_option_i32(const OptionOpaque *self) * } */ - public static FunctionDescriptor ResultOpaque_destroy$descriptor() { - return ResultOpaque_destroy.DESC; + public static FunctionDescriptor OptionOpaque_option_i32$descriptor() { + return OptionOpaque_option_i32.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void ResultOpaque_destroy(ResultOpaque *self) + * struct OptionOpaque_option_i32_result OptionOpaque_option_i32(const OptionOpaque *self) * } */ - public static MethodHandle ResultOpaque_destroy$handle() { - return ResultOpaque_destroy.HANDLE; + public static MethodHandle OptionOpaque_option_i32$handle() { + return OptionOpaque_option_i32.HANDLE; } /** * Address for: * {@snippet lang=c : - * void ResultOpaque_destroy(ResultOpaque *self) + * struct OptionOpaque_option_i32_result OptionOpaque_option_i32(const OptionOpaque *self) * } */ - public static MemorySegment ResultOpaque_destroy$address() { - return ResultOpaque_destroy.ADDR; + public static MemorySegment OptionOpaque_option_i32$address() { + return OptionOpaque_option_i32.ADDR; } /** * {@snippet lang=c : - * void ResultOpaque_destroy(ResultOpaque *self) + * struct OptionOpaque_option_i32_result OptionOpaque_option_i32(const OptionOpaque *self) * } */ - public static void ResultOpaque_destroy(MemorySegment self) { - var mh$ = ResultOpaque_destroy.HANDLE; + public static MemorySegment OptionOpaque_option_i32(SegmentAllocator allocator, MemorySegment self) { + var mh$ = OptionOpaque_option_i32.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("ResultOpaque_destroy", self); + traceDowncall("OptionOpaque_option_i32", allocator, self); } - mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(allocator, self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class RefList_node { + private static class OptionOpaque_option_u32 { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, + OptionOpaque_option_u32_result.layout(), somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("RefList_node"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaque_option_u32"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -16290,56 +16209,197 @@ private static class RefList_node { /** * Function descriptor for: * {@snippet lang=c : - * RefList *RefList_node(const RefListParameter *data) + * struct OptionOpaque_option_u32_result OptionOpaque_option_u32(const OptionOpaque *self) * } */ - public static FunctionDescriptor RefList_node$descriptor() { - return RefList_node.DESC; + public static FunctionDescriptor OptionOpaque_option_u32$descriptor() { + return OptionOpaque_option_u32.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * RefList *RefList_node(const RefListParameter *data) + * struct OptionOpaque_option_u32_result OptionOpaque_option_u32(const OptionOpaque *self) * } */ - public static MethodHandle RefList_node$handle() { - return RefList_node.HANDLE; + public static MethodHandle OptionOpaque_option_u32$handle() { + return OptionOpaque_option_u32.HANDLE; } /** * Address for: * {@snippet lang=c : - * RefList *RefList_node(const RefListParameter *data) + * struct OptionOpaque_option_u32_result OptionOpaque_option_u32(const OptionOpaque *self) * } */ - public static MemorySegment RefList_node$address() { - return RefList_node.ADDR; + public static MemorySegment OptionOpaque_option_u32$address() { + return OptionOpaque_option_u32.ADDR; } /** * {@snippet lang=c : - * RefList *RefList_node(const RefListParameter *data) + * struct OptionOpaque_option_u32_result OptionOpaque_option_u32(const OptionOpaque *self) * } */ - public static MemorySegment RefList_node(MemorySegment data) { - var mh$ = RefList_node.HANDLE; + public static MemorySegment OptionOpaque_option_u32(SegmentAllocator allocator, MemorySegment self) { + var mh$ = OptionOpaque_option_u32.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("RefList_node", data); + traceDowncall("OptionOpaque_option_u32", allocator, self); } - return (MemorySegment)mh$.invokeExact(data); + return (MemorySegment)mh$.invokeExact(allocator, self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class RefList_destroy { + /** + * Variadic invoker class for: + * {@snippet lang=c : + * OptionStruct OptionOpaque_new_struct() + * } + */ + public static class OptionOpaque_new_struct { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + OptionStruct.layout() ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaque_new_struct"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private OptionOpaque_new_struct(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * OptionStruct OptionOpaque_new_struct() + * } + */ + public static OptionOpaque_new_struct makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new OptionOpaque_new_struct(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public MemorySegment apply(SegmentAllocator allocator, Object... x0) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("OptionOpaque_new_struct", allocator, x0); + } + return (MemorySegment)spreader.invokeExact(allocator, x0); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + /** + * Variadic invoker class for: + * {@snippet lang=c : + * OptionStruct OptionOpaque_new_struct_nones() + * } + */ + public static class OptionOpaque_new_struct_nones { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + OptionStruct.layout() ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaque_new_struct_nones"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private OptionOpaque_new_struct_nones(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * OptionStruct OptionOpaque_new_struct_nones() + * } + */ + public static OptionOpaque_new_struct_nones makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new OptionOpaque_new_struct_nones(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public MemorySegment apply(SegmentAllocator allocator, Object... x0) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("OptionOpaque_new_struct_nones", allocator, x0); + } + return (MemorySegment)spreader.invokeExact(allocator, x0); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static class OptionOpaque_assert_integer { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER + somelib_h.C_POINTER, + somelib_h.C_INT ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("RefList_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaque_assert_integer"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -16347,57 +16407,57 @@ private static class RefList_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void RefList_destroy(RefList *self) + * void OptionOpaque_assert_integer(const OptionOpaque *self, int32_t i) * } */ - public static FunctionDescriptor RefList_destroy$descriptor() { - return RefList_destroy.DESC; + public static FunctionDescriptor OptionOpaque_assert_integer$descriptor() { + return OptionOpaque_assert_integer.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void RefList_destroy(RefList *self) + * void OptionOpaque_assert_integer(const OptionOpaque *self, int32_t i) * } */ - public static MethodHandle RefList_destroy$handle() { - return RefList_destroy.HANDLE; + public static MethodHandle OptionOpaque_assert_integer$handle() { + return OptionOpaque_assert_integer.HANDLE; } /** * Address for: * {@snippet lang=c : - * void RefList_destroy(RefList *self) + * void OptionOpaque_assert_integer(const OptionOpaque *self, int32_t i) * } */ - public static MemorySegment RefList_destroy$address() { - return RefList_destroy.ADDR; + public static MemorySegment OptionOpaque_assert_integer$address() { + return OptionOpaque_assert_integer.ADDR; } /** * {@snippet lang=c : - * void RefList_destroy(RefList *self) + * void OptionOpaque_assert_integer(const OptionOpaque *self, int32_t i) * } */ - public static void RefList_destroy(MemorySegment self) { - var mh$ = RefList_destroy.HANDLE; + public static void OptionOpaque_assert_integer(MemorySegment self, int i) { + var mh$ = OptionOpaque_assert_integer.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("RefList_destroy", self); + traceDowncall("OptionOpaque_assert_integer", self, i); } - mh$.invokeExact(self); + mh$.invokeExact(self, i); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class namespace_Unnamespaced_make { + private static class OptionOpaque_option_opaque_argument { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_INT + somelib_h.C_BOOL, + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_Unnamespaced_make"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaque_option_opaque_argument"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -16405,57 +16465,56 @@ private static class namespace_Unnamespaced_make { /** * Function descriptor for: * {@snippet lang=c : - * Unnamespaced *namespace_Unnamespaced_make(AttrEnum _e) + * bool OptionOpaque_option_opaque_argument(const OptionOpaque *arg) * } */ - public static FunctionDescriptor namespace_Unnamespaced_make$descriptor() { - return namespace_Unnamespaced_make.DESC; + public static FunctionDescriptor OptionOpaque_option_opaque_argument$descriptor() { + return OptionOpaque_option_opaque_argument.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Unnamespaced *namespace_Unnamespaced_make(AttrEnum _e) + * bool OptionOpaque_option_opaque_argument(const OptionOpaque *arg) * } */ - public static MethodHandle namespace_Unnamespaced_make$handle() { - return namespace_Unnamespaced_make.HANDLE; + public static MethodHandle OptionOpaque_option_opaque_argument$handle() { + return OptionOpaque_option_opaque_argument.HANDLE; } /** * Address for: * {@snippet lang=c : - * Unnamespaced *namespace_Unnamespaced_make(AttrEnum _e) + * bool OptionOpaque_option_opaque_argument(const OptionOpaque *arg) * } */ - public static MemorySegment namespace_Unnamespaced_make$address() { - return namespace_Unnamespaced_make.ADDR; + public static MemorySegment OptionOpaque_option_opaque_argument$address() { + return OptionOpaque_option_opaque_argument.ADDR; } /** * {@snippet lang=c : - * Unnamespaced *namespace_Unnamespaced_make(AttrEnum _e) + * bool OptionOpaque_option_opaque_argument(const OptionOpaque *arg) * } */ - public static MemorySegment namespace_Unnamespaced_make(int _e) { - var mh$ = namespace_Unnamespaced_make.HANDLE; + public static boolean OptionOpaque_option_opaque_argument(MemorySegment arg) { + var mh$ = OptionOpaque_option_opaque_argument.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("namespace_Unnamespaced_make", _e); + traceDowncall("OptionOpaque_option_opaque_argument", arg); } - return (MemorySegment)mh$.invokeExact(_e); + return (boolean)mh$.invokeExact(arg); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class namespace_Unnamespaced_use_namespaced { + private static class OptionOpaque_destroy { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_Unnamespaced_use_namespaced"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaque_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -16463,56 +16522,58 @@ private static class namespace_Unnamespaced_use_namespaced { /** * Function descriptor for: * {@snippet lang=c : - * void namespace_Unnamespaced_use_namespaced(const Unnamespaced *self, const AttrOpaque1 *_n) + * void OptionOpaque_destroy(OptionOpaque *self) * } */ - public static FunctionDescriptor namespace_Unnamespaced_use_namespaced$descriptor() { - return namespace_Unnamespaced_use_namespaced.DESC; + public static FunctionDescriptor OptionOpaque_destroy$descriptor() { + return OptionOpaque_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void namespace_Unnamespaced_use_namespaced(const Unnamespaced *self, const AttrOpaque1 *_n) + * void OptionOpaque_destroy(OptionOpaque *self) * } */ - public static MethodHandle namespace_Unnamespaced_use_namespaced$handle() { - return namespace_Unnamespaced_use_namespaced.HANDLE; + public static MethodHandle OptionOpaque_destroy$handle() { + return OptionOpaque_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * void namespace_Unnamespaced_use_namespaced(const Unnamespaced *self, const AttrOpaque1 *_n) + * void OptionOpaque_destroy(OptionOpaque *self) * } */ - public static MemorySegment namespace_Unnamespaced_use_namespaced$address() { - return namespace_Unnamespaced_use_namespaced.ADDR; + public static MemorySegment OptionOpaque_destroy$address() { + return OptionOpaque_destroy.ADDR; } /** * {@snippet lang=c : - * void namespace_Unnamespaced_use_namespaced(const Unnamespaced *self, const AttrOpaque1 *_n) + * void OptionOpaque_destroy(OptionOpaque *self) * } */ - public static void namespace_Unnamespaced_use_namespaced(MemorySegment self, MemorySegment _n) { - var mh$ = namespace_Unnamespaced_use_namespaced.HANDLE; + public static void OptionOpaque_destroy(MemorySegment self) { + var mh$ = OptionOpaque_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("namespace_Unnamespaced_use_namespaced", self, _n); + traceDowncall("OptionOpaque_destroy", self); } - mh$.invokeExact(self, _n); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class namespace_Unnamespaced_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER + private static class namespace_MyIterable_new { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_Unnamespaced_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_MyIterable_new"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -16520,61 +16581,57 @@ private static class namespace_Unnamespaced_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void namespace_Unnamespaced_destroy(Unnamespaced *self) + * MyIterable *namespace_MyIterable_new(const uint8_t *x_data, size_t x_len) * } */ - public static FunctionDescriptor namespace_Unnamespaced_destroy$descriptor() { - return namespace_Unnamespaced_destroy.DESC; + public static FunctionDescriptor namespace_MyIterable_new$descriptor() { + return namespace_MyIterable_new.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void namespace_Unnamespaced_destroy(Unnamespaced *self) + * MyIterable *namespace_MyIterable_new(const uint8_t *x_data, size_t x_len) * } */ - public static MethodHandle namespace_Unnamespaced_destroy$handle() { - return namespace_Unnamespaced_destroy.HANDLE; + public static MethodHandle namespace_MyIterable_new$handle() { + return namespace_MyIterable_new.HANDLE; } /** * Address for: * {@snippet lang=c : - * void namespace_Unnamespaced_destroy(Unnamespaced *self) + * MyIterable *namespace_MyIterable_new(const uint8_t *x_data, size_t x_len) * } */ - public static MemorySegment namespace_Unnamespaced_destroy$address() { - return namespace_Unnamespaced_destroy.ADDR; + public static MemorySegment namespace_MyIterable_new$address() { + return namespace_MyIterable_new.ADDR; } /** * {@snippet lang=c : - * void namespace_Unnamespaced_destroy(Unnamespaced *self) + * MyIterable *namespace_MyIterable_new(const uint8_t *x_data, size_t x_len) * } */ - public static void namespace_Unnamespaced_destroy(MemorySegment self) { - var mh$ = namespace_Unnamespaced_destroy.HANDLE; + public static MemorySegment namespace_MyIterable_new(MemorySegment x_data, long x_len) { + var mh$ = namespace_MyIterable_new.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("namespace_Unnamespaced_destroy", self); + traceDowncall("namespace_MyIterable_new", x_data, x_len); } - mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(x_data, x_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class BorrowedFields_from_bar_and_strings { + private static class namespace_MyIterable_iter { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - BorrowedFields.layout(), - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG, somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("BorrowedFields_from_bar_and_strings"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_MyIterable_iter"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -16582,57 +16639,56 @@ private static class BorrowedFields_from_bar_and_strings { /** * Function descriptor for: * {@snippet lang=c : - * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, const char16_t *dstr16_data, size_t dstr16_len, const char *utf8_str_data, size_t utf8_str_len) + * MyIterator *namespace_MyIterable_iter(const MyIterable *self) * } */ - public static FunctionDescriptor BorrowedFields_from_bar_and_strings$descriptor() { - return BorrowedFields_from_bar_and_strings.DESC; + public static FunctionDescriptor namespace_MyIterable_iter$descriptor() { + return namespace_MyIterable_iter.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, const char16_t *dstr16_data, size_t dstr16_len, const char *utf8_str_data, size_t utf8_str_len) + * MyIterator *namespace_MyIterable_iter(const MyIterable *self) * } */ - public static MethodHandle BorrowedFields_from_bar_and_strings$handle() { - return BorrowedFields_from_bar_and_strings.HANDLE; + public static MethodHandle namespace_MyIterable_iter$handle() { + return namespace_MyIterable_iter.HANDLE; } /** * Address for: * {@snippet lang=c : - * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, const char16_t *dstr16_data, size_t dstr16_len, const char *utf8_str_data, size_t utf8_str_len) + * MyIterator *namespace_MyIterable_iter(const MyIterable *self) * } */ - public static MemorySegment BorrowedFields_from_bar_and_strings$address() { - return BorrowedFields_from_bar_and_strings.ADDR; + public static MemorySegment namespace_MyIterable_iter$address() { + return namespace_MyIterable_iter.ADDR; } /** * {@snippet lang=c : - * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, const char16_t *dstr16_data, size_t dstr16_len, const char *utf8_str_data, size_t utf8_str_len) + * MyIterator *namespace_MyIterable_iter(const MyIterable *self) * } */ - public static MemorySegment BorrowedFields_from_bar_and_strings(SegmentAllocator allocator, MemorySegment bar, MemorySegment dstr16_data, long dstr16_len, MemorySegment utf8_str_data, long utf8_str_len) { - var mh$ = BorrowedFields_from_bar_and_strings.HANDLE; + public static MemorySegment namespace_MyIterable_iter(MemorySegment self) { + var mh$ = namespace_MyIterable_iter.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("BorrowedFields_from_bar_and_strings", allocator, bar, dstr16_data, dstr16_len, utf8_str_data, utf8_str_len); + traceDowncall("namespace_MyIterable_iter", self); } - return (MemorySegment)mh$.invokeExact(allocator, bar, dstr16_data, dstr16_len, utf8_str_data, utf8_str_len); + return (MemorySegment)mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OptionOpaqueChar_assert_char { + private static class namespace_MyIterable_destroy { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER, - somelib_h.C_INT + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaqueChar_assert_char"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_MyIterable_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -16640,56 +16696,66 @@ private static class OptionOpaqueChar_assert_char { /** * Function descriptor for: * {@snippet lang=c : - * void OptionOpaqueChar_assert_char(const OptionOpaqueChar *self, char32_t ch) + * void namespace_MyIterable_destroy(MyIterable *self) * } */ - public static FunctionDescriptor OptionOpaqueChar_assert_char$descriptor() { - return OptionOpaqueChar_assert_char.DESC; + public static FunctionDescriptor namespace_MyIterable_destroy$descriptor() { + return namespace_MyIterable_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void OptionOpaqueChar_assert_char(const OptionOpaqueChar *self, char32_t ch) + * void namespace_MyIterable_destroy(MyIterable *self) * } */ - public static MethodHandle OptionOpaqueChar_assert_char$handle() { - return OptionOpaqueChar_assert_char.HANDLE; + public static MethodHandle namespace_MyIterable_destroy$handle() { + return namespace_MyIterable_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * void OptionOpaqueChar_assert_char(const OptionOpaqueChar *self, char32_t ch) + * void namespace_MyIterable_destroy(MyIterable *self) * } */ - public static MemorySegment OptionOpaqueChar_assert_char$address() { - return OptionOpaqueChar_assert_char.ADDR; + public static MemorySegment namespace_MyIterable_destroy$address() { + return namespace_MyIterable_destroy.ADDR; } /** * {@snippet lang=c : - * void OptionOpaqueChar_assert_char(const OptionOpaqueChar *self, char32_t ch) + * void namespace_MyIterable_destroy(MyIterable *self) * } */ - public static void OptionOpaqueChar_assert_char(MemorySegment self, int ch) { - var mh$ = OptionOpaqueChar_assert_char.HANDLE; + public static void namespace_MyIterable_destroy(MemorySegment self) { + var mh$ = namespace_MyIterable_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OptionOpaqueChar_assert_char", self, ch); + traceDowncall("namespace_MyIterable_destroy", self); } - mh$.invokeExact(self, ch); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OptionOpaqueChar_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER + private static class NestedBorrowedFields_from_bar_and_foo_and_strings { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + NestedBorrowedFields.layout(), + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG, + somelib_h.C_POINTER, + somelib_h.C_LONG, + somelib_h.C_POINTER, + somelib_h.C_LONG, + somelib_h.C_POINTER, + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaqueChar_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("NestedBorrowedFields_from_bar_and_foo_and_strings"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -16697,58 +16763,127 @@ private static class OptionOpaqueChar_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void OptionOpaqueChar_destroy(OptionOpaqueChar *self) + * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char16_t *dstr16_z_data, size_t dstr16_z_len, const char *utf8_str_y_data, size_t utf8_str_y_len, const char *utf8_str_z_data, size_t utf8_str_z_len) * } */ - public static FunctionDescriptor OptionOpaqueChar_destroy$descriptor() { - return OptionOpaqueChar_destroy.DESC; + public static FunctionDescriptor NestedBorrowedFields_from_bar_and_foo_and_strings$descriptor() { + return NestedBorrowedFields_from_bar_and_foo_and_strings.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void OptionOpaqueChar_destroy(OptionOpaqueChar *self) + * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char16_t *dstr16_z_data, size_t dstr16_z_len, const char *utf8_str_y_data, size_t utf8_str_y_len, const char *utf8_str_z_data, size_t utf8_str_z_len) * } */ - public static MethodHandle OptionOpaqueChar_destroy$handle() { - return OptionOpaqueChar_destroy.HANDLE; + public static MethodHandle NestedBorrowedFields_from_bar_and_foo_and_strings$handle() { + return NestedBorrowedFields_from_bar_and_foo_and_strings.HANDLE; } /** * Address for: * {@snippet lang=c : - * void OptionOpaqueChar_destroy(OptionOpaqueChar *self) + * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char16_t *dstr16_z_data, size_t dstr16_z_len, const char *utf8_str_y_data, size_t utf8_str_y_len, const char *utf8_str_z_data, size_t utf8_str_z_len) * } */ - public static MemorySegment OptionOpaqueChar_destroy$address() { - return OptionOpaqueChar_destroy.ADDR; + public static MemorySegment NestedBorrowedFields_from_bar_and_foo_and_strings$address() { + return NestedBorrowedFields_from_bar_and_foo_and_strings.ADDR; } /** * {@snippet lang=c : - * void OptionOpaqueChar_destroy(OptionOpaqueChar *self) + * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char16_t *dstr16_z_data, size_t dstr16_z_len, const char *utf8_str_y_data, size_t utf8_str_y_len, const char *utf8_str_z_data, size_t utf8_str_z_len) * } */ - public static void OptionOpaqueChar_destroy(MemorySegment self) { - var mh$ = OptionOpaqueChar_destroy.HANDLE; + public static MemorySegment NestedBorrowedFields_from_bar_and_foo_and_strings(SegmentAllocator allocator, MemorySegment bar, MemorySegment foo, MemorySegment dstr16_x_data, long dstr16_x_len, MemorySegment dstr16_z_data, long dstr16_z_len, MemorySegment utf8_str_y_data, long utf8_str_y_len, MemorySegment utf8_str_z_data, long utf8_str_z_len) { + var mh$ = NestedBorrowedFields_from_bar_and_foo_and_strings.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OptionOpaqueChar_destroy", self); + traceDowncall("NestedBorrowedFields_from_bar_and_foo_and_strings", allocator, bar, foo, dstr16_x_data, dstr16_x_len, dstr16_z_data, dstr16_z_len, utf8_str_y_data, utf8_str_y_len, utf8_str_z_data, utf8_str_z_len); + } + return (MemorySegment)mh$.invokeExact(allocator, bar, foo, dstr16_x_data, dstr16_x_len, dstr16_z_data, dstr16_z_len, utf8_str_y_data, utf8_str_y_len, utf8_str_z_data, utf8_str_z_len); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + /** + * Variadic invoker class for: + * {@snippet lang=c : + * MyStruct MyStruct_new() + * } + */ + public static class MyStruct_new { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + MyStruct.layout() ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("MyStruct_new"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private MyStruct_new(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * MyStruct MyStruct_new() + * } + */ + public static MyStruct_new makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new MyStruct_new(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public MemorySegment apply(SegmentAllocator allocator, Object... x0) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("MyStruct_new", allocator, x0); + } + return (MemorySegment)spreader.invokeExact(allocator, x0); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); } - mh$.invokeExact(self); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); } } - private static class namespace_MyIterable_new { + private static class MyStruct_into_a { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_CHAR, + MyStruct.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_MyIterable_new"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyStruct_into_a"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -16756,57 +16891,128 @@ private static class namespace_MyIterable_new { /** * Function descriptor for: * {@snippet lang=c : - * MyIterable *namespace_MyIterable_new(const uint8_t *x_data, size_t x_len) + * uint8_t MyStruct_into_a(MyStruct self) * } */ - public static FunctionDescriptor namespace_MyIterable_new$descriptor() { - return namespace_MyIterable_new.DESC; + public static FunctionDescriptor MyStruct_into_a$descriptor() { + return MyStruct_into_a.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * MyIterable *namespace_MyIterable_new(const uint8_t *x_data, size_t x_len) + * uint8_t MyStruct_into_a(MyStruct self) * } */ - public static MethodHandle namespace_MyIterable_new$handle() { - return namespace_MyIterable_new.HANDLE; + public static MethodHandle MyStruct_into_a$handle() { + return MyStruct_into_a.HANDLE; } /** * Address for: * {@snippet lang=c : - * MyIterable *namespace_MyIterable_new(const uint8_t *x_data, size_t x_len) + * uint8_t MyStruct_into_a(MyStruct self) * } */ - public static MemorySegment namespace_MyIterable_new$address() { - return namespace_MyIterable_new.ADDR; + public static MemorySegment MyStruct_into_a$address() { + return MyStruct_into_a.ADDR; } /** * {@snippet lang=c : - * MyIterable *namespace_MyIterable_new(const uint8_t *x_data, size_t x_len) + * uint8_t MyStruct_into_a(MyStruct self) * } */ - public static MemorySegment namespace_MyIterable_new(MemorySegment x_data, long x_len) { - var mh$ = namespace_MyIterable_new.HANDLE; + public static byte MyStruct_into_a(MemorySegment self) { + var mh$ = MyStruct_into_a.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("namespace_MyIterable_new", x_data, x_len); + traceDowncall("MyStruct_into_a", self); } - return (MemorySegment)mh$.invokeExact(x_data, x_len); + return (byte)mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class namespace_MyIterable_iter { + /** + * Variadic invoker class for: + * {@snippet lang=c : + * struct MyStruct_returns_zst_result_result MyStruct_returns_zst_result() + * } + */ + public static class MyStruct_returns_zst_result { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + MyStruct_returns_zst_result_result.layout() ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("MyStruct_returns_zst_result"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private MyStruct_returns_zst_result(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * struct MyStruct_returns_zst_result_result MyStruct_returns_zst_result() + * } + */ + public static MyStruct_returns_zst_result makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new MyStruct_returns_zst_result(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public MemorySegment apply(SegmentAllocator allocator, Object... x0) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("MyStruct_returns_zst_result", allocator, x0); + } + return (MemorySegment)spreader.invokeExact(allocator, x0); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static class Float64Vec_new { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - somelib_h.C_POINTER + somelib_h.C_POINTER, + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_MyIterable_iter"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -16814,56 +17020,58 @@ private static class namespace_MyIterable_iter { /** * Function descriptor for: * {@snippet lang=c : - * MyIterator *namespace_MyIterable_iter(const MyIterable *self) + * Float64Vec *Float64Vec_new(const double *v_data, size_t v_len) * } */ - public static FunctionDescriptor namespace_MyIterable_iter$descriptor() { - return namespace_MyIterable_iter.DESC; + public static FunctionDescriptor Float64Vec_new$descriptor() { + return Float64Vec_new.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * MyIterator *namespace_MyIterable_iter(const MyIterable *self) + * Float64Vec *Float64Vec_new(const double *v_data, size_t v_len) * } */ - public static MethodHandle namespace_MyIterable_iter$handle() { - return namespace_MyIterable_iter.HANDLE; + public static MethodHandle Float64Vec_new$handle() { + return Float64Vec_new.HANDLE; } /** * Address for: * {@snippet lang=c : - * MyIterator *namespace_MyIterable_iter(const MyIterable *self) + * Float64Vec *Float64Vec_new(const double *v_data, size_t v_len) * } */ - public static MemorySegment namespace_MyIterable_iter$address() { - return namespace_MyIterable_iter.ADDR; + public static MemorySegment Float64Vec_new$address() { + return Float64Vec_new.ADDR; } /** * {@snippet lang=c : - * MyIterator *namespace_MyIterable_iter(const MyIterable *self) + * Float64Vec *Float64Vec_new(const double *v_data, size_t v_len) * } */ - public static MemorySegment namespace_MyIterable_iter(MemorySegment self) { - var mh$ = namespace_MyIterable_iter.HANDLE; + public static MemorySegment Float64Vec_new(MemorySegment v_data, long v_len) { + var mh$ = Float64Vec_new.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("namespace_MyIterable_iter", self); + traceDowncall("Float64Vec_new", v_data, v_len); } - return (MemorySegment)mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(v_data, v_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class namespace_MyIterable_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER + private static class Float64Vec_new_bool { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_MyIterable_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_bool"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -16871,57 +17079,58 @@ private static class namespace_MyIterable_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void namespace_MyIterable_destroy(MyIterable *self) + * Float64Vec *Float64Vec_new_bool(const bool *v_data, size_t v_len) * } */ - public static FunctionDescriptor namespace_MyIterable_destroy$descriptor() { - return namespace_MyIterable_destroy.DESC; + public static FunctionDescriptor Float64Vec_new_bool$descriptor() { + return Float64Vec_new_bool.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void namespace_MyIterable_destroy(MyIterable *self) + * Float64Vec *Float64Vec_new_bool(const bool *v_data, size_t v_len) * } */ - public static MethodHandle namespace_MyIterable_destroy$handle() { - return namespace_MyIterable_destroy.HANDLE; + public static MethodHandle Float64Vec_new_bool$handle() { + return Float64Vec_new_bool.HANDLE; } /** * Address for: * {@snippet lang=c : - * void namespace_MyIterable_destroy(MyIterable *self) + * Float64Vec *Float64Vec_new_bool(const bool *v_data, size_t v_len) * } */ - public static MemorySegment namespace_MyIterable_destroy$address() { - return namespace_MyIterable_destroy.ADDR; + public static MemorySegment Float64Vec_new_bool$address() { + return Float64Vec_new_bool.ADDR; } /** * {@snippet lang=c : - * void namespace_MyIterable_destroy(MyIterable *self) + * Float64Vec *Float64Vec_new_bool(const bool *v_data, size_t v_len) * } */ - public static void namespace_MyIterable_destroy(MemorySegment self) { - var mh$ = namespace_MyIterable_destroy.HANDLE; + public static MemorySegment Float64Vec_new_bool(MemorySegment v_data, long v_len) { + var mh$ = Float64Vec_new_bool.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("namespace_MyIterable_destroy", self); + traceDowncall("Float64Vec_new_bool", v_data, v_len); } - mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(v_data, v_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class namespace_OpaqueIterator_next { + private static class Float64Vec_new_i16 { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - somelib_h.C_POINTER + somelib_h.C_POINTER, + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_OpaqueIterator_next"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_i16"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -16929,56 +17138,58 @@ private static class namespace_OpaqueIterator_next { /** * Function descriptor for: * {@snippet lang=c : - * AttrOpaque1 *namespace_OpaqueIterator_next(OpaqueIterator *self) + * Float64Vec *Float64Vec_new_i16(const int16_t *v_data, size_t v_len) * } */ - public static FunctionDescriptor namespace_OpaqueIterator_next$descriptor() { - return namespace_OpaqueIterator_next.DESC; + public static FunctionDescriptor Float64Vec_new_i16$descriptor() { + return Float64Vec_new_i16.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * AttrOpaque1 *namespace_OpaqueIterator_next(OpaqueIterator *self) + * Float64Vec *Float64Vec_new_i16(const int16_t *v_data, size_t v_len) * } */ - public static MethodHandle namespace_OpaqueIterator_next$handle() { - return namespace_OpaqueIterator_next.HANDLE; + public static MethodHandle Float64Vec_new_i16$handle() { + return Float64Vec_new_i16.HANDLE; } /** * Address for: * {@snippet lang=c : - * AttrOpaque1 *namespace_OpaqueIterator_next(OpaqueIterator *self) + * Float64Vec *Float64Vec_new_i16(const int16_t *v_data, size_t v_len) * } */ - public static MemorySegment namespace_OpaqueIterator_next$address() { - return namespace_OpaqueIterator_next.ADDR; + public static MemorySegment Float64Vec_new_i16$address() { + return Float64Vec_new_i16.ADDR; } /** * {@snippet lang=c : - * AttrOpaque1 *namespace_OpaqueIterator_next(OpaqueIterator *self) + * Float64Vec *Float64Vec_new_i16(const int16_t *v_data, size_t v_len) * } */ - public static MemorySegment namespace_OpaqueIterator_next(MemorySegment self) { - var mh$ = namespace_OpaqueIterator_next.HANDLE; + public static MemorySegment Float64Vec_new_i16(MemorySegment v_data, long v_len) { + var mh$ = Float64Vec_new_i16.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("namespace_OpaqueIterator_next", self); + traceDowncall("Float64Vec_new_i16", v_data, v_len); } - return (MemorySegment)mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(v_data, v_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class namespace_OpaqueIterator_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER + private static class Float64Vec_new_u16 { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_OpaqueIterator_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_u16"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -16986,57 +17197,58 @@ private static class namespace_OpaqueIterator_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void namespace_OpaqueIterator_destroy(OpaqueIterator *self) + * Float64Vec *Float64Vec_new_u16(const uint16_t *v_data, size_t v_len) * } */ - public static FunctionDescriptor namespace_OpaqueIterator_destroy$descriptor() { - return namespace_OpaqueIterator_destroy.DESC; + public static FunctionDescriptor Float64Vec_new_u16$descriptor() { + return Float64Vec_new_u16.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void namespace_OpaqueIterator_destroy(OpaqueIterator *self) + * Float64Vec *Float64Vec_new_u16(const uint16_t *v_data, size_t v_len) * } */ - public static MethodHandle namespace_OpaqueIterator_destroy$handle() { - return namespace_OpaqueIterator_destroy.HANDLE; + public static MethodHandle Float64Vec_new_u16$handle() { + return Float64Vec_new_u16.HANDLE; } /** * Address for: * {@snippet lang=c : - * void namespace_OpaqueIterator_destroy(OpaqueIterator *self) + * Float64Vec *Float64Vec_new_u16(const uint16_t *v_data, size_t v_len) * } */ - public static MemorySegment namespace_OpaqueIterator_destroy$address() { - return namespace_OpaqueIterator_destroy.ADDR; + public static MemorySegment Float64Vec_new_u16$address() { + return Float64Vec_new_u16.ADDR; } /** * {@snippet lang=c : - * void namespace_OpaqueIterator_destroy(OpaqueIterator *self) + * Float64Vec *Float64Vec_new_u16(const uint16_t *v_data, size_t v_len) * } - */ - public static void namespace_OpaqueIterator_destroy(MemorySegment self) { - var mh$ = namespace_OpaqueIterator_destroy.HANDLE; + */ + public static MemorySegment Float64Vec_new_u16(MemorySegment v_data, long v_len) { + var mh$ = Float64Vec_new_u16.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("namespace_OpaqueIterator_destroy", self); + traceDowncall("Float64Vec_new_u16", v_data, v_len); } - mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(v_data, v_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class namespace_MyIterator_next { + private static class Float64Vec_new_isize { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - namespace_MyIterator_next_result.layout(), - somelib_h.C_POINTER + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_MyIterator_next"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_isize"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -17044,56 +17256,58 @@ private static class namespace_MyIterator_next { /** * Function descriptor for: * {@snippet lang=c : - * struct namespace_MyIterator_next_result namespace_MyIterator_next(MyIterator *self) + * Float64Vec *Float64Vec_new_isize(const intptr_t *v_data, size_t v_len) * } */ - public static FunctionDescriptor namespace_MyIterator_next$descriptor() { - return namespace_MyIterator_next.DESC; + public static FunctionDescriptor Float64Vec_new_isize$descriptor() { + return Float64Vec_new_isize.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * struct namespace_MyIterator_next_result namespace_MyIterator_next(MyIterator *self) + * Float64Vec *Float64Vec_new_isize(const intptr_t *v_data, size_t v_len) * } */ - public static MethodHandle namespace_MyIterator_next$handle() { - return namespace_MyIterator_next.HANDLE; + public static MethodHandle Float64Vec_new_isize$handle() { + return Float64Vec_new_isize.HANDLE; } /** * Address for: * {@snippet lang=c : - * struct namespace_MyIterator_next_result namespace_MyIterator_next(MyIterator *self) + * Float64Vec *Float64Vec_new_isize(const intptr_t *v_data, size_t v_len) * } */ - public static MemorySegment namespace_MyIterator_next$address() { - return namespace_MyIterator_next.ADDR; + public static MemorySegment Float64Vec_new_isize$address() { + return Float64Vec_new_isize.ADDR; } /** * {@snippet lang=c : - * struct namespace_MyIterator_next_result namespace_MyIterator_next(MyIterator *self) + * Float64Vec *Float64Vec_new_isize(const intptr_t *v_data, size_t v_len) * } */ - public static MemorySegment namespace_MyIterator_next(SegmentAllocator allocator, MemorySegment self) { - var mh$ = namespace_MyIterator_next.HANDLE; + public static MemorySegment Float64Vec_new_isize(MemorySegment v_data, long v_len) { + var mh$ = Float64Vec_new_isize.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("namespace_MyIterator_next", allocator, self); + traceDowncall("Float64Vec_new_isize", v_data, v_len); } - return (MemorySegment)mh$.invokeExact(allocator, self); + return (MemorySegment)mh$.invokeExact(v_data, v_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class namespace_MyIterator_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER + private static class Float64Vec_new_usize { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_MyIterator_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_usize"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -17101,57 +17315,58 @@ private static class namespace_MyIterator_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void namespace_MyIterator_destroy(MyIterator *self) + * Float64Vec *Float64Vec_new_usize(const size_t *v_data, size_t v_len) * } */ - public static FunctionDescriptor namespace_MyIterator_destroy$descriptor() { - return namespace_MyIterator_destroy.DESC; + public static FunctionDescriptor Float64Vec_new_usize$descriptor() { + return Float64Vec_new_usize.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void namespace_MyIterator_destroy(MyIterator *self) + * Float64Vec *Float64Vec_new_usize(const size_t *v_data, size_t v_len) * } */ - public static MethodHandle namespace_MyIterator_destroy$handle() { - return namespace_MyIterator_destroy.HANDLE; + public static MethodHandle Float64Vec_new_usize$handle() { + return Float64Vec_new_usize.HANDLE; } /** * Address for: * {@snippet lang=c : - * void namespace_MyIterator_destroy(MyIterator *self) + * Float64Vec *Float64Vec_new_usize(const size_t *v_data, size_t v_len) * } */ - public static MemorySegment namespace_MyIterator_destroy$address() { - return namespace_MyIterator_destroy.ADDR; + public static MemorySegment Float64Vec_new_usize$address() { + return Float64Vec_new_usize.ADDR; } /** * {@snippet lang=c : - * void namespace_MyIterator_destroy(MyIterator *self) + * Float64Vec *Float64Vec_new_usize(const size_t *v_data, size_t v_len) * } */ - public static void namespace_MyIterator_destroy(MemorySegment self) { - var mh$ = namespace_MyIterator_destroy.HANDLE; + public static MemorySegment Float64Vec_new_usize(MemorySegment v_data, long v_len) { + var mh$ = Float64Vec_new_usize.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("namespace_MyIterator_destroy", self); + traceDowncall("Float64Vec_new_usize", v_data, v_len); } - mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(v_data, v_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OptionOpaque_new { + private static class Float64Vec_new_f64_be_bytes { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - somelib_h.C_INT + somelib_h.C_POINTER, + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaque_new"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_f64_be_bytes"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -17159,197 +17374,115 @@ private static class OptionOpaque_new { /** * Function descriptor for: * {@snippet lang=c : - * OptionOpaque *OptionOpaque_new(int32_t i) + * Float64Vec *Float64Vec_new_f64_be_bytes(const uint8_t *v_data, size_t v_len) * } */ - public static FunctionDescriptor OptionOpaque_new$descriptor() { - return OptionOpaque_new.DESC; + public static FunctionDescriptor Float64Vec_new_f64_be_bytes$descriptor() { + return Float64Vec_new_f64_be_bytes.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * OptionOpaque *OptionOpaque_new(int32_t i) + * Float64Vec *Float64Vec_new_f64_be_bytes(const uint8_t *v_data, size_t v_len) * } */ - public static MethodHandle OptionOpaque_new$handle() { - return OptionOpaque_new.HANDLE; + public static MethodHandle Float64Vec_new_f64_be_bytes$handle() { + return Float64Vec_new_f64_be_bytes.HANDLE; } /** * Address for: * {@snippet lang=c : - * OptionOpaque *OptionOpaque_new(int32_t i) + * Float64Vec *Float64Vec_new_f64_be_bytes(const uint8_t *v_data, size_t v_len) * } */ - public static MemorySegment OptionOpaque_new$address() { - return OptionOpaque_new.ADDR; + public static MemorySegment Float64Vec_new_f64_be_bytes$address() { + return Float64Vec_new_f64_be_bytes.ADDR; } /** * {@snippet lang=c : - * OptionOpaque *OptionOpaque_new(int32_t i) + * Float64Vec *Float64Vec_new_f64_be_bytes(const uint8_t *v_data, size_t v_len) * } */ - public static MemorySegment OptionOpaque_new(int i) { - var mh$ = OptionOpaque_new.HANDLE; + public static MemorySegment Float64Vec_new_f64_be_bytes(MemorySegment v_data, long v_len) { + var mh$ = Float64Vec_new_f64_be_bytes.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OptionOpaque_new", i); + traceDowncall("Float64Vec_new_f64_be_bytes", v_data, v_len); } - return (MemorySegment)mh$.invokeExact(i); + return (MemorySegment)mh$.invokeExact(v_data, v_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } + private static class Float64Vec_as_boxed_slice { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + DiplomatF64View.layout(), + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_as_boxed_slice"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + /** - * Variadic invoker class for: + * Function descriptor for: * {@snippet lang=c : - * OptionOpaque *OptionOpaque_new_none() + * DiplomatF64View Float64Vec_as_boxed_slice(const Float64Vec *self) * } */ - public static class OptionOpaque_new_none { - private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - somelib_h.C_POINTER ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaque_new_none"); - - private final MethodHandle handle; - private final FunctionDescriptor descriptor; - private final MethodHandle spreader; - - private OptionOpaque_new_none(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { - this.handle = handle; - this.descriptor = descriptor; - this.spreader = spreader; - } - - /** - * Variadic invoker factory for: - * {@snippet lang=c : - * OptionOpaque *OptionOpaque_new_none() - * } - */ - public static OptionOpaque_new_none makeInvoker(MemoryLayout... layouts) { - FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); - Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); - var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); - var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new OptionOpaque_new_none(mh$, desc$, spreader$); - } - - /** - * {@return the address} - */ - public static MemorySegment address() { - return ADDR; - } - - /** - * {@return the specialized method handle} - */ - public MethodHandle handle() { - return handle; - } - - /** - * {@return the specialized descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } - - public MemorySegment apply(Object... x0) { - try { - if (TRACE_DOWNCALLS) { - traceDowncall("OptionOpaque_new_none", x0); - } - return (MemorySegment)spreader.invokeExact(x0); - } catch(IllegalArgumentException | ClassCastException ex$) { - throw ex$; // rethrow IAE from passing wrong number/type of args - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } + public static FunctionDescriptor Float64Vec_as_boxed_slice$descriptor() { + return Float64Vec_as_boxed_slice.DESC; } /** - * Variadic invoker class for: + * Downcall method handle for: * {@snippet lang=c : - * struct OptionOpaque_returns_result OptionOpaque_returns() + * DiplomatF64View Float64Vec_as_boxed_slice(const Float64Vec *self) * } */ - public static class OptionOpaque_returns { - private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - OptionOpaque_returns_result.layout() ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaque_returns"); - - private final MethodHandle handle; - private final FunctionDescriptor descriptor; - private final MethodHandle spreader; - - private OptionOpaque_returns(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { - this.handle = handle; - this.descriptor = descriptor; - this.spreader = spreader; - } - - /** - * Variadic invoker factory for: - * {@snippet lang=c : - * struct OptionOpaque_returns_result OptionOpaque_returns() - * } - */ - public static OptionOpaque_returns makeInvoker(MemoryLayout... layouts) { - FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); - Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); - var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); - var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new OptionOpaque_returns(mh$, desc$, spreader$); - } - - /** - * {@return the address} - */ - public static MemorySegment address() { - return ADDR; - } - - /** - * {@return the specialized method handle} - */ - public MethodHandle handle() { - return handle; - } + public static MethodHandle Float64Vec_as_boxed_slice$handle() { + return Float64Vec_as_boxed_slice.HANDLE; + } - /** - * {@return the specialized descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } + /** + * Address for: + * {@snippet lang=c : + * DiplomatF64View Float64Vec_as_boxed_slice(const Float64Vec *self) + * } + */ + public static MemorySegment Float64Vec_as_boxed_slice$address() { + return Float64Vec_as_boxed_slice.ADDR; + } - public MemorySegment apply(SegmentAllocator allocator, Object... x0) { - try { - if (TRACE_DOWNCALLS) { - traceDowncall("OptionOpaque_returns", allocator, x0); - } - return (MemorySegment)spreader.invokeExact(allocator, x0); - } catch(IllegalArgumentException | ClassCastException ex$) { - throw ex$; // rethrow IAE from passing wrong number/type of args - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); + /** + * {@snippet lang=c : + * DiplomatF64View Float64Vec_as_boxed_slice(const Float64Vec *self) + * } + */ + public static MemorySegment Float64Vec_as_boxed_slice(SegmentAllocator allocator, MemorySegment self) { + var mh$ = Float64Vec_as_boxed_slice.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Float64Vec_as_boxed_slice", allocator, self); } + return (MemorySegment)mh$.invokeExact(allocator, self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); } } - private static class OptionOpaque_option_isize { + private static class Float64Vec_as_slice { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - OptionOpaque_option_isize_result.layout(), + DiplomatF64View.layout(), somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaque_option_isize"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_as_slice"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -17357,43 +17490,43 @@ private static class OptionOpaque_option_isize { /** * Function descriptor for: * {@snippet lang=c : - * struct OptionOpaque_option_isize_result OptionOpaque_option_isize(const OptionOpaque *self) + * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) * } */ - public static FunctionDescriptor OptionOpaque_option_isize$descriptor() { - return OptionOpaque_option_isize.DESC; + public static FunctionDescriptor Float64Vec_as_slice$descriptor() { + return Float64Vec_as_slice.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * struct OptionOpaque_option_isize_result OptionOpaque_option_isize(const OptionOpaque *self) + * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) * } */ - public static MethodHandle OptionOpaque_option_isize$handle() { - return OptionOpaque_option_isize.HANDLE; + public static MethodHandle Float64Vec_as_slice$handle() { + return Float64Vec_as_slice.HANDLE; } /** * Address for: * {@snippet lang=c : - * struct OptionOpaque_option_isize_result OptionOpaque_option_isize(const OptionOpaque *self) + * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) * } */ - public static MemorySegment OptionOpaque_option_isize$address() { - return OptionOpaque_option_isize.ADDR; + public static MemorySegment Float64Vec_as_slice$address() { + return Float64Vec_as_slice.ADDR; } /** * {@snippet lang=c : - * struct OptionOpaque_option_isize_result OptionOpaque_option_isize(const OptionOpaque *self) + * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) * } */ - public static MemorySegment OptionOpaque_option_isize(SegmentAllocator allocator, MemorySegment self) { - var mh$ = OptionOpaque_option_isize.HANDLE; + public static MemorySegment Float64Vec_as_slice(SegmentAllocator allocator, MemorySegment self) { + var mh$ = Float64Vec_as_slice.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OptionOpaque_option_isize", allocator, self); + traceDowncall("Float64Vec_as_slice", allocator, self); } return (MemorySegment)mh$.invokeExact(allocator, self); } catch (Throwable ex$) { @@ -17401,13 +17534,14 @@ public static MemorySegment OptionOpaque_option_isize(SegmentAllocator allocator } } - private static class OptionOpaque_option_usize { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - OptionOpaque_option_usize_result.layout(), - somelib_h.C_POINTER + private static class Float64Vec_fill_slice { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaque_option_usize"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_fill_slice"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -17415,57 +17549,58 @@ private static class OptionOpaque_option_usize { /** * Function descriptor for: * {@snippet lang=c : - * struct OptionOpaque_option_usize_result OptionOpaque_option_usize(const OptionOpaque *self) + * void Float64Vec_fill_slice(const Float64Vec *self, double *v_data, size_t v_len) * } */ - public static FunctionDescriptor OptionOpaque_option_usize$descriptor() { - return OptionOpaque_option_usize.DESC; + public static FunctionDescriptor Float64Vec_fill_slice$descriptor() { + return Float64Vec_fill_slice.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * struct OptionOpaque_option_usize_result OptionOpaque_option_usize(const OptionOpaque *self) + * void Float64Vec_fill_slice(const Float64Vec *self, double *v_data, size_t v_len) * } */ - public static MethodHandle OptionOpaque_option_usize$handle() { - return OptionOpaque_option_usize.HANDLE; + public static MethodHandle Float64Vec_fill_slice$handle() { + return Float64Vec_fill_slice.HANDLE; } /** * Address for: * {@snippet lang=c : - * struct OptionOpaque_option_usize_result OptionOpaque_option_usize(const OptionOpaque *self) + * void Float64Vec_fill_slice(const Float64Vec *self, double *v_data, size_t v_len) * } */ - public static MemorySegment OptionOpaque_option_usize$address() { - return OptionOpaque_option_usize.ADDR; + public static MemorySegment Float64Vec_fill_slice$address() { + return Float64Vec_fill_slice.ADDR; } /** * {@snippet lang=c : - * struct OptionOpaque_option_usize_result OptionOpaque_option_usize(const OptionOpaque *self) + * void Float64Vec_fill_slice(const Float64Vec *self, double *v_data, size_t v_len) * } */ - public static MemorySegment OptionOpaque_option_usize(SegmentAllocator allocator, MemorySegment self) { - var mh$ = OptionOpaque_option_usize.HANDLE; + public static void Float64Vec_fill_slice(MemorySegment self, MemorySegment v_data, long v_len) { + var mh$ = Float64Vec_fill_slice.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OptionOpaque_option_usize", allocator, self); + traceDowncall("Float64Vec_fill_slice", self, v_data, v_len); } - return (MemorySegment)mh$.invokeExact(allocator, self); + mh$.invokeExact(self, v_data, v_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OptionOpaque_option_i32 { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - OptionOpaque_option_i32_result.layout(), - somelib_h.C_POINTER + private static class Float64Vec_set_value { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaque_option_i32"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_set_value"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -17473,57 +17608,57 @@ private static class OptionOpaque_option_i32 { /** * Function descriptor for: * {@snippet lang=c : - * struct OptionOpaque_option_i32_result OptionOpaque_option_i32(const OptionOpaque *self) + * void Float64Vec_set_value(Float64Vec *self, const double *new_slice_data, size_t new_slice_len) * } */ - public static FunctionDescriptor OptionOpaque_option_i32$descriptor() { - return OptionOpaque_option_i32.DESC; + public static FunctionDescriptor Float64Vec_set_value$descriptor() { + return Float64Vec_set_value.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * struct OptionOpaque_option_i32_result OptionOpaque_option_i32(const OptionOpaque *self) + * void Float64Vec_set_value(Float64Vec *self, const double *new_slice_data, size_t new_slice_len) * } */ - public static MethodHandle OptionOpaque_option_i32$handle() { - return OptionOpaque_option_i32.HANDLE; + public static MethodHandle Float64Vec_set_value$handle() { + return Float64Vec_set_value.HANDLE; } /** * Address for: * {@snippet lang=c : - * struct OptionOpaque_option_i32_result OptionOpaque_option_i32(const OptionOpaque *self) + * void Float64Vec_set_value(Float64Vec *self, const double *new_slice_data, size_t new_slice_len) * } */ - public static MemorySegment OptionOpaque_option_i32$address() { - return OptionOpaque_option_i32.ADDR; + public static MemorySegment Float64Vec_set_value$address() { + return Float64Vec_set_value.ADDR; } /** * {@snippet lang=c : - * struct OptionOpaque_option_i32_result OptionOpaque_option_i32(const OptionOpaque *self) + * void Float64Vec_set_value(Float64Vec *self, const double *new_slice_data, size_t new_slice_len) * } */ - public static MemorySegment OptionOpaque_option_i32(SegmentAllocator allocator, MemorySegment self) { - var mh$ = OptionOpaque_option_i32.HANDLE; + public static void Float64Vec_set_value(MemorySegment self, MemorySegment new_slice_data, long new_slice_len) { + var mh$ = Float64Vec_set_value.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OptionOpaque_option_i32", allocator, self); + traceDowncall("Float64Vec_set_value", self, new_slice_data, new_slice_len); } - return (MemorySegment)mh$.invokeExact(allocator, self); + mh$.invokeExact(self, new_slice_data, new_slice_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OptionOpaque_option_u32 { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - OptionOpaque_option_u32_result.layout(), + private static class Float64Vec_to_string { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaque_option_u32"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_to_string"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -17531,197 +17666,116 @@ private static class OptionOpaque_option_u32 { /** * Function descriptor for: * {@snippet lang=c : - * struct OptionOpaque_option_u32_result OptionOpaque_option_u32(const OptionOpaque *self) + * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) * } */ - public static FunctionDescriptor OptionOpaque_option_u32$descriptor() { - return OptionOpaque_option_u32.DESC; + public static FunctionDescriptor Float64Vec_to_string$descriptor() { + return Float64Vec_to_string.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * struct OptionOpaque_option_u32_result OptionOpaque_option_u32(const OptionOpaque *self) + * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) * } */ - public static MethodHandle OptionOpaque_option_u32$handle() { - return OptionOpaque_option_u32.HANDLE; + public static MethodHandle Float64Vec_to_string$handle() { + return Float64Vec_to_string.HANDLE; } /** * Address for: * {@snippet lang=c : - * struct OptionOpaque_option_u32_result OptionOpaque_option_u32(const OptionOpaque *self) + * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) * } */ - public static MemorySegment OptionOpaque_option_u32$address() { - return OptionOpaque_option_u32.ADDR; + public static MemorySegment Float64Vec_to_string$address() { + return Float64Vec_to_string.ADDR; } /** * {@snippet lang=c : - * struct OptionOpaque_option_u32_result OptionOpaque_option_u32(const OptionOpaque *self) + * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) * } */ - public static MemorySegment OptionOpaque_option_u32(SegmentAllocator allocator, MemorySegment self) { - var mh$ = OptionOpaque_option_u32.HANDLE; + public static void Float64Vec_to_string(MemorySegment self, MemorySegment write) { + var mh$ = Float64Vec_to_string.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OptionOpaque_option_u32", allocator, self); + traceDowncall("Float64Vec_to_string", self, write); } - return (MemorySegment)mh$.invokeExact(allocator, self); + mh$.invokeExact(self, write); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } + private static class Float64Vec_borrow { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + DiplomatF64View.layout(), + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_borrow"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + /** - * Variadic invoker class for: + * Function descriptor for: * {@snippet lang=c : - * OptionStruct OptionOpaque_new_struct() + * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) * } */ - public static class OptionOpaque_new_struct { - private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - OptionStruct.layout() ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaque_new_struct"); - - private final MethodHandle handle; - private final FunctionDescriptor descriptor; - private final MethodHandle spreader; - - private OptionOpaque_new_struct(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { - this.handle = handle; - this.descriptor = descriptor; - this.spreader = spreader; - } - - /** - * Variadic invoker factory for: - * {@snippet lang=c : - * OptionStruct OptionOpaque_new_struct() - * } - */ - public static OptionOpaque_new_struct makeInvoker(MemoryLayout... layouts) { - FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); - Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); - var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); - var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new OptionOpaque_new_struct(mh$, desc$, spreader$); - } - - /** - * {@return the address} - */ - public static MemorySegment address() { - return ADDR; - } - - /** - * {@return the specialized method handle} - */ - public MethodHandle handle() { - return handle; - } - - /** - * {@return the specialized descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } + public static FunctionDescriptor Float64Vec_borrow$descriptor() { + return Float64Vec_borrow.DESC; + } - public MemorySegment apply(SegmentAllocator allocator, Object... x0) { - try { - if (TRACE_DOWNCALLS) { - traceDowncall("OptionOpaque_new_struct", allocator, x0); - } - return (MemorySegment)spreader.invokeExact(allocator, x0); - } catch(IllegalArgumentException | ClassCastException ex$) { - throw ex$; // rethrow IAE from passing wrong number/type of args - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } + /** + * Downcall method handle for: + * {@snippet lang=c : + * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) + * } + */ + public static MethodHandle Float64Vec_borrow$handle() { + return Float64Vec_borrow.HANDLE; } /** - * Variadic invoker class for: + * Address for: * {@snippet lang=c : - * OptionStruct OptionOpaque_new_struct_nones() + * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) * } */ - public static class OptionOpaque_new_struct_nones { - private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - OptionStruct.layout() ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaque_new_struct_nones"); - - private final MethodHandle handle; - private final FunctionDescriptor descriptor; - private final MethodHandle spreader; - - private OptionOpaque_new_struct_nones(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { - this.handle = handle; - this.descriptor = descriptor; - this.spreader = spreader; - } - - /** - * Variadic invoker factory for: - * {@snippet lang=c : - * OptionStruct OptionOpaque_new_struct_nones() - * } - */ - public static OptionOpaque_new_struct_nones makeInvoker(MemoryLayout... layouts) { - FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); - Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); - var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); - var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new OptionOpaque_new_struct_nones(mh$, desc$, spreader$); - } - - /** - * {@return the address} - */ - public static MemorySegment address() { - return ADDR; - } - - /** - * {@return the specialized method handle} - */ - public MethodHandle handle() { - return handle; - } - - /** - * {@return the specialized descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } + public static MemorySegment Float64Vec_borrow$address() { + return Float64Vec_borrow.ADDR; + } - public MemorySegment apply(SegmentAllocator allocator, Object... x0) { - try { - if (TRACE_DOWNCALLS) { - traceDowncall("OptionOpaque_new_struct_nones", allocator, x0); - } - return (MemorySegment)spreader.invokeExact(allocator, x0); - } catch(IllegalArgumentException | ClassCastException ex$) { - throw ex$; // rethrow IAE from passing wrong number/type of args - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); + /** + * {@snippet lang=c : + * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) + * } + */ + public static MemorySegment Float64Vec_borrow(SegmentAllocator allocator, MemorySegment self) { + var mh$ = Float64Vec_borrow.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Float64Vec_borrow", allocator, self); } + return (MemorySegment)mh$.invokeExact(allocator, self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); } } - private static class OptionOpaque_assert_integer { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class Float64Vec_get { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + Float64Vec_get_result.layout(), somelib_h.C_POINTER, - somelib_h.C_INT + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaque_assert_integer"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_get"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -17729,57 +17783,56 @@ private static class OptionOpaque_assert_integer { /** * Function descriptor for: * {@snippet lang=c : - * void OptionOpaque_assert_integer(const OptionOpaque *self, int32_t i) + * struct Float64Vec_get_result Float64Vec_get(const Float64Vec *self, size_t i) * } */ - public static FunctionDescriptor OptionOpaque_assert_integer$descriptor() { - return OptionOpaque_assert_integer.DESC; + public static FunctionDescriptor Float64Vec_get$descriptor() { + return Float64Vec_get.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void OptionOpaque_assert_integer(const OptionOpaque *self, int32_t i) + * struct Float64Vec_get_result Float64Vec_get(const Float64Vec *self, size_t i) * } */ - public static MethodHandle OptionOpaque_assert_integer$handle() { - return OptionOpaque_assert_integer.HANDLE; + public static MethodHandle Float64Vec_get$handle() { + return Float64Vec_get.HANDLE; } /** * Address for: * {@snippet lang=c : - * void OptionOpaque_assert_integer(const OptionOpaque *self, int32_t i) + * struct Float64Vec_get_result Float64Vec_get(const Float64Vec *self, size_t i) * } */ - public static MemorySegment OptionOpaque_assert_integer$address() { - return OptionOpaque_assert_integer.ADDR; + public static MemorySegment Float64Vec_get$address() { + return Float64Vec_get.ADDR; } /** * {@snippet lang=c : - * void OptionOpaque_assert_integer(const OptionOpaque *self, int32_t i) + * struct Float64Vec_get_result Float64Vec_get(const Float64Vec *self, size_t i) * } */ - public static void OptionOpaque_assert_integer(MemorySegment self, int i) { - var mh$ = OptionOpaque_assert_integer.HANDLE; + public static MemorySegment Float64Vec_get(SegmentAllocator allocator, MemorySegment self, long i) { + var mh$ = Float64Vec_get.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OptionOpaque_assert_integer", self, i); + traceDowncall("Float64Vec_get", allocator, self, i); } - mh$.invokeExact(self, i); + return (MemorySegment)mh$.invokeExact(allocator, self, i); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OptionOpaque_option_opaque_argument { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_BOOL, + private static class Float64Vec_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaque_option_opaque_argument"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -17787,56 +17840,61 @@ private static class OptionOpaque_option_opaque_argument { /** * Function descriptor for: * {@snippet lang=c : - * bool OptionOpaque_option_opaque_argument(const OptionOpaque *arg) + * void Float64Vec_destroy(Float64Vec *self) * } */ - public static FunctionDescriptor OptionOpaque_option_opaque_argument$descriptor() { - return OptionOpaque_option_opaque_argument.DESC; + public static FunctionDescriptor Float64Vec_destroy$descriptor() { + return Float64Vec_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * bool OptionOpaque_option_opaque_argument(const OptionOpaque *arg) + * void Float64Vec_destroy(Float64Vec *self) * } */ - public static MethodHandle OptionOpaque_option_opaque_argument$handle() { - return OptionOpaque_option_opaque_argument.HANDLE; + public static MethodHandle Float64Vec_destroy$handle() { + return Float64Vec_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * bool OptionOpaque_option_opaque_argument(const OptionOpaque *arg) + * void Float64Vec_destroy(Float64Vec *self) * } */ - public static MemorySegment OptionOpaque_option_opaque_argument$address() { - return OptionOpaque_option_opaque_argument.ADDR; + public static MemorySegment Float64Vec_destroy$address() { + return Float64Vec_destroy.ADDR; } /** * {@snippet lang=c : - * bool OptionOpaque_option_opaque_argument(const OptionOpaque *arg) + * void Float64Vec_destroy(Float64Vec *self) * } */ - public static boolean OptionOpaque_option_opaque_argument(MemorySegment arg) { - var mh$ = OptionOpaque_option_opaque_argument.HANDLE; + public static void Float64Vec_destroy(MemorySegment self) { + var mh$ = Float64Vec_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OptionOpaque_option_opaque_argument", arg); + traceDowncall("Float64Vec_destroy", self); } - return (boolean)mh$.invokeExact(arg); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OptionOpaque_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER + private static class BorrowedFieldsWithBounds_from_foo_and_strings { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + BorrowedFieldsWithBounds.layout(), + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG, + somelib_h.C_POINTER, + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaque_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("BorrowedFieldsWithBounds_from_foo_and_strings"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -17844,57 +17902,57 @@ private static class OptionOpaque_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void OptionOpaque_destroy(OptionOpaque *self) + * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char *utf8_str_z_data, size_t utf8_str_z_len) * } */ - public static FunctionDescriptor OptionOpaque_destroy$descriptor() { - return OptionOpaque_destroy.DESC; + public static FunctionDescriptor BorrowedFieldsWithBounds_from_foo_and_strings$descriptor() { + return BorrowedFieldsWithBounds_from_foo_and_strings.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void OptionOpaque_destroy(OptionOpaque *self) + * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char *utf8_str_z_data, size_t utf8_str_z_len) * } */ - public static MethodHandle OptionOpaque_destroy$handle() { - return OptionOpaque_destroy.HANDLE; + public static MethodHandle BorrowedFieldsWithBounds_from_foo_and_strings$handle() { + return BorrowedFieldsWithBounds_from_foo_and_strings.HANDLE; } /** * Address for: * {@snippet lang=c : - * void OptionOpaque_destroy(OptionOpaque *self) + * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char *utf8_str_z_data, size_t utf8_str_z_len) * } */ - public static MemorySegment OptionOpaque_destroy$address() { - return OptionOpaque_destroy.ADDR; + public static MemorySegment BorrowedFieldsWithBounds_from_foo_and_strings$address() { + return BorrowedFieldsWithBounds_from_foo_and_strings.ADDR; } /** * {@snippet lang=c : - * void OptionOpaque_destroy(OptionOpaque *self) + * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char *utf8_str_z_data, size_t utf8_str_z_len) * } */ - public static void OptionOpaque_destroy(MemorySegment self) { - var mh$ = OptionOpaque_destroy.HANDLE; + public static MemorySegment BorrowedFieldsWithBounds_from_foo_and_strings(SegmentAllocator allocator, MemorySegment foo, MemorySegment dstr16_x_data, long dstr16_x_len, MemorySegment utf8_str_z_data, long utf8_str_z_len) { + var mh$ = BorrowedFieldsWithBounds_from_foo_and_strings.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OptionOpaque_destroy", self); + traceDowncall("BorrowedFieldsWithBounds_from_foo_and_strings", allocator, foo, dstr16_x_data, dstr16_x_len, utf8_str_z_data, utf8_str_z_len); } - mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(allocator, foo, dstr16_x_data, dstr16_x_len, utf8_str_z_data, utf8_str_z_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Bar_foo { + private static class namespace_OpaqueIterator_next { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Bar_foo"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_OpaqueIterator_next"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -17902,43 +17960,43 @@ private static class Bar_foo { /** * Function descriptor for: * {@snippet lang=c : - * const Foo *Bar_foo(const Bar *self) + * AttrOpaque1 *namespace_OpaqueIterator_next(OpaqueIterator *self) * } */ - public static FunctionDescriptor Bar_foo$descriptor() { - return Bar_foo.DESC; + public static FunctionDescriptor namespace_OpaqueIterator_next$descriptor() { + return namespace_OpaqueIterator_next.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * const Foo *Bar_foo(const Bar *self) + * AttrOpaque1 *namespace_OpaqueIterator_next(OpaqueIterator *self) * } */ - public static MethodHandle Bar_foo$handle() { - return Bar_foo.HANDLE; + public static MethodHandle namespace_OpaqueIterator_next$handle() { + return namespace_OpaqueIterator_next.HANDLE; } /** * Address for: * {@snippet lang=c : - * const Foo *Bar_foo(const Bar *self) + * AttrOpaque1 *namespace_OpaqueIterator_next(OpaqueIterator *self) * } */ - public static MemorySegment Bar_foo$address() { - return Bar_foo.ADDR; + public static MemorySegment namespace_OpaqueIterator_next$address() { + return namespace_OpaqueIterator_next.ADDR; } /** * {@snippet lang=c : - * const Foo *Bar_foo(const Bar *self) + * AttrOpaque1 *namespace_OpaqueIterator_next(OpaqueIterator *self) * } */ - public static MemorySegment Bar_foo(MemorySegment self) { - var mh$ = Bar_foo.HANDLE; + public static MemorySegment namespace_OpaqueIterator_next(MemorySegment self) { + var mh$ = namespace_OpaqueIterator_next.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Bar_foo", self); + traceDowncall("namespace_OpaqueIterator_next", self); } return (MemorySegment)mh$.invokeExact(self); } catch (Throwable ex$) { @@ -17946,12 +18004,12 @@ public static MemorySegment Bar_foo(MemorySegment self) { } } - private static class Bar_destroy { + private static class namespace_OpaqueIterator_destroy { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Bar_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_OpaqueIterator_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -17959,43 +18017,43 @@ private static class Bar_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void Bar_destroy(Bar *self) + * void namespace_OpaqueIterator_destroy(OpaqueIterator *self) * } */ - public static FunctionDescriptor Bar_destroy$descriptor() { - return Bar_destroy.DESC; + public static FunctionDescriptor namespace_OpaqueIterator_destroy$descriptor() { + return namespace_OpaqueIterator_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Bar_destroy(Bar *self) + * void namespace_OpaqueIterator_destroy(OpaqueIterator *self) * } */ - public static MethodHandle Bar_destroy$handle() { - return Bar_destroy.HANDLE; + public static MethodHandle namespace_OpaqueIterator_destroy$handle() { + return namespace_OpaqueIterator_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Bar_destroy(Bar *self) + * void namespace_OpaqueIterator_destroy(OpaqueIterator *self) * } */ - public static MemorySegment Bar_destroy$address() { - return Bar_destroy.ADDR; + public static MemorySegment namespace_OpaqueIterator_destroy$address() { + return namespace_OpaqueIterator_destroy.ADDR; } /** * {@snippet lang=c : - * void Bar_destroy(Bar *self) + * void namespace_OpaqueIterator_destroy(OpaqueIterator *self) * } */ - public static void Bar_destroy(MemorySegment self) { - var mh$ = Bar_destroy.HANDLE; + public static void namespace_OpaqueIterator_destroy(MemorySegment self) { + var mh$ = namespace_OpaqueIterator_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Bar_destroy", self); + traceDowncall("namespace_OpaqueIterator_destroy", self); } mh$.invokeExact(self); } catch (Throwable ex$) { diff --git a/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/OpaqueTest.java b/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/OpaqueTest.java index 0cf6ab6a1..2b62be0fb 100644 --- a/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/OpaqueTest.java +++ b/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/OpaqueTest.java @@ -10,16 +10,8 @@ class OpaqueTest { @Test void testOpaque() { - var opaque = new Opaque(); - - assert opaque.pointer() != 0L; - - try (var arena = Arena.ofConfined()) { - var myStruct = new MyStruct(arena); - opaque.assertStruct(myStruct); - } - - opaque.delete(); - assert true; + var input = "How do you do?"; + var opaque = Opaque.fromStr(input); + assertEquals(input.length() + 1, opaque.internalLen()); } } \ No newline at end of file diff --git a/feature_tests/src/structs.rs b/feature_tests/src/structs.rs index 8cd2704ca..d80c5067a 100644 --- a/feature_tests/src/structs.rs +++ b/feature_tests/src/structs.rs @@ -80,6 +80,10 @@ pub mod ffi { 412 } + pub fn internal_len(&self) -> usize { + self.0.len() + } + pub fn returns_imported() -> ImportedStruct { unimplemented!() } diff --git a/tool/src/java/README.md b/tool/src/java/README.md new file mode 100644 index 000000000..6e0e3530b --- /dev/null +++ b/tool/src/java/README.md @@ -0,0 +1,37 @@ +* slices appear to be passed as memory segments and lengths and not as slice structs +* structs and opaque are just memsegs which seem to be basically pointers +* some functions on Opaque types don't get generated call methods, only something to create an "invoker" +which must be called separately + + +## Invoker functions + +Only the following methods generate invokers. These are all of the zero argument functions. + +```rust +pub fn new_failing_foo() -> Result, ErrorEnum>; +pub fn new_failing_bar() -> Result, ErrorEnum>; +pub fn new_failing_unit() -> Result, ()>; +pub fn new_none() -> Option>; +pub fn returns() -> Option; +pub fn new_struct() -> OptionStruct; +pub fn new_struct_nones() -> OptionStruct; +pub fn new() -> MyStruct; +pub fn returns_zst_result() -> Result<(), MyZst>; +pub fn get_a() -> MyEnum; +pub fn new() -> Box; +pub fn returns_usize() -> usize; +pub fn returns_imported() -> ImportedStruct; +pub fn cmp() -> core::cmp::Ordering; +pub fn new() -> Box; +``` +for comparison the method +```rust +pub fn method(&self) -> u8; +``` +generates a method +```java +public static byte namespace_AttrOpaque1_method(MemorySegment self) { +``` + + diff --git a/tool/src/java/formatter.rs b/tool/src/java/formatter.rs new file mode 100644 index 000000000..04b70c46a --- /dev/null +++ b/tool/src/java/formatter.rs @@ -0,0 +1,106 @@ +use std::borrow::Cow; + +use diplomat_core::{ + ast::Ident, + hir::{ + self, FloatType, IntType, OutType, PrimitiveType, ReturnType, Slice, SuccessType, + TyPosition, Type, TypeContext, TypeId, + }, +}; +use heck::ToLowerCamelCase; + +use crate::c2::CFormatter; + +pub(crate) struct JavaFormatter<'cx> { + tcx: &'cx TypeContext, + c: CFormatter<'cx>, +} + +const INVALID_METHOD_NAMES: &[&str] = &[ + "new", "static", "default", "private", "internal", "toString", +]; + +const DISALLOWED_CORE_TYPES: &[&str] = &["Object", "String"]; + +impl<'cx> JavaFormatter<'cx> { + pub fn new(tcx: &'cx TypeContext) -> Self { + Self { + tcx, + c: CFormatter::new(tcx), + } + } + + pub fn fmt_c_method_name<'a>(&self, ty: TypeId, method: &'a hir::Method) -> Cow<'a, str> { + self.c.fmt_method_name(ty, method).into() + } + + pub fn fmt_method_name<'a>(&self, method: &'a hir::Method) -> Cow<'a, str> { + let name = method.name.as_str().to_lower_camel_case(); + let name = method.attrs.rename.apply(name.into()); + if INVALID_METHOD_NAMES.contains(&&*name) { + format!("{name}_").into() + } else { + name + } + } + + pub fn fmt_return_type_java<'a>(&self, return_ty: &'a ReturnType) -> Cow<'a, str> { + match return_ty { + ReturnType::Infallible(ref success) => self.fmt_success_type_java(success), + ReturnType::Fallible(_, _) => todo!(), + ReturnType::Nullable(_) => todo!(), + } + } + + pub fn fmt_success_type_java<'a>(&self, success_ty: &'a SuccessType) -> Cow<'a, str> { + match success_ty { + SuccessType::Write => todo!(), + SuccessType::OutType(ref o) => self.fmt_java_type(o), + SuccessType::Unit => todo!(), + _ => todo!(), + } + } + + pub fn fmt_native_type<'a, P: TyPosition>(&self, ty: &'a Type

) -> Cow<'a, str> { + match ty { + Type::Primitive(ref p) => self.fmt_primitive(p), + Type::Opaque(_) => todo!(), + Type::Struct(_) => todo!(), + Type::Enum(_) => todo!(), + Type::Slice(_) => todo!(), + _ => todo!(), + } + } + pub fn fmt_java_type<'a, P: TyPosition>(&self, ty: &'a Type

) -> Cow<'a, str> { + match ty { + hir::Type::Primitive(ref p) => self.fmt_primitive(p), + hir::Type::Opaque(o) => self.tcx.resolve_opaque(o.tcx_id).name.to_string().into(), + hir::Type::Struct(_) => todo!(), + hir::Type::Enum(e) => self.tcx.resolve_enum(e.tcx_id).name.to_string().into(), + hir::Type::Slice(Slice::Str(_, _)) => "String".into(), + hir::Type::Slice(_) => todo!("Need to work on slices"), + _ => todo!(), + } + } + + pub fn fmt_primitive<'a>(&self, ty: &'a PrimitiveType) -> Cow<'a, str> { + match ty { + PrimitiveType::Bool => "boolean", + PrimitiveType::Char => "int", + PrimitiveType::Byte => "byte", + PrimitiveType::Int(IntType::I8 | IntType::U8) => "byte", + PrimitiveType::Int(IntType::I16 | IntType::U16) => "short", + PrimitiveType::Int(IntType::I32 | IntType::U32) => "int", + PrimitiveType::Int(IntType::I64 | IntType::U64) => "long", + PrimitiveType::IntSize(_) => "long", + PrimitiveType::Int128(_) => panic!("128 not supported by java"), + PrimitiveType::Float(FloatType::F32) => "float", + PrimitiveType::Float(FloatType::F64) => "double", + } + .into() + } + + pub fn fmt_param_name(&self, name: &str) -> String { + name.to_lower_camel_case() + } +} diff --git a/tool/src/java/mod.rs b/tool/src/java/mod.rs index 55d0a19f4..8046444ba 100644 --- a/tool/src/java/mod.rs +++ b/tool/src/java/mod.rs @@ -1,20 +1,27 @@ +use std::borrow::Cow; use std::collections::HashSet; use std::fs::File; use std::io::Write; use std::path::Path; -use diplomat_core::hir::TypeContext; +use askama::Template; +use diplomat_core::hir::{ + self, OpaqueDef, ReturnType, Slice, SpecialMethod, StringEncoding, SuccessType, TypeContext, + TypeDef, TypeId, +}; +use formatter::JavaFormatter; -use crate::c2; -use crate::common::FileMap; +use crate::c2::{self}; +use crate::common::{ErrorStore, FileMap}; const TMP_C_DIR: &str = "tmp"; const LIBRARY: &str = "somelib"; // todo: build from conf. Ensure that name is not the same as any // type const GROUP: &str = "dev.diplomattest"; // todo: config -const TMP_LIB_NAME: &str = "dev/diplomattest/somelib"; // todo: build from conf -const JAVA_DIR: &str = "src/main/java/"; +const _TMP_LIB_NAME: &str = "dev/diplomattest/somelib"; // todo: build from conf +const _JAVA_DIR: &str = "src/main/java/"; +mod formatter; pub fn run( tcx: &TypeContext, _conf_path: Option<&Path>, @@ -99,6 +106,374 @@ pub fn run( } } + let java_formatter = JavaFormatter::new(tcx); + let formatter = &java_formatter; + let error_store = ErrorStore::default(); + let errors = &error_store; + + let ty_gen_cx = TyGenContext { + tcx, + formatter, + errors, + }; + let files = FileMap::default(); + for (id, ty) in tcx.all_types() { + let _guard = ty_gen_cx.errors.set_context_ty(ty.name().as_str().into()); + if ty.attrs().disable { + continue; + } + + match ty { + TypeDef::Opaque(o) => { + // let type_name = o.name.to_string(); + + // let (file_name, body) = ty_gen_cx.gen_opaque_def(o, id, GROUP, LIBRARY); + + // files.add_file(format!("src/main/kotlin/{file_name}"), body); + } + _ => continue, + } + } + Ok(files) } + +#[derive(Clone, Debug)] +struct Param<'a> { + name: Cow<'a, str>, + ty: Cow<'a, str>, +} + +#[derive(Clone, Debug)] +pub(crate) struct ParamConversion<'a> { + converted_value: Cow<'a, str>, + conversion_def: Cow<'a, str>, +} + +#[derive(Template, Clone, Debug)] +#[template(path = "java/Method.java.jinja", escape = "none")] +pub(crate) struct MethodTpl<'a> { + method_name: Option>, + is_static: bool, + return_ty: Cow<'a, str>, + native_method: Cow<'a, str>, + native_invocation: Cow<'a, str>, + params: Vec>, + param_conversions: Vec>, + return_conversion: Cow<'a, str>, + allocations: bool, +} + +#[derive(Template, Clone, Debug)] +#[template(path = "java/Opaque.java.jinja", escape = "none")] +pub(crate) struct OpaqueTypeTpl<'a> { + type_name: Cow<'a, str>, + lib_name: Cow<'a, str>, + domain: Cow<'a, str>, + static_methods: Vec>, + class_methods: Vec>, +} + +#[derive(Template, Clone, Debug)] +#[template(path = "java/OpaqueReturn.java.jinja", escape = "none")] +pub(crate) struct OpaqueReturnTpl<'a> { + return_ty: Cow<'a, str>, +} + +#[derive(Template, Clone, Debug)] +#[template(path = "java/OpaqueConstructor.java.jinja", escape = "none")] +pub(crate) struct OpaqueConstructorTpl<'a> { + return_ty: Cow<'a, str>, +} + +struct TyGenContext<'a, 'cx> { + tcx: &'cx TypeContext, + formatter: &'a JavaFormatter<'cx>, + errors: &'a ErrorStore<'cx, String>, +} + +impl<'a, 'cx> TyGenContext<'a, 'cx> { + fn gen_param_conversion<'b>( + &self, + param: &'b diplomat_core::hir::Param, + ) -> ParamConversion<'b> { + let diplomat_core::hir::Param { name, ty, .. } = param; + // let java_ty = self.formatter.fmt_java_type(ty); + let converted_value: Cow<'b, str> = format!("{name}Native").into(); + let (conversion, converted_value) = match ty { + hir::Type::Primitive(_) => (name.as_str().into(), converted_value), + hir::Type::Opaque(_) => (format!("{name}.inner").into(), converted_value), + hir::Type::Struct(_) => todo!(), + hir::Type::Enum(_) => todo!(), + hir::Type::Slice(Slice::Str(_, StringEncoding::UnvalidatedUtf8)) => ( + format!( + r#"var {name}MemSeg = arena.allocateFrom({name}, StandardCharsets.UTF_8); +var {name}Len = {name}MemSeg.byteSize();"# + ) + .into(), + format!("{name}MemSeg, {name}Len").into(), + ), + hir::Type::Slice(Slice::Str(_, StringEncoding::UnvalidatedUtf16)) => ( + format!( + r#"var {name}MemSeg = arena.allocateFrom({name}, StandardCharsets.UTF_16); +var {name}Len = {name}MemSeg.byteSize();"# + ) + .into(), + format!("{name}MemSeg, {name}Len").into(), + ), + hir::Type::Slice(Slice::Str(_, StringEncoding::Utf8)) => ( + format!( + r#"var {name}MemSeg = arena.allocateFrom({name}, StandardCharsets.UTF_8); +var {name}Len = {name}MemSeg.byteSize();"# + ) + .into(), + format!("{name}MemSeg, {name}Len").into(), + ), + _ => todo!(), + }; + ParamConversion { + converted_value, + conversion_def: conversion, + } + } + + fn gen_return_conversion(&self, ty: &ReturnType) -> Cow<'cx, str> { + let ret = match ty { + ReturnType::Infallible(ref ret) => ret, + ReturnType::Fallible(ref ret, _) => ret, + ReturnType::Nullable(ref ret) => ret, + }; + let o = match ret { + SuccessType::Write => return "".into(), + SuccessType::OutType(ref o) => o, + SuccessType::Unit => return "".into(), + _ => todo!(), + }; + match o { + hir::Type::Primitive(o) => "return nativeVal;".into(), + hir::Type::Opaque(o) => { + let ty_name = &self.tcx.resolve_opaque(o.tcx_id).name; + OpaqueReturnTpl { + return_ty: ty_name.as_str().into(), + } + .render() + .unwrap_or_else(|err| { + panic!( + "Failed to render return val for type {}. Cause: {err}", + ty_name + ) + }) + .into() + } + hir::Type::Struct(_) => todo!(), + hir::Type::Enum(_) => todo!(), + hir::Type::Slice(_) => todo!(), + _ => todo!(), + } + } + + fn gen_opaque_def( + &self, + o: &OpaqueDef, + ty: TypeId, + domain: &str, + lib_name: &str, + ) -> (Cow, String) { + let mut static_methods = Vec::new(); + let mut class_methods = Vec::new(); + for method in o.methods.iter() { + let method_name = match method.attrs.special_method { + // We need to reserve the default constructor for internal methods so a constructor + // must always have params + Some(SpecialMethod::Constructor) if !method.params.is_empty() => None, + Some(SpecialMethod::Constructor) => { + eprintln!( + "Attempted to create constructor for {:?} type {:?}", + method.name, o.name + ); + Some(self.formatter.fmt_method_name(method)) + } + _ => Some(self.formatter.fmt_method_name(method)), + }; + + let return_ty = self.formatter.fmt_return_type_java(&method.output); + let return_conversion = if method_name.is_none() { + OpaqueConstructorTpl { + return_ty: return_ty.clone(), + } + .render() + .unwrap_or_else(|err| { + panic!( + "Failed to render method {} for type {}. Cause: {err}", + method.name, o.name + ) + }) + .into() + } else { + self.gen_return_conversion(&method.output) + }; + + let allocations = + method + .params + .iter() + .any(|diplomat_core::hir::Param { ty, .. }| { + matches!(ty, diplomat_core::hir::Type::Slice(_)) + }); + let params = method + .params + .iter() + .map(|diplomat_core::hir::Param { name, ty, .. }| Param { + name: self.formatter.fmt_param_name(name.as_str()).into(), + ty: self.formatter.fmt_java_type(ty), + }) + .collect(); + let param_conversions: Vec<_> = method + .param_self + .iter() + .map(|_| ParamConversion { + converted_value: "internal".into(), + conversion_def: "".into(), + }) + .chain( + method + .params + .iter() + .map(|param| self.gen_param_conversion(param)), + ) + .collect(); + let native_method: Cow = format!( + "{lib_name}_h.{}", + self.formatter.fmt_c_method_name(ty, method) + ) + .into(); + let native_invocation = if param_conversions.is_empty() { + "nativeInvoker.apply".into() + } else { + native_method.clone() + }; + let method_rendered = MethodTpl { + method_name, + is_static: method.param_self.is_none(), + return_ty, + native_method, + native_invocation, + params, + param_conversions, + return_conversion, + allocations, + } + .render() + .unwrap_or_else(|err| { + panic!( + "Failed to render method {} for type {}. Cause: {err}", + method.name, o.name + ) + }); + + println!("HAve method!"); + println!("{method_rendered}"); + + match method.param_self { + Some(_) => class_methods.push(method_rendered.into()), + None => static_methods.push(method_rendered.into()), + } + } + + let opaque_tpl = OpaqueTypeTpl { + type_name: o.name.to_string().into(), + lib_name: lib_name.into(), + domain: domain.into(), + static_methods, + class_methods, + }; + + ( + format!("{}.java", o.name).into(), + opaque_tpl.render().expect("Failed to render opaque type"), + ) + } +} + +#[cfg(test)] +mod test { + + use askama::Template; + use diplomat_core::hir::TypeDef; + use quote::quote; + + use crate::{common::ErrorStore, test::new_tcx}; + + use super::{formatter::JavaFormatter, OpaqueTypeTpl, TyGenContext}; + #[test] + fn test_opaque_render() { + let opaque_type = OpaqueTypeTpl { + type_name: "Opaque2".into(), + lib_name: "somelib".into(), + domain: "dev.diplomattest".into(), + static_methods: Vec::new(), + class_methods: Vec::new(), + }; + + let rendered = opaque_type.render().expect("Failed to render opaque type"); + insta::assert_snapshot!(rendered); + } + + #[test] + fn test_opaque() { + let tk_stream = quote! { + #[diplomat::bridge] + mod ffi { + + #[diplomat::opaque] + pub struct Opaque(String); + + impl Opaque { + #[diplomat::attr(supports = constructors, constructor)] + pub fn new() -> Box { + Box::new(Opaque("".into())) + } + + pub fn from_str(input: &str) -> Box { + Box::new(Self(input.into())) + } + + + pub fn returns_usize() -> usize { + 412 + } + + pub fn internal_len(&self) -> usize { + self.0.len() + } + + } + } + }; + + let tcx = new_tcx(tk_stream); + + let formatter = JavaFormatter::new(&tcx); + + let errors = ErrorStore::default(); + let tcx_gen = TyGenContext { + tcx: &tcx, + formatter: &formatter, + errors: &errors, + }; + + let (ty, some_opaque) = tcx + .all_types() + .next() + .expect("Didn't find type despite there being one in quote"); + if let TypeDef::Opaque(opaque) = some_opaque { + println!("Found opaque"); + let (_, rendered) = tcx_gen.gen_opaque_def(opaque, ty, "dev.diplomattest", "somelib"); + + insta::assert_snapshot!(rendered); + } else { + panic!("Found type should have been opaque but wasn't"); + } + } +} diff --git a/tool/src/java/snapshots/diplomat_tool__java__test__opaque.snap b/tool/src/java/snapshots/diplomat_tool__java__test__opaque.snap new file mode 100644 index 000000000..61135fcd4 --- /dev/null +++ b/tool/src/java/snapshots/diplomat_tool__java__test__opaque.snap @@ -0,0 +1,69 @@ +--- +source: tool/src/java/mod.rs +expression: rendered +--- +package dev.diplomattest.somelib; + +import dev.diplomattest.somelib.ntv.*; + + +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; + + +public class Opaque { + + MemorySegment internal; + Cleaner.Cleanable cleanable; + + static class OpaqueCleaner implements Runnable { + + MemorySegment segment; + OpaqueCleaner(MemorySegment segment) { + this.segment = segment; + } + + public void run() { + somelib_h.Opaque_destroy(this.segment); + } + } + + Opaque() {} + + public static Opaque new_() { + var nativeInvoker = somelib_h.Opaque_new.makeInvoker(); + var nativeVal = nativeInvoker.apply(); + var returnVal = new Opaque(); + returnVal.internal = nativeVal; + var cleaner = new Opaque.OpaqueCleaner(nativeVal); + returnVal.cleanable = Main.cleaner.register(returnVal, cleaner); + return returnVal; + } + + public static Opaque fromStr(String input) { + try (var arena = Arena.ofConfined()) { + var inputMemSeg = arena.allocateFrom(input, StandardCharsets.UTF_8); + var inputLen = inputMemSeg.byteSize(); + var nativeVal = somelib_h.Opaque_from_str(inputMemSeg, inputLen); + var returnVal = new Opaque(); + returnVal.internal = nativeVal; + var cleaner = new Opaque.OpaqueCleaner(nativeVal); + returnVal.cleanable = Main.cleaner.register(returnVal, cleaner); + return returnVal; + } + } + + public static long returnsUsize() { + var nativeInvoker = somelib_h.Opaque_returns_usize.makeInvoker(); + var nativeVal = nativeInvoker.apply(); + return nativeVal; + } + + + public long internalLen() { + + var nativeVal = somelib_h.Opaque_internal_len(internal); + return nativeVal; + } + +} diff --git a/tool/src/java/snapshots/diplomat_tool__java__test__opaque_render.snap b/tool/src/java/snapshots/diplomat_tool__java__test__opaque_render.snap new file mode 100644 index 000000000..281c12c77 --- /dev/null +++ b/tool/src/java/snapshots/diplomat_tool__java__test__opaque_render.snap @@ -0,0 +1,34 @@ +--- +source: tool/src/java/mod.rs +expression: rendered +--- +package dev.diplomattest.somelib; + +import dev.diplomattest.somelib.ntv.*; + + +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; + + +public class Opaque2 { + + MemorySegment internal; + Cleaner.Cleanable cleanable; + + static class Opaque2Cleaner implements Runnable { + + MemorySegment segment; + Opaque2Cleaner(MemorySegment segment) { + this.segment = segment; + } + + public void run() { + somelib_h.Opaque2_destroy(this.segment); + } + } + + Opaque2() {} + + +} diff --git a/tool/src/kotlin/formatter.rs b/tool/src/kotlin/formatter.rs index 513623b5a..fa8c40266 100644 --- a/tool/src/kotlin/formatter.rs +++ b/tool/src/kotlin/formatter.rs @@ -367,35 +367,10 @@ pub mod test { use std::borrow::Cow; use super::KotlinFormatter; - use diplomat_core::{ - ast::{self}, - hir::{self, TypeContext}, - }; - use proc_macro2::TokenStream; + use crate::test::new_tcx; use quote::quote; - pub fn new_tcx(tk_stream: TokenStream) -> TypeContext { - let item = syn::parse2::(tk_stream).expect("failed to parse item "); - - let diplomat_file = ast::File::from(&item); - - let env = diplomat_file.all_types(); - let mut attr_validator = hir::BasicAttributeValidator::new("kotlin_test"); - attr_validator.support.renaming = true; - attr_validator.support.disabling = true; - - match hir::TypeContext::from_ast(&env, attr_validator) { - Ok(context) => context, - Err(e) => { - for (_cx, err) in e { - eprintln!("Lowering error: {}", err); - } - panic!("Failed to create context") - } - } - } - #[test] fn test_type_name() { let tk_stream = quote! { diff --git a/tool/src/kotlin/mod.rs b/tool/src/kotlin/mod.rs index 90de15c06..d57666ca7 100644 --- a/tool/src/kotlin/mod.rs +++ b/tool/src/kotlin/mod.rs @@ -1476,8 +1476,8 @@ mod test { use crate::common::ErrorStore; - use super::formatter::test::new_tcx; use super::{formatter::KotlinFormatter, TyGenContext}; + use crate::test::new_tcx; #[test] fn test_enum() { diff --git a/tool/src/lib.rs b/tool/src/lib.rs index 217bb088a..ed924fad9 100644 --- a/tool/src/lib.rs +++ b/tool/src/lib.rs @@ -308,3 +308,35 @@ fn exit_if_path_missing(path: &Path, message: &str) { std::process::exit(1); } } + +#[cfg(test)] +pub(crate) mod test { + + use diplomat_core::{ + ast::{self}, + hir::{self, TypeContext}, + }; + use proc_macro2::TokenStream; + + pub fn new_tcx(tk_stream: TokenStream) -> TypeContext { + let item = syn::parse2::(tk_stream).expect("failed to parse item "); + + let diplomat_file = ast::File::from(&item); + + let env = diplomat_file.all_types(); + let mut attr_validator = hir::BasicAttributeValidator::new("kotlin_test"); + attr_validator.support.renaming = true; + attr_validator.support.disabling = true; + attr_validator.support.constructors = true; + + match hir::TypeContext::from_ast(&env, attr_validator) { + Ok(context) => context, + Err(e) => { + for (_cx, err) in e { + eprintln!("Lowering error: {}", err); + } + panic!("Failed to create context") + } + } + } +} diff --git a/tool/templates/java/Main.java.jinja b/tool/templates/java/Main.java.jinja new file mode 100644 index 000000000..c9432e06a --- /dev/null +++ b/tool/templates/java/Main.java.jinja @@ -0,0 +1,5 @@ +package {{domain}}.{{lib_name}} + +public class Main { + public class Slice +} diff --git a/tool/templates/java/Method.java.jinja b/tool/templates/java/Method.java.jinja new file mode 100644 index 000000000..71447f23b --- /dev/null +++ b/tool/templates/java/Method.java.jinja @@ -0,0 +1,40 @@ +public{% if is_static %} static {% else %} {% endif %}{{return_ty}} +{%- match method_name -%} +{%- when Some with (method_name) %} {{method_name}} +{%- when None -%} +{%- endmatch -%} +( +{%- for param in params -%} +{{param.ty}} {{param.name}}{% if loop.last%}{% else %},{% endif -%} +{%- endfor -%} +) { + {% if allocations -%} + try (var arena = Arena.ofConfined()) { + {% for conv in param_conversions -%} + {{conv.conversion_def|indent(8)}} + {% endfor -%} + {% if param_conversions.is_empty() -%} + var nativeInvoker = {{native_method}}.makeInvoker(); + {% endif -%} + var nativeVal = {{native_invocation}}( + {%- for conv in param_conversions -%} + {{conv.converted_value}}{% if loop.last %}{% else %}, {% endif -%} + {% endfor -%} + ); + {{return_conversion|indent(8)}} + } + {%- else -%} + {% for conv in param_conversions -%} + {{conv.conversion_def|indent(4)}} + {% endfor -%} + {% if param_conversions.is_empty() -%} + var nativeInvoker = {{native_method}}.makeInvoker(); + {% endif -%} + var nativeVal = {{native_invocation}}( + {%- for conv in param_conversions -%} + {{conv.converted_value}}{% if loop.last %}{% else %}, {% endif -%} + {% endfor -%} + ); + {{return_conversion|indent(4)}} + {%- endif %} +} diff --git a/tool/templates/java/Opaque.java.jinja b/tool/templates/java/Opaque.java.jinja new file mode 100644 index 000000000..09b2855b2 --- /dev/null +++ b/tool/templates/java/Opaque.java.jinja @@ -0,0 +1,34 @@ +package {{domain}}.{{lib_name}}; + +import {{domain}}.{{lib_name}}.ntv.*; + + +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; + + +public class {{type_name}} { + + MemorySegment internal; + Cleaner.Cleanable cleanable; + + static class {{type_name}}Cleaner implements Runnable { + + MemorySegment segment; + {{type_name}}Cleaner(MemorySegment segment) { + this.segment = segment; + } + + public void run() { + {{lib_name}}_h.{{type_name}}_destroy(this.segment); + } + } + + {{type_name}}() {} + {% for method in static_methods %} + {{method|indent(4)}} + {% endfor %} + {% for method in class_methods %} + {{method|indent(4)}} + {% endfor %} +} diff --git a/tool/templates/java/OpaqueConstructor.java.jinja b/tool/templates/java/OpaqueConstructor.java.jinja new file mode 100644 index 000000000..4b5deb34b --- /dev/null +++ b/tool/templates/java/OpaqueConstructor.java.jinja @@ -0,0 +1,3 @@ +this.internal = nativeVal; +var cleaner = new {{return_ty}}.{{return_ty}}Cleaner(nativeVal); +this.cleanable = Main.cleaner.register(this, cleaner); diff --git a/tool/templates/java/OpaqueReturn.java.jinja b/tool/templates/java/OpaqueReturn.java.jinja new file mode 100644 index 000000000..f06c1d1a5 --- /dev/null +++ b/tool/templates/java/OpaqueReturn.java.jinja @@ -0,0 +1,5 @@ +var returnVal = new {{return_ty}}(); +returnVal.internal = nativeVal; +var cleaner = new {{return_ty}}.{{return_ty}}Cleaner(nativeVal); +returnVal.cleanable = Main.cleaner.register(returnVal, cleaner); +return returnVal; From c8282c9b71a3538336877480e55b1d7868aeeae9 Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Thu, 11 Jul 2024 14:22:00 +0200 Subject: [PATCH 04/69] panama-backend - add enums and structs / limited slice support --- feature_tests/java/somelib/pom.xml | 5 + .../dev/diplomattest/somelib/Float64Vec.java | 65 ++ .../java/dev/diplomattest/somelib/Main.java | 72 ++ .../java/dev/diplomattest/somelib/MyEnum.java | 77 ++ .../dev/diplomattest/somelib/MyString.java | 4 + .../dev/diplomattest/somelib/MyStruct.java | 46 +- .../java/dev/diplomattest/somelib/Opaque.java | 14 +- .../diplomattest/somelib/Float64VecTest.java | 19 + .../dev/diplomattest/somelib/MyEnumSpec.java | 12 + .../dev/diplomattest/somelib/OpaqueTest.java | 5 +- tool/src/java/formatter.rs | 19 +- tool/src/java/mod.rs | 738 +++++++++++++++--- .../diplomat_tool__java__test__enum.snap | 82 ++ .../diplomat_tool__java__test__opaque.snap | 148 +++- .../diplomat_tool__java__test__slice.snap | 147 ++++ tool/src/kotlin/mod.rs | 62 +- ...plomat_tool__kotlin__test__opaque_gen.snap | 260 +++++- tool/templates/java/Enum.java.jinja | 41 + tool/templates/java/Method.java.jinja | 2 +- tool/templates/java/Struct.java.jinja | 86 ++ 20 files changed, 1742 insertions(+), 162 deletions(-) create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Float64Vec.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyEnum.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyString.java create mode 100644 feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/Float64VecTest.java create mode 100644 feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/MyEnumSpec.java create mode 100644 tool/src/java/snapshots/diplomat_tool__java__test__enum.snap create mode 100644 tool/src/java/snapshots/diplomat_tool__java__test__slice.snap create mode 100644 tool/templates/java/Enum.java.jinja create mode 100644 tool/templates/java/Struct.java.jinja diff --git a/feature_tests/java/somelib/pom.xml b/feature_tests/java/somelib/pom.xml index 09a239864..23fcf7946 100644 --- a/feature_tests/java/somelib/pom.xml +++ b/feature_tests/java/somelib/pom.xml @@ -14,6 +14,11 @@ UTF-8 + + net.java.dev.jna + jna + 5.14.0 + org.junit.jupiter junit-jupiter diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Float64Vec.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Float64Vec.java new file mode 100644 index 000000000..f0ab5cea9 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Float64Vec.java @@ -0,0 +1,65 @@ +package dev.diplomattest.somelib; + +import java.lang.foreign.AddressLayout; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; + +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import java.nio.charset.StandardCharsets; + +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + +import dev.diplomattest.somelib.ntv.somelib_h; + +import static java.lang.foreign.ValueLayout.JAVA_DOUBLE; + + +public class Float64Vec { + + MemorySegment internal; + Cleaner.Cleanable cleanable; + + static class Float64VecCleaner implements Runnable { + + MemorySegment segment; + + Float64VecCleaner(MemorySegment segment) { + this.segment = segment; + } + + public void run() { + somelib_h.Float64Vec_destroy(this.segment); + } + } + + Float64Vec() { + } + + public double[] asSLice() { + try (var arena = Arena.ofConfined()) { + var nativeVal = somelib_h.Float64Vec_as_slice(arena, internal); + var data = dev.diplomattest.somelib.ntv.DiplomatF64View.data(nativeVal); + var len = dev.diplomattest.somelib.ntv.DiplomatF64View.len(nativeVal); + return data.asSlice(0, len * JAVA_DOUBLE.byteSize()).toArray(JAVA_DOUBLE); + } + } + + public static Float64Vec new_(double[] v) { + try (var arena = Arena.ofConfined()) { + var vLen = v.length; + var vMemSeg = arena.allocate(JAVA_DOUBLE, vLen); + for (var i = 0; i < vLen; i++) { + vMemSeg.setAtIndex(JAVA_DOUBLE, i, v[i]); + } + var nativeVal = somelib_h.Float64Vec_new(vMemSeg, vLen); + var returnVal = new Float64Vec(); + returnVal.internal = nativeVal; + var cleaner = new Float64Vec.Float64VecCleaner(nativeVal); + returnVal.cleanable = Main.cleaner.register(returnVal, cleaner); + return returnVal; + } + } +} \ No newline at end of file diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Main.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Main.java index 296b51f53..dc8421caf 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Main.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Main.java @@ -1,10 +1,46 @@ package dev.diplomattest.somelib; +import dev.diplomattest.somelib.ntv.DiplomatStringsView; + +import java.lang.foreign.MemorySegment; +import java.lang.foreign.ValueLayout; import java.lang.ref.Cleaner; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; //TIP To Run code, press or // click the icon in the gutter. public class Main { + + public sealed interface Result { + boolean isOk = false; + } + public final class Ok implements Result { + boolean isOk = true; + T value; + public Ok(T value) { + value = value; + } + } + public final class Err implements Result { + boolean isOk = false; + E err; + public Err(E err) { + err = err; + } + } + + class ResBuilder { + ResBuilder() {} + Ok Ok(T value) { + return Ok(value); + } + Err Err(E err) { + return Err(err); + } + } + + class Unit {} static final Cleaner cleaner = Cleaner.create(); public static void main(String[] args) { var str = "Whaddap G"; @@ -20,4 +56,40 @@ public static void main(String[] args) { } } +} + +class SliceUtils { + static byte[] byteSlice(MemorySegment segment) { + return segment.toArray(ValueLayout.JAVA_BYTE); + } + static short[] shortSlice(MemorySegment segment) { + return segment.toArray(ValueLayout.JAVA_SHORT); + } + static int[] intSlice(MemorySegment segment) { + return segment.toArray(ValueLayout.JAVA_INT); + } + static long[] longSlice(MemorySegment segment) { + return segment.toArray(ValueLayout.JAVA_LONG); + } + static float[] floatSlice(MemorySegment segment) { + return segment.toArray(ValueLayout.JAVA_FLOAT); + } + static double[] doubleSlice(MemorySegment segment) { + return segment.toArray(ValueLayout.JAVA_DOUBLE); + } + static String[] stringsSlice(MemorySegment segment) { + var len = DiplomatStringsView.len(segment); + String[] returnSlice = new String[(int) len]; + for (var i = 0; i < len; i++) { + var slice = DiplomatStringsView.asSlice(segment, i); + returnSlice[i] = slice.getString(0, StandardCharsets.UTF_8); + } + return returnSlice; + } + static String readUtf8(MemorySegment segment) { + return segment.getString(0, StandardCharsets.UTF_8); + } + static String readUtf16(MemorySegment segment) { + return segment.getString(0, StandardCharsets.UTF_16); + } } \ No newline at end of file diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyEnum.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyEnum.java new file mode 100644 index 000000000..a8578a32b --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyEnum.java @@ -0,0 +1,77 @@ +package dev.diplomattest.somelib; + +import dev.diplomattest.somelib.ntv.somelib_h; + + +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; + + +public enum MyEnum { + A, + B, + C, + D, + E, + F, + ; + + static MyEnum fromInt(int i) { + switch (i) { + case -2 -> { + return MyEnum.A; + } + case -1 -> { + return MyEnum.B; + } + case 0 -> { + return MyEnum.C; + } + case 1 -> { + return MyEnum.D; + } + case 2 -> { + return MyEnum.E; + } + case 3 -> { + return MyEnum.F; + } + + } + throw new RuntimeException("Unexpected int for MyEnum:" + i); + } + + int toInt() { + switch (this) { + case A -> { + return -2; + } + case B -> { + return -1; + } + case C -> { + return 0; + } + case D -> { + return 1; + } + case E -> { + return 2; + } + case F -> { + return 3; + } + + } + throw new RuntimeException("Unexpected variant for MyEnum:" + this); + } + + + public static MyEnum getA() { + var nativeInvoker = somelib_h.MyEnum_get_a.makeInvoker(); + var nativeVal = nativeInvoker.apply(); + return MyEnum.fromInt(nativeVal) + } + +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyString.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyString.java new file mode 100644 index 000000000..134418943 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyString.java @@ -0,0 +1,4 @@ +package dev.diplomattest.somelib; + +public class MyString { +} diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyStruct.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyStruct.java index ca0670c44..80b24b772 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyStruct.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyStruct.java @@ -2,17 +2,55 @@ import dev.diplomattest.somelib.ntv.somelib_h; +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; import java.lang.foreign.SegmentAllocator; public class MyStruct { - MemorySegment nativeStruct$; - public MyStruct(SegmentAllocator alloc) { + public byte a; + public boolean b; + public byte c; + public long d; + public int e; + public char f; + public MyEnum g; + + MemorySegment internal = null; + + MyStruct(SegmentAllocator alloc, byte a, boolean b, byte c, long d, int e, char f, MyEnum g) { + var segment = dev.diplomattest.somelib.ntv.MyStruct.allocate(alloc); + dev.diplomattest.somelib.ntv.MyStruct.a(segment, a); + dev.diplomattest.somelib.ntv.MyStruct.b(segment, b); + dev.diplomattest.somelib.ntv.MyStruct.c(segment, c); + dev.diplomattest.somelib.ntv.MyStruct.d(segment, d); + dev.diplomattest.somelib.ntv.MyStruct.e(segment, e); + dev.diplomattest.somelib.ntv.MyStruct.f(segment, f); + dev.diplomattest.somelib.ntv.MyStruct.g(segment, g.toInt()); + internal = segment; + } + private MyStruct() {} + + static MyStruct fromSegment(MemorySegment segment) { + var returnVal = new MyStruct(); + returnVal.internal = segment; + returnVal.a = dev.diplomattest.somelib.ntv.MyStruct.a(segment); + returnVal.b = dev.diplomattest.somelib.ntv.MyStruct.b(segment); + returnVal.c = dev.diplomattest.somelib.ntv.MyStruct.c(segment); + returnVal.d = dev.diplomattest.somelib.ntv.MyStruct.d(segment); + returnVal.e = dev.diplomattest.somelib.ntv.MyStruct.e(segment); + returnVal.f = (char) dev.diplomattest.somelib.ntv.MyStruct.f(segment); + returnVal.g = MyEnum.fromInt(dev.diplomattest.somelib.ntv.MyStruct.g(segment)); + return returnVal; + } + + public static MyStruct new_() { var function = somelib_h.MyStruct_new.makeInvoker(); - this.nativeStruct$ = function.apply(alloc); + var arena = Arena.global(); + var nativeVal = function.apply(arena); + return MyStruct.fromSegment(nativeVal); } MemorySegment getNativeStruct$() { - return nativeStruct$; + return internal; } } diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Opaque.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Opaque.java index a5ebbfec9..7368723ee 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Opaque.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Opaque.java @@ -5,6 +5,7 @@ import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; +import java.lang.foreign.ValueLayout; import java.lang.ref.Cleaner; import java.nio.charset.StandardCharsets; @@ -42,7 +43,8 @@ public static Opaque fromStr(String input) { try (var arena = Arena.ofConfined()) { var inputMemSeg = arena.allocateFrom(input, StandardCharsets.UTF_8); var inputLen = inputMemSeg.byteSize(); - var nativeVal = somelib_h.Opaque_from_str(inputMemSeg, inputLen); + var inputMemSeg2 = inputMemSeg.asSlice(0, inputLen - 1); + var nativeVal = somelib_h.Opaque_from_str(inputMemSeg, inputLen - 1); var returnVal = new Opaque(); returnVal.internal = nativeVal; var cleaner = new Opaque.OpaqueCleaner(nativeVal); @@ -64,4 +66,14 @@ public long internalLen() { return nativeVal; } + public String getDebugStr() { + + var writeable = somelib_h.diplomat_buffer_write_create(0); + somelib_h.Opaque_get_debug_str(internal, writeable); + var buffer = DiplomatWrite.buf(writeable); + var string = buffer.getString(0, StandardCharsets.UTF_8); + somelib_h.diplomat_buffer_write_destroy(writeable); + return string; + } + } diff --git a/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/Float64VecTest.java b/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/Float64VecTest.java new file mode 100644 index 000000000..0e5ed3341 --- /dev/null +++ b/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/Float64VecTest.java @@ -0,0 +1,19 @@ +package dev.diplomattest.somelib; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.*; + +class Float64VecTest { + @Test + void testFloat64Vec() { + double[] dArray = {0.1, 0.2, 0.3, 0.4}; + var float64Vec = Float64Vec.new_(dArray); + var outArray = float64Vec.asSLice(); + assertEquals(dArray.length, outArray.length); + for (var i = 0; i < dArray.length; i++) { + assertEquals(dArray[i], outArray[i]); + } + } + +} \ No newline at end of file diff --git a/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/MyEnumSpec.java b/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/MyEnumSpec.java new file mode 100644 index 000000000..b9b4daa2c --- /dev/null +++ b/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/MyEnumSpec.java @@ -0,0 +1,12 @@ +package dev.diplomattest.somelib; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class MyEnumSpec { + @Test + public void testGetA() { + assertEquals(MyEnum.getA(), MyEnum.A); + } +} diff --git a/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/OpaqueTest.java b/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/OpaqueTest.java index 2b62be0fb..704928c6e 100644 --- a/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/OpaqueTest.java +++ b/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/OpaqueTest.java @@ -12,6 +12,9 @@ class OpaqueTest { void testOpaque() { var input = "How do you do?"; var opaque = Opaque.fromStr(input); - assertEquals(input.length() + 1, opaque.internalLen()); + System.out.println("instantiated"); + System.out.println(opaque.getDebugStr()); + System.out.println("done debuging"); + assertEquals(input.length(), opaque.internalLen()); } } \ No newline at end of file diff --git a/tool/src/java/formatter.rs b/tool/src/java/formatter.rs index 04b70c46a..17a5ce023 100644 --- a/tool/src/java/formatter.rs +++ b/tool/src/java/formatter.rs @@ -3,8 +3,8 @@ use std::borrow::Cow; use diplomat_core::{ ast::Ident, hir::{ - self, FloatType, IntType, OutType, PrimitiveType, ReturnType, Slice, SuccessType, - TyPosition, Type, TypeContext, TypeId, + self, FloatType, IntType, OutType, PrimitiveType, ReturnType, Slice, StructPathLike, + SuccessType, TyPosition, Type, TypeContext, TypeId, }, }; use heck::ToLowerCamelCase; @@ -13,7 +13,7 @@ use crate::c2::CFormatter; pub(crate) struct JavaFormatter<'cx> { tcx: &'cx TypeContext, - c: CFormatter<'cx>, + pub c: CFormatter<'cx>, } const INVALID_METHOD_NAMES: &[&str] = &[ @@ -54,9 +54,9 @@ impl<'cx> JavaFormatter<'cx> { pub fn fmt_success_type_java<'a>(&self, success_ty: &'a SuccessType) -> Cow<'a, str> { match success_ty { - SuccessType::Write => todo!(), + SuccessType::Write => "String".into(), SuccessType::OutType(ref o) => self.fmt_java_type(o), - SuccessType::Unit => todo!(), + SuccessType::Unit => "".into(), _ => todo!(), } } @@ -75,11 +75,14 @@ impl<'cx> JavaFormatter<'cx> { match ty { hir::Type::Primitive(ref p) => self.fmt_primitive(p), hir::Type::Opaque(o) => self.tcx.resolve_opaque(o.tcx_id).name.to_string().into(), - hir::Type::Struct(_) => todo!(), + hir::Type::Struct(s) => self.tcx.resolve_type(s.id()).name().to_string().into(), hir::Type::Enum(e) => self.tcx.resolve_enum(e.tcx_id).name.to_string().into(), hir::Type::Slice(Slice::Str(_, _)) => "String".into(), - hir::Type::Slice(_) => todo!("Need to work on slices"), - _ => todo!(), + hir::Type::Slice(Slice::Primitive(_, p)) => { + format!("{}[]", self.fmt_primitive(p)).into() + } + hir::Type::Slice(Slice::Strs(_)) => "String []".into(), + ty => todo!("haven't implemented, {ty:?}"), } } diff --git a/tool/src/java/mod.rs b/tool/src/java/mod.rs index 8046444ba..475adc2d3 100644 --- a/tool/src/java/mod.rs +++ b/tool/src/java/mod.rs @@ -6,8 +6,9 @@ use std::path::Path; use askama::Template; use diplomat_core::hir::{ - self, OpaqueDef, ReturnType, Slice, SpecialMethod, StringEncoding, SuccessType, TypeContext, - TypeDef, TypeId, + self, EnumDef, EnumId, EnumVariant, FloatType, IntSizeType, IntType, Method, OpaqueDef, + ReturnType, Slice, SpecialMethod, StringEncoding, StructDef, StructField, StructPathLike, + SuccessType, TypeContext, TypeDef, TypeId, }; use formatter::JavaFormatter; @@ -110,22 +111,27 @@ pub fn run( let formatter = &java_formatter; let error_store = ErrorStore::default(); let errors = &error_store; + let tcx_config = Config { + domain: "dev.diplomattest".into(), + lib_name: "somelib".into(), + }; let ty_gen_cx = TyGenContext { tcx, + tcx_config, formatter, errors, }; let files = FileMap::default(); - for (id, ty) in tcx.all_types() { + for (_id, ty) in tcx.all_types() { let _guard = ty_gen_cx.errors.set_context_ty(ty.name().as_str().into()); if ty.attrs().disable { continue; } match ty { - TypeDef::Opaque(o) => { + TypeDef::Opaque(_) => { // let type_name = o.name.to_string(); // let (file_name, body) = ty_gen_cx.gen_opaque_def(o, id, GROUP, LIBRARY); @@ -163,6 +169,39 @@ pub(crate) struct MethodTpl<'a> { param_conversions: Vec>, return_conversion: Cow<'a, str>, allocations: bool, + native_return_void: bool, +} + +#[derive(Template, Clone, Debug)] +#[template(path = "java/Struct.java.jinja", escape = "none")] +pub(crate) struct StructTypeTpl<'a> { + type_name: Cow<'a, str>, + lib_name: Cow<'a, str>, + domain: Cow<'a, str>, + fields: Vec>, + methods: Vec>, +} + +#[derive(Clone, Debug)] +struct FieldTpl<'a> { + name: Cow<'a, str>, + ty: Cow<'a, str>, +} + +#[derive(Template, Clone, Debug)] +#[template(path = "java/Enum.java.jinja", escape = "none")] +pub(crate) struct EnumTypeTpl<'a> { + type_name: Cow<'a, str>, + lib_name: Cow<'a, str>, + domain: Cow<'a, str>, + variants: Vec>, + methods: Vec>, +} + +#[derive(Clone, Debug)] +struct VariantTpl<'a> { + name: Cow<'a, str>, + index: Cow<'a, str>, } #[derive(Template, Clone, Debug)] @@ -187,8 +226,14 @@ pub(crate) struct OpaqueConstructorTpl<'a> { return_ty: Cow<'a, str>, } +struct Config<'cx> { + domain: Cow<'cx, str>, + lib_name: Cow<'cx, str>, +} + struct TyGenContext<'a, 'cx> { tcx: &'cx TypeContext, + tcx_config: Config<'cx>, formatter: &'a JavaFormatter<'cx>, errors: &'a ErrorStore<'cx, String>, } @@ -200,19 +245,25 @@ impl<'a, 'cx> TyGenContext<'a, 'cx> { ) -> ParamConversion<'b> { let diplomat_core::hir::Param { name, ty, .. } = param; // let java_ty = self.formatter.fmt_java_type(ty); + let Config { domain, lib_name } = &self.tcx_config; let converted_value: Cow<'b, str> = format!("{name}Native").into(); let (conversion, converted_value) = match ty { hir::Type::Primitive(_) => (name.as_str().into(), converted_value), - hir::Type::Opaque(_) => (format!("{name}.inner").into(), converted_value), - hir::Type::Struct(_) => todo!(), + hir::Type::Opaque(_) => (format!("{name}.internal").into(), converted_value), + hir::Type::Struct(_) => ( + format!(r#"var {name}Native = {name}.internal;"#).into(), + converted_value, + ), hir::Type::Enum(_) => todo!(), hir::Type::Slice(Slice::Str(_, StringEncoding::UnvalidatedUtf8)) => ( + // java allocates native strings as null-terminated so we truncate the last + // character format!( r#"var {name}MemSeg = arena.allocateFrom({name}, StandardCharsets.UTF_8); var {name}Len = {name}MemSeg.byteSize();"# ) .into(), - format!("{name}MemSeg, {name}Len").into(), + format!("{name}MemSeg, {name}Len - 1").into(), ), hir::Type::Slice(Slice::Str(_, StringEncoding::UnvalidatedUtf16)) => ( format!( @@ -220,7 +271,7 @@ var {name}Len = {name}MemSeg.byteSize();"# var {name}Len = {name}MemSeg.byteSize();"# ) .into(), - format!("{name}MemSeg, {name}Len").into(), + format!("{name}MemSeg, {name}Len - 1").into(), ), hir::Type::Slice(Slice::Str(_, StringEncoding::Utf8)) => ( format!( @@ -228,9 +279,38 @@ var {name}Len = {name}MemSeg.byteSize();"# var {name}Len = {name}MemSeg.byteSize();"# ) .into(), - format!("{name}MemSeg, {name}Len").into(), + format!("{name}MemSeg, {name}Len - 1").into(), ), - _ => todo!(), + hir::Type::Slice(Slice::Primitive(_, p)) => { + let primitive_ty = match p { + hir::PrimitiveType::Bool => "JAVA_BOOLEAN", + hir::PrimitiveType::Char => "JAVA_INT", + hir::PrimitiveType::Byte => "JAVA_BYTE", + hir::PrimitiveType::Int(IntType::I8 | IntType::U8) => "JAVA_BYTE", + hir::PrimitiveType::Int(IntType::I16 | IntType::U16) => "JAVA_SHORT", + hir::PrimitiveType::Int(IntType::I32 | IntType::U32) => "JAVA_INT", + hir::PrimitiveType::Int(IntType::I64 | IntType::U64) => "JAVA_LONG", + hir::PrimitiveType::IntSize(_) => "JAVA_LONG", + hir::PrimitiveType::Int128(_) => { + panic!("java backend doesn't support 128 bit integers") + } + hir::PrimitiveType::Float(hir::FloatType::F32) => "JAVA_FLOAT", + hir::PrimitiveType::Float(hir::FloatType::F64) => "JAVA_DOUBLE", + }; + ( + format!( + r#"var {name}Len = {name}.length; +var {name}MemSeg = arena.allocate({primitive_ty}, {name}Len); +for (var i = 0; i < {name}Len; i++) {{ + {name}MemSeg.setAtIndex({primitive_ty}, i, {name}[i]); +}}"# + ) + .into(), + format!("{name}MemSeg, {name}Len").into(), + ) + } + // hir::Type::Slice(Slice::Strs(_)) => ("".into(), "".into()), + x => panic!("Unexpected slice type {x:?}"), }; ParamConversion { converted_value, @@ -238,20 +318,110 @@ var {name}Len = {name}MemSeg.byteSize();"# } } - fn gen_return_conversion(&self, ty: &ReturnType) -> Cow<'cx, str> { + fn gen_slice_return_conversion(&self, ty: &Slice) -> Result, String> { + let return_conversion: Cow<'cx, str> = match ty { + Slice::Str(None, _) | Slice::Primitive(None, _) => { + // We can probably do boxed returns by just relying on jna + // public double[] asBoxedSLice() { + // try (var arena = Arena.ofConfined()) { + // var nativeVal = somelib_h.Float64Vec_as_boxed_slice(arena, internal); + // var data = dev.diplomattest.somelib.ntv.DiplomatF64View.data(nativeVal); + // var len = dev.diplomattest.somelib.ntv.DiplomatF64View.len(nativeVal); + // var returnVal = data.asSlice(0, len * JAVA_DOUBLE.byteSize()).toArray(JAVA_DOUBLE); + // Native.free(data.address()); + // return returnVal; + // } + // } + return "method returns owned slice but java backend doesn't support owned slices in return position".to_string().wrap_err(); + } + Slice::Str(Some(_), StringEncoding::Utf8) => { + "return SliceUtils.readUtf8(nativeVal);".into() + } + Slice::Str(Some(_), StringEncoding::UnvalidatedUtf8) => { + "return SliceUtils.readUtf8(nativeVal);".into() + } + Slice::Str(Some(_), StringEncoding::UnvalidatedUtf16) => { + "return SliceUtils.readUtf16(nativeVal);".into() + } + Slice::Primitive(Some(_), p) => { + let lib_name = self.tcx_config.lib_name.as_ref(); + let domain = self.tcx_config.domain.as_ref(); + let primitive_ty = match p { + hir::PrimitiveType::Bool => "Bool", + hir::PrimitiveType::Char => "Char", + hir::PrimitiveType::Byte => "U8", + hir::PrimitiveType::Int(IntType::U8) => "U8", + hir::PrimitiveType::Int(IntType::I8) => "I8", + hir::PrimitiveType::Int(IntType::U16) => "U16", + hir::PrimitiveType::Int(IntType::I16) => "I16", + hir::PrimitiveType::Int(IntType::U32) => "U32", + hir::PrimitiveType::Int(IntType::I32) => "I32", + hir::PrimitiveType::Int(IntType::U64) => "U64", + hir::PrimitiveType::Int(IntType::I64) => "I64", + hir::PrimitiveType::IntSize(IntSizeType::Usize) => "Usize", + hir::PrimitiveType::IntSize(IntSizeType::Isize) => "Isize", + hir::PrimitiveType::Int128(_) => { + panic!("Java backend doesn't support Int128 types") + } + hir::PrimitiveType::Float(FloatType::F32) => "F32", + hir::PrimitiveType::Float(FloatType::F64) => "F64", + }; + + let java_primitive_ty = self.formatter.fmt_primitive(p); + format!( + r#"var data = {domain}{lib_name}.ntv.Diplomat{primitive_ty}View.data(nativeVal); +var len = {domain}{lib_name}.ntv.Diplomat{primitive_ty}View.len(nativeVal); +return SliceUtils.{java_primitive_ty}Slice(nativeVal);"# + ) + .into() + } + Slice::Strs(StringEncoding::Utf8) => { + todo!("strs utf8 not ready") + } + Slice::Strs(StringEncoding::UnvalidatedUtf8) => { + todo!("strs utf8 not ready") + } + Slice::Strs(StringEncoding::UnvalidatedUtf16) => { + todo!("strs utf16 not ready") + } + _ => todo!(), + }; + return_conversion.wrap_ok() + } + + fn gen_return_conversion(&self, ty: &ReturnType) -> Result, String> { + let Config { lib_name, .. } = &self.tcx_config; let ret = match ty { ReturnType::Infallible(ref ret) => ret, ReturnType::Fallible(ref ret, _) => ret, ReturnType::Nullable(ref ret) => ret, }; let o = match ret { - SuccessType::Write => return "".into(), + /* + var writeable = somelib_h.diplomat_buffer_write_create(0); + somelib_h.Opaque_get_debug_str(internal, writeable); + var buffer = DiplomatWrite.buf(writeable); + var string = buffer.getString(0, StandardCharsets.UTF_8); + somelib_h.diplomat_buffer_write_destroy(writeable); + return string; + */ + SuccessType::Write => { + let write_return: Cow<'cx, str> = format!( + r#"var buffer = DiplomatWrite.buf(writeable); +var string = buffer.getString(0, StandardCharsets.UTF_8); +{}_h.diplomat_buffer_write_destroy(writeable); +return string;"#, + lib_name + ) + .into(); + return write_return.wrap_ok(); + } SuccessType::OutType(ref o) => o, - SuccessType::Unit => return "".into(), + SuccessType::Unit => return Cow::<'cx, str>::default().wrap_ok(), _ => todo!(), }; - match o { - hir::Type::Primitive(o) => "return nativeVal;".into(), + let return_statment: Cow<'cx, str> = match o { + hir::Type::Primitive(_) => "return nativeVal;".into(), hir::Type::Opaque(o) => { let ty_name = &self.tcx.resolve_opaque(o.tcx_id).name; OpaqueReturnTpl { @@ -266,125 +436,222 @@ var {name}Len = {name}MemSeg.byteSize();"# }) .into() } - hir::Type::Struct(_) => todo!(), - hir::Type::Enum(_) => todo!(), - hir::Type::Slice(_) => todo!(), - _ => todo!(), - } + hir::Type::Struct(s) => { + let ty_name = &self.tcx.resolve_type(s.id()).name(); + format!(r#"return new {ty_name}(nativeVal);"#).into() + } + hir::Type::Enum(e) => { + let enum_ty = self.tcx.resolve_enum(e.tcx_id).name.as_str(); + format!(r#"return {enum_ty}.fromInt(nativeVal)"#).into() + } + hir::Type::Slice(ref slice) => self.gen_slice_return_conversion(slice)?, + unknown => panic!("Got to unknown return type: {unknown:?}"), + }; + + Ok(return_statment) } - fn gen_opaque_def( + fn gen_methods( &self, - o: &OpaqueDef, - ty: TypeId, - domain: &str, - lib_name: &str, - ) -> (Cow, String) { + ty_id: TypeId, + ty_name: &str, + methods: &[Method], + ) -> (Vec>, Vec>) { + let Config { domain, lib_name } = &self.tcx_config; let mut static_methods = Vec::new(); let mut class_methods = Vec::new(); - for method in o.methods.iter() { - let method_name = match method.attrs.special_method { - // We need to reserve the default constructor for internal methods so a constructor - // must always have params - Some(SpecialMethod::Constructor) if !method.params.is_empty() => None, - Some(SpecialMethod::Constructor) => { - eprintln!( - "Attempted to create constructor for {:?} type {:?}", - method.name, o.name - ); - Some(self.formatter.fmt_method_name(method)) - } - _ => Some(self.formatter.fmt_method_name(method)), - }; + methods + .iter() + .filter_map(|method| -> Option<(bool, Cow<'cx, str>)> { + let method_name = match method.attrs.special_method { + // We need to reserve the default constructor for internal methods so a constructor + // must always have params + Some(SpecialMethod::Constructor) if !method.params.is_empty() => None, + Some(SpecialMethod::Constructor) => { + eprintln!( + "Attempted to create constructor for {:?} type {:?}", + method.name, ty_name + ); + Some(self.formatter.fmt_method_name(method)) + } + _ => Some(self.formatter.fmt_method_name(method)), + }; - let return_ty = self.formatter.fmt_return_type_java(&method.output); - let return_conversion = if method_name.is_none() { - OpaqueConstructorTpl { - return_ty: return_ty.clone(), + let return_ty = self.formatter.fmt_return_type_java(&method.output); + let return_conversion = if method_name.is_none() { + OpaqueConstructorTpl { + return_ty: return_ty.clone(), + } + .render() + .unwrap_or_else(|err| { + panic!( + "Failed to render method {} for type {}. Cause: {err}", + method.name, ty_name + ) + }) + .cown() + } else { + match self.gen_return_conversion(&method.output) { + Ok(ok) => ok, + Err(err) => { + self.errors.push_error(format!( + "can't construct method {} because {err}", + method.name + )); + return None; + } + } + }; + let allocations = + method + .params + .iter() + .any(|diplomat_core::hir::Param { ty, .. }| { + matches!(ty, diplomat_core::hir::Type::Slice(_)) + }); + let params = method + .params + .iter() + .map(|diplomat_core::hir::Param { name, ty, .. }| Param { + name: self.formatter.fmt_param_name(name.as_str()).into(), + ty: self.formatter.fmt_java_type(ty), + }) + .collect(); + let mut param_conversions: Vec<_> = method + .param_self + .iter() + .map(|_| ParamConversion { + converted_value: "internal".into(), + conversion_def: "".into(), + }) + .chain( + method + .params + .iter() + .map(|param| self.gen_param_conversion(param)), + ) + .collect(); + if let ReturnType::Fallible(SuccessType::Write, _) + | ReturnType::Infallible(SuccessType::Write) + | ReturnType::Nullable(SuccessType::Unit) = method.output + { + param_conversions.push(ParamConversion { + converted_value: "writeable".into(), + conversion_def: format!( + "var writeable = {lib_name}_h.diplomat_buffer_write_create(0);" + ) + .into(), + }) + } + let native_method: Cow = format!( + "{lib_name}_h.{}", + self.formatter.fmt_c_method_name(ty_id, method) + ) + .into(); + let native_invocation = if param_conversions.is_empty() { + "nativeInvoker.apply".into() + } else { + native_method.clone() + }; + let native_return_void = matches!( + method.output, + ReturnType::Infallible(SuccessType::Unit | SuccessType::Write) + ); + let method_rendered = MethodTpl { + method_name, + is_static: method.param_self.is_none(), + return_ty, + native_method, + native_invocation, + params, + param_conversions, + return_conversion, + allocations, + native_return_void, } .render() .unwrap_or_else(|err| { panic!( "Failed to render method {} for type {}. Cause: {err}", - method.name, o.name + method.name, ty_name ) - }) - .into() - } else { - self.gen_return_conversion(&method.output) - }; + }); - let allocations = - method - .params - .iter() - .any(|diplomat_core::hir::Param { ty, .. }| { - matches!(ty, diplomat_core::hir::Type::Slice(_)) - }); - let params = method - .params - .iter() - .map(|diplomat_core::hir::Param { name, ty, .. }| Param { - name: self.formatter.fmt_param_name(name.as_str()).into(), - ty: self.formatter.fmt_java_type(ty), - }) - .collect(); - let param_conversions: Vec<_> = method - .param_self - .iter() - .map(|_| ParamConversion { - converted_value: "internal".into(), - conversion_def: "".into(), - }) - .chain( - method - .params - .iter() - .map(|param| self.gen_param_conversion(param)), - ) - .collect(); - let native_method: Cow = format!( - "{lib_name}_h.{}", - self.formatter.fmt_c_method_name(ty, method) - ) - .into(); - let native_invocation = if param_conversions.is_empty() { - "nativeInvoker.apply".into() - } else { - native_method.clone() - }; - let method_rendered = MethodTpl { - method_name, - is_static: method.param_self.is_none(), - return_ty, - native_method, - native_invocation, - params, - param_conversions, - return_conversion, - allocations, - } - .render() - .unwrap_or_else(|err| { - panic!( - "Failed to render method {} for type {}. Cause: {err}", - method.name, o.name - ) + (method.param_self.is_some(), method_rendered.cown()).wrap_some() + }) + .for_each(|(self_param, method_rendered)| match self_param { + true => class_methods.push(method_rendered), + false => static_methods.push(method_rendered), }); - println!("HAve method!"); - println!("{method_rendered}"); + (static_methods, class_methods) + } - match method.param_self { - Some(_) => class_methods.push(method_rendered.into()), - None => static_methods.push(method_rendered.into()), + fn gen_enum_def(&self, e: &EnumDef, ty: EnumId) -> (Cow, String) { + let Config { domain, lib_name } = &self.tcx_config; + let type_name = e.name.as_str(); + let variants = e + .variants + .iter() + .map( + |EnumVariant { + name, discriminant, .. + }| { + let name = name.as_str().into(); + let index = discriminant.to_string().into(); + VariantTpl { name, index } + }, + ) + .collect(); + let (methods, _) = self.gen_methods(ty.into(), e.name.as_str(), &e.methods); + ( + format!("{type_name}.java").into(), + EnumTypeTpl { + type_name: type_name.into(), + lib_name: lib_name.clone(), + domain: domain.clone(), + variants, + methods, } - } + .render() + .expect("failed to render struct type"), + ) + } + fn gen_struct_def(&self, s: &StructDef, ty: TypeId) -> (Cow, String) { + let Config { domain, lib_name } = &self.tcx_config; + let type_name = s.name.as_str(); + let fields = s + .fields + .iter() + .map(|StructField { name, ty, .. }| { + let name = name.as_str().into(); + let ty = self.formatter.fmt_java_type(ty); + FieldTpl { name, ty } + }) + .collect(); + let (methods, _) = self.gen_methods(ty, s.name.as_str(), &s.methods); + ( + format!("{type_name}.java").into(), + StructTypeTpl { + type_name: type_name.into(), + lib_name: lib_name.clone(), + domain: domain.clone(), + fields, + methods, + } + .render() + .expect("failed to render struct type"), + ) + } + + fn gen_opaque_def(&self, o: &OpaqueDef, ty: TypeId) -> (Cow, String) { + let Config { domain, lib_name } = &self.tcx_config; + let (static_methods, class_methods) = self.gen_methods(ty, o.name.as_str(), &o.methods); let opaque_tpl = OpaqueTypeTpl { type_name: o.name.to_string().into(), - lib_name: lib_name.into(), - domain: domain.into(), + lib_name: lib_name.clone(), + domain: domain.clone(), static_methods, class_methods, }; @@ -396,14 +663,39 @@ var {name}Len = {name}MemSeg.byteSize();"# } } +trait PostFix: Sized { + fn wrap_ok(self) -> Result { + Ok(self) + } + fn wrap_err(self) -> Result { + Err(self) + } + + fn wrap_some(self) -> Option { + Some(self) + } +} + +impl PostFix for T {} + +trait PostFixCown { + fn cown<'a>(self) -> Cow<'a, str>; +} + +impl PostFixCown for String { + fn cown<'a>(self) -> Cow<'a, str> { + Cow::Owned(self) + } +} + #[cfg(test)] mod test { use askama::Template; - use diplomat_core::hir::TypeDef; + use diplomat_core::hir::{TypeDef, TypeId}; use quote::quote; - use crate::{common::ErrorStore, test::new_tcx}; + use crate::{common::ErrorStore, java::Config, test::new_tcx}; use super::{formatter::JavaFormatter, OpaqueTypeTpl, TyGenContext}; #[test] @@ -419,7 +711,161 @@ mod test { let rendered = opaque_type.render().expect("Failed to render opaque type"); insta::assert_snapshot!(rendered); } + #[test] + fn test_slice() { + let tk_stream = quote! { + #[diplomat::bridge] + mod ffi { + + #[diplomat::opaque] + struct MyString(String); + + impl MyString { + #[diplomat::attr(supports = constructors, constructor)] + pub fn new(v: &DiplomatStr) -> Box { + Box::new(Self(String::from_utf8(v.to_owned()).unwrap())) + } + + #[diplomat::attr(supports = named_constructors, named_constructor = "unsafe")] + pub fn new_unsafe(v: &str) -> Box { + Box::new(Self(v.to_string())) + } + + pub fn new_owned(v: Box) -> Box { + Box::new(Self(String::from_utf8(v.into()).unwrap())) + } + + // #[diplomat::skip_if_ast] + // pub fn new_from_first(v: &[&DiplomatStr]) -> Box { + // Box::new(Self(core::str::from_utf8(v[0]).unwrap().into())) + // } + + #[diplomat::attr(supports = accessors, setter = "str")] + pub fn set_str(&mut self, new_str: &DiplomatStr) { + self.0 = String::from_utf8(new_str.to_owned()).unwrap(); + } + + #[diplomat::attr(supports = accessors, getter = "str")] + pub fn get_str(&self, write: &mut DiplomatWrite) { + let _infallible = write!(write, "{}", self.0); + } + + #[diplomat::skip_if_ast] + pub fn get_boxed_str(&self) -> Box { + self.0.as_str().into() + } + } + + #[diplomat::opaque] + struct Float64Vec(Vec); + + impl Float64Vec { + pub fn new(v: &[f64]) -> Box { + Box::new(Self(v.to_vec())) + } + + #[diplomat::attr(supports = accessors, getter = "asBoxedSlice")] + pub fn as_boxed_slice(&self) -> Box<[f64]> { + self.0.clone().into() + } + + #[diplomat::attr(supports = accessors, getter = "asSlice")] + pub fn as_slice<'a>(&'a self) -> &'a [f64] { + &self.0 + } + } + } + }; + + let tcx = new_tcx(tk_stream); + + let formatter = JavaFormatter::new(&tcx); + + let errors = ErrorStore::default(); + let tcx_gen = TyGenContext { + tcx: &tcx, + tcx_config: Config { + domain: "dev.diplomattest".into(), + lib_name: "somelib".into(), + }, + formatter: &formatter, + errors: &errors, + }; + + let mut res = String::new(); + for (ty, def) in tcx.all_types() { + let rendered = match def { + TypeDef::Opaque(opaque) => { + let (_, rendered) = tcx_gen.gen_opaque_def(opaque, ty); + rendered + } + _ => String::new(), + }; + + res.push_str(&rendered); + res.push_str("\n============================\n") + } + insta::assert_snapshot!(res); + } + #[test] + fn test_enum() { + let tk_stream = quote! { + #[diplomat::bridge] + mod ffi { + + #[derive(Debug, PartialEq, Eq)] + pub enum MyEnum { + A = -2, + B = -1, + C = 0, + D = 1, + E = 2, + F = 3, + } + + impl MyEnum { + pub fn into_value(self) -> i8 { + self as i8 + } + + pub fn get_a() -> MyEnum { + MyEnum::A + } + } + } + }; + + let tcx = new_tcx(tk_stream); + + let formatter = JavaFormatter::new(&tcx); + + let errors = ErrorStore::default(); + let tcx_gen = TyGenContext { + tcx: &tcx, + tcx_config: Config { + domain: "dev.diplomattest".into(), + lib_name: "somelib".into(), + }, + formatter: &formatter, + errors: &errors, + }; + + let mut res = String::new(); + for (ty, def) in tcx.all_types() { + let rendered = match (ty, def) { + (TypeId::Enum(enum_id), TypeDef::Enum(enum_def)) => { + let (_, rendered) = tcx_gen.gen_enum_def(enum_def, enum_id); + rendered + } + _ => String::new(), + }; + + res.push_str(&rendered); + res.push_str("\n============================\n") + } + insta::assert_snapshot!(res); + } #[test] fn test_opaque() { let tk_stream = quote! { @@ -448,7 +894,30 @@ mod test { self.0.len() } + pub fn get_debug_str(&self, write: &mut DiplomatWrite) { + let _infallible = write!(write, "{:?}", &self.0); + } + + pub fn returns_imported() -> OwningStruct { + unimplemented!() + } + } + + pub struct OwnedStruct { + count: u8, } + + pub struct OwningStruct { + a: OwnedStruct, + b: OwnedStruct, + } + + impl OwningStruct { + pub fn do_opaque_stuff<'a>(input: OwnedStruct) -> Box { + unimplemented!() + } + } + } }; @@ -459,21 +928,36 @@ mod test { let errors = ErrorStore::default(); let tcx_gen = TyGenContext { tcx: &tcx, + tcx_config: Config { + domain: "dev.diplomattest".into(), + lib_name: "somelib".into(), + }, formatter: &formatter, errors: &errors, }; - let (ty, some_opaque) = tcx - .all_types() - .next() - .expect("Didn't find type despite there being one in quote"); - if let TypeDef::Opaque(opaque) = some_opaque { - println!("Found opaque"); - let (_, rendered) = tcx_gen.gen_opaque_def(opaque, ty, "dev.diplomattest", "somelib"); - - insta::assert_snapshot!(rendered); - } else { - panic!("Found type should have been opaque but wasn't"); + let mut res = String::new(); + for (ty, def) in tcx.all_types() { + let rendered = match (ty, def) { + (_, TypeDef::Opaque(opaque)) => { + let (_, rendered) = tcx_gen.gen_opaque_def(opaque, ty); + rendered + } + (_, TypeDef::Struct(struct_def)) => { + let (_, rendered) = tcx_gen.gen_struct_def(struct_def, ty); + rendered + } + + (TypeId::Enum(enum_id), TypeDef::Enum(enum_def)) => { + let (_, rendered) = tcx_gen.gen_enum_def(enum_def, enum_id); + rendered + } + _ => String::new(), + }; + + res.push_str(&rendered); + res.push_str("\n============================\n") } + insta::assert_snapshot!(res); } } diff --git a/tool/src/java/snapshots/diplomat_tool__java__test__enum.snap b/tool/src/java/snapshots/diplomat_tool__java__test__enum.snap new file mode 100644 index 000000000..8cea95a20 --- /dev/null +++ b/tool/src/java/snapshots/diplomat_tool__java__test__enum.snap @@ -0,0 +1,82 @@ +--- +source: tool/src/java/mod.rs +expression: res +--- +package dev.diplomattest.somelib; + +import dev.diplomattest.somelib.ntv.somelib_h; + + +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; + + +public enum MyEnum { + A, + B, + C, + D, + E, + F, + ; + + static MyEnum fromInt(int i) { + switch (i) { + case -2 -> { + return MyEnum.A; + } + case -1 -> { + return MyEnum.B; + } + case 0 -> { + return MyEnum.C; + } + case 1 -> { + return MyEnum.D; + } + case 2 -> { + return MyEnum.E; + } + case 3 -> { + return MyEnum.F; + } + + } + throw new RuntimeException("Unexpected int for MyEnum:" + i); + } + + int toInt() { + switch (this) { + case A -> { + return -2; + } + case B -> { + return -1; + } + case C -> { + return 0; + } + case D -> { + return 1; + } + case E -> { + return 2; + } + case F -> { + return 3; + } + + } + throw new RuntimeException("Unexpected variant for MyEnum:" + variant); + } + + + public static MyEnum getA() { + var nativeInvoker = somelib_h.MyEnum_get_a.makeInvoker(); + var nativeVal = nativeInvoker.apply(); + return MyEnum.fromInt(nativeVal) + } + +} + +============================ diff --git a/tool/src/java/snapshots/diplomat_tool__java__test__opaque.snap b/tool/src/java/snapshots/diplomat_tool__java__test__opaque.snap index 61135fcd4..4f3b23f0a 100644 --- a/tool/src/java/snapshots/diplomat_tool__java__test__opaque.snap +++ b/tool/src/java/snapshots/diplomat_tool__java__test__opaque.snap @@ -1,9 +1,136 @@ --- source: tool/src/java/mod.rs -expression: rendered +expression: res --- package dev.diplomattest.somelib; +import dev.diplomattest.somelib.ntv.somelib_h; + + +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; + + +public class OwnedStruct { + var byte count; + + + MemorySegment internal; + + private OwnedStruct() { + } + + static OwnedStruct fromSegment(MemorySegment segment) { + returnVal.internal = segment; + var returnVal = new MyStruct(); + returnVal.count = dev.diplomattest.somelib.ntv.count(segment); + + return returnVal; + } + +} + + +============================ +package dev.diplomattest.somelib; + +import dev.diplomattest.somelib.ntv.somelib_h; + + +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; + + +public class OwningStruct { + var OwnedStruct a; + var OwnedStruct b; + + + MemorySegment internal; + + private OwningStruct() { + } + + static OwningStruct fromSegment(MemorySegment segment) { + returnVal.internal = segment; + var returnVal = new MyStruct(); + returnVal.a = dev.diplomattest.somelib.ntv.a(segment); + returnVal.b = dev.diplomattest.somelib.ntv.b(segment); + + return returnVal; + } + + public static Opaque doOpaqueStuff(OwnedStruct input) { + var inputNative = input.internal; + var nativeVal = somelib_h.OwningStruct_do_opaque_stuff(inputNative); + var returnVal = new Opaque(); + returnVal.internal = nativeVal; + var cleaner = new Opaque.OpaqueCleaner(nativeVal); + returnVal.cleanable = Main.cleaner.register(returnVal, cleaner); + return returnVal; + } + +} + + +============================ +package dev.diplomattest.somelib; + +import dev.diplomattest.somelib.ntv.*; + + +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; + + +public class Float64Vec { + + MemorySegment internal; + Cleaner.Cleanable cleanable; + + static class Float64VecCleaner implements Runnable { + + MemorySegment segment; + Float64VecCleaner(MemorySegment segment) { + this.segment = segment; + } + + public void run() { + somelib_h.Float64Vec_destroy(this.segment); + } + } + + Float64Vec() {} + + public static Float64Vec new_(double[] v) { + try (var arena = Arena.ofConfined()) { + + var nativeVal = somelib_h.Float64Vec_new(); + var returnVal = new Float64Vec(); + returnVal.internal = nativeVal; + var cleaner = new Float64Vec.Float64VecCleaner(nativeVal); + returnVal.cleanable = Main.cleaner.register(returnVal, cleaner); + return returnVal; + } + } + + + public double[] asBoxedSlice() { + + var nativeVal = somelib_h.Float64Vec_as_boxed_slice(internal); + + } + + public double[] asSlice() { + + var nativeVal = somelib_h.Float64Vec_as_slice(internal); + + } + +} +============================ +package dev.diplomattest.somelib; + import dev.diplomattest.somelib.ntv.*; @@ -44,7 +171,7 @@ public class Opaque { try (var arena = Arena.ofConfined()) { var inputMemSeg = arena.allocateFrom(input, StandardCharsets.UTF_8); var inputLen = inputMemSeg.byteSize(); - var nativeVal = somelib_h.Opaque_from_str(inputMemSeg, inputLen); + var nativeVal = somelib_h.Opaque_from_str(inputMemSeg, inputLen - 1); var returnVal = new Opaque(); returnVal.internal = nativeVal; var cleaner = new Opaque.OpaqueCleaner(nativeVal); @@ -59,6 +186,12 @@ public class Opaque { return nativeVal; } + public static OwningStruct returnsImported() { + var nativeInvoker = somelib_h.Opaque_returns_imported.makeInvoker(); + var nativeVal = nativeInvoker.apply(); + return new OwningStruct(nativeVal); + } + public long internalLen() { @@ -66,4 +199,15 @@ public class Opaque { return nativeVal; } + public String getDebugStr() { + + var writeable = somelib_h.diplomat_buffer_write_create(0); + somelib_h.Opaque_get_debug_str(internal, writeable); + var buffer = DiplomatWrite.buf(writeable); + var string = buffer.getString(0, StandardCharsets.UTF_8); + somelib_h.diplomat_buffer_write_destroy(writeable); + return string; + } + } +============================ diff --git a/tool/src/java/snapshots/diplomat_tool__java__test__slice.snap b/tool/src/java/snapshots/diplomat_tool__java__test__slice.snap new file mode 100644 index 000000000..1176276a6 --- /dev/null +++ b/tool/src/java/snapshots/diplomat_tool__java__test__slice.snap @@ -0,0 +1,147 @@ +--- +source: tool/src/java/mod.rs +expression: res +--- +package dev.diplomattest.somelib; + +import dev.diplomattest.somelib.ntv.*; + + +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; + + +public class Float64Vec { + + MemorySegment internal; + Cleaner.Cleanable cleanable; + + static class Float64VecCleaner implements Runnable { + + MemorySegment segment; + Float64VecCleaner(MemorySegment segment) { + this.segment = segment; + } + + public void run() { + somelib_h.Float64Vec_destroy(this.segment); + } + } + + Float64Vec() {} + + public static Float64Vec new_(double[] v) { + try (var arena = Arena.ofConfined()) { + var vLen = v.length; + var vMemSeg = arena.allocate(JAVA_DOUBLE, vLen); + for (var i = 0; i < vLen; i++) { + vMemSeg.setAtIndex(JAVA_DOUBLE, i, v[i]); + } + var nativeVal = somelib_h.Float64Vec_new(vMemSeg, vLen); + var returnVal = new Float64Vec(); + returnVal.internal = nativeVal; + var cleaner = new Float64Vec.Float64VecCleaner(nativeVal); + returnVal.cleanable = Main.cleaner.register(returnVal, cleaner); + return returnVal; + } + } + + + public double[] asSlice() { + + var nativeVal = somelib_h.Float64Vec_as_slice(internal); + var data = dev.diplomattestsomelib.ntv.DiplomatF64View.data(nativeVal); + var len = dev.diplomattestsomelib.ntv.DiplomatF64View.len(nativeVal); + return SliceUtils.doubleSlice(nativeVal); + } + +} +============================ +package dev.diplomattest.somelib; + +import dev.diplomattest.somelib.ntv.*; + + +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; + + +public class MyString { + + MemorySegment internal; + Cleaner.Cleanable cleanable; + + static class MyStringCleaner implements Runnable { + + MemorySegment segment; + MyStringCleaner(MemorySegment segment) { + this.segment = segment; + } + + public void run() { + somelib_h.MyString_destroy(this.segment); + } + } + + MyString() {} + + public static MyString(String v) { + try (var arena = Arena.ofConfined()) { + var vMemSeg = arena.allocateFrom(v, StandardCharsets.UTF_8); + var vLen = vMemSeg.byteSize(); + var nativeVal = somelib_h.MyString_new(vMemSeg, vLen - 1); + this.internal = nativeVal; + var cleaner = new MyString.MyStringCleaner(nativeVal); + this.cleanable = Main.cleaner.register(this, cleaner); + } + } + + public static MyString newUnsafe(String v) { + try (var arena = Arena.ofConfined()) { + var vMemSeg = arena.allocateFrom(v, StandardCharsets.UTF_8); + var vLen = vMemSeg.byteSize(); + var nativeVal = somelib_h.MyString_new_unsafe(vMemSeg, vLen - 1); + var returnVal = new MyString(); + returnVal.internal = nativeVal; + var cleaner = new MyString.MyStringCleaner(nativeVal); + returnVal.cleanable = Main.cleaner.register(returnVal, cleaner); + return returnVal; + } + } + + public static MyString newOwned(String v) { + try (var arena = Arena.ofConfined()) { + var vMemSeg = arena.allocateFrom(v, StandardCharsets.UTF_8); + var vLen = vMemSeg.byteSize(); + var nativeVal = somelib_h.MyString_new_owned(vMemSeg, vLen - 1); + var returnVal = new MyString(); + returnVal.internal = nativeVal; + var cleaner = new MyString.MyStringCleaner(nativeVal); + returnVal.cleanable = Main.cleaner.register(returnVal, cleaner); + return returnVal; + } + } + + + public setStr(String newStr) { + try (var arena = Arena.ofConfined()) { + + var new_strMemSeg = arena.allocateFrom(new_str, StandardCharsets.UTF_8); + var new_strLen = new_strMemSeg.byteSize(); + var nativeVal = somelib_h.MyString_set_str(internal, new_strMemSeg, new_strLen - 1); + + } + } + + public String getStr() { + + var writeable = somelib_h.diplomat_buffer_write_create(0); + somelib_h.MyString_get_str(internal, writeable); + var buffer = DiplomatWrite.buf(writeable); + var string = buffer.getString(0, StandardCharsets.UTF_8); + somelib_h.diplomat_buffer_write_destroy(writeable); + return string; + } + +} +============================ diff --git a/tool/src/kotlin/mod.rs b/tool/src/kotlin/mod.rs index d57666ca7..4bef0d091 100644 --- a/tool/src/kotlin/mod.rs +++ b/tool/src/kotlin/mod.rs @@ -1606,12 +1606,21 @@ mod test { #[diplomat::bridge] mod ffi { #[diplomat::opaque] - struct MyOpaqueStruct<'b> { + pub struct MyOpaqueStruct<'b> { a: SomeExternalType } #[diplomat::opaque] - struct InputStruct { + pub struct InputStruct { + } + + pub struct OwnedStruct { + int: i32, + } + + pub struct OwndingStruct { + a: OwnedStruct, + b: OwnedStruct, } #[diplomat::opaque] @@ -1683,11 +1692,9 @@ mod test { } }; let tcx = new_tcx(tk_stream); - let mut all_types = tcx.all_types(); - if let (type_id, TypeDef::Opaque(opaque_def)) = all_types - .next() - .expect("Failed to generate first opaque def") - { + let all_types = tcx.all_types(); + let mut res = String::new(); + for (ty_id, def) in all_types { let eror_store = ErrorStore::default(); let formatter = KotlinFormatter::new(&tcx, None); let mut ty_gen_cx = TyGenContext { @@ -1697,16 +1704,37 @@ mod test { option_types: RefCell::new(BTreeSet::new()), errors: &eror_store, }; - let type_name = opaque_def.name.to_string(); - // test that we can render and that it doesn't panic - let (_, result) = ty_gen_cx.gen_opaque_def( - opaque_def, - type_id, - &type_name, - "dev.gigapixel", - "somelib", - ); - insta::assert_snapshot!(result) + let result = match def { + TypeDef::Opaque(opaque_def) => { + let type_name = opaque_def.name.to_string(); + // test that we can render and that it doesn't panic + let (_, result) = ty_gen_cx.gen_opaque_def( + opaque_def, + ty_id, + &type_name, + "dev.gigapixel", + "somelib", + ); + result + } + + TypeDef::Struct(struct_def) => { + let type_name = struct_def.name.to_string(); + // test that we can render and that it doesn't panic + let (_, result) = ty_gen_cx.gen_struct_def( + struct_def, + ty_id, + &type_name, + "dev.gigapixel", + "somelib", + ); + result + } + _ => String::new(), + }; + res.push_str(&result); + res.push_str("\n=======================\n") } + insta::assert_snapshot!(res) } } diff --git a/tool/src/kotlin/snapshots/diplomat_tool__kotlin__test__opaque_gen.snap b/tool/src/kotlin/snapshots/diplomat_tool__kotlin__test__opaque_gen.snap index b172e8e46..5c0651d8c 100644 --- a/tool/src/kotlin/snapshots/diplomat_tool__kotlin__test__opaque_gen.snap +++ b/tool/src/kotlin/snapshots/diplomat_tool__kotlin__test__opaque_gen.snap @@ -1,7 +1,76 @@ --- source: tool/src/kotlin/mod.rs -expression: result +expression: res --- +package dev.gigapixel.somelib + +import com.sun.jna.Library +import com.sun.jna.Native +import com.sun.jna.Pointer +import com.sun.jna.Structure + +internal interface OwndingStructLib: Library { +} + +internal class OwndingStructNative: Structure(), Structure.ByValue { + @JvmField + internal var a: OwnedStructNative = OwnedStructNative(); + @JvmField + internal var b: OwnedStructNative = OwnedStructNative(); + + // Define the fields of the struct + override fun getFieldOrder(): List { + return listOf("a", "b") + } +} + +class OwndingStruct internal constructor ( + internal val nativeStruct: OwndingStructNative) { + val a: OwnedStruct = OwnedStruct(nativeStruct.a) + val b: OwnedStruct = OwnedStruct(nativeStruct.b) + + companion object { + internal val libClass: Class = OwndingStructLib::class.java + internal val lib: OwndingStructLib = Native.load("somelib", libClass) + val NATIVESIZE: Long = Native.getNativeSize(OwndingStructNative::class.java).toLong() + } + +} + +======================= +package dev.gigapixel.somelib + +import com.sun.jna.Library +import com.sun.jna.Native +import com.sun.jna.Pointer +import com.sun.jna.Structure + +internal interface OwnedStructLib: Library { +} + +internal class OwnedStructNative: Structure(), Structure.ByValue { + @JvmField + internal var int: Int = 0; + + // Define the fields of the struct + override fun getFieldOrder(): List { + return listOf("int") + } +} + +class OwnedStruct internal constructor ( + internal val nativeStruct: OwnedStructNative) { + val int: Int = nativeStruct.int + + companion object { + internal val libClass: Class = OwnedStructLib::class.java + internal val lib: OwnedStructLib = Native.load("somelib", libClass) + val NATIVESIZE: Long = Native.getNativeSize(OwnedStructNative::class.java).toLong() + } + +} + +======================= package dev.gigapixel.somelib; import com.sun.jna.Library import com.sun.jna.Native @@ -33,3 +102,192 @@ class BorrowWrapper internal constructor ( } } + +======================= +package dev.gigapixel.somelib; +import com.sun.jna.Library +import com.sun.jna.Native +import com.sun.jna.Pointer + + +internal interface InputStructLib: Library { + fun InputStruct_destroy(handle: Pointer) +} + +class InputStruct internal constructor ( + internal val handle: Pointer, + // These ensure that anything that is borrowed is kept alive and not cleaned + // up by the garbage collector. + internal val selfEdges: List +) { + + internal class InputStructCleaner(val handle: Pointer, val lib: InputStructLib) : Runnable { + override fun run() { + lib.InputStruct_destroy(handle) + } + } + + companion object { + internal val libClass: Class = InputStructLib::class.java + internal val lib: InputStructLib = Native.load("somelib", libClass) + } + +} + +======================= +package dev.gigapixel.somelib; +import com.sun.jna.Library +import com.sun.jna.Native +import com.sun.jna.Pointer + + +internal interface MyOpaqueStructLib: Library { + fun MyOpaqueStruct_destroy(handle: Pointer) + fun MyOpaqueStruct_get_byte(): Byte + fun MyOpaqueStruct_get_string_wrapper(in1: Int): Int + fun MyOpaqueStruct_copy(handle: Pointer, borrow: Pointer): Int + fun MyOpaqueStruct_borrow_other(inp1: Pointer, inp2: Pointer, borrow: Pointer): Pointer + fun MyOpaqueStruct_create(in1: Int): Pointer + fun MyOpaqueStruct_do_stuff(handle: Pointer, in1: Int): Double + fun MyOpaqueStruct_borrow(handle: Pointer): Pointer + fun MyOpaqueStruct_borrow2(handle: Pointer): Pointer + fun MyOpaqueStruct_borrow3(handle: Pointer, write: Pointer): Unit + fun MyOpaqueStruct_borrow(other: Pointer): Pointer + fun MyOpaqueStruct_string_stuff(handle: Pointer, someStr: Slice): Pointer + fun MyOpaqueStruct_string_stuff_2(handle: Pointer, someStr: Slice): Pointer +} + +class MyOpaqueStruct internal constructor ( + internal val handle: Pointer, + // These ensure that anything that is borrowed is kept alive and not cleaned + // up by the garbage collector. + internal val selfEdges: List, + internal val bEdges: List, +) { + + internal class MyOpaqueStructCleaner(val handle: Pointer, val lib: MyOpaqueStructLib) : Runnable { + override fun run() { + lib.MyOpaqueStruct_destroy(handle) + } + } + + companion object { + internal val libClass: Class = MyOpaqueStructLib::class.java + internal val lib: MyOpaqueStructLib = Native.load("somelib", libClass) + + fun getByte(): UByte { + + val returnVal = lib.MyOpaqueStruct_get_byte(); + return returnVal.toUByte() + } + + fun getStringWrapper(in1: Int): Int { + + val returnVal = lib.MyOpaqueStruct_get_string_wrapper(in1); + return returnVal + } + + fun borrowOther(inp1: InputStruct, inp2: InputStruct, borrow: MyOpaqueStruct): MyOpaqueStruct { + + val returnVal = lib.MyOpaqueStruct_borrow_other(inp1.handle, inp2.handle, borrow.handle); + val selfEdges: List = listOf(inp1) + listOf(inp2) + listOf(borrow) + val bEdges: List = listOf(borrow) + val handle = returnVal + val returnOpaque = MyOpaqueStruct(handle, selfEdges, bEdges) + return returnOpaque + } + + fun create(in1: Int): MyOpaqueStruct { + + val returnVal = lib.MyOpaqueStruct_create(in1); + val selfEdges: List = listOf() + val bEdges: List = listOf() + val handle = returnVal + val returnOpaque = MyOpaqueStruct(handle, selfEdges, bEdges) + CLEANER.register(returnOpaque, MyOpaqueStruct.MyOpaqueStructCleaner(handle, MyOpaqueStruct.lib)); + + return returnOpaque + } + + fun borrow(other: MyOpaqueStruct): BorrowWrapper { + + val returnVal = lib.MyOpaqueStruct_borrow(other.handle); + val selfEdges: List = listOf() + val bEdges: List = listOf(other) + val aEdges: List = listOf(other) + val handle = returnVal + val returnOpaque = BorrowWrapper(handle, selfEdges, bEdges, aEdges) + CLEANER.register(returnOpaque, BorrowWrapper.BorrowWrapperCleaner(handle, BorrowWrapper.lib)); + + return returnOpaque + } + } + + fun copy(borrow: MyOpaqueStruct): Int { + + val returnVal = lib.MyOpaqueStruct_copy(handle, borrow.handle); + return returnVal + } + + fun doStuff(in1: Int): Double { + + val returnVal = lib.MyOpaqueStruct_do_stuff(handle, in1); + return returnVal + } + + fun borrow(): BorrowWrapper { + + val returnVal = lib.MyOpaqueStruct_borrow(handle); + val selfEdges: List = listOf() + val bEdges: List = listOf(this) + val aEdges: List = listOf(this) + val handle = returnVal + val returnOpaque = BorrowWrapper(handle, selfEdges, bEdges, aEdges) + CLEANER.register(returnOpaque, BorrowWrapper.BorrowWrapperCleaner(handle, BorrowWrapper.lib)); + + return returnOpaque + } + + fun borrow2(): MyOpaqueStruct { + + val returnVal = lib.MyOpaqueStruct_borrow2(handle); + val selfEdges: List = listOf(this) + val bEdges: List = listOf(this) + val handle = returnVal + val returnOpaque = MyOpaqueStruct(handle, selfEdges, bEdges) + return returnOpaque + } + + fun borrow3(): String { + val write = DW.lib.diplomat_buffer_write_create(0) + val returnVal = lib.MyOpaqueStruct_borrow3(handle, write); + + val returnString = DW.writeToString(write) + return returnString + } + + fun stringStuff(someStr: String): MyOpaqueStruct { + val (someStrMem, someStrSlice) = PrimitiveArrayTools.readUtf8(someStr) + + val returnVal = lib.MyOpaqueStruct_string_stuff(handle, someStrSlice); + val selfEdges: List = listOf(this) + listOf(someStrMem) + val bEdges: List = listOf(this) + val handle = returnVal + val returnOpaque = MyOpaqueStruct(handle, selfEdges, bEdges) + return returnOpaque + } + + fun stringStuff2(someStr: String): MyOpaqueStruct { + val (someStrMem, someStrSlice) = PrimitiveArrayTools.readUtf8(someStr) + + val returnVal = lib.MyOpaqueStruct_string_stuff_2(handle, someStrSlice); + val selfEdges: List = listOf(this) + val bEdges: List = listOf(this) + val handle = returnVal + val returnOpaque = MyOpaqueStruct(handle, selfEdges, bEdges)someStrMem.close() + return returnOpaque + } + +} + +======================= diff --git a/tool/templates/java/Enum.java.jinja b/tool/templates/java/Enum.java.jinja new file mode 100644 index 000000000..925bf5c46 --- /dev/null +++ b/tool/templates/java/Enum.java.jinja @@ -0,0 +1,41 @@ +package {{domain}}.{{lib_name}}; + +import {{domain}}.{{lib_name}}.ntv.{{lib_name}}_h; + + +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; + + +public enum {{type_name}} { + {% for variant in variants -%} + {{variant.name}}, + {% endfor %}; + + static {{type_name}} fromInt(int i) { + switch (i) { + {% for variant in variants -%} + case {{variant.index}} -> { + return {{type_name}}.{{variant.name}}; + } + {% endfor %} + } + throw new RuntimeException("Unexpected int for {{type_name}}:" + i); + } + + int toInt() { + switch (this) { + {% for variant in variants -%} + case {{variant.name}} -> { + return {{variant.index}}; + } + {% endfor %} + } + throw new RuntimeException("Unexpected variant for {{type_name}}:" + variant); + } + + {% for method in methods %} + {{method|indent(4)}} + {% endfor %} +} + diff --git a/tool/templates/java/Method.java.jinja b/tool/templates/java/Method.java.jinja index 71447f23b..dc6daa3d4 100644 --- a/tool/templates/java/Method.java.jinja +++ b/tool/templates/java/Method.java.jinja @@ -30,7 +30,7 @@ public{% if is_static %} static {% else %} {% endif %}{{return_ty}} {% if param_conversions.is_empty() -%} var nativeInvoker = {{native_method}}.makeInvoker(); {% endif -%} - var nativeVal = {{native_invocation}}( + {% if native_return_void %}{% else %}var nativeVal = {% endif %}{{native_invocation}}( {%- for conv in param_conversions -%} {{conv.converted_value}}{% if loop.last %}{% else %}, {% endif -%} {% endfor -%} diff --git a/tool/templates/java/Struct.java.jinja b/tool/templates/java/Struct.java.jinja new file mode 100644 index 000000000..48a19321f --- /dev/null +++ b/tool/templates/java/Struct.java.jinja @@ -0,0 +1,86 @@ +package {{domain}}.{{lib_name}}; + +import {{domain}}.{{lib_name}}.ntv.{{lib_name}}_h; + + +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; + + +public class {{type_name}} { + {% for field in fields -%} + var {{field.ty}} {{field.name}}; + {% endfor %} + + MemorySegment internal; + + private {{type_name}}() { + } + + static {{type_name}} fromSegment(MemorySegment segment) { + returnVal.internal = segment; + var returnVal = new MyStruct(); + {% for field in fields -%} + returnVal.{{field.name}} = {{domain}}.{{lib_name}}.ntv.{{field.name}}(segment); + {% endfor %} + return returnVal; + } + {% for method in methods %} + {{method|indent(4)}} + {% endfor %} +} + +{# +package dev.diplomattest.somelib; + +import dev.diplomattest.somelib.ntv.somelib_h; + +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; + +public class MyStruct { + byte a = 0; + boolean b = false; + byte c = 0; + long d = 0; + int e = 0; + char f = 0; + MyEnum g = MyEnum.defaultValue(); + + MemorySegment internal = null; + + MyStruct() { + } + + MyStruct(SegmentAllocator alloc, byte a, boolean b, byte c, long d, int e, char f, MyEnum g) { + var segment = dev.diplomattest.somelib.ntv.MyStruct.allocate(alloc); + dev.diplomattest.somelib.ntv.MyStruct.a(segment, a); + dev.diplomattest.somelib.ntv.MyStruct.b(segment, b); + dev.diplomattest.somelib.ntv.MyStruct.c(segment, c); + dev.diplomattest.somelib.ntv.MyStruct.d(segment, d); + dev.diplomattest.somelib.ntv.MyStruct.e(segment, e); + dev.diplomattest.somelib.ntv.MyStruct.f(segment, f); + dev.diplomattest.somelib.ntv.MyStruct.g(segment, g.toInt()); + internal = segment; + } + private MyStruct() {} + + static MyStruct fromSegment(MemorySegment segment) { + var returnVal = new MyStruct(); + returnVal.internal = segment; + returnVal.a = dev.diplomattest.somelib.ntv.MyStruct.a(segment); + returnVal.b = dev.diplomattest.somelib.ntv.MyStruct.b(segment); + returnVal.c = dev.diplomattest.somelib.ntv.MyStruct.c(segment); + returnVal.d = dev.diplomattest.somelib.ntv.MyStruct.d(segment); + returnVal.e = dev.diplomattest.somelib.ntv.MyStruct.e(segment); + returnVal.f = (char) dev.diplomattest.somelib.ntv.MyStruct.f(segment); + returnVal.g = MyEnum.fromInt(dev.diplomattest.somelib.ntv.MyStruct.g(segment)); + return returnVal; + } + MemorySegment getNativeStruct$() { + return internal; + } +} + +#} From 5272832ffcd02dc196de02b057993d6891dea187 Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Thu, 11 Jul 2024 15:25:55 +0200 Subject: [PATCH 05/69] panam-backend - semicolon --- .../somelib/src/main/java/dev/diplomattest/somelib/MyEnum.java | 2 +- tool/src/java/mod.rs | 2 +- tool/src/java/snapshots/diplomat_tool__java__test__enum.snap | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyEnum.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyEnum.java index a8578a32b..25dfb6aca 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyEnum.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyEnum.java @@ -70,7 +70,7 @@ int toInt() { public static MyEnum getA() { var nativeInvoker = somelib_h.MyEnum_get_a.makeInvoker(); var nativeVal = nativeInvoker.apply(); - return MyEnum.fromInt(nativeVal) + return MyEnum.fromInt(nativeVal); } } diff --git a/tool/src/java/mod.rs b/tool/src/java/mod.rs index 475adc2d3..04d0fa5c4 100644 --- a/tool/src/java/mod.rs +++ b/tool/src/java/mod.rs @@ -442,7 +442,7 @@ return string;"#, } hir::Type::Enum(e) => { let enum_ty = self.tcx.resolve_enum(e.tcx_id).name.as_str(); - format!(r#"return {enum_ty}.fromInt(nativeVal)"#).into() + format!(r#"return {enum_ty}.fromInt(nativeVal);"#).into() } hir::Type::Slice(ref slice) => self.gen_slice_return_conversion(slice)?, unknown => panic!("Got to unknown return type: {unknown:?}"), diff --git a/tool/src/java/snapshots/diplomat_tool__java__test__enum.snap b/tool/src/java/snapshots/diplomat_tool__java__test__enum.snap index 8cea95a20..3848add51 100644 --- a/tool/src/java/snapshots/diplomat_tool__java__test__enum.snap +++ b/tool/src/java/snapshots/diplomat_tool__java__test__enum.snap @@ -74,7 +74,7 @@ public enum MyEnum { public static MyEnum getA() { var nativeInvoker = somelib_h.MyEnum_get_a.makeInvoker(); var nativeVal = nativeInvoker.apply(); - return MyEnum.fromInt(nativeVal) + return MyEnum.fromInt(nativeVal); } } From dc8969fb13bab84f9102590583c348e66e84596e Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Wed, 17 Jul 2024 22:10:57 +0300 Subject: [PATCH 06/69] panama-backend - fixing structs --- .../dev/diplomattest/somelib/Float64Vec.java | 60 ++--- .../java/dev/diplomattest/somelib/Lib.java | 187 ++++++++++++++ .../java/dev/diplomattest/somelib/Main.java | 95 ------- .../java/dev/diplomattest/somelib/MyEnum.java | 5 +- .../dev/diplomattest/somelib/MyString.java | 102 ++++++++ .../dev/diplomattest/somelib/MyStruct.java | 73 +++--- .../java/dev/diplomattest/somelib/Opaque.java | 5 +- .../diplomattest/somelib/Float64VecTest.java | 4 +- .../diplomattest/somelib/MyStringTest.java | 25 ++ .../dev/diplomattest/somelib/OpaqueTest.java | 5 +- .../dev/diplomattest/somelib/MyStruct.kt | 4 +- tool/src/java/formatter.rs | 4 +- tool/src/java/mod.rs | 235 ++++++++++++------ ...at_tool__java__test__enum_and_struct.snap} | 55 +++- .../diplomat_tool__java__test__opaque.snap | 91 ++----- ...lomat_tool__java__test__opaque_render.snap | 4 +- .../diplomat_tool__java__test__slice.snap | 77 ++++-- tool/templates/java/Enum.java.jinja | 6 +- tool/templates/java/Main.java.jinja | 188 +++++++++++++- tool/templates/java/Method.java.jinja | 3 +- tool/templates/java/Opaque.java.jinja | 4 +- .../java/OpaqueConstructor.java.jinja | 2 +- tool/templates/java/OpaqueReturn.java.jinja | 2 +- tool/templates/java/Struct.java.jinja | 11 +- tool/templates/java/StructReturn.java.jinja | 13 + 25 files changed, 891 insertions(+), 369 deletions(-) create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Lib.java delete mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Main.java create mode 100644 feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/MyStringTest.java rename tool/src/java/snapshots/{diplomat_tool__java__test__enum.snap => diplomat_tool__java__test__enum_and_struct.snap} (51%) create mode 100644 tool/templates/java/StructReturn.java.jinja diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Float64Vec.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Float64Vec.java index f0ab5cea9..55a262f9c 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Float64Vec.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Float64Vec.java @@ -1,22 +1,14 @@ package dev.diplomattest.somelib; -import java.lang.foreign.AddressLayout; -import java.lang.foreign.Arena; -import java.lang.foreign.MemorySegment; +import dev.diplomattest.somelib.ntv.*; + +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; import java.nio.charset.StandardCharsets; -import com.sun.jna.Memory; -import com.sun.jna.Native; -import com.sun.jna.Pointer; - -import dev.diplomattest.somelib.ntv.somelib_h; - -import static java.lang.foreign.ValueLayout.JAVA_DOUBLE; - - public class Float64Vec { MemorySegment internal; @@ -25,7 +17,6 @@ public class Float64Vec { static class Float64VecCleaner implements Runnable { MemorySegment segment; - Float64VecCleaner(MemorySegment segment) { this.segment = segment; } @@ -35,31 +26,40 @@ public void run() { } } - Float64Vec() { - } - - public double[] asSLice() { - try (var arena = Arena.ofConfined()) { - var nativeVal = somelib_h.Float64Vec_as_slice(arena, internal); - var data = dev.diplomattest.somelib.ntv.DiplomatF64View.data(nativeVal); - var len = dev.diplomattest.somelib.ntv.DiplomatF64View.len(nativeVal); - return data.asSlice(0, len * JAVA_DOUBLE.byteSize()).toArray(JAVA_DOUBLE); - } - } + Float64Vec() {} public static Float64Vec new_(double[] v) { try (var arena = Arena.ofConfined()) { var vLen = v.length; - var vMemSeg = arena.allocate(JAVA_DOUBLE, vLen); - for (var i = 0; i < vLen; i++) { - vMemSeg.setAtIndex(JAVA_DOUBLE, i, v[i]); - } + var vMemSeg = arena.allocateFrom(JAVA_DOUBLE, v); var nativeVal = somelib_h.Float64Vec_new(vMemSeg, vLen); var returnVal = new Float64Vec(); returnVal.internal = nativeVal; var cleaner = new Float64Vec.Float64VecCleaner(nativeVal); - returnVal.cleanable = Main.cleaner.register(returnVal, cleaner); + returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; } } -} \ No newline at end of file + + + public double[] asBoxedSlice() { + var boxArena = Arena.ofConfined(); + + var nativeVal = somelib_h.Float64Vec_as_boxed_slice(boxArena, internal); + var data = dev.diplomattest.somelib.ntv.DiplomatF64View.data(nativeVal); + var len = dev.diplomattest.somelib.ntv.DiplomatF64View.len(nativeVal); + return SliceUtils.doubleSliceToArray(nativeVal); + } + + public double[] asSlice() { + try (var arena = Arena.ofConfined()) { + + + var nativeVal = somelib_h.Float64Vec_as_slice(arena, internal); + var data = dev.diplomattest.somelib.ntv.DiplomatF64View.data(nativeVal); + var len = dev.diplomattest.somelib.ntv.DiplomatF64View.len(nativeVal); + return SliceUtils.doubleSliceToArray(nativeVal); + } + } + +} diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Lib.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Lib.java new file mode 100644 index 000000000..10a3508a5 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Lib.java @@ -0,0 +1,187 @@ +package dev.diplomattest.somelib; + +import dev.diplomattest.somelib.ntv.*; + +import java.lang.foreign.*; +import java.lang.ref.Cleaner; +import java.nio.charset.StandardCharsets; +import java.util.function.Consumer; + +import static java.lang.foreign.ValueLayout.*; + +public class Lib { + + public sealed interface Result { + boolean isOk = false; + } + public final class Ok implements Result { + boolean isOk = true; + T value; + public Ok(T value) { + value = value; + } + } + public final class Err implements Result { + boolean isOk = false; + E err; + public Err(E err) { + err = err; + } + } + + class ResBuilder { + ResBuilder() {} + Ok Ok(T value) { + return Ok(value); + } + Err Err(E err) { + return Err(err); + } + } + + class Unit {} + static final Cleaner cleaner = Cleaner.create(); +} + +class SliceUtils { + + static byte[] byteSliceToArray(MemorySegment segment) { + var data = DiplomatU8View.data(segment); + var len = DiplomatU8View.len(segment); + var slice = data.asSlice(0, len * JAVA_BYTE.byteSize()); + return slice.toArray(JAVA_BYTE); + } + + static short[] shortSliceToArray(MemorySegment segment) { + var data = DiplomatU16View.data(segment); + var len = DiplomatU16View.len(segment); + var slice = data.asSlice(0, len * JAVA_SHORT.byteSize()); + return slice.toArray(JAVA_SHORT); + } + static int[] intSliceToArray(MemorySegment segment) { + var data = DiplomatU32View.data(segment); + var len = DiplomatU32View.len(segment); + var slice = data.asSlice(0, len * JAVA_INT.byteSize()); + return slice.toArray(JAVA_INT); + } + static long[] longSliceToArray(MemorySegment segment) { + var data = DiplomatU64View.data(segment); + var len = DiplomatU64View.len(segment); + var slice = data.asSlice(0, len * JAVA_LONG.byteSize()); + return slice.toArray(JAVA_LONG); + } + static float[] floatSliceToArray(MemorySegment segment) { + var data = DiplomatF32View.data(segment); + var len = DiplomatF32View.len(segment); + var slice = data.asSlice(0, len * JAVA_FLOAT.byteSize()); + return slice.toArray(JAVA_FLOAT); + } + + static double[] doubleSliceToArray(MemorySegment segment) { + var data = DiplomatF64View.data(segment); + var len = DiplomatF64View.len(segment); + var slice = data.asSlice(0, len * JAVA_DOUBLE.byteSize()); + return slice.toArray(JAVA_DOUBLE); + } + + static MemorySegment byteArrayToSlice(SegmentAllocator arena, byte[] array) { + var len = array.length; + var memSeg = arena.allocate(JAVA_BYTE, len); + for (var i = 0; i < len; i++) { + memSeg.setAtIndex(JAVA_BYTE, i, array[i]); + } + return memSeg; + } + + static MemorySegment shortArrayToSlice(SegmentAllocator arena, short[] array) { + var len = array.length; + var memSeg = arena.allocate(JAVA_SHORT, len); + for (var i = 0; i < len; i++) { + memSeg.setAtIndex(JAVA_SHORT, i, array[i]); + } + return memSeg; + } + + static MemorySegment intArrayToSlice(SegmentAllocator arena, int[] array) { + var len = array.length; + var memSeg = arena.allocate(JAVA_INT, len); + for (var i = 0; i < len; i++) { + memSeg.setAtIndex(JAVA_INT, i, array[i]); + } + return memSeg; + } + static MemorySegment longArrayToSlice(SegmentAllocator arena, long[] array) { + var len = array.length; + var memSeg = arena.allocate(JAVA_LONG, len); + for (var i = 0; i < len; i++) { + memSeg.setAtIndex(JAVA_LONG, i, array[i]); + } + return memSeg; + } + static MemorySegment floatArrayToSlice(SegmentAllocator arena, float[] array) { + var len = array.length; + var memSeg = arena.allocate(JAVA_FLOAT, len); + for (var i = 0; i < len; i++) { + memSeg.setAtIndex(JAVA_FLOAT, i, array[i]); + } + return memSeg; + } + + static MemorySegment doubleArrayToSlice(SegmentAllocator arena, double[] array) { + return arena.allocateFrom(JAVA_DOUBLE, array); + } + + static String readUtf8(MemorySegment segment) { + var data = DiplomatStringView.data(segment); + var len = DiplomatStringView.len(segment); + var strData = data.asSlice(0, len); + var bytes = strData.toArray(JAVA_BYTE); + var string = new String(bytes, StandardCharsets.UTF_8); + return string; + } + + static String readUtf16(MemorySegment segment) { + var data = DiplomatStringView.data(segment); + var len = DiplomatStringView.len(segment); + var strData = data.asSlice(0, len); + var bytes = strData.toArray(JAVA_BYTE); + var string = new String(bytes, StandardCharsets.UTF_16); + return string; + } + + // for parameter conversion + static MemorySegment strs16(SegmentAllocator arena, String [] strings) { + var diplomatStrsData = DiplomatStringView.allocateArray(strings.length, arena); + var layout = DiplomatStringView.layout(); + diplomatStrsData.elements(layout).forEach(new Consumer() { + int i = 0; + @Override + public void accept(MemorySegment memorySegment) { + var str = strings[i]; + var bytes = str.getBytes(StandardCharsets.UTF_16); + var data = arena.allocateFrom(JAVA_BYTE, bytes); + DiplomatStringView.data(memorySegment, data); + DiplomatStringView.len(memorySegment, bytes.length); + i++; + } + }); + return diplomatStrsData; + } + static MemorySegment strs8(SegmentAllocator arena, String [] strings) { + var diplomatStrsData = DiplomatStringView.allocateArray(strings.length, arena); + var layout = DiplomatStringView.layout(); + diplomatStrsData.elements(layout).forEach(new Consumer() { + int i = 0; + @Override + public void accept(MemorySegment memorySegment) { + var str = strings[i]; + var bytes = str.getBytes(StandardCharsets.UTF_8); + var data = arena.allocateFrom(JAVA_BYTE, bytes); + DiplomatStringView.data(memorySegment, data); + DiplomatStringView.len(memorySegment, bytes.length); + i++; + } + }); + return diplomatStrsData; + } +} \ No newline at end of file diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Main.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Main.java deleted file mode 100644 index dc8421caf..000000000 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Main.java +++ /dev/null @@ -1,95 +0,0 @@ -package dev.diplomattest.somelib; - -import dev.diplomattest.somelib.ntv.DiplomatStringsView; - -import java.lang.foreign.MemorySegment; -import java.lang.foreign.ValueLayout; -import java.lang.ref.Cleaner; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; - -//TIP To Run code, press or -// click the icon in the gutter. -public class Main { - - public sealed interface Result { - boolean isOk = false; - } - public final class Ok implements Result { - boolean isOk = true; - T value; - public Ok(T value) { - value = value; - } - } - public final class Err implements Result { - boolean isOk = false; - E err; - public Err(E err) { - err = err; - } - } - - class ResBuilder { - ResBuilder() {} - Ok Ok(T value) { - return Ok(value); - } - Err Err(E err) { - return Err(err); - } - } - - class Unit {} - static final Cleaner cleaner = Cleaner.create(); - public static void main(String[] args) { - var str = "Whaddap G"; - var opaque = Opaque.fromStr(str); - //TIP Press with your caret at the highlighted text - // to see how IntelliJ IDEA suggests fixing it. - System.out.printf("Hello and welcome!"); - - for (int i = 1; i <= 5; i++) { - //TIP Press to start debugging your code. We have set one breakpoint - // for you, but you can always add more by pressing . - System.out.println("i = " + i); - } - } - -} - -class SliceUtils { - static byte[] byteSlice(MemorySegment segment) { - return segment.toArray(ValueLayout.JAVA_BYTE); - } - static short[] shortSlice(MemorySegment segment) { - return segment.toArray(ValueLayout.JAVA_SHORT); - } - static int[] intSlice(MemorySegment segment) { - return segment.toArray(ValueLayout.JAVA_INT); - } - static long[] longSlice(MemorySegment segment) { - return segment.toArray(ValueLayout.JAVA_LONG); - } - static float[] floatSlice(MemorySegment segment) { - return segment.toArray(ValueLayout.JAVA_FLOAT); - } - static double[] doubleSlice(MemorySegment segment) { - return segment.toArray(ValueLayout.JAVA_DOUBLE); - } - static String[] stringsSlice(MemorySegment segment) { - var len = DiplomatStringsView.len(segment); - String[] returnSlice = new String[(int) len]; - for (var i = 0; i < len; i++) { - var slice = DiplomatStringsView.asSlice(segment, i); - returnSlice[i] = slice.getString(0, StandardCharsets.UTF_8); - } - return returnSlice; - } - static String readUtf8(MemorySegment segment) { - return segment.getString(0, StandardCharsets.UTF_8); - } - static String readUtf16(MemorySegment segment) { - return segment.getString(0, StandardCharsets.UTF_16); - } -} \ No newline at end of file diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyEnum.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyEnum.java index 25dfb6aca..9147a3cb0 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyEnum.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyEnum.java @@ -3,9 +3,11 @@ import dev.diplomattest.somelib.ntv.somelib_h; +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; import java.lang.ref.Cleaner; - +import static java.lang.foreign.ValueLayout.*; +import java.nio.charset.StandardCharsets; public enum MyEnum { A, @@ -74,4 +76,3 @@ public static MyEnum getA() { } } - diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyString.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyString.java index 134418943..df4ee4028 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyString.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyString.java @@ -1,4 +1,106 @@ package dev.diplomattest.somelib; +import dev.diplomattest.somelib.ntv.*; + + +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; +import java.nio.charset.StandardCharsets; + public class MyString { + + MemorySegment internal; + Cleaner.Cleanable cleanable; + + static class MyStringCleaner implements Runnable { + + MemorySegment segment; + MyStringCleaner(MemorySegment segment) { + this.segment = segment; + } + + public void run() { + somelib_h.MyString_destroy(this.segment); + } + } + + MyString() {} + + public MyString(String v) { + try (var arena = Arena.ofConfined()) { + var vMemSeg = arena.allocateFrom(v, StandardCharsets.UTF_8); + var vLen = vMemSeg.byteSize(); + var nativeVal = somelib_h.MyString_new(vMemSeg, vLen - 1); + this.internal = nativeVal; + var cleaner = new MyString.MyStringCleaner(nativeVal); + this.cleanable = Lib.cleaner.register(this, cleaner); + } + } + + public static MyString newUnsafe(String v) { + try (var arena = Arena.ofConfined()) { + var vMemSeg = arena.allocateFrom(v, StandardCharsets.UTF_8); + var vLen = vMemSeg.byteSize(); + var nativeVal = somelib_h.MyString_new_unsafe(vMemSeg, vLen - 1); + var returnVal = new MyString(); + returnVal.internal = nativeVal; + var cleaner = new MyString.MyStringCleaner(nativeVal); + returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); + return returnVal; + } + } + + public static MyString newOwned(String v) { + var vMemSeg = Arena.global().allocateFrom(v, StandardCharsets.UTF_8); + var vLen = vMemSeg.byteSize(); + var nativeVal = somelib_h.MyString_new_owned(vMemSeg, vLen - 1); + var returnVal = new MyString(); + returnVal.internal = nativeVal; + var cleaner = new MyString.MyStringCleaner(nativeVal); + returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); + return returnVal; + } + + public static MyString newFromFirst(String [] v) { + try (var arena = Arena.ofConfined()) { + var vData = SliceUtils.strs8(arena, v); + var vLen = v.length; + var nativeVal = somelib_h.MyString_new_from_first(vData, vLen); + var returnVal = new MyString(); + returnVal.internal = nativeVal; + var cleaner = new MyString.MyStringCleaner(nativeVal); + returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); + return returnVal; + } + } + + + public void setStr(String newStr) { + try (var arena = Arena.ofConfined()) { + var newStrMemSeg = arena.allocateFrom(newStr, StandardCharsets.UTF_8); + var newStrLen = newStrMemSeg.byteSize(); + somelib_h.MyString_set_str(internal, newStrMemSeg, newStrLen - 1); + + } + } + + public String getStr() { + + var writeable = somelib_h.diplomat_buffer_write_create(0); + somelib_h.MyString_get_str(internal, writeable); + var buffer = DiplomatWrite.buf(writeable); + var string = buffer.getString(0, StandardCharsets.UTF_8); + somelib_h.diplomat_buffer_write_destroy(writeable); + return string; + } + + public String getBoxedStr() { + var boxArena = Arena.ofConfined(); + + var nativeVal = somelib_h.MyString_get_boxed_str(boxArena, internal); + return SliceUtils.readUtf8(nativeVal); + } + } diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyStruct.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyStruct.java index 80b24b772..aa1fb77a1 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyStruct.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyStruct.java @@ -5,52 +5,45 @@ import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; import java.lang.foreign.SegmentAllocator; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; +import java.nio.charset.StandardCharsets; public class MyStruct { - public byte a; - public boolean b; - public byte c; - public long d; - public int e; - public char f; - public MyEnum g; - - MemorySegment internal = null; - - MyStruct(SegmentAllocator alloc, byte a, boolean b, byte c, long d, int e, char f, MyEnum g) { - var segment = dev.diplomattest.somelib.ntv.MyStruct.allocate(alloc); - dev.diplomattest.somelib.ntv.MyStruct.a(segment, a); - dev.diplomattest.somelib.ntv.MyStruct.b(segment, b); - dev.diplomattest.somelib.ntv.MyStruct.c(segment, c); - dev.diplomattest.somelib.ntv.MyStruct.d(segment, d); - dev.diplomattest.somelib.ntv.MyStruct.e(segment, e); - dev.diplomattest.somelib.ntv.MyStruct.f(segment, f); - dev.diplomattest.somelib.ntv.MyStruct.g(segment, g.toInt()); - internal = segment; + byte a; + boolean b; + byte c; + long d; + int e; + int f; + MyEnum g; + + SegmentAllocator ownArena; + + MemorySegment internal; + + private MyStruct(SegmentAllocator arena) { + ownArena = arena; } - private MyStruct() {} - - static MyStruct fromSegment(MemorySegment segment) { - var returnVal = new MyStruct(); - returnVal.internal = segment; - returnVal.a = dev.diplomattest.somelib.ntv.MyStruct.a(segment); - returnVal.b = dev.diplomattest.somelib.ntv.MyStruct.b(segment); - returnVal.c = dev.diplomattest.somelib.ntv.MyStruct.c(segment); - returnVal.d = dev.diplomattest.somelib.ntv.MyStruct.d(segment); - returnVal.e = dev.diplomattest.somelib.ntv.MyStruct.e(segment); - returnVal.f = (char) dev.diplomattest.somelib.ntv.MyStruct.f(segment); - returnVal.g = MyEnum.fromInt(dev.diplomattest.somelib.ntv.MyStruct.g(segment)); - return returnVal; + + void initFromSegment(MemorySegment segment) { + internal = segment; + a = dev.diplomattest.somelib.ntv.MyStruct.a(segment); + b = dev.diplomattest.somelib.ntv.MyStruct.b(segment); + c = dev.diplomattest.somelib.ntv.MyStruct.c(segment); + d = dev.diplomattest.somelib.ntv.MyStruct.d(segment); + e = dev.diplomattest.somelib.ntv.MyStruct.e(segment); + f = dev.diplomattest.somelib.ntv.MyStruct.f(segment); + g = MyEnum.fromInt(dev.diplomattest.somelib.ntv.MyStruct.g(segment)); } public static MyStruct new_() { - var function = somelib_h.MyStruct_new.makeInvoker(); - var arena = Arena.global(); - var nativeVal = function.apply(arena); - return MyStruct.fromSegment(nativeVal); + var arena = Arena.ofAuto(); + var nativeInvoker = somelib_h.MyStruct_new.makeInvoker(); + var nativeVal = nativeInvoker.apply(arena); + var returnVal = new MyStruct(arena); + returnVal.initFromSegment(nativeVal); + return returnVal; } - MemorySegment getNativeStruct$() { - return internal; - } } diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Opaque.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Opaque.java index 7368723ee..45bfeff7a 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Opaque.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Opaque.java @@ -5,7 +5,6 @@ import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; -import java.lang.foreign.ValueLayout; import java.lang.ref.Cleaner; import java.nio.charset.StandardCharsets; @@ -35,7 +34,7 @@ public static Opaque new_() { var returnVal = new Opaque(); returnVal.internal = nativeVal; var cleaner = new Opaque.OpaqueCleaner(nativeVal); - returnVal.cleanable = Main.cleaner.register(returnVal, cleaner); + returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; } @@ -48,7 +47,7 @@ public static Opaque fromStr(String input) { var returnVal = new Opaque(); returnVal.internal = nativeVal; var cleaner = new Opaque.OpaqueCleaner(nativeVal); - returnVal.cleanable = Main.cleaner.register(returnVal, cleaner); + returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; } } diff --git a/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/Float64VecTest.java b/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/Float64VecTest.java index 0e5ed3341..e1a5060a3 100644 --- a/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/Float64VecTest.java +++ b/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/Float64VecTest.java @@ -2,6 +2,8 @@ import org.junit.jupiter.api.Test; +import java.util.Arrays; + import static org.junit.jupiter.api.Assertions.*; class Float64VecTest { @@ -9,7 +11,7 @@ class Float64VecTest { void testFloat64Vec() { double[] dArray = {0.1, 0.2, 0.3, 0.4}; var float64Vec = Float64Vec.new_(dArray); - var outArray = float64Vec.asSLice(); + var outArray = float64Vec.asSlice(); assertEquals(dArray.length, outArray.length); for (var i = 0; i < dArray.length; i++) { assertEquals(dArray[i], outArray[i]); diff --git a/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/MyStringTest.java b/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/MyStringTest.java new file mode 100644 index 000000000..d1de3b90e --- /dev/null +++ b/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/MyStringTest.java @@ -0,0 +1,25 @@ +package dev.diplomattest.somelib; + +import org.junit.jupiter.api.Test; + +import java.util.Arrays; +import java.util.Comparator; + +import static org.junit.jupiter.api.Assertions.*; + +class MyStringTest { + + @Test + void newFromFirst() { + var str = "Hi There"; + var str1 = "Hi There 1"; + var str2 = "Hi There 2"; + var myStr0 = new MyString(str); + assertEquals(myStr0.getStr(), str); + var strs = new String[]{str, str1, str2}; + var myStr = MyString.newFromFirst(strs); + assertEquals(myStr.getStr(), str); + assertEquals(myStr.getBoxedStr(), str); + + } +} \ No newline at end of file diff --git a/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/OpaqueTest.java b/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/OpaqueTest.java index 704928c6e..ee5ac7961 100644 --- a/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/OpaqueTest.java +++ b/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/OpaqueTest.java @@ -12,9 +12,8 @@ class OpaqueTest { void testOpaque() { var input = "How do you do?"; var opaque = Opaque.fromStr(input); - System.out.println("instantiated"); - System.out.println(opaque.getDebugStr()); - System.out.println("done debuging"); + var debugStr = opaque.getDebugStr(); assertEquals(input.length(), opaque.internalLen()); + assertEquals("\"How do you do?\"", debugStr); } } \ No newline at end of file diff --git a/feature_tests/kotlin/somelib/src/main/kotlin/dev/diplomattest/somelib/MyStruct.kt b/feature_tests/kotlin/somelib/src/main/kotlin/dev/diplomattest/somelib/MyStruct.kt index 81eaef011..2a43f3884 100644 --- a/feature_tests/kotlin/somelib/src/main/kotlin/dev/diplomattest/somelib/MyStruct.kt +++ b/feature_tests/kotlin/somelib/src/main/kotlin/dev/diplomattest/somelib/MyStruct.kt @@ -60,9 +60,9 @@ class MyStruct internal constructor ( val returnVal = lib.MyStruct_returns_zst_result(); if (returnVal.isOk == 1.toByte()) { - Unit.ok() + return Unit.ok() } else { - MyZst().err() + return MyZst().err() } } } diff --git a/tool/src/java/formatter.rs b/tool/src/java/formatter.rs index 17a5ce023..b4c450d1e 100644 --- a/tool/src/java/formatter.rs +++ b/tool/src/java/formatter.rs @@ -47,7 +47,7 @@ impl<'cx> JavaFormatter<'cx> { pub fn fmt_return_type_java<'a>(&self, return_ty: &'a ReturnType) -> Cow<'a, str> { match return_ty { ReturnType::Infallible(ref success) => self.fmt_success_type_java(success), - ReturnType::Fallible(_, _) => todo!(), + ReturnType::Fallible(ref success, _) => todo!(), ReturnType::Nullable(_) => todo!(), } } @@ -56,7 +56,7 @@ impl<'cx> JavaFormatter<'cx> { match success_ty { SuccessType::Write => "String".into(), SuccessType::OutType(ref o) => self.fmt_java_type(o), - SuccessType::Unit => "".into(), + SuccessType::Unit => "void".into(), _ => todo!(), } } diff --git a/tool/src/java/mod.rs b/tool/src/java/mod.rs index 04d0fa5c4..fcc17e7fa 100644 --- a/tool/src/java/mod.rs +++ b/tool/src/java/mod.rs @@ -245,43 +245,43 @@ impl<'a, 'cx> TyGenContext<'a, 'cx> { ) -> ParamConversion<'b> { let diplomat_core::hir::Param { name, ty, .. } = param; // let java_ty = self.formatter.fmt_java_type(ty); - let Config { domain, lib_name } = &self.tcx_config; let converted_value: Cow<'b, str> = format!("{name}Native").into(); + let name = self.formatter.fmt_param_name(name.as_str()); let (conversion, converted_value) = match ty { - hir::Type::Primitive(_) => (name.as_str().into(), converted_value), + hir::Type::Primitive(_) => (name.into(), converted_value), hir::Type::Opaque(_) => (format!("{name}.internal").into(), converted_value), hir::Type::Struct(_) => ( format!(r#"var {name}Native = {name}.internal;"#).into(), converted_value, ), hir::Type::Enum(_) => todo!(), - hir::Type::Slice(Slice::Str(_, StringEncoding::UnvalidatedUtf8)) => ( - // java allocates native strings as null-terminated so we truncate the last - // character - format!( - r#"var {name}MemSeg = arena.allocateFrom({name}, StandardCharsets.UTF_8); -var {name}Len = {name}MemSeg.byteSize();"# - ) - .into(), - format!("{name}MemSeg, {name}Len - 1").into(), - ), - hir::Type::Slice(Slice::Str(_, StringEncoding::UnvalidatedUtf16)) => ( - format!( - r#"var {name}MemSeg = arena.allocateFrom({name}, StandardCharsets.UTF_16); + hir::Type::Slice(Slice::Str(borrow, StringEncoding::UnvalidatedUtf16)) => { + let arena_name = borrow.map(|_| "arena").unwrap_or("Arena.global()"); + ( + format!( + r#"var {name}MemSeg = {arena_name}.allocateFrom({name}, StandardCharsets.UTF_16); var {name}Len = {name}MemSeg.byteSize();"# + ) + .into(), + format!("{name}MemSeg, {name}Len - 1").into(), ) - .into(), - format!("{name}MemSeg, {name}Len - 1").into(), - ), - hir::Type::Slice(Slice::Str(_, StringEncoding::Utf8)) => ( - format!( - r#"var {name}MemSeg = arena.allocateFrom({name}, StandardCharsets.UTF_8); + } + hir::Type::Slice(Slice::Str( + borrow, + StringEncoding::Utf8 | StringEncoding::UnvalidatedUtf8, + )) => { + let arena_name = borrow.map(|_| "arena").unwrap_or("Arena.global()"); + ( + format!( + r#"var {name}MemSeg = {arena_name}.allocateFrom({name}, StandardCharsets.UTF_8); var {name}Len = {name}MemSeg.byteSize();"# + ) + .into(), + format!("{name}MemSeg, {name}Len - 1").into(), + // by default java native creates null terminated strings ) - .into(), - format!("{name}MemSeg, {name}Len - 1").into(), - ), - hir::Type::Slice(Slice::Primitive(_, p)) => { + } + hir::Type::Slice(Slice::Primitive(borrow, p)) => { let primitive_ty = match p { hir::PrimitiveType::Bool => "JAVA_BOOLEAN", hir::PrimitiveType::Char => "JAVA_INT", @@ -297,19 +297,32 @@ var {name}Len = {name}MemSeg.byteSize();"# hir::PrimitiveType::Float(hir::FloatType::F32) => "JAVA_FLOAT", hir::PrimitiveType::Float(hir::FloatType::F64) => "JAVA_DOUBLE", }; + let arena_name = borrow.map(|_| "arena").unwrap_or("Arena.global()"); ( format!( r#"var {name}Len = {name}.length; -var {name}MemSeg = arena.allocate({primitive_ty}, {name}Len); -for (var i = 0; i < {name}Len; i++) {{ - {name}MemSeg.setAtIndex({primitive_ty}, i, {name}[i]); -}}"# +var {name}MemSeg = {arena_name}.allocateFrom({primitive_ty}, {name});"# ) .into(), format!("{name}MemSeg, {name}Len").into(), ) } - // hir::Type::Slice(Slice::Strs(_)) => ("".into(), "".into()), + hir::Type::Slice(Slice::Strs(StringEncoding::UnvalidatedUtf16)) => ( + format!( + r#"var {name}Data = SliceUtils.strs16(arena, {name}); +var {name}Len = {name}.length;"# + ) + .into(), + format!(r#"{name}Data, {name}Len"#).into(), + ), + hir::Type::Slice(Slice::Strs(_)) => ( + format!( + r#"var {name}Data = SliceUtils.strs8(arena, {name}); +var {name}Len = {name}.length;"# + ) + .into(), + format!(r#"{name}Data, {name}Len"#).into(), + ), x => panic!("Unexpected slice type {x:?}"), }; ParamConversion { @@ -320,30 +333,15 @@ for (var i = 0; i < {name}Len; i++) {{ fn gen_slice_return_conversion(&self, ty: &Slice) -> Result, String> { let return_conversion: Cow<'cx, str> = match ty { - Slice::Str(None, _) | Slice::Primitive(None, _) => { - // We can probably do boxed returns by just relying on jna - // public double[] asBoxedSLice() { - // try (var arena = Arena.ofConfined()) { - // var nativeVal = somelib_h.Float64Vec_as_boxed_slice(arena, internal); - // var data = dev.diplomattest.somelib.ntv.DiplomatF64View.data(nativeVal); - // var len = dev.diplomattest.somelib.ntv.DiplomatF64View.len(nativeVal); - // var returnVal = data.asSlice(0, len * JAVA_DOUBLE.byteSize()).toArray(JAVA_DOUBLE); - // Native.free(data.address()); - // return returnVal; - // } - // } - return "method returns owned slice but java backend doesn't support owned slices in return position".to_string().wrap_err(); - } - Slice::Str(Some(_), StringEncoding::Utf8) => { - "return SliceUtils.readUtf8(nativeVal);".into() - } - Slice::Str(Some(_), StringEncoding::UnvalidatedUtf8) => { - "return SliceUtils.readUtf8(nativeVal);".into() - } - Slice::Str(Some(_), StringEncoding::UnvalidatedUtf16) => { - "return SliceUtils.readUtf16(nativeVal);".into() + Slice::Str(_, encoding) => match encoding { + StringEncoding::Utf8 | StringEncoding::UnvalidatedUtf8 => { + "return SliceUtils.readUtf8(nativeVal);" + } + StringEncoding::UnvalidatedUtf16 => "return SliceUtils.readUtf16(nativeVal);", + _ => unreachable!("Not a valid string encoding for diplomat"), } - Slice::Primitive(Some(_), p) => { + .into(), + Slice::Primitive(_, p) => { let lib_name = self.tcx_config.lib_name.as_ref(); let domain = self.tcx_config.domain.as_ref(); let primitive_ty = match p { @@ -369,20 +367,14 @@ for (var i = 0; i < {name}Len; i++) {{ let java_primitive_ty = self.formatter.fmt_primitive(p); format!( - r#"var data = {domain}{lib_name}.ntv.Diplomat{primitive_ty}View.data(nativeVal); -var len = {domain}{lib_name}.ntv.Diplomat{primitive_ty}View.len(nativeVal); -return SliceUtils.{java_primitive_ty}Slice(nativeVal);"# + r#"var data = {domain}.{lib_name}.ntv.Diplomat{primitive_ty}View.data(nativeVal); +var len = {domain}.{lib_name}.ntv.Diplomat{primitive_ty}View.len(nativeVal); +return SliceUtils.{java_primitive_ty}SliceToArray(nativeVal);"# ) .into() } - Slice::Strs(StringEncoding::Utf8) => { - todo!("strs utf8 not ready") - } - Slice::Strs(StringEncoding::UnvalidatedUtf8) => { - todo!("strs utf8 not ready") - } - Slice::Strs(StringEncoding::UnvalidatedUtf16) => { - todo!("strs utf16 not ready") + Slice::Strs(_) => { + panic!("[&str] not allowed in return position") } _ => todo!(), }; @@ -463,18 +455,18 @@ return string;"#, methods .iter() .filter_map(|method| -> Option<(bool, Cow<'cx, str>)> { - let method_name = match method.attrs.special_method { + let (method_name, is_valid_constructor) = match method.attrs.special_method { // We need to reserve the default constructor for internal methods so a constructor // must always have params - Some(SpecialMethod::Constructor) if !method.params.is_empty() => None, + Some(SpecialMethod::Constructor) if !method.params.is_empty() => (None, true), Some(SpecialMethod::Constructor) => { eprintln!( "Attempted to create constructor for {:?} type {:?}", method.name, ty_name ); - Some(self.formatter.fmt_method_name(method)) + (Some(self.formatter.fmt_method_name(method)), false) } - _ => Some(self.formatter.fmt_method_name(method)), + _ => (Some(self.formatter.fmt_method_name(method)), false), }; let return_ty = self.formatter.fmt_return_type_java(&method.output); @@ -507,8 +499,26 @@ return string;"#, .params .iter() .any(|diplomat_core::hir::Param { ty, .. }| { - matches!(ty, diplomat_core::hir::Type::Slice(_)) + matches!( + ty, + diplomat_core::hir::Type::Slice( + Slice::Str(Some(_), _) + | Slice::Primitive(Some(_), _) + | Slice::Strs(_) + ) + ) }); + let allocations = allocations + || match &method.output { + ReturnType::Infallible(SuccessType::OutType(o)) + | ReturnType::Fallible(SuccessType::OutType(o), _) + | ReturnType::Nullable(SuccessType::OutType(o)) => matches!( + o, + hir::Type::Slice(Slice::Str(Some(_), _) | Slice::Primitive(Some(_), _),) + ), + _ => false, + }; + let params = method .params .iter() @@ -517,13 +527,33 @@ return string;"#, ty: self.formatter.fmt_java_type(ty), }) .collect(); - let mut param_conversions: Vec<_> = method - .param_self - .iter() - .map(|_| ParamConversion { + + let boxed_return = match &method.output { + ReturnType::Fallible(SuccessType::OutType(o), _) + | ReturnType::Nullable(SuccessType::OutType(o)) + | ReturnType::Infallible(SuccessType::OutType(o)) => match o { + hir::Type::Slice(Slice::Str(None, _) | Slice::Primitive(None, _)) => { + Some(ParamConversion { + converted_value: "boxArena".into(), + conversion_def: "var boxArena = Arena.ofConfined();".into(), + }) + } + hir::Type::Slice(Slice::Str(Some(_), _) | Slice::Primitive(Some(_), _)) => { + Some(ParamConversion { + converted_value: "arena".into(), + conversion_def: "".into(), + }) + } + _ => None, + }, + _ => None, + }; + let mut param_conversions: Vec<_> = boxed_return + .into_iter() + .chain(method.param_self.iter().map(|_| ParamConversion { converted_value: "internal".into(), conversion_def: "".into(), - }) + })) .chain( method .params @@ -559,7 +589,7 @@ return string;"#, ); let method_rendered = MethodTpl { method_name, - is_static: method.param_self.is_none(), + is_static: method.param_self.is_none() && !is_valid_constructor, return_ty, native_method, native_invocation, @@ -735,10 +765,10 @@ mod test { Box::new(Self(String::from_utf8(v.into()).unwrap())) } - // #[diplomat::skip_if_ast] - // pub fn new_from_first(v: &[&DiplomatStr]) -> Box { - // Box::new(Self(core::str::from_utf8(v[0]).unwrap().into())) - // } + #[diplomat::skip_if_ast] + pub fn new_from_first(v: &[&DiplomatStr]) -> Box { + Box::new(Self(core::str::from_utf8(v[0]).unwrap().into())) + } #[diplomat::attr(supports = accessors, setter = "str")] pub fn set_str(&mut self, new_str: &DiplomatStr) { @@ -809,11 +839,51 @@ mod test { } #[test] - fn test_enum() { + fn test_enum_and_struct() { let tk_stream = quote! { #[diplomat::bridge] mod ffi { + pub struct MyStruct { + a: u8, + b: bool, + c: u8, + d: u64, + e: i32, + f: DiplomatChar, + g: MyEnum, + } + + impl MyStruct { + #[diplomat::attr(supports = constructors, constructor)] + pub fn new() -> MyStruct { + MyStruct { + a: 17, + b: true, + c: 209, + d: 1234, + e: 5991, + f: '餐' as DiplomatChar, + g: MyEnum::B, + } + } + + pub fn into_a(self) -> u8 { + self.a + } + + fn assert_value(&self) { + assert_eq!(self.a, 17); + assert!(self.b); + assert_eq!(self.c, 209); + assert_eq!(self.d, 1234); + assert_eq!(self.e, 5991); + assert_eq!(self.f, '餐' as DiplomatChar); + assert_eq!(self.g, MyEnum::B); + } + + } + #[derive(Debug, PartialEq, Eq)] pub enum MyEnum { A = -2, @@ -854,6 +924,10 @@ mod test { let mut res = String::new(); for (ty, def) in tcx.all_types() { let rendered = match (ty, def) { + (_, TypeDef::Struct(struct_def)) => { + let (_, rendered) = tcx_gen.gen_struct_def(struct_def, ty); + rendered + } (TypeId::Enum(enum_id), TypeDef::Enum(enum_def)) => { let (_, rendered) = tcx_gen.gen_enum_def(enum_def, enum_id); rendered @@ -866,6 +940,7 @@ mod test { } insta::assert_snapshot!(res); } + #[test] fn test_opaque() { let tk_stream = quote! { diff --git a/tool/src/java/snapshots/diplomat_tool__java__test__enum.snap b/tool/src/java/snapshots/diplomat_tool__java__test__enum_and_struct.snap similarity index 51% rename from tool/src/java/snapshots/diplomat_tool__java__test__enum.snap rename to tool/src/java/snapshots/diplomat_tool__java__test__enum_and_struct.snap index 3848add51..d6d22a5ba 100644 --- a/tool/src/java/snapshots/diplomat_tool__java__test__enum.snap +++ b/tool/src/java/snapshots/diplomat_tool__java__test__enum_and_struct.snap @@ -6,10 +6,61 @@ package dev.diplomattest.somelib; import dev.diplomattest.somelib.ntv.somelib_h; - +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; +import java.nio.charset.StandardCharsets; + +public class MyStruct { + byte a; + boolean b; + byte c; + long d; + int e; + int f; + MyEnum g; + + + MemorySegment internal; + + private MyStruct() { + } + + static MyStruct fromSegment(MemorySegment segment) { + var returnVal = new MyStruct(); + returnVal.internal = segment; + returnVal.a = dev.diplomattest.somelib.ntv.MyStruct.a(segment); + returnVal.b = dev.diplomattest.somelib.ntv.MyStruct.b(segment); + returnVal.c = dev.diplomattest.somelib.ntv.MyStruct.c(segment); + returnVal.d = dev.diplomattest.somelib.ntv.MyStruct.d(segment); + returnVal.e = dev.diplomattest.somelib.ntv.MyStruct.e(segment); + returnVal.f = dev.diplomattest.somelib.ntv.MyStruct.f(segment); + returnVal.g = dev.diplomattest.somelib.ntv.MyStruct.g(segment); + + return returnVal; + } + + public static MyStruct new_() { + var nativeInvoker = somelib_h.MyStruct_new.makeInvoker(); + var nativeVal = nativeInvoker.apply(); + return new MyStruct(nativeVal); + } + +} + + +============================ +package dev.diplomattest.somelib; +import dev.diplomattest.somelib.ntv.somelib_h; + + +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; +import java.nio.charset.StandardCharsets; public enum MyEnum { A, @@ -67,7 +118,7 @@ public enum MyEnum { } } - throw new RuntimeException("Unexpected variant for MyEnum:" + variant); + throw new RuntimeException("Unexpected variant for MyEnum:" + this); } diff --git a/tool/src/java/snapshots/diplomat_tool__java__test__opaque.snap b/tool/src/java/snapshots/diplomat_tool__java__test__opaque.snap index 4f3b23f0a..261ee3899 100644 --- a/tool/src/java/snapshots/diplomat_tool__java__test__opaque.snap +++ b/tool/src/java/snapshots/diplomat_tool__java__test__opaque.snap @@ -6,13 +6,14 @@ package dev.diplomattest.somelib; import dev.diplomattest.somelib.ntv.somelib_h; - +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; import java.lang.ref.Cleaner; - +import static java.lang.foreign.ValueLayout.*; +import java.nio.charset.StandardCharsets; public class OwnedStruct { - var byte count; + byte count; MemorySegment internal; @@ -21,9 +22,9 @@ public class OwnedStruct { } static OwnedStruct fromSegment(MemorySegment segment) { + var returnVal = new OwnedStruct(); returnVal.internal = segment; - var returnVal = new MyStruct(); - returnVal.count = dev.diplomattest.somelib.ntv.count(segment); + returnVal.count = dev.diplomattest.somelib.ntv.OwnedStruct.count(segment); return returnVal; } @@ -36,14 +37,15 @@ package dev.diplomattest.somelib; import dev.diplomattest.somelib.ntv.somelib_h; - +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; import java.lang.ref.Cleaner; - +import static java.lang.foreign.ValueLayout.*; +import java.nio.charset.StandardCharsets; public class OwningStruct { - var OwnedStruct a; - var OwnedStruct b; + OwnedStruct a; + OwnedStruct b; MemorySegment internal; @@ -52,10 +54,10 @@ public class OwningStruct { } static OwningStruct fromSegment(MemorySegment segment) { + var returnVal = new OwningStruct(); returnVal.internal = segment; - var returnVal = new MyStruct(); - returnVal.a = dev.diplomattest.somelib.ntv.a(segment); - returnVal.b = dev.diplomattest.somelib.ntv.b(segment); + returnVal.a = dev.diplomattest.somelib.ntv.OwningStruct.a(segment); + returnVal.b = dev.diplomattest.somelib.ntv.OwningStruct.b(segment); return returnVal; } @@ -66,7 +68,7 @@ public class OwningStruct { var returnVal = new Opaque(); returnVal.internal = nativeVal; var cleaner = new Opaque.OpaqueCleaner(nativeVal); - returnVal.cleanable = Main.cleaner.register(returnVal, cleaner); + returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; } @@ -79,64 +81,11 @@ package dev.diplomattest.somelib; import dev.diplomattest.somelib.ntv.*; +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; import java.lang.ref.Cleaner; - - -public class Float64Vec { - - MemorySegment internal; - Cleaner.Cleanable cleanable; - - static class Float64VecCleaner implements Runnable { - - MemorySegment segment; - Float64VecCleaner(MemorySegment segment) { - this.segment = segment; - } - - public void run() { - somelib_h.Float64Vec_destroy(this.segment); - } - } - - Float64Vec() {} - - public static Float64Vec new_(double[] v) { - try (var arena = Arena.ofConfined()) { - - var nativeVal = somelib_h.Float64Vec_new(); - var returnVal = new Float64Vec(); - returnVal.internal = nativeVal; - var cleaner = new Float64Vec.Float64VecCleaner(nativeVal); - returnVal.cleanable = Main.cleaner.register(returnVal, cleaner); - return returnVal; - } - } - - - public double[] asBoxedSlice() { - - var nativeVal = somelib_h.Float64Vec_as_boxed_slice(internal); - - } - - public double[] asSlice() { - - var nativeVal = somelib_h.Float64Vec_as_slice(internal); - - } - -} -============================ -package dev.diplomattest.somelib; - -import dev.diplomattest.somelib.ntv.*; - - -import java.lang.foreign.MemorySegment; -import java.lang.ref.Cleaner; - +import static java.lang.foreign.ValueLayout.*; +import java.nio.charset.StandardCharsets; public class Opaque { @@ -163,7 +112,7 @@ public class Opaque { var returnVal = new Opaque(); returnVal.internal = nativeVal; var cleaner = new Opaque.OpaqueCleaner(nativeVal); - returnVal.cleanable = Main.cleaner.register(returnVal, cleaner); + returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; } @@ -175,7 +124,7 @@ public class Opaque { var returnVal = new Opaque(); returnVal.internal = nativeVal; var cleaner = new Opaque.OpaqueCleaner(nativeVal); - returnVal.cleanable = Main.cleaner.register(returnVal, cleaner); + returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; } } diff --git a/tool/src/java/snapshots/diplomat_tool__java__test__opaque_render.snap b/tool/src/java/snapshots/diplomat_tool__java__test__opaque_render.snap index 281c12c77..f75aee4aa 100644 --- a/tool/src/java/snapshots/diplomat_tool__java__test__opaque_render.snap +++ b/tool/src/java/snapshots/diplomat_tool__java__test__opaque_render.snap @@ -7,9 +7,11 @@ package dev.diplomattest.somelib; import dev.diplomattest.somelib.ntv.*; +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; import java.lang.ref.Cleaner; - +import static java.lang.foreign.ValueLayout.*; +import java.nio.charset.StandardCharsets; public class Opaque2 { diff --git a/tool/src/java/snapshots/diplomat_tool__java__test__slice.snap b/tool/src/java/snapshots/diplomat_tool__java__test__slice.snap index 1176276a6..b1920cbd5 100644 --- a/tool/src/java/snapshots/diplomat_tool__java__test__slice.snap +++ b/tool/src/java/snapshots/diplomat_tool__java__test__slice.snap @@ -7,9 +7,11 @@ package dev.diplomattest.somelib; import dev.diplomattest.somelib.ntv.*; +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; import java.lang.ref.Cleaner; - +import static java.lang.foreign.ValueLayout.*; +import java.nio.charset.StandardCharsets; public class Float64Vec { @@ -33,26 +35,35 @@ public class Float64Vec { public static Float64Vec new_(double[] v) { try (var arena = Arena.ofConfined()) { var vLen = v.length; - var vMemSeg = arena.allocate(JAVA_DOUBLE, vLen); - for (var i = 0; i < vLen; i++) { - vMemSeg.setAtIndex(JAVA_DOUBLE, i, v[i]); - } + var vMemSeg = arena.allocateFrom(JAVA_DOUBLE, v); var nativeVal = somelib_h.Float64Vec_new(vMemSeg, vLen); var returnVal = new Float64Vec(); returnVal.internal = nativeVal; var cleaner = new Float64Vec.Float64VecCleaner(nativeVal); - returnVal.cleanable = Main.cleaner.register(returnVal, cleaner); + returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; } } - public double[] asSlice() { + public double[] asBoxedSlice() { + var boxArena = Arena.ofConfined(); - var nativeVal = somelib_h.Float64Vec_as_slice(internal); - var data = dev.diplomattestsomelib.ntv.DiplomatF64View.data(nativeVal); - var len = dev.diplomattestsomelib.ntv.DiplomatF64View.len(nativeVal); - return SliceUtils.doubleSlice(nativeVal); + var nativeVal = somelib_h.Float64Vec_as_boxed_slice(boxArena, internal); + var data = dev.diplomattest.somelib.ntv.DiplomatF64View.data(nativeVal); + var len = dev.diplomattest.somelib.ntv.DiplomatF64View.len(nativeVal); + return SliceUtils.doubleSliceToArray(nativeVal); + } + + public double[] asSlice() { + try (var arena = Arena.ofConfined()) { + + + var nativeVal = somelib_h.Float64Vec_as_slice(arena, internal); + var data = dev.diplomattest.somelib.ntv.DiplomatF64View.data(nativeVal); + var len = dev.diplomattest.somelib.ntv.DiplomatF64View.len(nativeVal); + return SliceUtils.doubleSliceToArray(nativeVal); + } } } @@ -62,9 +73,11 @@ package dev.diplomattest.somelib; import dev.diplomattest.somelib.ntv.*; +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; import java.lang.ref.Cleaner; - +import static java.lang.foreign.ValueLayout.*; +import java.nio.charset.StandardCharsets; public class MyString { @@ -85,14 +98,14 @@ public class MyString { MyString() {} - public static MyString(String v) { + public MyString(String v) { try (var arena = Arena.ofConfined()) { var vMemSeg = arena.allocateFrom(v, StandardCharsets.UTF_8); var vLen = vMemSeg.byteSize(); var nativeVal = somelib_h.MyString_new(vMemSeg, vLen - 1); this.internal = nativeVal; var cleaner = new MyString.MyStringCleaner(nativeVal); - this.cleanable = Main.cleaner.register(this, cleaner); + this.cleanable = Lib.cleaner.register(this, cleaner); } } @@ -104,31 +117,42 @@ public class MyString { var returnVal = new MyString(); returnVal.internal = nativeVal; var cleaner = new MyString.MyStringCleaner(nativeVal); - returnVal.cleanable = Main.cleaner.register(returnVal, cleaner); + returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; } } public static MyString newOwned(String v) { + var vMemSeg = Arena.global().allocateFrom(v, StandardCharsets.UTF_8); + var vLen = vMemSeg.byteSize(); + var nativeVal = somelib_h.MyString_new_owned(vMemSeg, vLen - 1); + var returnVal = new MyString(); + returnVal.internal = nativeVal; + var cleaner = new MyString.MyStringCleaner(nativeVal); + returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); + return returnVal; + } + + public static MyString newFromFirst(String [] v) { try (var arena = Arena.ofConfined()) { - var vMemSeg = arena.allocateFrom(v, StandardCharsets.UTF_8); - var vLen = vMemSeg.byteSize(); - var nativeVal = somelib_h.MyString_new_owned(vMemSeg, vLen - 1); + var vData = SliceUtils.strs8(arena, v); + var vLen = v.length; + var nativeVal = somelib_h.MyString_new_from_first(vData, vLen); var returnVal = new MyString(); returnVal.internal = nativeVal; var cleaner = new MyString.MyStringCleaner(nativeVal); - returnVal.cleanable = Main.cleaner.register(returnVal, cleaner); + returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; } } - public setStr(String newStr) { + public void setStr(String newStr) { try (var arena = Arena.ofConfined()) { - var new_strMemSeg = arena.allocateFrom(new_str, StandardCharsets.UTF_8); - var new_strLen = new_strMemSeg.byteSize(); - var nativeVal = somelib_h.MyString_set_str(internal, new_strMemSeg, new_strLen - 1); + var newStrMemSeg = arena.allocateFrom(newStr, StandardCharsets.UTF_8); + var newStrLen = newStrMemSeg.byteSize(); + somelib_h.MyString_set_str(internal, newStrMemSeg, newStrLen - 1); } } @@ -143,5 +167,12 @@ public class MyString { return string; } + public String getBoxedStr() { + var boxArena = Arena.ofConfined(); + + var nativeVal = somelib_h.MyString_get_boxed_str(boxArena, internal); + return SliceUtils.readUtf8(nativeVal); + } + } ============================ diff --git a/tool/templates/java/Enum.java.jinja b/tool/templates/java/Enum.java.jinja index 925bf5c46..04f0b0aa0 100644 --- a/tool/templates/java/Enum.java.jinja +++ b/tool/templates/java/Enum.java.jinja @@ -3,9 +3,11 @@ package {{domain}}.{{lib_name}}; import {{domain}}.{{lib_name}}.ntv.{{lib_name}}_h; +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; import java.lang.ref.Cleaner; - +import static java.lang.foreign.ValueLayout.*; +import java.nio.charset.StandardCharsets; public enum {{type_name}} { {% for variant in variants -%} @@ -31,7 +33,7 @@ public enum {{type_name}} { } {% endfor %} } - throw new RuntimeException("Unexpected variant for {{type_name}}:" + variant); + throw new RuntimeException("Unexpected variant for {{type_name}}:" + this); } {% for method in methods %} diff --git a/tool/templates/java/Main.java.jinja b/tool/templates/java/Main.java.jinja index c9432e06a..7f58d7053 100644 --- a/tool/templates/java/Main.java.jinja +++ b/tool/templates/java/Main.java.jinja @@ -1,5 +1,187 @@ -package {{domain}}.{{lib_name}} +package {{domain}}.{{lib_name}}; -public class Main { - public class Slice +import {{domain}}.{{lib_name}}.ntv.*; + +import java.lang.foreign.*; +import java.lang.ref.Cleaner; +import java.nio.charset.StandardCharsets; +import java.util.function.Consumer; + +import static java.lang.foreign.ValueLayout.*; + +public class Lib { + + public sealed interface Result { + boolean isOk = false; + } + public final class Ok implements Result { + boolean isOk = true; + T value; + public Ok(T value) { + value = value; + } + } + public final class Err implements Result { + boolean isOk = false; + E err; + public Err(E err) { + err = err; + } + } + + class ResBuilder { + ResBuilder() {} + Ok Ok(T value) { + return Ok(value); + } + Err Err(E err) { + return Err(err); + } + } + + class Unit {} + static final Cleaner cleaner = Cleaner.create(); +} + +class SliceUtils { + + static byte[] byteSliceToArray(MemorySegment segment) { + var data = DiplomatU8View.data(segment); + var len = DiplomatU8View.len(segment); + var slice = data.asSlice(0, len * JAVA_BYTE.byteSize()); + return slice.toArray(JAVA_BYTE); + } + + static short[] shortSliceToArray(MemorySegment segment) { + var data = DiplomatU16View.data(segment); + var len = DiplomatU16View.len(segment); + var slice = data.asSlice(0, len * JAVA_SHORT.byteSize()); + return slice.toArray(JAVA_SHORT); + } + static int[] intSliceToArray(MemorySegment segment) { + var data = DiplomatU32View.data(segment); + var len = DiplomatU32View.len(segment); + var slice = data.asSlice(0, len * JAVA_INT.byteSize()); + return slice.toArray(JAVA_INT); + } + static long[] longSliceToArray(MemorySegment segment) { + var data = DiplomatU64View.data(segment); + var len = DiplomatU64View.len(segment); + var slice = data.asSlice(0, len * JAVA_LONG.byteSize()); + return slice.toArray(JAVA_LONG); + } + static float[] floatSliceToArray(MemorySegment segment) { + var data = DiplomatF32View.data(segment); + var len = DiplomatF32View.len(segment); + var slice = data.asSlice(0, len * JAVA_FLOAT.byteSize()); + return slice.toArray(JAVA_FLOAT); + } + + static double[] doubleSliceToArray(MemorySegment segment) { + var data = DiplomatF64View.data(segment); + var len = DiplomatF64View.len(segment); + var slice = data.asSlice(0, len * JAVA_DOUBLE.byteSize()); + return slice.toArray(JAVA_DOUBLE); + } + + static MemorySegment byteArrayToSlice(SegmentAllocator arena, byte[] array) { + var len = array.length; + var memSeg = arena.allocate(JAVA_BYTE, len); + for (var i = 0; i < len; i++) { + memSeg.setAtIndex(JAVA_BYTE, i, array[i]); + } + return memSeg; + } + + static MemorySegment shortArrayToSlice(SegmentAllocator arena, short[] array) { + var len = array.length; + var memSeg = arena.allocate(JAVA_SHORT, len); + for (var i = 0; i < len; i++) { + memSeg.setAtIndex(JAVA_SHORT, i, array[i]); + } + return memSeg; + } + + static MemorySegment intArrayToSlice(SegmentAllocator arena, int[] array) { + var len = array.length; + var memSeg = arena.allocate(JAVA_INT, len); + for (var i = 0; i < len; i++) { + memSeg.setAtIndex(JAVA_INT, i, array[i]); + } + return memSeg; + } + static MemorySegment longArrayToSlice(SegmentAllocator arena, long[] array) { + var len = array.length; + var memSeg = arena.allocate(JAVA_LONG, len); + for (var i = 0; i < len; i++) { + memSeg.setAtIndex(JAVA_LONG, i, array[i]); + } + return memSeg; + } + static MemorySegment floatArrayToSlice(SegmentAllocator arena, float[] array) { + var len = array.length; + var memSeg = arena.allocate(JAVA_FLOAT, len); + for (var i = 0; i < len; i++) { + memSeg.setAtIndex(JAVA_FLOAT, i, array[i]); + } + return memSeg; + } + + static MemorySegment doubleArrayToSlice(SegmentAllocator arena, double[] array) { + return arena.allocateFrom(JAVA_DOUBLE, array); + } + + static String readUtf8(MemorySegment segment) { + var data = DiplomatStringView.data(segment); + var len = DiplomatStringView.len(segment); + var strData = data.asSlice(0, len); + var bytes = strData.toArray(JAVA_BYTE); + var string = new String(bytes, StandardCharsets.UTF_8); + return string; + } + + static String readUtf16(MemorySegment segment) { + var data = DiplomatStringView.data(segment); + var len = DiplomatStringView.len(segment); + var strData = data.asSlice(0, len); + var bytes = strData.toArray(JAVA_BYTE); + var string = new String(bytes, StandardCharsets.UTF_16); + return string; + } + + // for parameter conversion + static MemorySegment strs16(SegmentAllocator arena, String [] strings) { + var diplomatStrsData = DiplomatStringView.allocateArray(strings.length, arena); + var layout = DiplomatStringView.layout(); + diplomatStrsData.elements(layout).forEach(new Consumer() { + int i = 0; + @Override + public void accept(MemorySegment memorySegment) { + var str = strings[i]; + var bytes = str.getBytes(StandardCharsets.UTF_16); + var data = arena.allocateFrom(JAVA_BYTE, bytes); + DiplomatStringView.data(memorySegment, data); + DiplomatStringView.len(memorySegment, bytes.length); + i++; + } + }); + return diplomatStrsData; + } + static MemorySegment strs8(SegmentAllocator arena, String [] strings) { + var diplomatStrsData = DiplomatStringView.allocateArray(strings.length, arena); + var layout = DiplomatStringView.layout(); + diplomatStrsData.elements(layout).forEach(new Consumer() { + int i = 0; + @Override + public void accept(MemorySegment memorySegment) { + var str = strings[i]; + var bytes = str.getBytes(StandardCharsets.UTF_8); + var data = arena.allocateFrom(JAVA_BYTE, bytes); + DiplomatStringView.data(memorySegment, data); + DiplomatStringView.len(memorySegment, bytes.length); + i++; + } + }); + return diplomatStrsData; + } } diff --git a/tool/templates/java/Method.java.jinja b/tool/templates/java/Method.java.jinja index dc6daa3d4..c06fef679 100644 --- a/tool/templates/java/Method.java.jinja +++ b/tool/templates/java/Method.java.jinja @@ -8,6 +8,7 @@ public{% if is_static %} static {% else %} {% endif %}{{return_ty}} {{param.ty}} {{param.name}}{% if loop.last%}{% else %},{% endif -%} {%- endfor -%} ) { + {# need to match on the type of allocations? #} {% if allocations -%} try (var arena = Arena.ofConfined()) { {% for conv in param_conversions -%} @@ -16,7 +17,7 @@ public{% if is_static %} static {% else %} {% endif %}{{return_ty}} {% if param_conversions.is_empty() -%} var nativeInvoker = {{native_method}}.makeInvoker(); {% endif -%} - var nativeVal = {{native_invocation}}( + {% if native_return_void %}{% else %}var nativeVal = {% endif %}{{native_invocation}}( {%- for conv in param_conversions -%} {{conv.converted_value}}{% if loop.last %}{% else %}, {% endif -%} {% endfor -%} diff --git a/tool/templates/java/Opaque.java.jinja b/tool/templates/java/Opaque.java.jinja index 09b2855b2..f3acced2a 100644 --- a/tool/templates/java/Opaque.java.jinja +++ b/tool/templates/java/Opaque.java.jinja @@ -3,9 +3,11 @@ package {{domain}}.{{lib_name}}; import {{domain}}.{{lib_name}}.ntv.*; +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; import java.lang.ref.Cleaner; - +import static java.lang.foreign.ValueLayout.*; +import java.nio.charset.StandardCharsets; public class {{type_name}} { diff --git a/tool/templates/java/OpaqueConstructor.java.jinja b/tool/templates/java/OpaqueConstructor.java.jinja index 4b5deb34b..3e8578d7e 100644 --- a/tool/templates/java/OpaqueConstructor.java.jinja +++ b/tool/templates/java/OpaqueConstructor.java.jinja @@ -1,3 +1,3 @@ this.internal = nativeVal; var cleaner = new {{return_ty}}.{{return_ty}}Cleaner(nativeVal); -this.cleanable = Main.cleaner.register(this, cleaner); +this.cleanable = Lib.cleaner.register(this, cleaner); diff --git a/tool/templates/java/OpaqueReturn.java.jinja b/tool/templates/java/OpaqueReturn.java.jinja index f06c1d1a5..c119ed22a 100644 --- a/tool/templates/java/OpaqueReturn.java.jinja +++ b/tool/templates/java/OpaqueReturn.java.jinja @@ -1,5 +1,5 @@ var returnVal = new {{return_ty}}(); returnVal.internal = nativeVal; var cleaner = new {{return_ty}}.{{return_ty}}Cleaner(nativeVal); -returnVal.cleanable = Main.cleaner.register(returnVal, cleaner); +returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; diff --git a/tool/templates/java/Struct.java.jinja b/tool/templates/java/Struct.java.jinja index 48a19321f..e9a2b094b 100644 --- a/tool/templates/java/Struct.java.jinja +++ b/tool/templates/java/Struct.java.jinja @@ -2,14 +2,15 @@ package {{domain}}.{{lib_name}}; import {{domain}}.{{lib_name}}.ntv.{{lib_name}}_h; - +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; import java.lang.ref.Cleaner; - +import static java.lang.foreign.ValueLayout.*; +import java.nio.charset.StandardCharsets; public class {{type_name}} { {% for field in fields -%} - var {{field.ty}} {{field.name}}; + {{field.ty}} {{field.name}}; {% endfor %} MemorySegment internal; @@ -18,10 +19,10 @@ public class {{type_name}} { } static {{type_name}} fromSegment(MemorySegment segment) { + var returnVal = new {{type_name}}(); returnVal.internal = segment; - var returnVal = new MyStruct(); {% for field in fields -%} - returnVal.{{field.name}} = {{domain}}.{{lib_name}}.ntv.{{field.name}}(segment); + returnVal.{{field.name}} = {{domain}}.{{lib_name}}.ntv.{{type_name}}.{{field.name}}(segment); {% endfor %} return returnVal; } diff --git a/tool/templates/java/StructReturn.java.jinja b/tool/templates/java/StructReturn.java.jinja new file mode 100644 index 000000000..52660882b --- /dev/null +++ b/tool/templates/java/StructReturn.java.jinja @@ -0,0 +1,13 @@ +var returnVal = new {{return_ty}}(); +returnVal.internal = nativeVal; +var cleaner = new {{return_ty}}.{{return_ty}}Cleaner(nativeVal); +returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); +return returnVal; + + public static MyStruct new_() { + var returnVal = new MyStruct(); + var nativeInvoker = somelib_h.MyStruct_new.makeInvoker(); + var nativeVal = nativeInvoker.apply(returnVal.ownArena); + returnVal.initFromSegment(nativeVal); + return returnVal; + } From aa87b1327f47b28ecd570426456c5ad3d0c716da Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Fri, 19 Jul 2024 23:41:23 +0300 Subject: [PATCH 07/69] panama-backend - fix struct generation --- feature_tests/java/somelib/pom.xml | 2 +- .../dev/diplomattest/somelib/MyStruct.java | 31 ++++--- .../java/dev/diplomattest/somelib/Opaque.java | 9 +- .../dev/diplomattest/somelib/MyStringTest.kt | 4 + tool/src/java/mod.rs | 72 ++++++++++------ ...mat_tool__java__test__enum_and_struct.snap | 35 +++++--- .../diplomat_tool__java__test__opaque.snap | 86 ++----------------- ...lomat_tool__java__test__opaque_render.snap | 1 + .../diplomat_tool__java__test__slice.snap | 12 +++ tool/templates/java/Enum.java.jinja | 1 + tool/templates/java/Method.java.jinja | 4 +- tool/templates/java/Opaque.java.jinja | 1 + tool/templates/java/Struct.java.jinja | 71 +++------------ tool/templates/java/StructReturn.java.jinja | 14 +-- 14 files changed, 130 insertions(+), 213 deletions(-) diff --git a/feature_tests/java/somelib/pom.xml b/feature_tests/java/somelib/pom.xml index 23fcf7946..f4a38ed41 100644 --- a/feature_tests/java/somelib/pom.xml +++ b/feature_tests/java/somelib/pom.xml @@ -22,7 +22,7 @@ org.junit.jupiter junit-jupiter - RELEASE + 5.10.3 test diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyStruct.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyStruct.java index aa1fb77a1..acf6a8bbc 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyStruct.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyStruct.java @@ -4,8 +4,8 @@ import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentAllocator; import java.lang.ref.Cleaner; +import java.lang.foreign.SegmentAllocator; import static java.lang.foreign.ValueLayout.*; import java.nio.charset.StandardCharsets; @@ -18,32 +18,35 @@ public class MyStruct { int f; MyEnum g; - SegmentAllocator ownArena; MemorySegment internal; + SegmentAllocator arena; private MyStruct(SegmentAllocator arena) { - ownArena = arena; } void initFromSegment(MemorySegment segment) { - internal = segment; - a = dev.diplomattest.somelib.ntv.MyStruct.a(segment); - b = dev.diplomattest.somelib.ntv.MyStruct.b(segment); - c = dev.diplomattest.somelib.ntv.MyStruct.c(segment); - d = dev.diplomattest.somelib.ntv.MyStruct.d(segment); - e = dev.diplomattest.somelib.ntv.MyStruct.e(segment); - f = dev.diplomattest.somelib.ntv.MyStruct.f(segment); - g = MyEnum.fromInt(dev.diplomattest.somelib.ntv.MyStruct.g(segment)); + this.internal = segment; + + this.a = dev.diplomattest.somelib.ntv.MyStruct.a(segment); + this.b = dev.diplomattest.somelib.ntv.MyStruct.b(segment); + this.c = dev.diplomattest.somelib.ntv.MyStruct.c(segment); + this.d = dev.diplomattest.somelib.ntv.MyStruct.d(segment); + this.e = dev.diplomattest.somelib.ntv.MyStruct.e(segment); + this.f = dev.diplomattest.somelib.ntv.MyStruct.f(segment); + this.g = MyEnum.fromInt(dev.diplomattest.somelib.ntv.MyStruct.g(segment)); + } public static MyStruct new_() { - var arena = Arena.ofAuto(); + + var returnArena = (SegmentAllocator) Arena.ofAuto(); var nativeInvoker = somelib_h.MyStruct_new.makeInvoker(); - var nativeVal = nativeInvoker.apply(arena); - var returnVal = new MyStruct(arena); + var nativeVal = nativeInvoker.apply(returnArena); + var returnVal = new MyStruct(returnArena); returnVal.initFromSegment(nativeVal); return returnVal; } } + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Opaque.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Opaque.java index 45bfeff7a..6756ee48a 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Opaque.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Opaque.java @@ -5,10 +5,11 @@ import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; import java.nio.charset.StandardCharsets; - public class Opaque { MemorySegment internal; @@ -29,6 +30,7 @@ public void run() { Opaque() {} public static Opaque new_() { + var nativeInvoker = somelib_h.Opaque_new.makeInvoker(); var nativeVal = nativeInvoker.apply(); var returnVal = new Opaque(); @@ -39,10 +41,10 @@ public static Opaque new_() { } public static Opaque fromStr(String input) { + try (var arena = Arena.ofConfined()) { var inputMemSeg = arena.allocateFrom(input, StandardCharsets.UTF_8); var inputLen = inputMemSeg.byteSize(); - var inputMemSeg2 = inputMemSeg.asSlice(0, inputLen - 1); var nativeVal = somelib_h.Opaque_from_str(inputMemSeg, inputLen - 1); var returnVal = new Opaque(); returnVal.internal = nativeVal; @@ -53,6 +55,7 @@ public static Opaque fromStr(String input) { } public static long returnsUsize() { + var nativeInvoker = somelib_h.Opaque_returns_usize.makeInvoker(); var nativeVal = nativeInvoker.apply(); return nativeVal; @@ -60,13 +63,13 @@ public static long returnsUsize() { public long internalLen() { - var nativeVal = somelib_h.Opaque_internal_len(internal); return nativeVal; } public String getDebugStr() { + var writeable = somelib_h.diplomat_buffer_write_create(0); somelib_h.Opaque_get_debug_str(internal, writeable); var buffer = DiplomatWrite.buf(writeable); diff --git a/feature_tests/kotlin/somelib/src/test/kotlin/dev/diplomattest/somelib/MyStringTest.kt b/feature_tests/kotlin/somelib/src/test/kotlin/dev/diplomattest/somelib/MyStringTest.kt index d242221ec..85a1dffec 100644 --- a/feature_tests/kotlin/somelib/src/test/kotlin/dev/diplomattest/somelib/MyStringTest.kt +++ b/feature_tests/kotlin/somelib/src/test/kotlin/dev/diplomattest/somelib/MyStringTest.kt @@ -5,6 +5,9 @@ import kotlin.test.assertEquals class MyStringTest { + fun higherOrder( fn: (Int) -> Int, i: Int): Int { + return fn(i) + } val javaStr = "下面是一句中文" val ukrainian = "І це українською мовою" // this should be ancient egyptian for "his brother elder" @@ -13,6 +16,7 @@ class MyStringTest { val ancientEgyptian = "\uD80C\uDD6E\uD80C\uDDCC \uD80C\uDDBC\uD80C\uDC00 \uD80C\uDE7B\uD80D\uDC30\uD80C\uDFDB" @Test fun testMyString() { + val i = higherOrder({input -> 2 * input}, 10) val myString = MyString.new_(javaStr) assertEquals(javaStr, myString.getStr()) myString.setStr(ukrainian) diff --git a/tool/src/java/mod.rs b/tool/src/java/mod.rs index fcc17e7fa..dc5366b65 100644 --- a/tool/src/java/mod.rs +++ b/tool/src/java/mod.rs @@ -7,8 +7,8 @@ use std::path::Path; use askama::Template; use diplomat_core::hir::{ self, EnumDef, EnumId, EnumVariant, FloatType, IntSizeType, IntType, Method, OpaqueDef, - ReturnType, Slice, SpecialMethod, StringEncoding, StructDef, StructField, StructPathLike, - SuccessType, TypeContext, TypeDef, TypeId, + OutType, ReturnType, Slice, SpecialMethod, StringEncoding, StructDef, StructField, + StructPathLike, SuccessType, TypeContext, TypeDef, TypeId, }; use formatter::JavaFormatter; @@ -164,6 +164,7 @@ pub(crate) struct MethodTpl<'a> { is_static: bool, return_ty: Cow<'a, str>, native_method: Cow<'a, str>, + make_invoker: bool, native_invocation: Cow<'a, str>, params: Vec>, param_conversions: Vec>, @@ -185,6 +186,7 @@ pub(crate) struct StructTypeTpl<'a> { #[derive(Clone, Debug)] struct FieldTpl<'a> { name: Cow<'a, str>, + field_transform: Option>, ty: Cow<'a, str>, } @@ -430,7 +432,12 @@ return string;"#, } hir::Type::Struct(s) => { let ty_name = &self.tcx.resolve_type(s.id()).name(); - format!(r#"return new {ty_name}(nativeVal);"#).into() + format!( + r#"var returnVal = new {ty_name}(returnArena); +returnVal.initFromSegment(nativeVal); +return returnVal;"# + ) + .into() } hir::Type::Enum(e) => { let enum_ty = self.tcx.resolve_enum(e.tcx_id).name.as_str(); @@ -544,6 +551,11 @@ return string;"#, conversion_def: "".into(), }) } + hir::Type::Struct(_) => Some(ParamConversion { + converted_value: "returnArena".into(), + conversion_def: "var returnArena = (SegmentAllocator) Arena.ofAuto();" + .into(), + }), _ => None, }, _ => None, @@ -561,10 +573,13 @@ return string;"#, .map(|param| self.gen_param_conversion(param)), ) .collect(); - if let ReturnType::Fallible(SuccessType::Write, _) - | ReturnType::Infallible(SuccessType::Write) - | ReturnType::Nullable(SuccessType::Unit) = method.output - { + let write_return = matches!( + method.output, + ReturnType::Fallible(SuccessType::Write, _) + | ReturnType::Infallible(SuccessType::Write) + | ReturnType::Nullable(SuccessType::Write) + ); + if write_return { param_conversions.push(ParamConversion { converted_value: "writeable".into(), conversion_def: format!( @@ -578,7 +593,9 @@ return string;"#, self.formatter.fmt_c_method_name(ty_id, method) ) .into(); - let native_invocation = if param_conversions.is_empty() { + let make_invoker = + method.params.is_empty() && !write_return && method.param_self.is_none(); + let native_invocation = if make_invoker { "nativeInvoker.apply".into() } else { native_method.clone() @@ -593,6 +610,7 @@ return string;"#, return_ty, native_method, native_invocation, + make_invoker, params, param_conversions, return_conversion, @@ -655,8 +673,25 @@ return string;"#, .iter() .map(|StructField { name, ty, .. }| { let name = name.as_str().into(); + let struct_return = match ty { + hir::Type::Enum(enum_def) => Some( + format!("{}.fromInt", self.tcx.resolve_enum(enum_def.tcx_id).name).into(), + ), + hir::Type::Struct(struct_def) => Some( + format!( + "{}.fromSegment", + self.tcx.resolve_struct(struct_def.tcx_id).name + ) + .into(), + ), + _ => None, + }; let ty = self.formatter.fmt_java_type(ty); - FieldTpl { name, ty } + FieldTpl { + name, + ty, + field_transform: struct_return, + } }) .collect(); let (methods, _) = self.gen_methods(ty, s.name.as_str(), &s.methods); @@ -972,25 +1007,6 @@ mod test { pub fn get_debug_str(&self, write: &mut DiplomatWrite) { let _infallible = write!(write, "{:?}", &self.0); } - - pub fn returns_imported() -> OwningStruct { - unimplemented!() - } - } - - pub struct OwnedStruct { - count: u8, - } - - pub struct OwningStruct { - a: OwnedStruct, - b: OwnedStruct, - } - - impl OwningStruct { - pub fn do_opaque_stuff<'a>(input: OwnedStruct) -> Box { - unimplemented!() - } } } diff --git a/tool/src/java/snapshots/diplomat_tool__java__test__enum_and_struct.snap b/tool/src/java/snapshots/diplomat_tool__java__test__enum_and_struct.snap index d6d22a5ba..ef308314e 100644 --- a/tool/src/java/snapshots/diplomat_tool__java__test__enum_and_struct.snap +++ b/tool/src/java/snapshots/diplomat_tool__java__test__enum_and_struct.snap @@ -9,6 +9,7 @@ import dev.diplomattest.somelib.ntv.somelib_h; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; import java.lang.ref.Cleaner; +import java.lang.foreign.SegmentAllocator; import static java.lang.foreign.ValueLayout.*; import java.nio.charset.StandardCharsets; @@ -23,28 +24,32 @@ public class MyStruct { MemorySegment internal; + SegmentAllocator arena; - private MyStruct() { + private MyStruct(SegmentAllocator arena) { } - static MyStruct fromSegment(MemorySegment segment) { - var returnVal = new MyStruct(); - returnVal.internal = segment; - returnVal.a = dev.diplomattest.somelib.ntv.MyStruct.a(segment); - returnVal.b = dev.diplomattest.somelib.ntv.MyStruct.b(segment); - returnVal.c = dev.diplomattest.somelib.ntv.MyStruct.c(segment); - returnVal.d = dev.diplomattest.somelib.ntv.MyStruct.d(segment); - returnVal.e = dev.diplomattest.somelib.ntv.MyStruct.e(segment); - returnVal.f = dev.diplomattest.somelib.ntv.MyStruct.f(segment); - returnVal.g = dev.diplomattest.somelib.ntv.MyStruct.g(segment); + void initFromSegment(MemorySegment segment) { + this.internal = segment; + + this.a = dev.diplomattest.somelib.ntv.MyStruct.a(segment); + this.b = dev.diplomattest.somelib.ntv.MyStruct.b(segment); + this.c = dev.diplomattest.somelib.ntv.MyStruct.c(segment); + this.d = dev.diplomattest.somelib.ntv.MyStruct.d(segment); + this.e = dev.diplomattest.somelib.ntv.MyStruct.e(segment); + this.f = dev.diplomattest.somelib.ntv.MyStruct.f(segment); + this.g = MyEnum.fromInt(dev.diplomattest.somelib.ntv.MyStruct.g(segment)); - return returnVal; } public static MyStruct new_() { + + var returnArena = (SegmentAllocator) Arena.ofAuto(); var nativeInvoker = somelib_h.MyStruct_new.makeInvoker(); - var nativeVal = nativeInvoker.apply(); - return new MyStruct(nativeVal); + var nativeVal = nativeInvoker.apply(returnArena); + var returnVal = new MyStruct(returnArena); + returnVal.initFromSegment(nativeVal); + return returnVal; } } @@ -59,6 +64,7 @@ import dev.diplomattest.somelib.ntv.somelib_h; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; import java.lang.ref.Cleaner; +import java.lang.foreign.SegmentAllocator; import static java.lang.foreign.ValueLayout.*; import java.nio.charset.StandardCharsets; @@ -123,6 +129,7 @@ public enum MyEnum { public static MyEnum getA() { + var nativeInvoker = somelib_h.MyEnum_get_a.makeInvoker(); var nativeVal = nativeInvoker.apply(); return MyEnum.fromInt(nativeVal); diff --git a/tool/src/java/snapshots/diplomat_tool__java__test__opaque.snap b/tool/src/java/snapshots/diplomat_tool__java__test__opaque.snap index 261ee3899..e18de2450 100644 --- a/tool/src/java/snapshots/diplomat_tool__java__test__opaque.snap +++ b/tool/src/java/snapshots/diplomat_tool__java__test__opaque.snap @@ -4,85 +4,12 @@ expression: res --- package dev.diplomattest.somelib; -import dev.diplomattest.somelib.ntv.somelib_h; - -import java.lang.foreign.Arena; -import java.lang.foreign.MemorySegment; -import java.lang.ref.Cleaner; -import static java.lang.foreign.ValueLayout.*; -import java.nio.charset.StandardCharsets; - -public class OwnedStruct { - byte count; - - - MemorySegment internal; - - private OwnedStruct() { - } - - static OwnedStruct fromSegment(MemorySegment segment) { - var returnVal = new OwnedStruct(); - returnVal.internal = segment; - returnVal.count = dev.diplomattest.somelib.ntv.OwnedStruct.count(segment); - - return returnVal; - } - -} - - -============================ -package dev.diplomattest.somelib; - -import dev.diplomattest.somelib.ntv.somelib_h; - -import java.lang.foreign.Arena; -import java.lang.foreign.MemorySegment; -import java.lang.ref.Cleaner; -import static java.lang.foreign.ValueLayout.*; -import java.nio.charset.StandardCharsets; - -public class OwningStruct { - OwnedStruct a; - OwnedStruct b; - - - MemorySegment internal; - - private OwningStruct() { - } - - static OwningStruct fromSegment(MemorySegment segment) { - var returnVal = new OwningStruct(); - returnVal.internal = segment; - returnVal.a = dev.diplomattest.somelib.ntv.OwningStruct.a(segment); - returnVal.b = dev.diplomattest.somelib.ntv.OwningStruct.b(segment); - - return returnVal; - } - - public static Opaque doOpaqueStuff(OwnedStruct input) { - var inputNative = input.internal; - var nativeVal = somelib_h.OwningStruct_do_opaque_stuff(inputNative); - var returnVal = new Opaque(); - returnVal.internal = nativeVal; - var cleaner = new Opaque.OpaqueCleaner(nativeVal); - returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); - return returnVal; - } - -} - - -============================ -package dev.diplomattest.somelib; - import dev.diplomattest.somelib.ntv.*; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; import java.lang.ref.Cleaner; import static java.lang.foreign.ValueLayout.*; import java.nio.charset.StandardCharsets; @@ -107,6 +34,7 @@ public class Opaque { Opaque() {} public static Opaque new_() { + var nativeInvoker = somelib_h.Opaque_new.makeInvoker(); var nativeVal = nativeInvoker.apply(); var returnVal = new Opaque(); @@ -117,6 +45,7 @@ public class Opaque { } public static Opaque fromStr(String input) { + try (var arena = Arena.ofConfined()) { var inputMemSeg = arena.allocateFrom(input, StandardCharsets.UTF_8); var inputLen = inputMemSeg.byteSize(); @@ -130,26 +59,23 @@ public class Opaque { } public static long returnsUsize() { + var nativeInvoker = somelib_h.Opaque_returns_usize.makeInvoker(); var nativeVal = nativeInvoker.apply(); return nativeVal; } - public static OwningStruct returnsImported() { - var nativeInvoker = somelib_h.Opaque_returns_imported.makeInvoker(); - var nativeVal = nativeInvoker.apply(); - return new OwningStruct(nativeVal); - } - public long internalLen() { + var nativeVal = somelib_h.Opaque_internal_len(internal); return nativeVal; } public String getDebugStr() { + var writeable = somelib_h.diplomat_buffer_write_create(0); somelib_h.Opaque_get_debug_str(internal, writeable); var buffer = DiplomatWrite.buf(writeable); diff --git a/tool/src/java/snapshots/diplomat_tool__java__test__opaque_render.snap b/tool/src/java/snapshots/diplomat_tool__java__test__opaque_render.snap index f75aee4aa..488c59f04 100644 --- a/tool/src/java/snapshots/diplomat_tool__java__test__opaque_render.snap +++ b/tool/src/java/snapshots/diplomat_tool__java__test__opaque_render.snap @@ -9,6 +9,7 @@ import dev.diplomattest.somelib.ntv.*; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; import java.lang.ref.Cleaner; import static java.lang.foreign.ValueLayout.*; import java.nio.charset.StandardCharsets; diff --git a/tool/src/java/snapshots/diplomat_tool__java__test__slice.snap b/tool/src/java/snapshots/diplomat_tool__java__test__slice.snap index b1920cbd5..87d78ea20 100644 --- a/tool/src/java/snapshots/diplomat_tool__java__test__slice.snap +++ b/tool/src/java/snapshots/diplomat_tool__java__test__slice.snap @@ -9,6 +9,7 @@ import dev.diplomattest.somelib.ntv.*; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; import java.lang.ref.Cleaner; import static java.lang.foreign.ValueLayout.*; import java.nio.charset.StandardCharsets; @@ -33,6 +34,7 @@ public class Float64Vec { Float64Vec() {} public static Float64Vec new_(double[] v) { + try (var arena = Arena.ofConfined()) { var vLen = v.length; var vMemSeg = arena.allocateFrom(JAVA_DOUBLE, v); @@ -47,6 +49,7 @@ public class Float64Vec { public double[] asBoxedSlice() { + var boxArena = Arena.ofConfined(); var nativeVal = somelib_h.Float64Vec_as_boxed_slice(boxArena, internal); @@ -56,6 +59,7 @@ public class Float64Vec { } public double[] asSlice() { + try (var arena = Arena.ofConfined()) { @@ -75,6 +79,7 @@ import dev.diplomattest.somelib.ntv.*; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; import java.lang.ref.Cleaner; import static java.lang.foreign.ValueLayout.*; import java.nio.charset.StandardCharsets; @@ -99,6 +104,7 @@ public class MyString { MyString() {} public MyString(String v) { + try (var arena = Arena.ofConfined()) { var vMemSeg = arena.allocateFrom(v, StandardCharsets.UTF_8); var vLen = vMemSeg.byteSize(); @@ -110,6 +116,7 @@ public class MyString { } public static MyString newUnsafe(String v) { + try (var arena = Arena.ofConfined()) { var vMemSeg = arena.allocateFrom(v, StandardCharsets.UTF_8); var vLen = vMemSeg.byteSize(); @@ -123,6 +130,7 @@ public class MyString { } public static MyString newOwned(String v) { + var vMemSeg = Arena.global().allocateFrom(v, StandardCharsets.UTF_8); var vLen = vMemSeg.byteSize(); var nativeVal = somelib_h.MyString_new_owned(vMemSeg, vLen - 1); @@ -134,6 +142,7 @@ public class MyString { } public static MyString newFromFirst(String [] v) { + try (var arena = Arena.ofConfined()) { var vData = SliceUtils.strs8(arena, v); var vLen = v.length; @@ -148,6 +157,7 @@ public class MyString { public void setStr(String newStr) { + try (var arena = Arena.ofConfined()) { var newStrMemSeg = arena.allocateFrom(newStr, StandardCharsets.UTF_8); @@ -159,6 +169,7 @@ public class MyString { public String getStr() { + var writeable = somelib_h.diplomat_buffer_write_create(0); somelib_h.MyString_get_str(internal, writeable); var buffer = DiplomatWrite.buf(writeable); @@ -168,6 +179,7 @@ public class MyString { } public String getBoxedStr() { + var boxArena = Arena.ofConfined(); var nativeVal = somelib_h.MyString_get_boxed_str(boxArena, internal); diff --git a/tool/templates/java/Enum.java.jinja b/tool/templates/java/Enum.java.jinja index 04f0b0aa0..d8fe2d47e 100644 --- a/tool/templates/java/Enum.java.jinja +++ b/tool/templates/java/Enum.java.jinja @@ -6,6 +6,7 @@ import {{domain}}.{{lib_name}}.ntv.{{lib_name}}_h; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; import java.lang.ref.Cleaner; +import java.lang.foreign.SegmentAllocator; import static java.lang.foreign.ValueLayout.*; import java.nio.charset.StandardCharsets; diff --git a/tool/templates/java/Method.java.jinja b/tool/templates/java/Method.java.jinja index c06fef679..73204d5fd 100644 --- a/tool/templates/java/Method.java.jinja +++ b/tool/templates/java/Method.java.jinja @@ -14,7 +14,7 @@ public{% if is_static %} static {% else %} {% endif %}{{return_ty}} {% for conv in param_conversions -%} {{conv.conversion_def|indent(8)}} {% endfor -%} - {% if param_conversions.is_empty() -%} + {% if make_invoker -%} var nativeInvoker = {{native_method}}.makeInvoker(); {% endif -%} {% if native_return_void %}{% else %}var nativeVal = {% endif %}{{native_invocation}}( @@ -28,7 +28,7 @@ public{% if is_static %} static {% else %} {% endif %}{{return_ty}} {% for conv in param_conversions -%} {{conv.conversion_def|indent(4)}} {% endfor -%} - {% if param_conversions.is_empty() -%} + {% if make_invoker -%} var nativeInvoker = {{native_method}}.makeInvoker(); {% endif -%} {% if native_return_void %}{% else %}var nativeVal = {% endif %}{{native_invocation}}( diff --git a/tool/templates/java/Opaque.java.jinja b/tool/templates/java/Opaque.java.jinja index f3acced2a..c82261bb5 100644 --- a/tool/templates/java/Opaque.java.jinja +++ b/tool/templates/java/Opaque.java.jinja @@ -5,6 +5,7 @@ import {{domain}}.{{lib_name}}.ntv.*; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; import java.lang.ref.Cleaner; import static java.lang.foreign.ValueLayout.*; import java.nio.charset.StandardCharsets; diff --git a/tool/templates/java/Struct.java.jinja b/tool/templates/java/Struct.java.jinja index e9a2b094b..db7070420 100644 --- a/tool/templates/java/Struct.java.jinja +++ b/tool/templates/java/Struct.java.jinja @@ -5,6 +5,7 @@ import {{domain}}.{{lib_name}}.ntv.{{lib_name}}_h; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; import java.lang.ref.Cleaner; +import java.lang.foreign.SegmentAllocator; import static java.lang.foreign.ValueLayout.*; import java.nio.charset.StandardCharsets; @@ -14,74 +15,26 @@ public class {{type_name}} { {% endfor %} MemorySegment internal; + SegmentAllocator arena; - private {{type_name}}() { + private {{type_name}}(SegmentAllocator arena) { } - static {{type_name}} fromSegment(MemorySegment segment) { - var returnVal = new {{type_name}}(); - returnVal.internal = segment; + void initFromSegment(MemorySegment segment) { + this.internal = segment; + {% for field in fields -%} - returnVal.{{field.name}} = {{domain}}.{{lib_name}}.ntv.{{type_name}}.{{field.name}}(segment); + this.{{field.name}} = {% match field.field_transform -%} + {% when Some with (transform) -%} + {{transform}}({{domain}}.{{lib_name}}.ntv.{{type_name}}.{{field.name}}(segment)); + {% when None -%} + {{domain}}.{{lib_name}}.ntv.{{type_name}}.{{field.name}}(segment); + {% endmatch -%} {% endfor %} - return returnVal; } {% for method in methods %} {{method|indent(4)}} {% endfor %} } -{# -package dev.diplomattest.somelib; - -import dev.diplomattest.somelib.ntv.somelib_h; - -import java.lang.foreign.Arena; -import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentAllocator; - -public class MyStruct { - byte a = 0; - boolean b = false; - byte c = 0; - long d = 0; - int e = 0; - char f = 0; - MyEnum g = MyEnum.defaultValue(); - - MemorySegment internal = null; - - MyStruct() { - } - - MyStruct(SegmentAllocator alloc, byte a, boolean b, byte c, long d, int e, char f, MyEnum g) { - var segment = dev.diplomattest.somelib.ntv.MyStruct.allocate(alloc); - dev.diplomattest.somelib.ntv.MyStruct.a(segment, a); - dev.diplomattest.somelib.ntv.MyStruct.b(segment, b); - dev.diplomattest.somelib.ntv.MyStruct.c(segment, c); - dev.diplomattest.somelib.ntv.MyStruct.d(segment, d); - dev.diplomattest.somelib.ntv.MyStruct.e(segment, e); - dev.diplomattest.somelib.ntv.MyStruct.f(segment, f); - dev.diplomattest.somelib.ntv.MyStruct.g(segment, g.toInt()); - internal = segment; - } - private MyStruct() {} - - static MyStruct fromSegment(MemorySegment segment) { - var returnVal = new MyStruct(); - returnVal.internal = segment; - returnVal.a = dev.diplomattest.somelib.ntv.MyStruct.a(segment); - returnVal.b = dev.diplomattest.somelib.ntv.MyStruct.b(segment); - returnVal.c = dev.diplomattest.somelib.ntv.MyStruct.c(segment); - returnVal.d = dev.diplomattest.somelib.ntv.MyStruct.d(segment); - returnVal.e = dev.diplomattest.somelib.ntv.MyStruct.e(segment); - returnVal.f = (char) dev.diplomattest.somelib.ntv.MyStruct.f(segment); - returnVal.g = MyEnum.fromInt(dev.diplomattest.somelib.ntv.MyStruct.g(segment)); - return returnVal; - } - MemorySegment getNativeStruct$() { - return internal; - } -} -#} diff --git a/tool/templates/java/StructReturn.java.jinja b/tool/templates/java/StructReturn.java.jinja index 52660882b..08d171b7f 100644 --- a/tool/templates/java/StructReturn.java.jinja +++ b/tool/templates/java/StructReturn.java.jinja @@ -1,13 +1,3 @@ -var returnVal = new {{return_ty}}(); -returnVal.internal = nativeVal; -var cleaner = new {{return_ty}}.{{return_ty}}Cleaner(nativeVal); -returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); +var returnVal = new {{return_ty}}(returnArena); +returnVal.initFromSegment(nativeVal); return returnVal; - - public static MyStruct new_() { - var returnVal = new MyStruct(); - var nativeInvoker = somelib_h.MyStruct_new.makeInvoker(); - var nativeVal = nativeInvoker.apply(returnVal.ownArena); - returnVal.initFromSegment(nativeVal); - return returnVal; - } From c3cb18f4ba0f0c164bf5b8137b674d9ed68b2866 Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Thu, 1 Aug 2024 21:06:49 +0300 Subject: [PATCH 08/69] panama-backend - basic lifetime bounds --- .../java/dev/diplomattest/somelib/Opaque.java | 2 + feature_tests/src/lifetimes.rs | 29 +- tool/src/java/formatter.rs | 12 +- tool/src/java/mod.rs | 262 ++++++++++++--- ...mat_tool__java__test__enum_and_struct.snap | 5 + .../diplomat_tool__java__test__lifetimes.snap | 297 ++++++++++++++++++ .../diplomat_tool__java__test__opaque.snap | 6 + ...lomat_tool__java__test__opaque_render.snap | 4 + .../diplomat_tool__java__test__slice.snap | 12 + tool/templates/java/Opaque.java.jinja | 6 + tool/templates/java/OpaqueReturn.java.jinja | 3 + tool/templates/java/Struct.java.jinja | 6 + 12 files changed, 588 insertions(+), 56 deletions(-) create mode 100644 tool/src/java/snapshots/diplomat_tool__java__test__lifetimes.snap diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Opaque.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Opaque.java index 6756ee48a..1a4a63206 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Opaque.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Opaque.java @@ -9,11 +9,13 @@ import java.lang.ref.Cleaner; import static java.lang.foreign.ValueLayout.*; import java.nio.charset.StandardCharsets; +import java.util.List; public class Opaque { MemorySegment internal; Cleaner.Cleanable cleanable; + List selfEdges = List.of(); static class OpaqueCleaner implements Runnable { diff --git a/feature_tests/src/lifetimes.rs b/feature_tests/src/lifetimes.rs index 45e8d5e45..ad039326f 100644 --- a/feature_tests/src/lifetimes.rs +++ b/feature_tests/src/lifetimes.rs @@ -66,25 +66,25 @@ pub mod ffi { impl<'x> BorrowedFields<'x> { pub fn from_bar_and_strings( bar: &'x Bar<'x, 'x>, - dstr16: &'x DiplomatStr16, + utf16_str: &'x DiplomatStr16, utf8_str: &'x str, ) -> Self { BorrowedFields { - a: dstr16, + a: utf16_str, b: bar.0 .0, c: utf8_str, } } } - impl<'x, 'y: 'x, 'z: 'y> BorrowedFieldsWithBounds<'x, 'y, 'z> { + impl<'x, 'y: 'x, 'z> BorrowedFieldsWithBounds<'x, 'y, 'z> { pub fn from_foo_and_strings( foo: &'x Foo<'y>, - dstr16_x: &'x DiplomatStr16, + utf16_str_x: &'x DiplomatStr16, utf8_str_z: &'z str, ) -> Self { BorrowedFieldsWithBounds { - field_a: dstr16_x, + field_a: utf16_str_x, field_b: foo.0, field_c: utf8_str_z, } @@ -101,15 +101,22 @@ pub mod ffi { pub fn from_bar_and_foo_and_strings( bar: &'x Bar<'x, 'y>, foo: &'z Foo<'z>, - dstr16_x: &'x DiplomatStr16, - dstr16_z: &'z DiplomatStr16, + utf16_str_x: &'x DiplomatStr16, + utf16_str_z: &'z DiplomatStr16, utf8_str_y: &'y str, utf8_str_z: &'z str, ) -> Self { - let fields = BorrowedFields::from_bar_and_strings(bar, dstr16_x, utf8_str_y); - let bounds = - BorrowedFieldsWithBounds::from_foo_and_strings(bar.0, dstr16_x, utf8_str_y); - let bounds2 = BorrowedFieldsWithBounds::from_foo_and_strings(foo, dstr16_z, utf8_str_z); + let fields = BorrowedFields::from_bar_and_strings(bar, utf16_str_x, utf8_str_y); + let bounds = BorrowedFieldsWithBounds { + field_a: utf16_str_x, + field_b: bar.0 .0, + field_c: utf8_str_y, + }; + let bounds2 = BorrowedFieldsWithBounds { + field_a: utf16_str_z, + field_b: foo.0, + field_c: utf8_str_z, + }; Self { fields, bounds, diff --git a/tool/src/java/formatter.rs b/tool/src/java/formatter.rs index b4c450d1e..5303c3966 100644 --- a/tool/src/java/formatter.rs +++ b/tool/src/java/formatter.rs @@ -16,7 +16,7 @@ pub(crate) struct JavaFormatter<'cx> { pub c: CFormatter<'cx>, } -const INVALID_METHOD_NAMES: &[&str] = &[ +const INVALID_NAMES: &[&str] = &[ "new", "static", "default", "private", "internal", "toString", ]; @@ -34,10 +34,18 @@ impl<'cx> JavaFormatter<'cx> { self.c.fmt_method_name(ty, method).into() } + pub fn fmt_field_name<'a>(&self, field: &'a hir::StructField) -> Cow<'a, str> { + let name = field.name.as_str().to_lower_camel_case(); + if INVALID_NAMES.contains(&&*name) { + format!("{name}_").into() + } else { + name.into() + } + } pub fn fmt_method_name<'a>(&self, method: &'a hir::Method) -> Cow<'a, str> { let name = method.name.as_str().to_lower_camel_case(); let name = method.attrs.rename.apply(name.into()); - if INVALID_METHOD_NAMES.contains(&&*name) { + if INVALID_NAMES.contains(&&*name) { format!("{name}_").into() } else { name diff --git a/tool/src/java/mod.rs b/tool/src/java/mod.rs index dc5366b65..9228882b5 100644 --- a/tool/src/java/mod.rs +++ b/tool/src/java/mod.rs @@ -6,8 +6,8 @@ use std::path::Path; use askama::Template; use diplomat_core::hir::{ - self, EnumDef, EnumId, EnumVariant, FloatType, IntSizeType, IntType, Method, OpaqueDef, - OutType, ReturnType, Slice, SpecialMethod, StringEncoding, StructDef, StructField, + self, EnumDef, EnumId, EnumVariant, FloatType, IntSizeType, IntType, MaybeStatic, Method, + OpaqueDef, ReturnType, Slice, SpecialMethod, StringEncoding, StructDef, StructField, StructPathLike, SuccessType, TypeContext, TypeDef, TypeId, }; use formatter::JavaFormatter; @@ -135,8 +135,6 @@ pub fn run( // let type_name = o.name.to_string(); // let (file_name, body) = ty_gen_cx.gen_opaque_def(o, id, GROUP, LIBRARY); - - // files.add_file(format!("src/main/kotlin/{file_name}"), body); } _ => continue, } @@ -179,6 +177,7 @@ pub(crate) struct StructTypeTpl<'a> { type_name: Cow<'a, str>, lib_name: Cow<'a, str>, domain: Cow<'a, str>, + edges: Vec>, fields: Vec>, methods: Vec>, } @@ -212,6 +211,7 @@ pub(crate) struct OpaqueTypeTpl<'a> { type_name: Cow<'a, str>, lib_name: Cow<'a, str>, domain: Cow<'a, str>, + edges: Vec>, static_methods: Vec>, class_methods: Vec>, } @@ -219,6 +219,7 @@ pub(crate) struct OpaqueTypeTpl<'a> { #[derive(Template, Clone, Debug)] #[template(path = "java/OpaqueReturn.java.jinja", escape = "none")] pub(crate) struct OpaqueReturnTpl<'a> { + lifetime_edges: Vec, return_ty: Cow<'a, str>, } @@ -383,7 +384,11 @@ return SliceUtils.{java_primitive_ty}SliceToArray(nativeVal);"# return_conversion.wrap_ok() } - fn gen_return_conversion(&self, ty: &ReturnType) -> Result, String> { + fn gen_return_conversion( + &self, + ty: &ReturnType, + lifetime_edges: Vec, + ) -> Result, String> { let Config { lib_name, .. } = &self.tcx_config; let ret = match ty { ReturnType::Infallible(ref ret) => ret, @@ -419,6 +424,7 @@ return string;"#, hir::Type::Opaque(o) => { let ty_name = &self.tcx.resolve_opaque(o.tcx_id).name; OpaqueReturnTpl { + lifetime_edges, return_ty: ty_name.as_str().into(), } .render() @@ -432,8 +438,10 @@ return string;"#, } hir::Type::Struct(s) => { let ty_name = &self.tcx.resolve_type(s.id()).name(); + let lifetime_edges = lifetime_edges.join("\n"); format!( r#"var returnVal = new {ty_name}(returnArena); +{lifetime_edges} returnVal.initFromSegment(nativeVal); return returnVal;"# ) @@ -456,12 +464,14 @@ return returnVal;"# ty_name: &str, methods: &[Method], ) -> (Vec>, Vec>) { - let Config { domain, lib_name } = &self.tcx_config; + let Config { lib_name, .. } = &self.tcx_config; let mut static_methods = Vec::new(); let mut class_methods = Vec::new(); methods .iter() .filter_map(|method| -> Option<(bool, Cow<'cx, str>)> { + let mut visitor = method.borrowing_param_visitor(self.tcx); + let (method_name, is_valid_constructor) = match method.attrs.special_method { // We need to reserve the default constructor for internal methods so a constructor // must always have params @@ -477,6 +487,76 @@ return returnVal;"# }; let return_ty = self.formatter.fmt_return_type_java(&method.output); + + if let Some(param) = &method.param_self { + visitor.visit_param(¶m.ty.clone().into(), "this"); + } + let params = method + .params + .iter() + .map(|diplomat_core::hir::Param { name, ty, .. }| { + let name: Cow = self.formatter.fmt_param_name(name.as_str()).into(); + visitor.visit_param(ty, name.as_ref()); + Param { + name, + ty: self.formatter.fmt_java_type(ty), + } + }) + .collect(); + let lt_lookup = visitor.borrow_map(); + let (lifetime_edges, boxed_return) = match &method.output { + ReturnType::Fallible(SuccessType::OutType(o), _) + | ReturnType::Nullable(SuccessType::OutType(o)) + | ReturnType::Infallible(SuccessType::OutType(o)) => { + let boxed_return = match o { + hir::Type::Slice(Slice::Str(None, _) | Slice::Primitive(None, _)) => { + Some(ParamConversion { + converted_value: "boxArena".into(), + conversion_def: "var boxArena = Arena.ofConfined();".into(), + }) + } + hir::Type::Slice( + Slice::Str(Some(_), _) | Slice::Primitive(Some(_), _), + ) => Some(ParamConversion { + converted_value: "arena".into(), + conversion_def: "".into(), + }), + hir::Type::Struct(_) => Some(ParamConversion { + converted_value: "returnArena".into(), + conversion_def: + "var returnArena = (SegmentAllocator) Arena.ofAuto();".into(), + }), + _ => None, + }; + let method_lts = &method.lifetime_env; + let lifetime_edges = o + .lifetimes() + .filter_map(|lt| match lt { + MaybeStatic::Static => None, + MaybeStatic::NonStatic(lt) => Some(lt), + }) + .filter_map(|lt| lt_lookup.get(<).map(|param| (lt, param))) + .map(|(lt, param)| { + let mut iter = param + .incoming_edges + .iter() + .map(|edge| edge.param_name.as_str()); + let first = iter.next().unwrap_or("").to_string(); + let edges = iter.fold(first, |mut accum, next| { + accum.push_str(", "); + accum.push_str(next); + accum + }); + format!( + "returnVal.{}Edges = List.of({edges});", + method_lts.fmt_lifetime(lt) + ) + }) + .collect::>(); + (lifetime_edges, boxed_return) + } + _ => (Vec::new(), None), + }; let return_conversion = if method_name.is_none() { OpaqueConstructorTpl { return_ty: return_ty.clone(), @@ -490,7 +570,7 @@ return returnVal;"# }) .cown() } else { - match self.gen_return_conversion(&method.output) { + match self.gen_return_conversion(&method.output, lifetime_edges) { Ok(ok) => ok, Err(err) => { self.errors.push_error(format!( @@ -526,40 +606,6 @@ return returnVal;"# _ => false, }; - let params = method - .params - .iter() - .map(|diplomat_core::hir::Param { name, ty, .. }| Param { - name: self.formatter.fmt_param_name(name.as_str()).into(), - ty: self.formatter.fmt_java_type(ty), - }) - .collect(); - - let boxed_return = match &method.output { - ReturnType::Fallible(SuccessType::OutType(o), _) - | ReturnType::Nullable(SuccessType::OutType(o)) - | ReturnType::Infallible(SuccessType::OutType(o)) => match o { - hir::Type::Slice(Slice::Str(None, _) | Slice::Primitive(None, _)) => { - Some(ParamConversion { - converted_value: "boxArena".into(), - conversion_def: "var boxArena = Arena.ofConfined();".into(), - }) - } - hir::Type::Slice(Slice::Str(Some(_), _) | Slice::Primitive(Some(_), _)) => { - Some(ParamConversion { - converted_value: "arena".into(), - conversion_def: "".into(), - }) - } - hir::Type::Struct(_) => Some(ParamConversion { - converted_value: "returnArena".into(), - conversion_def: "var returnArena = (SegmentAllocator) Arena.ofAuto();" - .into(), - }), - _ => None, - }, - _ => None, - }; let mut param_conversions: Vec<_> = boxed_return .into_iter() .chain(method.param_self.iter().map(|_| ParamConversion { @@ -671,8 +717,8 @@ return returnVal;"# let fields = s .fields .iter() - .map(|StructField { name, ty, .. }| { - let name = name.as_str().into(); + .map(|field @ StructField { ty, .. }| { + let name = self.formatter.fmt_field_name(field); let struct_return = match ty { hir::Type::Enum(enum_def) => Some( format!("{}.fromInt", self.tcx.resolve_enum(enum_def.tcx_id).name).into(), @@ -694,6 +740,16 @@ return returnVal;"# } }) .collect(); + let edges = s + .lifetimes + .lifetimes() + .lifetimes() + .filter_map(|lt| match lt { + MaybeStatic::Static => None, + MaybeStatic::NonStatic(lt) => Some(lt), + }) + .map(|lt| s.lifetimes.fmt_lifetime(lt)) + .collect(); let (methods, _) = self.gen_methods(ty, s.name.as_str(), &s.methods); ( format!("{type_name}.java").into(), @@ -701,6 +757,7 @@ return returnVal;"# type_name: type_name.into(), lib_name: lib_name.clone(), domain: domain.clone(), + edges, fields, methods, } @@ -713,10 +770,22 @@ return returnVal;"# let Config { domain, lib_name } = &self.tcx_config; let (static_methods, class_methods) = self.gen_methods(ty, o.name.as_str(), &o.methods); + let edges = o + .lifetimes + .lifetimes() + .lifetimes() + .filter_map(|lt| match lt { + MaybeStatic::Static => None, + MaybeStatic::NonStatic(lt) => Some(lt), + }) + .map(|lt| o.lifetimes.fmt_lifetime(lt)) + .collect(); + let opaque_tpl = OpaqueTypeTpl { type_name: o.name.to_string().into(), lib_name: lib_name.clone(), domain: domain.clone(), + edges, static_methods, class_methods, }; @@ -769,6 +838,7 @@ mod test { type_name: "Opaque2".into(), lib_name: "somelib".into(), domain: "dev.diplomattest".into(), + edges: Vec::new(), static_methods: Vec::new(), class_methods: Vec::new(), }; @@ -1051,4 +1121,110 @@ mod test { } insta::assert_snapshot!(res); } + + #[test] + fn test_lifetimes() { + let tk_stream = quote! { + #[diplomat::bridge] + pub mod ffi { + use diplomat_runtime::DiplomatStr16; + + #[diplomat::opaque] + pub struct Foo<'a>(&'a DiplomatStr); + + #[diplomat::opaque] + #[diplomat::transparent_convert] + pub struct Bar<'b, 'a: 'b>(&'b Foo<'a>); + + pub struct BorrowedFields<'a> { + a: &'a DiplomatStr16, + b: &'a DiplomatStr, + c: &'a str, + } + + pub struct BorrowedFieldsWithBounds<'a, 'b: 'a, 'c: 'b> { + field_a: &'a DiplomatStr16, + field_b: &'b DiplomatStr, + field_c: &'c str, + } + + pub struct BorrowedFieldsReturning<'a> { + bytes: &'a DiplomatStr, + } + + impl<'a> Foo<'a> { + pub fn new(x: &'a DiplomatStr) -> Box { + Box::new(Foo(x)) + } + + pub fn get_bar<'b>(&'b self) -> Box> { + Box::new(Bar(self)) + } + + pub fn new_static(x: &'static DiplomatStr) -> Box { + Box::new(Foo(x)) + } + + pub fn as_returning(&self) -> BorrowedFieldsReturning<'a> { + BorrowedFieldsReturning { bytes: self.0 } + } + + pub fn extract_from_fields(fields: BorrowedFields<'a>) -> Box { + Box::new(Foo(fields.b)) + } + + /// Test that the extraction logic correctly pins the right fields + pub fn extract_from_bounds<'x, 'y: 'x + 'a, 'z: 'x + 'y>( + bounds: BorrowedFieldsWithBounds<'x, 'y, 'z>, + another_string: &'a DiplomatStr, + ) -> Box { + if bounds.field_b.is_empty() { + Box::new(Self(another_string)) + } else { + Box::new(Self(bounds.field_b)) + } + } + } + } + }; + + let tcx = new_tcx(tk_stream); + + let formatter = JavaFormatter::new(&tcx); + + let errors = ErrorStore::default(); + let tcx_gen = TyGenContext { + tcx: &tcx, + tcx_config: Config { + domain: "dev.diplomattest".into(), + lib_name: "somelib".into(), + }, + formatter: &formatter, + errors: &errors, + }; + + let mut res = String::new(); + for (ty, def) in tcx.all_types() { + let rendered = match (ty, def) { + (_, TypeDef::Opaque(opaque)) => { + let (_, rendered) = tcx_gen.gen_opaque_def(opaque, ty); + rendered + } + (_, TypeDef::Struct(struct_def)) => { + let (_, rendered) = tcx_gen.gen_struct_def(struct_def, ty); + rendered + } + + (TypeId::Enum(enum_id), TypeDef::Enum(enum_def)) => { + let (_, rendered) = tcx_gen.gen_enum_def(enum_def, enum_id); + rendered + } + _ => String::new(), + }; + + res.push_str(&rendered); + res.push_str("\n============================\n") + } + insta::assert_snapshot!(res); + } } diff --git a/tool/src/java/snapshots/diplomat_tool__java__test__enum_and_struct.snap b/tool/src/java/snapshots/diplomat_tool__java__test__enum_and_struct.snap index ef308314e..8a6e0839a 100644 --- a/tool/src/java/snapshots/diplomat_tool__java__test__enum_and_struct.snap +++ b/tool/src/java/snapshots/diplomat_tool__java__test__enum_and_struct.snap @@ -10,6 +10,7 @@ import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; import java.lang.ref.Cleaner; import java.lang.foreign.SegmentAllocator; +import java.util.List; import static java.lang.foreign.ValueLayout.*; import java.nio.charset.StandardCharsets; @@ -25,8 +26,11 @@ public class MyStruct { MemorySegment internal; SegmentAllocator arena; + List selfEdges = List.of(); + private MyStruct(SegmentAllocator arena) { + this.arena = arena } void initFromSegment(MemorySegment segment) { @@ -48,6 +52,7 @@ public class MyStruct { var nativeInvoker = somelib_h.MyStruct_new.makeInvoker(); var nativeVal = nativeInvoker.apply(returnArena); var returnVal = new MyStruct(returnArena); + returnVal.initFromSegment(nativeVal); return returnVal; } diff --git a/tool/src/java/snapshots/diplomat_tool__java__test__lifetimes.snap b/tool/src/java/snapshots/diplomat_tool__java__test__lifetimes.snap new file mode 100644 index 000000000..607c6e71b --- /dev/null +++ b/tool/src/java/snapshots/diplomat_tool__java__test__lifetimes.snap @@ -0,0 +1,297 @@ +--- +source: tool/src/java/mod.rs +expression: res +--- +package dev.diplomattest.somelib; + +import dev.diplomattest.somelib.ntv.somelib_h; + +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import java.lang.foreign.SegmentAllocator; +import java.util.List; +import static java.lang.foreign.ValueLayout.*; +import java.nio.charset.StandardCharsets; + +public class BorrowedFields { + String a; + String b; + String c; + + + MemorySegment internal; + SegmentAllocator arena; + List selfEdges = List.of(); + List aEdges = List.of(); + + + private BorrowedFields(SegmentAllocator arena) { + this.arena = arena + } + + void initFromSegment(MemorySegment segment) { + this.internal = segment; + + this.a = dev.diplomattest.somelib.ntv.BorrowedFields.a(segment); + this.b = dev.diplomattest.somelib.ntv.BorrowedFields.b(segment); + this.c = dev.diplomattest.somelib.ntv.BorrowedFields.c(segment); + + } + +} + + +============================ +package dev.diplomattest.somelib; + +import dev.diplomattest.somelib.ntv.somelib_h; + +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import java.lang.foreign.SegmentAllocator; +import java.util.List; +import static java.lang.foreign.ValueLayout.*; +import java.nio.charset.StandardCharsets; + +public class BorrowedFieldsReturning { + String bytes; + + + MemorySegment internal; + SegmentAllocator arena; + List selfEdges = List.of(); + List aEdges = List.of(); + + + private BorrowedFieldsReturning(SegmentAllocator arena) { + this.arena = arena + } + + void initFromSegment(MemorySegment segment) { + this.internal = segment; + + this.bytes = dev.diplomattest.somelib.ntv.BorrowedFieldsReturning.bytes(segment); + + } + +} + + +============================ +package dev.diplomattest.somelib; + +import dev.diplomattest.somelib.ntv.somelib_h; + +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import java.lang.foreign.SegmentAllocator; +import java.util.List; +import static java.lang.foreign.ValueLayout.*; +import java.nio.charset.StandardCharsets; + +public class BorrowedFieldsWithBounds { + String fieldA; + String fieldB; + String fieldC; + + + MemorySegment internal; + SegmentAllocator arena; + List selfEdges = List.of(); + List aEdges = List.of(); + List bEdges = List.of(); + List cEdges = List.of(); + + + private BorrowedFieldsWithBounds(SegmentAllocator arena) { + this.arena = arena + } + + void initFromSegment(MemorySegment segment) { + this.internal = segment; + + this.fieldA = dev.diplomattest.somelib.ntv.BorrowedFieldsWithBounds.fieldA(segment); + this.fieldB = dev.diplomattest.somelib.ntv.BorrowedFieldsWithBounds.fieldB(segment); + this.fieldC = dev.diplomattest.somelib.ntv.BorrowedFieldsWithBounds.fieldC(segment); + + } + +} + + +============================ +package dev.diplomattest.somelib; + +import dev.diplomattest.somelib.ntv.*; + + +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; +import java.lang.ref.Cleaner; +import java.util.List; +import static java.lang.foreign.ValueLayout.*; +import java.nio.charset.StandardCharsets; + +public class Bar { + + MemorySegment internal; + Cleaner.Cleanable cleanable; + + List selfEdges = List.of(); + List bEdges = List.of(); + List aEdges = List.of(); + + + static class BarCleaner implements Runnable { + + MemorySegment segment; + BarCleaner(MemorySegment segment) { + this.segment = segment; + } + + public void run() { + somelib_h.Bar_destroy(this.segment); + } + } + + Bar() {} + + +} +============================ +package dev.diplomattest.somelib; + +import dev.diplomattest.somelib.ntv.*; + + +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; +import java.lang.ref.Cleaner; +import java.util.List; +import static java.lang.foreign.ValueLayout.*; +import java.nio.charset.StandardCharsets; + +public class Foo { + + MemorySegment internal; + Cleaner.Cleanable cleanable; + + List selfEdges = List.of(); + List aEdges = List.of(); + + + static class FooCleaner implements Runnable { + + MemorySegment segment; + FooCleaner(MemorySegment segment) { + this.segment = segment; + } + + public void run() { + somelib_h.Foo_destroy(this.segment); + } + } + + Foo() {} + + public static Foo new_(String x) { + + try (var arena = Arena.ofConfined()) { + var xMemSeg = arena.allocateFrom(x, StandardCharsets.UTF_8); + var xLen = xMemSeg.byteSize(); + var nativeVal = somelib_h.Foo_new(xMemSeg, xLen - 1); + var returnVal = new Foo(); + + returnVal.aEdges = List.of(x); + + returnVal.internal = nativeVal; + var cleaner = new Foo.FooCleaner(nativeVal); + returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); + return returnVal; + } + } + + public static Foo newStatic(String x) { + + try (var arena = Arena.ofConfined()) { + var xMemSeg = arena.allocateFrom(x, StandardCharsets.UTF_8); + var xLen = xMemSeg.byteSize(); + var nativeVal = somelib_h.Foo_new_static(xMemSeg, xLen - 1); + var returnVal = new Foo(); + + returnVal.aEdges = List.of(); + + returnVal.internal = nativeVal; + var cleaner = new Foo.FooCleaner(nativeVal); + returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); + return returnVal; + } + } + + public static Foo extractFromFields(BorrowedFields fields) { + + var fieldsNative = fields.internal; + var nativeVal = somelib_h.Foo_extract_from_fields(fieldsNative); + var returnVal = new Foo(); + + returnVal.aEdges = List.of(fields); + + returnVal.internal = nativeVal; + var cleaner = new Foo.FooCleaner(nativeVal); + returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); + return returnVal; + } + + public static Foo extractFromBounds(BorrowedFieldsWithBounds bounds,String anotherString) { + + try (var arena = Arena.ofConfined()) { + var boundsNative = bounds.internal; + var anotherStringMemSeg = arena.allocateFrom(anotherString, StandardCharsets.UTF_8); + var anotherStringLen = anotherStringMemSeg.byteSize(); + var nativeVal = somelib_h.Foo_extract_from_bounds(boundsNative, anotherStringMemSeg, anotherStringLen - 1); + var returnVal = new Foo(); + + returnVal.aEdges = List.of(bounds, bounds, anotherString); + + returnVal.internal = nativeVal; + var cleaner = new Foo.FooCleaner(nativeVal); + returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); + return returnVal; + } + } + + + public Bar getBar() { + + + var nativeVal = somelib_h.Foo_get_bar(internal); + var returnVal = new Bar(); + + returnVal.bEdges = List.of(this); + + returnVal.aEdges = List.of(this); + + returnVal.internal = nativeVal; + var cleaner = new Bar.BarCleaner(nativeVal); + returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); + return returnVal; + } + + public BorrowedFieldsReturning asReturning() { + + var returnArena = (SegmentAllocator) Arena.ofAuto(); + + var nativeVal = somelib_h.Foo_as_returning(returnArena, internal); + var returnVal = new BorrowedFieldsReturning(returnArena); + returnVal.aEdges = List.of(this); + returnVal.initFromSegment(nativeVal); + return returnVal; + } + +} +============================ diff --git a/tool/src/java/snapshots/diplomat_tool__java__test__opaque.snap b/tool/src/java/snapshots/diplomat_tool__java__test__opaque.snap index e18de2450..1d386f5fe 100644 --- a/tool/src/java/snapshots/diplomat_tool__java__test__opaque.snap +++ b/tool/src/java/snapshots/diplomat_tool__java__test__opaque.snap @@ -11,6 +11,7 @@ import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; import java.lang.foreign.SegmentAllocator; import java.lang.ref.Cleaner; +import java.util.List; import static java.lang.foreign.ValueLayout.*; import java.nio.charset.StandardCharsets; @@ -19,6 +20,9 @@ public class Opaque { MemorySegment internal; Cleaner.Cleanable cleanable; + List selfEdges = List.of(); + + static class OpaqueCleaner implements Runnable { MemorySegment segment; @@ -38,6 +42,7 @@ public class Opaque { var nativeInvoker = somelib_h.Opaque_new.makeInvoker(); var nativeVal = nativeInvoker.apply(); var returnVal = new Opaque(); + returnVal.internal = nativeVal; var cleaner = new Opaque.OpaqueCleaner(nativeVal); returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); @@ -51,6 +56,7 @@ public class Opaque { var inputLen = inputMemSeg.byteSize(); var nativeVal = somelib_h.Opaque_from_str(inputMemSeg, inputLen - 1); var returnVal = new Opaque(); + returnVal.internal = nativeVal; var cleaner = new Opaque.OpaqueCleaner(nativeVal); returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); diff --git a/tool/src/java/snapshots/diplomat_tool__java__test__opaque_render.snap b/tool/src/java/snapshots/diplomat_tool__java__test__opaque_render.snap index 488c59f04..fa697f7a7 100644 --- a/tool/src/java/snapshots/diplomat_tool__java__test__opaque_render.snap +++ b/tool/src/java/snapshots/diplomat_tool__java__test__opaque_render.snap @@ -11,6 +11,7 @@ import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; import java.lang.foreign.SegmentAllocator; import java.lang.ref.Cleaner; +import java.util.List; import static java.lang.foreign.ValueLayout.*; import java.nio.charset.StandardCharsets; @@ -19,6 +20,9 @@ public class Opaque2 { MemorySegment internal; Cleaner.Cleanable cleanable; + List selfEdges = List.of(); + + static class Opaque2Cleaner implements Runnable { MemorySegment segment; diff --git a/tool/src/java/snapshots/diplomat_tool__java__test__slice.snap b/tool/src/java/snapshots/diplomat_tool__java__test__slice.snap index 87d78ea20..40932b537 100644 --- a/tool/src/java/snapshots/diplomat_tool__java__test__slice.snap +++ b/tool/src/java/snapshots/diplomat_tool__java__test__slice.snap @@ -11,6 +11,7 @@ import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; import java.lang.foreign.SegmentAllocator; import java.lang.ref.Cleaner; +import java.util.List; import static java.lang.foreign.ValueLayout.*; import java.nio.charset.StandardCharsets; @@ -19,6 +20,9 @@ public class Float64Vec { MemorySegment internal; Cleaner.Cleanable cleanable; + List selfEdges = List.of(); + + static class Float64VecCleaner implements Runnable { MemorySegment segment; @@ -40,6 +44,7 @@ public class Float64Vec { var vMemSeg = arena.allocateFrom(JAVA_DOUBLE, v); var nativeVal = somelib_h.Float64Vec_new(vMemSeg, vLen); var returnVal = new Float64Vec(); + returnVal.internal = nativeVal; var cleaner = new Float64Vec.Float64VecCleaner(nativeVal); returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); @@ -81,6 +86,7 @@ import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; import java.lang.foreign.SegmentAllocator; import java.lang.ref.Cleaner; +import java.util.List; import static java.lang.foreign.ValueLayout.*; import java.nio.charset.StandardCharsets; @@ -89,6 +95,9 @@ public class MyString { MemorySegment internal; Cleaner.Cleanable cleanable; + List selfEdges = List.of(); + + static class MyStringCleaner implements Runnable { MemorySegment segment; @@ -122,6 +131,7 @@ public class MyString { var vLen = vMemSeg.byteSize(); var nativeVal = somelib_h.MyString_new_unsafe(vMemSeg, vLen - 1); var returnVal = new MyString(); + returnVal.internal = nativeVal; var cleaner = new MyString.MyStringCleaner(nativeVal); returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); @@ -135,6 +145,7 @@ public class MyString { var vLen = vMemSeg.byteSize(); var nativeVal = somelib_h.MyString_new_owned(vMemSeg, vLen - 1); var returnVal = new MyString(); + returnVal.internal = nativeVal; var cleaner = new MyString.MyStringCleaner(nativeVal); returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); @@ -148,6 +159,7 @@ public class MyString { var vLen = v.length; var nativeVal = somelib_h.MyString_new_from_first(vData, vLen); var returnVal = new MyString(); + returnVal.internal = nativeVal; var cleaner = new MyString.MyStringCleaner(nativeVal); returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); diff --git a/tool/templates/java/Opaque.java.jinja b/tool/templates/java/Opaque.java.jinja index c82261bb5..98c71bec5 100644 --- a/tool/templates/java/Opaque.java.jinja +++ b/tool/templates/java/Opaque.java.jinja @@ -7,6 +7,7 @@ import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; import java.lang.foreign.SegmentAllocator; import java.lang.ref.Cleaner; +import java.util.List; import static java.lang.foreign.ValueLayout.*; import java.nio.charset.StandardCharsets; @@ -15,6 +16,11 @@ public class {{type_name}} { MemorySegment internal; Cleaner.Cleanable cleanable; + List selfEdges = List.of(); + {% for edge in edges -%} + List {{edge}}Edges = List.of(); + {% endfor %} + static class {{type_name}}Cleaner implements Runnable { MemorySegment segment; diff --git a/tool/templates/java/OpaqueReturn.java.jinja b/tool/templates/java/OpaqueReturn.java.jinja index c119ed22a..6e4b6a519 100644 --- a/tool/templates/java/OpaqueReturn.java.jinja +++ b/tool/templates/java/OpaqueReturn.java.jinja @@ -1,4 +1,7 @@ var returnVal = new {{return_ty}}(); +{% for lifetime_edge in lifetime_edges %} +{{lifetime_edge}} +{% endfor %} returnVal.internal = nativeVal; var cleaner = new {{return_ty}}.{{return_ty}}Cleaner(nativeVal); returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); diff --git a/tool/templates/java/Struct.java.jinja b/tool/templates/java/Struct.java.jinja index db7070420..8e9ac08b4 100644 --- a/tool/templates/java/Struct.java.jinja +++ b/tool/templates/java/Struct.java.jinja @@ -6,6 +6,7 @@ import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; import java.lang.ref.Cleaner; import java.lang.foreign.SegmentAllocator; +import java.util.List; import static java.lang.foreign.ValueLayout.*; import java.nio.charset.StandardCharsets; @@ -16,8 +17,13 @@ public class {{type_name}} { MemorySegment internal; SegmentAllocator arena; + List selfEdges = List.of(); + {% for edge in edges -%} + List {{edge}}Edges = List.of(); + {% endfor %} private {{type_name}}(SegmentAllocator arena) { + this.arena = arena } void initFromSegment(MemorySegment segment) { From e863425f814f030f89c79c7e0fd24f97be55d55c Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Thu, 1 Aug 2024 21:12:38 +0300 Subject: [PATCH 09/69] panama-backend - revert lifetime experimentation --- feature_tests/src/lifetimes.rs | 64 ++++------------------------------ 1 file changed, 6 insertions(+), 58 deletions(-) diff --git a/feature_tests/src/lifetimes.rs b/feature_tests/src/lifetimes.rs index ad039326f..9b4462944 100644 --- a/feature_tests/src/lifetimes.rs +++ b/feature_tests/src/lifetimes.rs @@ -1,26 +1,29 @@ #[diplomat::bridge] pub mod ffi { - use diplomat_runtime::DiplomatStr16; - #[diplomat::opaque] + #[diplomat::attr(kotlin, disable)] pub struct Foo<'a>(&'a DiplomatStr); #[diplomat::opaque] #[diplomat::transparent_convert] + #[diplomat::attr(kotlin, disable)] pub struct Bar<'b, 'a: 'b>(&'b Foo<'a>); + #[diplomat::attr(kotlin, disable)] pub struct BorrowedFields<'a> { a: &'a DiplomatStr16, b: &'a DiplomatStr, c: &'a str, } + #[diplomat::attr(kotlin, disable)] pub struct BorrowedFieldsWithBounds<'a, 'b: 'a, 'c: 'b> { field_a: &'a DiplomatStr16, field_b: &'b DiplomatStr, field_c: &'c str, } + #[diplomat::attr(kotlin, disable)] pub struct BorrowedFieldsReturning<'a> { bytes: &'a DiplomatStr, } @@ -63,68 +66,13 @@ pub mod ffi { } } - impl<'x> BorrowedFields<'x> { - pub fn from_bar_and_strings( - bar: &'x Bar<'x, 'x>, - utf16_str: &'x DiplomatStr16, - utf8_str: &'x str, - ) -> Self { - BorrowedFields { - a: utf16_str, - b: bar.0 .0, - c: utf8_str, - } - } - } - - impl<'x, 'y: 'x, 'z> BorrowedFieldsWithBounds<'x, 'y, 'z> { - pub fn from_foo_and_strings( - foo: &'x Foo<'y>, - utf16_str_x: &'x DiplomatStr16, - utf8_str_z: &'z str, - ) -> Self { - BorrowedFieldsWithBounds { - field_a: utf16_str_x, - field_b: foo.0, - field_c: utf8_str_z, - } - } - } - + #[diplomat::attr(kotlin, disable)] pub struct NestedBorrowedFields<'x, 'y: 'x, 'z> { fields: BorrowedFields<'x>, bounds: BorrowedFieldsWithBounds<'x, 'y, 'y>, bounds2: BorrowedFieldsWithBounds<'z, 'z, 'z>, } - impl<'x, 'y: 'x, 'z> NestedBorrowedFields<'x, 'y, 'z> { - pub fn from_bar_and_foo_and_strings( - bar: &'x Bar<'x, 'y>, - foo: &'z Foo<'z>, - utf16_str_x: &'x DiplomatStr16, - utf16_str_z: &'z DiplomatStr16, - utf8_str_y: &'y str, - utf8_str_z: &'z str, - ) -> Self { - let fields = BorrowedFields::from_bar_and_strings(bar, utf16_str_x, utf8_str_y); - let bounds = BorrowedFieldsWithBounds { - field_a: utf16_str_x, - field_b: bar.0 .0, - field_c: utf8_str_y, - }; - let bounds2 = BorrowedFieldsWithBounds { - field_a: utf16_str_z, - field_b: foo.0, - field_c: utf8_str_z, - }; - Self { - fields, - bounds, - bounds2, - } - } - } - // FIXME(#191): This test breaks the C++ codegen impl<'b, 'a: 'b> Bar<'b, 'a> { #[diplomat::skip_if_ast] From 68e6bebe44bf5897de3746562cc0e29fd1d1103d Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Thu, 1 Aug 2024 22:48:29 +0300 Subject: [PATCH 10/69] panama-backend - fix lifetimes --- feature_tests/src/lifetimes.rs | 55 ++++++++++++++++++++++++++++++---- tool/src/java/mod.rs | 43 +++++++++++++------------- 2 files changed, 72 insertions(+), 26 deletions(-) diff --git a/feature_tests/src/lifetimes.rs b/feature_tests/src/lifetimes.rs index 9b4462944..69306b8f6 100644 --- a/feature_tests/src/lifetimes.rs +++ b/feature_tests/src/lifetimes.rs @@ -1,29 +1,24 @@ #[diplomat::bridge] pub mod ffi { #[diplomat::opaque] - #[diplomat::attr(kotlin, disable)] pub struct Foo<'a>(&'a DiplomatStr); #[diplomat::opaque] #[diplomat::transparent_convert] - #[diplomat::attr(kotlin, disable)] pub struct Bar<'b, 'a: 'b>(&'b Foo<'a>); - #[diplomat::attr(kotlin, disable)] pub struct BorrowedFields<'a> { a: &'a DiplomatStr16, b: &'a DiplomatStr, c: &'a str, } - #[diplomat::attr(kotlin, disable)] pub struct BorrowedFieldsWithBounds<'a, 'b: 'a, 'c: 'b> { field_a: &'a DiplomatStr16, field_b: &'b DiplomatStr, field_c: &'c str, } - #[diplomat::attr(kotlin, disable)] pub struct BorrowedFieldsReturning<'a> { bytes: &'a DiplomatStr, } @@ -66,13 +61,61 @@ pub mod ffi { } } - #[diplomat::attr(kotlin, disable)] + impl<'x> BorrowedFields<'x> { + pub fn from_bar_and_strings( + bar: &'x Bar<'x, 'x>, + dstr16: &'x DiplomatStr16, + utf8_str: &'x str, + ) -> Self { + BorrowedFields { + a: dstr16, + b: bar.0 .0, + c: utf8_str, + } + } + } + + impl<'x, 'y: 'x, 'z: 'y> BorrowedFieldsWithBounds<'x, 'y, 'z> { + pub fn from_foo_and_strings( + foo: &'x Foo<'y>, + dstr16_x: &'x DiplomatStr16, + utf8_str_z: &'z str, + ) -> Self { + BorrowedFieldsWithBounds { + field_a: dstr16_x, + field_b: foo.0, + field_c: utf8_str_z, + } + } + } + pub struct NestedBorrowedFields<'x, 'y: 'x, 'z> { fields: BorrowedFields<'x>, bounds: BorrowedFieldsWithBounds<'x, 'y, 'y>, bounds2: BorrowedFieldsWithBounds<'z, 'z, 'z>, } + impl<'x, 'y: 'x, 'z> NestedBorrowedFields<'x, 'y, 'z> { + pub fn from_bar_and_foo_and_strings( + bar: &'x Bar<'x, 'y>, + foo: &'z Foo<'z>, + dstr16_x: &'x DiplomatStr16, + dstr16_z: &'z DiplomatStr16, + utf8_str_y: &'y str, + utf8_str_z: &'z str, + ) -> Self { + let fields = BorrowedFields::from_bar_and_strings(bar, dstr16_x, utf8_str_y); + let bounds = + BorrowedFieldsWithBounds::from_foo_and_strings(bar.0, dstr16_x, utf8_str_y); + let bounds2 = BorrowedFieldsWithBounds::from_foo_and_strings(foo, dstr16_z, utf8_str_z); + Self { + fields, + bounds, + bounds2, + } + } + } + // FIXME(#191): This test breaks the C++ codegen impl<'b, 'a: 'b> Bar<'b, 'a> { #[diplomat::skip_if_ast] diff --git a/tool/src/java/mod.rs b/tool/src/java/mod.rs index 9228882b5..5b619056e 100644 --- a/tool/src/java/mod.rs +++ b/tool/src/java/mod.rs @@ -6,9 +6,9 @@ use std::path::Path; use askama::Template; use diplomat_core::hir::{ - self, EnumDef, EnumId, EnumVariant, FloatType, IntSizeType, IntType, MaybeStatic, Method, - OpaqueDef, ReturnType, Slice, SpecialMethod, StringEncoding, StructDef, StructField, - StructPathLike, SuccessType, TypeContext, TypeDef, TypeId, + self, EnumDef, EnumVariant, FloatType, IntSizeType, IntType, MaybeStatic, Method, OpaqueDef, + ReturnType, Slice, SpecialMethod, StringEncoding, StructDef, StructField, StructPathLike, + SuccessType, TypeContext, TypeDef, TypeId, }; use formatter::JavaFormatter; @@ -66,6 +66,7 @@ pub fn run( writeln!(lib_file, "#include \"{include}\"")?; } + // Here we try to build the following command // jextract \ // --include-dir /path/to/mylib/include \ // --output src \ @@ -88,11 +89,11 @@ pub fn run( println!("Running: {:?}", command); - // todo: delete directory - match command.output() { Err(err) => match err.kind() { std::io::ErrorKind::NotFound => { + // note to guarantee a working link we link to a specific commit. But this should + // be updated when we check the validity of jextract eprintln!("Check that jextract is in your path and all directories exist. See https://github.com/openjdk/jextract/blob/5715737be0a1a9de24cce3ee7190881cfc8b1350/doc/GUIDE.md"); return Err(err); } @@ -124,20 +125,22 @@ pub fn run( }; let files = FileMap::default(); - for (_id, ty) in tcx.all_types() { + for (id, ty) in tcx.all_types() { let _guard = ty_gen_cx.errors.set_context_ty(ty.name().as_str().into()); if ty.attrs().disable { continue; } - match ty { - TypeDef::Opaque(_) => { - // let type_name = o.name.to_string(); - - // let (file_name, body) = ty_gen_cx.gen_opaque_def(o, id, GROUP, LIBRARY); + let (file, body) = match ty { + TypeDef::Opaque(opaque) => ty_gen_cx.gen_opaque_def(opaque, id), + TypeDef::Struct(struct_def) => ty_gen_cx.gen_struct_def(struct_def, id), + TypeDef::Enum(enum_def) => ty_gen_cx.gen_enum_def(enum_def, id), + TypeDef::OutStruct(_) => unreachable!(""), + unknown => { + unreachable!("Encountered unknown variant: {unknown:?} while parsing all types") } - _ => continue, - } + }; + files.add_file(format!("src/main/java/{file}"), body); } Ok(files) @@ -681,7 +684,7 @@ return returnVal;"# (static_methods, class_methods) } - fn gen_enum_def(&self, e: &EnumDef, ty: EnumId) -> (Cow, String) { + fn gen_enum_def(&self, e: &EnumDef, ty: TypeId) -> (Cow, String) { let Config { domain, lib_name } = &self.tcx_config; let type_name = e.name.as_str(); let variants = e @@ -697,7 +700,7 @@ return returnVal;"# }, ) .collect(); - let (methods, _) = self.gen_methods(ty.into(), e.name.as_str(), &e.methods); + let (methods, _) = self.gen_methods(ty, e.name.as_str(), &e.methods); ( format!("{type_name}.java").into(), EnumTypeTpl { @@ -1033,8 +1036,8 @@ mod test { let (_, rendered) = tcx_gen.gen_struct_def(struct_def, ty); rendered } - (TypeId::Enum(enum_id), TypeDef::Enum(enum_def)) => { - let (_, rendered) = tcx_gen.gen_enum_def(enum_def, enum_id); + (_, TypeDef::Enum(enum_def)) => { + let (_, rendered) = tcx_gen.gen_enum_def(enum_def, ty); rendered } _ => String::new(), @@ -1109,8 +1112,8 @@ mod test { rendered } - (TypeId::Enum(enum_id), TypeDef::Enum(enum_def)) => { - let (_, rendered) = tcx_gen.gen_enum_def(enum_def, enum_id); + (_, TypeDef::Enum(enum_def)) => { + let (_, rendered) = tcx_gen.gen_enum_def(enum_def, ty); rendered } _ => String::new(), @@ -1216,7 +1219,7 @@ mod test { } (TypeId::Enum(enum_id), TypeDef::Enum(enum_def)) => { - let (_, rendered) = tcx_gen.gen_enum_def(enum_def, enum_id); + let (_, rendered) = tcx_gen.gen_enum_def(enum_def, ty); rendered } _ => String::new(), From 70050627a81af577ee7f748f187420c150c1f8d9 Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Sat, 3 Aug 2024 22:40:18 +0300 Subject: [PATCH 11/69] panama-backend - remove accidental type --- tool/src/lib.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/tool/src/lib.rs b/tool/src/lib.rs index 751c23e96..b0806f687 100644 --- a/tool/src/lib.rs +++ b/tool/src/lib.rs @@ -14,7 +14,6 @@ use colored::*; use core::mem; use core::panic; use diplomat_core::hir; -use java::RunResult; use std::borrow::Cow; use std::cell::RefCell; use std::collections::HashMap; From c02c92fa51ee336ccc6335d02785200fd07019f6 Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Sun, 4 Aug 2024 17:25:30 +0300 Subject: [PATCH 12/69] panama-backend - adding overrides --- feature_tests/src/option.rs | 4 +++ feature_tests/src/result.rs | 1 + feature_tests/src/slices.rs | 1 + feature_tests/src/structs.rs | 2 ++ tool/src/java/formatter.rs | 13 +++++++-- tool/src/java/mod.rs | 56 ++++++++++++++++++++++++++---------- 6 files changed, 59 insertions(+), 18 deletions(-) diff --git a/feature_tests/src/option.rs b/feature_tests/src/option.rs index 27573d26b..50431d794 100644 --- a/feature_tests/src/option.rs +++ b/feature_tests/src/option.rs @@ -3,13 +3,16 @@ pub mod ffi { use diplomat_runtime::DiplomatWrite; #[diplomat::opaque] + #[diplomat::attr(java, disable)] pub struct OptionOpaque(i32); #[diplomat::opaque] + #[diplomat::attr(java, disable)] pub struct OptionOpaqueChar(char); #[diplomat::opaque] #[diplomat::attr(dart, disable)] + #[diplomat::attr(java, disable)] pub struct OptionString(String); impl OptionString { @@ -30,6 +33,7 @@ pub mod ffi { } #[diplomat::out] + #[diplomat::attr(java, disable)] pub struct OptionStruct { a: Option>, b: Option>, diff --git a/feature_tests/src/result.rs b/feature_tests/src/result.rs index 0786a2b86..d03128a8f 100644 --- a/feature_tests/src/result.rs +++ b/feature_tests/src/result.rs @@ -1,6 +1,7 @@ #[diplomat::bridge] pub mod ffi { + #[diplomat::attr(java, disable)] #[diplomat::opaque] pub struct ResultOpaque(i32); diff --git a/feature_tests/src/slices.rs b/feature_tests/src/slices.rs index 7047fc6a5..0868e0032 100644 --- a/feature_tests/src/slices.rs +++ b/feature_tests/src/slices.rs @@ -116,6 +116,7 @@ mod ffi { } #[diplomat::attr(auto, indexer)] + #[diplomat::attr(java, disable)] pub fn get(&self, i: usize) -> Option { self.0.get(i).copied() } diff --git a/feature_tests/src/structs.rs b/feature_tests/src/structs.rs index a32c20d0b..612c3e7df 100644 --- a/feature_tests/src/structs.rs +++ b/feature_tests/src/structs.rs @@ -53,6 +53,7 @@ pub mod ffi { Box::new(Opaque("".into())) } + #[diplomat::attr(java, disable)] pub fn try_from_utf8(input: &DiplomatStr) -> Option> { let s = std::str::from_utf8(input).ok()?; Some(Box::new(Self(s.into()))) @@ -192,6 +193,7 @@ pub mod ffi { assert_eq!(self.g, MyEnum::B); } + #[diplomat::attr(java, disable)] pub fn returns_zst_result() -> Result<(), MyZst> { Ok(()) } diff --git a/tool/src/java/formatter.rs b/tool/src/java/formatter.rs index 9814dadb6..0a39b8c57 100644 --- a/tool/src/java/formatter.rs +++ b/tool/src/java/formatter.rs @@ -25,7 +25,10 @@ impl<'cx> JavaFormatter<'cx> { method.abi_name.as_str().into() } - pub fn fmt_field_name<'a>(&self, field: &'a hir::StructField) -> Cow<'a, str> { + pub fn fmt_field_name<'a, TyP: TyPosition>( + &self, + field: &'a hir::StructField, + ) -> Cow<'a, str> { let name = field.name.as_str().to_lower_camel_case(); if INVALID_NAMES.contains(&&*name) { format!("{name}_").into() @@ -46,8 +49,12 @@ impl<'cx> JavaFormatter<'cx> { pub fn fmt_return_type_java<'a>(&self, return_ty: &'a ReturnType) -> Cow<'a, str> { match return_ty { ReturnType::Infallible(ref success) => self.fmt_success_type_java(success), - ReturnType::Fallible(_, _) => todo!(), - ReturnType::Nullable(_) => todo!(), + ReturnType::Fallible(success, _) => { + todo!("Don't yet support fallible returns. Return type was: {success:?}") + } + ReturnType::Nullable(success) => { + todo!("Don't yet support Nullable returns. Return type was: {success:?}") + } } } diff --git a/tool/src/java/mod.rs b/tool/src/java/mod.rs index 1ab01ebcd..01f2c8060 100644 --- a/tool/src/java/mod.rs +++ b/tool/src/java/mod.rs @@ -8,7 +8,7 @@ use askama::Template; use diplomat_core::hir::{ self, BackendAttrSupport, EnumDef, EnumVariant, FloatType, IntSizeType, IntType, MaybeStatic, Method, OpaqueDef, ReturnType, Slice, SpecialMethod, StringEncoding, StructDef, StructField, - StructPathLike, SuccessType, TypeContext, TypeDef, TypeId, + StructPathLike, SuccessType, TyPosition, TypeContext, TypeDef, TypeId, }; use formatter::JavaFormatter; @@ -82,9 +82,11 @@ pub(crate) fn run<'a>( let lib_path = tmp_path.join(format!("{LIBRARY}.h")); - let mut lib_file = File::create(&lib_path).expect("failed to create lib file"); - for include in include_files { - writeln!(lib_file, "#include \"{include}\"").expect("failed to write line in lib file"); + { + let mut lib_file = File::create(&lib_path).expect("failed to create lib file"); + for include in include_files { + writeln!(lib_file, "#include \"{include}\"").expect("failed to write line in lib file"); + } } // Here we try to build the following command @@ -108,6 +110,12 @@ pub(crate) fn run<'a>( .arg(LIBRARY) .arg(lib_path); + // cleanup tmp c files + let cleanup = || { + let mut command = std::process::Command::new("rm"); + command.arg("-r").arg(tmp_path).output() + }; + println!("Running: {:?}", command); match command.output() { @@ -115,9 +123,14 @@ pub(crate) fn run<'a>( std::io::ErrorKind::NotFound => { // note to guarantee a working link we link to a specific commit. But this should // be updated when we check the validity of jextract + //cleanup().expect("Failed to clean up temporary files"); + (cleanup.clone())().expect("failed to clean up resources"); panic!("Check that jextract is in your path and all directories exist. See https://github.com/openjdk/jextract/blob/5715737be0a1a9de24cce3ee7190881cfc8b1350/doc/GUIDE.md"); } - err => panic!("unexpected error {err}"), + err => { + (cleanup.clone())().expect("failed to clean up resources"); + panic!("unexpected error {err}") + } }, Ok(ok) => { let stdout = String::from_utf8_lossy(&ok.stdout); @@ -128,6 +141,8 @@ pub(crate) fn run<'a>( } } + cleanup().expect("Failed to clean up temporary files"); + let java_formatter = JavaFormatter::new(tcx); let formatter = &java_formatter; let error_store = ErrorStore::default(); @@ -154,9 +169,9 @@ pub(crate) fn run<'a>( let (file, body) = match ty { TypeDef::Opaque(opaque) => ty_gen_cx.gen_opaque_def(opaque, id), - TypeDef::Struct(struct_def) => ty_gen_cx.gen_struct_def(struct_def, id), TypeDef::Enum(enum_def) => ty_gen_cx.gen_enum_def(enum_def, id), - TypeDef::OutStruct(_) => unreachable!(""), + TypeDef::Struct(struct_def) => ty_gen_cx.gen_struct_def(struct_def, id), + TypeDef::OutStruct(struct_def) => ty_gen_cx.gen_struct_def(struct_def, id), unknown => { unreachable!("Encountered unknown variant: {unknown:?} while parsing all types") } @@ -281,7 +296,11 @@ impl<'a, 'cx> TyGenContext<'a, 'cx> { format!(r#"var {name}Native = {name}.internal;"#).into(), converted_value, ), - hir::Type::Enum(_) => todo!(), + hir::Type::Enum(_) => ( + format!("var {name}Native = {name}.toInt();").into(), + format!("{name}Native").into(), + ), + hir::Type::Slice(Slice::Str(borrow, StringEncoding::UnvalidatedUtf16)) => { let arena_name = borrow.map(|_| "arena").unwrap_or("Arena.global()"); ( @@ -491,9 +510,12 @@ return returnVal;"# let Config { lib_name, .. } = &self.tcx_config; let mut static_methods = Vec::new(); let mut class_methods = Vec::new(); + println!("Working on type {ty_name}"); methods .iter() + .filter(|method| !method.attrs.disable) .filter_map(|method| -> Option<(bool, Cow<'cx, str>)> { + println!("Working on method {}", method.name); let mut visitor = method.borrowing_param_visitor(self.tcx); let (method_name, is_valid_constructor) = match method.attrs.special_method { @@ -732,28 +754,32 @@ return returnVal;"# .expect("failed to render struct type"), ) } - fn gen_struct_def(&self, s: &StructDef, ty: TypeId) -> (Cow, String) { + fn gen_struct_def( + &self, + s: &StructDef, + ty: TypeId, + ) -> (Cow, String) { let Config { domain, lib_name } = &self.tcx_config; let type_name = s.name.as_str(); let fields = s .fields .iter() - .map(|field @ StructField { ty, .. }| { + .map(|field| { let name = self.formatter.fmt_field_name(field); - let struct_return = match ty { - hir::Type::Enum(enum_def) => Some( + let struct_return = match field.ty { + hir::Type::Enum(ref enum_def) => Some( format!("{}.fromInt", self.tcx.resolve_enum(enum_def.tcx_id).name).into(), ), - hir::Type::Struct(struct_def) => Some( + hir::Type::Struct(ref struct_def) => Some( format!( "{}.fromSegment", - self.tcx.resolve_struct(struct_def.tcx_id).name + self.tcx.resolve_type(struct_def.id()).name() ) .into(), ), _ => None, }; - let ty = self.formatter.fmt_java_type(ty); + let ty = self.formatter.fmt_java_type(&field.ty); FieldTpl { name, ty, From fdc619b03f669e526cd94fbc65b96b9fb0280a1a Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Sat, 10 Aug 2024 11:40:29 +0200 Subject: [PATCH 13/69] panamaa-backend - complete pipeline --- Makefile.toml | 8 + feature_tests/diplomat-java-conf.toml | 2 + .../java/dev/diplomattest/somelib/Bar.java | 62 + .../diplomattest/somelib/BorrowedFields.java | 62 + .../somelib/BorrowedFieldsReturning.java | 40 + .../somelib/BorrowedFieldsWithBounds.java | 68 + .../diplomattest/somelib/ContiguousEnum.java | 59 + .../diplomattest/somelib/CyclicStructA.java | 48 + .../diplomattest/somelib/CyclicStructB.java | 48 + .../dev/diplomattest/somelib/ErrorEnum.java | 45 + .../dev/diplomattest/somelib/ErrorStruct.java | 40 + .../dev/diplomattest/somelib/Float64Vec.java | 195 +- .../java/dev/diplomattest/somelib/Foo.java | 144 + .../java/dev/diplomattest/somelib/Lib.java | 14 + .../java/dev/diplomattest/somelib/MyEnum.java | 13 +- .../dev/diplomattest/somelib/MyString.java | 92 +- .../dev/diplomattest/somelib/MyStruct.java | 42 +- .../java/dev/diplomattest/somelib/MyZst.java | 36 + .../somelib/NestedBorrowedFields.java | 73 + .../java/dev/diplomattest/somelib/One.java | 239 + .../java/dev/diplomattest/somelib/Opaque.java | 75 +- .../somelib/OpaqueMutexedString.java | 138 + .../dev/diplomattest/somelib/RefList.java | 61 + .../somelib/RefListParameter.java | 44 + .../java/dev/diplomattest/somelib/Two.java | 48 + .../dev/diplomattest/somelib/Utf16Wrap.java | 82 + ...g_write_result.java => CyclicStructA.java} | 40 +- ...OSUnalignedU32.java => CyclicStructB.java} | 40 +- ...edStruct.java => DiplomatBoolViewMut.java} | 73 +- ...t_result.java => DiplomatCharViewMut.java} | 76 +- ...et_result.java => DiplomatF32ViewMut.java} | 77 +- ...nt_result.java => DiplomatF64ViewMut.java} | 77 +- .../somelib/ntv/DiplomatI16ViewMut.java | 173 + .../somelib/ntv/DiplomatI32ViewMut.java | 173 + .../somelib/ntv/DiplomatI64ViewMut.java | 173 + .../somelib/ntv/DiplomatI8ViewMut.java | 173 + .../somelib/ntv/DiplomatIsizeViewMut.java | 173 + .../somelib/ntv/DiplomatString16ViewMut.java | 173 + .../somelib/ntv/DiplomatStringViewMut.java | 173 + .../somelib/ntv/DiplomatStrings16ViewMut.java | 173 + .../somelib/ntv/DiplomatStringsViewMut.java | 173 + .../somelib/ntv/DiplomatU16ViewMut.java | 173 + .../somelib/ntv/DiplomatU32ViewMut.java | 173 + .../somelib/ntv/DiplomatU64ViewMut.java | 173 + .../somelib/ntv/DiplomatU8ViewMut.java | 173 + .../somelib/ntv/DiplomatUsizeViewMut.java | 173 + .../MyStruct_returns_zst_result_result.java | 127 - .../ntv/OptionOpaque_option_i32_result.java | 178 - .../ntv/OptionOpaque_option_isize_result.java | 178 - .../ntv/OptionOpaque_option_u32_result.java | 178 - .../ntv/OptionOpaque_option_usize_result.java | 178 - .../ntv/OptionOpaque_returns_result.java | 178 - .../ntv/OptionString_borrow_result.java | 178 - .../somelib/ntv/OptionStruct.java | 266 - .../ResultOpaque_new_failing_bar_result.java | 224 - .../ResultOpaque_new_failing_foo_result.java | 224 - ...esultOpaque_new_failing_struct_result.java | 224 - .../ResultOpaque_new_failing_unit_result.java | 178 - .../ResultOpaque_new_in_enum_err_result.java | 224 - .../ntv/ResultOpaque_new_in_err_result.java | 178 - .../somelib/ntv/ResultOpaque_new_result.java | 224 - .../somelib/ntv/_OSUnalignedU16.java | 127 - .../somelib/ntv/_OSUnalignedU64.java | 127 - .../dev/diplomattest/somelib/ntv/fd_set.java | 160 - .../ntv/namespace_MyIndexer_get_result.java | 178 - .../somelib/ntv/pthread_attr_t.java | 26 - .../somelib/ntv/pthread_cond_t.java | 26 - .../somelib/ntv/pthread_condattr_t.java | 26 - .../somelib/ntv/pthread_mutex_t.java | 26 - .../somelib/ntv/pthread_mutexattr_t.java | 26 - .../somelib/ntv/pthread_once_t.java | 26 - .../somelib/ntv/pthread_rwlock_t.java | 26 - .../somelib/ntv/pthread_rwlockattr_t.java | 26 - .../diplomattest/somelib/ntv/somelib_h.java | 12792 ++++++---------- .../diplomattest/somelib/Float64VecTest.java | 6 +- .../diplomattest/somelib/MyStringTest.java | 6 +- .../dev/diplomattest/somelib/MyStruct.kt | 4 +- .../kotlin/dev/diplomattest/somelib/Opaque.kt | 7 + feature_tests/src/attrs.rs | 4 + feature_tests/src/imports.rs | 2 + feature_tests/src/structs.rs | 1 + tool/src/java/formatter.rs | 16 +- tool/src/java/mod.rs | 380 +- .../java/{Main.java.jinja => Lib.java.jinja} | 14 + tool/templates/java/Method.java.jinja | 6 - tool/templates/java/Opaque.java.jinja | 13 + tool/templates/java/OpaqueReturn.java.jinja | 27 +- tool/templates/java/Struct.java.jinja | 23 +- tool/templates/java/StructReturn.java.jinja | 15 +- 89 files changed, 9215 insertions(+), 12421 deletions(-) create mode 100644 feature_tests/diplomat-java-conf.toml create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Bar.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/BorrowedFields.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/BorrowedFieldsReturning.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/BorrowedFieldsWithBounds.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ContiguousEnum.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/CyclicStructA.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/CyclicStructB.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ErrorEnum.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ErrorStruct.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Foo.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyZst.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/NestedBorrowedFields.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/One.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/OpaqueMutexedString.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/RefList.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/RefListParameter.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Two.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Utf16Wrap.java rename feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/{OptionString_write_result.java => CyclicStructA.java} (76%) rename feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/{_OSUnalignedU32.java => CyclicStructB.java} (76%) rename feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/{ImportedStruct.java => DiplomatBoolViewMut.java} (67%) rename feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/{namespace_MyIterator_next_result.java => DiplomatCharViewMut.java} (65%) rename feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/{Float64Vec_get_result.java => DiplomatF32ViewMut.java} (65%) rename feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/{ResultOpaque_new_int_result.java => DiplomatF64ViewMut.java} (65%) create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI16ViewMut.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI32ViewMut.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI64ViewMut.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI8ViewMut.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatIsizeViewMut.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatString16ViewMut.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringViewMut.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStrings16ViewMut.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringsViewMut.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU16ViewMut.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU32ViewMut.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU64ViewMut.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU8ViewMut.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatUsizeViewMut.java delete mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/MyStruct_returns_zst_result_result.java delete mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionOpaque_option_i32_result.java delete mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionOpaque_option_isize_result.java delete mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionOpaque_option_u32_result.java delete mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionOpaque_option_usize_result.java delete mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionOpaque_returns_result.java delete mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionString_borrow_result.java delete mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionStruct.java delete mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_failing_bar_result.java delete mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_failing_foo_result.java delete mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_failing_struct_result.java delete mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_failing_unit_result.java delete mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_in_enum_err_result.java delete mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_in_err_result.java delete mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_result.java delete mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_OSUnalignedU16.java delete mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_OSUnalignedU64.java delete mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/fd_set.java delete mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/namespace_MyIndexer_get_result.java delete mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_attr_t.java delete mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_cond_t.java delete mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_condattr_t.java delete mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_mutex_t.java delete mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_mutexattr_t.java delete mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_once_t.java delete mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_rwlock_t.java delete mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_rwlockattr_t.java rename tool/templates/java/{Main.java.jinja => Lib.java.jinja} (93%) diff --git a/Makefile.toml b/Makefile.toml index ba80d153b..94e721d66 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -434,6 +434,14 @@ exit_on_error true generate_generic example dart lib/src ''' +[tasks.gen-java-feature] +category = "Code generation" +script_runner = "@duckscript" +script = ''' +exit_on_error true +!include_files ./support/functions.ds +generate_generic feature_tests java somelib "-l diplomat-java-conf.toml" /src/main/java +''' # this task generates all of the kotlin code but does not copy generated project files over # we only copy the generated main src files to preserve the tests [tasks.gen-kotlin-feature] diff --git a/feature_tests/diplomat-java-conf.toml b/feature_tests/diplomat-java-conf.toml new file mode 100644 index 000000000..31bf6f372 --- /dev/null +++ b/feature_tests/diplomat-java-conf.toml @@ -0,0 +1,2 @@ +domain = "dev.diplomattest" +lib_name = "somelib" diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Bar.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Bar.java new file mode 100644 index 000000000..a3d06d74a --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Bar.java @@ -0,0 +1,62 @@ +package dev.diplomattest.somelib; + +import dev.diplomattest.somelib.ntv.*; + + +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; +import java.lang.ref.Cleaner; +import java.util.List; +import static java.lang.foreign.ValueLayout.*; +import java.nio.charset.StandardCharsets; +import java.util.stream.Stream; + +public class Bar { + + MemorySegment internal; + Cleaner.Cleanable cleanable; + + List selfEdges = List.of(); + List bEdges = List.of(); + List aEdges = List.of(); + + + static class BarCleaner implements Runnable { + + MemorySegment segment; + BarCleaner(MemorySegment segment) { + this.segment = segment; + } + + public void run() { + somelib_h.Bar_destroy(this.segment); + } + } + + Bar() {} + Bar(MemorySegment handle, List selfEdges, List bEdges, List aEdges) { + this.internal = handle; + this.selfEdges = selfEdges; + this.bEdges = bEdges; + this.aEdges = aEdges; + + + } + + + public Foo foo() { + + + var nativeVal = somelib_h.Bar_foo(internal); + List selfEdges = List.of(this); + + + + List aEdges = List.of(this); + var returnVal = new Foo(nativeVal, selfEdges, aEdges); + + return returnVal; + } + +} \ No newline at end of file diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/BorrowedFields.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/BorrowedFields.java new file mode 100644 index 000000000..36538a355 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/BorrowedFields.java @@ -0,0 +1,62 @@ +package dev.diplomattest.somelib; + +import dev.diplomattest.somelib.ntv.somelib_h; + +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import java.lang.foreign.SegmentAllocator; +import java.util.List; +import static java.lang.foreign.ValueLayout.*; +import java.nio.charset.StandardCharsets; +import java.util.stream.Stream; + +public class BorrowedFields { + String a; + String b; + String c; + + + MemorySegment internal; + SegmentAllocator arena; + List selfEdges = List.of(); + List aEdges = List.of(); + + + private BorrowedFields(SegmentAllocator arena) { + this.arena = arena; + } + + BorrowedFields(SegmentAllocator arena, MemorySegment structSegment, List aEdges) { + this.arena = arena; + this.selfEdges = selfEdges; + this.aEdges = aEdges; + + + this.a = SliceUtils.readUtf16(dev.diplomattest.somelib.ntv.BorrowedFields.a(structSegment)); + this.b = SliceUtils.readUtf8(dev.diplomattest.somelib.ntv.BorrowedFields.b(structSegment)); + this.c = SliceUtils.readUtf8(dev.diplomattest.somelib.ntv.BorrowedFields.c(structSegment)); + + + } + + public static BorrowedFields fromBarAndStrings(Bar bar,String dstr16,String utf8Str) { + + try (var arena = Arena.ofConfined()) { + var returnArena = (SegmentAllocator) Arena.ofAuto(); + var barNative = bar.internal; + var dstr16MemSeg = arena.allocateFrom(dstr16, StandardCharsets.UTF_16); + var dstr16Len = dstr16MemSeg.byteSize(); + var utf8StrMemSeg = arena.allocateFrom(utf8Str, StandardCharsets.UTF_8); + var utf8StrLen = utf8StrMemSeg.byteSize(); + var nativeVal = somelib_h.BorrowedFields_from_bar_and_strings(returnArena, barNative, dstr16MemSeg, dstr16Len - 1, utf8StrMemSeg, utf8StrLen - 1); + + List xEdges = List.of(bar, dstr16, utf8Str); + + var returnVal = new BorrowedFields(returnArena, nativeVal, xEdges); + return returnVal; + } + } + +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/BorrowedFieldsReturning.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/BorrowedFieldsReturning.java new file mode 100644 index 000000000..9bd6f6a75 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/BorrowedFieldsReturning.java @@ -0,0 +1,40 @@ +package dev.diplomattest.somelib; + +import dev.diplomattest.somelib.ntv.somelib_h; + +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import java.lang.foreign.SegmentAllocator; +import java.util.List; +import static java.lang.foreign.ValueLayout.*; +import java.nio.charset.StandardCharsets; +import java.util.stream.Stream; + +public class BorrowedFieldsReturning { + String bytes; + + + MemorySegment internal; + SegmentAllocator arena; + List selfEdges = List.of(); + List aEdges = List.of(); + + + private BorrowedFieldsReturning(SegmentAllocator arena) { + this.arena = arena; + } + + BorrowedFieldsReturning(SegmentAllocator arena, MemorySegment structSegment, List aEdges) { + this.arena = arena; + this.selfEdges = selfEdges; + this.aEdges = aEdges; + + + this.bytes = SliceUtils.readUtf8(dev.diplomattest.somelib.ntv.BorrowedFieldsReturning.bytes(structSegment)); + + + } + +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/BorrowedFieldsWithBounds.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/BorrowedFieldsWithBounds.java new file mode 100644 index 000000000..6e75cc85c --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/BorrowedFieldsWithBounds.java @@ -0,0 +1,68 @@ +package dev.diplomattest.somelib; + +import dev.diplomattest.somelib.ntv.somelib_h; + +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import java.lang.foreign.SegmentAllocator; +import java.util.List; +import static java.lang.foreign.ValueLayout.*; +import java.nio.charset.StandardCharsets; +import java.util.stream.Stream; + +public class BorrowedFieldsWithBounds { + String fieldA; + String fieldB; + String fieldC; + + + MemorySegment internal; + SegmentAllocator arena; + List selfEdges = List.of(); + List aEdges = List.of(); + List bEdges = List.of(); + List cEdges = List.of(); + + + private BorrowedFieldsWithBounds(SegmentAllocator arena) { + this.arena = arena; + } + + BorrowedFieldsWithBounds(SegmentAllocator arena, MemorySegment structSegment, List aEdges, List bEdges, List cEdges) { + this.arena = arena; + this.selfEdges = selfEdges; + this.aEdges = aEdges; + this.bEdges = bEdges; + this.cEdges = cEdges; + + + this.fieldA = SliceUtils.readUtf16(dev.diplomattest.somelib.ntv.BorrowedFieldsWithBounds.field_a(structSegment)); + this.fieldB = SliceUtils.readUtf8(dev.diplomattest.somelib.ntv.BorrowedFieldsWithBounds.field_b(structSegment)); + this.fieldC = SliceUtils.readUtf8(dev.diplomattest.somelib.ntv.BorrowedFieldsWithBounds.field_c(structSegment)); + + + } + + public static BorrowedFieldsWithBounds fromFooAndStrings(Foo foo,String dstr16X,String utf8StrZ) { + + try (var arena = Arena.ofConfined()) { + var returnArena = (SegmentAllocator) Arena.ofAuto(); + var fooNative = foo.internal; + var dstr16XMemSeg = arena.allocateFrom(dstr16X, StandardCharsets.UTF_16); + var dstr16XLen = dstr16XMemSeg.byteSize(); + var utf8StrZMemSeg = arena.allocateFrom(utf8StrZ, StandardCharsets.UTF_8); + var utf8StrZLen = utf8StrZMemSeg.byteSize(); + var nativeVal = somelib_h.BorrowedFieldsWithBounds_from_foo_and_strings(returnArena, fooNative, dstr16XMemSeg, dstr16XLen - 1, utf8StrZMemSeg, utf8StrZLen - 1); + + List xEdges = List.of(foo, dstr16X, utf8StrZ); + List yEdges = List.of(foo, utf8StrZ); + List zEdges = List.of(utf8StrZ); + + var returnVal = new BorrowedFieldsWithBounds(returnArena, nativeVal, xEdges, yEdges, zEdges); + return returnVal; + } + } + +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ContiguousEnum.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ContiguousEnum.java new file mode 100644 index 000000000..bea541a2e --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ContiguousEnum.java @@ -0,0 +1,59 @@ +package dev.diplomattest.somelib; + +import dev.diplomattest.somelib.ntv.somelib_h; + + +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import java.lang.foreign.SegmentAllocator; +import static java.lang.foreign.ValueLayout.*; +import java.nio.charset.StandardCharsets; + +public enum ContiguousEnum { + C, + D, + E, + F, + ; + + static ContiguousEnum fromInt(int i) { + switch (i) { + case 0 -> { + return ContiguousEnum.C; + } + case 1 -> { + return ContiguousEnum.D; + } + case 2 -> { + return ContiguousEnum.E; + } + case 3 -> { + return ContiguousEnum.F; + } + + } + throw new RuntimeException("Unexpected int for ContiguousEnum:" + i); + } + + int toInt() { + switch (this) { + case C -> { + return 0; + } + case D -> { + return 1; + } + case E -> { + return 2; + } + case F -> { + return 3; + } + + } + throw new RuntimeException("Unexpected variant for ContiguousEnum:" + this); + } + + +} diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/CyclicStructA.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/CyclicStructA.java new file mode 100644 index 000000000..bc3d54f56 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/CyclicStructA.java @@ -0,0 +1,48 @@ +package dev.diplomattest.somelib; + +import dev.diplomattest.somelib.ntv.somelib_h; + +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import java.lang.foreign.SegmentAllocator; +import java.util.List; +import static java.lang.foreign.ValueLayout.*; +import java.nio.charset.StandardCharsets; +import java.util.stream.Stream; + +public class CyclicStructA { + CyclicStructB a; + + + MemorySegment internal; + SegmentAllocator arena; + List selfEdges = List.of(); + + + private CyclicStructA(SegmentAllocator arena) { + this.arena = arena; + } + + CyclicStructA(SegmentAllocator arena, MemorySegment structSegment) { + this.arena = arena; + this.selfEdges = selfEdges; + + + this.a = new CyclicStructB(arena, dev.diplomattest.somelib.ntv.CyclicStructA.a(structSegment)); + + + } + + public static CyclicStructB getB() { + + var returnArena = (SegmentAllocator) Arena.ofAuto(); + var nativeVal = somelib_h.CyclicStructA_get_b(returnArena); + + + var returnVal = new CyclicStructB(returnArena, nativeVal); + return returnVal; + } + +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/CyclicStructB.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/CyclicStructB.java new file mode 100644 index 000000000..34feb60e8 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/CyclicStructB.java @@ -0,0 +1,48 @@ +package dev.diplomattest.somelib; + +import dev.diplomattest.somelib.ntv.somelib_h; + +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import java.lang.foreign.SegmentAllocator; +import java.util.List; +import static java.lang.foreign.ValueLayout.*; +import java.nio.charset.StandardCharsets; +import java.util.stream.Stream; + +public class CyclicStructB { + byte field; + + + MemorySegment internal; + SegmentAllocator arena; + List selfEdges = List.of(); + + + private CyclicStructB(SegmentAllocator arena) { + this.arena = arena; + } + + CyclicStructB(SegmentAllocator arena, MemorySegment structSegment) { + this.arena = arena; + this.selfEdges = selfEdges; + + + this.field = dev.diplomattest.somelib.ntv.CyclicStructB.field(structSegment); + + + } + + public static CyclicStructA getA() { + + var returnArena = (SegmentAllocator) Arena.ofAuto(); + var nativeVal = somelib_h.CyclicStructB_get_a(returnArena); + + + var returnVal = new CyclicStructA(returnArena, nativeVal); + return returnVal; + } + +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ErrorEnum.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ErrorEnum.java new file mode 100644 index 000000000..53838c8eb --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ErrorEnum.java @@ -0,0 +1,45 @@ +package dev.diplomattest.somelib; + +import dev.diplomattest.somelib.ntv.somelib_h; + + +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import java.lang.foreign.SegmentAllocator; +import static java.lang.foreign.ValueLayout.*; +import java.nio.charset.StandardCharsets; + +public enum ErrorEnum { + Foo, + Bar, + ; + + static ErrorEnum fromInt(int i) { + switch (i) { + case 0 -> { + return ErrorEnum.Foo; + } + case 1 -> { + return ErrorEnum.Bar; + } + + } + throw new RuntimeException("Unexpected int for ErrorEnum:" + i); + } + + int toInt() { + switch (this) { + case Foo -> { + return 0; + } + case Bar -> { + return 1; + } + + } + throw new RuntimeException("Unexpected variant for ErrorEnum:" + this); + } + + +} diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ErrorStruct.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ErrorStruct.java new file mode 100644 index 000000000..9f258be51 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ErrorStruct.java @@ -0,0 +1,40 @@ +package dev.diplomattest.somelib; + +import dev.diplomattest.somelib.ntv.somelib_h; + +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import java.lang.foreign.SegmentAllocator; +import java.util.List; +import static java.lang.foreign.ValueLayout.*; +import java.nio.charset.StandardCharsets; +import java.util.stream.Stream; + +public class ErrorStruct { + int i; + int j; + + + MemorySegment internal; + SegmentAllocator arena; + List selfEdges = List.of(); + + + private ErrorStruct(SegmentAllocator arena) { + this.arena = arena; + } + + ErrorStruct(SegmentAllocator arena, MemorySegment structSegment) { + this.arena = arena; + this.selfEdges = selfEdges; + + + this.i = dev.diplomattest.somelib.ntv.ErrorStruct.i(structSegment); + this.j = dev.diplomattest.somelib.ntv.ErrorStruct.j(structSegment); + + + } + +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Float64Vec.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Float64Vec.java index 55a262f9c..b3a2deca2 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Float64Vec.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Float64Vec.java @@ -5,15 +5,21 @@ import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; import java.lang.ref.Cleaner; +import java.util.List; import static java.lang.foreign.ValueLayout.*; import java.nio.charset.StandardCharsets; +import java.util.stream.Stream; public class Float64Vec { MemorySegment internal; Cleaner.Cleanable cleanable; + List selfEdges = List.of(); + + static class Float64VecCleaner implements Runnable { MemorySegment segment; @@ -27,39 +33,190 @@ public void run() { } Float64Vec() {} + Float64Vec(MemorySegment handle, List selfEdges) { + this.internal = handle; + this.selfEdges = selfEdges; + - public static Float64Vec new_(double[] v) { + } + + public static Float64Vec newBool(boolean[] v) { + try (var arena = Arena.ofConfined()) { var vLen = v.length; - var vMemSeg = arena.allocateFrom(JAVA_DOUBLE, v); - var nativeVal = somelib_h.Float64Vec_new(vMemSeg, vLen); - var returnVal = new Float64Vec(); - returnVal.internal = nativeVal; + byte[] vByteArray = new byte[vLen]; + for (int i = 0; i < vLen; i++) { + vByteArray[i] = (byte) (v[i] ? 1 : 0); + } + var vMemSeg = arena.allocateFrom(JAVA_BYTE, vByteArray); + var nativeVal = somelib_h.Float64Vec_new_bool(vMemSeg, vLen); + List selfEdges = List.of(); + + + + var returnVal = new Float64Vec(nativeVal, selfEdges); var cleaner = new Float64Vec.Float64VecCleaner(nativeVal); returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; } } - - - public double[] asBoxedSlice() { - var boxArena = Arena.ofConfined(); - - var nativeVal = somelib_h.Float64Vec_as_boxed_slice(boxArena, internal); - var data = dev.diplomattest.somelib.ntv.DiplomatF64View.data(nativeVal); - var len = dev.diplomattest.somelib.ntv.DiplomatF64View.len(nativeVal); - return SliceUtils.doubleSliceToArray(nativeVal); + + public static Float64Vec newI16(short[] v) { + + try (var arena = Arena.ofConfined()) { + var vLen = v.length; + var vMemSeg = arena.allocateFrom(JAVA_SHORT, v); + var nativeVal = somelib_h.Float64Vec_new_i16(vMemSeg, vLen); + List selfEdges = List.of(); + + + + var returnVal = new Float64Vec(nativeVal, selfEdges); + var cleaner = new Float64Vec.Float64VecCleaner(nativeVal); + returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); + return returnVal; + } } - + + public static Float64Vec newU16(short[] v) { + + try (var arena = Arena.ofConfined()) { + var vLen = v.length; + var vMemSeg = arena.allocateFrom(JAVA_SHORT, v); + var nativeVal = somelib_h.Float64Vec_new_u16(vMemSeg, vLen); + List selfEdges = List.of(); + + + + var returnVal = new Float64Vec(nativeVal, selfEdges); + var cleaner = new Float64Vec.Float64VecCleaner(nativeVal); + returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); + return returnVal; + } + } + + public static Float64Vec newIsize(long[] v) { + + try (var arena = Arena.ofConfined()) { + var vLen = v.length; + var vMemSeg = arena.allocateFrom(JAVA_LONG, v); + var nativeVal = somelib_h.Float64Vec_new_isize(vMemSeg, vLen); + List selfEdges = List.of(); + + + + var returnVal = new Float64Vec(nativeVal, selfEdges); + var cleaner = new Float64Vec.Float64VecCleaner(nativeVal); + returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); + return returnVal; + } + } + + public static Float64Vec newUsize(long[] v) { + + try (var arena = Arena.ofConfined()) { + var vLen = v.length; + var vMemSeg = arena.allocateFrom(JAVA_LONG, v); + var nativeVal = somelib_h.Float64Vec_new_usize(vMemSeg, vLen); + List selfEdges = List.of(); + + + + var returnVal = new Float64Vec(nativeVal, selfEdges); + var cleaner = new Float64Vec.Float64VecCleaner(nativeVal); + returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); + return returnVal; + } + } + + public static Float64Vec newF64BeBytes(byte[] v) { + + try (var arena = Arena.ofConfined()) { + var vLen = v.length; + var vMemSeg = arena.allocateFrom(JAVA_BYTE, v); + var nativeVal = somelib_h.Float64Vec_new_f64_be_bytes(vMemSeg, vLen); + List selfEdges = List.of(); + + + + var returnVal = new Float64Vec(nativeVal, selfEdges); + var cleaner = new Float64Vec.Float64VecCleaner(nativeVal); + returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); + return returnVal; + } + } + + public static Float64Vec newFromOwned(double[] v) { + + var vLen = v.length; + var vMemSeg = Arena.global().allocateFrom(JAVA_DOUBLE, v); + var nativeVal = somelib_h.Float64Vec_new_from_owned(vMemSeg, vLen); + List selfEdges = List.of(); + + + + var returnVal = new Float64Vec(nativeVal, selfEdges); + var cleaner = new Float64Vec.Float64VecCleaner(nativeVal); + returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); + return returnVal; + } + + public double[] asSlice() { + try (var arena = Arena.ofConfined()) { - - + + var nativeVal = somelib_h.Float64Vec_as_slice(arena, internal); var data = dev.diplomattest.somelib.ntv.DiplomatF64View.data(nativeVal); var len = dev.diplomattest.somelib.ntv.DiplomatF64View.len(nativeVal); return SliceUtils.doubleSliceToArray(nativeVal); } } - -} + + public void fillSlice(double[] v) { + + try (var arena = Arena.ofConfined()) { + + var vLen = v.length; + var vMemSeg = arena.allocateFrom(JAVA_DOUBLE, v); + somelib_h.Float64Vec_fill_slice(internal, vMemSeg, vLen); + + } + } + + public void setValue(double[] newSlice) { + + try (var arena = Arena.ofConfined()) { + + var newSliceLen = newSlice.length; + var newSliceMemSeg = arena.allocateFrom(JAVA_DOUBLE, newSlice); + somelib_h.Float64Vec_set_value(internal, newSliceMemSeg, newSliceLen); + + } + } + + public String toString_() { + + + var writeable = somelib_h.diplomat_buffer_write_create(0); + somelib_h.Float64Vec_to_string(internal, writeable); + var buffer = DiplomatWrite.buf(writeable); + var string = buffer.getString(0, StandardCharsets.UTF_8); + somelib_h.diplomat_buffer_write_destroy(writeable); + return string; + } + + public double[] borrow() { + + try (var arena = Arena.ofConfined()) { + + + var nativeVal = somelib_h.Float64Vec_borrow(arena, internal); + var data = dev.diplomattest.somelib.ntv.DiplomatF64View.data(nativeVal); + var len = dev.diplomattest.somelib.ntv.DiplomatF64View.len(nativeVal); + return SliceUtils.doubleSliceToArray(nativeVal); + } + } + +} \ No newline at end of file diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Foo.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Foo.java new file mode 100644 index 000000000..d50fab57b --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Foo.java @@ -0,0 +1,144 @@ +package dev.diplomattest.somelib; + +import dev.diplomattest.somelib.ntv.*; + + +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; +import java.lang.ref.Cleaner; +import java.util.List; +import static java.lang.foreign.ValueLayout.*; +import java.nio.charset.StandardCharsets; +import java.util.stream.Stream; + +public class Foo { + + MemorySegment internal; + Cleaner.Cleanable cleanable; + + List selfEdges = List.of(); + List aEdges = List.of(); + + + static class FooCleaner implements Runnable { + + MemorySegment segment; + FooCleaner(MemorySegment segment) { + this.segment = segment; + } + + public void run() { + somelib_h.Foo_destroy(this.segment); + } + } + + Foo() {} + Foo(MemorySegment handle, List selfEdges, List aEdges) { + this.internal = handle; + this.selfEdges = selfEdges; + this.aEdges = aEdges; + + + } + + public static Foo new_(String x) { + + try (var arena = Arena.ofConfined()) { + var xMemSeg = arena.allocateFrom(x, StandardCharsets.UTF_8); + var xLen = xMemSeg.byteSize(); + var nativeVal = somelib_h.Foo_new(xMemSeg, xLen - 1); + List selfEdges = List.of(); + + + + List aEdges = List.of(x); + var returnVal = new Foo(nativeVal, selfEdges, aEdges); + var cleaner = new Foo.FooCleaner(nativeVal); + returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); + return returnVal; + } + } + + public static Foo newStatic(String x) { + + try (var arena = Arena.ofConfined()) { + var xMemSeg = arena.allocateFrom(x, StandardCharsets.UTF_8); + var xLen = xMemSeg.byteSize(); + var nativeVal = somelib_h.Foo_new_static(xMemSeg, xLen - 1); + List selfEdges = List.of(); + + + + List aEdges = List.of(); + var returnVal = new Foo(nativeVal, selfEdges, aEdges); + var cleaner = new Foo.FooCleaner(nativeVal); + returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); + return returnVal; + } + } + + public static Foo extractFromFields(BorrowedFields fields) { + + var fieldsNative = fields.internal; + var nativeVal = somelib_h.Foo_extract_from_fields(fieldsNative); + List selfEdges = List.of(); + + + + List aEdges = List.of(fields); + var returnVal = new Foo(nativeVal, selfEdges, aEdges); + var cleaner = new Foo.FooCleaner(nativeVal); + returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); + return returnVal; + } + + public static Foo extractFromBounds(BorrowedFieldsWithBounds bounds,String anotherString) { + + try (var arena = Arena.ofConfined()) { + var boundsNative = bounds.internal; + var anotherStringMemSeg = arena.allocateFrom(anotherString, StandardCharsets.UTF_8); + var anotherStringLen = anotherStringMemSeg.byteSize(); + var nativeVal = somelib_h.Foo_extract_from_bounds(boundsNative, anotherStringMemSeg, anotherStringLen - 1); + List selfEdges = List.of(); + + + + List aEdges = List.of(bounds, bounds, anotherString); + var returnVal = new Foo(nativeVal, selfEdges, aEdges); + var cleaner = new Foo.FooCleaner(nativeVal); + returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); + return returnVal; + } + } + + + public Bar getBar() { + + + var nativeVal = somelib_h.Foo_get_bar(internal); + List selfEdges = List.of(); + + + + List bEdges = List.of(this); + List aEdges = List.of(this); + var returnVal = new Bar(nativeVal, selfEdges, bEdges, aEdges); + var cleaner = new Bar.BarCleaner(nativeVal); + returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); + return returnVal; + } + + public BorrowedFieldsReturning asReturning() { + + var returnArena = (SegmentAllocator) Arena.ofAuto(); + + var nativeVal = somelib_h.Foo_as_returning(returnArena, internal); + + List aEdges = List.of(this); + + var returnVal = new BorrowedFieldsReturning(returnArena, nativeVal, aEdges); + return returnVal; + } + +} \ No newline at end of file diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Lib.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Lib.java index 10a3508a5..76db853de 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Lib.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Lib.java @@ -6,6 +6,7 @@ import java.lang.ref.Cleaner; import java.nio.charset.StandardCharsets; import java.util.function.Consumer; +import java.util.Arrays; import static java.lang.foreign.ValueLayout.*; @@ -45,6 +46,19 @@ class Unit {} class SliceUtils { + + static boolean[] booleanSliceToArray(MemorySegment segment) { + var data = DiplomatU8View.data(segment); + var len = DiplomatU8View.len(segment); + var slice = data.asSlice(0, len * JAVA_BYTE.byteSize()); + var byteArray = slice.toArray(JAVA_BYTE); + var returnArray = new boolean[(int) len]; + for (var i=0; i < len; i++ ) { + returnArray[i] = (byteArray[i] == 1); + } + return returnArray; + } + static byte[] byteSliceToArray(MemorySegment segment) { var data = DiplomatU8View.data(segment); var len = DiplomatU8View.len(segment); diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyEnum.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyEnum.java index 9147a3cb0..49518c024 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyEnum.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyEnum.java @@ -6,6 +6,7 @@ import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; import java.lang.ref.Cleaner; +import java.lang.foreign.SegmentAllocator; import static java.lang.foreign.ValueLayout.*; import java.nio.charset.StandardCharsets; @@ -38,7 +39,7 @@ static MyEnum fromInt(int i) { case 3 -> { return MyEnum.F; } - + } throw new RuntimeException("Unexpected int for MyEnum:" + i); } @@ -63,16 +64,16 @@ int toInt() { case F -> { return 3; } - + } throw new RuntimeException("Unexpected variant for MyEnum:" + this); } - + public static MyEnum getA() { - var nativeInvoker = somelib_h.MyEnum_get_a.makeInvoker(); - var nativeVal = nativeInvoker.apply(); + + var nativeVal = somelib_h.MyEnum_get_a(); return MyEnum.fromInt(nativeVal); } - + } diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyString.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyString.java index df4ee4028..6089ab482 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyString.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyString.java @@ -5,15 +5,21 @@ import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; import java.lang.ref.Cleaner; +import java.util.List; import static java.lang.foreign.ValueLayout.*; import java.nio.charset.StandardCharsets; +import java.util.stream.Stream; public class MyString { MemorySegment internal; Cleaner.Cleanable cleanable; + List selfEdges = List.of(); + + static class MyStringCleaner implements Runnable { MemorySegment segment; @@ -27,67 +33,108 @@ public void run() { } MyString() {} + MyString(MemorySegment handle, List selfEdges) { + this.internal = handle; + this.selfEdges = selfEdges; + - public MyString(String v) { + } + + public static MyString new_(String v) { + try (var arena = Arena.ofConfined()) { var vMemSeg = arena.allocateFrom(v, StandardCharsets.UTF_8); var vLen = vMemSeg.byteSize(); var nativeVal = somelib_h.MyString_new(vMemSeg, vLen - 1); - this.internal = nativeVal; + List selfEdges = List.of(); + + + + var returnVal = new MyString(nativeVal, selfEdges); var cleaner = new MyString.MyStringCleaner(nativeVal); - this.cleanable = Lib.cleaner.register(this, cleaner); + returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); + return returnVal; } } - + public static MyString newUnsafe(String v) { + try (var arena = Arena.ofConfined()) { var vMemSeg = arena.allocateFrom(v, StandardCharsets.UTF_8); var vLen = vMemSeg.byteSize(); var nativeVal = somelib_h.MyString_new_unsafe(vMemSeg, vLen - 1); - var returnVal = new MyString(); - returnVal.internal = nativeVal; + List selfEdges = List.of(); + + + + var returnVal = new MyString(nativeVal, selfEdges); var cleaner = new MyString.MyStringCleaner(nativeVal); returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; } } - + public static MyString newOwned(String v) { + var vMemSeg = Arena.global().allocateFrom(v, StandardCharsets.UTF_8); var vLen = vMemSeg.byteSize(); var nativeVal = somelib_h.MyString_new_owned(vMemSeg, vLen - 1); - var returnVal = new MyString(); - returnVal.internal = nativeVal; + List selfEdges = List.of(); + + + + var returnVal = new MyString(nativeVal, selfEdges); var cleaner = new MyString.MyStringCleaner(nativeVal); returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; } - + public static MyString newFromFirst(String [] v) { + try (var arena = Arena.ofConfined()) { var vData = SliceUtils.strs8(arena, v); var vLen = v.length; var nativeVal = somelib_h.MyString_new_from_first(vData, vLen); - var returnVal = new MyString(); - returnVal.internal = nativeVal; + List selfEdges = List.of(); + + + + var returnVal = new MyString(nativeVal, selfEdges); var cleaner = new MyString.MyStringCleaner(nativeVal); returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; } } - - + + public static String stringTransform(String foo) { + + try (var arena = Arena.ofConfined()) { + var fooMemSeg = arena.allocateFrom(foo, StandardCharsets.UTF_8); + var fooLen = fooMemSeg.byteSize(); + var writeable = somelib_h.diplomat_buffer_write_create(0); + somelib_h.MyString_string_transform(fooMemSeg, fooLen - 1, writeable); + var buffer = DiplomatWrite.buf(writeable); + var string = buffer.getString(0, StandardCharsets.UTF_8); + somelib_h.diplomat_buffer_write_destroy(writeable); + return string; + } + } + + public void setStr(String newStr) { + try (var arena = Arena.ofConfined()) { + var newStrMemSeg = arena.allocateFrom(newStr, StandardCharsets.UTF_8); var newStrLen = newStrMemSeg.byteSize(); somelib_h.MyString_set_str(internal, newStrMemSeg, newStrLen - 1); - + } } - + public String getStr() { - + + var writeable = somelib_h.diplomat_buffer_write_create(0); somelib_h.MyString_get_str(internal, writeable); var buffer = DiplomatWrite.buf(writeable); @@ -95,12 +142,5 @@ public String getStr() { somelib_h.diplomat_buffer_write_destroy(writeable); return string; } - - public String getBoxedStr() { - var boxArena = Arena.ofConfined(); - - var nativeVal = somelib_h.MyString_get_boxed_str(boxArena, internal); - return SliceUtils.readUtf8(nativeVal); - } - -} + +} \ No newline at end of file diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyStruct.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyStruct.java index acf6a8bbc..c853c264c 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyStruct.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyStruct.java @@ -6,8 +6,10 @@ import java.lang.foreign.MemorySegment; import java.lang.ref.Cleaner; import java.lang.foreign.SegmentAllocator; +import java.util.List; import static java.lang.foreign.ValueLayout.*; import java.nio.charset.StandardCharsets; +import java.util.stream.Stream; public class MyStruct { byte a; @@ -17,36 +19,42 @@ public class MyStruct { int e; int f; MyEnum g; - + MemorySegment internal; SegmentAllocator arena; + List selfEdges = List.of(); + private MyStruct(SegmentAllocator arena) { + this.arena = arena; } - void initFromSegment(MemorySegment segment) { - this.internal = segment; + MyStruct(SegmentAllocator arena, MemorySegment structSegment) { + this.arena = arena; + this.selfEdges = selfEdges; + - this.a = dev.diplomattest.somelib.ntv.MyStruct.a(segment); - this.b = dev.diplomattest.somelib.ntv.MyStruct.b(segment); - this.c = dev.diplomattest.somelib.ntv.MyStruct.c(segment); - this.d = dev.diplomattest.somelib.ntv.MyStruct.d(segment); - this.e = dev.diplomattest.somelib.ntv.MyStruct.e(segment); - this.f = dev.diplomattest.somelib.ntv.MyStruct.f(segment); - this.g = MyEnum.fromInt(dev.diplomattest.somelib.ntv.MyStruct.g(segment)); + this.a = dev.diplomattest.somelib.ntv.MyStruct.a(structSegment); + this.b = dev.diplomattest.somelib.ntv.MyStruct.b(structSegment); + this.c = dev.diplomattest.somelib.ntv.MyStruct.c(structSegment); + this.d = dev.diplomattest.somelib.ntv.MyStruct.d(structSegment); + this.e = dev.diplomattest.somelib.ntv.MyStruct.e(structSegment); + this.f = dev.diplomattest.somelib.ntv.MyStruct.f(structSegment); + this.g = MyEnum.fromInt(dev.diplomattest.somelib.ntv.MyStruct.g(structSegment)); + } - + public static MyStruct new_() { - + var returnArena = (SegmentAllocator) Arena.ofAuto(); - var nativeInvoker = somelib_h.MyStruct_new.makeInvoker(); - var nativeVal = nativeInvoker.apply(returnArena); - var returnVal = new MyStruct(returnArena); - returnVal.initFromSegment(nativeVal); + var nativeVal = somelib_h.MyStruct_new(returnArena); + + + var returnVal = new MyStruct(returnArena, nativeVal); return returnVal; } - + } diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyZst.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyZst.java new file mode 100644 index 000000000..e3892baae --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyZst.java @@ -0,0 +1,36 @@ +package dev.diplomattest.somelib; + +import dev.diplomattest.somelib.ntv.somelib_h; + +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import java.lang.foreign.SegmentAllocator; +import java.util.List; +import static java.lang.foreign.ValueLayout.*; +import java.nio.charset.StandardCharsets; +import java.util.stream.Stream; + +public class MyZst { + + + MemorySegment internal; + SegmentAllocator arena; + List selfEdges = List.of(); + + + private MyZst(SegmentAllocator arena) { + this.arena = arena; + } + + MyZst(SegmentAllocator arena, MemorySegment structSegment) { + this.arena = arena; + this.selfEdges = selfEdges; + + + + + } + +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/NestedBorrowedFields.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/NestedBorrowedFields.java new file mode 100644 index 000000000..adb0c4f93 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/NestedBorrowedFields.java @@ -0,0 +1,73 @@ +package dev.diplomattest.somelib; + +import dev.diplomattest.somelib.ntv.somelib_h; + +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import java.lang.foreign.SegmentAllocator; +import java.util.List; +import static java.lang.foreign.ValueLayout.*; +import java.nio.charset.StandardCharsets; +import java.util.stream.Stream; + +public class NestedBorrowedFields { + BorrowedFields fields; + BorrowedFieldsWithBounds bounds; + BorrowedFieldsWithBounds bounds2; + + + MemorySegment internal; + SegmentAllocator arena; + List selfEdges = List.of(); + List xEdges = List.of(); + List yEdges = List.of(); + List zEdges = List.of(); + + + private NestedBorrowedFields(SegmentAllocator arena) { + this.arena = arena; + } + + NestedBorrowedFields(SegmentAllocator arena, MemorySegment structSegment, List xEdges, List yEdges, List zEdges) { + this.arena = arena; + this.selfEdges = selfEdges; + this.xEdges = xEdges; + this.yEdges = yEdges; + this.zEdges = zEdges; + + + this.fields = new BorrowedFields(arena, dev.diplomattest.somelib.ntv.NestedBorrowedFields.fields(structSegment), Stream.concat(xEdges.stream(), yEdges.stream()).toList()); + this.bounds = new BorrowedFieldsWithBounds(arena, dev.diplomattest.somelib.ntv.NestedBorrowedFields.bounds(structSegment), Stream.concat(xEdges.stream(), yEdges.stream()).toList(), yEdges, yEdges); + this.bounds2 = new BorrowedFieldsWithBounds(arena, dev.diplomattest.somelib.ntv.NestedBorrowedFields.bounds2(structSegment), zEdges, zEdges, zEdges); + + + } + + public static NestedBorrowedFields fromBarAndFooAndStrings(Bar bar,Foo foo,String dstr16X,String dstr16Z,String utf8StrY,String utf8StrZ) { + + try (var arena = Arena.ofConfined()) { + var returnArena = (SegmentAllocator) Arena.ofAuto(); + var barNative = bar.internal; + var fooNative = foo.internal; + var dstr16XMemSeg = arena.allocateFrom(dstr16X, StandardCharsets.UTF_16); + var dstr16XLen = dstr16XMemSeg.byteSize(); + var dstr16ZMemSeg = arena.allocateFrom(dstr16Z, StandardCharsets.UTF_16); + var dstr16ZLen = dstr16ZMemSeg.byteSize(); + var utf8StrYMemSeg = arena.allocateFrom(utf8StrY, StandardCharsets.UTF_8); + var utf8StrYLen = utf8StrYMemSeg.byteSize(); + var utf8StrZMemSeg = arena.allocateFrom(utf8StrZ, StandardCharsets.UTF_8); + var utf8StrZLen = utf8StrZMemSeg.byteSize(); + var nativeVal = somelib_h.NestedBorrowedFields_from_bar_and_foo_and_strings(returnArena, barNative, fooNative, dstr16XMemSeg, dstr16XLen - 1, dstr16ZMemSeg, dstr16ZLen - 1, utf8StrYMemSeg, utf8StrYLen - 1, utf8StrZMemSeg, utf8StrZLen - 1); + + List xEdges = List.of(bar, dstr16X, utf8StrY); + List yEdges = List.of(bar, utf8StrY); + List zEdges = List.of(foo, dstr16Z, utf8StrZ); + + var returnVal = new NestedBorrowedFields(returnArena, nativeVal, xEdges, yEdges, zEdges); + return returnVal; + } + } + +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/One.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/One.java new file mode 100644 index 000000000..7b1b243d2 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/One.java @@ -0,0 +1,239 @@ +package dev.diplomattest.somelib; + +import dev.diplomattest.somelib.ntv.*; + + +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; +import java.lang.ref.Cleaner; +import java.util.List; +import static java.lang.foreign.ValueLayout.*; +import java.nio.charset.StandardCharsets; +import java.util.stream.Stream; + +public class One { + + MemorySegment internal; + Cleaner.Cleanable cleanable; + + List selfEdges = List.of(); + List aEdges = List.of(); + + + static class OneCleaner implements Runnable { + + MemorySegment segment; + OneCleaner(MemorySegment segment) { + this.segment = segment; + } + + public void run() { + somelib_h.One_destroy(this.segment); + } + } + + One() {} + One(MemorySegment handle, List selfEdges, List aEdges) { + this.internal = handle; + this.selfEdges = selfEdges; + this.aEdges = aEdges; + + + } + + public static One transitivity(One hold,One nohold) { + + var holdNative = hold.internal; + var noholdNative = nohold.internal; + var nativeVal = somelib_h.One_transitivity(holdNative, noholdNative); + List selfEdges = List.of(); + + + + List aEdges = List.of(hold); + var returnVal = new One(nativeVal, selfEdges, aEdges); + var cleaner = new One.OneCleaner(nativeVal); + returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); + return returnVal; + } + + public static One cycle(Two hold,One nohold) { + + var holdNative = hold.internal; + var noholdNative = nohold.internal; + var nativeVal = somelib_h.One_cycle(holdNative, noholdNative); + List selfEdges = List.of(); + + + + List aEdges = List.of(hold); + var returnVal = new One(nativeVal, selfEdges, aEdges); + var cleaner = new One.OneCleaner(nativeVal); + returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); + return returnVal; + } + + public static One manyDependents(One a,One b,Two c,Two d,Two nohold) { + + var aNative = a.internal; + var bNative = b.internal; + var cNative = c.internal; + var dNative = d.internal; + var noholdNative = nohold.internal; + var nativeVal = somelib_h.One_many_dependents(aNative, bNative, cNative, dNative, noholdNative); + List selfEdges = List.of(); + + + + List aEdges = List.of(a, b, c, d); + var returnVal = new One(nativeVal, selfEdges, aEdges); + var cleaner = new One.OneCleaner(nativeVal); + returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); + return returnVal; + } + + public static One returnOutlivesParam(Two hold,One nohold) { + + var holdNative = hold.internal; + var noholdNative = nohold.internal; + var nativeVal = somelib_h.One_return_outlives_param(holdNative, noholdNative); + List selfEdges = List.of(); + + + + List longEdges = List.of(hold); + var returnVal = new One(nativeVal, selfEdges, longEdges); + var cleaner = new One.OneCleaner(nativeVal); + returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); + return returnVal; + } + + public static One diamondTop(One top,One left,One right,One bottom) { + + var topNative = top.internal; + var leftNative = left.internal; + var rightNative = right.internal; + var bottomNative = bottom.internal; + var nativeVal = somelib_h.One_diamond_top(topNative, leftNative, rightNative, bottomNative); + List selfEdges = List.of(); + + + + List topEdges = List.of(top, left, right, bottom); + var returnVal = new One(nativeVal, selfEdges, topEdges); + var cleaner = new One.OneCleaner(nativeVal); + returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); + return returnVal; + } + + public static One diamondLeft(One top,One left,One right,One bottom) { + + var topNative = top.internal; + var leftNative = left.internal; + var rightNative = right.internal; + var bottomNative = bottom.internal; + var nativeVal = somelib_h.One_diamond_left(topNative, leftNative, rightNative, bottomNative); + List selfEdges = List.of(); + + + + List leftEdges = List.of(left, bottom); + var returnVal = new One(nativeVal, selfEdges, leftEdges); + var cleaner = new One.OneCleaner(nativeVal); + returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); + return returnVal; + } + + public static One diamondRight(One top,One left,One right,One bottom) { + + var topNative = top.internal; + var leftNative = left.internal; + var rightNative = right.internal; + var bottomNative = bottom.internal; + var nativeVal = somelib_h.One_diamond_right(topNative, leftNative, rightNative, bottomNative); + List selfEdges = List.of(); + + + + List rightEdges = List.of(right, bottom); + var returnVal = new One(nativeVal, selfEdges, rightEdges); + var cleaner = new One.OneCleaner(nativeVal); + returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); + return returnVal; + } + + public static One diamondBottom(One top,One left,One right,One bottom) { + + var topNative = top.internal; + var leftNative = left.internal; + var rightNative = right.internal; + var bottomNative = bottom.internal; + var nativeVal = somelib_h.One_diamond_bottom(topNative, leftNative, rightNative, bottomNative); + List selfEdges = List.of(); + + + + List bottomEdges = List.of(bottom); + var returnVal = new One(nativeVal, selfEdges, bottomEdges); + var cleaner = new One.OneCleaner(nativeVal); + returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); + return returnVal; + } + + public static One diamondAndNestedTypes(One a,One b,One c,One d,One nohold) { + + var aNative = a.internal; + var bNative = b.internal; + var cNative = c.internal; + var dNative = d.internal; + var noholdNative = nohold.internal; + var nativeVal = somelib_h.One_diamond_and_nested_types(aNative, bNative, cNative, dNative, noholdNative); + List selfEdges = List.of(); + + + + List aEdges = List.of(a, b, c, d); + var returnVal = new One(nativeVal, selfEdges, aEdges); + var cleaner = new One.OneCleaner(nativeVal); + returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); + return returnVal; + } + + public static One implicitBounds(One explicitHold,One implicitHold,One nohold) { + + var explicitHoldNative = explicitHold.internal; + var implicitHoldNative = implicitHold.internal; + var noholdNative = nohold.internal; + var nativeVal = somelib_h.One_implicit_bounds(explicitHoldNative, implicitHoldNative, noholdNative); + List selfEdges = List.of(); + + + + List aEdges = List.of(explicitHold, implicitHold); + var returnVal = new One(nativeVal, selfEdges, aEdges); + var cleaner = new One.OneCleaner(nativeVal); + returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); + return returnVal; + } + + public static One implicitBoundsDeep(One explicit,One implicit1,One implicit2,One nohold) { + + var explicitNative = explicit.internal; + var implicit1Native = implicit1.internal; + var implicit2Native = implicit2.internal; + var noholdNative = nohold.internal; + var nativeVal = somelib_h.One_implicit_bounds_deep(explicitNative, implicit1Native, implicit2Native, noholdNative); + List selfEdges = List.of(); + + + + List aEdges = List.of(explicit, implicit1, implicit2); + var returnVal = new One(nativeVal, selfEdges, aEdges); + var cleaner = new One.OneCleaner(nativeVal); + returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); + return returnVal; + } + + +} \ No newline at end of file diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Opaque.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Opaque.java index 1a4a63206..3d7abfdb0 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Opaque.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Opaque.java @@ -7,15 +7,18 @@ import java.lang.foreign.MemorySegment; import java.lang.foreign.SegmentAllocator; import java.lang.ref.Cleaner; +import java.util.List; import static java.lang.foreign.ValueLayout.*; import java.nio.charset.StandardCharsets; -import java.util.List; +import java.util.stream.Stream; public class Opaque { MemorySegment internal; Cleaner.Cleanable cleanable; + List selfEdges = List.of(); + static class OpaqueCleaner implements Runnable { @@ -30,48 +33,59 @@ public void run() { } Opaque() {} + Opaque(MemorySegment handle, List selfEdges) { + this.internal = handle; + this.selfEdges = selfEdges; + + } + public static Opaque new_() { - - var nativeInvoker = somelib_h.Opaque_new.makeInvoker(); - var nativeVal = nativeInvoker.apply(); - var returnVal = new Opaque(); - returnVal.internal = nativeVal; + + var nativeVal = somelib_h.Opaque_new(); + List selfEdges = List.of(); + + + + var returnVal = new Opaque(nativeVal, selfEdges); var cleaner = new Opaque.OpaqueCleaner(nativeVal); returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; } - + public static Opaque fromStr(String input) { - + try (var arena = Arena.ofConfined()) { var inputMemSeg = arena.allocateFrom(input, StandardCharsets.UTF_8); var inputLen = inputMemSeg.byteSize(); var nativeVal = somelib_h.Opaque_from_str(inputMemSeg, inputLen - 1); - var returnVal = new Opaque(); - returnVal.internal = nativeVal; + List selfEdges = List.of(); + + + + var returnVal = new Opaque(nativeVal, selfEdges); var cleaner = new Opaque.OpaqueCleaner(nativeVal); returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; } } - + public static long returnsUsize() { - - var nativeInvoker = somelib_h.Opaque_returns_usize.makeInvoker(); - var nativeVal = nativeInvoker.apply(); + + var nativeVal = somelib_h.Opaque_returns_usize(); return nativeVal; } - - - public long internalLen() { - var nativeVal = somelib_h.Opaque_internal_len(internal); + + public static byte cmp() { + + var nativeVal = somelib_h.Opaque_cmp(); return nativeVal; } - + + public String getDebugStr() { - - + + var writeable = somelib_h.diplomat_buffer_write_create(0); somelib_h.Opaque_get_debug_str(internal, writeable); var buffer = DiplomatWrite.buf(writeable); @@ -79,5 +93,20 @@ public String getDebugStr() { somelib_h.diplomat_buffer_write_destroy(writeable); return string; } - -} + + public void assertStruct(MyStruct s) { + + + var sNative = s.internal; + somelib_h.Opaque_assert_struct(internal, sNative); + + } + + public long internalLen() { + + + var nativeVal = somelib_h.Opaque_internal_len(internal); + return nativeVal; + } + +} \ No newline at end of file diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/OpaqueMutexedString.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/OpaqueMutexedString.java new file mode 100644 index 000000000..c07f2dcf7 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/OpaqueMutexedString.java @@ -0,0 +1,138 @@ +package dev.diplomattest.somelib; + +import dev.diplomattest.somelib.ntv.*; + + +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; +import java.lang.ref.Cleaner; +import java.util.List; +import static java.lang.foreign.ValueLayout.*; +import java.nio.charset.StandardCharsets; +import java.util.stream.Stream; + +public class OpaqueMutexedString { + + MemorySegment internal; + Cleaner.Cleanable cleanable; + + List selfEdges = List.of(); + + + static class OpaqueMutexedStringCleaner implements Runnable { + + MemorySegment segment; + OpaqueMutexedStringCleaner(MemorySegment segment) { + this.segment = segment; + } + + public void run() { + somelib_h.OpaqueMutexedString_destroy(this.segment); + } + } + + OpaqueMutexedString() {} + OpaqueMutexedString(MemorySegment handle, List selfEdges) { + this.internal = handle; + this.selfEdges = selfEdges; + + + } + + public static OpaqueMutexedString fromUsize(long number) { + + var numberNative = number; + var nativeVal = somelib_h.OpaqueMutexedString_from_usize(numberNative); + List selfEdges = List.of(); + + + + var returnVal = new OpaqueMutexedString(nativeVal, selfEdges); + var cleaner = new OpaqueMutexedString.OpaqueMutexedStringCleaner(nativeVal); + returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); + return returnVal; + } + + public static OpaqueMutexedString borrowOther(OpaqueMutexedString other) { + + var otherNative = other.internal; + var nativeVal = somelib_h.OpaqueMutexedString_borrow_other(otherNative); + List selfEdges = List.of(other); + + + + var returnVal = new OpaqueMutexedString(nativeVal, selfEdges); + + return returnVal; + } + + + public void change(long number) { + + + var numberNative = number; + somelib_h.OpaqueMutexedString_change(internal, numberNative); + + } + + public OpaqueMutexedString borrow() { + + + var nativeVal = somelib_h.OpaqueMutexedString_borrow(internal); + List selfEdges = List.of(this); + + + + var returnVal = new OpaqueMutexedString(nativeVal, selfEdges); + + return returnVal; + } + + public OpaqueMutexedString borrowSelfOrOther(OpaqueMutexedString other) { + + + var otherNative = other.internal; + var nativeVal = somelib_h.OpaqueMutexedString_borrow_self_or_other(internal, otherNative); + List selfEdges = List.of(this, other); + + + + var returnVal = new OpaqueMutexedString(nativeVal, selfEdges); + + return returnVal; + } + + public long getLenAndAdd(long other) { + + + var otherNative = other; + var nativeVal = somelib_h.OpaqueMutexedString_get_len_and_add(internal, otherNative); + return nativeVal; + } + + public String dummyStr() { + + try (var arena = Arena.ofConfined()) { + + + var nativeVal = somelib_h.OpaqueMutexedString_dummy_str(arena, internal); + return SliceUtils.readUtf8(nativeVal); + } + } + + public Utf16Wrap wrapper() { + + + var nativeVal = somelib_h.OpaqueMutexedString_wrapper(internal); + List selfEdges = List.of(); + + + + var returnVal = new Utf16Wrap(nativeVal, selfEdges); + var cleaner = new Utf16Wrap.Utf16WrapCleaner(nativeVal); + returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); + return returnVal; + } + +} \ No newline at end of file diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/RefList.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/RefList.java new file mode 100644 index 000000000..be628362a --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/RefList.java @@ -0,0 +1,61 @@ +package dev.diplomattest.somelib; + +import dev.diplomattest.somelib.ntv.*; + + +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; +import java.lang.ref.Cleaner; +import java.util.List; +import static java.lang.foreign.ValueLayout.*; +import java.nio.charset.StandardCharsets; +import java.util.stream.Stream; + +public class RefList { + + MemorySegment internal; + Cleaner.Cleanable cleanable; + + List selfEdges = List.of(); + List aEdges = List.of(); + + + static class RefListCleaner implements Runnable { + + MemorySegment segment; + RefListCleaner(MemorySegment segment) { + this.segment = segment; + } + + public void run() { + somelib_h.RefList_destroy(this.segment); + } + } + + RefList() {} + RefList(MemorySegment handle, List selfEdges, List aEdges) { + this.internal = handle; + this.selfEdges = selfEdges; + this.aEdges = aEdges; + + + } + + public static RefList node(RefListParameter data) { + + var dataNative = data.internal; + var nativeVal = somelib_h.RefList_node(dataNative); + List selfEdges = List.of(); + + + + List bEdges = List.of(data); + var returnVal = new RefList(nativeVal, selfEdges, bEdges); + var cleaner = new RefList.RefListCleaner(nativeVal); + returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); + return returnVal; + } + + +} \ No newline at end of file diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/RefListParameter.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/RefListParameter.java new file mode 100644 index 000000000..536ffa054 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/RefListParameter.java @@ -0,0 +1,44 @@ +package dev.diplomattest.somelib; + +import dev.diplomattest.somelib.ntv.*; + + +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; +import java.lang.ref.Cleaner; +import java.util.List; +import static java.lang.foreign.ValueLayout.*; +import java.nio.charset.StandardCharsets; +import java.util.stream.Stream; + +public class RefListParameter { + + MemorySegment internal; + Cleaner.Cleanable cleanable; + + List selfEdges = List.of(); + + + static class RefListParameterCleaner implements Runnable { + + MemorySegment segment; + RefListParameterCleaner(MemorySegment segment) { + this.segment = segment; + } + + public void run() { + somelib_h.RefListParameter_destroy(this.segment); + } + } + + RefListParameter() {} + RefListParameter(MemorySegment handle, List selfEdges) { + this.internal = handle; + this.selfEdges = selfEdges; + + + } + + +} \ No newline at end of file diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Two.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Two.java new file mode 100644 index 000000000..c47af91c3 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Two.java @@ -0,0 +1,48 @@ +package dev.diplomattest.somelib; + +import dev.diplomattest.somelib.ntv.*; + + +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; +import java.lang.ref.Cleaner; +import java.util.List; +import static java.lang.foreign.ValueLayout.*; +import java.nio.charset.StandardCharsets; +import java.util.stream.Stream; + +public class Two { + + MemorySegment internal; + Cleaner.Cleanable cleanable; + + List selfEdges = List.of(); + List aEdges = List.of(); + List bEdges = List.of(); + + + static class TwoCleaner implements Runnable { + + MemorySegment segment; + TwoCleaner(MemorySegment segment) { + this.segment = segment; + } + + public void run() { + somelib_h.Two_destroy(this.segment); + } + } + + Two() {} + Two(MemorySegment handle, List selfEdges, List aEdges, List bEdges) { + this.internal = handle; + this.selfEdges = selfEdges; + this.aEdges = aEdges; + this.bEdges = bEdges; + + + } + + +} \ No newline at end of file diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Utf16Wrap.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Utf16Wrap.java new file mode 100644 index 000000000..d15a80648 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Utf16Wrap.java @@ -0,0 +1,82 @@ +package dev.diplomattest.somelib; + +import dev.diplomattest.somelib.ntv.*; + + +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; +import java.lang.ref.Cleaner; +import java.util.List; +import static java.lang.foreign.ValueLayout.*; +import java.nio.charset.StandardCharsets; +import java.util.stream.Stream; + +public class Utf16Wrap { + + MemorySegment internal; + Cleaner.Cleanable cleanable; + + List selfEdges = List.of(); + + + static class Utf16WrapCleaner implements Runnable { + + MemorySegment segment; + Utf16WrapCleaner(MemorySegment segment) { + this.segment = segment; + } + + public void run() { + somelib_h.Utf16Wrap_destroy(this.segment); + } + } + + Utf16Wrap() {} + Utf16Wrap(MemorySegment handle, List selfEdges) { + this.internal = handle; + this.selfEdges = selfEdges; + + + } + + public static Utf16Wrap fromUtf16(String input) { + + try (var arena = Arena.ofConfined()) { + var inputMemSeg = arena.allocateFrom(input, StandardCharsets.UTF_16); + var inputLen = inputMemSeg.byteSize(); + var nativeVal = somelib_h.Utf16Wrap_from_utf16(inputMemSeg, inputLen - 1); + List selfEdges = List.of(); + + + + var returnVal = new Utf16Wrap(nativeVal, selfEdges); + var cleaner = new Utf16Wrap.Utf16WrapCleaner(nativeVal); + returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); + return returnVal; + } + } + + + public String getDebugStr() { + + + var writeable = somelib_h.diplomat_buffer_write_create(0); + somelib_h.Utf16Wrap_get_debug_str(internal, writeable); + var buffer = DiplomatWrite.buf(writeable); + var string = buffer.getString(0, StandardCharsets.UTF_8); + somelib_h.diplomat_buffer_write_destroy(writeable); + return string; + } + + public String borrowCont() { + + try (var arena = Arena.ofConfined()) { + + + var nativeVal = somelib_h.Utf16Wrap_borrow_cont(arena, internal); + return SliceUtils.readUtf16(nativeVal); + } + } + +} \ No newline at end of file diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionString_write_result.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/CyclicStructA.java similarity index 76% rename from feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionString_write_result.java rename to feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/CyclicStructA.java index bb05e867e..ad7ef681c 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionString_write_result.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/CyclicStructA.java @@ -14,20 +14,20 @@ /** * {@snippet lang=c : - * struct OptionString_write_result { - * bool is_ok; + * struct CyclicStructA { + * CyclicStructB a; * } * } */ -public class OptionString_write_result { +public class CyclicStructA { - OptionString_write_result() { + CyclicStructA() { // Should not be called directly } private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_BOOL.withName("is_ok") - ).withName("OptionString_write_result"); + CyclicStructB.layout().withName("a") + ).withName("CyclicStructA"); /** * The layout of this struct @@ -36,48 +36,48 @@ public static final GroupLayout layout() { return $LAYOUT; } - private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + private static final GroupLayout a$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("a")); /** * Layout for field: * {@snippet lang=c : - * bool is_ok + * CyclicStructB a * } */ - public static final OfBoolean is_ok$layout() { - return is_ok$LAYOUT; + public static final GroupLayout a$layout() { + return a$LAYOUT; } - private static final long is_ok$OFFSET = 0; + private static final long a$OFFSET = 0; /** * Offset for field: * {@snippet lang=c : - * bool is_ok + * CyclicStructB a * } */ - public static final long is_ok$offset() { - return is_ok$OFFSET; + public static final long a$offset() { + return a$OFFSET; } /** * Getter for field: * {@snippet lang=c : - * bool is_ok + * CyclicStructB a * } */ - public static boolean is_ok(MemorySegment struct) { - return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + public static MemorySegment a(MemorySegment struct) { + return struct.asSlice(a$OFFSET, a$LAYOUT.byteSize()); } /** * Setter for field: * {@snippet lang=c : - * bool is_ok + * CyclicStructB a * } */ - public static void is_ok(MemorySegment struct, boolean fieldValue) { - struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + public static void a(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, a$OFFSET, a$LAYOUT.byteSize()); } /** diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_OSUnalignedU32.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/CyclicStructB.java similarity index 76% rename from feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_OSUnalignedU32.java rename to feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/CyclicStructB.java index e92d4f122..62095d819 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_OSUnalignedU32.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/CyclicStructB.java @@ -14,20 +14,20 @@ /** * {@snippet lang=c : - * struct _OSUnalignedU32 { - * volatile uint32_t __val; + * struct CyclicStructB { + * uint8_t field; * } * } */ -public class _OSUnalignedU32 { +public class CyclicStructB { - _OSUnalignedU32() { + CyclicStructB() { // Should not be called directly } private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.align(somelib_h.C_INT, 1).withName("__val") - ).withName("_OSUnalignedU32"); + somelib_h.C_CHAR.withName("field") + ).withName("CyclicStructB"); /** * The layout of this struct @@ -36,48 +36,48 @@ public static final GroupLayout layout() { return $LAYOUT; } - private static final OfInt __val$LAYOUT = (OfInt)$LAYOUT.select(groupElement("__val")); + private static final OfByte field$LAYOUT = (OfByte)$LAYOUT.select(groupElement("field")); /** * Layout for field: * {@snippet lang=c : - * volatile uint32_t __val + * uint8_t field * } */ - public static final OfInt __val$layout() { - return __val$LAYOUT; + public static final OfByte field$layout() { + return field$LAYOUT; } - private static final long __val$OFFSET = 0; + private static final long field$OFFSET = 0; /** * Offset for field: * {@snippet lang=c : - * volatile uint32_t __val + * uint8_t field * } */ - public static final long __val$offset() { - return __val$OFFSET; + public static final long field$offset() { + return field$OFFSET; } /** * Getter for field: * {@snippet lang=c : - * volatile uint32_t __val + * uint8_t field * } */ - public static int __val(MemorySegment struct) { - return struct.get(__val$LAYOUT, __val$OFFSET); + public static byte field(MemorySegment struct) { + return struct.get(field$LAYOUT, field$OFFSET); } /** * Setter for field: * {@snippet lang=c : - * volatile uint32_t __val + * uint8_t field * } */ - public static void __val(MemorySegment struct, int fieldValue) { - struct.set(__val$LAYOUT, __val$OFFSET, fieldValue); + public static void field(MemorySegment struct, byte fieldValue) { + struct.set(field$LAYOUT, field$OFFSET, fieldValue); } /** diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ImportedStruct.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatBoolViewMut.java similarity index 67% rename from feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ImportedStruct.java rename to feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatBoolViewMut.java index 0ef6656c7..08bf3f4bb 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ImportedStruct.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatBoolViewMut.java @@ -14,23 +14,22 @@ /** * {@snippet lang=c : - * struct ImportedStruct { - * UnimportedEnum foo; - * uint8_t count; + * struct DiplomatBoolViewMut { + * bool *data; + * size_t len; * } * } */ -public class ImportedStruct { +public class DiplomatBoolViewMut { - ImportedStruct() { + DiplomatBoolViewMut() { // Should not be called directly } private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_INT.withName("foo"), - somelib_h.C_CHAR.withName("count"), - MemoryLayout.paddingLayout(3) - ).withName("ImportedStruct"); + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatBoolViewMut"); /** * The layout of this struct @@ -39,92 +38,92 @@ public static final GroupLayout layout() { return $LAYOUT; } - private static final OfInt foo$LAYOUT = (OfInt)$LAYOUT.select(groupElement("foo")); + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); /** * Layout for field: * {@snippet lang=c : - * UnimportedEnum foo + * bool *data * } */ - public static final OfInt foo$layout() { - return foo$LAYOUT; + public static final AddressLayout data$layout() { + return data$LAYOUT; } - private static final long foo$OFFSET = 0; + private static final long data$OFFSET = 0; /** * Offset for field: * {@snippet lang=c : - * UnimportedEnum foo + * bool *data * } */ - public static final long foo$offset() { - return foo$OFFSET; + public static final long data$offset() { + return data$OFFSET; } /** * Getter for field: * {@snippet lang=c : - * UnimportedEnum foo + * bool *data * } */ - public static int foo(MemorySegment struct) { - return struct.get(foo$LAYOUT, foo$OFFSET); + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); } /** * Setter for field: * {@snippet lang=c : - * UnimportedEnum foo + * bool *data * } */ - public static void foo(MemorySegment struct, int fieldValue) { - struct.set(foo$LAYOUT, foo$OFFSET, fieldValue); + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); } - private static final OfByte count$LAYOUT = (OfByte)$LAYOUT.select(groupElement("count")); + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); /** * Layout for field: * {@snippet lang=c : - * uint8_t count + * size_t len * } */ - public static final OfByte count$layout() { - return count$LAYOUT; + public static final OfLong len$layout() { + return len$LAYOUT; } - private static final long count$OFFSET = 4; + private static final long len$OFFSET = 8; /** * Offset for field: * {@snippet lang=c : - * uint8_t count + * size_t len * } */ - public static final long count$offset() { - return count$OFFSET; + public static final long len$offset() { + return len$OFFSET; } /** * Getter for field: * {@snippet lang=c : - * uint8_t count + * size_t len * } */ - public static byte count(MemorySegment struct) { - return struct.get(count$LAYOUT, count$OFFSET); + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); } /** * Setter for field: * {@snippet lang=c : - * uint8_t count + * size_t len * } */ - public static void count(MemorySegment struct, byte fieldValue) { - struct.set(count$LAYOUT, count$OFFSET, fieldValue); + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); } /** diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/namespace_MyIterator_next_result.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatCharViewMut.java similarity index 65% rename from feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/namespace_MyIterator_next_result.java rename to feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatCharViewMut.java index 8ebc5584c..a147ed662 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/namespace_MyIterator_next_result.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatCharViewMut.java @@ -14,26 +14,22 @@ /** * {@snippet lang=c : - * struct namespace_MyIterator_next_result { - * union { - * uint8_t ok; - * }; - * bool is_ok; + * struct DiplomatCharViewMut { + * char32_t *data; + * size_t len; * } * } */ -public class namespace_MyIterator_next_result { +public class DiplomatCharViewMut { - namespace_MyIterator_next_result() { + DiplomatCharViewMut() { // Should not be called directly } private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - MemoryLayout.unionLayout( - somelib_h.C_CHAR.withName("ok") - ).withName("$anon$18:42"), - somelib_h.C_BOOL.withName("is_ok") - ).withName("namespace_MyIterator_next_result"); + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatCharViewMut"); /** * The layout of this struct @@ -42,92 +38,92 @@ public static final GroupLayout layout() { return $LAYOUT; } - private static final OfByte ok$LAYOUT = (OfByte)$LAYOUT.select(groupElement("$anon$18:42"), groupElement("ok")); + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); /** * Layout for field: * {@snippet lang=c : - * uint8_t ok + * char32_t *data * } */ - public static final OfByte ok$layout() { - return ok$LAYOUT; + public static final AddressLayout data$layout() { + return data$LAYOUT; } - private static final long ok$OFFSET = 0; + private static final long data$OFFSET = 0; /** * Offset for field: * {@snippet lang=c : - * uint8_t ok + * char32_t *data * } */ - public static final long ok$offset() { - return ok$OFFSET; + public static final long data$offset() { + return data$OFFSET; } /** * Getter for field: * {@snippet lang=c : - * uint8_t ok + * char32_t *data * } */ - public static byte ok(MemorySegment struct) { - return struct.get(ok$LAYOUT, ok$OFFSET); + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); } /** * Setter for field: * {@snippet lang=c : - * uint8_t ok + * char32_t *data * } */ - public static void ok(MemorySegment struct, byte fieldValue) { - struct.set(ok$LAYOUT, ok$OFFSET, fieldValue); + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); } - private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); /** * Layout for field: * {@snippet lang=c : - * bool is_ok + * size_t len * } */ - public static final OfBoolean is_ok$layout() { - return is_ok$LAYOUT; + public static final OfLong len$layout() { + return len$LAYOUT; } - private static final long is_ok$OFFSET = 1; + private static final long len$OFFSET = 8; /** * Offset for field: * {@snippet lang=c : - * bool is_ok + * size_t len * } */ - public static final long is_ok$offset() { - return is_ok$OFFSET; + public static final long len$offset() { + return len$OFFSET; } /** * Getter for field: * {@snippet lang=c : - * bool is_ok + * size_t len * } */ - public static boolean is_ok(MemorySegment struct) { - return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); } /** * Setter for field: * {@snippet lang=c : - * bool is_ok + * size_t len * } */ - public static void is_ok(MemorySegment struct, boolean fieldValue) { - struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); } /** diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/Float64Vec_get_result.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF32ViewMut.java similarity index 65% rename from feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/Float64Vec_get_result.java rename to feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF32ViewMut.java index 25f871d78..2c1ff7f72 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/Float64Vec_get_result.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF32ViewMut.java @@ -14,27 +14,22 @@ /** * {@snippet lang=c : - * struct Float64Vec_get_result { - * union { - * double ok; - * }; - * bool is_ok; + * struct DiplomatF32ViewMut { + * float *data; + * size_t len; * } * } */ -public class Float64Vec_get_result { +public class DiplomatF32ViewMut { - Float64Vec_get_result() { + DiplomatF32ViewMut() { // Should not be called directly } private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - MemoryLayout.unionLayout( - somelib_h.C_DOUBLE.withName("ok") - ).withName("$anon$44:31"), - somelib_h.C_BOOL.withName("is_ok"), - MemoryLayout.paddingLayout(7) - ).withName("Float64Vec_get_result"); + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatF32ViewMut"); /** * The layout of this struct @@ -43,92 +38,92 @@ public static final GroupLayout layout() { return $LAYOUT; } - private static final OfDouble ok$LAYOUT = (OfDouble)$LAYOUT.select(groupElement("$anon$44:31"), groupElement("ok")); + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); /** * Layout for field: * {@snippet lang=c : - * double ok + * float *data * } */ - public static final OfDouble ok$layout() { - return ok$LAYOUT; + public static final AddressLayout data$layout() { + return data$LAYOUT; } - private static final long ok$OFFSET = 0; + private static final long data$OFFSET = 0; /** * Offset for field: * {@snippet lang=c : - * double ok + * float *data * } */ - public static final long ok$offset() { - return ok$OFFSET; + public static final long data$offset() { + return data$OFFSET; } /** * Getter for field: * {@snippet lang=c : - * double ok + * float *data * } */ - public static double ok(MemorySegment struct) { - return struct.get(ok$LAYOUT, ok$OFFSET); + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); } /** * Setter for field: * {@snippet lang=c : - * double ok + * float *data * } */ - public static void ok(MemorySegment struct, double fieldValue) { - struct.set(ok$LAYOUT, ok$OFFSET, fieldValue); + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); } - private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); /** * Layout for field: * {@snippet lang=c : - * bool is_ok + * size_t len * } */ - public static final OfBoolean is_ok$layout() { - return is_ok$LAYOUT; + public static final OfLong len$layout() { + return len$LAYOUT; } - private static final long is_ok$OFFSET = 8; + private static final long len$OFFSET = 8; /** * Offset for field: * {@snippet lang=c : - * bool is_ok + * size_t len * } */ - public static final long is_ok$offset() { - return is_ok$OFFSET; + public static final long len$offset() { + return len$OFFSET; } /** * Getter for field: * {@snippet lang=c : - * bool is_ok + * size_t len * } */ - public static boolean is_ok(MemorySegment struct) { - return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); } /** * Setter for field: * {@snippet lang=c : - * bool is_ok + * size_t len * } */ - public static void is_ok(MemorySegment struct, boolean fieldValue) { - struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); } /** diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_int_result.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF64ViewMut.java similarity index 65% rename from feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_int_result.java rename to feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF64ViewMut.java index 5038cbb46..b76f35eb5 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_int_result.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF64ViewMut.java @@ -14,27 +14,22 @@ /** * {@snippet lang=c : - * struct ResultOpaque_new_int_result { - * union { - * int32_t ok; - * }; - * bool is_ok; + * struct DiplomatF64ViewMut { + * double *data; + * size_t len; * } * } */ -public class ResultOpaque_new_int_result { +public class DiplomatF64ViewMut { - ResultOpaque_new_int_result() { + DiplomatF64ViewMut() { // Should not be called directly } private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - MemoryLayout.unionLayout( - somelib_h.C_INT.withName("ok") - ).withName("$anon$38:37"), - somelib_h.C_BOOL.withName("is_ok"), - MemoryLayout.paddingLayout(3) - ).withName("ResultOpaque_new_int_result"); + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatF64ViewMut"); /** * The layout of this struct @@ -43,92 +38,92 @@ public static final GroupLayout layout() { return $LAYOUT; } - private static final OfInt ok$LAYOUT = (OfInt)$LAYOUT.select(groupElement("$anon$38:37"), groupElement("ok")); + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); /** * Layout for field: * {@snippet lang=c : - * int32_t ok + * double *data * } */ - public static final OfInt ok$layout() { - return ok$LAYOUT; + public static final AddressLayout data$layout() { + return data$LAYOUT; } - private static final long ok$OFFSET = 0; + private static final long data$OFFSET = 0; /** * Offset for field: * {@snippet lang=c : - * int32_t ok + * double *data * } */ - public static final long ok$offset() { - return ok$OFFSET; + public static final long data$offset() { + return data$OFFSET; } /** * Getter for field: * {@snippet lang=c : - * int32_t ok + * double *data * } */ - public static int ok(MemorySegment struct) { - return struct.get(ok$LAYOUT, ok$OFFSET); + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); } /** * Setter for field: * {@snippet lang=c : - * int32_t ok + * double *data * } */ - public static void ok(MemorySegment struct, int fieldValue) { - struct.set(ok$LAYOUT, ok$OFFSET, fieldValue); + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); } - private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); /** * Layout for field: * {@snippet lang=c : - * bool is_ok + * size_t len * } */ - public static final OfBoolean is_ok$layout() { - return is_ok$LAYOUT; + public static final OfLong len$layout() { + return len$LAYOUT; } - private static final long is_ok$OFFSET = 4; + private static final long len$OFFSET = 8; /** * Offset for field: * {@snippet lang=c : - * bool is_ok + * size_t len * } */ - public static final long is_ok$offset() { - return is_ok$OFFSET; + public static final long len$offset() { + return len$OFFSET; } /** * Getter for field: * {@snippet lang=c : - * bool is_ok + * size_t len * } */ - public static boolean is_ok(MemorySegment struct) { - return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); } /** * Setter for field: * {@snippet lang=c : - * bool is_ok + * size_t len * } */ - public static void is_ok(MemorySegment struct, boolean fieldValue) { - struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); } /** diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI16ViewMut.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI16ViewMut.java new file mode 100644 index 000000000..54fefcc6c --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI16ViewMut.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatI16ViewMut { + * int16_t *data; + * size_t len; + * } + * } + */ +public class DiplomatI16ViewMut { + + DiplomatI16ViewMut() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatI16ViewMut"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * int16_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * int16_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int16_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int16_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI32ViewMut.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI32ViewMut.java new file mode 100644 index 000000000..ee22a4cdb --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI32ViewMut.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatI32ViewMut { + * int32_t *data; + * size_t len; + * } + * } + */ +public class DiplomatI32ViewMut { + + DiplomatI32ViewMut() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatI32ViewMut"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * int32_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * int32_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int32_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int32_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI64ViewMut.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI64ViewMut.java new file mode 100644 index 000000000..44ffdabcd --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI64ViewMut.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatI64ViewMut { + * int64_t *data; + * size_t len; + * } + * } + */ +public class DiplomatI64ViewMut { + + DiplomatI64ViewMut() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatI64ViewMut"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * int64_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * int64_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int64_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int64_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI8ViewMut.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI8ViewMut.java new file mode 100644 index 000000000..3f9302170 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI8ViewMut.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatI8ViewMut { + * int8_t *data; + * size_t len; + * } + * } + */ +public class DiplomatI8ViewMut { + + DiplomatI8ViewMut() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatI8ViewMut"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * int8_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * int8_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int8_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int8_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatIsizeViewMut.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatIsizeViewMut.java new file mode 100644 index 000000000..baa2ddd00 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatIsizeViewMut.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatIsizeViewMut { + * intptr_t *data; + * size_t len; + * } + * } + */ +public class DiplomatIsizeViewMut { + + DiplomatIsizeViewMut() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatIsizeViewMut"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * intptr_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * intptr_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * intptr_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * intptr_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatString16ViewMut.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatString16ViewMut.java new file mode 100644 index 000000000..c2da631d6 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatString16ViewMut.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatString16ViewMut { + * char16_t *data; + * size_t len; + * } + * } + */ +public class DiplomatString16ViewMut { + + DiplomatString16ViewMut() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatString16ViewMut"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * char16_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * char16_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * char16_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * char16_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringViewMut.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringViewMut.java new file mode 100644 index 000000000..676f12436 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringViewMut.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatStringViewMut { + * char *data; + * size_t len; + * } + * } + */ +public class DiplomatStringViewMut { + + DiplomatStringViewMut() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatStringViewMut"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * char *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * char *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * char *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * char *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStrings16ViewMut.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStrings16ViewMut.java new file mode 100644 index 000000000..bf9559f10 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStrings16ViewMut.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatStrings16ViewMut { + * DiplomatString16View *data; + * size_t len; + * } + * } + */ +public class DiplomatStrings16ViewMut { + + DiplomatStrings16ViewMut() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatStrings16ViewMut"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * DiplomatString16View *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * DiplomatString16View *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * DiplomatString16View *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * DiplomatString16View *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringsViewMut.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringsViewMut.java new file mode 100644 index 000000000..df608564e --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringsViewMut.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatStringsViewMut { + * DiplomatStringView *data; + * size_t len; + * } + * } + */ +public class DiplomatStringsViewMut { + + DiplomatStringsViewMut() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatStringsViewMut"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * DiplomatStringView *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * DiplomatStringView *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * DiplomatStringView *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * DiplomatStringView *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU16ViewMut.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU16ViewMut.java new file mode 100644 index 000000000..f4c40512d --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU16ViewMut.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatU16ViewMut { + * uint16_t *data; + * size_t len; + * } + * } + */ +public class DiplomatU16ViewMut { + + DiplomatU16ViewMut() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatU16ViewMut"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * uint16_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * uint16_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * uint16_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * uint16_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU32ViewMut.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU32ViewMut.java new file mode 100644 index 000000000..e516c6ba4 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU32ViewMut.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatU32ViewMut { + * uint32_t *data; + * size_t len; + * } + * } + */ +public class DiplomatU32ViewMut { + + DiplomatU32ViewMut() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatU32ViewMut"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * uint32_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * uint32_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * uint32_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * uint32_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU64ViewMut.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU64ViewMut.java new file mode 100644 index 000000000..7e0d0b05b --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU64ViewMut.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatU64ViewMut { + * uint64_t *data; + * size_t len; + * } + * } + */ +public class DiplomatU64ViewMut { + + DiplomatU64ViewMut() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatU64ViewMut"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * uint64_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * uint64_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * uint64_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * uint64_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU8ViewMut.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU8ViewMut.java new file mode 100644 index 000000000..f04cc0c40 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU8ViewMut.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatU8ViewMut { + * uint8_t *data; + * size_t len; + * } + * } + */ +public class DiplomatU8ViewMut { + + DiplomatU8ViewMut() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatU8ViewMut"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * uint8_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * uint8_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * uint8_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * uint8_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatUsizeViewMut.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatUsizeViewMut.java new file mode 100644 index 000000000..99c1929e4 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/DiplomatUsizeViewMut.java @@ -0,0 +1,173 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct DiplomatUsizeViewMut { + * size_t *data; + * size_t len; + * } + * } + */ +public class DiplomatUsizeViewMut { + + DiplomatUsizeViewMut() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_POINTER.withName("data"), + somelib_h.C_LONG.withName("len") + ).withName("DiplomatUsizeViewMut"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t *data + * } + */ + public static final AddressLayout data$layout() { + return data$LAYOUT; + } + + private static final long data$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t *data + * } + */ + public static final long data$offset() { + return data$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t *data + * } + */ + public static MemorySegment data(MemorySegment struct) { + return struct.get(data$LAYOUT, data$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t *data + * } + */ + public static void data(MemorySegment struct, MemorySegment fieldValue) { + struct.set(data$LAYOUT, data$OFFSET, fieldValue); + } + + private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final OfLong len$layout() { + return len$LAYOUT; + } + + private static final long len$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static final long len$offset() { + return len$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static long len(MemorySegment struct) { + return struct.get(len$LAYOUT, len$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t len + * } + */ + public static void len(MemorySegment struct, long fieldValue) { + struct.set(len$LAYOUT, len$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/MyStruct_returns_zst_result_result.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/MyStruct_returns_zst_result_result.java deleted file mode 100644 index e20b244cf..000000000 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/MyStruct_returns_zst_result_result.java +++ /dev/null @@ -1,127 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct MyStruct_returns_zst_result_result { - * bool is_ok; - * } - * } - */ -public class MyStruct_returns_zst_result_result { - - MyStruct_returns_zst_result_result() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_BOOL.withName("is_ok") - ).withName("MyStruct_returns_zst_result_result"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); - - /** - * Layout for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static final OfBoolean is_ok$layout() { - return is_ok$LAYOUT; - } - - private static final long is_ok$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static final long is_ok$offset() { - return is_ok$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static boolean is_ok(MemorySegment struct) { - return struct.get(is_ok$LAYOUT, is_ok$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static void is_ok(MemorySegment struct, boolean fieldValue) { - struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionOpaque_option_i32_result.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionOpaque_option_i32_result.java deleted file mode 100644 index f2ba41a30..000000000 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionOpaque_option_i32_result.java +++ /dev/null @@ -1,178 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct OptionOpaque_option_i32_result { - * union { - * int32_t ok; - * }; - * bool is_ok; - * } - * } - */ -public class OptionOpaque_option_i32_result { - - OptionOpaque_option_i32_result() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - MemoryLayout.unionLayout( - somelib_h.C_INT.withName("ok") - ).withName("$anon$32:40"), - somelib_h.C_BOOL.withName("is_ok"), - MemoryLayout.paddingLayout(3) - ).withName("OptionOpaque_option_i32_result"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfInt ok$LAYOUT = (OfInt)$LAYOUT.select(groupElement("$anon$32:40"), groupElement("ok")); - - /** - * Layout for field: - * {@snippet lang=c : - * int32_t ok - * } - */ - public static final OfInt ok$layout() { - return ok$LAYOUT; - } - - private static final long ok$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * int32_t ok - * } - */ - public static final long ok$offset() { - return ok$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int32_t ok - * } - */ - public static int ok(MemorySegment struct) { - return struct.get(ok$LAYOUT, ok$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int32_t ok - * } - */ - public static void ok(MemorySegment struct, int fieldValue) { - struct.set(ok$LAYOUT, ok$OFFSET, fieldValue); - } - - private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); - - /** - * Layout for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static final OfBoolean is_ok$layout() { - return is_ok$LAYOUT; - } - - private static final long is_ok$OFFSET = 4; - - /** - * Offset for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static final long is_ok$offset() { - return is_ok$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static boolean is_ok(MemorySegment struct) { - return struct.get(is_ok$LAYOUT, is_ok$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static void is_ok(MemorySegment struct, boolean fieldValue) { - struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionOpaque_option_isize_result.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionOpaque_option_isize_result.java deleted file mode 100644 index 5b8aa735e..000000000 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionOpaque_option_isize_result.java +++ /dev/null @@ -1,178 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct OptionOpaque_option_isize_result { - * union { - * intptr_t ok; - * }; - * bool is_ok; - * } - * } - */ -public class OptionOpaque_option_isize_result { - - OptionOpaque_option_isize_result() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - MemoryLayout.unionLayout( - somelib_h.C_LONG.withName("ok") - ).withName("$anon$26:42"), - somelib_h.C_BOOL.withName("is_ok"), - MemoryLayout.paddingLayout(7) - ).withName("OptionOpaque_option_isize_result"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong ok$LAYOUT = (OfLong)$LAYOUT.select(groupElement("$anon$26:42"), groupElement("ok")); - - /** - * Layout for field: - * {@snippet lang=c : - * intptr_t ok - * } - */ - public static final OfLong ok$layout() { - return ok$LAYOUT; - } - - private static final long ok$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * intptr_t ok - * } - */ - public static final long ok$offset() { - return ok$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * intptr_t ok - * } - */ - public static long ok(MemorySegment struct) { - return struct.get(ok$LAYOUT, ok$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * intptr_t ok - * } - */ - public static void ok(MemorySegment struct, long fieldValue) { - struct.set(ok$LAYOUT, ok$OFFSET, fieldValue); - } - - private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); - - /** - * Layout for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static final OfBoolean is_ok$layout() { - return is_ok$LAYOUT; - } - - private static final long is_ok$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static final long is_ok$offset() { - return is_ok$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static boolean is_ok(MemorySegment struct) { - return struct.get(is_ok$LAYOUT, is_ok$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static void is_ok(MemorySegment struct, boolean fieldValue) { - struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionOpaque_option_u32_result.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionOpaque_option_u32_result.java deleted file mode 100644 index 96d0a0ad5..000000000 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionOpaque_option_u32_result.java +++ /dev/null @@ -1,178 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct OptionOpaque_option_u32_result { - * union { - * uint32_t ok; - * }; - * bool is_ok; - * } - * } - */ -public class OptionOpaque_option_u32_result { - - OptionOpaque_option_u32_result() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - MemoryLayout.unionLayout( - somelib_h.C_INT.withName("ok") - ).withName("$anon$35:40"), - somelib_h.C_BOOL.withName("is_ok"), - MemoryLayout.paddingLayout(3) - ).withName("OptionOpaque_option_u32_result"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfInt ok$LAYOUT = (OfInt)$LAYOUT.select(groupElement("$anon$35:40"), groupElement("ok")); - - /** - * Layout for field: - * {@snippet lang=c : - * uint32_t ok - * } - */ - public static final OfInt ok$layout() { - return ok$LAYOUT; - } - - private static final long ok$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * uint32_t ok - * } - */ - public static final long ok$offset() { - return ok$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * uint32_t ok - * } - */ - public static int ok(MemorySegment struct) { - return struct.get(ok$LAYOUT, ok$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * uint32_t ok - * } - */ - public static void ok(MemorySegment struct, int fieldValue) { - struct.set(ok$LAYOUT, ok$OFFSET, fieldValue); - } - - private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); - - /** - * Layout for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static final OfBoolean is_ok$layout() { - return is_ok$LAYOUT; - } - - private static final long is_ok$OFFSET = 4; - - /** - * Offset for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static final long is_ok$offset() { - return is_ok$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static boolean is_ok(MemorySegment struct) { - return struct.get(is_ok$LAYOUT, is_ok$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static void is_ok(MemorySegment struct, boolean fieldValue) { - struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionOpaque_option_usize_result.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionOpaque_option_usize_result.java deleted file mode 100644 index e01eabc77..000000000 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionOpaque_option_usize_result.java +++ /dev/null @@ -1,178 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct OptionOpaque_option_usize_result { - * union { - * size_t ok; - * }; - * bool is_ok; - * } - * } - */ -public class OptionOpaque_option_usize_result { - - OptionOpaque_option_usize_result() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - MemoryLayout.unionLayout( - somelib_h.C_LONG.withName("ok") - ).withName("$anon$29:42"), - somelib_h.C_BOOL.withName("is_ok"), - MemoryLayout.paddingLayout(7) - ).withName("OptionOpaque_option_usize_result"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong ok$LAYOUT = (OfLong)$LAYOUT.select(groupElement("$anon$29:42"), groupElement("ok")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t ok - * } - */ - public static final OfLong ok$layout() { - return ok$LAYOUT; - } - - private static final long ok$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t ok - * } - */ - public static final long ok$offset() { - return ok$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t ok - * } - */ - public static long ok(MemorySegment struct) { - return struct.get(ok$LAYOUT, ok$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t ok - * } - */ - public static void ok(MemorySegment struct, long fieldValue) { - struct.set(ok$LAYOUT, ok$OFFSET, fieldValue); - } - - private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); - - /** - * Layout for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static final OfBoolean is_ok$layout() { - return is_ok$LAYOUT; - } - - private static final long is_ok$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static final long is_ok$offset() { - return is_ok$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static boolean is_ok(MemorySegment struct) { - return struct.get(is_ok$LAYOUT, is_ok$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static void is_ok(MemorySegment struct, boolean fieldValue) { - struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionOpaque_returns_result.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionOpaque_returns_result.java deleted file mode 100644 index 642bbf921..000000000 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionOpaque_returns_result.java +++ /dev/null @@ -1,178 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct OptionOpaque_returns_result { - * union { - * OptionStruct ok; - * }; - * bool is_ok; - * } - * } - */ -public class OptionOpaque_returns_result { - - OptionOpaque_returns_result() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - MemoryLayout.unionLayout( - OptionStruct.layout().withName("ok") - ).withName("$anon$23:37"), - somelib_h.C_BOOL.withName("is_ok"), - MemoryLayout.paddingLayout(7) - ).withName("OptionOpaque_returns_result"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final GroupLayout ok$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$23:37"), groupElement("ok")); - - /** - * Layout for field: - * {@snippet lang=c : - * OptionStruct ok - * } - */ - public static final GroupLayout ok$layout() { - return ok$LAYOUT; - } - - private static final long ok$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * OptionStruct ok - * } - */ - public static final long ok$offset() { - return ok$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * OptionStruct ok - * } - */ - public static MemorySegment ok(MemorySegment struct) { - return struct.asSlice(ok$OFFSET, ok$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * OptionStruct ok - * } - */ - public static void ok(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, ok$OFFSET, ok$LAYOUT.byteSize()); - } - - private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); - - /** - * Layout for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static final OfBoolean is_ok$layout() { - return is_ok$LAYOUT; - } - - private static final long is_ok$OFFSET = 32; - - /** - * Offset for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static final long is_ok$offset() { - return is_ok$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static boolean is_ok(MemorySegment struct) { - return struct.get(is_ok$LAYOUT, is_ok$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static void is_ok(MemorySegment struct, boolean fieldValue) { - struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionString_borrow_result.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionString_borrow_result.java deleted file mode 100644 index 3798179a0..000000000 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionString_borrow_result.java +++ /dev/null @@ -1,178 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct OptionString_borrow_result { - * union { - * DiplomatStringView ok; - * }; - * bool is_ok; - * } - * } - */ -public class OptionString_borrow_result { - - OptionString_borrow_result() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - MemoryLayout.unionLayout( - DiplomatStringView.layout().withName("ok") - ).withName("$anon$23:36"), - somelib_h.C_BOOL.withName("is_ok"), - MemoryLayout.paddingLayout(7) - ).withName("OptionString_borrow_result"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final GroupLayout ok$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$23:36"), groupElement("ok")); - - /** - * Layout for field: - * {@snippet lang=c : - * DiplomatStringView ok - * } - */ - public static final GroupLayout ok$layout() { - return ok$LAYOUT; - } - - private static final long ok$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * DiplomatStringView ok - * } - */ - public static final long ok$offset() { - return ok$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * DiplomatStringView ok - * } - */ - public static MemorySegment ok(MemorySegment struct) { - return struct.asSlice(ok$OFFSET, ok$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * DiplomatStringView ok - * } - */ - public static void ok(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, ok$OFFSET, ok$LAYOUT.byteSize()); - } - - private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); - - /** - * Layout for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static final OfBoolean is_ok$layout() { - return is_ok$LAYOUT; - } - - private static final long is_ok$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static final long is_ok$offset() { - return is_ok$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static boolean is_ok(MemorySegment struct) { - return struct.get(is_ok$LAYOUT, is_ok$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static void is_ok(MemorySegment struct, boolean fieldValue) { - struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionStruct.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionStruct.java deleted file mode 100644 index 9e93d8e5a..000000000 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionStruct.java +++ /dev/null @@ -1,266 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct OptionStruct { - * OptionOpaque *a; - * OptionOpaqueChar *b; - * uint32_t c; - * OptionOpaque *d; - * } - * } - */ -public class OptionStruct { - - OptionStruct() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_POINTER.withName("a"), - somelib_h.C_POINTER.withName("b"), - somelib_h.C_INT.withName("c"), - MemoryLayout.paddingLayout(4), - somelib_h.C_POINTER.withName("d") - ).withName("OptionStruct"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout a$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("a")); - - /** - * Layout for field: - * {@snippet lang=c : - * OptionOpaque *a - * } - */ - public static final AddressLayout a$layout() { - return a$LAYOUT; - } - - private static final long a$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * OptionOpaque *a - * } - */ - public static final long a$offset() { - return a$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * OptionOpaque *a - * } - */ - public static MemorySegment a(MemorySegment struct) { - return struct.get(a$LAYOUT, a$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * OptionOpaque *a - * } - */ - public static void a(MemorySegment struct, MemorySegment fieldValue) { - struct.set(a$LAYOUT, a$OFFSET, fieldValue); - } - - private static final AddressLayout b$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("b")); - - /** - * Layout for field: - * {@snippet lang=c : - * OptionOpaqueChar *b - * } - */ - public static final AddressLayout b$layout() { - return b$LAYOUT; - } - - private static final long b$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * OptionOpaqueChar *b - * } - */ - public static final long b$offset() { - return b$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * OptionOpaqueChar *b - * } - */ - public static MemorySegment b(MemorySegment struct) { - return struct.get(b$LAYOUT, b$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * OptionOpaqueChar *b - * } - */ - public static void b(MemorySegment struct, MemorySegment fieldValue) { - struct.set(b$LAYOUT, b$OFFSET, fieldValue); - } - - private static final OfInt c$LAYOUT = (OfInt)$LAYOUT.select(groupElement("c")); - - /** - * Layout for field: - * {@snippet lang=c : - * uint32_t c - * } - */ - public static final OfInt c$layout() { - return c$LAYOUT; - } - - private static final long c$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * uint32_t c - * } - */ - public static final long c$offset() { - return c$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * uint32_t c - * } - */ - public static int c(MemorySegment struct) { - return struct.get(c$LAYOUT, c$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * uint32_t c - * } - */ - public static void c(MemorySegment struct, int fieldValue) { - struct.set(c$LAYOUT, c$OFFSET, fieldValue); - } - - private static final AddressLayout d$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("d")); - - /** - * Layout for field: - * {@snippet lang=c : - * OptionOpaque *d - * } - */ - public static final AddressLayout d$layout() { - return d$LAYOUT; - } - - private static final long d$OFFSET = 24; - - /** - * Offset for field: - * {@snippet lang=c : - * OptionOpaque *d - * } - */ - public static final long d$offset() { - return d$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * OptionOpaque *d - * } - */ - public static MemorySegment d(MemorySegment struct) { - return struct.get(d$LAYOUT, d$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * OptionOpaque *d - * } - */ - public static void d(MemorySegment struct, MemorySegment fieldValue) { - struct.set(d$LAYOUT, d$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_failing_bar_result.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_failing_bar_result.java deleted file mode 100644 index 0b02cac84..000000000 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_failing_bar_result.java +++ /dev/null @@ -1,224 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct ResultOpaque_new_failing_bar_result { - * union { - * ResultOpaque *ok; - * ErrorEnum err; - * }; - * bool is_ok; - * } - * } - */ -public class ResultOpaque_new_failing_bar_result { - - ResultOpaque_new_failing_bar_result() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - MemoryLayout.unionLayout( - somelib_h.C_POINTER.withName("ok"), - somelib_h.C_INT.withName("err") - ).withName("$anon$26:45"), - somelib_h.C_BOOL.withName("is_ok"), - MemoryLayout.paddingLayout(7) - ).withName("ResultOpaque_new_failing_bar_result"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout ok$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("$anon$26:45"), groupElement("ok")); - - /** - * Layout for field: - * {@snippet lang=c : - * ResultOpaque *ok - * } - */ - public static final AddressLayout ok$layout() { - return ok$LAYOUT; - } - - private static final long ok$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * ResultOpaque *ok - * } - */ - public static final long ok$offset() { - return ok$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * ResultOpaque *ok - * } - */ - public static MemorySegment ok(MemorySegment struct) { - return struct.get(ok$LAYOUT, ok$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * ResultOpaque *ok - * } - */ - public static void ok(MemorySegment struct, MemorySegment fieldValue) { - struct.set(ok$LAYOUT, ok$OFFSET, fieldValue); - } - - private static final OfInt err$LAYOUT = (OfInt)$LAYOUT.select(groupElement("$anon$26:45"), groupElement("err")); - - /** - * Layout for field: - * {@snippet lang=c : - * ErrorEnum err - * } - */ - public static final OfInt err$layout() { - return err$LAYOUT; - } - - private static final long err$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * ErrorEnum err - * } - */ - public static final long err$offset() { - return err$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * ErrorEnum err - * } - */ - public static int err(MemorySegment struct) { - return struct.get(err$LAYOUT, err$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * ErrorEnum err - * } - */ - public static void err(MemorySegment struct, int fieldValue) { - struct.set(err$LAYOUT, err$OFFSET, fieldValue); - } - - private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); - - /** - * Layout for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static final OfBoolean is_ok$layout() { - return is_ok$LAYOUT; - } - - private static final long is_ok$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static final long is_ok$offset() { - return is_ok$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static boolean is_ok(MemorySegment struct) { - return struct.get(is_ok$LAYOUT, is_ok$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static void is_ok(MemorySegment struct, boolean fieldValue) { - struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_failing_foo_result.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_failing_foo_result.java deleted file mode 100644 index 3c0137f18..000000000 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_failing_foo_result.java +++ /dev/null @@ -1,224 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct ResultOpaque_new_failing_foo_result { - * union { - * ResultOpaque *ok; - * ErrorEnum err; - * }; - * bool is_ok; - * } - * } - */ -public class ResultOpaque_new_failing_foo_result { - - ResultOpaque_new_failing_foo_result() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - MemoryLayout.unionLayout( - somelib_h.C_POINTER.withName("ok"), - somelib_h.C_INT.withName("err") - ).withName("$anon$23:45"), - somelib_h.C_BOOL.withName("is_ok"), - MemoryLayout.paddingLayout(7) - ).withName("ResultOpaque_new_failing_foo_result"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout ok$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("$anon$23:45"), groupElement("ok")); - - /** - * Layout for field: - * {@snippet lang=c : - * ResultOpaque *ok - * } - */ - public static final AddressLayout ok$layout() { - return ok$LAYOUT; - } - - private static final long ok$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * ResultOpaque *ok - * } - */ - public static final long ok$offset() { - return ok$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * ResultOpaque *ok - * } - */ - public static MemorySegment ok(MemorySegment struct) { - return struct.get(ok$LAYOUT, ok$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * ResultOpaque *ok - * } - */ - public static void ok(MemorySegment struct, MemorySegment fieldValue) { - struct.set(ok$LAYOUT, ok$OFFSET, fieldValue); - } - - private static final OfInt err$LAYOUT = (OfInt)$LAYOUT.select(groupElement("$anon$23:45"), groupElement("err")); - - /** - * Layout for field: - * {@snippet lang=c : - * ErrorEnum err - * } - */ - public static final OfInt err$layout() { - return err$LAYOUT; - } - - private static final long err$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * ErrorEnum err - * } - */ - public static final long err$offset() { - return err$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * ErrorEnum err - * } - */ - public static int err(MemorySegment struct) { - return struct.get(err$LAYOUT, err$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * ErrorEnum err - * } - */ - public static void err(MemorySegment struct, int fieldValue) { - struct.set(err$LAYOUT, err$OFFSET, fieldValue); - } - - private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); - - /** - * Layout for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static final OfBoolean is_ok$layout() { - return is_ok$LAYOUT; - } - - private static final long is_ok$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static final long is_ok$offset() { - return is_ok$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static boolean is_ok(MemorySegment struct) { - return struct.get(is_ok$LAYOUT, is_ok$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static void is_ok(MemorySegment struct, boolean fieldValue) { - struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_failing_struct_result.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_failing_struct_result.java deleted file mode 100644 index b6bda0217..000000000 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_failing_struct_result.java +++ /dev/null @@ -1,224 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct ResultOpaque_new_failing_struct_result { - * union { - * ResultOpaque *ok; - * ErrorStruct err; - * }; - * bool is_ok; - * } - * } - */ -public class ResultOpaque_new_failing_struct_result { - - ResultOpaque_new_failing_struct_result() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - MemoryLayout.unionLayout( - somelib_h.C_POINTER.withName("ok"), - ErrorStruct.layout().withName("err") - ).withName("$anon$32:48"), - somelib_h.C_BOOL.withName("is_ok"), - MemoryLayout.paddingLayout(7) - ).withName("ResultOpaque_new_failing_struct_result"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout ok$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("$anon$32:48"), groupElement("ok")); - - /** - * Layout for field: - * {@snippet lang=c : - * ResultOpaque *ok - * } - */ - public static final AddressLayout ok$layout() { - return ok$LAYOUT; - } - - private static final long ok$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * ResultOpaque *ok - * } - */ - public static final long ok$offset() { - return ok$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * ResultOpaque *ok - * } - */ - public static MemorySegment ok(MemorySegment struct) { - return struct.get(ok$LAYOUT, ok$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * ResultOpaque *ok - * } - */ - public static void ok(MemorySegment struct, MemorySegment fieldValue) { - struct.set(ok$LAYOUT, ok$OFFSET, fieldValue); - } - - private static final GroupLayout err$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$32:48"), groupElement("err")); - - /** - * Layout for field: - * {@snippet lang=c : - * ErrorStruct err - * } - */ - public static final GroupLayout err$layout() { - return err$LAYOUT; - } - - private static final long err$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * ErrorStruct err - * } - */ - public static final long err$offset() { - return err$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * ErrorStruct err - * } - */ - public static MemorySegment err(MemorySegment struct) { - return struct.asSlice(err$OFFSET, err$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * ErrorStruct err - * } - */ - public static void err(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, err$OFFSET, err$LAYOUT.byteSize()); - } - - private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); - - /** - * Layout for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static final OfBoolean is_ok$layout() { - return is_ok$LAYOUT; - } - - private static final long is_ok$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static final long is_ok$offset() { - return is_ok$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static boolean is_ok(MemorySegment struct) { - return struct.get(is_ok$LAYOUT, is_ok$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static void is_ok(MemorySegment struct, boolean fieldValue) { - struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_failing_unit_result.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_failing_unit_result.java deleted file mode 100644 index 26da09930..000000000 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_failing_unit_result.java +++ /dev/null @@ -1,178 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct ResultOpaque_new_failing_unit_result { - * union { - * ResultOpaque *ok; - * }; - * bool is_ok; - * } - * } - */ -public class ResultOpaque_new_failing_unit_result { - - ResultOpaque_new_failing_unit_result() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - MemoryLayout.unionLayout( - somelib_h.C_POINTER.withName("ok") - ).withName("$anon$29:46"), - somelib_h.C_BOOL.withName("is_ok"), - MemoryLayout.paddingLayout(7) - ).withName("ResultOpaque_new_failing_unit_result"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout ok$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("$anon$29:46"), groupElement("ok")); - - /** - * Layout for field: - * {@snippet lang=c : - * ResultOpaque *ok - * } - */ - public static final AddressLayout ok$layout() { - return ok$LAYOUT; - } - - private static final long ok$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * ResultOpaque *ok - * } - */ - public static final long ok$offset() { - return ok$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * ResultOpaque *ok - * } - */ - public static MemorySegment ok(MemorySegment struct) { - return struct.get(ok$LAYOUT, ok$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * ResultOpaque *ok - * } - */ - public static void ok(MemorySegment struct, MemorySegment fieldValue) { - struct.set(ok$LAYOUT, ok$OFFSET, fieldValue); - } - - private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); - - /** - * Layout for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static final OfBoolean is_ok$layout() { - return is_ok$LAYOUT; - } - - private static final long is_ok$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static final long is_ok$offset() { - return is_ok$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static boolean is_ok(MemorySegment struct) { - return struct.get(is_ok$LAYOUT, is_ok$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static void is_ok(MemorySegment struct, boolean fieldValue) { - struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_in_enum_err_result.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_in_enum_err_result.java deleted file mode 100644 index 588694ecd..000000000 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_in_enum_err_result.java +++ /dev/null @@ -1,224 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct ResultOpaque_new_in_enum_err_result { - * union { - * ErrorEnum ok; - * ResultOpaque *err; - * }; - * bool is_ok; - * } - * } - */ -public class ResultOpaque_new_in_enum_err_result { - - ResultOpaque_new_in_enum_err_result() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - MemoryLayout.unionLayout( - somelib_h.C_INT.withName("ok"), - somelib_h.C_POINTER.withName("err") - ).withName("$anon$41:45"), - somelib_h.C_BOOL.withName("is_ok"), - MemoryLayout.paddingLayout(7) - ).withName("ResultOpaque_new_in_enum_err_result"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfInt ok$LAYOUT = (OfInt)$LAYOUT.select(groupElement("$anon$41:45"), groupElement("ok")); - - /** - * Layout for field: - * {@snippet lang=c : - * ErrorEnum ok - * } - */ - public static final OfInt ok$layout() { - return ok$LAYOUT; - } - - private static final long ok$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * ErrorEnum ok - * } - */ - public static final long ok$offset() { - return ok$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * ErrorEnum ok - * } - */ - public static int ok(MemorySegment struct) { - return struct.get(ok$LAYOUT, ok$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * ErrorEnum ok - * } - */ - public static void ok(MemorySegment struct, int fieldValue) { - struct.set(ok$LAYOUT, ok$OFFSET, fieldValue); - } - - private static final AddressLayout err$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("$anon$41:45"), groupElement("err")); - - /** - * Layout for field: - * {@snippet lang=c : - * ResultOpaque *err - * } - */ - public static final AddressLayout err$layout() { - return err$LAYOUT; - } - - private static final long err$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * ResultOpaque *err - * } - */ - public static final long err$offset() { - return err$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * ResultOpaque *err - * } - */ - public static MemorySegment err(MemorySegment struct) { - return struct.get(err$LAYOUT, err$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * ResultOpaque *err - * } - */ - public static void err(MemorySegment struct, MemorySegment fieldValue) { - struct.set(err$LAYOUT, err$OFFSET, fieldValue); - } - - private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); - - /** - * Layout for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static final OfBoolean is_ok$layout() { - return is_ok$LAYOUT; - } - - private static final long is_ok$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static final long is_ok$offset() { - return is_ok$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static boolean is_ok(MemorySegment struct) { - return struct.get(is_ok$LAYOUT, is_ok$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static void is_ok(MemorySegment struct, boolean fieldValue) { - struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_in_err_result.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_in_err_result.java deleted file mode 100644 index da94af79f..000000000 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_in_err_result.java +++ /dev/null @@ -1,178 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct ResultOpaque_new_in_err_result { - * union { - * ResultOpaque *err; - * }; - * bool is_ok; - * } - * } - */ -public class ResultOpaque_new_in_err_result { - - ResultOpaque_new_in_err_result() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - MemoryLayout.unionLayout( - somelib_h.C_POINTER.withName("err") - ).withName("$anon$35:40"), - somelib_h.C_BOOL.withName("is_ok"), - MemoryLayout.paddingLayout(7) - ).withName("ResultOpaque_new_in_err_result"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout err$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("$anon$35:40"), groupElement("err")); - - /** - * Layout for field: - * {@snippet lang=c : - * ResultOpaque *err - * } - */ - public static final AddressLayout err$layout() { - return err$LAYOUT; - } - - private static final long err$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * ResultOpaque *err - * } - */ - public static final long err$offset() { - return err$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * ResultOpaque *err - * } - */ - public static MemorySegment err(MemorySegment struct) { - return struct.get(err$LAYOUT, err$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * ResultOpaque *err - * } - */ - public static void err(MemorySegment struct, MemorySegment fieldValue) { - struct.set(err$LAYOUT, err$OFFSET, fieldValue); - } - - private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); - - /** - * Layout for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static final OfBoolean is_ok$layout() { - return is_ok$LAYOUT; - } - - private static final long is_ok$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static final long is_ok$offset() { - return is_ok$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static boolean is_ok(MemorySegment struct) { - return struct.get(is_ok$LAYOUT, is_ok$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static void is_ok(MemorySegment struct, boolean fieldValue) { - struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_result.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_result.java deleted file mode 100644 index 516d30060..000000000 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ResultOpaque_new_result.java +++ /dev/null @@ -1,224 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct ResultOpaque_new_result { - * union { - * ResultOpaque *ok; - * ErrorEnum err; - * }; - * bool is_ok; - * } - * } - */ -public class ResultOpaque_new_result { - - ResultOpaque_new_result() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - MemoryLayout.unionLayout( - somelib_h.C_POINTER.withName("ok"), - somelib_h.C_INT.withName("err") - ).withName("$anon$20:33"), - somelib_h.C_BOOL.withName("is_ok"), - MemoryLayout.paddingLayout(7) - ).withName("ResultOpaque_new_result"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout ok$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("$anon$20:33"), groupElement("ok")); - - /** - * Layout for field: - * {@snippet lang=c : - * ResultOpaque *ok - * } - */ - public static final AddressLayout ok$layout() { - return ok$LAYOUT; - } - - private static final long ok$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * ResultOpaque *ok - * } - */ - public static final long ok$offset() { - return ok$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * ResultOpaque *ok - * } - */ - public static MemorySegment ok(MemorySegment struct) { - return struct.get(ok$LAYOUT, ok$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * ResultOpaque *ok - * } - */ - public static void ok(MemorySegment struct, MemorySegment fieldValue) { - struct.set(ok$LAYOUT, ok$OFFSET, fieldValue); - } - - private static final OfInt err$LAYOUT = (OfInt)$LAYOUT.select(groupElement("$anon$20:33"), groupElement("err")); - - /** - * Layout for field: - * {@snippet lang=c : - * ErrorEnum err - * } - */ - public static final OfInt err$layout() { - return err$LAYOUT; - } - - private static final long err$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * ErrorEnum err - * } - */ - public static final long err$offset() { - return err$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * ErrorEnum err - * } - */ - public static int err(MemorySegment struct) { - return struct.get(err$LAYOUT, err$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * ErrorEnum err - * } - */ - public static void err(MemorySegment struct, int fieldValue) { - struct.set(err$LAYOUT, err$OFFSET, fieldValue); - } - - private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); - - /** - * Layout for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static final OfBoolean is_ok$layout() { - return is_ok$LAYOUT; - } - - private static final long is_ok$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static final long is_ok$offset() { - return is_ok$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static boolean is_ok(MemorySegment struct) { - return struct.get(is_ok$LAYOUT, is_ok$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static void is_ok(MemorySegment struct, boolean fieldValue) { - struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_OSUnalignedU16.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_OSUnalignedU16.java deleted file mode 100644 index 7d88e1de8..000000000 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_OSUnalignedU16.java +++ /dev/null @@ -1,127 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct _OSUnalignedU16 { - * volatile uint16_t __val; - * } - * } - */ -public class _OSUnalignedU16 { - - _OSUnalignedU16() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.align(somelib_h.C_SHORT, 1).withName("__val") - ).withName("_OSUnalignedU16"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfShort __val$LAYOUT = (OfShort)$LAYOUT.select(groupElement("__val")); - - /** - * Layout for field: - * {@snippet lang=c : - * volatile uint16_t __val - * } - */ - public static final OfShort __val$layout() { - return __val$LAYOUT; - } - - private static final long __val$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * volatile uint16_t __val - * } - */ - public static final long __val$offset() { - return __val$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * volatile uint16_t __val - * } - */ - public static short __val(MemorySegment struct) { - return struct.get(__val$LAYOUT, __val$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * volatile uint16_t __val - * } - */ - public static void __val(MemorySegment struct, short fieldValue) { - struct.set(__val$LAYOUT, __val$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_OSUnalignedU64.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_OSUnalignedU64.java deleted file mode 100644 index 3c28f93f5..000000000 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/_OSUnalignedU64.java +++ /dev/null @@ -1,127 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct _OSUnalignedU64 { - * volatile uint64_t __val; - * } - * } - */ -public class _OSUnalignedU64 { - - _OSUnalignedU64() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.align(somelib_h.C_LONG_LONG, 1).withName("__val") - ).withName("_OSUnalignedU64"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong __val$LAYOUT = (OfLong)$LAYOUT.select(groupElement("__val")); - - /** - * Layout for field: - * {@snippet lang=c : - * volatile uint64_t __val - * } - */ - public static final OfLong __val$layout() { - return __val$LAYOUT; - } - - private static final long __val$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * volatile uint64_t __val - * } - */ - public static final long __val$offset() { - return __val$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * volatile uint64_t __val - * } - */ - public static long __val(MemorySegment struct) { - return struct.get(__val$LAYOUT, __val$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * volatile uint64_t __val - * } - */ - public static void __val(MemorySegment struct, long fieldValue) { - struct.set(__val$LAYOUT, __val$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/fd_set.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/fd_set.java deleted file mode 100644 index 618dad751..000000000 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/fd_set.java +++ /dev/null @@ -1,160 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct fd_set { - * __int32_t fds_bits[32]; - * } - * } - */ -public class fd_set { - - fd_set() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - MemoryLayout.sequenceLayout(32, somelib_h.C_INT).withName("fds_bits") - ).withName("fd_set"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final SequenceLayout fds_bits$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("fds_bits")); - - /** - * Layout for field: - * {@snippet lang=c : - * __int32_t fds_bits[32] - * } - */ - public static final SequenceLayout fds_bits$layout() { - return fds_bits$LAYOUT; - } - - private static final long fds_bits$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * __int32_t fds_bits[32] - * } - */ - public static final long fds_bits$offset() { - return fds_bits$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * __int32_t fds_bits[32] - * } - */ - public static MemorySegment fds_bits(MemorySegment struct) { - return struct.asSlice(fds_bits$OFFSET, fds_bits$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * __int32_t fds_bits[32] - * } - */ - public static void fds_bits(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, fds_bits$OFFSET, fds_bits$LAYOUT.byteSize()); - } - - private static long[] fds_bits$DIMS = { 32 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * __int32_t fds_bits[32] - * } - */ - public static long[] fds_bits$dimensions() { - return fds_bits$DIMS; - } - private static final VarHandle fds_bits$ELEM_HANDLE = fds_bits$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * __int32_t fds_bits[32] - * } - */ - public static int fds_bits(MemorySegment struct, long index0) { - return (int)fds_bits$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * __int32_t fds_bits[32] - * } - */ - public static void fds_bits(MemorySegment struct, long index0, int fieldValue) { - fds_bits$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/namespace_MyIndexer_get_result.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/namespace_MyIndexer_get_result.java deleted file mode 100644 index aa203db64..000000000 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/namespace_MyIndexer_get_result.java +++ /dev/null @@ -1,178 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct namespace_MyIndexer_get_result { - * union { - * DiplomatStringView ok; - * }; - * bool is_ok; - * } - * } - */ -public class namespace_MyIndexer_get_result { - - namespace_MyIndexer_get_result() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - MemoryLayout.unionLayout( - DiplomatStringView.layout().withName("ok") - ).withName("$anon$18:40"), - somelib_h.C_BOOL.withName("is_ok"), - MemoryLayout.paddingLayout(7) - ).withName("namespace_MyIndexer_get_result"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final GroupLayout ok$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$18:40"), groupElement("ok")); - - /** - * Layout for field: - * {@snippet lang=c : - * DiplomatStringView ok - * } - */ - public static final GroupLayout ok$layout() { - return ok$LAYOUT; - } - - private static final long ok$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * DiplomatStringView ok - * } - */ - public static final long ok$offset() { - return ok$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * DiplomatStringView ok - * } - */ - public static MemorySegment ok(MemorySegment struct) { - return struct.asSlice(ok$OFFSET, ok$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * DiplomatStringView ok - * } - */ - public static void ok(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, ok$OFFSET, ok$LAYOUT.byteSize()); - } - - private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); - - /** - * Layout for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static final OfBoolean is_ok$layout() { - return is_ok$LAYOUT; - } - - private static final long is_ok$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static final long is_ok$offset() { - return is_ok$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static boolean is_ok(MemorySegment struct) { - return struct.get(is_ok$LAYOUT, is_ok$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static void is_ok(MemorySegment struct, boolean fieldValue) { - struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_attr_t.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_attr_t.java deleted file mode 100644 index e4bfe4bbf..000000000 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_attr_t.java +++ /dev/null @@ -1,26 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * typedef __darwin_pthread_attr_t pthread_attr_t - * } - */ -public class pthread_attr_t extends _opaque_pthread_attr_t { - - pthread_attr_t() { - // Should not be called directly - } -} - diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_cond_t.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_cond_t.java deleted file mode 100644 index ad8ee80cb..000000000 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_cond_t.java +++ /dev/null @@ -1,26 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * typedef __darwin_pthread_cond_t pthread_cond_t - * } - */ -public class pthread_cond_t extends _opaque_pthread_cond_t { - - pthread_cond_t() { - // Should not be called directly - } -} - diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_condattr_t.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_condattr_t.java deleted file mode 100644 index b3b04c732..000000000 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_condattr_t.java +++ /dev/null @@ -1,26 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * typedef __darwin_pthread_condattr_t pthread_condattr_t - * } - */ -public class pthread_condattr_t extends _opaque_pthread_condattr_t { - - pthread_condattr_t() { - // Should not be called directly - } -} - diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_mutex_t.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_mutex_t.java deleted file mode 100644 index 41e191b4b..000000000 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_mutex_t.java +++ /dev/null @@ -1,26 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * typedef __darwin_pthread_mutex_t pthread_mutex_t - * } - */ -public class pthread_mutex_t extends _opaque_pthread_mutex_t { - - pthread_mutex_t() { - // Should not be called directly - } -} - diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_mutexattr_t.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_mutexattr_t.java deleted file mode 100644 index f7bb8b17d..000000000 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_mutexattr_t.java +++ /dev/null @@ -1,26 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * typedef __darwin_pthread_mutexattr_t pthread_mutexattr_t - * } - */ -public class pthread_mutexattr_t extends _opaque_pthread_mutexattr_t { - - pthread_mutexattr_t() { - // Should not be called directly - } -} - diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_once_t.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_once_t.java deleted file mode 100644 index cc2bf572b..000000000 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_once_t.java +++ /dev/null @@ -1,26 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * typedef __darwin_pthread_once_t pthread_once_t - * } - */ -public class pthread_once_t extends _opaque_pthread_once_t { - - pthread_once_t() { - // Should not be called directly - } -} - diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_rwlock_t.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_rwlock_t.java deleted file mode 100644 index 4e774a4c2..000000000 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_rwlock_t.java +++ /dev/null @@ -1,26 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * typedef __darwin_pthread_rwlock_t pthread_rwlock_t - * } - */ -public class pthread_rwlock_t extends _opaque_pthread_rwlock_t { - - pthread_rwlock_t() { - // Should not be called directly - } -} - diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_rwlockattr_t.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_rwlockattr_t.java deleted file mode 100644 index a674c0acf..000000000 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/pthread_rwlockattr_t.java +++ /dev/null @@ -1,26 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * typedef __darwin_pthread_rwlockattr_t pthread_rwlockattr_t - * } - */ -public class pthread_rwlockattr_t extends _opaque_pthread_rwlockattr_t { - - pthread_rwlockattr_t() { - // Should not be called directly - } -} - diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java index 2025a2023..d6b05d147 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java @@ -213,6 +213,168 @@ public static int _DARWIN_FEATURE_UNIX_CONFORMANCE() { public static int __has_ptrcheck() { return __has_ptrcheck; } + private static final int true_ = (int)1L; + /** + * {@snippet lang=c : + * #define true 1 + * } + */ + public static int true_() { + return true_; + } + private static final int false_ = (int)0L; + /** + * {@snippet lang=c : + * #define false 0 + * } + */ + public static int false_() { + return false_; + } + private static final int __bool_true_false_are_defined = (int)1L; + /** + * {@snippet lang=c : + * #define __bool_true_false_are_defined 1 + * } + */ + public static int __bool_true_false_are_defined() { + return __bool_true_false_are_defined; + } + private static final int __WORDSIZE = (int)64L; + /** + * {@snippet lang=c : + * #define __WORDSIZE 64 + * } + */ + public static int __WORDSIZE() { + return __WORDSIZE; + } + private static final int __PTHREAD_SIZE__ = (int)8176L; + /** + * {@snippet lang=c : + * #define __PTHREAD_SIZE__ 8176 + * } + */ + public static int __PTHREAD_SIZE__() { + return __PTHREAD_SIZE__; + } + private static final int __PTHREAD_ATTR_SIZE__ = (int)56L; + /** + * {@snippet lang=c : + * #define __PTHREAD_ATTR_SIZE__ 56 + * } + */ + public static int __PTHREAD_ATTR_SIZE__() { + return __PTHREAD_ATTR_SIZE__; + } + private static final int __PTHREAD_MUTEXATTR_SIZE__ = (int)8L; + /** + * {@snippet lang=c : + * #define __PTHREAD_MUTEXATTR_SIZE__ 8 + * } + */ + public static int __PTHREAD_MUTEXATTR_SIZE__() { + return __PTHREAD_MUTEXATTR_SIZE__; + } + private static final int __PTHREAD_MUTEX_SIZE__ = (int)56L; + /** + * {@snippet lang=c : + * #define __PTHREAD_MUTEX_SIZE__ 56 + * } + */ + public static int __PTHREAD_MUTEX_SIZE__() { + return __PTHREAD_MUTEX_SIZE__; + } + private static final int __PTHREAD_CONDATTR_SIZE__ = (int)8L; + /** + * {@snippet lang=c : + * #define __PTHREAD_CONDATTR_SIZE__ 8 + * } + */ + public static int __PTHREAD_CONDATTR_SIZE__() { + return __PTHREAD_CONDATTR_SIZE__; + } + private static final int __PTHREAD_COND_SIZE__ = (int)40L; + /** + * {@snippet lang=c : + * #define __PTHREAD_COND_SIZE__ 40 + * } + */ + public static int __PTHREAD_COND_SIZE__() { + return __PTHREAD_COND_SIZE__; + } + private static final int __PTHREAD_ONCE_SIZE__ = (int)8L; + /** + * {@snippet lang=c : + * #define __PTHREAD_ONCE_SIZE__ 8 + * } + */ + public static int __PTHREAD_ONCE_SIZE__() { + return __PTHREAD_ONCE_SIZE__; + } + private static final int __PTHREAD_RWLOCK_SIZE__ = (int)192L; + /** + * {@snippet lang=c : + * #define __PTHREAD_RWLOCK_SIZE__ 192 + * } + */ + public static int __PTHREAD_RWLOCK_SIZE__() { + return __PTHREAD_RWLOCK_SIZE__; + } + private static final int __PTHREAD_RWLOCKATTR_SIZE__ = (int)16L; + /** + * {@snippet lang=c : + * #define __PTHREAD_RWLOCKATTR_SIZE__ 16 + * } + */ + public static int __PTHREAD_RWLOCKATTR_SIZE__() { + return __PTHREAD_RWLOCKATTR_SIZE__; + } + private static final int INT8_MAX = (int)127L; + /** + * {@snippet lang=c : + * #define INT8_MAX 127 + * } + */ + public static int INT8_MAX() { + return INT8_MAX; + } + private static final int INT16_MAX = (int)32767L; + /** + * {@snippet lang=c : + * #define INT16_MAX 32767 + * } + */ + public static int INT16_MAX() { + return INT16_MAX; + } + private static final int INT32_MAX = (int)2147483647L; + /** + * {@snippet lang=c : + * #define INT32_MAX 2147483647 + * } + */ + public static int INT32_MAX() { + return INT32_MAX; + } + private static final int UINT8_MAX = (int)255L; + /** + * {@snippet lang=c : + * #define UINT8_MAX 255 + * } + */ + public static int UINT8_MAX() { + return UINT8_MAX; + } + private static final int UINT16_MAX = (int)65535L; + /** + * {@snippet lang=c : + * #define UINT16_MAX 65535 + * } + */ + public static int UINT16_MAX() { + return UINT16_MAX; + } private static final int __API_TO_BE_DEPRECATED = (int)100000L; /** * {@snippet lang=c : @@ -2787,87 +2949,6 @@ public static int __VISIONOS_1_2() { public static int __ENABLE_LEGACY_MAC_AVAILABILITY() { return __ENABLE_LEGACY_MAC_AVAILABILITY; } - private static final int __PTHREAD_SIZE__ = (int)8176L; - /** - * {@snippet lang=c : - * #define __PTHREAD_SIZE__ 8176 - * } - */ - public static int __PTHREAD_SIZE__() { - return __PTHREAD_SIZE__; - } - private static final int __PTHREAD_ATTR_SIZE__ = (int)56L; - /** - * {@snippet lang=c : - * #define __PTHREAD_ATTR_SIZE__ 56 - * } - */ - public static int __PTHREAD_ATTR_SIZE__() { - return __PTHREAD_ATTR_SIZE__; - } - private static final int __PTHREAD_MUTEXATTR_SIZE__ = (int)8L; - /** - * {@snippet lang=c : - * #define __PTHREAD_MUTEXATTR_SIZE__ 8 - * } - */ - public static int __PTHREAD_MUTEXATTR_SIZE__() { - return __PTHREAD_MUTEXATTR_SIZE__; - } - private static final int __PTHREAD_MUTEX_SIZE__ = (int)56L; - /** - * {@snippet lang=c : - * #define __PTHREAD_MUTEX_SIZE__ 56 - * } - */ - public static int __PTHREAD_MUTEX_SIZE__() { - return __PTHREAD_MUTEX_SIZE__; - } - private static final int __PTHREAD_CONDATTR_SIZE__ = (int)8L; - /** - * {@snippet lang=c : - * #define __PTHREAD_CONDATTR_SIZE__ 8 - * } - */ - public static int __PTHREAD_CONDATTR_SIZE__() { - return __PTHREAD_CONDATTR_SIZE__; - } - private static final int __PTHREAD_COND_SIZE__ = (int)40L; - /** - * {@snippet lang=c : - * #define __PTHREAD_COND_SIZE__ 40 - * } - */ - public static int __PTHREAD_COND_SIZE__() { - return __PTHREAD_COND_SIZE__; - } - private static final int __PTHREAD_ONCE_SIZE__ = (int)8L; - /** - * {@snippet lang=c : - * #define __PTHREAD_ONCE_SIZE__ 8 - * } - */ - public static int __PTHREAD_ONCE_SIZE__() { - return __PTHREAD_ONCE_SIZE__; - } - private static final int __PTHREAD_RWLOCK_SIZE__ = (int)192L; - /** - * {@snippet lang=c : - * #define __PTHREAD_RWLOCK_SIZE__ 192 - * } - */ - public static int __PTHREAD_RWLOCK_SIZE__() { - return __PTHREAD_RWLOCK_SIZE__; - } - private static final int __PTHREAD_RWLOCKATTR_SIZE__ = (int)16L; - /** - * {@snippet lang=c : - * #define __PTHREAD_RWLOCKATTR_SIZE__ 16 - * } - */ - public static int __PTHREAD_RWLOCKATTR_SIZE__() { - return __PTHREAD_RWLOCKATTR_SIZE__; - } private static final int _FORTIFY_SOURCE = (int)2L; /** * {@snippet lang=c : @@ -3201,150 +3282,234 @@ public static int L_ctermid() { public static int _USE_FORTIFY_LEVEL() { return _USE_FORTIFY_LEVEL; } - private static final int __WORDSIZE = (int)64L; + + private static class __assert_rtn { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("__assert_rtn"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + /** + * Function descriptor for: * {@snippet lang=c : - * #define __WORDSIZE 64 + * void __assert_rtn(const char *, const char *, int, const char *) * } */ - public static int __WORDSIZE() { - return __WORDSIZE; + public static FunctionDescriptor __assert_rtn$descriptor() { + return __assert_rtn.DESC; } - private static final int INT8_MAX = (int)127L; + /** + * Downcall method handle for: * {@snippet lang=c : - * #define INT8_MAX 127 + * void __assert_rtn(const char *, const char *, int, const char *) * } */ - public static int INT8_MAX() { - return INT8_MAX; + public static MethodHandle __assert_rtn$handle() { + return __assert_rtn.HANDLE; } - private static final int INT16_MAX = (int)32767L; + /** + * Address for: * {@snippet lang=c : - * #define INT16_MAX 32767 + * void __assert_rtn(const char *, const char *, int, const char *) * } */ - public static int INT16_MAX() { - return INT16_MAX; + public static MemorySegment __assert_rtn$address() { + return __assert_rtn.ADDR; } - private static final int INT32_MAX = (int)2147483647L; + /** * {@snippet lang=c : - * #define INT32_MAX 2147483647 + * void __assert_rtn(const char *, const char *, int, const char *) * } */ - public static int INT32_MAX() { - return INT32_MAX; + public static void __assert_rtn(MemorySegment x0, MemorySegment x1, int x2, MemorySegment x3) { + var mh$ = __assert_rtn.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("__assert_rtn", x0, x1, x2, x3); + } + mh$.invokeExact(x0, x1, x2, x3); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } } - private static final int UINT8_MAX = (int)255L; /** * {@snippet lang=c : - * #define UINT8_MAX 255 + * typedef long ptrdiff_t * } */ - public static int UINT8_MAX() { - return UINT8_MAX; - } - private static final int UINT16_MAX = (int)65535L; + public static final OfLong ptrdiff_t = somelib_h.C_LONG; /** * {@snippet lang=c : - * #define UINT16_MAX 65535 + * typedef unsigned long size_t * } */ - public static int UINT16_MAX() { - return UINT16_MAX; - } - private static final int true_ = (int)1L; + public static final OfLong size_t = somelib_h.C_LONG; /** * {@snippet lang=c : - * #define true 1 + * typedef unsigned long rsize_t * } */ - public static int true_() { - return true_; - } - private static final int false_ = (int)0L; + public static final OfLong rsize_t = somelib_h.C_LONG; /** * {@snippet lang=c : - * #define false 0 + * typedef int wchar_t * } */ - public static int false_() { - return false_; - } - private static final int __bool_true_false_are_defined = (int)1L; + public static final OfInt wchar_t = somelib_h.C_INT; /** * {@snippet lang=c : - * #define __bool_true_false_are_defined 1 + * typedef signed char int8_t * } */ - public static int __bool_true_false_are_defined() { - return __bool_true_false_are_defined; - } - private static final int _QUAD_HIGHWORD = (int)1L; + public static final OfByte int8_t = somelib_h.C_CHAR; /** * {@snippet lang=c : - * #define _QUAD_HIGHWORD 1 + * typedef short int16_t * } */ - public static int _QUAD_HIGHWORD() { - return _QUAD_HIGHWORD; - } - private static final int _QUAD_LOWWORD = (int)0L; + public static final OfShort int16_t = somelib_h.C_SHORT; /** * {@snippet lang=c : - * #define _QUAD_LOWWORD 0 + * typedef int int32_t * } */ - public static int _QUAD_LOWWORD() { - return _QUAD_LOWWORD; - } - private static final int __DARWIN_LITTLE_ENDIAN = (int)1234L; + public static final OfInt int32_t = somelib_h.C_INT; /** * {@snippet lang=c : - * #define __DARWIN_LITTLE_ENDIAN 1234 + * typedef long long int64_t * } */ - public static int __DARWIN_LITTLE_ENDIAN() { - return __DARWIN_LITTLE_ENDIAN; - } - private static final int __DARWIN_BIG_ENDIAN = (int)4321L; + public static final OfLong int64_t = somelib_h.C_LONG_LONG; /** * {@snippet lang=c : - * #define __DARWIN_BIG_ENDIAN 4321 + * typedef unsigned char uint8_t * } */ - public static int __DARWIN_BIG_ENDIAN() { - return __DARWIN_BIG_ENDIAN; - } - private static final int __DARWIN_PDP_ENDIAN = (int)3412L; + public static final OfByte uint8_t = somelib_h.C_CHAR; /** * {@snippet lang=c : - * #define __DARWIN_PDP_ENDIAN 3412 + * typedef unsigned short uint16_t * } */ - public static int __DARWIN_PDP_ENDIAN() { - return __DARWIN_PDP_ENDIAN; - } - private static final int __DARWIN_FD_SETSIZE = (int)1024L; + public static final OfShort uint16_t = somelib_h.C_SHORT; /** * {@snippet lang=c : - * #define __DARWIN_FD_SETSIZE 1024 + * typedef unsigned int uint32_t * } */ - public static int __DARWIN_FD_SETSIZE() { - return __DARWIN_FD_SETSIZE; - } - private static final int __DARWIN_NBBY = (int)8L; + public static final OfInt uint32_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef unsigned long long uint64_t + * } + */ + public static final OfLong uint64_t = somelib_h.C_LONG_LONG; /** * {@snippet lang=c : - * #define __DARWIN_NBBY 8 + * typedef int8_t int_least8_t * } */ - public static int __DARWIN_NBBY() { - return __DARWIN_NBBY; - } + public static final OfByte int_least8_t = somelib_h.C_CHAR; + /** + * {@snippet lang=c : + * typedef int16_t int_least16_t + * } + */ + public static final OfShort int_least16_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef int32_t int_least32_t + * } + */ + public static final OfInt int_least32_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef int64_t int_least64_t + * } + */ + public static final OfLong int_least64_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef uint8_t uint_least8_t + * } + */ + public static final OfByte uint_least8_t = somelib_h.C_CHAR; + /** + * {@snippet lang=c : + * typedef uint16_t uint_least16_t + * } + */ + public static final OfShort uint_least16_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef uint32_t uint_least32_t + * } + */ + public static final OfInt uint_least32_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef uint64_t uint_least64_t + * } + */ + public static final OfLong uint_least64_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef int8_t int_fast8_t + * } + */ + public static final OfByte int_fast8_t = somelib_h.C_CHAR; + /** + * {@snippet lang=c : + * typedef int16_t int_fast16_t + * } + */ + public static final OfShort int_fast16_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef int32_t int_fast32_t + * } + */ + public static final OfInt int_fast32_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef int64_t int_fast64_t + * } + */ + public static final OfLong int_fast64_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef uint8_t uint_fast8_t + * } + */ + public static final OfByte uint_fast8_t = somelib_h.C_CHAR; + /** + * {@snippet lang=c : + * typedef uint16_t uint_fast16_t + * } + */ + public static final OfShort uint_fast16_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef uint32_t uint_fast32_t + * } + */ + public static final OfInt uint_fast32_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef uint64_t uint_fast64_t + * } + */ + public static final OfLong uint_fast64_t = somelib_h.C_LONG_LONG; /** * {@snippet lang=c : * typedef signed char __int8_t @@ -3595,48 +3760,6 @@ public static int __DARWIN_NBBY() { * } */ public static final AddressLayout __darwin_pthread_t = somelib_h.C_POINTER; - /** - * {@snippet lang=c : - * typedef int __darwin_nl_item - * } - */ - public static final OfInt __darwin_nl_item = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef int __darwin_wctrans_t - * } - */ - public static final OfInt __darwin_wctrans_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef __uint32_t __darwin_wctype_t - * } - */ - public static final OfInt __darwin_wctype_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef signed char int8_t - * } - */ - public static final OfByte int8_t = somelib_h.C_CHAR; - /** - * {@snippet lang=c : - * typedef short int16_t - * } - */ - public static final OfShort int16_t = somelib_h.C_SHORT; - /** - * {@snippet lang=c : - * typedef int int32_t - * } - */ - public static final OfInt int32_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef long long int64_t - * } - */ - public static final OfLong int64_t = somelib_h.C_LONG_LONG; /** * {@snippet lang=c : * typedef unsigned char u_int8_t @@ -3667,12 +3790,6 @@ public static int __DARWIN_NBBY() { * } */ public static final OfLong register_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef __darwin_intptr_t intptr_t - * } - */ - public static final OfLong intptr_t = somelib_h.C_LONG; /** * {@snippet lang=c : * typedef unsigned long uintptr_t @@ -3729,87 +3846,43 @@ public static int __DARWIN_NBBY() { public static final OfLong syscall_arg_t = somelib_h.C_LONG_LONG; /** * {@snippet lang=c : - * typedef __darwin_va_list va_list + * typedef __darwin_intptr_t intptr_t * } */ - public static final AddressLayout va_list = somelib_h.C_POINTER; + public static final OfLong intptr_t = somelib_h.C_LONG; /** * {@snippet lang=c : - * typedef __darwin_size_t size_t + * typedef long intmax_t * } */ - public static final OfLong size_t = somelib_h.C_LONG; - - private static class renameat { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("renameat"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - + public static final OfLong intmax_t = somelib_h.C_LONG; /** - * Function descriptor for: * {@snippet lang=c : - * int renameat(int, const char *, int, const char *) + * typedef unsigned long uintmax_t * } */ - public static FunctionDescriptor renameat$descriptor() { - return renameat.DESC; - } - + public static final OfLong uintmax_t = somelib_h.C_LONG; /** - * Downcall method handle for: - * {@snippet lang=c : - * int renameat(int, const char *, int, const char *) - * } - */ - public static MethodHandle renameat$handle() { - return renameat.HANDLE; - } - - /** - * Address for: * {@snippet lang=c : - * int renameat(int, const char *, int, const char *) + * typedef uint_least16_t char16_t * } */ - public static MemorySegment renameat$address() { - return renameat.ADDR; - } - + public static final OfShort char16_t = somelib_h.C_SHORT; /** * {@snippet lang=c : - * int renameat(int, const char *, int, const char *) + * typedef uint_least32_t char32_t * } */ - public static int renameat(int x0, MemorySegment x1, int x2, MemorySegment x3) { - var mh$ = renameat.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("renameat", x0, x1, x2, x3); - } - return (int)mh$.invokeExact(x0, x1, x2, x3); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } + public static final OfInt char32_t = somelib_h.C_INT; - private static class renamex_np { + private static class diplomat_is_str { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, + somelib_h.C_BOOL, somelib_h.C_POINTER, - somelib_h.C_INT + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("renamex_np"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_is_str"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -3817,61 +3890,58 @@ private static class renamex_np { /** * Function descriptor for: * {@snippet lang=c : - * int renamex_np(const char *, const char *, unsigned int) + * bool diplomat_is_str(const char *buf, size_t len) * } */ - public static FunctionDescriptor renamex_np$descriptor() { - return renamex_np.DESC; + public static FunctionDescriptor diplomat_is_str$descriptor() { + return diplomat_is_str.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int renamex_np(const char *, const char *, unsigned int) + * bool diplomat_is_str(const char *buf, size_t len) * } */ - public static MethodHandle renamex_np$handle() { - return renamex_np.HANDLE; + public static MethodHandle diplomat_is_str$handle() { + return diplomat_is_str.HANDLE; } /** * Address for: * {@snippet lang=c : - * int renamex_np(const char *, const char *, unsigned int) + * bool diplomat_is_str(const char *buf, size_t len) * } */ - public static MemorySegment renamex_np$address() { - return renamex_np.ADDR; + public static MemorySegment diplomat_is_str$address() { + return diplomat_is_str.ADDR; } /** * {@snippet lang=c : - * int renamex_np(const char *, const char *, unsigned int) + * bool diplomat_is_str(const char *buf, size_t len) * } */ - public static int renamex_np(MemorySegment x0, MemorySegment x1, int x2) { - var mh$ = renamex_np.HANDLE; + public static boolean diplomat_is_str(MemorySegment buf, long len) { + var mh$ = diplomat_is_str.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("renamex_np", x0, x1, x2); + traceDowncall("diplomat_is_str", buf, len); } - return (int)mh$.invokeExact(x0, x1, x2); + return (boolean)mh$.invokeExact(buf, len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class renameatx_np { + private static class diplomat_simple_write { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_INT, + DiplomatWrite.layout(), somelib_h.C_POINTER, - somelib_h.C_INT + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("renameatx_np"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_simple_write"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -3879,197 +3949,230 @@ private static class renameatx_np { /** * Function descriptor for: * {@snippet lang=c : - * int renameatx_np(int, const char *, int, const char *, unsigned int) + * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) * } */ - public static FunctionDescriptor renameatx_np$descriptor() { - return renameatx_np.DESC; + public static FunctionDescriptor diplomat_simple_write$descriptor() { + return diplomat_simple_write.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int renameatx_np(int, const char *, int, const char *, unsigned int) + * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) * } */ - public static MethodHandle renameatx_np$handle() { - return renameatx_np.HANDLE; + public static MethodHandle diplomat_simple_write$handle() { + return diplomat_simple_write.HANDLE; } /** * Address for: * {@snippet lang=c : - * int renameatx_np(int, const char *, int, const char *, unsigned int) + * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) * } */ - public static MemorySegment renameatx_np$address() { - return renameatx_np.ADDR; + public static MemorySegment diplomat_simple_write$address() { + return diplomat_simple_write.ADDR; } /** * {@snippet lang=c : - * int renameatx_np(int, const char *, int, const char *, unsigned int) + * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) * } */ - public static int renameatx_np(int x0, MemorySegment x1, int x2, MemorySegment x3, int x4) { - var mh$ = renameatx_np.HANDLE; + public static MemorySegment diplomat_simple_write(SegmentAllocator allocator, MemorySegment buf, long buf_size) { + var mh$ = diplomat_simple_write.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("renameatx_np", x0, x1, x2, x3, x4); + traceDowncall("diplomat_simple_write", allocator, buf, buf_size); } - return (int)mh$.invokeExact(x0, x1, x2, x3, x4); + return (MemorySegment)mh$.invokeExact(allocator, buf, buf_size); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - /** - * {@snippet lang=c : - * typedef __darwin_off_t fpos_t - * } - */ - public static final OfLong fpos_t = somelib_h.C_LONG_LONG; - private static class __stdinp$constants { - public static final AddressLayout LAYOUT = somelib_h.C_POINTER; - public static final MemorySegment SEGMENT = somelib_h.findOrThrow("__stdinp").reinterpret(LAYOUT.byteSize()); + private static class diplomat_buffer_write_create { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_LONG + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_create"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } /** - * Layout for variable: + * Function descriptor for: * {@snippet lang=c : - * extern FILE *__stdinp + * DiplomatWrite *diplomat_buffer_write_create(size_t cap) * } */ - public static AddressLayout __stdinp$layout() { - return __stdinp$constants.LAYOUT; + public static FunctionDescriptor diplomat_buffer_write_create$descriptor() { + return diplomat_buffer_write_create.DESC; } /** - * Segment for variable: + * Downcall method handle for: * {@snippet lang=c : - * extern FILE *__stdinp + * DiplomatWrite *diplomat_buffer_write_create(size_t cap) * } */ - public static MemorySegment __stdinp$segment() { - return __stdinp$constants.SEGMENT; + public static MethodHandle diplomat_buffer_write_create$handle() { + return diplomat_buffer_write_create.HANDLE; } /** - * Getter for variable: + * Address for: * {@snippet lang=c : - * extern FILE *__stdinp + * DiplomatWrite *diplomat_buffer_write_create(size_t cap) * } */ - public static MemorySegment __stdinp() { - return __stdinp$constants.SEGMENT.get(__stdinp$constants.LAYOUT, 0L); + public static MemorySegment diplomat_buffer_write_create$address() { + return diplomat_buffer_write_create.ADDR; } /** - * Setter for variable: * {@snippet lang=c : - * extern FILE *__stdinp + * DiplomatWrite *diplomat_buffer_write_create(size_t cap) * } */ - public static void __stdinp(MemorySegment varValue) { - __stdinp$constants.SEGMENT.set(__stdinp$constants.LAYOUT, 0L, varValue); + public static MemorySegment diplomat_buffer_write_create(long cap) { + var mh$ = diplomat_buffer_write_create.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("diplomat_buffer_write_create", cap); + } + return (MemorySegment)mh$.invokeExact(cap); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } } - private static class __stdoutp$constants { - public static final AddressLayout LAYOUT = somelib_h.C_POINTER; - public static final MemorySegment SEGMENT = somelib_h.findOrThrow("__stdoutp").reinterpret(LAYOUT.byteSize()); + private static class diplomat_buffer_write_get_bytes { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_get_bytes"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } /** - * Layout for variable: + * Function descriptor for: * {@snippet lang=c : - * extern FILE *__stdoutp + * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) * } */ - public static AddressLayout __stdoutp$layout() { - return __stdoutp$constants.LAYOUT; + public static FunctionDescriptor diplomat_buffer_write_get_bytes$descriptor() { + return diplomat_buffer_write_get_bytes.DESC; } /** - * Segment for variable: + * Downcall method handle for: * {@snippet lang=c : - * extern FILE *__stdoutp + * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) * } */ - public static MemorySegment __stdoutp$segment() { - return __stdoutp$constants.SEGMENT; + public static MethodHandle diplomat_buffer_write_get_bytes$handle() { + return diplomat_buffer_write_get_bytes.HANDLE; } /** - * Getter for variable: + * Address for: * {@snippet lang=c : - * extern FILE *__stdoutp + * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) * } */ - public static MemorySegment __stdoutp() { - return __stdoutp$constants.SEGMENT.get(__stdoutp$constants.LAYOUT, 0L); + public static MemorySegment diplomat_buffer_write_get_bytes$address() { + return diplomat_buffer_write_get_bytes.ADDR; } /** - * Setter for variable: * {@snippet lang=c : - * extern FILE *__stdoutp + * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) * } */ - public static void __stdoutp(MemorySegment varValue) { - __stdoutp$constants.SEGMENT.set(__stdoutp$constants.LAYOUT, 0L, varValue); + public static MemorySegment diplomat_buffer_write_get_bytes(MemorySegment t) { + var mh$ = diplomat_buffer_write_get_bytes.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("diplomat_buffer_write_get_bytes", t); + } + return (MemorySegment)mh$.invokeExact(t); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } } - private static class __stderrp$constants { - public static final AddressLayout LAYOUT = somelib_h.C_POINTER; - public static final MemorySegment SEGMENT = somelib_h.findOrThrow("__stderrp").reinterpret(LAYOUT.byteSize()); + private static class diplomat_buffer_write_len { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_LONG, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_len"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } /** - * Layout for variable: + * Function descriptor for: * {@snippet lang=c : - * extern FILE *__stderrp + * size_t diplomat_buffer_write_len(DiplomatWrite *t) * } */ - public static AddressLayout __stderrp$layout() { - return __stderrp$constants.LAYOUT; + public static FunctionDescriptor diplomat_buffer_write_len$descriptor() { + return diplomat_buffer_write_len.DESC; } /** - * Segment for variable: + * Downcall method handle for: * {@snippet lang=c : - * extern FILE *__stderrp + * size_t diplomat_buffer_write_len(DiplomatWrite *t) * } */ - public static MemorySegment __stderrp$segment() { - return __stderrp$constants.SEGMENT; + public static MethodHandle diplomat_buffer_write_len$handle() { + return diplomat_buffer_write_len.HANDLE; } /** - * Getter for variable: + * Address for: * {@snippet lang=c : - * extern FILE *__stderrp + * size_t diplomat_buffer_write_len(DiplomatWrite *t) * } */ - public static MemorySegment __stderrp() { - return __stderrp$constants.SEGMENT.get(__stderrp$constants.LAYOUT, 0L); + public static MemorySegment diplomat_buffer_write_len$address() { + return diplomat_buffer_write_len.ADDR; } /** - * Setter for variable: * {@snippet lang=c : - * extern FILE *__stderrp + * size_t diplomat_buffer_write_len(DiplomatWrite *t) * } */ - public static void __stderrp(MemorySegment varValue) { - __stderrp$constants.SEGMENT.set(__stderrp$constants.LAYOUT, 0L, varValue); - } + public static long diplomat_buffer_write_len(MemorySegment t) { + var mh$ = diplomat_buffer_write_len.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("diplomat_buffer_write_len", t); + } + return (long)mh$.invokeExact(t); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } - private static class clearerr { + private static class diplomat_buffer_write_destroy { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("clearerr"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4077,115 +4180,84 @@ private static class clearerr { /** * Function descriptor for: * {@snippet lang=c : - * void clearerr(FILE *) + * void diplomat_buffer_write_destroy(DiplomatWrite *t) * } */ - public static FunctionDescriptor clearerr$descriptor() { - return clearerr.DESC; + public static FunctionDescriptor diplomat_buffer_write_destroy$descriptor() { + return diplomat_buffer_write_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void clearerr(FILE *) + * void diplomat_buffer_write_destroy(DiplomatWrite *t) * } */ - public static MethodHandle clearerr$handle() { - return clearerr.HANDLE; + public static MethodHandle diplomat_buffer_write_destroy$handle() { + return diplomat_buffer_write_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * void clearerr(FILE *) + * void diplomat_buffer_write_destroy(DiplomatWrite *t) * } */ - public static MemorySegment clearerr$address() { - return clearerr.ADDR; + public static MemorySegment diplomat_buffer_write_destroy$address() { + return diplomat_buffer_write_destroy.ADDR; } /** * {@snippet lang=c : - * void clearerr(FILE *) + * void diplomat_buffer_write_destroy(DiplomatWrite *t) * } */ - public static void clearerr(MemorySegment x0) { - var mh$ = clearerr.HANDLE; + public static void diplomat_buffer_write_destroy(MemorySegment t) { + var mh$ = diplomat_buffer_write_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("clearerr", x0); + traceDowncall("diplomat_buffer_write_destroy", t); } - mh$.invokeExact(x0); + mh$.invokeExact(t); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - - private static class fclose { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("fclose"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - /** - * Function descriptor for: * {@snippet lang=c : - * int fclose(FILE *) + * typedef int __darwin_nl_item * } */ - public static FunctionDescriptor fclose$descriptor() { - return fclose.DESC; - } - + public static final OfInt __darwin_nl_item = somelib_h.C_INT; /** - * Downcall method handle for: * {@snippet lang=c : - * int fclose(FILE *) + * typedef int __darwin_wctrans_t * } */ - public static MethodHandle fclose$handle() { - return fclose.HANDLE; - } - + public static final OfInt __darwin_wctrans_t = somelib_h.C_INT; /** - * Address for: * {@snippet lang=c : - * int fclose(FILE *) + * typedef __uint32_t __darwin_wctype_t * } */ - public static MemorySegment fclose$address() { - return fclose.ADDR; - } - + public static final OfInt __darwin_wctype_t = somelib_h.C_INT; /** * {@snippet lang=c : - * int fclose(FILE *) + * typedef __darwin_va_list va_list * } */ - public static int fclose(MemorySegment x0) { - var mh$ = fclose.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("fclose", x0); - } - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } + public static final AddressLayout va_list = somelib_h.C_POINTER; - private static class feof { + private static class renameat { public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_INT, + somelib_h.C_POINTER, somelib_h.C_INT, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("feof"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("renameat"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4193,57 +4265,59 @@ private static class feof { /** * Function descriptor for: * {@snippet lang=c : - * int feof(FILE *) + * int renameat(int, const char *, int, const char *) * } */ - public static FunctionDescriptor feof$descriptor() { - return feof.DESC; + public static FunctionDescriptor renameat$descriptor() { + return renameat.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int feof(FILE *) + * int renameat(int, const char *, int, const char *) * } */ - public static MethodHandle feof$handle() { - return feof.HANDLE; + public static MethodHandle renameat$handle() { + return renameat.HANDLE; } /** * Address for: * {@snippet lang=c : - * int feof(FILE *) + * int renameat(int, const char *, int, const char *) * } */ - public static MemorySegment feof$address() { - return feof.ADDR; + public static MemorySegment renameat$address() { + return renameat.ADDR; } /** * {@snippet lang=c : - * int feof(FILE *) + * int renameat(int, const char *, int, const char *) * } */ - public static int feof(MemorySegment x0) { - var mh$ = feof.HANDLE; + public static int renameat(int x0, MemorySegment x1, int x2, MemorySegment x3) { + var mh$ = renameat.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("feof", x0); + traceDowncall("renameat", x0, x1, x2, x3); } - return (int)mh$.invokeExact(x0); + return (int)mh$.invokeExact(x0, x1, x2, x3); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class ferror { + private static class renamex_np { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_INT, - somelib_h.C_POINTER + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_INT ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("ferror"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("renamex_np"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4251,57 +4325,61 @@ private static class ferror { /** * Function descriptor for: * {@snippet lang=c : - * int ferror(FILE *) + * int renamex_np(const char *, const char *, unsigned int) * } */ - public static FunctionDescriptor ferror$descriptor() { - return ferror.DESC; + public static FunctionDescriptor renamex_np$descriptor() { + return renamex_np.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int ferror(FILE *) + * int renamex_np(const char *, const char *, unsigned int) * } */ - public static MethodHandle ferror$handle() { - return ferror.HANDLE; + public static MethodHandle renamex_np$handle() { + return renamex_np.HANDLE; } /** * Address for: * {@snippet lang=c : - * int ferror(FILE *) + * int renamex_np(const char *, const char *, unsigned int) * } */ - public static MemorySegment ferror$address() { - return ferror.ADDR; + public static MemorySegment renamex_np$address() { + return renamex_np.ADDR; } /** * {@snippet lang=c : - * int ferror(FILE *) + * int renamex_np(const char *, const char *, unsigned int) * } */ - public static int ferror(MemorySegment x0) { - var mh$ = ferror.HANDLE; + public static int renamex_np(MemorySegment x0, MemorySegment x1, int x2) { + var mh$ = renamex_np.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("ferror", x0); + traceDowncall("renamex_np", x0, x1, x2); } - return (int)mh$.invokeExact(x0); + return (int)mh$.invokeExact(x0, x1, x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class fflush { + private static class renameatx_np { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_INT, - somelib_h.C_POINTER + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_INT ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("fflush"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("renameatx_np"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4309,235 +4387,197 @@ private static class fflush { /** * Function descriptor for: * {@snippet lang=c : - * int fflush(FILE *) + * int renameatx_np(int, const char *, int, const char *, unsigned int) * } */ - public static FunctionDescriptor fflush$descriptor() { - return fflush.DESC; + public static FunctionDescriptor renameatx_np$descriptor() { + return renameatx_np.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int fflush(FILE *) + * int renameatx_np(int, const char *, int, const char *, unsigned int) * } */ - public static MethodHandle fflush$handle() { - return fflush.HANDLE; + public static MethodHandle renameatx_np$handle() { + return renameatx_np.HANDLE; } /** * Address for: * {@snippet lang=c : - * int fflush(FILE *) + * int renameatx_np(int, const char *, int, const char *, unsigned int) * } */ - public static MemorySegment fflush$address() { - return fflush.ADDR; + public static MemorySegment renameatx_np$address() { + return renameatx_np.ADDR; } /** * {@snippet lang=c : - * int fflush(FILE *) + * int renameatx_np(int, const char *, int, const char *, unsigned int) * } */ - public static int fflush(MemorySegment x0) { - var mh$ = fflush.HANDLE; + public static int renameatx_np(int x0, MemorySegment x1, int x2, MemorySegment x3, int x4) { + var mh$ = renameatx_np.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("fflush", x0); + traceDowncall("renameatx_np", x0, x1, x2, x3, x4); } - return (int)mh$.invokeExact(x0); + return (int)mh$.invokeExact(x0, x1, x2, x3, x4); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } + /** + * {@snippet lang=c : + * typedef __darwin_off_t fpos_t + * } + */ + public static final OfLong fpos_t = somelib_h.C_LONG_LONG; - private static class fgetc { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("fgetc"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + private static class __stdinp$constants { + public static final AddressLayout LAYOUT = somelib_h.C_POINTER; + public static final MemorySegment SEGMENT = somelib_h.findOrThrow("__stdinp").reinterpret(LAYOUT.byteSize()); } /** - * Function descriptor for: + * Layout for variable: * {@snippet lang=c : - * int fgetc(FILE *) + * extern FILE *__stdinp * } */ - public static FunctionDescriptor fgetc$descriptor() { - return fgetc.DESC; + public static AddressLayout __stdinp$layout() { + return __stdinp$constants.LAYOUT; } /** - * Downcall method handle for: + * Segment for variable: * {@snippet lang=c : - * int fgetc(FILE *) + * extern FILE *__stdinp * } */ - public static MethodHandle fgetc$handle() { - return fgetc.HANDLE; + public static MemorySegment __stdinp$segment() { + return __stdinp$constants.SEGMENT; } /** - * Address for: + * Getter for variable: * {@snippet lang=c : - * int fgetc(FILE *) + * extern FILE *__stdinp * } */ - public static MemorySegment fgetc$address() { - return fgetc.ADDR; + public static MemorySegment __stdinp() { + return __stdinp$constants.SEGMENT.get(__stdinp$constants.LAYOUT, 0L); } /** + * Setter for variable: * {@snippet lang=c : - * int fgetc(FILE *) + * extern FILE *__stdinp * } */ - public static int fgetc(MemorySegment x0) { - var mh$ = fgetc.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("fgetc", x0); - } - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } + public static void __stdinp(MemorySegment varValue) { + __stdinp$constants.SEGMENT.set(__stdinp$constants.LAYOUT, 0L, varValue); } - private static class fgetpos { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("fgetpos"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + private static class __stdoutp$constants { + public static final AddressLayout LAYOUT = somelib_h.C_POINTER; + public static final MemorySegment SEGMENT = somelib_h.findOrThrow("__stdoutp").reinterpret(LAYOUT.byteSize()); } /** - * Function descriptor for: + * Layout for variable: * {@snippet lang=c : - * int fgetpos(FILE *restrict, fpos_t *) + * extern FILE *__stdoutp * } */ - public static FunctionDescriptor fgetpos$descriptor() { - return fgetpos.DESC; + public static AddressLayout __stdoutp$layout() { + return __stdoutp$constants.LAYOUT; } /** - * Downcall method handle for: + * Segment for variable: * {@snippet lang=c : - * int fgetpos(FILE *restrict, fpos_t *) + * extern FILE *__stdoutp * } */ - public static MethodHandle fgetpos$handle() { - return fgetpos.HANDLE; + public static MemorySegment __stdoutp$segment() { + return __stdoutp$constants.SEGMENT; } /** - * Address for: + * Getter for variable: * {@snippet lang=c : - * int fgetpos(FILE *restrict, fpos_t *) + * extern FILE *__stdoutp * } */ - public static MemorySegment fgetpos$address() { - return fgetpos.ADDR; + public static MemorySegment __stdoutp() { + return __stdoutp$constants.SEGMENT.get(__stdoutp$constants.LAYOUT, 0L); } /** + * Setter for variable: * {@snippet lang=c : - * int fgetpos(FILE *restrict, fpos_t *) + * extern FILE *__stdoutp * } */ - public static int fgetpos(MemorySegment x0, MemorySegment x1) { - var mh$ = fgetpos.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("fgetpos", x0, x1); - } - return (int)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } + public static void __stdoutp(MemorySegment varValue) { + __stdoutp$constants.SEGMENT.set(__stdoutp$constants.LAYOUT, 0L, varValue); } - private static class fgets { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("fgets"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + private static class __stderrp$constants { + public static final AddressLayout LAYOUT = somelib_h.C_POINTER; + public static final MemorySegment SEGMENT = somelib_h.findOrThrow("__stderrp").reinterpret(LAYOUT.byteSize()); } /** - * Function descriptor for: + * Layout for variable: * {@snippet lang=c : - * char *fgets(char *restrict, int, FILE *) + * extern FILE *__stderrp * } */ - public static FunctionDescriptor fgets$descriptor() { - return fgets.DESC; + public static AddressLayout __stderrp$layout() { + return __stderrp$constants.LAYOUT; } /** - * Downcall method handle for: + * Segment for variable: * {@snippet lang=c : - * char *fgets(char *restrict, int, FILE *) + * extern FILE *__stderrp * } */ - public static MethodHandle fgets$handle() { - return fgets.HANDLE; + public static MemorySegment __stderrp$segment() { + return __stderrp$constants.SEGMENT; } /** - * Address for: + * Getter for variable: * {@snippet lang=c : - * char *fgets(char *restrict, int, FILE *) + * extern FILE *__stderrp * } */ - public static MemorySegment fgets$address() { - return fgets.ADDR; + public static MemorySegment __stderrp() { + return __stderrp$constants.SEGMENT.get(__stderrp$constants.LAYOUT, 0L); } /** + * Setter for variable: * {@snippet lang=c : - * char *fgets(char *restrict, int, FILE *) + * extern FILE *__stderrp * } */ - public static MemorySegment fgets(MemorySegment x0, int x1, MemorySegment x2) { - var mh$ = fgets.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("fgets", x0, x1, x2); - } - return (MemorySegment)mh$.invokeExact(x0, x1, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } + public static void __stderrp(MemorySegment varValue) { + __stderrp$constants.SEGMENT.set(__stderrp$constants.LAYOUT, 0L, varValue); } - private static class fopen { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, + private static class clearerr { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("fopen"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("clearerr"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4545,131 +4585,57 @@ private static class fopen { /** * Function descriptor for: * {@snippet lang=c : - * FILE *fopen(const char *restrict __filename, const char *restrict __mode) + * void clearerr(FILE *) * } */ - public static FunctionDescriptor fopen$descriptor() { - return fopen.DESC; + public static FunctionDescriptor clearerr$descriptor() { + return clearerr.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * FILE *fopen(const char *restrict __filename, const char *restrict __mode) + * void clearerr(FILE *) * } */ - public static MethodHandle fopen$handle() { - return fopen.HANDLE; + public static MethodHandle clearerr$handle() { + return clearerr.HANDLE; } /** * Address for: * {@snippet lang=c : - * FILE *fopen(const char *restrict __filename, const char *restrict __mode) + * void clearerr(FILE *) * } */ - public static MemorySegment fopen$address() { - return fopen.ADDR; + public static MemorySegment clearerr$address() { + return clearerr.ADDR; } /** * {@snippet lang=c : - * FILE *fopen(const char *restrict __filename, const char *restrict __mode) + * void clearerr(FILE *) * } */ - public static MemorySegment fopen(MemorySegment __filename, MemorySegment __mode) { - var mh$ = fopen.HANDLE; + public static void clearerr(MemorySegment x0) { + var mh$ = clearerr.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("fopen", __filename, __mode); + traceDowncall("clearerr", x0); } - return (MemorySegment)mh$.invokeExact(__filename, __mode); + mh$.invokeExact(x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - /** - * Variadic invoker class for: - * {@snippet lang=c : - * int fprintf(FILE *restrict, const char *restrict, ...) - * } - */ - public static class fprintf { - private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("fprintf"); - - private final MethodHandle handle; - private final FunctionDescriptor descriptor; - private final MethodHandle spreader; - - private fprintf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { - this.handle = handle; - this.descriptor = descriptor; - this.spreader = spreader; - } - - /** - * Variadic invoker factory for: - * {@snippet lang=c : - * int fprintf(FILE *restrict, const char *restrict, ...) - * } - */ - public static fprintf makeInvoker(MemoryLayout... layouts) { - FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); - Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); - var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); - var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new fprintf(mh$, desc$, spreader$); - } - - /** - * {@return the address} - */ - public static MemorySegment address() { - return ADDR; - } - - /** - * {@return the specialized method handle} - */ - public MethodHandle handle() { - return handle; - } - - /** - * {@return the specialized descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } - - public int apply(MemorySegment x0, MemorySegment x1, Object... x2) { - try { - if (TRACE_DOWNCALLS) { - traceDowncall("fprintf", x0, x1, x2); - } - return (int)spreader.invokeExact(x0, x1, x2); - } catch(IllegalArgumentException | ClassCastException ex$) { - throw ex$; // rethrow IAE from passing wrong number/type of args - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - } - - private static class fputc { + private static class fclose { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, somelib_h.C_INT, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("fputc"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fclose"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4677,58 +4643,57 @@ private static class fputc { /** * Function descriptor for: * {@snippet lang=c : - * int fputc(int, FILE *) + * int fclose(FILE *) * } */ - public static FunctionDescriptor fputc$descriptor() { - return fputc.DESC; + public static FunctionDescriptor fclose$descriptor() { + return fclose.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int fputc(int, FILE *) + * int fclose(FILE *) * } */ - public static MethodHandle fputc$handle() { - return fputc.HANDLE; + public static MethodHandle fclose$handle() { + return fclose.HANDLE; } /** * Address for: * {@snippet lang=c : - * int fputc(int, FILE *) + * int fclose(FILE *) * } */ - public static MemorySegment fputc$address() { - return fputc.ADDR; + public static MemorySegment fclose$address() { + return fclose.ADDR; } /** * {@snippet lang=c : - * int fputc(int, FILE *) + * int fclose(FILE *) * } */ - public static int fputc(int x0, MemorySegment x1) { - var mh$ = fputc.HANDLE; + public static int fclose(MemorySegment x0) { + var mh$ = fclose.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("fputc", x0, x1); + traceDowncall("fclose", x0); } - return (int)mh$.invokeExact(x0, x1); + return (int)mh$.invokeExact(x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class fputs { + private static class feof { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_INT, - somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("fputs"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("feof"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4736,60 +4701,57 @@ private static class fputs { /** * Function descriptor for: * {@snippet lang=c : - * int fputs(const char *restrict, FILE *restrict) + * int feof(FILE *) * } */ - public static FunctionDescriptor fputs$descriptor() { - return fputs.DESC; + public static FunctionDescriptor feof$descriptor() { + return feof.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int fputs(const char *restrict, FILE *restrict) + * int feof(FILE *) * } */ - public static MethodHandle fputs$handle() { - return fputs.HANDLE; + public static MethodHandle feof$handle() { + return feof.HANDLE; } /** * Address for: * {@snippet lang=c : - * int fputs(const char *restrict, FILE *restrict) + * int feof(FILE *) * } */ - public static MemorySegment fputs$address() { - return fputs.ADDR; + public static MemorySegment feof$address() { + return feof.ADDR; } /** * {@snippet lang=c : - * int fputs(const char *restrict, FILE *restrict) + * int feof(FILE *) * } */ - public static int fputs(MemorySegment x0, MemorySegment x1) { - var mh$ = fputs.HANDLE; + public static int feof(MemorySegment x0) { + var mh$ = feof.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("fputs", x0, x1); + traceDowncall("feof", x0); } - return (int)mh$.invokeExact(x0, x1); + return (int)mh$.invokeExact(x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class fread { + private static class ferror { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_LONG, - somelib_h.C_POINTER, - somelib_h.C_LONG, - somelib_h.C_LONG, + somelib_h.C_INT, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("fread"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("ferror"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4797,59 +4759,57 @@ private static class fread { /** * Function descriptor for: * {@snippet lang=c : - * unsigned long fread(void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) + * int ferror(FILE *) * } */ - public static FunctionDescriptor fread$descriptor() { - return fread.DESC; + public static FunctionDescriptor ferror$descriptor() { + return ferror.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * unsigned long fread(void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) + * int ferror(FILE *) * } */ - public static MethodHandle fread$handle() { - return fread.HANDLE; + public static MethodHandle ferror$handle() { + return ferror.HANDLE; } /** * Address for: * {@snippet lang=c : - * unsigned long fread(void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) + * int ferror(FILE *) * } */ - public static MemorySegment fread$address() { - return fread.ADDR; + public static MemorySegment ferror$address() { + return ferror.ADDR; } /** * {@snippet lang=c : - * unsigned long fread(void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) + * int ferror(FILE *) * } */ - public static long fread(MemorySegment __ptr, long __size, long __nitems, MemorySegment __stream) { - var mh$ = fread.HANDLE; + public static int ferror(MemorySegment x0) { + var mh$ = ferror.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("fread", __ptr, __size, __nitems, __stream); + traceDowncall("ferror", x0); } - return (long)mh$.invokeExact(__ptr, __size, __nitems, __stream); + return (int)mh$.invokeExact(x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class freopen { + private static class fflush { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, + somelib_h.C_INT, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("freopen"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fflush"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4857,132 +4817,57 @@ private static class freopen { /** * Function descriptor for: * {@snippet lang=c : - * FILE *freopen(const char *restrict, const char *restrict, FILE *restrict) + * int fflush(FILE *) * } */ - public static FunctionDescriptor freopen$descriptor() { - return freopen.DESC; + public static FunctionDescriptor fflush$descriptor() { + return fflush.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * FILE *freopen(const char *restrict, const char *restrict, FILE *restrict) + * int fflush(FILE *) * } */ - public static MethodHandle freopen$handle() { - return freopen.HANDLE; + public static MethodHandle fflush$handle() { + return fflush.HANDLE; } /** * Address for: * {@snippet lang=c : - * FILE *freopen(const char *restrict, const char *restrict, FILE *restrict) + * int fflush(FILE *) * } */ - public static MemorySegment freopen$address() { - return freopen.ADDR; + public static MemorySegment fflush$address() { + return fflush.ADDR; } /** * {@snippet lang=c : - * FILE *freopen(const char *restrict, const char *restrict, FILE *restrict) + * int fflush(FILE *) * } */ - public static MemorySegment freopen(MemorySegment x0, MemorySegment x1, MemorySegment x2) { - var mh$ = freopen.HANDLE; + public static int fflush(MemorySegment x0) { + var mh$ = fflush.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("freopen", x0, x1, x2); + traceDowncall("fflush", x0); } - return (MemorySegment)mh$.invokeExact(x0, x1, x2); + return (int)mh$.invokeExact(x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - /** - * Variadic invoker class for: - * {@snippet lang=c : - * int fscanf(FILE *restrict, const char *restrict, ...) - * } - */ - public static class fscanf { - private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("fscanf"); - - private final MethodHandle handle; - private final FunctionDescriptor descriptor; - private final MethodHandle spreader; - - private fscanf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { - this.handle = handle; - this.descriptor = descriptor; - this.spreader = spreader; - } - - /** - * Variadic invoker factory for: - * {@snippet lang=c : - * int fscanf(FILE *restrict, const char *restrict, ...) - * } - */ - public static fscanf makeInvoker(MemoryLayout... layouts) { - FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); - Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); - var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); - var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new fscanf(mh$, desc$, spreader$); - } - - /** - * {@return the address} - */ - public static MemorySegment address() { - return ADDR; - } - - /** - * {@return the specialized method handle} - */ - public MethodHandle handle() { - return handle; - } - - /** - * {@return the specialized descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } - - public int apply(MemorySegment x0, MemorySegment x1, Object... x2) { - try { - if (TRACE_DOWNCALLS) { - traceDowncall("fscanf", x0, x1, x2); - } - return (int)spreader.invokeExact(x0, x1, x2); - } catch(IllegalArgumentException | ClassCastException ex$) { - throw ex$; // rethrow IAE from passing wrong number/type of args - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - } - - private static class fseek { + private static class fgetc { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_LONG, - somelib_h.C_INT + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("fseek"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fgetc"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4990,58 +4875,58 @@ private static class fseek { /** * Function descriptor for: * {@snippet lang=c : - * int fseek(FILE *, long, int) + * int fgetc(FILE *) * } */ - public static FunctionDescriptor fseek$descriptor() { - return fseek.DESC; + public static FunctionDescriptor fgetc$descriptor() { + return fgetc.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int fseek(FILE *, long, int) + * int fgetc(FILE *) * } */ - public static MethodHandle fseek$handle() { - return fseek.HANDLE; + public static MethodHandle fgetc$handle() { + return fgetc.HANDLE; } /** * Address for: * {@snippet lang=c : - * int fseek(FILE *, long, int) + * int fgetc(FILE *) * } */ - public static MemorySegment fseek$address() { - return fseek.ADDR; + public static MemorySegment fgetc$address() { + return fgetc.ADDR; } /** * {@snippet lang=c : - * int fseek(FILE *, long, int) + * int fgetc(FILE *) * } */ - public static int fseek(MemorySegment x0, long x1, int x2) { - var mh$ = fseek.HANDLE; + public static int fgetc(MemorySegment x0) { + var mh$ = fgetc.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("fseek", x0, x1, x2); + traceDowncall("fgetc", x0); } - return (int)mh$.invokeExact(x0, x1, x2); + return (int)mh$.invokeExact(x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class fsetpos { + private static class fgetpos { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_INT, somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("fsetpos"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fgetpos"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -5049,43 +4934,43 @@ private static class fsetpos { /** * Function descriptor for: * {@snippet lang=c : - * int fsetpos(FILE *, const fpos_t *) + * int fgetpos(FILE *restrict, fpos_t *) * } */ - public static FunctionDescriptor fsetpos$descriptor() { - return fsetpos.DESC; + public static FunctionDescriptor fgetpos$descriptor() { + return fgetpos.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int fsetpos(FILE *, const fpos_t *) + * int fgetpos(FILE *restrict, fpos_t *) * } */ - public static MethodHandle fsetpos$handle() { - return fsetpos.HANDLE; + public static MethodHandle fgetpos$handle() { + return fgetpos.HANDLE; } /** * Address for: * {@snippet lang=c : - * int fsetpos(FILE *, const fpos_t *) + * int fgetpos(FILE *restrict, fpos_t *) * } */ - public static MemorySegment fsetpos$address() { - return fsetpos.ADDR; + public static MemorySegment fgetpos$address() { + return fgetpos.ADDR; } /** * {@snippet lang=c : - * int fsetpos(FILE *, const fpos_t *) + * int fgetpos(FILE *restrict, fpos_t *) * } */ - public static int fsetpos(MemorySegment x0, MemorySegment x1) { - var mh$ = fsetpos.HANDLE; + public static int fgetpos(MemorySegment x0, MemorySegment x1) { + var mh$ = fgetpos.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("fsetpos", x0, x1); + traceDowncall("fgetpos", x0, x1); } return (int)mh$.invokeExact(x0, x1); } catch (Throwable ex$) { @@ -5093,13 +4978,15 @@ public static int fsetpos(MemorySegment x0, MemorySegment x1) { } } - private static class ftell { + private static class fgets { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_LONG, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_INT, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("ftell"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fgets"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -5107,60 +4994,58 @@ private static class ftell { /** * Function descriptor for: * {@snippet lang=c : - * long ftell(FILE *) + * char *fgets(char *restrict, int, FILE *) * } */ - public static FunctionDescriptor ftell$descriptor() { - return ftell.DESC; + public static FunctionDescriptor fgets$descriptor() { + return fgets.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * long ftell(FILE *) + * char *fgets(char *restrict, int, FILE *) * } */ - public static MethodHandle ftell$handle() { - return ftell.HANDLE; + public static MethodHandle fgets$handle() { + return fgets.HANDLE; } /** * Address for: * {@snippet lang=c : - * long ftell(FILE *) + * char *fgets(char *restrict, int, FILE *) * } */ - public static MemorySegment ftell$address() { - return ftell.ADDR; + public static MemorySegment fgets$address() { + return fgets.ADDR; } /** * {@snippet lang=c : - * long ftell(FILE *) + * char *fgets(char *restrict, int, FILE *) * } */ - public static long ftell(MemorySegment x0) { - var mh$ = ftell.HANDLE; + public static MemorySegment fgets(MemorySegment x0, int x1, MemorySegment x2) { + var mh$ = fgets.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("ftell", x0); + traceDowncall("fgets", x0, x1, x2); } - return (long)mh$.invokeExact(x0); + return (MemorySegment)mh$.invokeExact(x0, x1, x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class fwrite { + private static class fopen { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_LONG, somelib_h.C_POINTER, - somelib_h.C_LONG, - somelib_h.C_LONG, + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("fwrite"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fopen"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -5168,57 +5053,131 @@ private static class fwrite { /** * Function descriptor for: * {@snippet lang=c : - * unsigned long fwrite(const void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) + * FILE *fopen(const char *restrict __filename, const char *restrict __mode) * } */ - public static FunctionDescriptor fwrite$descriptor() { - return fwrite.DESC; + public static FunctionDescriptor fopen$descriptor() { + return fopen.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * unsigned long fwrite(const void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) + * FILE *fopen(const char *restrict __filename, const char *restrict __mode) * } */ - public static MethodHandle fwrite$handle() { - return fwrite.HANDLE; + public static MethodHandle fopen$handle() { + return fopen.HANDLE; } /** * Address for: * {@snippet lang=c : - * unsigned long fwrite(const void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) + * FILE *fopen(const char *restrict __filename, const char *restrict __mode) * } */ - public static MemorySegment fwrite$address() { - return fwrite.ADDR; + public static MemorySegment fopen$address() { + return fopen.ADDR; } /** * {@snippet lang=c : - * unsigned long fwrite(const void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) + * FILE *fopen(const char *restrict __filename, const char *restrict __mode) * } */ - public static long fwrite(MemorySegment __ptr, long __size, long __nitems, MemorySegment __stream) { - var mh$ = fwrite.HANDLE; + public static MemorySegment fopen(MemorySegment __filename, MemorySegment __mode) { + var mh$ = fopen.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("fwrite", __ptr, __size, __nitems, __stream); + traceDowncall("fopen", __filename, __mode); } - return (long)mh$.invokeExact(__ptr, __size, __nitems, __stream); + return (MemorySegment)mh$.invokeExact(__filename, __mode); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class getc { + /** + * Variadic invoker class for: + * {@snippet lang=c : + * int fprintf(FILE *restrict, const char *restrict, ...) + * } + */ + public static class fprintf { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("fprintf"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private fprintf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * int fprintf(FILE *restrict, const char *restrict, ...) + * } + */ + public static fprintf makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new fprintf(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public int apply(MemorySegment x0, MemorySegment x1, Object... x2) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fprintf", x0, x1, x2); + } + return (int)spreader.invokeExact(x0, x1, x2); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static class fputc { public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, somelib_h.C_INT, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("getc"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fputc"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -5226,55 +5185,58 @@ private static class getc { /** * Function descriptor for: * {@snippet lang=c : - * int getc(FILE *) + * int fputc(int, FILE *) * } */ - public static FunctionDescriptor getc$descriptor() { - return getc.DESC; + public static FunctionDescriptor fputc$descriptor() { + return fputc.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int getc(FILE *) + * int fputc(int, FILE *) * } */ - public static MethodHandle getc$handle() { - return getc.HANDLE; + public static MethodHandle fputc$handle() { + return fputc.HANDLE; } /** * Address for: * {@snippet lang=c : - * int getc(FILE *) + * int fputc(int, FILE *) * } */ - public static MemorySegment getc$address() { - return getc.ADDR; + public static MemorySegment fputc$address() { + return fputc.ADDR; } /** * {@snippet lang=c : - * int getc(FILE *) + * int fputc(int, FILE *) * } */ - public static int getc(MemorySegment x0) { - var mh$ = getc.HANDLE; + public static int fputc(int x0, MemorySegment x1) { + var mh$ = fputc.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("getc", x0); + traceDowncall("fputc", x0, x1); } - return (int)mh$.invokeExact(x0); + return (int)mh$.invokeExact(x0, x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class getchar { + private static class fputs { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT ); + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("getchar"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fputs"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -5282,57 +5244,60 @@ private static class getchar { /** * Function descriptor for: * {@snippet lang=c : - * int getchar() + * int fputs(const char *restrict, FILE *restrict) * } */ - public static FunctionDescriptor getchar$descriptor() { - return getchar.DESC; + public static FunctionDescriptor fputs$descriptor() { + return fputs.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int getchar() + * int fputs(const char *restrict, FILE *restrict) * } */ - public static MethodHandle getchar$handle() { - return getchar.HANDLE; + public static MethodHandle fputs$handle() { + return fputs.HANDLE; } /** * Address for: * {@snippet lang=c : - * int getchar() + * int fputs(const char *restrict, FILE *restrict) * } */ - public static MemorySegment getchar$address() { - return getchar.ADDR; + public static MemorySegment fputs$address() { + return fputs.ADDR; } /** * {@snippet lang=c : - * int getchar() + * int fputs(const char *restrict, FILE *restrict) * } */ - public static int getchar() { - var mh$ = getchar.HANDLE; + public static int fputs(MemorySegment x0, MemorySegment x1) { + var mh$ = fputs.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("getchar"); + traceDowncall("fputs", x0, x1); } - return (int)mh$.invokeExact(); + return (int)mh$.invokeExact(x0, x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class gets { + private static class fread { public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_LONG, somelib_h.C_POINTER, + somelib_h.C_LONG, + somelib_h.C_LONG, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("gets"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fread"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -5340,56 +5305,59 @@ private static class gets { /** * Function descriptor for: * {@snippet lang=c : - * char *gets(char *) + * unsigned long fread(void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) * } */ - public static FunctionDescriptor gets$descriptor() { - return gets.DESC; + public static FunctionDescriptor fread$descriptor() { + return fread.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * char *gets(char *) + * unsigned long fread(void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) * } */ - public static MethodHandle gets$handle() { - return gets.HANDLE; + public static MethodHandle fread$handle() { + return fread.HANDLE; } /** * Address for: * {@snippet lang=c : - * char *gets(char *) + * unsigned long fread(void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) * } */ - public static MemorySegment gets$address() { - return gets.ADDR; + public static MemorySegment fread$address() { + return fread.ADDR; } /** * {@snippet lang=c : - * char *gets(char *) + * unsigned long fread(void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) * } */ - public static MemorySegment gets(MemorySegment x0) { - var mh$ = gets.HANDLE; + public static long fread(MemorySegment __ptr, long __size, long __nitems, MemorySegment __stream) { + var mh$ = fread.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("gets", x0); + traceDowncall("fread", __ptr, __size, __nitems, __stream); } - return (MemorySegment)mh$.invokeExact(x0); + return (long)mh$.invokeExact(__ptr, __size, __nitems, __stream); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class perror { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class freopen { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("perror"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("freopen"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -5397,45 +5365,45 @@ private static class perror { /** * Function descriptor for: * {@snippet lang=c : - * void perror(const char *) + * FILE *freopen(const char *restrict, const char *restrict, FILE *restrict) * } */ - public static FunctionDescriptor perror$descriptor() { - return perror.DESC; + public static FunctionDescriptor freopen$descriptor() { + return freopen.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void perror(const char *) + * FILE *freopen(const char *restrict, const char *restrict, FILE *restrict) * } */ - public static MethodHandle perror$handle() { - return perror.HANDLE; + public static MethodHandle freopen$handle() { + return freopen.HANDLE; } /** * Address for: * {@snippet lang=c : - * void perror(const char *) + * FILE *freopen(const char *restrict, const char *restrict, FILE *restrict) * } */ - public static MemorySegment perror$address() { - return perror.ADDR; + public static MemorySegment freopen$address() { + return freopen.ADDR; } /** * {@snippet lang=c : - * void perror(const char *) + * FILE *freopen(const char *restrict, const char *restrict, FILE *restrict) * } */ - public static void perror(MemorySegment x0) { - var mh$ = perror.HANDLE; + public static MemorySegment freopen(MemorySegment x0, MemorySegment x1, MemorySegment x2) { + var mh$ = freopen.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("perror", x0); + traceDowncall("freopen", x0, x1, x2); } - mh$.invokeExact(x0); + return (MemorySegment)mh$.invokeExact(x0, x1, x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -5444,21 +5412,22 @@ public static void perror(MemorySegment x0) { /** * Variadic invoker class for: * {@snippet lang=c : - * int printf(const char *restrict, ...) + * int fscanf(FILE *restrict, const char *restrict, ...) * } */ - public static class printf { + public static class fscanf { private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( somelib_h.C_INT, + somelib_h.C_POINTER, somelib_h.C_POINTER ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("printf"); + private static final MemorySegment ADDR = somelib_h.findOrThrow("fscanf"); private final MethodHandle handle; private final FunctionDescriptor descriptor; private final MethodHandle spreader; - private printf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + private fscanf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { this.handle = handle; this.descriptor = descriptor; this.spreader = spreader; @@ -5467,15 +5436,15 @@ private printf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle /** * Variadic invoker factory for: * {@snippet lang=c : - * int printf(const char *restrict, ...) + * int fscanf(FILE *restrict, const char *restrict, ...) * } */ - public static printf makeInvoker(MemoryLayout... layouts) { + public static fscanf makeInvoker(MemoryLayout... layouts) { FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new printf(mh$, desc$, spreader$); + return new fscanf(mh$, desc$, spreader$); } /** @@ -5499,12 +5468,12 @@ public FunctionDescriptor descriptor() { return descriptor; } - public int apply(MemorySegment x0, Object... x1) { + public int apply(MemorySegment x0, MemorySegment x1, Object... x2) { try { if (TRACE_DOWNCALLS) { - traceDowncall("printf", x0, x1); + traceDowncall("fscanf", x0, x1, x2); } - return (int)spreader.invokeExact(x0, x1); + return (int)spreader.invokeExact(x0, x1, x2); } catch(IllegalArgumentException | ClassCastException ex$) { throw ex$; // rethrow IAE from passing wrong number/type of args } catch (Throwable ex$) { @@ -5513,14 +5482,15 @@ public int apply(MemorySegment x0, Object... x1) { } } - private static class putc { + private static class fseek { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_INT, - somelib_h.C_INT, - somelib_h.C_POINTER + somelib_h.C_POINTER, + somelib_h.C_LONG, + somelib_h.C_INT ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("putc"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fseek"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -5528,57 +5498,58 @@ private static class putc { /** * Function descriptor for: * {@snippet lang=c : - * int putc(int, FILE *) + * int fseek(FILE *, long, int) * } */ - public static FunctionDescriptor putc$descriptor() { - return putc.DESC; + public static FunctionDescriptor fseek$descriptor() { + return fseek.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int putc(int, FILE *) + * int fseek(FILE *, long, int) * } */ - public static MethodHandle putc$handle() { - return putc.HANDLE; + public static MethodHandle fseek$handle() { + return fseek.HANDLE; } /** * Address for: * {@snippet lang=c : - * int putc(int, FILE *) + * int fseek(FILE *, long, int) * } */ - public static MemorySegment putc$address() { - return putc.ADDR; + public static MemorySegment fseek$address() { + return fseek.ADDR; } /** * {@snippet lang=c : - * int putc(int, FILE *) + * int fseek(FILE *, long, int) * } */ - public static int putc(int x0, MemorySegment x1) { - var mh$ = putc.HANDLE; + public static int fseek(MemorySegment x0, long x1, int x2) { + var mh$ = fseek.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("putc", x0, x1); + traceDowncall("fseek", x0, x1, x2); } - return (int)mh$.invokeExact(x0, x1); + return (int)mh$.invokeExact(x0, x1, x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class putchar { + private static class fsetpos { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_INT, - somelib_h.C_INT + somelib_h.C_POINTER, + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("putchar"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fsetpos"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -5586,57 +5557,57 @@ private static class putchar { /** * Function descriptor for: * {@snippet lang=c : - * int putchar(int) + * int fsetpos(FILE *, const fpos_t *) * } */ - public static FunctionDescriptor putchar$descriptor() { - return putchar.DESC; + public static FunctionDescriptor fsetpos$descriptor() { + return fsetpos.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int putchar(int) + * int fsetpos(FILE *, const fpos_t *) * } */ - public static MethodHandle putchar$handle() { - return putchar.HANDLE; + public static MethodHandle fsetpos$handle() { + return fsetpos.HANDLE; } /** * Address for: * {@snippet lang=c : - * int putchar(int) + * int fsetpos(FILE *, const fpos_t *) * } */ - public static MemorySegment putchar$address() { - return putchar.ADDR; + public static MemorySegment fsetpos$address() { + return fsetpos.ADDR; } /** * {@snippet lang=c : - * int putchar(int) + * int fsetpos(FILE *, const fpos_t *) * } */ - public static int putchar(int x0) { - var mh$ = putchar.HANDLE; + public static int fsetpos(MemorySegment x0, MemorySegment x1) { + var mh$ = fsetpos.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("putchar", x0); + traceDowncall("fsetpos", x0, x1); } - return (int)mh$.invokeExact(x0); + return (int)mh$.invokeExact(x0, x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class puts { + private static class ftell { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, + somelib_h.C_LONG, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("puts"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("ftell"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -5644,57 +5615,60 @@ private static class puts { /** * Function descriptor for: * {@snippet lang=c : - * int puts(const char *) + * long ftell(FILE *) * } */ - public static FunctionDescriptor puts$descriptor() { - return puts.DESC; + public static FunctionDescriptor ftell$descriptor() { + return ftell.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int puts(const char *) + * long ftell(FILE *) * } */ - public static MethodHandle puts$handle() { - return puts.HANDLE; + public static MethodHandle ftell$handle() { + return ftell.HANDLE; } /** * Address for: * {@snippet lang=c : - * int puts(const char *) + * long ftell(FILE *) * } */ - public static MemorySegment puts$address() { - return puts.ADDR; + public static MemorySegment ftell$address() { + return ftell.ADDR; } /** * {@snippet lang=c : - * int puts(const char *) + * long ftell(FILE *) * } */ - public static int puts(MemorySegment x0) { - var mh$ = puts.HANDLE; + public static long ftell(MemorySegment x0) { + var mh$ = ftell.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("puts", x0); + traceDowncall("ftell", x0); } - return (int)mh$.invokeExact(x0); + return (long)mh$.invokeExact(x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class remove { + private static class fwrite { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, + somelib_h.C_LONG, + somelib_h.C_POINTER, + somelib_h.C_LONG, + somelib_h.C_LONG, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("remove"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fwrite"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -5702,58 +5676,57 @@ private static class remove { /** * Function descriptor for: * {@snippet lang=c : - * int remove(const char *) + * unsigned long fwrite(const void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) * } */ - public static FunctionDescriptor remove$descriptor() { - return remove.DESC; + public static FunctionDescriptor fwrite$descriptor() { + return fwrite.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int remove(const char *) + * unsigned long fwrite(const void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) * } */ - public static MethodHandle remove$handle() { - return remove.HANDLE; + public static MethodHandle fwrite$handle() { + return fwrite.HANDLE; } /** * Address for: * {@snippet lang=c : - * int remove(const char *) + * unsigned long fwrite(const void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) * } */ - public static MemorySegment remove$address() { - return remove.ADDR; + public static MemorySegment fwrite$address() { + return fwrite.ADDR; } /** * {@snippet lang=c : - * int remove(const char *) + * unsigned long fwrite(const void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) * } */ - public static int remove(MemorySegment x0) { - var mh$ = remove.HANDLE; + public static long fwrite(MemorySegment __ptr, long __size, long __nitems, MemorySegment __stream) { + var mh$ = fwrite.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("remove", x0); + traceDowncall("fwrite", __ptr, __size, __nitems, __stream); } - return (int)mh$.invokeExact(x0); + return (long)mh$.invokeExact(__ptr, __size, __nitems, __stream); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class rename { + private static class getc { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_INT, - somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("rename"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("getc"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -5761,56 +5734,55 @@ private static class rename { /** * Function descriptor for: * {@snippet lang=c : - * int rename(const char *__old, const char *__new) + * int getc(FILE *) * } */ - public static FunctionDescriptor rename$descriptor() { - return rename.DESC; + public static FunctionDescriptor getc$descriptor() { + return getc.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int rename(const char *__old, const char *__new) + * int getc(FILE *) * } */ - public static MethodHandle rename$handle() { - return rename.HANDLE; + public static MethodHandle getc$handle() { + return getc.HANDLE; } /** * Address for: * {@snippet lang=c : - * int rename(const char *__old, const char *__new) + * int getc(FILE *) * } */ - public static MemorySegment rename$address() { - return rename.ADDR; + public static MemorySegment getc$address() { + return getc.ADDR; } /** * {@snippet lang=c : - * int rename(const char *__old, const char *__new) + * int getc(FILE *) * } */ - public static int rename(MemorySegment __old, MemorySegment __new) { - var mh$ = rename.HANDLE; + public static int getc(MemorySegment x0) { + var mh$ = getc.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("rename", __old, __new); + traceDowncall("getc", x0); } - return (int)mh$.invokeExact(__old, __new); + return (int)mh$.invokeExact(x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class rewind { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER - ); + private static class getchar { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("rewind"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("getchar"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -5818,129 +5790,57 @@ private static class rewind { /** * Function descriptor for: * {@snippet lang=c : - * void rewind(FILE *) + * int getchar() * } */ - public static FunctionDescriptor rewind$descriptor() { - return rewind.DESC; + public static FunctionDescriptor getchar$descriptor() { + return getchar.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void rewind(FILE *) + * int getchar() * } */ - public static MethodHandle rewind$handle() { - return rewind.HANDLE; + public static MethodHandle getchar$handle() { + return getchar.HANDLE; } /** * Address for: * {@snippet lang=c : - * void rewind(FILE *) + * int getchar() * } */ - public static MemorySegment rewind$address() { - return rewind.ADDR; + public static MemorySegment getchar$address() { + return getchar.ADDR; } /** * {@snippet lang=c : - * void rewind(FILE *) + * int getchar() * } */ - public static void rewind(MemorySegment x0) { - var mh$ = rewind.HANDLE; + public static int getchar() { + var mh$ = getchar.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("rewind", x0); + traceDowncall("getchar"); } - mh$.invokeExact(x0); + return (int)mh$.invokeExact(); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - /** - * Variadic invoker class for: - * {@snippet lang=c : - * int scanf(const char *restrict, ...) - * } - */ - public static class scanf { - private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER - ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("scanf"); - - private final MethodHandle handle; - private final FunctionDescriptor descriptor; - private final MethodHandle spreader; - - private scanf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { - this.handle = handle; - this.descriptor = descriptor; - this.spreader = spreader; - } - - /** - * Variadic invoker factory for: - * {@snippet lang=c : - * int scanf(const char *restrict, ...) - * } - */ - public static scanf makeInvoker(MemoryLayout... layouts) { - FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); - Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); - var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); - var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new scanf(mh$, desc$, spreader$); - } - - /** - * {@return the address} - */ - public static MemorySegment address() { - return ADDR; - } - - /** - * {@return the specialized method handle} - */ - public MethodHandle handle() { - return handle; - } - - /** - * {@return the specialized descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } - - public int apply(MemorySegment x0, Object... x1) { - try { - if (TRACE_DOWNCALLS) { - traceDowncall("scanf", x0, x1); - } - return (int)spreader.invokeExact(x0, x1); - } catch(IllegalArgumentException | ClassCastException ex$) { - throw ex$; // rethrow IAE from passing wrong number/type of args - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - } - - private static class setbuf { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class gets { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("setbuf"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("gets"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -5948,60 +5848,56 @@ private static class setbuf { /** * Function descriptor for: * {@snippet lang=c : - * void setbuf(FILE *restrict, char *restrict) + * char *gets(char *) * } */ - public static FunctionDescriptor setbuf$descriptor() { - return setbuf.DESC; + public static FunctionDescriptor gets$descriptor() { + return gets.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void setbuf(FILE *restrict, char *restrict) + * char *gets(char *) * } */ - public static MethodHandle setbuf$handle() { - return setbuf.HANDLE; + public static MethodHandle gets$handle() { + return gets.HANDLE; } /** * Address for: * {@snippet lang=c : - * void setbuf(FILE *restrict, char *restrict) + * char *gets(char *) * } */ - public static MemorySegment setbuf$address() { - return setbuf.ADDR; + public static MemorySegment gets$address() { + return gets.ADDR; } /** * {@snippet lang=c : - * void setbuf(FILE *restrict, char *restrict) + * char *gets(char *) * } */ - public static void setbuf(MemorySegment x0, MemorySegment x1) { - var mh$ = setbuf.HANDLE; + public static MemorySegment gets(MemorySegment x0) { + var mh$ = gets.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("setbuf", x0, x1); + traceDowncall("gets", x0); } - mh$.invokeExact(x0, x1); + return (MemorySegment)mh$.invokeExact(x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class setvbuf { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_INT, - somelib_h.C_LONG + private static class perror { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("setvbuf"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("perror"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -6009,45 +5905,45 @@ private static class setvbuf { /** * Function descriptor for: * {@snippet lang=c : - * int setvbuf(FILE *restrict, char *restrict, int, size_t) + * void perror(const char *) * } */ - public static FunctionDescriptor setvbuf$descriptor() { - return setvbuf.DESC; + public static FunctionDescriptor perror$descriptor() { + return perror.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int setvbuf(FILE *restrict, char *restrict, int, size_t) + * void perror(const char *) * } */ - public static MethodHandle setvbuf$handle() { - return setvbuf.HANDLE; + public static MethodHandle perror$handle() { + return perror.HANDLE; } /** * Address for: * {@snippet lang=c : - * int setvbuf(FILE *restrict, char *restrict, int, size_t) + * void perror(const char *) * } */ - public static MemorySegment setvbuf$address() { - return setvbuf.ADDR; + public static MemorySegment perror$address() { + return perror.ADDR; } /** * {@snippet lang=c : - * int setvbuf(FILE *restrict, char *restrict, int, size_t) + * void perror(const char *) * } */ - public static int setvbuf(MemorySegment x0, MemorySegment x1, int x2, long x3) { - var mh$ = setvbuf.HANDLE; + public static void perror(MemorySegment x0) { + var mh$ = perror.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("setvbuf", x0, x1, x2, x3); + traceDowncall("perror", x0); } - return (int)mh$.invokeExact(x0, x1, x2, x3); + mh$.invokeExact(x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -6056,95 +5952,21 @@ public static int setvbuf(MemorySegment x0, MemorySegment x1, int x2, long x3) { /** * Variadic invoker class for: * {@snippet lang=c : - * int sprintf(char *restrict, const char *restrict, ...) - * } - */ - public static class sprintf { - private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("sprintf"); - - private final MethodHandle handle; - private final FunctionDescriptor descriptor; - private final MethodHandle spreader; - - private sprintf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { - this.handle = handle; - this.descriptor = descriptor; - this.spreader = spreader; - } - - /** - * Variadic invoker factory for: - * {@snippet lang=c : - * int sprintf(char *restrict, const char *restrict, ...) - * } - */ - public static sprintf makeInvoker(MemoryLayout... layouts) { - FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); - Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); - var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); - var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new sprintf(mh$, desc$, spreader$); - } - - /** - * {@return the address} - */ - public static MemorySegment address() { - return ADDR; - } - - /** - * {@return the specialized method handle} - */ - public MethodHandle handle() { - return handle; - } - - /** - * {@return the specialized descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } - - public int apply(MemorySegment x0, MemorySegment x1, Object... x2) { - try { - if (TRACE_DOWNCALLS) { - traceDowncall("sprintf", x0, x1, x2); - } - return (int)spreader.invokeExact(x0, x1, x2); - } catch(IllegalArgumentException | ClassCastException ex$) { - throw ex$; // rethrow IAE from passing wrong number/type of args - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - } - - /** - * Variadic invoker class for: - * {@snippet lang=c : - * int sscanf(const char *restrict, const char *restrict, ...) + * int printf(const char *restrict, ...) * } */ - public static class sscanf { + public static class printf { private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( somelib_h.C_INT, - somelib_h.C_POINTER, somelib_h.C_POINTER ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("sscanf"); + private static final MemorySegment ADDR = somelib_h.findOrThrow("printf"); private final MethodHandle handle; private final FunctionDescriptor descriptor; private final MethodHandle spreader; - private sscanf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + private printf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { this.handle = handle; this.descriptor = descriptor; this.spreader = spreader; @@ -6153,15 +5975,15 @@ private sscanf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle /** * Variadic invoker factory for: * {@snippet lang=c : - * int sscanf(const char *restrict, const char *restrict, ...) + * int printf(const char *restrict, ...) * } */ - public static sscanf makeInvoker(MemoryLayout... layouts) { + public static printf makeInvoker(MemoryLayout... layouts) { FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new sscanf(mh$, desc$, spreader$); + return new printf(mh$, desc$, spreader$); } /** @@ -6185,12 +6007,12 @@ public FunctionDescriptor descriptor() { return descriptor; } - public int apply(MemorySegment x0, MemorySegment x1, Object... x2) { + public int apply(MemorySegment x0, Object... x1) { try { if (TRACE_DOWNCALLS) { - traceDowncall("sscanf", x0, x1, x2); + traceDowncall("printf", x0, x1); } - return (int)spreader.invokeExact(x0, x1, x2); + return (int)spreader.invokeExact(x0, x1); } catch(IllegalArgumentException | ClassCastException ex$) { throw ex$; // rethrow IAE from passing wrong number/type of args } catch (Throwable ex$) { @@ -6199,11 +6021,14 @@ public int apply(MemorySegment x0, MemorySegment x1, Object... x2) { } } - private static class tmpfile { + private static class putc { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER ); + somelib_h.C_INT, + somelib_h.C_INT, + somelib_h.C_POINTER + ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("tmpfile"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("putc"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -6211,57 +6036,57 @@ private static class tmpfile { /** * Function descriptor for: * {@snippet lang=c : - * FILE *tmpfile() + * int putc(int, FILE *) * } */ - public static FunctionDescriptor tmpfile$descriptor() { - return tmpfile.DESC; + public static FunctionDescriptor putc$descriptor() { + return putc.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * FILE *tmpfile() + * int putc(int, FILE *) * } */ - public static MethodHandle tmpfile$handle() { - return tmpfile.HANDLE; + public static MethodHandle putc$handle() { + return putc.HANDLE; } /** * Address for: * {@snippet lang=c : - * FILE *tmpfile() + * int putc(int, FILE *) * } */ - public static MemorySegment tmpfile$address() { - return tmpfile.ADDR; + public static MemorySegment putc$address() { + return putc.ADDR; } /** * {@snippet lang=c : - * FILE *tmpfile() + * int putc(int, FILE *) * } */ - public static MemorySegment tmpfile() { - var mh$ = tmpfile.HANDLE; + public static int putc(int x0, MemorySegment x1) { + var mh$ = putc.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("tmpfile"); + traceDowncall("putc", x0, x1); } - return (MemorySegment)mh$.invokeExact(); + return (int)mh$.invokeExact(x0, x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class tmpnam { + private static class putchar { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER + somelib_h.C_INT, + somelib_h.C_INT ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("tmpnam"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("putchar"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -6269,58 +6094,57 @@ private static class tmpnam { /** * Function descriptor for: * {@snippet lang=c : - * char *tmpnam(char *) + * int putchar(int) * } */ - public static FunctionDescriptor tmpnam$descriptor() { - return tmpnam.DESC; + public static FunctionDescriptor putchar$descriptor() { + return putchar.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * char *tmpnam(char *) + * int putchar(int) * } */ - public static MethodHandle tmpnam$handle() { - return tmpnam.HANDLE; + public static MethodHandle putchar$handle() { + return putchar.HANDLE; } /** * Address for: * {@snippet lang=c : - * char *tmpnam(char *) + * int putchar(int) * } */ - public static MemorySegment tmpnam$address() { - return tmpnam.ADDR; + public static MemorySegment putchar$address() { + return putchar.ADDR; } /** * {@snippet lang=c : - * char *tmpnam(char *) + * int putchar(int) * } */ - public static MemorySegment tmpnam(MemorySegment x0) { - var mh$ = tmpnam.HANDLE; + public static int putchar(int x0) { + var mh$ = putchar.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("tmpnam", x0); + traceDowncall("putchar", x0); } - return (MemorySegment)mh$.invokeExact(x0); + return (int)mh$.invokeExact(x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class ungetc { + private static class puts { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, somelib_h.C_INT, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("ungetc"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("puts"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -6328,59 +6152,57 @@ private static class ungetc { /** * Function descriptor for: * {@snippet lang=c : - * int ungetc(int, FILE *) + * int puts(const char *) * } */ - public static FunctionDescriptor ungetc$descriptor() { - return ungetc.DESC; + public static FunctionDescriptor puts$descriptor() { + return puts.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int ungetc(int, FILE *) + * int puts(const char *) * } */ - public static MethodHandle ungetc$handle() { - return ungetc.HANDLE; + public static MethodHandle puts$handle() { + return puts.HANDLE; } /** * Address for: * {@snippet lang=c : - * int ungetc(int, FILE *) + * int puts(const char *) * } */ - public static MemorySegment ungetc$address() { - return ungetc.ADDR; + public static MemorySegment puts$address() { + return puts.ADDR; } /** * {@snippet lang=c : - * int ungetc(int, FILE *) + * int puts(const char *) * } */ - public static int ungetc(int x0, MemorySegment x1) { - var mh$ = ungetc.HANDLE; + public static int puts(MemorySegment x0) { + var mh$ = puts.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("ungetc", x0, x1); + traceDowncall("puts", x0); } - return (int)mh$.invokeExact(x0, x1); + return (int)mh$.invokeExact(x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class vfprintf { + private static class remove { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("vfprintf"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("remove"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -6388,58 +6210,58 @@ private static class vfprintf { /** * Function descriptor for: * {@snippet lang=c : - * int vfprintf(FILE *restrict, const char *restrict, va_list) + * int remove(const char *) * } */ - public static FunctionDescriptor vfprintf$descriptor() { - return vfprintf.DESC; + public static FunctionDescriptor remove$descriptor() { + return remove.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int vfprintf(FILE *restrict, const char *restrict, va_list) + * int remove(const char *) * } */ - public static MethodHandle vfprintf$handle() { - return vfprintf.HANDLE; + public static MethodHandle remove$handle() { + return remove.HANDLE; } /** * Address for: * {@snippet lang=c : - * int vfprintf(FILE *restrict, const char *restrict, va_list) + * int remove(const char *) * } */ - public static MemorySegment vfprintf$address() { - return vfprintf.ADDR; + public static MemorySegment remove$address() { + return remove.ADDR; } /** * {@snippet lang=c : - * int vfprintf(FILE *restrict, const char *restrict, va_list) + * int remove(const char *) * } */ - public static int vfprintf(MemorySegment x0, MemorySegment x1, MemorySegment x2) { - var mh$ = vfprintf.HANDLE; + public static int remove(MemorySegment x0) { + var mh$ = remove.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("vfprintf", x0, x1, x2); + traceDowncall("remove", x0); } - return (int)mh$.invokeExact(x0, x1, x2); + return (int)mh$.invokeExact(x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class vprintf { + private static class rename { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_INT, somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("vprintf"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("rename"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -6447,59 +6269,56 @@ private static class vprintf { /** * Function descriptor for: * {@snippet lang=c : - * int vprintf(const char *restrict, va_list) + * int rename(const char *__old, const char *__new) * } */ - public static FunctionDescriptor vprintf$descriptor() { - return vprintf.DESC; + public static FunctionDescriptor rename$descriptor() { + return rename.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int vprintf(const char *restrict, va_list) + * int rename(const char *__old, const char *__new) * } */ - public static MethodHandle vprintf$handle() { - return vprintf.HANDLE; + public static MethodHandle rename$handle() { + return rename.HANDLE; } /** * Address for: * {@snippet lang=c : - * int vprintf(const char *restrict, va_list) + * int rename(const char *__old, const char *__new) * } */ - public static MemorySegment vprintf$address() { - return vprintf.ADDR; + public static MemorySegment rename$address() { + return rename.ADDR; } /** * {@snippet lang=c : - * int vprintf(const char *restrict, va_list) + * int rename(const char *__old, const char *__new) * } */ - public static int vprintf(MemorySegment x0, MemorySegment x1) { - var mh$ = vprintf.HANDLE; + public static int rename(MemorySegment __old, MemorySegment __new) { + var mh$ = rename.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("vprintf", x0, x1); + traceDowncall("rename", __old, __new); } - return (int)mh$.invokeExact(x0, x1); + return (int)mh$.invokeExact(__old, __new); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class vsprintf { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_POINTER, + private static class rewind { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("vsprintf"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("rewind"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -6507,3288 +6326,129 @@ private static class vsprintf { /** * Function descriptor for: * {@snippet lang=c : - * int vsprintf(char *restrict, const char *restrict, va_list) + * void rewind(FILE *) * } */ - public static FunctionDescriptor vsprintf$descriptor() { - return vsprintf.DESC; + public static FunctionDescriptor rewind$descriptor() { + return rewind.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int vsprintf(char *restrict, const char *restrict, va_list) + * void rewind(FILE *) * } */ - public static MethodHandle vsprintf$handle() { - return vsprintf.HANDLE; + public static MethodHandle rewind$handle() { + return rewind.HANDLE; } /** * Address for: * {@snippet lang=c : - * int vsprintf(char *restrict, const char *restrict, va_list) + * void rewind(FILE *) * } */ - public static MemorySegment vsprintf$address() { - return vsprintf.ADDR; + public static MemorySegment rewind$address() { + return rewind.ADDR; } /** * {@snippet lang=c : - * int vsprintf(char *restrict, const char *restrict, va_list) + * void rewind(FILE *) * } */ - public static int vsprintf(MemorySegment x0, MemorySegment x1, MemorySegment x2) { - var mh$ = vsprintf.HANDLE; + public static void rewind(MemorySegment x0) { + var mh$ = rewind.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("vsprintf", x0, x1, x2); + traceDowncall("rewind", x0); } - return (int)mh$.invokeExact(x0, x1, x2); + mh$.invokeExact(x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class ctermid { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("ctermid"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * char *ctermid(char *) - * } - */ - public static FunctionDescriptor ctermid$descriptor() { - return ctermid.DESC; - } - /** - * Downcall method handle for: + * Variadic invoker class for: * {@snippet lang=c : - * char *ctermid(char *) + * int scanf(const char *restrict, ...) * } */ - public static MethodHandle ctermid$handle() { - return ctermid.HANDLE; - } + public static class scanf { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER + ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("scanf"); - /** - * Address for: - * {@snippet lang=c : - * char *ctermid(char *) - * } - */ - public static MemorySegment ctermid$address() { - return ctermid.ADDR; - } + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; - /** - * {@snippet lang=c : - * char *ctermid(char *) - * } - */ - public static MemorySegment ctermid(MemorySegment x0) { - var mh$ = ctermid.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("ctermid", x0); - } - return (MemorySegment)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); + private scanf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; } - } - private static class fdopen { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("fdopen"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * FILE *fdopen(int, const char *) - * } - */ - public static FunctionDescriptor fdopen$descriptor() { - return fdopen.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * FILE *fdopen(int, const char *) - * } - */ - public static MethodHandle fdopen$handle() { - return fdopen.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * FILE *fdopen(int, const char *) - * } - */ - public static MemorySegment fdopen$address() { - return fdopen.ADDR; - } - - /** - * {@snippet lang=c : - * FILE *fdopen(int, const char *) - * } - */ - public static MemorySegment fdopen(int x0, MemorySegment x1) { - var mh$ = fdopen.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("fdopen", x0, x1); - } - return (MemorySegment)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * int scanf(const char *restrict, ...) + * } + */ + public static scanf makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new scanf(mh$, desc$, spreader$); } - } - - private static class fileno { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("fileno"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int fileno(FILE *) - * } - */ - public static FunctionDescriptor fileno$descriptor() { - return fileno.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int fileno(FILE *) - * } - */ - public static MethodHandle fileno$handle() { - return fileno.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int fileno(FILE *) - * } - */ - public static MemorySegment fileno$address() { - return fileno.ADDR; - } - /** - * {@snippet lang=c : - * int fileno(FILE *) - * } - */ - public static int fileno(MemorySegment x0) { - var mh$ = fileno.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("fileno", x0); - } - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; } - } - - private static class pclose { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("pclose"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int pclose(FILE *) - * } - */ - public static FunctionDescriptor pclose$descriptor() { - return pclose.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int pclose(FILE *) - * } - */ - public static MethodHandle pclose$handle() { - return pclose.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int pclose(FILE *) - * } - */ - public static MemorySegment pclose$address() { - return pclose.ADDR; - } - /** - * {@snippet lang=c : - * int pclose(FILE *) - * } - */ - public static int pclose(MemorySegment x0) { - var mh$ = pclose.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("pclose", x0); - } - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; } - } - - private static class popen { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("popen"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * FILE *popen(const char *, const char *) - * } - */ - public static FunctionDescriptor popen$descriptor() { - return popen.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * FILE *popen(const char *, const char *) - * } - */ - public static MethodHandle popen$handle() { - return popen.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * FILE *popen(const char *, const char *) - * } - */ - public static MemorySegment popen$address() { - return popen.ADDR; - } - - /** - * {@snippet lang=c : - * FILE *popen(const char *, const char *) - * } - */ - public static MemorySegment popen(MemorySegment x0, MemorySegment x1) { - var mh$ = popen.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("popen", x0, x1); - } - return (MemorySegment)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; } - } - - private static class __srget { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("__srget"); - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int __srget(FILE *) - * } - */ - public static FunctionDescriptor __srget$descriptor() { - return __srget.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int __srget(FILE *) - * } - */ - public static MethodHandle __srget$handle() { - return __srget.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int __srget(FILE *) - * } - */ - public static MemorySegment __srget$address() { - return __srget.ADDR; - } - - /** - * {@snippet lang=c : - * int __srget(FILE *) - * } - */ - public static int __srget(MemorySegment x0) { - var mh$ = __srget.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("__srget", x0); - } - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class __svfscanf { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("__svfscanf"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int __svfscanf(FILE *, const char *, va_list) - * } - */ - public static FunctionDescriptor __svfscanf$descriptor() { - return __svfscanf.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int __svfscanf(FILE *, const char *, va_list) - * } - */ - public static MethodHandle __svfscanf$handle() { - return __svfscanf.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int __svfscanf(FILE *, const char *, va_list) - * } - */ - public static MemorySegment __svfscanf$address() { - return __svfscanf.ADDR; - } - - /** - * {@snippet lang=c : - * int __svfscanf(FILE *, const char *, va_list) - * } - */ - public static int __svfscanf(MemorySegment x0, MemorySegment x1, MemorySegment x2) { - var mh$ = __svfscanf.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("__svfscanf", x0, x1, x2); - } - return (int)mh$.invokeExact(x0, x1, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class __swbuf { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("__swbuf"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int __swbuf(int, FILE *) - * } - */ - public static FunctionDescriptor __swbuf$descriptor() { - return __swbuf.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int __swbuf(int, FILE *) - * } - */ - public static MethodHandle __swbuf$handle() { - return __swbuf.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int __swbuf(int, FILE *) - * } - */ - public static MemorySegment __swbuf$address() { - return __swbuf.ADDR; - } - - /** - * {@snippet lang=c : - * int __swbuf(int, FILE *) - * } - */ - public static int __swbuf(int x0, MemorySegment x1) { - var mh$ = __swbuf.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("__swbuf", x0, x1); - } - return (int)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class flockfile { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("flockfile"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * void flockfile(FILE *) - * } - */ - public static FunctionDescriptor flockfile$descriptor() { - return flockfile.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * void flockfile(FILE *) - * } - */ - public static MethodHandle flockfile$handle() { - return flockfile.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * void flockfile(FILE *) - * } - */ - public static MemorySegment flockfile$address() { - return flockfile.ADDR; - } - - /** - * {@snippet lang=c : - * void flockfile(FILE *) - * } - */ - public static void flockfile(MemorySegment x0) { - var mh$ = flockfile.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("flockfile", x0); - } - mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class ftrylockfile { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("ftrylockfile"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int ftrylockfile(FILE *) - * } - */ - public static FunctionDescriptor ftrylockfile$descriptor() { - return ftrylockfile.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int ftrylockfile(FILE *) - * } - */ - public static MethodHandle ftrylockfile$handle() { - return ftrylockfile.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int ftrylockfile(FILE *) - * } - */ - public static MemorySegment ftrylockfile$address() { - return ftrylockfile.ADDR; - } - - /** - * {@snippet lang=c : - * int ftrylockfile(FILE *) - * } - */ - public static int ftrylockfile(MemorySegment x0) { - var mh$ = ftrylockfile.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("ftrylockfile", x0); - } - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class funlockfile { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("funlockfile"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * void funlockfile(FILE *) - * } - */ - public static FunctionDescriptor funlockfile$descriptor() { - return funlockfile.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * void funlockfile(FILE *) - * } - */ - public static MethodHandle funlockfile$handle() { - return funlockfile.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * void funlockfile(FILE *) - * } - */ - public static MemorySegment funlockfile$address() { - return funlockfile.ADDR; - } - - /** - * {@snippet lang=c : - * void funlockfile(FILE *) - * } - */ - public static void funlockfile(MemorySegment x0) { - var mh$ = funlockfile.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("funlockfile", x0); - } - mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class getc_unlocked { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("getc_unlocked"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int getc_unlocked(FILE *) - * } - */ - public static FunctionDescriptor getc_unlocked$descriptor() { - return getc_unlocked.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int getc_unlocked(FILE *) - * } - */ - public static MethodHandle getc_unlocked$handle() { - return getc_unlocked.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int getc_unlocked(FILE *) - * } - */ - public static MemorySegment getc_unlocked$address() { - return getc_unlocked.ADDR; - } - - /** - * {@snippet lang=c : - * int getc_unlocked(FILE *) - * } - */ - public static int getc_unlocked(MemorySegment x0) { - var mh$ = getc_unlocked.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("getc_unlocked", x0); - } - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class getchar_unlocked { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("getchar_unlocked"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int getchar_unlocked() - * } - */ - public static FunctionDescriptor getchar_unlocked$descriptor() { - return getchar_unlocked.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int getchar_unlocked() - * } - */ - public static MethodHandle getchar_unlocked$handle() { - return getchar_unlocked.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int getchar_unlocked() - * } - */ - public static MemorySegment getchar_unlocked$address() { - return getchar_unlocked.ADDR; - } - - /** - * {@snippet lang=c : - * int getchar_unlocked() - * } - */ - public static int getchar_unlocked() { - var mh$ = getchar_unlocked.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("getchar_unlocked"); - } - return (int)mh$.invokeExact(); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class putc_unlocked { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("putc_unlocked"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int putc_unlocked(int, FILE *) - * } - */ - public static FunctionDescriptor putc_unlocked$descriptor() { - return putc_unlocked.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int putc_unlocked(int, FILE *) - * } - */ - public static MethodHandle putc_unlocked$handle() { - return putc_unlocked.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int putc_unlocked(int, FILE *) - * } - */ - public static MemorySegment putc_unlocked$address() { - return putc_unlocked.ADDR; - } - - /** - * {@snippet lang=c : - * int putc_unlocked(int, FILE *) - * } - */ - public static int putc_unlocked(int x0, MemorySegment x1) { - var mh$ = putc_unlocked.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("putc_unlocked", x0, x1); - } - return (int)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class putchar_unlocked { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_INT - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("putchar_unlocked"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int putchar_unlocked(int) - * } - */ - public static FunctionDescriptor putchar_unlocked$descriptor() { - return putchar_unlocked.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int putchar_unlocked(int) - * } - */ - public static MethodHandle putchar_unlocked$handle() { - return putchar_unlocked.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int putchar_unlocked(int) - * } - */ - public static MemorySegment putchar_unlocked$address() { - return putchar_unlocked.ADDR; - } - - /** - * {@snippet lang=c : - * int putchar_unlocked(int) - * } - */ - public static int putchar_unlocked(int x0) { - var mh$ = putchar_unlocked.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("putchar_unlocked", x0); - } - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class getw { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("getw"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int getw(FILE *) - * } - */ - public static FunctionDescriptor getw$descriptor() { - return getw.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int getw(FILE *) - * } - */ - public static MethodHandle getw$handle() { - return getw.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int getw(FILE *) - * } - */ - public static MemorySegment getw$address() { - return getw.ADDR; - } - - /** - * {@snippet lang=c : - * int getw(FILE *) - * } - */ - public static int getw(MemorySegment x0) { - var mh$ = getw.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("getw", x0); - } - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class putw { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("putw"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int putw(int, FILE *) - * } - */ - public static FunctionDescriptor putw$descriptor() { - return putw.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int putw(int, FILE *) - * } - */ - public static MethodHandle putw$handle() { - return putw.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int putw(int, FILE *) - * } - */ - public static MemorySegment putw$address() { - return putw.ADDR; - } - - /** - * {@snippet lang=c : - * int putw(int, FILE *) - * } - */ - public static int putw(int x0, MemorySegment x1) { - var mh$ = putw.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("putw", x0, x1); - } - return (int)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class tempnam { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("tempnam"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * char *tempnam(const char *__dir, const char *__prefix) - * } - */ - public static FunctionDescriptor tempnam$descriptor() { - return tempnam.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * char *tempnam(const char *__dir, const char *__prefix) - * } - */ - public static MethodHandle tempnam$handle() { - return tempnam.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * char *tempnam(const char *__dir, const char *__prefix) - * } - */ - public static MemorySegment tempnam$address() { - return tempnam.ADDR; - } - - /** - * {@snippet lang=c : - * char *tempnam(const char *__dir, const char *__prefix) - * } - */ - public static MemorySegment tempnam(MemorySegment __dir, MemorySegment __prefix) { - var mh$ = tempnam.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("tempnam", __dir, __prefix); - } - return (MemorySegment)mh$.invokeExact(__dir, __prefix); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - /** - * {@snippet lang=c : - * typedef __darwin_off_t off_t - * } - */ - public static final OfLong off_t = somelib_h.C_LONG_LONG; - - private static class fseeko { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_LONG_LONG, - somelib_h.C_INT - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("fseeko"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int fseeko(FILE *__stream, off_t __offset, int __whence) - * } - */ - public static FunctionDescriptor fseeko$descriptor() { - return fseeko.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int fseeko(FILE *__stream, off_t __offset, int __whence) - * } - */ - public static MethodHandle fseeko$handle() { - return fseeko.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int fseeko(FILE *__stream, off_t __offset, int __whence) - * } - */ - public static MemorySegment fseeko$address() { - return fseeko.ADDR; - } - - /** - * {@snippet lang=c : - * int fseeko(FILE *__stream, off_t __offset, int __whence) - * } - */ - public static int fseeko(MemorySegment __stream, long __offset, int __whence) { - var mh$ = fseeko.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("fseeko", __stream, __offset, __whence); - } - return (int)mh$.invokeExact(__stream, __offset, __whence); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class ftello { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_LONG_LONG, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("ftello"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * off_t ftello(FILE *__stream) - * } - */ - public static FunctionDescriptor ftello$descriptor() { - return ftello.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * off_t ftello(FILE *__stream) - * } - */ - public static MethodHandle ftello$handle() { - return ftello.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * off_t ftello(FILE *__stream) - * } - */ - public static MemorySegment ftello$address() { - return ftello.ADDR; - } - - /** - * {@snippet lang=c : - * off_t ftello(FILE *__stream) - * } - */ - public static long ftello(MemorySegment __stream) { - var mh$ = ftello.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("ftello", __stream); - } - return (long)mh$.invokeExact(__stream); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - /** - * Variadic invoker class for: - * {@snippet lang=c : - * int snprintf(char *restrict __str, size_t __size, const char *restrict __format, ...) - * } - */ - public static class snprintf { - private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_LONG, - somelib_h.C_POINTER - ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("snprintf"); - - private final MethodHandle handle; - private final FunctionDescriptor descriptor; - private final MethodHandle spreader; - - private snprintf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { - this.handle = handle; - this.descriptor = descriptor; - this.spreader = spreader; - } - - /** - * Variadic invoker factory for: - * {@snippet lang=c : - * int snprintf(char *restrict __str, size_t __size, const char *restrict __format, ...) - * } - */ - public static snprintf makeInvoker(MemoryLayout... layouts) { - FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); - Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); - var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); - var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new snprintf(mh$, desc$, spreader$); - } - - /** - * {@return the address} - */ - public static MemorySegment address() { - return ADDR; - } - - /** - * {@return the specialized method handle} - */ - public MethodHandle handle() { - return handle; - } - - /** - * {@return the specialized descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } - - public int apply(MemorySegment __str, long __size, MemorySegment __format, Object... x3) { - try { - if (TRACE_DOWNCALLS) { - traceDowncall("snprintf", __str, __size, __format, x3); - } - return (int)spreader.invokeExact(__str, __size, __format, x3); - } catch(IllegalArgumentException | ClassCastException ex$) { - throw ex$; // rethrow IAE from passing wrong number/type of args - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - } - - private static class vfscanf { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("vfscanf"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int vfscanf(FILE *restrict __stream, const char *restrict __format, va_list) - * } - */ - public static FunctionDescriptor vfscanf$descriptor() { - return vfscanf.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int vfscanf(FILE *restrict __stream, const char *restrict __format, va_list) - * } - */ - public static MethodHandle vfscanf$handle() { - return vfscanf.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int vfscanf(FILE *restrict __stream, const char *restrict __format, va_list) - * } - */ - public static MemorySegment vfscanf$address() { - return vfscanf.ADDR; - } - - /** - * {@snippet lang=c : - * int vfscanf(FILE *restrict __stream, const char *restrict __format, va_list) - * } - */ - public static int vfscanf(MemorySegment __stream, MemorySegment __format, MemorySegment x2) { - var mh$ = vfscanf.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("vfscanf", __stream, __format, x2); - } - return (int)mh$.invokeExact(__stream, __format, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class vscanf { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("vscanf"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int vscanf(const char *restrict __format, va_list) - * } - */ - public static FunctionDescriptor vscanf$descriptor() { - return vscanf.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int vscanf(const char *restrict __format, va_list) - * } - */ - public static MethodHandle vscanf$handle() { - return vscanf.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int vscanf(const char *restrict __format, va_list) - * } - */ - public static MemorySegment vscanf$address() { - return vscanf.ADDR; - } - - /** - * {@snippet lang=c : - * int vscanf(const char *restrict __format, va_list) - * } - */ - public static int vscanf(MemorySegment __format, MemorySegment x1) { - var mh$ = vscanf.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("vscanf", __format, x1); - } - return (int)mh$.invokeExact(__format, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class vsnprintf { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_LONG, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("vsnprintf"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int vsnprintf(char *restrict __str, size_t __size, const char *restrict __format, va_list) - * } - */ - public static FunctionDescriptor vsnprintf$descriptor() { - return vsnprintf.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int vsnprintf(char *restrict __str, size_t __size, const char *restrict __format, va_list) - * } - */ - public static MethodHandle vsnprintf$handle() { - return vsnprintf.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int vsnprintf(char *restrict __str, size_t __size, const char *restrict __format, va_list) - * } - */ - public static MemorySegment vsnprintf$address() { - return vsnprintf.ADDR; - } - - /** - * {@snippet lang=c : - * int vsnprintf(char *restrict __str, size_t __size, const char *restrict __format, va_list) - * } - */ - public static int vsnprintf(MemorySegment __str, long __size, MemorySegment __format, MemorySegment x3) { - var mh$ = vsnprintf.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("vsnprintf", __str, __size, __format, x3); - } - return (int)mh$.invokeExact(__str, __size, __format, x3); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class vsscanf { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("vsscanf"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int vsscanf(const char *restrict __str, const char *restrict __format, va_list) - * } - */ - public static FunctionDescriptor vsscanf$descriptor() { - return vsscanf.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int vsscanf(const char *restrict __str, const char *restrict __format, va_list) - * } - */ - public static MethodHandle vsscanf$handle() { - return vsscanf.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int vsscanf(const char *restrict __str, const char *restrict __format, va_list) - * } - */ - public static MemorySegment vsscanf$address() { - return vsscanf.ADDR; - } - - /** - * {@snippet lang=c : - * int vsscanf(const char *restrict __str, const char *restrict __format, va_list) - * } - */ - public static int vsscanf(MemorySegment __str, MemorySegment __format, MemorySegment x2) { - var mh$ = vsscanf.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("vsscanf", __str, __format, x2); - } - return (int)mh$.invokeExact(__str, __format, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - /** - * {@snippet lang=c : - * typedef __darwin_ssize_t ssize_t - * } - */ - public static final OfLong ssize_t = somelib_h.C_LONG; - - /** - * Variadic invoker class for: - * {@snippet lang=c : - * int dprintf(int, const char *restrict, ...) - * } - */ - public static class dprintf { - private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_INT, - somelib_h.C_POINTER - ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("dprintf"); - - private final MethodHandle handle; - private final FunctionDescriptor descriptor; - private final MethodHandle spreader; - - private dprintf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { - this.handle = handle; - this.descriptor = descriptor; - this.spreader = spreader; - } - - /** - * Variadic invoker factory for: - * {@snippet lang=c : - * int dprintf(int, const char *restrict, ...) - * } - */ - public static dprintf makeInvoker(MemoryLayout... layouts) { - FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); - Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); - var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); - var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new dprintf(mh$, desc$, spreader$); - } - - /** - * {@return the address} - */ - public static MemorySegment address() { - return ADDR; - } - - /** - * {@return the specialized method handle} - */ - public MethodHandle handle() { - return handle; - } - - /** - * {@return the specialized descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } - - public int apply(int x0, MemorySegment x1, Object... x2) { - try { - if (TRACE_DOWNCALLS) { - traceDowncall("dprintf", x0, x1, x2); - } - return (int)spreader.invokeExact(x0, x1, x2); - } catch(IllegalArgumentException | ClassCastException ex$) { - throw ex$; // rethrow IAE from passing wrong number/type of args - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - } - - private static class vdprintf { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("vdprintf"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int vdprintf(int, const char *restrict, va_list) - * } - */ - public static FunctionDescriptor vdprintf$descriptor() { - return vdprintf.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int vdprintf(int, const char *restrict, va_list) - * } - */ - public static MethodHandle vdprintf$handle() { - return vdprintf.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int vdprintf(int, const char *restrict, va_list) - * } - */ - public static MemorySegment vdprintf$address() { - return vdprintf.ADDR; - } - - /** - * {@snippet lang=c : - * int vdprintf(int, const char *restrict, va_list) - * } - */ - public static int vdprintf(int x0, MemorySegment x1, MemorySegment x2) { - var mh$ = vdprintf.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("vdprintf", x0, x1, x2); - } - return (int)mh$.invokeExact(x0, x1, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class getdelim { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_LONG, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("getdelim"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * ssize_t getdelim(char **restrict __linep, size_t *restrict __linecapp, int __delimiter, FILE *restrict __stream) - * } - */ - public static FunctionDescriptor getdelim$descriptor() { - return getdelim.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * ssize_t getdelim(char **restrict __linep, size_t *restrict __linecapp, int __delimiter, FILE *restrict __stream) - * } - */ - public static MethodHandle getdelim$handle() { - return getdelim.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * ssize_t getdelim(char **restrict __linep, size_t *restrict __linecapp, int __delimiter, FILE *restrict __stream) - * } - */ - public static MemorySegment getdelim$address() { - return getdelim.ADDR; - } - - /** - * {@snippet lang=c : - * ssize_t getdelim(char **restrict __linep, size_t *restrict __linecapp, int __delimiter, FILE *restrict __stream) - * } - */ - public static long getdelim(MemorySegment __linep, MemorySegment __linecapp, int __delimiter, MemorySegment __stream) { - var mh$ = getdelim.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("getdelim", __linep, __linecapp, __delimiter, __stream); - } - return (long)mh$.invokeExact(__linep, __linecapp, __delimiter, __stream); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class getline { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_LONG, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("getline"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * ssize_t getline(char **restrict __linep, size_t *restrict __linecapp, FILE *restrict __stream) - * } - */ - public static FunctionDescriptor getline$descriptor() { - return getline.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * ssize_t getline(char **restrict __linep, size_t *restrict __linecapp, FILE *restrict __stream) - * } - */ - public static MethodHandle getline$handle() { - return getline.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * ssize_t getline(char **restrict __linep, size_t *restrict __linecapp, FILE *restrict __stream) - * } - */ - public static MemorySegment getline$address() { - return getline.ADDR; - } - - /** - * {@snippet lang=c : - * ssize_t getline(char **restrict __linep, size_t *restrict __linecapp, FILE *restrict __stream) - * } - */ - public static long getline(MemorySegment __linep, MemorySegment __linecapp, MemorySegment __stream) { - var mh$ = getline.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("getline", __linep, __linecapp, __stream); - } - return (long)mh$.invokeExact(__linep, __linecapp, __stream); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class fmemopen { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("fmemopen"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * FILE *fmemopen(void *restrict __buf, size_t __size, const char *restrict __mode) - * } - */ - public static FunctionDescriptor fmemopen$descriptor() { - return fmemopen.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * FILE *fmemopen(void *restrict __buf, size_t __size, const char *restrict __mode) - * } - */ - public static MethodHandle fmemopen$handle() { - return fmemopen.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * FILE *fmemopen(void *restrict __buf, size_t __size, const char *restrict __mode) - * } - */ - public static MemorySegment fmemopen$address() { - return fmemopen.ADDR; - } - - /** - * {@snippet lang=c : - * FILE *fmemopen(void *restrict __buf, size_t __size, const char *restrict __mode) - * } - */ - public static MemorySegment fmemopen(MemorySegment __buf, long __size, MemorySegment __mode) { - var mh$ = fmemopen.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("fmemopen", __buf, __size, __mode); - } - return (MemorySegment)mh$.invokeExact(__buf, __size, __mode); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class open_memstream { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("open_memstream"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * FILE *open_memstream(char **__bufp, size_t *__sizep) - * } - */ - public static FunctionDescriptor open_memstream$descriptor() { - return open_memstream.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * FILE *open_memstream(char **__bufp, size_t *__sizep) - * } - */ - public static MethodHandle open_memstream$handle() { - return open_memstream.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * FILE *open_memstream(char **__bufp, size_t *__sizep) - * } - */ - public static MemorySegment open_memstream$address() { - return open_memstream.ADDR; - } - - /** - * {@snippet lang=c : - * FILE *open_memstream(char **__bufp, size_t *__sizep) - * } - */ - public static MemorySegment open_memstream(MemorySegment __bufp, MemorySegment __sizep) { - var mh$ = open_memstream.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("open_memstream", __bufp, __sizep); - } - return (MemorySegment)mh$.invokeExact(__bufp, __sizep); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class sys_nerr$constants { - public static final OfInt LAYOUT = somelib_h.C_INT; - public static final MemorySegment SEGMENT = somelib_h.findOrThrow("sys_nerr").reinterpret(LAYOUT.byteSize()); - } - - /** - * Layout for variable: - * {@snippet lang=c : - * extern const int sys_nerr - * } - */ - public static OfInt sys_nerr$layout() { - return sys_nerr$constants.LAYOUT; - } - - /** - * Segment for variable: - * {@snippet lang=c : - * extern const int sys_nerr - * } - */ - public static MemorySegment sys_nerr$segment() { - return sys_nerr$constants.SEGMENT; - } - - /** - * Getter for variable: - * {@snippet lang=c : - * extern const int sys_nerr - * } - */ - public static int sys_nerr() { - return sys_nerr$constants.SEGMENT.get(sys_nerr$constants.LAYOUT, 0L); - } - - /** - * Setter for variable: - * {@snippet lang=c : - * extern const int sys_nerr - * } - */ - public static void sys_nerr(int varValue) { - sys_nerr$constants.SEGMENT.set(sys_nerr$constants.LAYOUT, 0L, varValue); - } - - private static class sys_errlist$constants { - public static final SequenceLayout LAYOUT = MemoryLayout.sequenceLayout(0, somelib_h.C_POINTER); - public static final MemorySegment SEGMENT = somelib_h.findOrThrow("sys_errlist").reinterpret(LAYOUT.byteSize()); - public static final VarHandle HANDLE = LAYOUT.varHandle(); - - public static final long[] DIMS = { }; - } - - /** - * Layout for variable: - * {@snippet lang=c : - * extern const char *const sys_errlist[] - * } - */ - public static SequenceLayout sys_errlist$layout() { - return sys_errlist$constants.LAYOUT; - } - - /** - * Dimensions for array variable: - * {@snippet lang=c : - * extern const char *const sys_errlist[] - * } - */ - public static long[] sys_errlist$dimensions() { - return sys_errlist$constants.DIMS; - } - - /** - * Getter for variable: - * {@snippet lang=c : - * extern const char *const sys_errlist[] - * } - */ - public static MemorySegment sys_errlist() { - return sys_errlist$constants.SEGMENT; - } - - /** - * Setter for variable: - * {@snippet lang=c : - * extern const char *const sys_errlist[] - * } - */ - public static void sys_errlist(MemorySegment varValue) { - MemorySegment.copy(varValue, 0L, sys_errlist$constants.SEGMENT, 0L, sys_errlist$constants.LAYOUT.byteSize()); - } - - /** - * Variadic invoker class for: - * {@snippet lang=c : - * int asprintf(char **restrict, const char *restrict, ...) - * } - */ - public static class asprintf { - private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("asprintf"); - - private final MethodHandle handle; - private final FunctionDescriptor descriptor; - private final MethodHandle spreader; - - private asprintf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { - this.handle = handle; - this.descriptor = descriptor; - this.spreader = spreader; - } - - /** - * Variadic invoker factory for: - * {@snippet lang=c : - * int asprintf(char **restrict, const char *restrict, ...) - * } - */ - public static asprintf makeInvoker(MemoryLayout... layouts) { - FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); - Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); - var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); - var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new asprintf(mh$, desc$, spreader$); - } - - /** - * {@return the address} - */ - public static MemorySegment address() { - return ADDR; - } - - /** - * {@return the specialized method handle} - */ - public MethodHandle handle() { - return handle; - } - - /** - * {@return the specialized descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } - - public int apply(MemorySegment x0, MemorySegment x1, Object... x2) { - try { - if (TRACE_DOWNCALLS) { - traceDowncall("asprintf", x0, x1, x2); - } - return (int)spreader.invokeExact(x0, x1, x2); - } catch(IllegalArgumentException | ClassCastException ex$) { - throw ex$; // rethrow IAE from passing wrong number/type of args - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - } - - private static class ctermid_r { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("ctermid_r"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * char *ctermid_r(char *) - * } - */ - public static FunctionDescriptor ctermid_r$descriptor() { - return ctermid_r.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * char *ctermid_r(char *) - * } - */ - public static MethodHandle ctermid_r$handle() { - return ctermid_r.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * char *ctermid_r(char *) - * } - */ - public static MemorySegment ctermid_r$address() { - return ctermid_r.ADDR; - } - - /** - * {@snippet lang=c : - * char *ctermid_r(char *) - * } - */ - public static MemorySegment ctermid_r(MemorySegment x0) { - var mh$ = ctermid_r.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("ctermid_r", x0); - } - return (MemorySegment)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class fgetln { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("fgetln"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * char *fgetln(FILE *, size_t *) - * } - */ - public static FunctionDescriptor fgetln$descriptor() { - return fgetln.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * char *fgetln(FILE *, size_t *) - * } - */ - public static MethodHandle fgetln$handle() { - return fgetln.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * char *fgetln(FILE *, size_t *) - * } - */ - public static MemorySegment fgetln$address() { - return fgetln.ADDR; - } - - /** - * {@snippet lang=c : - * char *fgetln(FILE *, size_t *) - * } - */ - public static MemorySegment fgetln(MemorySegment x0, MemorySegment x1) { - var mh$ = fgetln.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("fgetln", x0, x1); - } - return (MemorySegment)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class fmtcheck { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("fmtcheck"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * const char *fmtcheck(const char *, const char *) - * } - */ - public static FunctionDescriptor fmtcheck$descriptor() { - return fmtcheck.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * const char *fmtcheck(const char *, const char *) - * } - */ - public static MethodHandle fmtcheck$handle() { - return fmtcheck.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * const char *fmtcheck(const char *, const char *) - * } - */ - public static MemorySegment fmtcheck$address() { - return fmtcheck.ADDR; - } - - /** - * {@snippet lang=c : - * const char *fmtcheck(const char *, const char *) - * } - */ - public static MemorySegment fmtcheck(MemorySegment x0, MemorySegment x1) { - var mh$ = fmtcheck.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("fmtcheck", x0, x1); - } - return (MemorySegment)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class fpurge { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("fpurge"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int fpurge(FILE *) - * } - */ - public static FunctionDescriptor fpurge$descriptor() { - return fpurge.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int fpurge(FILE *) - * } - */ - public static MethodHandle fpurge$handle() { - return fpurge.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int fpurge(FILE *) - * } - */ - public static MemorySegment fpurge$address() { - return fpurge.ADDR; - } - - /** - * {@snippet lang=c : - * int fpurge(FILE *) - * } - */ - public static int fpurge(MemorySegment x0) { - var mh$ = fpurge.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("fpurge", x0); - } - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class setbuffer { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_INT - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("setbuffer"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * void setbuffer(FILE *, char *, int) - * } - */ - public static FunctionDescriptor setbuffer$descriptor() { - return setbuffer.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * void setbuffer(FILE *, char *, int) - * } - */ - public static MethodHandle setbuffer$handle() { - return setbuffer.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * void setbuffer(FILE *, char *, int) - * } - */ - public static MemorySegment setbuffer$address() { - return setbuffer.ADDR; - } - - /** - * {@snippet lang=c : - * void setbuffer(FILE *, char *, int) - * } - */ - public static void setbuffer(MemorySegment x0, MemorySegment x1, int x2) { - var mh$ = setbuffer.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("setbuffer", x0, x1, x2); - } - mh$.invokeExact(x0, x1, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class setlinebuf { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("setlinebuf"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int setlinebuf(FILE *) - * } - */ - public static FunctionDescriptor setlinebuf$descriptor() { - return setlinebuf.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int setlinebuf(FILE *) - * } - */ - public static MethodHandle setlinebuf$handle() { - return setlinebuf.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int setlinebuf(FILE *) - * } - */ - public static MemorySegment setlinebuf$address() { - return setlinebuf.ADDR; - } - - /** - * {@snippet lang=c : - * int setlinebuf(FILE *) - * } - */ - public static int setlinebuf(MemorySegment x0) { - var mh$ = setlinebuf.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("setlinebuf", x0); - } - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class vasprintf { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("vasprintf"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int vasprintf(char **restrict, const char *restrict, va_list) - * } - */ - public static FunctionDescriptor vasprintf$descriptor() { - return vasprintf.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int vasprintf(char **restrict, const char *restrict, va_list) - * } - */ - public static MethodHandle vasprintf$handle() { - return vasprintf.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int vasprintf(char **restrict, const char *restrict, va_list) - * } - */ - public static MemorySegment vasprintf$address() { - return vasprintf.ADDR; - } - - /** - * {@snippet lang=c : - * int vasprintf(char **restrict, const char *restrict, va_list) - * } - */ - public static int vasprintf(MemorySegment x0, MemorySegment x1, MemorySegment x2) { - var mh$ = vasprintf.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("vasprintf", x0, x1, x2); - } - return (int)mh$.invokeExact(x0, x1, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class funopen { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("funopen"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * FILE *funopen(const void *, int (* _Nullable)(void *, char *, int), int (* _Nullable)(void *, const char *, int), fpos_t (* _Nullable)(void *, fpos_t, int), int (* _Nullable)(void *)) - * } - */ - public static FunctionDescriptor funopen$descriptor() { - return funopen.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * FILE *funopen(const void *, int (* _Nullable)(void *, char *, int), int (* _Nullable)(void *, const char *, int), fpos_t (* _Nullable)(void *, fpos_t, int), int (* _Nullable)(void *)) - * } - */ - public static MethodHandle funopen$handle() { - return funopen.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * FILE *funopen(const void *, int (* _Nullable)(void *, char *, int), int (* _Nullable)(void *, const char *, int), fpos_t (* _Nullable)(void *, fpos_t, int), int (* _Nullable)(void *)) - * } - */ - public static MemorySegment funopen$address() { - return funopen.ADDR; - } - - /** - * {@snippet lang=c : - * FILE *funopen(const void *, int (* _Nullable)(void *, char *, int), int (* _Nullable)(void *, const char *, int), fpos_t (* _Nullable)(void *, fpos_t, int), int (* _Nullable)(void *)) - * } - */ - public static MemorySegment funopen(MemorySegment x0, MemorySegment x1, MemorySegment x2, MemorySegment x3, MemorySegment x4) { - var mh$ = funopen.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("funopen", x0, x1, x2, x3, x4); - } - return (MemorySegment)mh$.invokeExact(x0, x1, x2, x3, x4); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - /** - * Variadic invoker class for: - * {@snippet lang=c : - * extern int __sprintf_chk(char *restrict, int, size_t, const char *restrict, ...) - * } - */ - public static class __sprintf_chk { - private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_INT, - somelib_h.C_LONG, - somelib_h.C_POINTER - ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("__sprintf_chk"); - - private final MethodHandle handle; - private final FunctionDescriptor descriptor; - private final MethodHandle spreader; - - private __sprintf_chk(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { - this.handle = handle; - this.descriptor = descriptor; - this.spreader = spreader; - } - - /** - * Variadic invoker factory for: - * {@snippet lang=c : - * extern int __sprintf_chk(char *restrict, int, size_t, const char *restrict, ...) - * } - */ - public static __sprintf_chk makeInvoker(MemoryLayout... layouts) { - FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); - Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); - var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); - var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new __sprintf_chk(mh$, desc$, spreader$); - } - - /** - * {@return the address} - */ - public static MemorySegment address() { - return ADDR; - } - - /** - * {@return the specialized method handle} - */ - public MethodHandle handle() { - return handle; - } - - /** - * {@return the specialized descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } - - public int apply(MemorySegment x0, int x1, long x2, MemorySegment x3, Object... x4) { - try { - if (TRACE_DOWNCALLS) { - traceDowncall("__sprintf_chk", x0, x1, x2, x3, x4); - } - return (int)spreader.invokeExact(x0, x1, x2, x3, x4); - } catch(IllegalArgumentException | ClassCastException ex$) { - throw ex$; // rethrow IAE from passing wrong number/type of args - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - } - - /** - * Variadic invoker class for: - * {@snippet lang=c : - * extern int __snprintf_chk(char *restrict, size_t, int, size_t, const char *restrict, ...) - * } - */ - public static class __snprintf_chk { - private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_LONG, - somelib_h.C_INT, - somelib_h.C_LONG, - somelib_h.C_POINTER - ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("__snprintf_chk"); - - private final MethodHandle handle; - private final FunctionDescriptor descriptor; - private final MethodHandle spreader; - - private __snprintf_chk(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { - this.handle = handle; - this.descriptor = descriptor; - this.spreader = spreader; - } - - /** - * Variadic invoker factory for: - * {@snippet lang=c : - * extern int __snprintf_chk(char *restrict, size_t, int, size_t, const char *restrict, ...) - * } - */ - public static __snprintf_chk makeInvoker(MemoryLayout... layouts) { - FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); - Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); - var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); - var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new __snprintf_chk(mh$, desc$, spreader$); - } - - /** - * {@return the address} - */ - public static MemorySegment address() { - return ADDR; - } - - /** - * {@return the specialized method handle} - */ - public MethodHandle handle() { - return handle; - } - - /** - * {@return the specialized descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } - - public int apply(MemorySegment x0, long x1, int x2, long x3, MemorySegment x4, Object... x5) { - try { - if (TRACE_DOWNCALLS) { - traceDowncall("__snprintf_chk", x0, x1, x2, x3, x4, x5); - } - return (int)spreader.invokeExact(x0, x1, x2, x3, x4, x5); - } catch(IllegalArgumentException | ClassCastException ex$) { - throw ex$; // rethrow IAE from passing wrong number/type of args - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - } - - private static class __vsprintf_chk { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_INT, - somelib_h.C_LONG, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("__vsprintf_chk"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern int __vsprintf_chk(char *restrict, int, size_t, const char *restrict, va_list) - * } - */ - public static FunctionDescriptor __vsprintf_chk$descriptor() { - return __vsprintf_chk.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern int __vsprintf_chk(char *restrict, int, size_t, const char *restrict, va_list) - * } - */ - public static MethodHandle __vsprintf_chk$handle() { - return __vsprintf_chk.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern int __vsprintf_chk(char *restrict, int, size_t, const char *restrict, va_list) - * } - */ - public static MemorySegment __vsprintf_chk$address() { - return __vsprintf_chk.ADDR; - } - - /** - * {@snippet lang=c : - * extern int __vsprintf_chk(char *restrict, int, size_t, const char *restrict, va_list) - * } - */ - public static int __vsprintf_chk(MemorySegment x0, int x1, long x2, MemorySegment x3, MemorySegment x4) { - var mh$ = __vsprintf_chk.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("__vsprintf_chk", x0, x1, x2, x3, x4); - } - return (int)mh$.invokeExact(x0, x1, x2, x3, x4); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class __vsnprintf_chk { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_LONG, - somelib_h.C_INT, - somelib_h.C_LONG, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("__vsnprintf_chk"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern int __vsnprintf_chk(char *restrict, size_t, int, size_t, const char *restrict, va_list) - * } - */ - public static FunctionDescriptor __vsnprintf_chk$descriptor() { - return __vsnprintf_chk.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern int __vsnprintf_chk(char *restrict, size_t, int, size_t, const char *restrict, va_list) - * } - */ - public static MethodHandle __vsnprintf_chk$handle() { - return __vsnprintf_chk.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern int __vsnprintf_chk(char *restrict, size_t, int, size_t, const char *restrict, va_list) - * } - */ - public static MemorySegment __vsnprintf_chk$address() { - return __vsnprintf_chk.ADDR; - } - - /** - * {@snippet lang=c : - * extern int __vsnprintf_chk(char *restrict, size_t, int, size_t, const char *restrict, va_list) - * } - */ - public static int __vsnprintf_chk(MemorySegment x0, long x1, int x2, long x3, MemorySegment x4, MemorySegment x5) { - var mh$ = __vsnprintf_chk.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("__vsnprintf_chk", x0, x1, x2, x3, x4, x5); - } - return (int)mh$.invokeExact(x0, x1, x2, x3, x4, x5); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - /** - * {@snippet lang=c : - * typedef unsigned char uint8_t - * } - */ - public static final OfByte uint8_t = somelib_h.C_CHAR; - /** - * {@snippet lang=c : - * typedef unsigned short uint16_t - * } - */ - public static final OfShort uint16_t = somelib_h.C_SHORT; - /** - * {@snippet lang=c : - * typedef unsigned int uint32_t - * } - */ - public static final OfInt uint32_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef unsigned long long uint64_t - * } - */ - public static final OfLong uint64_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef int8_t int_least8_t - * } - */ - public static final OfByte int_least8_t = somelib_h.C_CHAR; - /** - * {@snippet lang=c : - * typedef int16_t int_least16_t - * } - */ - public static final OfShort int_least16_t = somelib_h.C_SHORT; - /** - * {@snippet lang=c : - * typedef int32_t int_least32_t - * } - */ - public static final OfInt int_least32_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef int64_t int_least64_t - * } - */ - public static final OfLong int_least64_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef uint8_t uint_least8_t - * } - */ - public static final OfByte uint_least8_t = somelib_h.C_CHAR; - /** - * {@snippet lang=c : - * typedef uint16_t uint_least16_t - * } - */ - public static final OfShort uint_least16_t = somelib_h.C_SHORT; - /** - * {@snippet lang=c : - * typedef uint32_t uint_least32_t - * } - */ - public static final OfInt uint_least32_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef uint64_t uint_least64_t - * } - */ - public static final OfLong uint_least64_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef int8_t int_fast8_t - * } - */ - public static final OfByte int_fast8_t = somelib_h.C_CHAR; - /** - * {@snippet lang=c : - * typedef int16_t int_fast16_t - * } - */ - public static final OfShort int_fast16_t = somelib_h.C_SHORT; - /** - * {@snippet lang=c : - * typedef int32_t int_fast32_t - * } - */ - public static final OfInt int_fast32_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef int64_t int_fast64_t - * } - */ - public static final OfLong int_fast64_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef uint8_t uint_fast8_t - * } - */ - public static final OfByte uint_fast8_t = somelib_h.C_CHAR; - /** - * {@snippet lang=c : - * typedef uint16_t uint_fast16_t - * } - */ - public static final OfShort uint_fast16_t = somelib_h.C_SHORT; - /** - * {@snippet lang=c : - * typedef uint32_t uint_fast32_t - * } - */ - public static final OfInt uint_fast32_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef uint64_t uint_fast64_t - * } - */ - public static final OfLong uint_fast64_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef long intmax_t - * } - */ - public static final OfLong intmax_t = somelib_h.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned long uintmax_t - * } - */ - public static final OfLong uintmax_t = somelib_h.C_LONG; - /** - * {@snippet lang=c : - * typedef long ptrdiff_t - * } - */ - public static final OfLong ptrdiff_t = somelib_h.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned long rsize_t - * } - */ - public static final OfLong rsize_t = somelib_h.C_LONG; - /** - * {@snippet lang=c : - * typedef int wchar_t - * } - */ - public static final OfInt wchar_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef unsigned char u_char - * } - */ - public static final OfByte u_char = somelib_h.C_CHAR; - /** - * {@snippet lang=c : - * typedef unsigned short u_short - * } - */ - public static final OfShort u_short = somelib_h.C_SHORT; - /** - * {@snippet lang=c : - * typedef unsigned int u_int - * } - */ - public static final OfInt u_int = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef unsigned long u_long - * } - */ - public static final OfLong u_long = somelib_h.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned short ushort - * } - */ - public static final OfShort ushort = somelib_h.C_SHORT; - /** - * {@snippet lang=c : - * typedef unsigned int uint - * } - */ - public static final OfInt uint = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef u_int64_t u_quad_t - * } - */ - public static final OfLong u_quad_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef int64_t quad_t - * } - */ - public static final OfLong quad_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef quad_t *qaddr_t - * } - */ - public static final AddressLayout qaddr_t = somelib_h.C_POINTER; - /** - * {@snippet lang=c : - * typedef char *caddr_t - * } - */ - public static final AddressLayout caddr_t = somelib_h.C_POINTER; - /** - * {@snippet lang=c : - * typedef int32_t daddr_t - * } - */ - public static final OfInt daddr_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef __darwin_dev_t dev_t - * } - */ - public static final OfInt dev_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef u_int32_t fixpt_t - * } - */ - public static final OfInt fixpt_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef __darwin_blkcnt_t blkcnt_t - * } - */ - public static final OfLong blkcnt_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef __darwin_blksize_t blksize_t - * } - */ - public static final OfInt blksize_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef __darwin_gid_t gid_t - * } - */ - public static final OfInt gid_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef __uint32_t in_addr_t - * } - */ - public static final OfInt in_addr_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef __uint16_t in_port_t - * } - */ - public static final OfShort in_port_t = somelib_h.C_SHORT; - /** - * {@snippet lang=c : - * typedef __darwin_ino_t ino_t - * } - */ - public static final OfLong ino_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef __darwin_ino64_t ino64_t - * } - */ - public static final OfLong ino64_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef __int32_t key_t - * } - */ - public static final OfInt key_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef __darwin_mode_t mode_t - * } - */ - public static final OfShort mode_t = somelib_h.C_SHORT; - /** - * {@snippet lang=c : - * typedef __uint16_t nlink_t - * } - */ - public static final OfShort nlink_t = somelib_h.C_SHORT; - /** - * {@snippet lang=c : - * typedef __darwin_id_t id_t - * } - */ - public static final OfInt id_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef __darwin_pid_t pid_t - * } - */ - public static final OfInt pid_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef int32_t segsz_t - * } - */ - public static final OfInt segsz_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef int32_t swblk_t - * } - */ - public static final OfInt swblk_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef __darwin_uid_t uid_t - * } - */ - public static final OfInt uid_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef __darwin_clock_t clock_t - * } - */ - public static final OfLong clock_t = somelib_h.C_LONG; - /** - * {@snippet lang=c : - * typedef __darwin_time_t time_t - * } - */ - public static final OfLong time_t = somelib_h.C_LONG; - /** - * {@snippet lang=c : - * typedef __darwin_useconds_t useconds_t - * } - */ - public static final OfInt useconds_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef __darwin_suseconds_t suseconds_t - * } - */ - public static final OfInt suseconds_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef int errno_t - * } - */ - public static final OfInt errno_t = somelib_h.C_INT; - - private static class __darwin_check_fd_set_overflow { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_INT - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("__darwin_check_fd_set_overflow"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int __darwin_check_fd_set_overflow(int, const void *, int) - * } - */ - public static FunctionDescriptor __darwin_check_fd_set_overflow$descriptor() { - return __darwin_check_fd_set_overflow.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int __darwin_check_fd_set_overflow(int, const void *, int) - * } - */ - public static MethodHandle __darwin_check_fd_set_overflow$handle() { - return __darwin_check_fd_set_overflow.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int __darwin_check_fd_set_overflow(int, const void *, int) - * } - */ - public static MemorySegment __darwin_check_fd_set_overflow$address() { - return __darwin_check_fd_set_overflow.ADDR; - } - - /** - * {@snippet lang=c : - * int __darwin_check_fd_set_overflow(int, const void *, int) - * } - */ - public static int __darwin_check_fd_set_overflow(int x0, MemorySegment x1, int x2) { - var mh$ = __darwin_check_fd_set_overflow.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("__darwin_check_fd_set_overflow", x0, x1, x2); - } - return (int)mh$.invokeExact(x0, x1, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - /** - * {@snippet lang=c : - * typedef __int32_t fd_mask - * } - */ - public static final OfInt fd_mask = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef __darwin_pthread_t pthread_t - * } - */ - public static final AddressLayout pthread_t = somelib_h.C_POINTER; - /** - * {@snippet lang=c : - * typedef __darwin_pthread_key_t pthread_key_t - * } - */ - public static final OfLong pthread_key_t = somelib_h.C_LONG; - /** - * {@snippet lang=c : - * typedef __darwin_fsblkcnt_t fsblkcnt_t - * } - */ - public static final OfInt fsblkcnt_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef __darwin_fsfilcnt_t fsfilcnt_t - * } - */ - public static final OfInt fsfilcnt_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef uint16_t char16_t - * } - */ - public static final OfShort char16_t = somelib_h.C_SHORT; - /** - * {@snippet lang=c : - * typedef uint32_t char32_t - * } - */ - public static final OfInt char32_t = somelib_h.C_INT; + public int apply(MemorySegment x0, Object... x1) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("scanf", x0, x1); + } + return (int)spreader.invokeExact(x0, x1); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } - private static class diplomat_simple_write { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - DiplomatWrite.layout(), + private static class setbuf { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_simple_write"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("setbuf"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -9796,57 +6456,60 @@ private static class diplomat_simple_write { /** * Function descriptor for: * {@snippet lang=c : - * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) + * void setbuf(FILE *restrict, char *restrict) * } */ - public static FunctionDescriptor diplomat_simple_write$descriptor() { - return diplomat_simple_write.DESC; + public static FunctionDescriptor setbuf$descriptor() { + return setbuf.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) + * void setbuf(FILE *restrict, char *restrict) * } */ - public static MethodHandle diplomat_simple_write$handle() { - return diplomat_simple_write.HANDLE; + public static MethodHandle setbuf$handle() { + return setbuf.HANDLE; } /** * Address for: * {@snippet lang=c : - * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) + * void setbuf(FILE *restrict, char *restrict) * } */ - public static MemorySegment diplomat_simple_write$address() { - return diplomat_simple_write.ADDR; + public static MemorySegment setbuf$address() { + return setbuf.ADDR; } /** * {@snippet lang=c : - * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) + * void setbuf(FILE *restrict, char *restrict) * } */ - public static MemorySegment diplomat_simple_write(SegmentAllocator allocator, MemorySegment buf, long buf_size) { - var mh$ = diplomat_simple_write.HANDLE; + public static void setbuf(MemorySegment x0, MemorySegment x1) { + var mh$ = setbuf.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("diplomat_simple_write", allocator, buf, buf_size); + traceDowncall("setbuf", x0, x1); } - return (MemorySegment)mh$.invokeExact(allocator, buf, buf_size); + mh$.invokeExact(x0, x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class diplomat_buffer_write_create { + private static class setvbuf { public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_INT, somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_create"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("setvbuf"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -9854,115 +6517,201 @@ private static class diplomat_buffer_write_create { /** * Function descriptor for: * {@snippet lang=c : - * DiplomatWrite *diplomat_buffer_write_create(size_t cap) + * int setvbuf(FILE *restrict, char *restrict, int, size_t) * } */ - public static FunctionDescriptor diplomat_buffer_write_create$descriptor() { - return diplomat_buffer_write_create.DESC; + public static FunctionDescriptor setvbuf$descriptor() { + return setvbuf.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * DiplomatWrite *diplomat_buffer_write_create(size_t cap) + * int setvbuf(FILE *restrict, char *restrict, int, size_t) * } */ - public static MethodHandle diplomat_buffer_write_create$handle() { - return diplomat_buffer_write_create.HANDLE; + public static MethodHandle setvbuf$handle() { + return setvbuf.HANDLE; } /** * Address for: * {@snippet lang=c : - * DiplomatWrite *diplomat_buffer_write_create(size_t cap) + * int setvbuf(FILE *restrict, char *restrict, int, size_t) * } */ - public static MemorySegment diplomat_buffer_write_create$address() { - return diplomat_buffer_write_create.ADDR; + public static MemorySegment setvbuf$address() { + return setvbuf.ADDR; } /** * {@snippet lang=c : - * DiplomatWrite *diplomat_buffer_write_create(size_t cap) + * int setvbuf(FILE *restrict, char *restrict, int, size_t) * } */ - public static MemorySegment diplomat_buffer_write_create(long cap) { - var mh$ = diplomat_buffer_write_create.HANDLE; + public static int setvbuf(MemorySegment x0, MemorySegment x1, int x2, long x3) { + var mh$ = setvbuf.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("diplomat_buffer_write_create", cap); + traceDowncall("setvbuf", x0, x1, x2, x3); } - return (MemorySegment)mh$.invokeExact(cap); + return (int)mh$.invokeExact(x0, x1, x2, x3); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class diplomat_buffer_write_get_bytes { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_get_bytes"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - /** - * Function descriptor for: + * Variadic invoker class for: * {@snippet lang=c : - * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) + * int sprintf(char *restrict, const char *restrict, ...) * } */ - public static FunctionDescriptor diplomat_buffer_write_get_bytes$descriptor() { - return diplomat_buffer_write_get_bytes.DESC; - } + public static class sprintf { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("sprintf"); - /** - * Downcall method handle for: - * {@snippet lang=c : - * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) - * } - */ - public static MethodHandle diplomat_buffer_write_get_bytes$handle() { - return diplomat_buffer_write_get_bytes.HANDLE; - } + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; - /** - * Address for: - * {@snippet lang=c : - * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) - * } - */ - public static MemorySegment diplomat_buffer_write_get_bytes$address() { - return diplomat_buffer_write_get_bytes.ADDR; + private sprintf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * int sprintf(char *restrict, const char *restrict, ...) + * } + */ + public static sprintf makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new sprintf(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public int apply(MemorySegment x0, MemorySegment x1, Object... x2) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("sprintf", x0, x1, x2); + } + return (int)spreader.invokeExact(x0, x1, x2); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } } /** + * Variadic invoker class for: * {@snippet lang=c : - * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) + * int sscanf(const char *restrict, const char *restrict, ...) * } */ - public static MemorySegment diplomat_buffer_write_get_bytes(MemorySegment t) { - var mh$ = diplomat_buffer_write_get_bytes.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("diplomat_buffer_write_get_bytes", t); + public static class sscanf { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("sscanf"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private sscanf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * int sscanf(const char *restrict, const char *restrict, ...) + * } + */ + public static sscanf makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new sscanf(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public int apply(MemorySegment x0, MemorySegment x1, Object... x2) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("sscanf", x0, x1, x2); + } + return (int)spreader.invokeExact(x0, x1, x2); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); } - return (MemorySegment)mh$.invokeExact(t); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); } } - private static class diplomat_buffer_write_len { + private static class tmpfile { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_LONG, - somelib_h.C_POINTER - ); + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_len"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("tmpfile"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -9970,56 +6719,57 @@ private static class diplomat_buffer_write_len { /** * Function descriptor for: * {@snippet lang=c : - * size_t diplomat_buffer_write_len(DiplomatWrite *t) + * FILE *tmpfile() * } */ - public static FunctionDescriptor diplomat_buffer_write_len$descriptor() { - return diplomat_buffer_write_len.DESC; + public static FunctionDescriptor tmpfile$descriptor() { + return tmpfile.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * size_t diplomat_buffer_write_len(DiplomatWrite *t) + * FILE *tmpfile() * } */ - public static MethodHandle diplomat_buffer_write_len$handle() { - return diplomat_buffer_write_len.HANDLE; + public static MethodHandle tmpfile$handle() { + return tmpfile.HANDLE; } /** * Address for: * {@snippet lang=c : - * size_t diplomat_buffer_write_len(DiplomatWrite *t) + * FILE *tmpfile() * } */ - public static MemorySegment diplomat_buffer_write_len$address() { - return diplomat_buffer_write_len.ADDR; + public static MemorySegment tmpfile$address() { + return tmpfile.ADDR; } /** * {@snippet lang=c : - * size_t diplomat_buffer_write_len(DiplomatWrite *t) + * FILE *tmpfile() * } */ - public static long diplomat_buffer_write_len(MemorySegment t) { - var mh$ = diplomat_buffer_write_len.HANDLE; + public static MemorySegment tmpfile() { + var mh$ = tmpfile.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("diplomat_buffer_write_len", t); + traceDowncall("tmpfile"); } - return (long)mh$.invokeExact(t); + return (MemorySegment)mh$.invokeExact(); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class diplomat_buffer_write_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class tmpnam { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("tmpnam"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10027,58 +6777,58 @@ private static class diplomat_buffer_write_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void diplomat_buffer_write_destroy(DiplomatWrite *t) + * char *tmpnam(char *) * } */ - public static FunctionDescriptor diplomat_buffer_write_destroy$descriptor() { - return diplomat_buffer_write_destroy.DESC; + public static FunctionDescriptor tmpnam$descriptor() { + return tmpnam.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void diplomat_buffer_write_destroy(DiplomatWrite *t) + * char *tmpnam(char *) * } */ - public static MethodHandle diplomat_buffer_write_destroy$handle() { - return diplomat_buffer_write_destroy.HANDLE; + public static MethodHandle tmpnam$handle() { + return tmpnam.HANDLE; } /** * Address for: * {@snippet lang=c : - * void diplomat_buffer_write_destroy(DiplomatWrite *t) + * char *tmpnam(char *) * } */ - public static MemorySegment diplomat_buffer_write_destroy$address() { - return diplomat_buffer_write_destroy.ADDR; + public static MemorySegment tmpnam$address() { + return tmpnam.ADDR; } /** * {@snippet lang=c : - * void diplomat_buffer_write_destroy(DiplomatWrite *t) + * char *tmpnam(char *) * } */ - public static void diplomat_buffer_write_destroy(MemorySegment t) { - var mh$ = diplomat_buffer_write_destroy.HANDLE; + public static MemorySegment tmpnam(MemorySegment x0) { + var mh$ = tmpnam.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("diplomat_buffer_write_destroy", t); + traceDowncall("tmpnam", x0); } - mh$.invokeExact(t); + return (MemorySegment)mh$.invokeExact(x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class diplomat_is_str { + private static class ungetc { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_BOOL, - somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_INT, + somelib_h.C_INT, + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_is_str"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("ungetc"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10086,57 +6836,59 @@ private static class diplomat_is_str { /** * Function descriptor for: * {@snippet lang=c : - * bool diplomat_is_str(const char *buf, size_t len) + * int ungetc(int, FILE *) * } */ - public static FunctionDescriptor diplomat_is_str$descriptor() { - return diplomat_is_str.DESC; + public static FunctionDescriptor ungetc$descriptor() { + return ungetc.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * bool diplomat_is_str(const char *buf, size_t len) + * int ungetc(int, FILE *) * } */ - public static MethodHandle diplomat_is_str$handle() { - return diplomat_is_str.HANDLE; + public static MethodHandle ungetc$handle() { + return ungetc.HANDLE; } /** * Address for: * {@snippet lang=c : - * bool diplomat_is_str(const char *buf, size_t len) + * int ungetc(int, FILE *) * } */ - public static MemorySegment diplomat_is_str$address() { - return diplomat_is_str.ADDR; + public static MemorySegment ungetc$address() { + return ungetc.ADDR; } /** * {@snippet lang=c : - * bool diplomat_is_str(const char *buf, size_t len) + * int ungetc(int, FILE *) * } */ - public static boolean diplomat_is_str(MemorySegment buf, long len) { - var mh$ = diplomat_is_str.HANDLE; + public static int ungetc(int x0, MemorySegment x1) { + var mh$ = ungetc.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("diplomat_is_str", buf, len); + traceDowncall("ungetc", x0, x1); } - return (boolean)mh$.invokeExact(buf, len); + return (int)mh$.invokeExact(x0, x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OptionOpaqueChar_assert_char { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class vfprintf { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, somelib_h.C_POINTER, - somelib_h.C_INT + somelib_h.C_POINTER, + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaqueChar_assert_char"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("vfprintf"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10144,56 +6896,58 @@ private static class OptionOpaqueChar_assert_char { /** * Function descriptor for: * {@snippet lang=c : - * void OptionOpaqueChar_assert_char(const OptionOpaqueChar *self, char32_t ch) + * int vfprintf(FILE *restrict, const char *restrict, va_list) * } */ - public static FunctionDescriptor OptionOpaqueChar_assert_char$descriptor() { - return OptionOpaqueChar_assert_char.DESC; + public static FunctionDescriptor vfprintf$descriptor() { + return vfprintf.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void OptionOpaqueChar_assert_char(const OptionOpaqueChar *self, char32_t ch) + * int vfprintf(FILE *restrict, const char *restrict, va_list) * } */ - public static MethodHandle OptionOpaqueChar_assert_char$handle() { - return OptionOpaqueChar_assert_char.HANDLE; + public static MethodHandle vfprintf$handle() { + return vfprintf.HANDLE; } /** * Address for: * {@snippet lang=c : - * void OptionOpaqueChar_assert_char(const OptionOpaqueChar *self, char32_t ch) + * int vfprintf(FILE *restrict, const char *restrict, va_list) * } */ - public static MemorySegment OptionOpaqueChar_assert_char$address() { - return OptionOpaqueChar_assert_char.ADDR; + public static MemorySegment vfprintf$address() { + return vfprintf.ADDR; } /** * {@snippet lang=c : - * void OptionOpaqueChar_assert_char(const OptionOpaqueChar *self, char32_t ch) + * int vfprintf(FILE *restrict, const char *restrict, va_list) * } */ - public static void OptionOpaqueChar_assert_char(MemorySegment self, int ch) { - var mh$ = OptionOpaqueChar_assert_char.HANDLE; + public static int vfprintf(MemorySegment x0, MemorySegment x1, MemorySegment x2) { + var mh$ = vfprintf.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OptionOpaqueChar_assert_char", self, ch); + traceDowncall("vfprintf", x0, x1, x2); } - mh$.invokeExact(self, ch); + return (int)mh$.invokeExact(x0, x1, x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OptionOpaqueChar_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class vprintf { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaqueChar_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("vprintf"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10201,56 +6955,59 @@ private static class OptionOpaqueChar_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void OptionOpaqueChar_destroy(OptionOpaqueChar *self) + * int vprintf(const char *restrict, va_list) * } */ - public static FunctionDescriptor OptionOpaqueChar_destroy$descriptor() { - return OptionOpaqueChar_destroy.DESC; + public static FunctionDescriptor vprintf$descriptor() { + return vprintf.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void OptionOpaqueChar_destroy(OptionOpaqueChar *self) + * int vprintf(const char *restrict, va_list) * } */ - public static MethodHandle OptionOpaqueChar_destroy$handle() { - return OptionOpaqueChar_destroy.HANDLE; + public static MethodHandle vprintf$handle() { + return vprintf.HANDLE; } /** * Address for: * {@snippet lang=c : - * void OptionOpaqueChar_destroy(OptionOpaqueChar *self) + * int vprintf(const char *restrict, va_list) * } */ - public static MemorySegment OptionOpaqueChar_destroy$address() { - return OptionOpaqueChar_destroy.ADDR; + public static MemorySegment vprintf$address() { + return vprintf.ADDR; } /** * {@snippet lang=c : - * void OptionOpaqueChar_destroy(OptionOpaqueChar *self) + * int vprintf(const char *restrict, va_list) * } */ - public static void OptionOpaqueChar_destroy(MemorySegment self) { - var mh$ = OptionOpaqueChar_destroy.HANDLE; + public static int vprintf(MemorySegment x0, MemorySegment x1) { + var mh$ = vprintf.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OptionOpaqueChar_destroy", self); + traceDowncall("vprintf", x0, x1); } - mh$.invokeExact(self); + return (int)mh$.invokeExact(x0, x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Two_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class vsprintf { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Two_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("vsprintf"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10258,57 +7015,57 @@ private static class Two_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void Two_destroy(Two *self) + * int vsprintf(char *restrict, const char *restrict, va_list) * } */ - public static FunctionDescriptor Two_destroy$descriptor() { - return Two_destroy.DESC; + public static FunctionDescriptor vsprintf$descriptor() { + return vsprintf.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Two_destroy(Two *self) + * int vsprintf(char *restrict, const char *restrict, va_list) * } */ - public static MethodHandle Two_destroy$handle() { - return Two_destroy.HANDLE; + public static MethodHandle vsprintf$handle() { + return vsprintf.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Two_destroy(Two *self) + * int vsprintf(char *restrict, const char *restrict, va_list) * } */ - public static MemorySegment Two_destroy$address() { - return Two_destroy.ADDR; + public static MemorySegment vsprintf$address() { + return vsprintf.ADDR; } /** * {@snippet lang=c : - * void Two_destroy(Two *self) + * int vsprintf(char *restrict, const char *restrict, va_list) * } */ - public static void Two_destroy(MemorySegment self) { - var mh$ = Two_destroy.HANDLE; + public static int vsprintf(MemorySegment x0, MemorySegment x1, MemorySegment x2) { + var mh$ = vsprintf.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Two_destroy", self); + traceDowncall("vsprintf", x0, x1, x2); } - mh$.invokeExact(self); + return (int)mh$.invokeExact(x0, x1, x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class namespace_OpaqueIterable_iter { + private static class ctermid { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_OpaqueIterable_iter"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("ctermid"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10316,56 +7073,58 @@ private static class namespace_OpaqueIterable_iter { /** * Function descriptor for: * {@snippet lang=c : - * OpaqueIterator *namespace_OpaqueIterable_iter(const OpaqueIterable *self) + * char *ctermid(char *) * } */ - public static FunctionDescriptor namespace_OpaqueIterable_iter$descriptor() { - return namespace_OpaqueIterable_iter.DESC; + public static FunctionDescriptor ctermid$descriptor() { + return ctermid.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * OpaqueIterator *namespace_OpaqueIterable_iter(const OpaqueIterable *self) + * char *ctermid(char *) * } */ - public static MethodHandle namespace_OpaqueIterable_iter$handle() { - return namespace_OpaqueIterable_iter.HANDLE; + public static MethodHandle ctermid$handle() { + return ctermid.HANDLE; } /** * Address for: * {@snippet lang=c : - * OpaqueIterator *namespace_OpaqueIterable_iter(const OpaqueIterable *self) + * char *ctermid(char *) * } */ - public static MemorySegment namespace_OpaqueIterable_iter$address() { - return namespace_OpaqueIterable_iter.ADDR; + public static MemorySegment ctermid$address() { + return ctermid.ADDR; } /** * {@snippet lang=c : - * OpaqueIterator *namespace_OpaqueIterable_iter(const OpaqueIterable *self) + * char *ctermid(char *) * } */ - public static MemorySegment namespace_OpaqueIterable_iter(MemorySegment self) { - var mh$ = namespace_OpaqueIterable_iter.HANDLE; + public static MemorySegment ctermid(MemorySegment x0) { + var mh$ = ctermid.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("namespace_OpaqueIterable_iter", self); + traceDowncall("ctermid", x0); } - return (MemorySegment)mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class namespace_OpaqueIterable_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class fdopen { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_INT, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_OpaqueIterable_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fdopen"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10373,85 +7132,57 @@ private static class namespace_OpaqueIterable_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void namespace_OpaqueIterable_destroy(OpaqueIterable *self) + * FILE *fdopen(int, const char *) * } */ - public static FunctionDescriptor namespace_OpaqueIterable_destroy$descriptor() { - return namespace_OpaqueIterable_destroy.DESC; + public static FunctionDescriptor fdopen$descriptor() { + return fdopen.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void namespace_OpaqueIterable_destroy(OpaqueIterable *self) + * FILE *fdopen(int, const char *) * } */ - public static MethodHandle namespace_OpaqueIterable_destroy$handle() { - return namespace_OpaqueIterable_destroy.HANDLE; + public static MethodHandle fdopen$handle() { + return fdopen.HANDLE; } /** * Address for: * {@snippet lang=c : - * void namespace_OpaqueIterable_destroy(OpaqueIterable *self) + * FILE *fdopen(int, const char *) * } */ - public static MemorySegment namespace_OpaqueIterable_destroy$address() { - return namespace_OpaqueIterable_destroy.ADDR; + public static MemorySegment fdopen$address() { + return fdopen.ADDR; } /** * {@snippet lang=c : - * void namespace_OpaqueIterable_destroy(OpaqueIterable *self) + * FILE *fdopen(int, const char *) * } */ - public static void namespace_OpaqueIterable_destroy(MemorySegment self) { - var mh$ = namespace_OpaqueIterable_destroy.HANDLE; + public static MemorySegment fdopen(int x0, MemorySegment x1) { + var mh$ = fdopen.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("namespace_OpaqueIterable_destroy", self); + traceDowncall("fdopen", x0, x1); } - mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(x0, x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static final int UnimportedEnum_A = (int)0L; - /** - * {@snippet lang=c : - * enum UnimportedEnum.UnimportedEnum_A = 0 - * } - */ - public static int UnimportedEnum_A() { - return UnimportedEnum_A; - } - private static final int UnimportedEnum_B = (int)1L; - /** - * {@snippet lang=c : - * enum UnimportedEnum.UnimportedEnum_B = 1 - * } - */ - public static int UnimportedEnum_B() { - return UnimportedEnum_B; - } - private static final int UnimportedEnum_C = (int)2L; - /** - * {@snippet lang=c : - * enum UnimportedEnum.UnimportedEnum_C = 2 - * } - */ - public static int UnimportedEnum_C() { - return UnimportedEnum_C; - } - private static class MyString_new { + private static class fileno { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_INT, + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fileno"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10459,58 +7190,57 @@ private static class MyString_new { /** * Function descriptor for: * {@snippet lang=c : - * MyString *MyString_new(const char *v_data, size_t v_len) + * int fileno(FILE *) * } */ - public static FunctionDescriptor MyString_new$descriptor() { - return MyString_new.DESC; + public static FunctionDescriptor fileno$descriptor() { + return fileno.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * MyString *MyString_new(const char *v_data, size_t v_len) + * int fileno(FILE *) * } */ - public static MethodHandle MyString_new$handle() { - return MyString_new.HANDLE; + public static MethodHandle fileno$handle() { + return fileno.HANDLE; } /** * Address for: * {@snippet lang=c : - * MyString *MyString_new(const char *v_data, size_t v_len) + * int fileno(FILE *) * } */ - public static MemorySegment MyString_new$address() { - return MyString_new.ADDR; + public static MemorySegment fileno$address() { + return fileno.ADDR; } /** * {@snippet lang=c : - * MyString *MyString_new(const char *v_data, size_t v_len) + * int fileno(FILE *) * } */ - public static MemorySegment MyString_new(MemorySegment v_data, long v_len) { - var mh$ = MyString_new.HANDLE; + public static int fileno(MemorySegment x0) { + var mh$ = fileno.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyString_new", v_data, v_len); + traceDowncall("fileno", x0); } - return (MemorySegment)mh$.invokeExact(v_data, v_len); + return (int)mh$.invokeExact(x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyString_new_unsafe { + private static class pclose { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_INT, + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new_unsafe"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("pclose"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10518,58 +7248,58 @@ private static class MyString_new_unsafe { /** * Function descriptor for: * {@snippet lang=c : - * MyString *MyString_new_unsafe(const char *v_data, size_t v_len) + * int pclose(FILE *) * } */ - public static FunctionDescriptor MyString_new_unsafe$descriptor() { - return MyString_new_unsafe.DESC; + public static FunctionDescriptor pclose$descriptor() { + return pclose.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * MyString *MyString_new_unsafe(const char *v_data, size_t v_len) + * int pclose(FILE *) * } */ - public static MethodHandle MyString_new_unsafe$handle() { - return MyString_new_unsafe.HANDLE; + public static MethodHandle pclose$handle() { + return pclose.HANDLE; } /** * Address for: * {@snippet lang=c : - * MyString *MyString_new_unsafe(const char *v_data, size_t v_len) + * int pclose(FILE *) * } */ - public static MemorySegment MyString_new_unsafe$address() { - return MyString_new_unsafe.ADDR; + public static MemorySegment pclose$address() { + return pclose.ADDR; } /** * {@snippet lang=c : - * MyString *MyString_new_unsafe(const char *v_data, size_t v_len) + * int pclose(FILE *) * } */ - public static MemorySegment MyString_new_unsafe(MemorySegment v_data, long v_len) { - var mh$ = MyString_new_unsafe.HANDLE; + public static int pclose(MemorySegment x0) { + var mh$ = pclose.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyString_new_unsafe", v_data, v_len); + traceDowncall("pclose", x0); } - return (MemorySegment)mh$.invokeExact(v_data, v_len); + return (int)mh$.invokeExact(x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyString_new_owned { + private static class popen { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new_owned"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("popen"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10577,58 +7307,57 @@ private static class MyString_new_owned { /** * Function descriptor for: * {@snippet lang=c : - * MyString *MyString_new_owned(const char *v_data, size_t v_len) + * FILE *popen(const char *, const char *) * } */ - public static FunctionDescriptor MyString_new_owned$descriptor() { - return MyString_new_owned.DESC; + public static FunctionDescriptor popen$descriptor() { + return popen.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * MyString *MyString_new_owned(const char *v_data, size_t v_len) + * FILE *popen(const char *, const char *) * } */ - public static MethodHandle MyString_new_owned$handle() { - return MyString_new_owned.HANDLE; + public static MethodHandle popen$handle() { + return popen.HANDLE; } /** * Address for: * {@snippet lang=c : - * MyString *MyString_new_owned(const char *v_data, size_t v_len) + * FILE *popen(const char *, const char *) * } */ - public static MemorySegment MyString_new_owned$address() { - return MyString_new_owned.ADDR; + public static MemorySegment popen$address() { + return popen.ADDR; } /** * {@snippet lang=c : - * MyString *MyString_new_owned(const char *v_data, size_t v_len) + * FILE *popen(const char *, const char *) * } */ - public static MemorySegment MyString_new_owned(MemorySegment v_data, long v_len) { - var mh$ = MyString_new_owned.HANDLE; + public static MemorySegment popen(MemorySegment x0, MemorySegment x1) { + var mh$ = popen.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyString_new_owned", v_data, v_len); + traceDowncall("popen", x0, x1); } - return (MemorySegment)mh$.invokeExact(v_data, v_len); + return (MemorySegment)mh$.invokeExact(x0, x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyString_new_from_first { + private static class __srget { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_INT, + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new_from_first"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("__srget"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10636,58 +7365,59 @@ private static class MyString_new_from_first { /** * Function descriptor for: * {@snippet lang=c : - * MyString *MyString_new_from_first(DiplomatStringsView *v_data, size_t v_len) + * int __srget(FILE *) * } */ - public static FunctionDescriptor MyString_new_from_first$descriptor() { - return MyString_new_from_first.DESC; + public static FunctionDescriptor __srget$descriptor() { + return __srget.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * MyString *MyString_new_from_first(DiplomatStringsView *v_data, size_t v_len) + * int __srget(FILE *) * } */ - public static MethodHandle MyString_new_from_first$handle() { - return MyString_new_from_first.HANDLE; + public static MethodHandle __srget$handle() { + return __srget.HANDLE; } /** * Address for: * {@snippet lang=c : - * MyString *MyString_new_from_first(DiplomatStringsView *v_data, size_t v_len) + * int __srget(FILE *) * } */ - public static MemorySegment MyString_new_from_first$address() { - return MyString_new_from_first.ADDR; + public static MemorySegment __srget$address() { + return __srget.ADDR; } /** * {@snippet lang=c : - * MyString *MyString_new_from_first(DiplomatStringsView *v_data, size_t v_len) + * int __srget(FILE *) * } */ - public static MemorySegment MyString_new_from_first(MemorySegment v_data, long v_len) { - var mh$ = MyString_new_from_first.HANDLE; + public static int __srget(MemorySegment x0) { + var mh$ = __srget.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyString_new_from_first", v_data, v_len); + traceDowncall("__srget", x0); } - return (MemorySegment)mh$.invokeExact(v_data, v_len); + return (int)mh$.invokeExact(x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyString_set_str { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class __svfscanf { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, somelib_h.C_POINTER, somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_set_str"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("__svfscanf"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10695,57 +7425,58 @@ private static class MyString_set_str { /** * Function descriptor for: * {@snippet lang=c : - * void MyString_set_str(MyString *self, const char *new_str_data, size_t new_str_len) + * int __svfscanf(FILE *, const char *, va_list) * } */ - public static FunctionDescriptor MyString_set_str$descriptor() { - return MyString_set_str.DESC; + public static FunctionDescriptor __svfscanf$descriptor() { + return __svfscanf.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void MyString_set_str(MyString *self, const char *new_str_data, size_t new_str_len) + * int __svfscanf(FILE *, const char *, va_list) * } */ - public static MethodHandle MyString_set_str$handle() { - return MyString_set_str.HANDLE; + public static MethodHandle __svfscanf$handle() { + return __svfscanf.HANDLE; } /** * Address for: * {@snippet lang=c : - * void MyString_set_str(MyString *self, const char *new_str_data, size_t new_str_len) + * int __svfscanf(FILE *, const char *, va_list) * } */ - public static MemorySegment MyString_set_str$address() { - return MyString_set_str.ADDR; + public static MemorySegment __svfscanf$address() { + return __svfscanf.ADDR; } /** * {@snippet lang=c : - * void MyString_set_str(MyString *self, const char *new_str_data, size_t new_str_len) + * int __svfscanf(FILE *, const char *, va_list) * } */ - public static void MyString_set_str(MemorySegment self, MemorySegment new_str_data, long new_str_len) { - var mh$ = MyString_set_str.HANDLE; + public static int __svfscanf(MemorySegment x0, MemorySegment x1, MemorySegment x2) { + var mh$ = __svfscanf.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyString_set_str", self, new_str_data, new_str_len); + traceDowncall("__svfscanf", x0, x1, x2); } - mh$.invokeExact(self, new_str_data, new_str_len); + return (int)mh$.invokeExact(x0, x1, x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyString_get_str { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER, + private static class __swbuf { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_INT, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_get_str"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("__swbuf"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10753,57 +7484,56 @@ private static class MyString_get_str { /** * Function descriptor for: * {@snippet lang=c : - * void MyString_get_str(const MyString *self, DiplomatWrite *write) + * int __swbuf(int, FILE *) * } */ - public static FunctionDescriptor MyString_get_str$descriptor() { - return MyString_get_str.DESC; + public static FunctionDescriptor __swbuf$descriptor() { + return __swbuf.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void MyString_get_str(const MyString *self, DiplomatWrite *write) + * int __swbuf(int, FILE *) * } */ - public static MethodHandle MyString_get_str$handle() { - return MyString_get_str.HANDLE; + public static MethodHandle __swbuf$handle() { + return __swbuf.HANDLE; } /** * Address for: * {@snippet lang=c : - * void MyString_get_str(const MyString *self, DiplomatWrite *write) + * int __swbuf(int, FILE *) * } */ - public static MemorySegment MyString_get_str$address() { - return MyString_get_str.ADDR; + public static MemorySegment __swbuf$address() { + return __swbuf.ADDR; } /** * {@snippet lang=c : - * void MyString_get_str(const MyString *self, DiplomatWrite *write) + * int __swbuf(int, FILE *) * } */ - public static void MyString_get_str(MemorySegment self, MemorySegment write) { - var mh$ = MyString_get_str.HANDLE; + public static int __swbuf(int x0, MemorySegment x1) { + var mh$ = __swbuf.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyString_get_str", self, write); + traceDowncall("__swbuf", x0, x1); } - mh$.invokeExact(self, write); + return (int)mh$.invokeExact(x0, x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyString_get_boxed_str { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - DiplomatStringView.layout(), + private static class flockfile { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_get_boxed_str"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("flockfile"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10811,56 +7541,57 @@ private static class MyString_get_boxed_str { /** * Function descriptor for: * {@snippet lang=c : - * DiplomatStringView MyString_get_boxed_str(const MyString *self) + * void flockfile(FILE *) * } */ - public static FunctionDescriptor MyString_get_boxed_str$descriptor() { - return MyString_get_boxed_str.DESC; + public static FunctionDescriptor flockfile$descriptor() { + return flockfile.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * DiplomatStringView MyString_get_boxed_str(const MyString *self) + * void flockfile(FILE *) * } */ - public static MethodHandle MyString_get_boxed_str$handle() { - return MyString_get_boxed_str.HANDLE; + public static MethodHandle flockfile$handle() { + return flockfile.HANDLE; } /** * Address for: * {@snippet lang=c : - * DiplomatStringView MyString_get_boxed_str(const MyString *self) + * void flockfile(FILE *) * } */ - public static MemorySegment MyString_get_boxed_str$address() { - return MyString_get_boxed_str.ADDR; + public static MemorySegment flockfile$address() { + return flockfile.ADDR; } /** * {@snippet lang=c : - * DiplomatStringView MyString_get_boxed_str(const MyString *self) + * void flockfile(FILE *) * } */ - public static MemorySegment MyString_get_boxed_str(SegmentAllocator allocator, MemorySegment self) { - var mh$ = MyString_get_boxed_str.HANDLE; + public static void flockfile(MemorySegment x0) { + var mh$ = flockfile.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyString_get_boxed_str", allocator, self); + traceDowncall("flockfile", x0); } - return (MemorySegment)mh$.invokeExact(allocator, self); + mh$.invokeExact(x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyString_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class ftrylockfile { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("ftrylockfile"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10868,57 +7599,56 @@ private static class MyString_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void MyString_destroy(MyString *self) + * int ftrylockfile(FILE *) * } */ - public static FunctionDescriptor MyString_destroy$descriptor() { - return MyString_destroy.DESC; + public static FunctionDescriptor ftrylockfile$descriptor() { + return ftrylockfile.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void MyString_destroy(MyString *self) + * int ftrylockfile(FILE *) * } */ - public static MethodHandle MyString_destroy$handle() { - return MyString_destroy.HANDLE; + public static MethodHandle ftrylockfile$handle() { + return ftrylockfile.HANDLE; } /** * Address for: * {@snippet lang=c : - * void MyString_destroy(MyString *self) + * int ftrylockfile(FILE *) * } */ - public static MemorySegment MyString_destroy$address() { - return MyString_destroy.ADDR; + public static MemorySegment ftrylockfile$address() { + return ftrylockfile.ADDR; } /** * {@snippet lang=c : - * void MyString_destroy(MyString *self) + * int ftrylockfile(FILE *) * } */ - public static void MyString_destroy(MemorySegment self) { - var mh$ = MyString_destroy.HANDLE; + public static int ftrylockfile(MemorySegment x0) { + var mh$ = ftrylockfile.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyString_destroy", self); + traceDowncall("ftrylockfile", x0); } - mh$.invokeExact(self); + return (int)mh$.invokeExact(x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class namespace_MyIterator_next { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - namespace_MyIterator_next_result.layout(), + private static class funlockfile { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_MyIterator_next"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("funlockfile"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10926,56 +7656,57 @@ private static class namespace_MyIterator_next { /** * Function descriptor for: * {@snippet lang=c : - * struct namespace_MyIterator_next_result namespace_MyIterator_next(MyIterator *self) + * void funlockfile(FILE *) * } */ - public static FunctionDescriptor namespace_MyIterator_next$descriptor() { - return namespace_MyIterator_next.DESC; + public static FunctionDescriptor funlockfile$descriptor() { + return funlockfile.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * struct namespace_MyIterator_next_result namespace_MyIterator_next(MyIterator *self) + * void funlockfile(FILE *) * } */ - public static MethodHandle namespace_MyIterator_next$handle() { - return namespace_MyIterator_next.HANDLE; + public static MethodHandle funlockfile$handle() { + return funlockfile.HANDLE; } /** * Address for: * {@snippet lang=c : - * struct namespace_MyIterator_next_result namespace_MyIterator_next(MyIterator *self) + * void funlockfile(FILE *) * } */ - public static MemorySegment namespace_MyIterator_next$address() { - return namespace_MyIterator_next.ADDR; + public static MemorySegment funlockfile$address() { + return funlockfile.ADDR; } /** * {@snippet lang=c : - * struct namespace_MyIterator_next_result namespace_MyIterator_next(MyIterator *self) + * void funlockfile(FILE *) * } */ - public static MemorySegment namespace_MyIterator_next(SegmentAllocator allocator, MemorySegment self) { - var mh$ = namespace_MyIterator_next.HANDLE; + public static void funlockfile(MemorySegment x0) { + var mh$ = funlockfile.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("namespace_MyIterator_next", allocator, self); + traceDowncall("funlockfile", x0); } - return (MemorySegment)mh$.invokeExact(allocator, self); + mh$.invokeExact(x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class namespace_MyIterator_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class getc_unlocked { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_MyIterator_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("getc_unlocked"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10983,57 +7714,55 @@ private static class namespace_MyIterator_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void namespace_MyIterator_destroy(MyIterator *self) + * int getc_unlocked(FILE *) * } */ - public static FunctionDescriptor namespace_MyIterator_destroy$descriptor() { - return namespace_MyIterator_destroy.DESC; + public static FunctionDescriptor getc_unlocked$descriptor() { + return getc_unlocked.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void namespace_MyIterator_destroy(MyIterator *self) + * int getc_unlocked(FILE *) * } */ - public static MethodHandle namespace_MyIterator_destroy$handle() { - return namespace_MyIterator_destroy.HANDLE; + public static MethodHandle getc_unlocked$handle() { + return getc_unlocked.HANDLE; } /** * Address for: * {@snippet lang=c : - * void namespace_MyIterator_destroy(MyIterator *self) + * int getc_unlocked(FILE *) * } */ - public static MemorySegment namespace_MyIterator_destroy$address() { - return namespace_MyIterator_destroy.ADDR; + public static MemorySegment getc_unlocked$address() { + return getc_unlocked.ADDR; } /** * {@snippet lang=c : - * void namespace_MyIterator_destroy(MyIterator *self) + * int getc_unlocked(FILE *) * } */ - public static void namespace_MyIterator_destroy(MemorySegment self) { - var mh$ = namespace_MyIterator_destroy.HANDLE; + public static int getc_unlocked(MemorySegment x0) { + var mh$ = getc_unlocked.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("namespace_MyIterator_destroy", self); + traceDowncall("getc_unlocked", x0); } - mh$.invokeExact(self); + return (int)mh$.invokeExact(x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Bar_foo { + private static class getchar_unlocked { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); + somelib_h.C_INT ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Bar_foo"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("getchar_unlocked"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11041,56 +7770,58 @@ private static class Bar_foo { /** * Function descriptor for: * {@snippet lang=c : - * const Foo *Bar_foo(const Bar *self) + * int getchar_unlocked() * } */ - public static FunctionDescriptor Bar_foo$descriptor() { - return Bar_foo.DESC; + public static FunctionDescriptor getchar_unlocked$descriptor() { + return getchar_unlocked.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * const Foo *Bar_foo(const Bar *self) + * int getchar_unlocked() * } */ - public static MethodHandle Bar_foo$handle() { - return Bar_foo.HANDLE; + public static MethodHandle getchar_unlocked$handle() { + return getchar_unlocked.HANDLE; } /** * Address for: * {@snippet lang=c : - * const Foo *Bar_foo(const Bar *self) + * int getchar_unlocked() * } */ - public static MemorySegment Bar_foo$address() { - return Bar_foo.ADDR; + public static MemorySegment getchar_unlocked$address() { + return getchar_unlocked.ADDR; } /** * {@snippet lang=c : - * const Foo *Bar_foo(const Bar *self) + * int getchar_unlocked() * } */ - public static MemorySegment Bar_foo(MemorySegment self) { - var mh$ = Bar_foo.HANDLE; + public static int getchar_unlocked() { + var mh$ = getchar_unlocked.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Bar_foo", self); + traceDowncall("getchar_unlocked"); } - return (MemorySegment)mh$.invokeExact(self); + return (int)mh$.invokeExact(); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Bar_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class putc_unlocked { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_INT, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Bar_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("putc_unlocked"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11098,111 +7829,57 @@ private static class Bar_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void Bar_destroy(Bar *self) + * int putc_unlocked(int, FILE *) * } */ - public static FunctionDescriptor Bar_destroy$descriptor() { - return Bar_destroy.DESC; + public static FunctionDescriptor putc_unlocked$descriptor() { + return putc_unlocked.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Bar_destroy(Bar *self) + * int putc_unlocked(int, FILE *) * } */ - public static MethodHandle Bar_destroy$handle() { - return Bar_destroy.HANDLE; + public static MethodHandle putc_unlocked$handle() { + return putc_unlocked.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Bar_destroy(Bar *self) + * int putc_unlocked(int, FILE *) * } */ - public static MemorySegment Bar_destroy$address() { - return Bar_destroy.ADDR; + public static MemorySegment putc_unlocked$address() { + return putc_unlocked.ADDR; } /** * {@snippet lang=c : - * void Bar_destroy(Bar *self) + * int putc_unlocked(int, FILE *) * } */ - public static void Bar_destroy(MemorySegment self) { - var mh$ = Bar_destroy.HANDLE; + public static int putc_unlocked(int x0, MemorySegment x1) { + var mh$ = putc_unlocked.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Bar_destroy", self); + traceDowncall("putc_unlocked", x0, x1); } - mh$.invokeExact(self); + return (int)mh$.invokeExact(x0, x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static final int MyEnum_A = (int)-2L; - /** - * {@snippet lang=c : - * enum MyEnum.MyEnum_A = -2 - * } - */ - public static int MyEnum_A() { - return MyEnum_A; - } - private static final int MyEnum_B = (int)-1L; - /** - * {@snippet lang=c : - * enum MyEnum.MyEnum_B = -1 - * } - */ - public static int MyEnum_B() { - return MyEnum_B; - } - private static final int MyEnum_C = (int)0L; - /** - * {@snippet lang=c : - * enum MyEnum.MyEnum_C = 0 - * } - */ - public static int MyEnum_C() { - return MyEnum_C; - } - private static final int MyEnum_D = (int)1L; - /** - * {@snippet lang=c : - * enum MyEnum.MyEnum_D = 1 - * } - */ - public static int MyEnum_D() { - return MyEnum_D; - } - private static final int MyEnum_E = (int)2L; - /** - * {@snippet lang=c : - * enum MyEnum.MyEnum_E = 2 - * } - */ - public static int MyEnum_E() { - return MyEnum_E; - } - private static final int MyEnum_F = (int)3L; - /** - * {@snippet lang=c : - * enum MyEnum.MyEnum_F = 3 - * } - */ - public static int MyEnum_F() { - return MyEnum_F; - } - private static class MyEnum_into_value { + private static class putchar_unlocked { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_CHAR, + somelib_h.C_INT, somelib_h.C_INT ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyEnum_into_value"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("putchar_unlocked"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11210,128 +7887,116 @@ private static class MyEnum_into_value { /** * Function descriptor for: * {@snippet lang=c : - * int8_t MyEnum_into_value(MyEnum self) + * int putchar_unlocked(int) * } */ - public static FunctionDescriptor MyEnum_into_value$descriptor() { - return MyEnum_into_value.DESC; + public static FunctionDescriptor putchar_unlocked$descriptor() { + return putchar_unlocked.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int8_t MyEnum_into_value(MyEnum self) + * int putchar_unlocked(int) * } */ - public static MethodHandle MyEnum_into_value$handle() { - return MyEnum_into_value.HANDLE; + public static MethodHandle putchar_unlocked$handle() { + return putchar_unlocked.HANDLE; } /** * Address for: * {@snippet lang=c : - * int8_t MyEnum_into_value(MyEnum self) + * int putchar_unlocked(int) * } */ - public static MemorySegment MyEnum_into_value$address() { - return MyEnum_into_value.ADDR; + public static MemorySegment putchar_unlocked$address() { + return putchar_unlocked.ADDR; } /** * {@snippet lang=c : - * int8_t MyEnum_into_value(MyEnum self) + * int putchar_unlocked(int) * } */ - public static byte MyEnum_into_value(int self) { - var mh$ = MyEnum_into_value.HANDLE; + public static int putchar_unlocked(int x0) { + var mh$ = putchar_unlocked.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyEnum_into_value", self); + traceDowncall("putchar_unlocked", x0); } - return (byte)mh$.invokeExact(self); + return (int)mh$.invokeExact(x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } + private static class getw { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("getw"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + /** - * Variadic invoker class for: + * Function descriptor for: * {@snippet lang=c : - * MyEnum MyEnum_get_a() + * int getw(FILE *) * } */ - public static class MyEnum_get_a { - private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - somelib_h.C_INT ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("MyEnum_get_a"); - - private final MethodHandle handle; - private final FunctionDescriptor descriptor; - private final MethodHandle spreader; - - private MyEnum_get_a(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { - this.handle = handle; - this.descriptor = descriptor; - this.spreader = spreader; - } - - /** - * Variadic invoker factory for: - * {@snippet lang=c : - * MyEnum MyEnum_get_a() - * } - */ - public static MyEnum_get_a makeInvoker(MemoryLayout... layouts) { - FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); - Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); - var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); - var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new MyEnum_get_a(mh$, desc$, spreader$); - } - - /** - * {@return the address} - */ - public static MemorySegment address() { - return ADDR; - } + public static FunctionDescriptor getw$descriptor() { + return getw.DESC; + } - /** - * {@return the specialized method handle} - */ - public MethodHandle handle() { - return handle; - } + /** + * Downcall method handle for: + * {@snippet lang=c : + * int getw(FILE *) + * } + */ + public static MethodHandle getw$handle() { + return getw.HANDLE; + } - /** - * {@return the specialized descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } + /** + * Address for: + * {@snippet lang=c : + * int getw(FILE *) + * } + */ + public static MemorySegment getw$address() { + return getw.ADDR; + } - public int apply(Object... x0) { - try { - if (TRACE_DOWNCALLS) { - traceDowncall("MyEnum_get_a", x0); - } - return (int)spreader.invokeExact(x0); - } catch(IllegalArgumentException | ClassCastException ex$) { - throw ex$; // rethrow IAE from passing wrong number/type of args - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); + /** + * {@snippet lang=c : + * int getw(FILE *) + * } + */ + public static int getw(MemorySegment x0) { + var mh$ = getw.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("getw", x0); } + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); } } - private static class OptionString_new { + private static class putw { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_INT, + somelib_h.C_INT, + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionString_new"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("putw"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11339,58 +8004,58 @@ private static class OptionString_new { /** * Function descriptor for: * {@snippet lang=c : - * OptionString *OptionString_new(const char *diplomat_str_data, size_t diplomat_str_len) + * int putw(int, FILE *) * } */ - public static FunctionDescriptor OptionString_new$descriptor() { - return OptionString_new.DESC; + public static FunctionDescriptor putw$descriptor() { + return putw.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * OptionString *OptionString_new(const char *diplomat_str_data, size_t diplomat_str_len) + * int putw(int, FILE *) * } */ - public static MethodHandle OptionString_new$handle() { - return OptionString_new.HANDLE; + public static MethodHandle putw$handle() { + return putw.HANDLE; } /** * Address for: * {@snippet lang=c : - * OptionString *OptionString_new(const char *diplomat_str_data, size_t diplomat_str_len) + * int putw(int, FILE *) * } */ - public static MemorySegment OptionString_new$address() { - return OptionString_new.ADDR; + public static MemorySegment putw$address() { + return putw.ADDR; } /** * {@snippet lang=c : - * OptionString *OptionString_new(const char *diplomat_str_data, size_t diplomat_str_len) + * int putw(int, FILE *) * } */ - public static MemorySegment OptionString_new(MemorySegment diplomat_str_data, long diplomat_str_len) { - var mh$ = OptionString_new.HANDLE; + public static int putw(int x0, MemorySegment x1) { + var mh$ = putw.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OptionString_new", diplomat_str_data, diplomat_str_len); + traceDowncall("putw", x0, x1); } - return (MemorySegment)mh$.invokeExact(diplomat_str_data, diplomat_str_len); + return (int)mh$.invokeExact(x0, x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OptionString_write { + private static class tempnam { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - OptionString_write_result.layout(), + somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionString_write"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("tempnam"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11398,57 +8063,65 @@ private static class OptionString_write { /** * Function descriptor for: * {@snippet lang=c : - * struct OptionString_write_result OptionString_write(const OptionString *self, DiplomatWrite *write) + * char *tempnam(const char *__dir, const char *__prefix) * } */ - public static FunctionDescriptor OptionString_write$descriptor() { - return OptionString_write.DESC; + public static FunctionDescriptor tempnam$descriptor() { + return tempnam.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * struct OptionString_write_result OptionString_write(const OptionString *self, DiplomatWrite *write) + * char *tempnam(const char *__dir, const char *__prefix) * } */ - public static MethodHandle OptionString_write$handle() { - return OptionString_write.HANDLE; + public static MethodHandle tempnam$handle() { + return tempnam.HANDLE; } /** * Address for: * {@snippet lang=c : - * struct OptionString_write_result OptionString_write(const OptionString *self, DiplomatWrite *write) + * char *tempnam(const char *__dir, const char *__prefix) * } */ - public static MemorySegment OptionString_write$address() { - return OptionString_write.ADDR; + public static MemorySegment tempnam$address() { + return tempnam.ADDR; } /** * {@snippet lang=c : - * struct OptionString_write_result OptionString_write(const OptionString *self, DiplomatWrite *write) + * char *tempnam(const char *__dir, const char *__prefix) * } */ - public static MemorySegment OptionString_write(SegmentAllocator allocator, MemorySegment self, MemorySegment write) { - var mh$ = OptionString_write.HANDLE; + public static MemorySegment tempnam(MemorySegment __dir, MemorySegment __prefix) { + var mh$ = tempnam.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OptionString_write", allocator, self, write); + traceDowncall("tempnam", __dir, __prefix); } - return (MemorySegment)mh$.invokeExact(allocator, self, write); + return (MemorySegment)mh$.invokeExact(__dir, __prefix); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } + /** + * {@snippet lang=c : + * typedef __darwin_off_t off_t + * } + */ + public static final OfLong off_t = somelib_h.C_LONG_LONG; - private static class OptionString_borrow { + private static class fseeko { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - OptionString_borrow_result.layout(), - somelib_h.C_POINTER + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_LONG_LONG, + somelib_h.C_INT ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionString_borrow"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fseeko"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11456,56 +8129,57 @@ private static class OptionString_borrow { /** * Function descriptor for: * {@snippet lang=c : - * struct OptionString_borrow_result OptionString_borrow(const OptionString *self) + * int fseeko(FILE *__stream, off_t __offset, int __whence) * } */ - public static FunctionDescriptor OptionString_borrow$descriptor() { - return OptionString_borrow.DESC; + public static FunctionDescriptor fseeko$descriptor() { + return fseeko.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * struct OptionString_borrow_result OptionString_borrow(const OptionString *self) + * int fseeko(FILE *__stream, off_t __offset, int __whence) * } */ - public static MethodHandle OptionString_borrow$handle() { - return OptionString_borrow.HANDLE; + public static MethodHandle fseeko$handle() { + return fseeko.HANDLE; } /** * Address for: * {@snippet lang=c : - * struct OptionString_borrow_result OptionString_borrow(const OptionString *self) + * int fseeko(FILE *__stream, off_t __offset, int __whence) * } */ - public static MemorySegment OptionString_borrow$address() { - return OptionString_borrow.ADDR; + public static MemorySegment fseeko$address() { + return fseeko.ADDR; } /** * {@snippet lang=c : - * struct OptionString_borrow_result OptionString_borrow(const OptionString *self) + * int fseeko(FILE *__stream, off_t __offset, int __whence) * } */ - public static MemorySegment OptionString_borrow(SegmentAllocator allocator, MemorySegment self) { - var mh$ = OptionString_borrow.HANDLE; + public static int fseeko(MemorySegment __stream, long __offset, int __whence) { + var mh$ = fseeko.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OptionString_borrow", allocator, self); + traceDowncall("fseeko", __stream, __offset, __whence); } - return (MemorySegment)mh$.invokeExact(allocator, self); + return (int)mh$.invokeExact(__stream, __offset, __whence); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OptionString_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class ftello { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_LONG_LONG, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionString_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("ftello"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11513,84 +8187,192 @@ private static class OptionString_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void OptionString_destroy(OptionString *self) + * off_t ftello(FILE *__stream) * } */ - public static FunctionDescriptor OptionString_destroy$descriptor() { - return OptionString_destroy.DESC; + public static FunctionDescriptor ftello$descriptor() { + return ftello.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void OptionString_destroy(OptionString *self) + * off_t ftello(FILE *__stream) * } */ - public static MethodHandle OptionString_destroy$handle() { - return OptionString_destroy.HANDLE; + public static MethodHandle ftello$handle() { + return ftello.HANDLE; } /** * Address for: * {@snippet lang=c : - * void OptionString_destroy(OptionString *self) + * off_t ftello(FILE *__stream) * } */ - public static MemorySegment OptionString_destroy$address() { - return OptionString_destroy.ADDR; + public static MemorySegment ftello$address() { + return ftello.ADDR; } /** * {@snippet lang=c : - * void OptionString_destroy(OptionString *self) + * off_t ftello(FILE *__stream) * } */ - public static void OptionString_destroy(MemorySegment self) { - var mh$ = OptionString_destroy.HANDLE; + public static long ftello(MemorySegment __stream) { + var mh$ = ftello.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OptionString_destroy", self); + traceDowncall("ftello", __stream); } - mh$.invokeExact(self); + return (long)mh$.invokeExact(__stream); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static final int AttrEnum_A = (int)0L; + + /** + * Variadic invoker class for: + * {@snippet lang=c : + * int snprintf(char *restrict __str, size_t __size, const char *restrict __format, ...) + * } + */ + public static class snprintf { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_LONG, + somelib_h.C_POINTER + ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("snprintf"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private snprintf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * int snprintf(char *restrict __str, size_t __size, const char *restrict __format, ...) + * } + */ + public static snprintf makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new snprintf(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public int apply(MemorySegment __str, long __size, MemorySegment __format, Object... x3) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("snprintf", __str, __size, __format, x3); + } + return (int)spreader.invokeExact(__str, __size, __format, x3); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static class vfscanf { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("vfscanf"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int vfscanf(FILE *restrict __stream, const char *restrict __format, va_list) + * } + */ + public static FunctionDescriptor vfscanf$descriptor() { + return vfscanf.DESC; + } + /** + * Downcall method handle for: * {@snippet lang=c : - * enum AttrEnum.AttrEnum_A = 0 + * int vfscanf(FILE *restrict __stream, const char *restrict __format, va_list) * } */ - public static int AttrEnum_A() { - return AttrEnum_A; + public static MethodHandle vfscanf$handle() { + return vfscanf.HANDLE; } - private static final int AttrEnum_B = (int)1L; + /** + * Address for: * {@snippet lang=c : - * enum AttrEnum.AttrEnum_B = 1 + * int vfscanf(FILE *restrict __stream, const char *restrict __format, va_list) * } */ - public static int AttrEnum_B() { - return AttrEnum_B; + public static MemorySegment vfscanf$address() { + return vfscanf.ADDR; } - private static final int AttrEnum_C = (int)2L; + /** * {@snippet lang=c : - * enum AttrEnum.AttrEnum_C = 2 + * int vfscanf(FILE *restrict __stream, const char *restrict __format, va_list) * } */ - public static int AttrEnum_C() { - return AttrEnum_C; + public static int vfscanf(MemorySegment __stream, MemorySegment __format, MemorySegment x2) { + var mh$ = vfscanf.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("vfscanf", __stream, __format, x2); + } + return (int)mh$.invokeExact(__stream, __format, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } } - private static class namespace_Unnamespaced_make { + private static class vscanf { public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, somelib_h.C_POINTER, - somelib_h.C_INT + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_Unnamespaced_make"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("vscanf"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11598,57 +8380,60 @@ private static class namespace_Unnamespaced_make { /** * Function descriptor for: * {@snippet lang=c : - * Unnamespaced *namespace_Unnamespaced_make(AttrEnum _e) + * int vscanf(const char *restrict __format, va_list) * } */ - public static FunctionDescriptor namespace_Unnamespaced_make$descriptor() { - return namespace_Unnamespaced_make.DESC; + public static FunctionDescriptor vscanf$descriptor() { + return vscanf.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Unnamespaced *namespace_Unnamespaced_make(AttrEnum _e) + * int vscanf(const char *restrict __format, va_list) * } */ - public static MethodHandle namespace_Unnamespaced_make$handle() { - return namespace_Unnamespaced_make.HANDLE; + public static MethodHandle vscanf$handle() { + return vscanf.HANDLE; } /** * Address for: * {@snippet lang=c : - * Unnamespaced *namespace_Unnamespaced_make(AttrEnum _e) + * int vscanf(const char *restrict __format, va_list) * } */ - public static MemorySegment namespace_Unnamespaced_make$address() { - return namespace_Unnamespaced_make.ADDR; + public static MemorySegment vscanf$address() { + return vscanf.ADDR; } /** * {@snippet lang=c : - * Unnamespaced *namespace_Unnamespaced_make(AttrEnum _e) + * int vscanf(const char *restrict __format, va_list) * } */ - public static MemorySegment namespace_Unnamespaced_make(int _e) { - var mh$ = namespace_Unnamespaced_make.HANDLE; + public static int vscanf(MemorySegment __format, MemorySegment x1) { + var mh$ = vscanf.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("namespace_Unnamespaced_make", _e); + traceDowncall("vscanf", __format, x1); } - return (MemorySegment)mh$.invokeExact(_e); + return (int)mh$.invokeExact(__format, x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class namespace_Unnamespaced_use_namespaced { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class vsnprintf { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_LONG, somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_Unnamespaced_use_namespaced"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("vsnprintf"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11656,56 +8441,59 @@ private static class namespace_Unnamespaced_use_namespaced { /** * Function descriptor for: * {@snippet lang=c : - * void namespace_Unnamespaced_use_namespaced(const Unnamespaced *self, const AttrOpaque1 *_n) + * int vsnprintf(char *restrict __str, size_t __size, const char *restrict __format, va_list) * } */ - public static FunctionDescriptor namespace_Unnamespaced_use_namespaced$descriptor() { - return namespace_Unnamespaced_use_namespaced.DESC; + public static FunctionDescriptor vsnprintf$descriptor() { + return vsnprintf.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void namespace_Unnamespaced_use_namespaced(const Unnamespaced *self, const AttrOpaque1 *_n) + * int vsnprintf(char *restrict __str, size_t __size, const char *restrict __format, va_list) * } */ - public static MethodHandle namespace_Unnamespaced_use_namespaced$handle() { - return namespace_Unnamespaced_use_namespaced.HANDLE; + public static MethodHandle vsnprintf$handle() { + return vsnprintf.HANDLE; } /** * Address for: * {@snippet lang=c : - * void namespace_Unnamespaced_use_namespaced(const Unnamespaced *self, const AttrOpaque1 *_n) + * int vsnprintf(char *restrict __str, size_t __size, const char *restrict __format, va_list) * } */ - public static MemorySegment namespace_Unnamespaced_use_namespaced$address() { - return namespace_Unnamespaced_use_namespaced.ADDR; + public static MemorySegment vsnprintf$address() { + return vsnprintf.ADDR; } /** * {@snippet lang=c : - * void namespace_Unnamespaced_use_namespaced(const Unnamespaced *self, const AttrOpaque1 *_n) + * int vsnprintf(char *restrict __str, size_t __size, const char *restrict __format, va_list) * } */ - public static void namespace_Unnamespaced_use_namespaced(MemorySegment self, MemorySegment _n) { - var mh$ = namespace_Unnamespaced_use_namespaced.HANDLE; + public static int vsnprintf(MemorySegment __str, long __size, MemorySegment __format, MemorySegment x3) { + var mh$ = vsnprintf.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("namespace_Unnamespaced_use_namespaced", self, _n); + traceDowncall("vsnprintf", __str, __size, __format, x3); } - mh$.invokeExact(self, _n); + return (int)mh$.invokeExact(__str, __size, __format, x3); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class namespace_Unnamespaced_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class vsscanf { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_Unnamespaced_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("vsscanf"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11713,66 +8501,75 @@ private static class namespace_Unnamespaced_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void namespace_Unnamespaced_destroy(Unnamespaced *self) + * int vsscanf(const char *restrict __str, const char *restrict __format, va_list) * } */ - public static FunctionDescriptor namespace_Unnamespaced_destroy$descriptor() { - return namespace_Unnamespaced_destroy.DESC; + public static FunctionDescriptor vsscanf$descriptor() { + return vsscanf.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void namespace_Unnamespaced_destroy(Unnamespaced *self) + * int vsscanf(const char *restrict __str, const char *restrict __format, va_list) * } */ - public static MethodHandle namespace_Unnamespaced_destroy$handle() { - return namespace_Unnamespaced_destroy.HANDLE; + public static MethodHandle vsscanf$handle() { + return vsscanf.HANDLE; } /** * Address for: * {@snippet lang=c : - * void namespace_Unnamespaced_destroy(Unnamespaced *self) + * int vsscanf(const char *restrict __str, const char *restrict __format, va_list) * } */ - public static MemorySegment namespace_Unnamespaced_destroy$address() { - return namespace_Unnamespaced_destroy.ADDR; + public static MemorySegment vsscanf$address() { + return vsscanf.ADDR; } /** * {@snippet lang=c : - * void namespace_Unnamespaced_destroy(Unnamespaced *self) + * int vsscanf(const char *restrict __str, const char *restrict __format, va_list) * } */ - public static void namespace_Unnamespaced_destroy(MemorySegment self) { - var mh$ = namespace_Unnamespaced_destroy.HANDLE; + public static int vsscanf(MemorySegment __str, MemorySegment __format, MemorySegment x2) { + var mh$ = vsscanf.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("namespace_Unnamespaced_destroy", self); + traceDowncall("vsscanf", __str, __format, x2); } - mh$.invokeExact(self); + return (int)mh$.invokeExact(__str, __format, x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } + /** + * {@snippet lang=c : + * typedef __darwin_ssize_t ssize_t + * } + */ + public static final OfLong ssize_t = somelib_h.C_LONG; /** * Variadic invoker class for: * {@snippet lang=c : - * Opaque *Opaque_new() + * int dprintf(int, const char *restrict, ...) * } */ - public static class Opaque_new { + public static class dprintf { private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - somelib_h.C_POINTER ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_new"); + somelib_h.C_INT, + somelib_h.C_INT, + somelib_h.C_POINTER + ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("dprintf"); private final MethodHandle handle; private final FunctionDescriptor descriptor; private final MethodHandle spreader; - private Opaque_new(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + private dprintf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { this.handle = handle; this.descriptor = descriptor; this.spreader = spreader; @@ -11781,15 +8578,15 @@ private Opaque_new(MethodHandle handle, FunctionDescriptor descriptor, MethodHan /** * Variadic invoker factory for: * {@snippet lang=c : - * Opaque *Opaque_new() + * int dprintf(int, const char *restrict, ...) * } */ - public static Opaque_new makeInvoker(MemoryLayout... layouts) { + public static dprintf makeInvoker(MemoryLayout... layouts) { FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new Opaque_new(mh$, desc$, spreader$); + return new dprintf(mh$, desc$, spreader$); } /** @@ -11813,12 +8610,12 @@ public FunctionDescriptor descriptor() { return descriptor; } - public MemorySegment apply(Object... x0) { + public int apply(int x0, MemorySegment x1, Object... x2) { try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_new", x0); + traceDowncall("dprintf", x0, x1, x2); } - return (MemorySegment)spreader.invokeExact(x0); + return (int)spreader.invokeExact(x0, x1, x2); } catch(IllegalArgumentException | ClassCastException ex$) { throw ex$; // rethrow IAE from passing wrong number/type of args } catch (Throwable ex$) { @@ -11827,14 +8624,15 @@ public MemorySegment apply(Object... x0) { } } - private static class Opaque_try_from_utf8 { + private static class vdprintf { public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_INT, somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_try_from_utf8"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("vdprintf"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11842,58 +8640,60 @@ private static class Opaque_try_from_utf8 { /** * Function descriptor for: * {@snippet lang=c : - * Opaque *Opaque_try_from_utf8(const char *input_data, size_t input_len) + * int vdprintf(int, const char *restrict, va_list) * } */ - public static FunctionDescriptor Opaque_try_from_utf8$descriptor() { - return Opaque_try_from_utf8.DESC; + public static FunctionDescriptor vdprintf$descriptor() { + return vdprintf.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Opaque *Opaque_try_from_utf8(const char *input_data, size_t input_len) + * int vdprintf(int, const char *restrict, va_list) * } */ - public static MethodHandle Opaque_try_from_utf8$handle() { - return Opaque_try_from_utf8.HANDLE; + public static MethodHandle vdprintf$handle() { + return vdprintf.HANDLE; } /** * Address for: * {@snippet lang=c : - * Opaque *Opaque_try_from_utf8(const char *input_data, size_t input_len) + * int vdprintf(int, const char *restrict, va_list) * } */ - public static MemorySegment Opaque_try_from_utf8$address() { - return Opaque_try_from_utf8.ADDR; + public static MemorySegment vdprintf$address() { + return vdprintf.ADDR; } /** * {@snippet lang=c : - * Opaque *Opaque_try_from_utf8(const char *input_data, size_t input_len) + * int vdprintf(int, const char *restrict, va_list) * } */ - public static MemorySegment Opaque_try_from_utf8(MemorySegment input_data, long input_len) { - var mh$ = Opaque_try_from_utf8.HANDLE; + public static int vdprintf(int x0, MemorySegment x1, MemorySegment x2) { + var mh$ = vdprintf.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_try_from_utf8", input_data, input_len); + traceDowncall("vdprintf", x0, x1, x2); } - return (MemorySegment)mh$.invokeExact(input_data, input_len); + return (int)mh$.invokeExact(x0, x1, x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Opaque_from_str { + private static class getdelim { public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_LONG, somelib_h.C_POINTER, somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_INT, + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_from_str"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("getdelim"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11901,57 +8701,59 @@ private static class Opaque_from_str { /** * Function descriptor for: * {@snippet lang=c : - * Opaque *Opaque_from_str(const char *input_data, size_t input_len) + * ssize_t getdelim(char **restrict __linep, size_t *restrict __linecapp, int __delimiter, FILE *restrict __stream) * } */ - public static FunctionDescriptor Opaque_from_str$descriptor() { - return Opaque_from_str.DESC; + public static FunctionDescriptor getdelim$descriptor() { + return getdelim.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Opaque *Opaque_from_str(const char *input_data, size_t input_len) + * ssize_t getdelim(char **restrict __linep, size_t *restrict __linecapp, int __delimiter, FILE *restrict __stream) * } */ - public static MethodHandle Opaque_from_str$handle() { - return Opaque_from_str.HANDLE; + public static MethodHandle getdelim$handle() { + return getdelim.HANDLE; } /** * Address for: * {@snippet lang=c : - * Opaque *Opaque_from_str(const char *input_data, size_t input_len) + * ssize_t getdelim(char **restrict __linep, size_t *restrict __linecapp, int __delimiter, FILE *restrict __stream) * } */ - public static MemorySegment Opaque_from_str$address() { - return Opaque_from_str.ADDR; + public static MemorySegment getdelim$address() { + return getdelim.ADDR; } /** * {@snippet lang=c : - * Opaque *Opaque_from_str(const char *input_data, size_t input_len) + * ssize_t getdelim(char **restrict __linep, size_t *restrict __linecapp, int __delimiter, FILE *restrict __stream) * } */ - public static MemorySegment Opaque_from_str(MemorySegment input_data, long input_len) { - var mh$ = Opaque_from_str.HANDLE; + public static long getdelim(MemorySegment __linep, MemorySegment __linecapp, int __delimiter, MemorySegment __stream) { + var mh$ = getdelim.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_from_str", input_data, input_len); + traceDowncall("getdelim", __linep, __linecapp, __delimiter, __stream); } - return (MemorySegment)mh$.invokeExact(input_data, input_len); + return (long)mh$.invokeExact(__linep, __linecapp, __delimiter, __stream); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Opaque_get_debug_str { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class getline { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_LONG, + somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_get_debug_str"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("getline"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11959,57 +8761,59 @@ private static class Opaque_get_debug_str { /** * Function descriptor for: * {@snippet lang=c : - * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) + * ssize_t getline(char **restrict __linep, size_t *restrict __linecapp, FILE *restrict __stream) * } */ - public static FunctionDescriptor Opaque_get_debug_str$descriptor() { - return Opaque_get_debug_str.DESC; + public static FunctionDescriptor getline$descriptor() { + return getline.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) + * ssize_t getline(char **restrict __linep, size_t *restrict __linecapp, FILE *restrict __stream) * } */ - public static MethodHandle Opaque_get_debug_str$handle() { - return Opaque_get_debug_str.HANDLE; + public static MethodHandle getline$handle() { + return getline.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) + * ssize_t getline(char **restrict __linep, size_t *restrict __linecapp, FILE *restrict __stream) * } */ - public static MemorySegment Opaque_get_debug_str$address() { - return Opaque_get_debug_str.ADDR; + public static MemorySegment getline$address() { + return getline.ADDR; } /** * {@snippet lang=c : - * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) + * ssize_t getline(char **restrict __linep, size_t *restrict __linecapp, FILE *restrict __stream) * } */ - public static void Opaque_get_debug_str(MemorySegment self, MemorySegment write) { - var mh$ = Opaque_get_debug_str.HANDLE; + public static long getline(MemorySegment __linep, MemorySegment __linecapp, MemorySegment __stream) { + var mh$ = getline.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_get_debug_str", self, write); + traceDowncall("getline", __linep, __linecapp, __stream); } - mh$.invokeExact(self, write); + return (long)mh$.invokeExact(__linep, __linecapp, __stream); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Opaque_assert_struct { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class fmemopen { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - MyStruct.layout() + somelib_h.C_POINTER, + somelib_h.C_LONG, + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_assert_struct"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fmemopen"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12017,127 +8821,58 @@ private static class Opaque_assert_struct { /** * Function descriptor for: * {@snippet lang=c : - * void Opaque_assert_struct(const Opaque *self, MyStruct s) + * FILE *fmemopen(void *restrict __buf, size_t __size, const char *restrict __mode) * } */ - public static FunctionDescriptor Opaque_assert_struct$descriptor() { - return Opaque_assert_struct.DESC; + public static FunctionDescriptor fmemopen$descriptor() { + return fmemopen.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Opaque_assert_struct(const Opaque *self, MyStruct s) + * FILE *fmemopen(void *restrict __buf, size_t __size, const char *restrict __mode) * } */ - public static MethodHandle Opaque_assert_struct$handle() { - return Opaque_assert_struct.HANDLE; + public static MethodHandle fmemopen$handle() { + return fmemopen.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Opaque_assert_struct(const Opaque *self, MyStruct s) - * } - */ - public static MemorySegment Opaque_assert_struct$address() { - return Opaque_assert_struct.ADDR; - } - - /** - * {@snippet lang=c : - * void Opaque_assert_struct(const Opaque *self, MyStruct s) - * } - */ - public static void Opaque_assert_struct(MemorySegment self, MemorySegment s) { - var mh$ = Opaque_assert_struct.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_assert_struct", self, s); - } - mh$.invokeExact(self, s); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - /** - * Variadic invoker class for: - * {@snippet lang=c : - * size_t Opaque_returns_usize() + * FILE *fmemopen(void *restrict __buf, size_t __size, const char *restrict __mode) * } */ - public static class Opaque_returns_usize { - private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - somelib_h.C_LONG ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_returns_usize"); - - private final MethodHandle handle; - private final FunctionDescriptor descriptor; - private final MethodHandle spreader; - - private Opaque_returns_usize(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { - this.handle = handle; - this.descriptor = descriptor; - this.spreader = spreader; - } - - /** - * Variadic invoker factory for: - * {@snippet lang=c : - * size_t Opaque_returns_usize() - * } - */ - public static Opaque_returns_usize makeInvoker(MemoryLayout... layouts) { - FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); - Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); - var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); - var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new Opaque_returns_usize(mh$, desc$, spreader$); - } - - /** - * {@return the address} - */ - public static MemorySegment address() { - return ADDR; - } - - /** - * {@return the specialized method handle} - */ - public MethodHandle handle() { - return handle; - } - - /** - * {@return the specialized descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } + public static MemorySegment fmemopen$address() { + return fmemopen.ADDR; + } - public long apply(Object... x0) { - try { - if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_returns_usize", x0); - } - return (long)spreader.invokeExact(x0); - } catch(IllegalArgumentException | ClassCastException ex$) { - throw ex$; // rethrow IAE from passing wrong number/type of args - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); + /** + * {@snippet lang=c : + * FILE *fmemopen(void *restrict __buf, size_t __size, const char *restrict __mode) + * } + */ + public static MemorySegment fmemopen(MemorySegment __buf, long __size, MemorySegment __mode) { + var mh$ = fmemopen.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fmemopen", __buf, __size, __mode); } + return (MemorySegment)mh$.invokeExact(__buf, __size, __mode); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); } } - private static class Opaque_internal_len { + private static class open_memstream { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_LONG, + somelib_h.C_POINTER, + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_internal_len"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("open_memstream"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12145,136 +8880,162 @@ private static class Opaque_internal_len { /** * Function descriptor for: * {@snippet lang=c : - * size_t Opaque_internal_len(const Opaque *self) + * FILE *open_memstream(char **__bufp, size_t *__sizep) * } */ - public static FunctionDescriptor Opaque_internal_len$descriptor() { - return Opaque_internal_len.DESC; + public static FunctionDescriptor open_memstream$descriptor() { + return open_memstream.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * size_t Opaque_internal_len(const Opaque *self) + * FILE *open_memstream(char **__bufp, size_t *__sizep) * } */ - public static MethodHandle Opaque_internal_len$handle() { - return Opaque_internal_len.HANDLE; + public static MethodHandle open_memstream$handle() { + return open_memstream.HANDLE; } /** * Address for: * {@snippet lang=c : - * size_t Opaque_internal_len(const Opaque *self) + * FILE *open_memstream(char **__bufp, size_t *__sizep) * } */ - public static MemorySegment Opaque_internal_len$address() { - return Opaque_internal_len.ADDR; + public static MemorySegment open_memstream$address() { + return open_memstream.ADDR; } /** * {@snippet lang=c : - * size_t Opaque_internal_len(const Opaque *self) + * FILE *open_memstream(char **__bufp, size_t *__sizep) * } */ - public static long Opaque_internal_len(MemorySegment self) { - var mh$ = Opaque_internal_len.HANDLE; + public static MemorySegment open_memstream(MemorySegment __bufp, MemorySegment __sizep) { + var mh$ = open_memstream.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_internal_len", self); + traceDowncall("open_memstream", __bufp, __sizep); } - return (long)mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(__bufp, __sizep); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } + private static class sys_nerr$constants { + public static final OfInt LAYOUT = somelib_h.C_INT; + public static final MemorySegment SEGMENT = somelib_h.findOrThrow("sys_nerr").reinterpret(LAYOUT.byteSize()); + } + /** - * Variadic invoker class for: + * Layout for variable: * {@snippet lang=c : - * ImportedStruct Opaque_returns_imported() + * extern const int sys_nerr * } */ - public static class Opaque_returns_imported { - private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - ImportedStruct.layout() ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_returns_imported"); + public static OfInt sys_nerr$layout() { + return sys_nerr$constants.LAYOUT; + } - private final MethodHandle handle; - private final FunctionDescriptor descriptor; - private final MethodHandle spreader; + /** + * Segment for variable: + * {@snippet lang=c : + * extern const int sys_nerr + * } + */ + public static MemorySegment sys_nerr$segment() { + return sys_nerr$constants.SEGMENT; + } - private Opaque_returns_imported(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { - this.handle = handle; - this.descriptor = descriptor; - this.spreader = spreader; - } + /** + * Getter for variable: + * {@snippet lang=c : + * extern const int sys_nerr + * } + */ + public static int sys_nerr() { + return sys_nerr$constants.SEGMENT.get(sys_nerr$constants.LAYOUT, 0L); + } - /** - * Variadic invoker factory for: - * {@snippet lang=c : - * ImportedStruct Opaque_returns_imported() - * } - */ - public static Opaque_returns_imported makeInvoker(MemoryLayout... layouts) { - FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); - Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); - var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); - var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new Opaque_returns_imported(mh$, desc$, spreader$); - } + /** + * Setter for variable: + * {@snippet lang=c : + * extern const int sys_nerr + * } + */ + public static void sys_nerr(int varValue) { + sys_nerr$constants.SEGMENT.set(sys_nerr$constants.LAYOUT, 0L, varValue); + } - /** - * {@return the address} - */ - public static MemorySegment address() { - return ADDR; - } + private static class sys_errlist$constants { + public static final SequenceLayout LAYOUT = MemoryLayout.sequenceLayout(0, somelib_h.C_POINTER); + public static final MemorySegment SEGMENT = somelib_h.findOrThrow("sys_errlist").reinterpret(LAYOUT.byteSize()); + public static final VarHandle HANDLE = LAYOUT.varHandle(); - /** - * {@return the specialized method handle} - */ - public MethodHandle handle() { - return handle; - } + public static final long[] DIMS = { }; + } - /** - * {@return the specialized descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } + /** + * Layout for variable: + * {@snippet lang=c : + * extern const char *const sys_errlist[] + * } + */ + public static SequenceLayout sys_errlist$layout() { + return sys_errlist$constants.LAYOUT; + } - public MemorySegment apply(SegmentAllocator allocator, Object... x0) { - try { - if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_returns_imported", allocator, x0); - } - return (MemorySegment)spreader.invokeExact(allocator, x0); - } catch(IllegalArgumentException | ClassCastException ex$) { - throw ex$; // rethrow IAE from passing wrong number/type of args - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } + /** + * Dimensions for array variable: + * {@snippet lang=c : + * extern const char *const sys_errlist[] + * } + */ + public static long[] sys_errlist$dimensions() { + return sys_errlist$constants.DIMS; + } + + /** + * Getter for variable: + * {@snippet lang=c : + * extern const char *const sys_errlist[] + * } + */ + public static MemorySegment sys_errlist() { + return sys_errlist$constants.SEGMENT; + } + + /** + * Setter for variable: + * {@snippet lang=c : + * extern const char *const sys_errlist[] + * } + */ + public static void sys_errlist(MemorySegment varValue) { + MemorySegment.copy(varValue, 0L, sys_errlist$constants.SEGMENT, 0L, sys_errlist$constants.LAYOUT.byteSize()); } /** * Variadic invoker class for: * {@snippet lang=c : - * int8_t Opaque_cmp() + * int asprintf(char **restrict, const char *restrict, ...) * } */ - public static class Opaque_cmp { + public static class asprintf { private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - somelib_h.C_CHAR ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_cmp"); + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("asprintf"); private final MethodHandle handle; private final FunctionDescriptor descriptor; private final MethodHandle spreader; - private Opaque_cmp(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + private asprintf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { this.handle = handle; this.descriptor = descriptor; this.spreader = spreader; @@ -12283,15 +9044,15 @@ private Opaque_cmp(MethodHandle handle, FunctionDescriptor descriptor, MethodHan /** * Variadic invoker factory for: * {@snippet lang=c : - * int8_t Opaque_cmp() + * int asprintf(char **restrict, const char *restrict, ...) * } */ - public static Opaque_cmp makeInvoker(MemoryLayout... layouts) { + public static asprintf makeInvoker(MemoryLayout... layouts) { FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new Opaque_cmp(mh$, desc$, spreader$); + return new asprintf(mh$, desc$, spreader$); } /** @@ -12315,12 +9076,12 @@ public FunctionDescriptor descriptor() { return descriptor; } - public byte apply(Object... x0) { + public int apply(MemorySegment x0, MemorySegment x1, Object... x2) { try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_cmp", x0); + traceDowncall("asprintf", x0, x1, x2); } - return (byte)spreader.invokeExact(x0); + return (int)spreader.invokeExact(x0, x1, x2); } catch(IllegalArgumentException | ClassCastException ex$) { throw ex$; // rethrow IAE from passing wrong number/type of args } catch (Throwable ex$) { @@ -12329,12 +9090,13 @@ public byte apply(Object... x0) { } } - private static class Opaque_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class ctermid_r { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("ctermid_r"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12342,93 +9104,58 @@ private static class Opaque_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void Opaque_destroy(Opaque *self) - * } - */ - public static FunctionDescriptor Opaque_destroy$descriptor() { - return Opaque_destroy.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * void Opaque_destroy(Opaque *self) - * } - */ - public static MethodHandle Opaque_destroy$handle() { - return Opaque_destroy.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * void Opaque_destroy(Opaque *self) - * } - */ - public static MemorySegment Opaque_destroy$address() { - return Opaque_destroy.ADDR; - } - - /** - * {@snippet lang=c : - * void Opaque_destroy(Opaque *self) - * } - */ - public static void Opaque_destroy(MemorySegment self) { - var mh$ = Opaque_destroy.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_destroy", self); - } - mh$.invokeExact(self); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - private static final int ContiguousEnum_C = (int)0L; - /** - * {@snippet lang=c : - * enum ContiguousEnum.ContiguousEnum_C = 0 + * char *ctermid_r(char *) * } - */ - public static int ContiguousEnum_C() { - return ContiguousEnum_C; + */ + public static FunctionDescriptor ctermid_r$descriptor() { + return ctermid_r.DESC; } - private static final int ContiguousEnum_D = (int)1L; + /** + * Downcall method handle for: * {@snippet lang=c : - * enum ContiguousEnum.ContiguousEnum_D = 1 + * char *ctermid_r(char *) * } */ - public static int ContiguousEnum_D() { - return ContiguousEnum_D; + public static MethodHandle ctermid_r$handle() { + return ctermid_r.HANDLE; } - private static final int ContiguousEnum_E = (int)2L; + /** + * Address for: * {@snippet lang=c : - * enum ContiguousEnum.ContiguousEnum_E = 2 + * char *ctermid_r(char *) * } */ - public static int ContiguousEnum_E() { - return ContiguousEnum_E; + public static MemorySegment ctermid_r$address() { + return ctermid_r.ADDR; } - private static final int ContiguousEnum_F = (int)3L; + /** * {@snippet lang=c : - * enum ContiguousEnum.ContiguousEnum_F = 3 + * char *ctermid_r(char *) * } */ - public static int ContiguousEnum_F() { - return ContiguousEnum_F; + public static MemorySegment ctermid_r(MemorySegment x0) { + var mh$ = ctermid_r.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("ctermid_r", x0); + } + return (MemorySegment)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } } - private static class OpaqueMutexedString_from_usize { + private static class fgetln { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_POINTER, + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_from_usize"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fgetln"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12436,57 +9163,58 @@ private static class OpaqueMutexedString_from_usize { /** * Function descriptor for: * {@snippet lang=c : - * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) + * char *fgetln(FILE *, size_t *) * } */ - public static FunctionDescriptor OpaqueMutexedString_from_usize$descriptor() { - return OpaqueMutexedString_from_usize.DESC; + public static FunctionDescriptor fgetln$descriptor() { + return fgetln.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) + * char *fgetln(FILE *, size_t *) * } */ - public static MethodHandle OpaqueMutexedString_from_usize$handle() { - return OpaqueMutexedString_from_usize.HANDLE; + public static MethodHandle fgetln$handle() { + return fgetln.HANDLE; } /** * Address for: * {@snippet lang=c : - * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) + * char *fgetln(FILE *, size_t *) * } */ - public static MemorySegment OpaqueMutexedString_from_usize$address() { - return OpaqueMutexedString_from_usize.ADDR; + public static MemorySegment fgetln$address() { + return fgetln.ADDR; } /** * {@snippet lang=c : - * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) + * char *fgetln(FILE *, size_t *) * } */ - public static MemorySegment OpaqueMutexedString_from_usize(long number) { - var mh$ = OpaqueMutexedString_from_usize.HANDLE; + public static MemorySegment fgetln(MemorySegment x0, MemorySegment x1) { + var mh$ = fgetln.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_from_usize", number); + traceDowncall("fgetln", x0, x1); } - return (MemorySegment)mh$.invokeExact(number); + return (MemorySegment)mh$.invokeExact(x0, x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OpaqueMutexedString_change { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class fmtcheck { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_POINTER, + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_change"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fmtcheck"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12494,57 +9222,57 @@ private static class OpaqueMutexedString_change { /** * Function descriptor for: * {@snippet lang=c : - * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) + * const char *fmtcheck(const char *, const char *) * } */ - public static FunctionDescriptor OpaqueMutexedString_change$descriptor() { - return OpaqueMutexedString_change.DESC; + public static FunctionDescriptor fmtcheck$descriptor() { + return fmtcheck.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) + * const char *fmtcheck(const char *, const char *) * } */ - public static MethodHandle OpaqueMutexedString_change$handle() { - return OpaqueMutexedString_change.HANDLE; + public static MethodHandle fmtcheck$handle() { + return fmtcheck.HANDLE; } /** * Address for: * {@snippet lang=c : - * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) + * const char *fmtcheck(const char *, const char *) * } */ - public static MemorySegment OpaqueMutexedString_change$address() { - return OpaqueMutexedString_change.ADDR; + public static MemorySegment fmtcheck$address() { + return fmtcheck.ADDR; } /** * {@snippet lang=c : - * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) + * const char *fmtcheck(const char *, const char *) * } */ - public static void OpaqueMutexedString_change(MemorySegment self, long number) { - var mh$ = OpaqueMutexedString_change.HANDLE; + public static MemorySegment fmtcheck(MemorySegment x0, MemorySegment x1) { + var mh$ = fmtcheck.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_change", self, number); + traceDowncall("fmtcheck", x0, x1); } - mh$.invokeExact(self, number); + return (MemorySegment)mh$.invokeExact(x0, x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OpaqueMutexedString_borrow { + private static class fpurge { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, + somelib_h.C_INT, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_borrow"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fpurge"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12552,57 +9280,58 @@ private static class OpaqueMutexedString_borrow { /** * Function descriptor for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) + * int fpurge(FILE *) * } */ - public static FunctionDescriptor OpaqueMutexedString_borrow$descriptor() { - return OpaqueMutexedString_borrow.DESC; + public static FunctionDescriptor fpurge$descriptor() { + return fpurge.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) + * int fpurge(FILE *) * } */ - public static MethodHandle OpaqueMutexedString_borrow$handle() { - return OpaqueMutexedString_borrow.HANDLE; + public static MethodHandle fpurge$handle() { + return fpurge.HANDLE; } /** * Address for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) + * int fpurge(FILE *) * } */ - public static MemorySegment OpaqueMutexedString_borrow$address() { - return OpaqueMutexedString_borrow.ADDR; + public static MemorySegment fpurge$address() { + return fpurge.ADDR; } /** * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) + * int fpurge(FILE *) * } */ - public static MemorySegment OpaqueMutexedString_borrow(MemorySegment self) { - var mh$ = OpaqueMutexedString_borrow.HANDLE; + public static int fpurge(MemorySegment x0) { + var mh$ = fpurge.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_borrow", self); + traceDowncall("fpurge", x0); } - return (MemorySegment)mh$.invokeExact(self); + return (int)mh$.invokeExact(x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OpaqueMutexedString_borrow_other { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( + private static class setbuffer { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER, - somelib_h.C_POINTER + somelib_h.C_POINTER, + somelib_h.C_INT ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_borrow_other"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("setbuffer"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12610,58 +9339,57 @@ private static class OpaqueMutexedString_borrow_other { /** * Function descriptor for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) + * void setbuffer(FILE *, char *, int) * } */ - public static FunctionDescriptor OpaqueMutexedString_borrow_other$descriptor() { - return OpaqueMutexedString_borrow_other.DESC; + public static FunctionDescriptor setbuffer$descriptor() { + return setbuffer.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) + * void setbuffer(FILE *, char *, int) * } */ - public static MethodHandle OpaqueMutexedString_borrow_other$handle() { - return OpaqueMutexedString_borrow_other.HANDLE; + public static MethodHandle setbuffer$handle() { + return setbuffer.HANDLE; } /** * Address for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) + * void setbuffer(FILE *, char *, int) * } */ - public static MemorySegment OpaqueMutexedString_borrow_other$address() { - return OpaqueMutexedString_borrow_other.ADDR; + public static MemorySegment setbuffer$address() { + return setbuffer.ADDR; } /** * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) + * void setbuffer(FILE *, char *, int) * } */ - public static MemorySegment OpaqueMutexedString_borrow_other(MemorySegment other) { - var mh$ = OpaqueMutexedString_borrow_other.HANDLE; + public static void setbuffer(MemorySegment x0, MemorySegment x1, int x2) { + var mh$ = setbuffer.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_borrow_other", other); + traceDowncall("setbuffer", x0, x1, x2); } - return (MemorySegment)mh$.invokeExact(other); + mh$.invokeExact(x0, x1, x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OpaqueMutexedString_borrow_self_or_other { + private static class setlinebuf { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, + somelib_h.C_INT, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_borrow_self_or_other"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("setlinebuf"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12669,58 +9397,59 @@ private static class OpaqueMutexedString_borrow_self_or_other { /** * Function descriptor for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) + * int setlinebuf(FILE *) * } */ - public static FunctionDescriptor OpaqueMutexedString_borrow_self_or_other$descriptor() { - return OpaqueMutexedString_borrow_self_or_other.DESC; + public static FunctionDescriptor setlinebuf$descriptor() { + return setlinebuf.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) + * int setlinebuf(FILE *) * } */ - public static MethodHandle OpaqueMutexedString_borrow_self_or_other$handle() { - return OpaqueMutexedString_borrow_self_or_other.HANDLE; + public static MethodHandle setlinebuf$handle() { + return setlinebuf.HANDLE; } /** * Address for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) + * int setlinebuf(FILE *) * } */ - public static MemorySegment OpaqueMutexedString_borrow_self_or_other$address() { - return OpaqueMutexedString_borrow_self_or_other.ADDR; + public static MemorySegment setlinebuf$address() { + return setlinebuf.ADDR; } /** * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) + * int setlinebuf(FILE *) * } */ - public static MemorySegment OpaqueMutexedString_borrow_self_or_other(MemorySegment self, MemorySegment other) { - var mh$ = OpaqueMutexedString_borrow_self_or_other.HANDLE; + public static int setlinebuf(MemorySegment x0) { + var mh$ = setlinebuf.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_borrow_self_or_other", self, other); + traceDowncall("setlinebuf", x0); } - return (MemorySegment)mh$.invokeExact(self, other); + return (int)mh$.invokeExact(x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OpaqueMutexedString_get_len_and_add { + private static class vasprintf { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_LONG, + somelib_h.C_INT, somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_POINTER, + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_get_len_and_add"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("vasprintf"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12728,57 +9457,61 @@ private static class OpaqueMutexedString_get_len_and_add { /** * Function descriptor for: * {@snippet lang=c : - * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) + * int vasprintf(char **restrict, const char *restrict, va_list) * } */ - public static FunctionDescriptor OpaqueMutexedString_get_len_and_add$descriptor() { - return OpaqueMutexedString_get_len_and_add.DESC; + public static FunctionDescriptor vasprintf$descriptor() { + return vasprintf.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) + * int vasprintf(char **restrict, const char *restrict, va_list) * } */ - public static MethodHandle OpaqueMutexedString_get_len_and_add$handle() { - return OpaqueMutexedString_get_len_and_add.HANDLE; + public static MethodHandle vasprintf$handle() { + return vasprintf.HANDLE; } /** * Address for: * {@snippet lang=c : - * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) + * int vasprintf(char **restrict, const char *restrict, va_list) * } */ - public static MemorySegment OpaqueMutexedString_get_len_and_add$address() { - return OpaqueMutexedString_get_len_and_add.ADDR; + public static MemorySegment vasprintf$address() { + return vasprintf.ADDR; } /** * {@snippet lang=c : - * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) + * int vasprintf(char **restrict, const char *restrict, va_list) * } */ - public static long OpaqueMutexedString_get_len_and_add(MemorySegment self, long other) { - var mh$ = OpaqueMutexedString_get_len_and_add.HANDLE; + public static int vasprintf(MemorySegment x0, MemorySegment x1, MemorySegment x2) { + var mh$ = vasprintf.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_get_len_and_add", self, other); + traceDowncall("vasprintf", x0, x1, x2); } - return (long)mh$.invokeExact(self, other); + return (int)mh$.invokeExact(x0, x1, x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OpaqueMutexedString_dummy_str { + private static class funopen { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - DiplomatStringView.layout(), + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_dummy_str"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("funopen"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12786,57 +9519,212 @@ private static class OpaqueMutexedString_dummy_str { /** * Function descriptor for: * {@snippet lang=c : - * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) + * FILE *funopen(const void *, int (* _Nullable)(void *, char *, int), int (* _Nullable)(void *, const char *, int), fpos_t (* _Nullable)(void *, fpos_t, int), int (* _Nullable)(void *)) * } */ - public static FunctionDescriptor OpaqueMutexedString_dummy_str$descriptor() { - return OpaqueMutexedString_dummy_str.DESC; + public static FunctionDescriptor funopen$descriptor() { + return funopen.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) + * FILE *funopen(const void *, int (* _Nullable)(void *, char *, int), int (* _Nullable)(void *, const char *, int), fpos_t (* _Nullable)(void *, fpos_t, int), int (* _Nullable)(void *)) * } */ - public static MethodHandle OpaqueMutexedString_dummy_str$handle() { - return OpaqueMutexedString_dummy_str.HANDLE; + public static MethodHandle funopen$handle() { + return funopen.HANDLE; } /** * Address for: * {@snippet lang=c : - * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) + * FILE *funopen(const void *, int (* _Nullable)(void *, char *, int), int (* _Nullable)(void *, const char *, int), fpos_t (* _Nullable)(void *, fpos_t, int), int (* _Nullable)(void *)) * } */ - public static MemorySegment OpaqueMutexedString_dummy_str$address() { - return OpaqueMutexedString_dummy_str.ADDR; + public static MemorySegment funopen$address() { + return funopen.ADDR; } /** * {@snippet lang=c : - * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) + * FILE *funopen(const void *, int (* _Nullable)(void *, char *, int), int (* _Nullable)(void *, const char *, int), fpos_t (* _Nullable)(void *, fpos_t, int), int (* _Nullable)(void *)) * } */ - public static MemorySegment OpaqueMutexedString_dummy_str(SegmentAllocator allocator, MemorySegment self) { - var mh$ = OpaqueMutexedString_dummy_str.HANDLE; + public static MemorySegment funopen(MemorySegment x0, MemorySegment x1, MemorySegment x2, MemorySegment x3, MemorySegment x4) { + var mh$ = funopen.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_dummy_str", allocator, self); + traceDowncall("funopen", x0, x1, x2, x3, x4); } - return (MemorySegment)mh$.invokeExact(allocator, self); + return (MemorySegment)mh$.invokeExact(x0, x1, x2, x3, x4); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OpaqueMutexedString_wrapper { + /** + * Variadic invoker class for: + * {@snippet lang=c : + * extern int __sprintf_chk(char *restrict, int, size_t, const char *restrict, ...) + * } + */ + public static class __sprintf_chk { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_INT, + somelib_h.C_LONG, + somelib_h.C_POINTER + ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("__sprintf_chk"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private __sprintf_chk(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * extern int __sprintf_chk(char *restrict, int, size_t, const char *restrict, ...) + * } + */ + public static __sprintf_chk makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new __sprintf_chk(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public int apply(MemorySegment x0, int x1, long x2, MemorySegment x3, Object... x4) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("__sprintf_chk", x0, x1, x2, x3, x4); + } + return (int)spreader.invokeExact(x0, x1, x2, x3, x4); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + /** + * Variadic invoker class for: + * {@snippet lang=c : + * extern int __snprintf_chk(char *restrict, size_t, int, size_t, const char *restrict, ...) + * } + */ + public static class __snprintf_chk { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_LONG, + somelib_h.C_INT, + somelib_h.C_LONG, + somelib_h.C_POINTER + ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("__snprintf_chk"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private __snprintf_chk(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * extern int __snprintf_chk(char *restrict, size_t, int, size_t, const char *restrict, ...) + * } + */ + public static __snprintf_chk makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new __snprintf_chk(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public int apply(MemorySegment x0, long x1, int x2, long x3, MemorySegment x4, Object... x5) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("__snprintf_chk", x0, x1, x2, x3, x4, x5); + } + return (int)spreader.invokeExact(x0, x1, x2, x3, x4, x5); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static class __vsprintf_chk { public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_INT, + somelib_h.C_LONG, somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_wrapper"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("__vsprintf_chk"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12844,56 +9732,62 @@ private static class OpaqueMutexedString_wrapper { /** * Function descriptor for: * {@snippet lang=c : - * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) + * extern int __vsprintf_chk(char *restrict, int, size_t, const char *restrict, va_list) * } */ - public static FunctionDescriptor OpaqueMutexedString_wrapper$descriptor() { - return OpaqueMutexedString_wrapper.DESC; + public static FunctionDescriptor __vsprintf_chk$descriptor() { + return __vsprintf_chk.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) + * extern int __vsprintf_chk(char *restrict, int, size_t, const char *restrict, va_list) * } */ - public static MethodHandle OpaqueMutexedString_wrapper$handle() { - return OpaqueMutexedString_wrapper.HANDLE; + public static MethodHandle __vsprintf_chk$handle() { + return __vsprintf_chk.HANDLE; } /** * Address for: * {@snippet lang=c : - * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) + * extern int __vsprintf_chk(char *restrict, int, size_t, const char *restrict, va_list) * } */ - public static MemorySegment OpaqueMutexedString_wrapper$address() { - return OpaqueMutexedString_wrapper.ADDR; + public static MemorySegment __vsprintf_chk$address() { + return __vsprintf_chk.ADDR; } /** * {@snippet lang=c : - * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) + * extern int __vsprintf_chk(char *restrict, int, size_t, const char *restrict, va_list) * } */ - public static MemorySegment OpaqueMutexedString_wrapper(MemorySegment self) { - var mh$ = OpaqueMutexedString_wrapper.HANDLE; + public static int __vsprintf_chk(MemorySegment x0, int x1, long x2, MemorySegment x3, MemorySegment x4) { + var mh$ = __vsprintf_chk.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_wrapper", self); + traceDowncall("__vsprintf_chk", x0, x1, x2, x3, x4); } - return (MemorySegment)mh$.invokeExact(self); + return (int)mh$.invokeExact(x0, x1, x2, x3, x4); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OpaqueMutexedString_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class __vsnprintf_chk { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_LONG, + somelib_h.C_INT, + somelib_h.C_LONG, + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("__vsnprintf_chk"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12901,45 +9795,45 @@ private static class OpaqueMutexedString_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) + * extern int __vsnprintf_chk(char *restrict, size_t, int, size_t, const char *restrict, va_list) * } */ - public static FunctionDescriptor OpaqueMutexedString_destroy$descriptor() { - return OpaqueMutexedString_destroy.DESC; + public static FunctionDescriptor __vsnprintf_chk$descriptor() { + return __vsnprintf_chk.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) + * extern int __vsnprintf_chk(char *restrict, size_t, int, size_t, const char *restrict, va_list) * } */ - public static MethodHandle OpaqueMutexedString_destroy$handle() { - return OpaqueMutexedString_destroy.HANDLE; + public static MethodHandle __vsnprintf_chk$handle() { + return __vsnprintf_chk.HANDLE; } /** * Address for: * {@snippet lang=c : - * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) + * extern int __vsnprintf_chk(char *restrict, size_t, int, size_t, const char *restrict, va_list) * } */ - public static MemorySegment OpaqueMutexedString_destroy$address() { - return OpaqueMutexedString_destroy.ADDR; + public static MemorySegment __vsnprintf_chk$address() { + return __vsnprintf_chk.ADDR; } /** * {@snippet lang=c : - * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) + * extern int __vsnprintf_chk(char *restrict, size_t, int, size_t, const char *restrict, va_list) * } - */ - public static void OpaqueMutexedString_destroy(MemorySegment self) { - var mh$ = OpaqueMutexedString_destroy.HANDLE; + */ + public static int __vsnprintf_chk(MemorySegment x0, long x1, int x2, long x3, MemorySegment x4, MemorySegment x5) { + var mh$ = __vsnprintf_chk.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_destroy", self); + traceDowncall("__vsnprintf_chk", x0, x1, x2, x3, x4, x5); } - mh$.invokeExact(self); + return (int)mh$.invokeExact(x0, x1, x2, x3, x4, x5); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -13353,33 +10247,79 @@ public static void Foo_destroy(MemorySegment self) { throw new AssertionError("should not reach here", ex$); } } - private static final int ErrorEnum_Foo = (int)0L; + + private static class CyclicStructA_get_b { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + CyclicStructB.layout() ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("CyclicStructA_get_b"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * CyclicStructB CyclicStructA_get_b() + * } + */ + public static FunctionDescriptor CyclicStructA_get_b$descriptor() { + return CyclicStructA_get_b.DESC; + } + /** + * Downcall method handle for: * {@snippet lang=c : - * enum ErrorEnum.ErrorEnum_Foo = 0 + * CyclicStructB CyclicStructA_get_b() * } */ - public static int ErrorEnum_Foo() { - return ErrorEnum_Foo; + public static MethodHandle CyclicStructA_get_b$handle() { + return CyclicStructA_get_b.HANDLE; } - private static final int ErrorEnum_Bar = (int)1L; + /** + * Address for: * {@snippet lang=c : - * enum ErrorEnum.ErrorEnum_Bar = 1 + * CyclicStructB CyclicStructA_get_b() * } */ - public static int ErrorEnum_Bar() { - return ErrorEnum_Bar; + public static MemorySegment CyclicStructA_get_b$address() { + return CyclicStructA_get_b.ADDR; } - private static class namespace_MyIndexer_get { + /** + * {@snippet lang=c : + * CyclicStructB CyclicStructA_get_b() + * } + */ + public static MemorySegment CyclicStructA_get_b(SegmentAllocator allocator) { + var mh$ = CyclicStructA_get_b.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("CyclicStructA_get_b", allocator); + } + return (MemorySegment)mh$.invokeExact(allocator); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class NestedBorrowedFields_from_bar_and_foo_and_strings { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - namespace_MyIndexer_get_result.layout(), + NestedBorrowedFields.layout(), + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG, + somelib_h.C_POINTER, + somelib_h.C_LONG, + somelib_h.C_POINTER, + somelib_h.C_LONG, somelib_h.C_POINTER, somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_MyIndexer_get"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("NestedBorrowedFields_from_bar_and_foo_and_strings"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13387,56 +10327,57 @@ private static class namespace_MyIndexer_get { /** * Function descriptor for: * {@snippet lang=c : - * struct namespace_MyIndexer_get_result namespace_MyIndexer_get(const MyIndexer *self, size_t i) + * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char16_t *dstr16_z_data, size_t dstr16_z_len, const char *utf8_str_y_data, size_t utf8_str_y_len, const char *utf8_str_z_data, size_t utf8_str_z_len) * } */ - public static FunctionDescriptor namespace_MyIndexer_get$descriptor() { - return namespace_MyIndexer_get.DESC; + public static FunctionDescriptor NestedBorrowedFields_from_bar_and_foo_and_strings$descriptor() { + return NestedBorrowedFields_from_bar_and_foo_and_strings.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * struct namespace_MyIndexer_get_result namespace_MyIndexer_get(const MyIndexer *self, size_t i) + * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char16_t *dstr16_z_data, size_t dstr16_z_len, const char *utf8_str_y_data, size_t utf8_str_y_len, const char *utf8_str_z_data, size_t utf8_str_z_len) * } */ - public static MethodHandle namespace_MyIndexer_get$handle() { - return namespace_MyIndexer_get.HANDLE; + public static MethodHandle NestedBorrowedFields_from_bar_and_foo_and_strings$handle() { + return NestedBorrowedFields_from_bar_and_foo_and_strings.HANDLE; } /** * Address for: * {@snippet lang=c : - * struct namespace_MyIndexer_get_result namespace_MyIndexer_get(const MyIndexer *self, size_t i) + * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char16_t *dstr16_z_data, size_t dstr16_z_len, const char *utf8_str_y_data, size_t utf8_str_y_len, const char *utf8_str_z_data, size_t utf8_str_z_len) * } */ - public static MemorySegment namespace_MyIndexer_get$address() { - return namespace_MyIndexer_get.ADDR; + public static MemorySegment NestedBorrowedFields_from_bar_and_foo_and_strings$address() { + return NestedBorrowedFields_from_bar_and_foo_and_strings.ADDR; } /** * {@snippet lang=c : - * struct namespace_MyIndexer_get_result namespace_MyIndexer_get(const MyIndexer *self, size_t i) + * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char16_t *dstr16_z_data, size_t dstr16_z_len, const char *utf8_str_y_data, size_t utf8_str_y_len, const char *utf8_str_z_data, size_t utf8_str_z_len) * } */ - public static MemorySegment namespace_MyIndexer_get(SegmentAllocator allocator, MemorySegment self, long i) { - var mh$ = namespace_MyIndexer_get.HANDLE; + public static MemorySegment NestedBorrowedFields_from_bar_and_foo_and_strings(SegmentAllocator allocator, MemorySegment bar, MemorySegment foo, MemorySegment dstr16_x_data, long dstr16_x_len, MemorySegment dstr16_z_data, long dstr16_z_len, MemorySegment utf8_str_y_data, long utf8_str_y_len, MemorySegment utf8_str_z_data, long utf8_str_z_len) { + var mh$ = NestedBorrowedFields_from_bar_and_foo_and_strings.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("namespace_MyIndexer_get", allocator, self, i); + traceDowncall("NestedBorrowedFields_from_bar_and_foo_and_strings", allocator, bar, foo, dstr16_x_data, dstr16_x_len, dstr16_z_data, dstr16_z_len, utf8_str_y_data, utf8_str_y_len, utf8_str_z_data, utf8_str_z_len); } - return (MemorySegment)mh$.invokeExact(allocator, self, i); + return (MemorySegment)mh$.invokeExact(allocator, bar, foo, dstr16_x_data, dstr16_x_len, dstr16_z_data, dstr16_z_len, utf8_str_y_data, utf8_str_y_len, utf8_str_z_data, utf8_str_z_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class namespace_MyIndexer_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class Bar_foo { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_MyIndexer_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Bar_foo"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13444,58 +10385,56 @@ private static class namespace_MyIndexer_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void namespace_MyIndexer_destroy(MyIndexer *self) + * const Foo *Bar_foo(const Bar *self) * } */ - public static FunctionDescriptor namespace_MyIndexer_destroy$descriptor() { - return namespace_MyIndexer_destroy.DESC; + public static FunctionDescriptor Bar_foo$descriptor() { + return Bar_foo.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void namespace_MyIndexer_destroy(MyIndexer *self) + * const Foo *Bar_foo(const Bar *self) * } */ - public static MethodHandle namespace_MyIndexer_destroy$handle() { - return namespace_MyIndexer_destroy.HANDLE; + public static MethodHandle Bar_foo$handle() { + return Bar_foo.HANDLE; } /** * Address for: * {@snippet lang=c : - * void namespace_MyIndexer_destroy(MyIndexer *self) + * const Foo *Bar_foo(const Bar *self) * } */ - public static MemorySegment namespace_MyIndexer_destroy$address() { - return namespace_MyIndexer_destroy.ADDR; + public static MemorySegment Bar_foo$address() { + return Bar_foo.ADDR; } /** * {@snippet lang=c : - * void namespace_MyIndexer_destroy(MyIndexer *self) + * const Foo *Bar_foo(const Bar *self) * } */ - public static void namespace_MyIndexer_destroy(MemorySegment self) { - var mh$ = namespace_MyIndexer_destroy.HANDLE; + public static MemorySegment Bar_foo(MemorySegment self) { + var mh$ = Bar_foo.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("namespace_MyIndexer_destroy", self); + traceDowncall("Bar_foo", self); } - mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_transitivity { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, + private static class Bar_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_transitivity"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Bar_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13503,58 +10442,57 @@ private static class One_transitivity { /** * Function descriptor for: * {@snippet lang=c : - * One *One_transitivity(const One *hold, const One *nohold) + * void Bar_destroy(Bar *self) * } */ - public static FunctionDescriptor One_transitivity$descriptor() { - return One_transitivity.DESC; + public static FunctionDescriptor Bar_destroy$descriptor() { + return Bar_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_transitivity(const One *hold, const One *nohold) + * void Bar_destroy(Bar *self) * } */ - public static MethodHandle One_transitivity$handle() { - return One_transitivity.HANDLE; + public static MethodHandle Bar_destroy$handle() { + return Bar_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_transitivity(const One *hold, const One *nohold) + * void Bar_destroy(Bar *self) * } */ - public static MemorySegment One_transitivity$address() { - return One_transitivity.ADDR; + public static MemorySegment Bar_destroy$address() { + return Bar_destroy.ADDR; } /** * {@snippet lang=c : - * One *One_transitivity(const One *hold, const One *nohold) + * void Bar_destroy(Bar *self) * } */ - public static MemorySegment One_transitivity(MemorySegment hold, MemorySegment nohold) { - var mh$ = One_transitivity.HANDLE; + public static void Bar_destroy(MemorySegment self) { + var mh$ = Bar_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_transitivity", hold, nohold); + traceDowncall("Bar_destroy", self); } - return (MemorySegment)mh$.invokeExact(hold, nohold); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_cycle { + private static class OpaqueMutexedString_from_usize { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_cycle"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_from_usize"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13562,61 +10500,57 @@ private static class One_cycle { /** * Function descriptor for: * {@snippet lang=c : - * One *One_cycle(const Two *hold, const One *nohold) + * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) * } */ - public static FunctionDescriptor One_cycle$descriptor() { - return One_cycle.DESC; + public static FunctionDescriptor OpaqueMutexedString_from_usize$descriptor() { + return OpaqueMutexedString_from_usize.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_cycle(const Two *hold, const One *nohold) + * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) * } */ - public static MethodHandle One_cycle$handle() { - return One_cycle.HANDLE; + public static MethodHandle OpaqueMutexedString_from_usize$handle() { + return OpaqueMutexedString_from_usize.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_cycle(const Two *hold, const One *nohold) + * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) * } */ - public static MemorySegment One_cycle$address() { - return One_cycle.ADDR; + public static MemorySegment OpaqueMutexedString_from_usize$address() { + return OpaqueMutexedString_from_usize.ADDR; } /** * {@snippet lang=c : - * One *One_cycle(const Two *hold, const One *nohold) + * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) * } */ - public static MemorySegment One_cycle(MemorySegment hold, MemorySegment nohold) { - var mh$ = One_cycle.HANDLE; + public static MemorySegment OpaqueMutexedString_from_usize(long number) { + var mh$ = OpaqueMutexedString_from_usize.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_cycle", hold, nohold); + traceDowncall("OpaqueMutexedString_from_usize", number); } - return (MemorySegment)mh$.invokeExact(hold, nohold); + return (MemorySegment)mh$.invokeExact(number); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_many_dependents { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, + private static class OpaqueMutexedString_change { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER, - somelib_h.C_POINTER + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_many_dependents"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_change"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13624,58 +10558,57 @@ private static class One_many_dependents { /** * Function descriptor for: * {@snippet lang=c : - * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) + * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) * } */ - public static FunctionDescriptor One_many_dependents$descriptor() { - return One_many_dependents.DESC; + public static FunctionDescriptor OpaqueMutexedString_change$descriptor() { + return OpaqueMutexedString_change.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) + * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) * } */ - public static MethodHandle One_many_dependents$handle() { - return One_many_dependents.HANDLE; + public static MethodHandle OpaqueMutexedString_change$handle() { + return OpaqueMutexedString_change.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) + * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) * } */ - public static MemorySegment One_many_dependents$address() { - return One_many_dependents.ADDR; + public static MemorySegment OpaqueMutexedString_change$address() { + return OpaqueMutexedString_change.ADDR; } /** * {@snippet lang=c : - * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) + * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) * } */ - public static MemorySegment One_many_dependents(MemorySegment a, MemorySegment b, MemorySegment c, MemorySegment d, MemorySegment nohold) { - var mh$ = One_many_dependents.HANDLE; + public static void OpaqueMutexedString_change(MemorySegment self, long number) { + var mh$ = OpaqueMutexedString_change.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_many_dependents", a, b, c, d, nohold); + traceDowncall("OpaqueMutexedString_change", self, number); } - return (MemorySegment)mh$.invokeExact(a, b, c, d, nohold); + mh$.invokeExact(self, number); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_return_outlives_param { + private static class OpaqueMutexedString_borrow { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_return_outlives_param"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_borrow"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13683,60 +10616,57 @@ private static class One_return_outlives_param { /** * Function descriptor for: * {@snippet lang=c : - * One *One_return_outlives_param(const Two *hold, const One *nohold) + * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) * } */ - public static FunctionDescriptor One_return_outlives_param$descriptor() { - return One_return_outlives_param.DESC; + public static FunctionDescriptor OpaqueMutexedString_borrow$descriptor() { + return OpaqueMutexedString_borrow.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_return_outlives_param(const Two *hold, const One *nohold) + * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) * } */ - public static MethodHandle One_return_outlives_param$handle() { - return One_return_outlives_param.HANDLE; + public static MethodHandle OpaqueMutexedString_borrow$handle() { + return OpaqueMutexedString_borrow.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_return_outlives_param(const Two *hold, const One *nohold) + * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) * } */ - public static MemorySegment One_return_outlives_param$address() { - return One_return_outlives_param.ADDR; + public static MemorySegment OpaqueMutexedString_borrow$address() { + return OpaqueMutexedString_borrow.ADDR; } /** * {@snippet lang=c : - * One *One_return_outlives_param(const Two *hold, const One *nohold) + * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) * } */ - public static MemorySegment One_return_outlives_param(MemorySegment hold, MemorySegment nohold) { - var mh$ = One_return_outlives_param.HANDLE; + public static MemorySegment OpaqueMutexedString_borrow(MemorySegment self) { + var mh$ = OpaqueMutexedString_borrow.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_return_outlives_param", hold, nohold); + traceDowncall("OpaqueMutexedString_borrow", self); } - return (MemorySegment)mh$.invokeExact(hold, nohold); + return (MemorySegment)mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_diamond_top { + private static class OpaqueMutexedString_borrow_other { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_top"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_borrow_other"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13744,60 +10674,58 @@ private static class One_diamond_top { /** * Function descriptor for: * {@snippet lang=c : - * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) + * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) * } */ - public static FunctionDescriptor One_diamond_top$descriptor() { - return One_diamond_top.DESC; + public static FunctionDescriptor OpaqueMutexedString_borrow_other$descriptor() { + return OpaqueMutexedString_borrow_other.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) + * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) * } */ - public static MethodHandle One_diamond_top$handle() { - return One_diamond_top.HANDLE; + public static MethodHandle OpaqueMutexedString_borrow_other$handle() { + return OpaqueMutexedString_borrow_other.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) + * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) * } */ - public static MemorySegment One_diamond_top$address() { - return One_diamond_top.ADDR; + public static MemorySegment OpaqueMutexedString_borrow_other$address() { + return OpaqueMutexedString_borrow_other.ADDR; } /** * {@snippet lang=c : - * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) + * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) * } */ - public static MemorySegment One_diamond_top(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { - var mh$ = One_diamond_top.HANDLE; + public static MemorySegment OpaqueMutexedString_borrow_other(MemorySegment other) { + var mh$ = OpaqueMutexedString_borrow_other.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_diamond_top", top, left, right, bottom); + traceDowncall("OpaqueMutexedString_borrow_other", other); } - return (MemorySegment)mh$.invokeExact(top, left, right, bottom); + return (MemorySegment)mh$.invokeExact(other); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_diamond_left { + private static class OpaqueMutexedString_borrow_self_or_other { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_left"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_borrow_self_or_other"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13805,60 +10733,58 @@ private static class One_diamond_left { /** * Function descriptor for: * {@snippet lang=c : - * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) + * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) * } */ - public static FunctionDescriptor One_diamond_left$descriptor() { - return One_diamond_left.DESC; + public static FunctionDescriptor OpaqueMutexedString_borrow_self_or_other$descriptor() { + return OpaqueMutexedString_borrow_self_or_other.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) + * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) * } */ - public static MethodHandle One_diamond_left$handle() { - return One_diamond_left.HANDLE; + public static MethodHandle OpaqueMutexedString_borrow_self_or_other$handle() { + return OpaqueMutexedString_borrow_self_or_other.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) + * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) * } */ - public static MemorySegment One_diamond_left$address() { - return One_diamond_left.ADDR; + public static MemorySegment OpaqueMutexedString_borrow_self_or_other$address() { + return OpaqueMutexedString_borrow_self_or_other.ADDR; } /** * {@snippet lang=c : - * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) + * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) * } */ - public static MemorySegment One_diamond_left(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { - var mh$ = One_diamond_left.HANDLE; + public static MemorySegment OpaqueMutexedString_borrow_self_or_other(MemorySegment self, MemorySegment other) { + var mh$ = OpaqueMutexedString_borrow_self_or_other.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_diamond_left", top, left, right, bottom); + traceDowncall("OpaqueMutexedString_borrow_self_or_other", self, other); } - return (MemorySegment)mh$.invokeExact(top, left, right, bottom); + return (MemorySegment)mh$.invokeExact(self, other); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_diamond_right { + private static class OpaqueMutexedString_get_len_and_add { public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_LONG, somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_right"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_get_len_and_add"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13866,60 +10792,57 @@ private static class One_diamond_right { /** * Function descriptor for: * {@snippet lang=c : - * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) + * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) * } */ - public static FunctionDescriptor One_diamond_right$descriptor() { - return One_diamond_right.DESC; + public static FunctionDescriptor OpaqueMutexedString_get_len_and_add$descriptor() { + return OpaqueMutexedString_get_len_and_add.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) + * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) * } */ - public static MethodHandle One_diamond_right$handle() { - return One_diamond_right.HANDLE; + public static MethodHandle OpaqueMutexedString_get_len_and_add$handle() { + return OpaqueMutexedString_get_len_and_add.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) + * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) * } */ - public static MemorySegment One_diamond_right$address() { - return One_diamond_right.ADDR; + public static MemorySegment OpaqueMutexedString_get_len_and_add$address() { + return OpaqueMutexedString_get_len_and_add.ADDR; } /** * {@snippet lang=c : - * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) + * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) * } */ - public static MemorySegment One_diamond_right(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { - var mh$ = One_diamond_right.HANDLE; + public static long OpaqueMutexedString_get_len_and_add(MemorySegment self, long other) { + var mh$ = OpaqueMutexedString_get_len_and_add.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_diamond_right", top, left, right, bottom); + traceDowncall("OpaqueMutexedString_get_len_and_add", self, other); } - return (MemorySegment)mh$.invokeExact(top, left, right, bottom); + return (long)mh$.invokeExact(self, other); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_diamond_bottom { + private static class OpaqueMutexedString_dummy_str { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, + DiplomatStringView.layout(), somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_bottom"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_dummy_str"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13927,61 +10850,57 @@ private static class One_diamond_bottom { /** * Function descriptor for: * {@snippet lang=c : - * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) + * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) * } */ - public static FunctionDescriptor One_diamond_bottom$descriptor() { - return One_diamond_bottom.DESC; + public static FunctionDescriptor OpaqueMutexedString_dummy_str$descriptor() { + return OpaqueMutexedString_dummy_str.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) + * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) * } */ - public static MethodHandle One_diamond_bottom$handle() { - return One_diamond_bottom.HANDLE; + public static MethodHandle OpaqueMutexedString_dummy_str$handle() { + return OpaqueMutexedString_dummy_str.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) + * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) * } */ - public static MemorySegment One_diamond_bottom$address() { - return One_diamond_bottom.ADDR; + public static MemorySegment OpaqueMutexedString_dummy_str$address() { + return OpaqueMutexedString_dummy_str.ADDR; } /** * {@snippet lang=c : - * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) + * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) * } */ - public static MemorySegment One_diamond_bottom(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { - var mh$ = One_diamond_bottom.HANDLE; + public static MemorySegment OpaqueMutexedString_dummy_str(SegmentAllocator allocator, MemorySegment self) { + var mh$ = OpaqueMutexedString_dummy_str.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_diamond_bottom", top, left, right, bottom); + traceDowncall("OpaqueMutexedString_dummy_str", allocator, self); } - return (MemorySegment)mh$.invokeExact(top, left, right, bottom); + return (MemorySegment)mh$.invokeExact(allocator, self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_diamond_and_nested_types { + private static class OpaqueMutexedString_wrapper { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_and_nested_types"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_wrapper"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13989,59 +10908,56 @@ private static class One_diamond_and_nested_types { /** * Function descriptor for: * {@snippet lang=c : - * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) + * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) * } */ - public static FunctionDescriptor One_diamond_and_nested_types$descriptor() { - return One_diamond_and_nested_types.DESC; + public static FunctionDescriptor OpaqueMutexedString_wrapper$descriptor() { + return OpaqueMutexedString_wrapper.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) + * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) * } */ - public static MethodHandle One_diamond_and_nested_types$handle() { - return One_diamond_and_nested_types.HANDLE; + public static MethodHandle OpaqueMutexedString_wrapper$handle() { + return OpaqueMutexedString_wrapper.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) + * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) * } */ - public static MemorySegment One_diamond_and_nested_types$address() { - return One_diamond_and_nested_types.ADDR; + public static MemorySegment OpaqueMutexedString_wrapper$address() { + return OpaqueMutexedString_wrapper.ADDR; } /** * {@snippet lang=c : - * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) + * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) * } */ - public static MemorySegment One_diamond_and_nested_types(MemorySegment a, MemorySegment b, MemorySegment c, MemorySegment d, MemorySegment nohold) { - var mh$ = One_diamond_and_nested_types.HANDLE; + public static MemorySegment OpaqueMutexedString_wrapper(MemorySegment self) { + var mh$ = OpaqueMutexedString_wrapper.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_diamond_and_nested_types", a, b, c, d, nohold); + traceDowncall("OpaqueMutexedString_wrapper", self); } - return (MemorySegment)mh$.invokeExact(a, b, c, d, nohold); + return (MemorySegment)mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_implicit_bounds { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, + private static class OpaqueMutexedString_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_implicit_bounds"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14049,60 +10965,58 @@ private static class One_implicit_bounds { /** * Function descriptor for: * {@snippet lang=c : - * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) + * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) * } */ - public static FunctionDescriptor One_implicit_bounds$descriptor() { - return One_implicit_bounds.DESC; + public static FunctionDescriptor OpaqueMutexedString_destroy$descriptor() { + return OpaqueMutexedString_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) + * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) * } */ - public static MethodHandle One_implicit_bounds$handle() { - return One_implicit_bounds.HANDLE; + public static MethodHandle OpaqueMutexedString_destroy$handle() { + return OpaqueMutexedString_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) + * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) * } */ - public static MemorySegment One_implicit_bounds$address() { - return One_implicit_bounds.ADDR; + public static MemorySegment OpaqueMutexedString_destroy$address() { + return OpaqueMutexedString_destroy.ADDR; } /** * {@snippet lang=c : - * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) + * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) * } */ - public static MemorySegment One_implicit_bounds(MemorySegment explicit_hold, MemorySegment implicit_hold, MemorySegment nohold) { - var mh$ = One_implicit_bounds.HANDLE; + public static void OpaqueMutexedString_destroy(MemorySegment self) { + var mh$ = OpaqueMutexedString_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_implicit_bounds", explicit_hold, implicit_hold, nohold); + traceDowncall("OpaqueMutexedString_destroy", self); } - return (MemorySegment)mh$.invokeExact(explicit_hold, implicit_hold, nohold); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_implicit_bounds_deep { + private static class One_transitivity { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_implicit_bounds_deep"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_transitivity"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14110,56 +11024,58 @@ private static class One_implicit_bounds_deep { /** * Function descriptor for: * {@snippet lang=c : - * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) + * One *One_transitivity(const One *hold, const One *nohold) * } */ - public static FunctionDescriptor One_implicit_bounds_deep$descriptor() { - return One_implicit_bounds_deep.DESC; + public static FunctionDescriptor One_transitivity$descriptor() { + return One_transitivity.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) + * One *One_transitivity(const One *hold, const One *nohold) * } */ - public static MethodHandle One_implicit_bounds_deep$handle() { - return One_implicit_bounds_deep.HANDLE; + public static MethodHandle One_transitivity$handle() { + return One_transitivity.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) + * One *One_transitivity(const One *hold, const One *nohold) * } */ - public static MemorySegment One_implicit_bounds_deep$address() { - return One_implicit_bounds_deep.ADDR; + public static MemorySegment One_transitivity$address() { + return One_transitivity.ADDR; } /** * {@snippet lang=c : - * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) + * One *One_transitivity(const One *hold, const One *nohold) * } */ - public static MemorySegment One_implicit_bounds_deep(MemorySegment explicit_, MemorySegment implicit_1, MemorySegment implicit_2, MemorySegment nohold) { - var mh$ = One_implicit_bounds_deep.HANDLE; + public static MemorySegment One_transitivity(MemorySegment hold, MemorySegment nohold) { + var mh$ = One_transitivity.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_implicit_bounds_deep", explicit_, implicit_1, implicit_2, nohold); + traceDowncall("One_transitivity", hold, nohold); } - return (MemorySegment)mh$.invokeExact(explicit_, implicit_1, implicit_2, nohold); + return (MemorySegment)mh$.invokeExact(hold, nohold); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class One_cycle { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_cycle"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14167,58 +11083,61 @@ private static class One_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void One_destroy(One *self) + * One *One_cycle(const Two *hold, const One *nohold) * } */ - public static FunctionDescriptor One_destroy$descriptor() { - return One_destroy.DESC; + public static FunctionDescriptor One_cycle$descriptor() { + return One_cycle.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void One_destroy(One *self) + * One *One_cycle(const Two *hold, const One *nohold) * } */ - public static MethodHandle One_destroy$handle() { - return One_destroy.HANDLE; + public static MethodHandle One_cycle$handle() { + return One_cycle.HANDLE; } /** * Address for: * {@snippet lang=c : - * void One_destroy(One *self) + * One *One_cycle(const Two *hold, const One *nohold) * } */ - public static MemorySegment One_destroy$address() { - return One_destroy.ADDR; + public static MemorySegment One_cycle$address() { + return One_cycle.ADDR; } /** * {@snippet lang=c : - * void One_destroy(One *self) + * One *One_cycle(const Two *hold, const One *nohold) * } */ - public static void One_destroy(MemorySegment self) { - var mh$ = One_destroy.HANDLE; + public static MemorySegment One_cycle(MemorySegment hold, MemorySegment nohold) { + var mh$ = One_cycle.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_destroy", self); + traceDowncall("One_cycle", hold, nohold); } - mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(hold, nohold); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Utf16Wrap_from_utf16 { + private static class One_many_dependents { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_from_utf16"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_many_dependents"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14226,57 +11145,58 @@ private static class Utf16Wrap_from_utf16 { /** * Function descriptor for: * {@snippet lang=c : - * Utf16Wrap *Utf16Wrap_from_utf16(const char16_t *input_data, size_t input_len) + * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) * } */ - public static FunctionDescriptor Utf16Wrap_from_utf16$descriptor() { - return Utf16Wrap_from_utf16.DESC; + public static FunctionDescriptor One_many_dependents$descriptor() { + return One_many_dependents.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Utf16Wrap *Utf16Wrap_from_utf16(const char16_t *input_data, size_t input_len) + * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) * } */ - public static MethodHandle Utf16Wrap_from_utf16$handle() { - return Utf16Wrap_from_utf16.HANDLE; + public static MethodHandle One_many_dependents$handle() { + return One_many_dependents.HANDLE; } /** * Address for: * {@snippet lang=c : - * Utf16Wrap *Utf16Wrap_from_utf16(const char16_t *input_data, size_t input_len) + * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) * } */ - public static MemorySegment Utf16Wrap_from_utf16$address() { - return Utf16Wrap_from_utf16.ADDR; + public static MemorySegment One_many_dependents$address() { + return One_many_dependents.ADDR; } /** * {@snippet lang=c : - * Utf16Wrap *Utf16Wrap_from_utf16(const char16_t *input_data, size_t input_len) + * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) * } */ - public static MemorySegment Utf16Wrap_from_utf16(MemorySegment input_data, long input_len) { - var mh$ = Utf16Wrap_from_utf16.HANDLE; + public static MemorySegment One_many_dependents(MemorySegment a, MemorySegment b, MemorySegment c, MemorySegment d, MemorySegment nohold) { + var mh$ = One_many_dependents.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Utf16Wrap_from_utf16", input_data, input_len); + traceDowncall("One_many_dependents", a, b, c, d, nohold); } - return (MemorySegment)mh$.invokeExact(input_data, input_len); + return (MemorySegment)mh$.invokeExact(a, b, c, d, nohold); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Utf16Wrap_get_debug_str { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class One_return_outlives_param { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_get_debug_str"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_return_outlives_param"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14284,57 +11204,60 @@ private static class Utf16Wrap_get_debug_str { /** * Function descriptor for: * {@snippet lang=c : - * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) + * One *One_return_outlives_param(const Two *hold, const One *nohold) * } */ - public static FunctionDescriptor Utf16Wrap_get_debug_str$descriptor() { - return Utf16Wrap_get_debug_str.DESC; + public static FunctionDescriptor One_return_outlives_param$descriptor() { + return One_return_outlives_param.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) + * One *One_return_outlives_param(const Two *hold, const One *nohold) * } */ - public static MethodHandle Utf16Wrap_get_debug_str$handle() { - return Utf16Wrap_get_debug_str.HANDLE; + public static MethodHandle One_return_outlives_param$handle() { + return One_return_outlives_param.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) + * One *One_return_outlives_param(const Two *hold, const One *nohold) * } */ - public static MemorySegment Utf16Wrap_get_debug_str$address() { - return Utf16Wrap_get_debug_str.ADDR; + public static MemorySegment One_return_outlives_param$address() { + return One_return_outlives_param.ADDR; } /** * {@snippet lang=c : - * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) + * One *One_return_outlives_param(const Two *hold, const One *nohold) * } */ - public static void Utf16Wrap_get_debug_str(MemorySegment self, MemorySegment write) { - var mh$ = Utf16Wrap_get_debug_str.HANDLE; + public static MemorySegment One_return_outlives_param(MemorySegment hold, MemorySegment nohold) { + var mh$ = One_return_outlives_param.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Utf16Wrap_get_debug_str", self, write); + traceDowncall("One_return_outlives_param", hold, nohold); } - mh$.invokeExact(self, write); + return (MemorySegment)mh$.invokeExact(hold, nohold); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Utf16Wrap_borrow_cont { + private static class One_diamond_top { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - DiplomatString16View.layout(), + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_borrow_cont"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_top"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14342,57 +11265,60 @@ private static class Utf16Wrap_borrow_cont { /** * Function descriptor for: * {@snippet lang=c : - * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) + * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static FunctionDescriptor Utf16Wrap_borrow_cont$descriptor() { - return Utf16Wrap_borrow_cont.DESC; + public static FunctionDescriptor One_diamond_top$descriptor() { + return One_diamond_top.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) + * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MethodHandle Utf16Wrap_borrow_cont$handle() { - return Utf16Wrap_borrow_cont.HANDLE; + public static MethodHandle One_diamond_top$handle() { + return One_diamond_top.HANDLE; } /** * Address for: * {@snippet lang=c : - * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) + * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MemorySegment Utf16Wrap_borrow_cont$address() { - return Utf16Wrap_borrow_cont.ADDR; + public static MemorySegment One_diamond_top$address() { + return One_diamond_top.ADDR; } /** * {@snippet lang=c : - * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) + * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MemorySegment Utf16Wrap_borrow_cont(SegmentAllocator allocator, MemorySegment self) { - var mh$ = Utf16Wrap_borrow_cont.HANDLE; + public static MemorySegment One_diamond_top(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { + var mh$ = One_diamond_top.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Utf16Wrap_borrow_cont", allocator, self); + traceDowncall("One_diamond_top", top, left, right, bottom); } - return (MemorySegment)mh$.invokeExact(allocator, self); + return (MemorySegment)mh$.invokeExact(top, left, right, bottom); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Utf16Wrap_owned { + private static class One_diamond_left { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - DiplomatString16View.layout(), + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_owned"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_left"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14400,56 +11326,60 @@ private static class Utf16Wrap_owned { /** * Function descriptor for: * {@snippet lang=c : - * DiplomatString16View Utf16Wrap_owned(const Utf16Wrap *self) + * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static FunctionDescriptor Utf16Wrap_owned$descriptor() { - return Utf16Wrap_owned.DESC; + public static FunctionDescriptor One_diamond_left$descriptor() { + return One_diamond_left.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * DiplomatString16View Utf16Wrap_owned(const Utf16Wrap *self) + * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MethodHandle Utf16Wrap_owned$handle() { - return Utf16Wrap_owned.HANDLE; + public static MethodHandle One_diamond_left$handle() { + return One_diamond_left.HANDLE; } /** * Address for: * {@snippet lang=c : - * DiplomatString16View Utf16Wrap_owned(const Utf16Wrap *self) + * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MemorySegment Utf16Wrap_owned$address() { - return Utf16Wrap_owned.ADDR; + public static MemorySegment One_diamond_left$address() { + return One_diamond_left.ADDR; } /** * {@snippet lang=c : - * DiplomatString16View Utf16Wrap_owned(const Utf16Wrap *self) + * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MemorySegment Utf16Wrap_owned(SegmentAllocator allocator, MemorySegment self) { - var mh$ = Utf16Wrap_owned.HANDLE; + public static MemorySegment One_diamond_left(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { + var mh$ = One_diamond_left.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Utf16Wrap_owned", allocator, self); + traceDowncall("One_diamond_left", top, left, right, bottom); } - return (MemorySegment)mh$.invokeExact(allocator, self); + return (MemorySegment)mh$.invokeExact(top, left, right, bottom); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Utf16Wrap_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class One_diamond_right { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_right"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14457,56 +11387,60 @@ private static class Utf16Wrap_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void Utf16Wrap_destroy(Utf16Wrap *self) + * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static FunctionDescriptor Utf16Wrap_destroy$descriptor() { - return Utf16Wrap_destroy.DESC; + public static FunctionDescriptor One_diamond_right$descriptor() { + return One_diamond_right.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Utf16Wrap_destroy(Utf16Wrap *self) + * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MethodHandle Utf16Wrap_destroy$handle() { - return Utf16Wrap_destroy.HANDLE; + public static MethodHandle One_diamond_right$handle() { + return One_diamond_right.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Utf16Wrap_destroy(Utf16Wrap *self) + * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MemorySegment Utf16Wrap_destroy$address() { - return Utf16Wrap_destroy.ADDR; + public static MemorySegment One_diamond_right$address() { + return One_diamond_right.ADDR; } /** * {@snippet lang=c : - * void Utf16Wrap_destroy(Utf16Wrap *self) + * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static void Utf16Wrap_destroy(MemorySegment self) { - var mh$ = Utf16Wrap_destroy.HANDLE; + public static MemorySegment One_diamond_right(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { + var mh$ = One_diamond_right.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Utf16Wrap_destroy", self); + traceDowncall("One_diamond_right", top, left, right, bottom); } - mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(top, left, right, bottom); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class namespace_AttrOpaque2_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class One_diamond_bottom { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_AttrOpaque2_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_bottom"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14514,57 +11448,61 @@ private static class namespace_AttrOpaque2_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void namespace_AttrOpaque2_destroy(AttrOpaque2 *self) + * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static FunctionDescriptor namespace_AttrOpaque2_destroy$descriptor() { - return namespace_AttrOpaque2_destroy.DESC; + public static FunctionDescriptor One_diamond_bottom$descriptor() { + return One_diamond_bottom.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void namespace_AttrOpaque2_destroy(AttrOpaque2 *self) + * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MethodHandle namespace_AttrOpaque2_destroy$handle() { - return namespace_AttrOpaque2_destroy.HANDLE; + public static MethodHandle One_diamond_bottom$handle() { + return One_diamond_bottom.HANDLE; } /** * Address for: * {@snippet lang=c : - * void namespace_AttrOpaque2_destroy(AttrOpaque2 *self) + * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MemorySegment namespace_AttrOpaque2_destroy$address() { - return namespace_AttrOpaque2_destroy.ADDR; + public static MemorySegment One_diamond_bottom$address() { + return One_diamond_bottom.ADDR; } /** * {@snippet lang=c : - * void namespace_AttrOpaque2_destroy(AttrOpaque2 *self) + * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static void namespace_AttrOpaque2_destroy(MemorySegment self) { - var mh$ = namespace_AttrOpaque2_destroy.HANDLE; + public static MemorySegment One_diamond_bottom(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { + var mh$ = One_diamond_bottom.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("namespace_AttrOpaque2_destroy", self); + traceDowncall("One_diamond_bottom", top, left, right, bottom); } - mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(top, left, right, bottom); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class RefList_node { + private static class One_diamond_and_nested_types { public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("RefList_node"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_and_nested_types"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14572,56 +11510,59 @@ private static class RefList_node { /** * Function descriptor for: * {@snippet lang=c : - * RefList *RefList_node(const RefListParameter *data) + * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) * } */ - public static FunctionDescriptor RefList_node$descriptor() { - return RefList_node.DESC; + public static FunctionDescriptor One_diamond_and_nested_types$descriptor() { + return One_diamond_and_nested_types.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * RefList *RefList_node(const RefListParameter *data) + * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) * } */ - public static MethodHandle RefList_node$handle() { - return RefList_node.HANDLE; + public static MethodHandle One_diamond_and_nested_types$handle() { + return One_diamond_and_nested_types.HANDLE; } /** * Address for: * {@snippet lang=c : - * RefList *RefList_node(const RefListParameter *data) + * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) * } */ - public static MemorySegment RefList_node$address() { - return RefList_node.ADDR; + public static MemorySegment One_diamond_and_nested_types$address() { + return One_diamond_and_nested_types.ADDR; } /** * {@snippet lang=c : - * RefList *RefList_node(const RefListParameter *data) + * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) * } */ - public static MemorySegment RefList_node(MemorySegment data) { - var mh$ = RefList_node.HANDLE; + public static MemorySegment One_diamond_and_nested_types(MemorySegment a, MemorySegment b, MemorySegment c, MemorySegment d, MemorySegment nohold) { + var mh$ = One_diamond_and_nested_types.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("RefList_node", data); + traceDowncall("One_diamond_and_nested_types", a, b, c, d, nohold); } - return (MemorySegment)mh$.invokeExact(data); + return (MemorySegment)mh$.invokeExact(a, b, c, d, nohold); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class RefList_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class One_implicit_bounds { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("RefList_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_implicit_bounds"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14629,61 +11570,60 @@ private static class RefList_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void RefList_destroy(RefList *self) + * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) * } */ - public static FunctionDescriptor RefList_destroy$descriptor() { - return RefList_destroy.DESC; + public static FunctionDescriptor One_implicit_bounds$descriptor() { + return One_implicit_bounds.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void RefList_destroy(RefList *self) + * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) * } */ - public static MethodHandle RefList_destroy$handle() { - return RefList_destroy.HANDLE; + public static MethodHandle One_implicit_bounds$handle() { + return One_implicit_bounds.HANDLE; } /** * Address for: * {@snippet lang=c : - * void RefList_destroy(RefList *self) + * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) * } */ - public static MemorySegment RefList_destroy$address() { - return RefList_destroy.ADDR; + public static MemorySegment One_implicit_bounds$address() { + return One_implicit_bounds.ADDR; } /** * {@snippet lang=c : - * void RefList_destroy(RefList *self) + * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) * } */ - public static void RefList_destroy(MemorySegment self) { - var mh$ = RefList_destroy.HANDLE; + public static MemorySegment One_implicit_bounds(MemorySegment explicit_hold, MemorySegment implicit_hold, MemorySegment nohold) { + var mh$ = One_implicit_bounds.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("RefList_destroy", self); + traceDowncall("One_implicit_bounds", explicit_hold, implicit_hold, nohold); } - mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(explicit_hold, implicit_hold, nohold); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class BorrowedFields_from_bar_and_strings { + private static class One_implicit_bounds_deep { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - BorrowedFields.layout(), somelib_h.C_POINTER, somelib_h.C_POINTER, - somelib_h.C_LONG, somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_POINTER, + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("BorrowedFields_from_bar_and_strings"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_implicit_bounds_deep"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14691,56 +11631,56 @@ private static class BorrowedFields_from_bar_and_strings { /** * Function descriptor for: * {@snippet lang=c : - * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, const char16_t *dstr16_data, size_t dstr16_len, const char *utf8_str_data, size_t utf8_str_len) + * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) * } */ - public static FunctionDescriptor BorrowedFields_from_bar_and_strings$descriptor() { - return BorrowedFields_from_bar_and_strings.DESC; + public static FunctionDescriptor One_implicit_bounds_deep$descriptor() { + return One_implicit_bounds_deep.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, const char16_t *dstr16_data, size_t dstr16_len, const char *utf8_str_data, size_t utf8_str_len) + * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) * } */ - public static MethodHandle BorrowedFields_from_bar_and_strings$handle() { - return BorrowedFields_from_bar_and_strings.HANDLE; + public static MethodHandle One_implicit_bounds_deep$handle() { + return One_implicit_bounds_deep.HANDLE; } /** * Address for: * {@snippet lang=c : - * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, const char16_t *dstr16_data, size_t dstr16_len, const char *utf8_str_data, size_t utf8_str_len) + * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) * } */ - public static MemorySegment BorrowedFields_from_bar_and_strings$address() { - return BorrowedFields_from_bar_and_strings.ADDR; + public static MemorySegment One_implicit_bounds_deep$address() { + return One_implicit_bounds_deep.ADDR; } /** * {@snippet lang=c : - * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, const char16_t *dstr16_data, size_t dstr16_len, const char *utf8_str_data, size_t utf8_str_len) + * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) * } */ - public static MemorySegment BorrowedFields_from_bar_and_strings(SegmentAllocator allocator, MemorySegment bar, MemorySegment dstr16_data, long dstr16_len, MemorySegment utf8_str_data, long utf8_str_len) { - var mh$ = BorrowedFields_from_bar_and_strings.HANDLE; + public static MemorySegment One_implicit_bounds_deep(MemorySegment explicit_, MemorySegment implicit_1, MemorySegment implicit_2, MemorySegment nohold) { + var mh$ = One_implicit_bounds_deep.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("BorrowedFields_from_bar_and_strings", allocator, bar, dstr16_data, dstr16_len, utf8_str_data, utf8_str_len); + traceDowncall("One_implicit_bounds_deep", explicit_, implicit_1, implicit_2, nohold); } - return (MemorySegment)mh$.invokeExact(allocator, bar, dstr16_data, dstr16_len, utf8_str_data, utf8_str_len); + return (MemorySegment)mh$.invokeExact(explicit_, implicit_1, implicit_2, nohold); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class RefListParameter_destroy { + private static class One_destroy { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("RefListParameter_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14748,43 +11688,43 @@ private static class RefListParameter_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void RefListParameter_destroy(RefListParameter *self) + * void One_destroy(One *self) * } */ - public static FunctionDescriptor RefListParameter_destroy$descriptor() { - return RefListParameter_destroy.DESC; + public static FunctionDescriptor One_destroy$descriptor() { + return One_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void RefListParameter_destroy(RefListParameter *self) + * void One_destroy(One *self) * } */ - public static MethodHandle RefListParameter_destroy$handle() { - return RefListParameter_destroy.HANDLE; + public static MethodHandle One_destroy$handle() { + return One_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * void RefListParameter_destroy(RefListParameter *self) + * void One_destroy(One *self) * } */ - public static MemorySegment RefListParameter_destroy$address() { - return RefListParameter_destroy.ADDR; + public static MemorySegment One_destroy$address() { + return One_destroy.ADDR; } /** * {@snippet lang=c : - * void RefListParameter_destroy(RefListParameter *self) + * void One_destroy(One *self) * } */ - public static void RefListParameter_destroy(MemorySegment self) { - var mh$ = RefListParameter_destroy.HANDLE; + public static void One_destroy(MemorySegment self) { + var mh$ = One_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("RefListParameter_destroy", self); + traceDowncall("One_destroy", self); } mh$.invokeExact(self); } catch (Throwable ex$) { @@ -14792,83 +11732,14 @@ public static void RefListParameter_destroy(MemorySegment self) { } } - /** - * Variadic invoker class for: - * {@snippet lang=c : - * AttrOpaque1 *namespace_AttrOpaque1_new() - * } - */ - public static class namespace_AttrOpaque1_new { - private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - somelib_h.C_POINTER ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_AttrOpaque1_new"); - - private final MethodHandle handle; - private final FunctionDescriptor descriptor; - private final MethodHandle spreader; - - private namespace_AttrOpaque1_new(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { - this.handle = handle; - this.descriptor = descriptor; - this.spreader = spreader; - } - - /** - * Variadic invoker factory for: - * {@snippet lang=c : - * AttrOpaque1 *namespace_AttrOpaque1_new() - * } - */ - public static namespace_AttrOpaque1_new makeInvoker(MemoryLayout... layouts) { - FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); - Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); - var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); - var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new namespace_AttrOpaque1_new(mh$, desc$, spreader$); - } - - /** - * {@return the address} - */ - public static MemorySegment address() { - return ADDR; - } - - /** - * {@return the specialized method handle} - */ - public MethodHandle handle() { - return handle; - } - - /** - * {@return the specialized descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } - - public MemorySegment apply(Object... x0) { - try { - if (TRACE_DOWNCALLS) { - traceDowncall("namespace_AttrOpaque1_new", x0); - } - return (MemorySegment)spreader.invokeExact(x0); - } catch(IllegalArgumentException | ClassCastException ex$) { - throw ex$; // rethrow IAE from passing wrong number/type of args - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - } - - private static class namespace_AttrOpaque1_method { + private static class Utf16Wrap_from_utf16 { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_CHAR, - somelib_h.C_POINTER + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_AttrOpaque1_method"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_from_utf16"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14876,57 +11747,57 @@ private static class namespace_AttrOpaque1_method { /** * Function descriptor for: * {@snippet lang=c : - * uint8_t namespace_AttrOpaque1_method(const AttrOpaque1 *self) + * Utf16Wrap *Utf16Wrap_from_utf16(const char16_t *input_data, size_t input_len) * } */ - public static FunctionDescriptor namespace_AttrOpaque1_method$descriptor() { - return namespace_AttrOpaque1_method.DESC; + public static FunctionDescriptor Utf16Wrap_from_utf16$descriptor() { + return Utf16Wrap_from_utf16.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * uint8_t namespace_AttrOpaque1_method(const AttrOpaque1 *self) + * Utf16Wrap *Utf16Wrap_from_utf16(const char16_t *input_data, size_t input_len) * } */ - public static MethodHandle namespace_AttrOpaque1_method$handle() { - return namespace_AttrOpaque1_method.HANDLE; + public static MethodHandle Utf16Wrap_from_utf16$handle() { + return Utf16Wrap_from_utf16.HANDLE; } /** * Address for: * {@snippet lang=c : - * uint8_t namespace_AttrOpaque1_method(const AttrOpaque1 *self) + * Utf16Wrap *Utf16Wrap_from_utf16(const char16_t *input_data, size_t input_len) * } */ - public static MemorySegment namespace_AttrOpaque1_method$address() { - return namespace_AttrOpaque1_method.ADDR; + public static MemorySegment Utf16Wrap_from_utf16$address() { + return Utf16Wrap_from_utf16.ADDR; } /** * {@snippet lang=c : - * uint8_t namespace_AttrOpaque1_method(const AttrOpaque1 *self) + * Utf16Wrap *Utf16Wrap_from_utf16(const char16_t *input_data, size_t input_len) * } */ - public static byte namespace_AttrOpaque1_method(MemorySegment self) { - var mh$ = namespace_AttrOpaque1_method.HANDLE; + public static MemorySegment Utf16Wrap_from_utf16(MemorySegment input_data, long input_len) { + var mh$ = Utf16Wrap_from_utf16.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("namespace_AttrOpaque1_method", self); + traceDowncall("Utf16Wrap_from_utf16", input_data, input_len); } - return (byte)mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(input_data, input_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class renamed_on_abi_only { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_CHAR, + private static class Utf16Wrap_get_debug_str { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("renamed_on_abi_only"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_get_debug_str"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14934,56 +11805,57 @@ private static class renamed_on_abi_only { /** * Function descriptor for: * {@snippet lang=c : - * uint8_t renamed_on_abi_only(const AttrOpaque1 *self) + * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) * } */ - public static FunctionDescriptor renamed_on_abi_only$descriptor() { - return renamed_on_abi_only.DESC; + public static FunctionDescriptor Utf16Wrap_get_debug_str$descriptor() { + return Utf16Wrap_get_debug_str.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * uint8_t renamed_on_abi_only(const AttrOpaque1 *self) + * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) * } */ - public static MethodHandle renamed_on_abi_only$handle() { - return renamed_on_abi_only.HANDLE; + public static MethodHandle Utf16Wrap_get_debug_str$handle() { + return Utf16Wrap_get_debug_str.HANDLE; } /** * Address for: * {@snippet lang=c : - * uint8_t renamed_on_abi_only(const AttrOpaque1 *self) + * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) * } */ - public static MemorySegment renamed_on_abi_only$address() { - return renamed_on_abi_only.ADDR; + public static MemorySegment Utf16Wrap_get_debug_str$address() { + return Utf16Wrap_get_debug_str.ADDR; } /** * {@snippet lang=c : - * uint8_t renamed_on_abi_only(const AttrOpaque1 *self) + * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) * } */ - public static byte renamed_on_abi_only(MemorySegment self) { - var mh$ = renamed_on_abi_only.HANDLE; + public static void Utf16Wrap_get_debug_str(MemorySegment self, MemorySegment write) { + var mh$ = Utf16Wrap_get_debug_str.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("renamed_on_abi_only", self); + traceDowncall("Utf16Wrap_get_debug_str", self, write); } - return (byte)mh$.invokeExact(self); + mh$.invokeExact(self, write); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class namespace_AttrOpaque1_method_disabledcpp { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class Utf16Wrap_borrow_cont { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + DiplomatString16View.layout(), somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_AttrOpaque1_method_disabledcpp"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_borrow_cont"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14991,57 +11863,56 @@ private static class namespace_AttrOpaque1_method_disabledcpp { /** * Function descriptor for: * {@snippet lang=c : - * void namespace_AttrOpaque1_method_disabledcpp(const AttrOpaque1 *self) + * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) * } */ - public static FunctionDescriptor namespace_AttrOpaque1_method_disabledcpp$descriptor() { - return namespace_AttrOpaque1_method_disabledcpp.DESC; + public static FunctionDescriptor Utf16Wrap_borrow_cont$descriptor() { + return Utf16Wrap_borrow_cont.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void namespace_AttrOpaque1_method_disabledcpp(const AttrOpaque1 *self) + * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) * } */ - public static MethodHandle namespace_AttrOpaque1_method_disabledcpp$handle() { - return namespace_AttrOpaque1_method_disabledcpp.HANDLE; + public static MethodHandle Utf16Wrap_borrow_cont$handle() { + return Utf16Wrap_borrow_cont.HANDLE; } /** * Address for: * {@snippet lang=c : - * void namespace_AttrOpaque1_method_disabledcpp(const AttrOpaque1 *self) + * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) * } */ - public static MemorySegment namespace_AttrOpaque1_method_disabledcpp$address() { - return namespace_AttrOpaque1_method_disabledcpp.ADDR; + public static MemorySegment Utf16Wrap_borrow_cont$address() { + return Utf16Wrap_borrow_cont.ADDR; } /** * {@snippet lang=c : - * void namespace_AttrOpaque1_method_disabledcpp(const AttrOpaque1 *self) + * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) * } */ - public static void namespace_AttrOpaque1_method_disabledcpp(MemorySegment self) { - var mh$ = namespace_AttrOpaque1_method_disabledcpp.HANDLE; + public static MemorySegment Utf16Wrap_borrow_cont(SegmentAllocator allocator, MemorySegment self) { + var mh$ = Utf16Wrap_borrow_cont.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("namespace_AttrOpaque1_method_disabledcpp", self); + traceDowncall("Utf16Wrap_borrow_cont", allocator, self); } - mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(allocator, self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class namespace_AttrOpaque1_use_unnamespaced { + private static class Utf16Wrap_destroy { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_AttrOpaque1_use_unnamespaced"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -15049,114 +11920,111 @@ private static class namespace_AttrOpaque1_use_unnamespaced { /** * Function descriptor for: * {@snippet lang=c : - * void namespace_AttrOpaque1_use_unnamespaced(const AttrOpaque1 *self, const Unnamespaced *_un) + * void Utf16Wrap_destroy(Utf16Wrap *self) * } */ - public static FunctionDescriptor namespace_AttrOpaque1_use_unnamespaced$descriptor() { - return namespace_AttrOpaque1_use_unnamespaced.DESC; + public static FunctionDescriptor Utf16Wrap_destroy$descriptor() { + return Utf16Wrap_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void namespace_AttrOpaque1_use_unnamespaced(const AttrOpaque1 *self, const Unnamespaced *_un) + * void Utf16Wrap_destroy(Utf16Wrap *self) * } */ - public static MethodHandle namespace_AttrOpaque1_use_unnamespaced$handle() { - return namespace_AttrOpaque1_use_unnamespaced.HANDLE; + public static MethodHandle Utf16Wrap_destroy$handle() { + return Utf16Wrap_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * void namespace_AttrOpaque1_use_unnamespaced(const AttrOpaque1 *self, const Unnamespaced *_un) + * void Utf16Wrap_destroy(Utf16Wrap *self) * } */ - public static MemorySegment namespace_AttrOpaque1_use_unnamespaced$address() { - return namespace_AttrOpaque1_use_unnamespaced.ADDR; + public static MemorySegment Utf16Wrap_destroy$address() { + return Utf16Wrap_destroy.ADDR; } /** * {@snippet lang=c : - * void namespace_AttrOpaque1_use_unnamespaced(const AttrOpaque1 *self, const Unnamespaced *_un) + * void Utf16Wrap_destroy(Utf16Wrap *self) * } */ - public static void namespace_AttrOpaque1_use_unnamespaced(MemorySegment self, MemorySegment _un) { - var mh$ = namespace_AttrOpaque1_use_unnamespaced.HANDLE; + public static void Utf16Wrap_destroy(MemorySegment self) { + var mh$ = Utf16Wrap_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("namespace_AttrOpaque1_use_unnamespaced", self, _un); + traceDowncall("Utf16Wrap_destroy", self); } - mh$.invokeExact(self, _un); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - - private static class namespace_AttrOpaque1_use_namespaced { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER, - somelib_h.C_INT - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_AttrOpaque1_use_namespaced"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + private static final int MyEnum_A = (int)-2L; + /** + * {@snippet lang=c : + * enum MyEnum.MyEnum_A = -2 + * } + */ + public static int MyEnum_A() { + return MyEnum_A; } - + private static final int MyEnum_B = (int)-1L; /** - * Function descriptor for: * {@snippet lang=c : - * void namespace_AttrOpaque1_use_namespaced(const AttrOpaque1 *self, AttrEnum _n) + * enum MyEnum.MyEnum_B = -1 * } */ - public static FunctionDescriptor namespace_AttrOpaque1_use_namespaced$descriptor() { - return namespace_AttrOpaque1_use_namespaced.DESC; + public static int MyEnum_B() { + return MyEnum_B; } - + private static final int MyEnum_C = (int)0L; + /** + * {@snippet lang=c : + * enum MyEnum.MyEnum_C = 0 + * } + */ + public static int MyEnum_C() { + return MyEnum_C; + } + private static final int MyEnum_D = (int)1L; /** - * Downcall method handle for: * {@snippet lang=c : - * void namespace_AttrOpaque1_use_namespaced(const AttrOpaque1 *self, AttrEnum _n) + * enum MyEnum.MyEnum_D = 1 * } */ - public static MethodHandle namespace_AttrOpaque1_use_namespaced$handle() { - return namespace_AttrOpaque1_use_namespaced.HANDLE; + public static int MyEnum_D() { + return MyEnum_D; } - + private static final int MyEnum_E = (int)2L; /** - * Address for: * {@snippet lang=c : - * void namespace_AttrOpaque1_use_namespaced(const AttrOpaque1 *self, AttrEnum _n) + * enum MyEnum.MyEnum_E = 2 * } */ - public static MemorySegment namespace_AttrOpaque1_use_namespaced$address() { - return namespace_AttrOpaque1_use_namespaced.ADDR; + public static int MyEnum_E() { + return MyEnum_E; } - + private static final int MyEnum_F = (int)3L; /** * {@snippet lang=c : - * void namespace_AttrOpaque1_use_namespaced(const AttrOpaque1 *self, AttrEnum _n) + * enum MyEnum.MyEnum_F = 3 * } */ - public static void namespace_AttrOpaque1_use_namespaced(MemorySegment self, int _n) { - var mh$ = namespace_AttrOpaque1_use_namespaced.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("namespace_AttrOpaque1_use_namespaced", self, _n); - } - mh$.invokeExact(self, _n); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } + public static int MyEnum_F() { + return MyEnum_F; } - private static class namespace_AttrOpaque1_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER + private static class MyEnum_into_value { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_CHAR, + somelib_h.C_INT ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_AttrOpaque1_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyEnum_into_value"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -15164,57 +12032,55 @@ private static class namespace_AttrOpaque1_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void namespace_AttrOpaque1_destroy(AttrOpaque1 *self) + * int8_t MyEnum_into_value(MyEnum self) * } */ - public static FunctionDescriptor namespace_AttrOpaque1_destroy$descriptor() { - return namespace_AttrOpaque1_destroy.DESC; + public static FunctionDescriptor MyEnum_into_value$descriptor() { + return MyEnum_into_value.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void namespace_AttrOpaque1_destroy(AttrOpaque1 *self) + * int8_t MyEnum_into_value(MyEnum self) * } */ - public static MethodHandle namespace_AttrOpaque1_destroy$handle() { - return namespace_AttrOpaque1_destroy.HANDLE; + public static MethodHandle MyEnum_into_value$handle() { + return MyEnum_into_value.HANDLE; } /** * Address for: * {@snippet lang=c : - * void namespace_AttrOpaque1_destroy(AttrOpaque1 *self) + * int8_t MyEnum_into_value(MyEnum self) * } */ - public static MemorySegment namespace_AttrOpaque1_destroy$address() { - return namespace_AttrOpaque1_destroy.ADDR; + public static MemorySegment MyEnum_into_value$address() { + return MyEnum_into_value.ADDR; } /** * {@snippet lang=c : - * void namespace_AttrOpaque1_destroy(AttrOpaque1 *self) + * int8_t MyEnum_into_value(MyEnum self) * } */ - public static void namespace_AttrOpaque1_destroy(MemorySegment self) { - var mh$ = namespace_AttrOpaque1_destroy.HANDLE; + public static byte MyEnum_into_value(int self) { + var mh$ = MyEnum_into_value.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("namespace_AttrOpaque1_destroy", self); + traceDowncall("MyEnum_into_value", self); } - mh$.invokeExact(self); + return (byte)mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class ResultOpaque_new { + private static class MyEnum_get_a { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - ResultOpaque_new_result.layout(), - somelib_h.C_INT - ); + somelib_h.C_INT ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("ResultOpaque_new"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyEnum_get_a"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -15222,267 +12088,56 @@ private static class ResultOpaque_new { /** * Function descriptor for: * {@snippet lang=c : - * struct ResultOpaque_new_result ResultOpaque_new(int32_t i) + * MyEnum MyEnum_get_a() * } */ - public static FunctionDescriptor ResultOpaque_new$descriptor() { - return ResultOpaque_new.DESC; + public static FunctionDescriptor MyEnum_get_a$descriptor() { + return MyEnum_get_a.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * struct ResultOpaque_new_result ResultOpaque_new(int32_t i) + * MyEnum MyEnum_get_a() * } */ - public static MethodHandle ResultOpaque_new$handle() { - return ResultOpaque_new.HANDLE; + public static MethodHandle MyEnum_get_a$handle() { + return MyEnum_get_a.HANDLE; } /** * Address for: * {@snippet lang=c : - * struct ResultOpaque_new_result ResultOpaque_new(int32_t i) + * MyEnum MyEnum_get_a() * } */ - public static MemorySegment ResultOpaque_new$address() { - return ResultOpaque_new.ADDR; + public static MemorySegment MyEnum_get_a$address() { + return MyEnum_get_a.ADDR; } /** * {@snippet lang=c : - * struct ResultOpaque_new_result ResultOpaque_new(int32_t i) + * MyEnum MyEnum_get_a() * } */ - public static MemorySegment ResultOpaque_new(SegmentAllocator allocator, int i) { - var mh$ = ResultOpaque_new.HANDLE; + public static int MyEnum_get_a() { + var mh$ = MyEnum_get_a.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("ResultOpaque_new", allocator, i); + traceDowncall("MyEnum_get_a"); } - return (MemorySegment)mh$.invokeExact(allocator, i); + return (int)mh$.invokeExact(); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - /** - * Variadic invoker class for: - * {@snippet lang=c : - * struct ResultOpaque_new_failing_foo_result ResultOpaque_new_failing_foo() - * } - */ - public static class ResultOpaque_new_failing_foo { - private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - ResultOpaque_new_failing_foo_result.layout() ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("ResultOpaque_new_failing_foo"); - - private final MethodHandle handle; - private final FunctionDescriptor descriptor; - private final MethodHandle spreader; - - private ResultOpaque_new_failing_foo(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { - this.handle = handle; - this.descriptor = descriptor; - this.spreader = spreader; - } - - /** - * Variadic invoker factory for: - * {@snippet lang=c : - * struct ResultOpaque_new_failing_foo_result ResultOpaque_new_failing_foo() - * } - */ - public static ResultOpaque_new_failing_foo makeInvoker(MemoryLayout... layouts) { - FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); - Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); - var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); - var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new ResultOpaque_new_failing_foo(mh$, desc$, spreader$); - } - - /** - * {@return the address} - */ - public static MemorySegment address() { - return ADDR; - } - - /** - * {@return the specialized method handle} - */ - public MethodHandle handle() { - return handle; - } - - /** - * {@return the specialized descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } - - public MemorySegment apply(SegmentAllocator allocator, Object... x0) { - try { - if (TRACE_DOWNCALLS) { - traceDowncall("ResultOpaque_new_failing_foo", allocator, x0); - } - return (MemorySegment)spreader.invokeExact(allocator, x0); - } catch(IllegalArgumentException | ClassCastException ex$) { - throw ex$; // rethrow IAE from passing wrong number/type of args - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - } - - /** - * Variadic invoker class for: - * {@snippet lang=c : - * struct ResultOpaque_new_failing_bar_result ResultOpaque_new_failing_bar() - * } - */ - public static class ResultOpaque_new_failing_bar { - private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - ResultOpaque_new_failing_bar_result.layout() ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("ResultOpaque_new_failing_bar"); - - private final MethodHandle handle; - private final FunctionDescriptor descriptor; - private final MethodHandle spreader; - - private ResultOpaque_new_failing_bar(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { - this.handle = handle; - this.descriptor = descriptor; - this.spreader = spreader; - } - - /** - * Variadic invoker factory for: - * {@snippet lang=c : - * struct ResultOpaque_new_failing_bar_result ResultOpaque_new_failing_bar() - * } - */ - public static ResultOpaque_new_failing_bar makeInvoker(MemoryLayout... layouts) { - FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); - Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); - var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); - var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new ResultOpaque_new_failing_bar(mh$, desc$, spreader$); - } - - /** - * {@return the address} - */ - public static MemorySegment address() { - return ADDR; - } - - /** - * {@return the specialized method handle} - */ - public MethodHandle handle() { - return handle; - } - - /** - * {@return the specialized descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } - - public MemorySegment apply(SegmentAllocator allocator, Object... x0) { - try { - if (TRACE_DOWNCALLS) { - traceDowncall("ResultOpaque_new_failing_bar", allocator, x0); - } - return (MemorySegment)spreader.invokeExact(allocator, x0); - } catch(IllegalArgumentException | ClassCastException ex$) { - throw ex$; // rethrow IAE from passing wrong number/type of args - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - } - - /** - * Variadic invoker class for: - * {@snippet lang=c : - * struct ResultOpaque_new_failing_unit_result ResultOpaque_new_failing_unit() - * } - */ - public static class ResultOpaque_new_failing_unit { - private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - ResultOpaque_new_failing_unit_result.layout() ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("ResultOpaque_new_failing_unit"); - - private final MethodHandle handle; - private final FunctionDescriptor descriptor; - private final MethodHandle spreader; - - private ResultOpaque_new_failing_unit(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { - this.handle = handle; - this.descriptor = descriptor; - this.spreader = spreader; - } - - /** - * Variadic invoker factory for: - * {@snippet lang=c : - * struct ResultOpaque_new_failing_unit_result ResultOpaque_new_failing_unit() - * } - */ - public static ResultOpaque_new_failing_unit makeInvoker(MemoryLayout... layouts) { - FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); - Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); - var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); - var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new ResultOpaque_new_failing_unit(mh$, desc$, spreader$); - } - - /** - * {@return the address} - */ - public static MemorySegment address() { - return ADDR; - } - - /** - * {@return the specialized method handle} - */ - public MethodHandle handle() { - return handle; - } - - /** - * {@return the specialized descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } - - public MemorySegment apply(SegmentAllocator allocator, Object... x0) { - try { - if (TRACE_DOWNCALLS) { - traceDowncall("ResultOpaque_new_failing_unit", allocator, x0); - } - return (MemorySegment)spreader.invokeExact(allocator, x0); - } catch(IllegalArgumentException | ClassCastException ex$) { - throw ex$; // rethrow IAE from passing wrong number/type of args - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - } - - private static class ResultOpaque_new_failing_struct { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - ResultOpaque_new_failing_struct_result.layout(), - somelib_h.C_INT + private static class RefListParameter_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("ResultOpaque_new_failing_struct"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("RefListParameter_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -15490,57 +12145,55 @@ private static class ResultOpaque_new_failing_struct { /** * Function descriptor for: * {@snippet lang=c : - * struct ResultOpaque_new_failing_struct_result ResultOpaque_new_failing_struct(int32_t i) + * void RefListParameter_destroy(RefListParameter *self) * } */ - public static FunctionDescriptor ResultOpaque_new_failing_struct$descriptor() { - return ResultOpaque_new_failing_struct.DESC; + public static FunctionDescriptor RefListParameter_destroy$descriptor() { + return RefListParameter_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * struct ResultOpaque_new_failing_struct_result ResultOpaque_new_failing_struct(int32_t i) + * void RefListParameter_destroy(RefListParameter *self) * } */ - public static MethodHandle ResultOpaque_new_failing_struct$handle() { - return ResultOpaque_new_failing_struct.HANDLE; + public static MethodHandle RefListParameter_destroy$handle() { + return RefListParameter_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * struct ResultOpaque_new_failing_struct_result ResultOpaque_new_failing_struct(int32_t i) + * void RefListParameter_destroy(RefListParameter *self) * } */ - public static MemorySegment ResultOpaque_new_failing_struct$address() { - return ResultOpaque_new_failing_struct.ADDR; + public static MemorySegment RefListParameter_destroy$address() { + return RefListParameter_destroy.ADDR; } /** * {@snippet lang=c : - * struct ResultOpaque_new_failing_struct_result ResultOpaque_new_failing_struct(int32_t i) + * void RefListParameter_destroy(RefListParameter *self) * } */ - public static MemorySegment ResultOpaque_new_failing_struct(SegmentAllocator allocator, int i) { - var mh$ = ResultOpaque_new_failing_struct.HANDLE; + public static void RefListParameter_destroy(MemorySegment self) { + var mh$ = RefListParameter_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("ResultOpaque_new_failing_struct", allocator, i); + traceDowncall("RefListParameter_destroy", self); } - return (MemorySegment)mh$.invokeExact(allocator, i); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class ResultOpaque_new_in_err { + private static class MyStruct_new { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - ResultOpaque_new_in_err_result.layout(), - somelib_h.C_INT - ); + MyStruct.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("ResultOpaque_new_in_err"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyStruct_new"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -15548,57 +12201,57 @@ private static class ResultOpaque_new_in_err { /** * Function descriptor for: * {@snippet lang=c : - * struct ResultOpaque_new_in_err_result ResultOpaque_new_in_err(int32_t i) + * MyStruct MyStruct_new() * } */ - public static FunctionDescriptor ResultOpaque_new_in_err$descriptor() { - return ResultOpaque_new_in_err.DESC; + public static FunctionDescriptor MyStruct_new$descriptor() { + return MyStruct_new.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * struct ResultOpaque_new_in_err_result ResultOpaque_new_in_err(int32_t i) + * MyStruct MyStruct_new() * } */ - public static MethodHandle ResultOpaque_new_in_err$handle() { - return ResultOpaque_new_in_err.HANDLE; + public static MethodHandle MyStruct_new$handle() { + return MyStruct_new.HANDLE; } /** * Address for: * {@snippet lang=c : - * struct ResultOpaque_new_in_err_result ResultOpaque_new_in_err(int32_t i) + * MyStruct MyStruct_new() * } */ - public static MemorySegment ResultOpaque_new_in_err$address() { - return ResultOpaque_new_in_err.ADDR; + public static MemorySegment MyStruct_new$address() { + return MyStruct_new.ADDR; } /** * {@snippet lang=c : - * struct ResultOpaque_new_in_err_result ResultOpaque_new_in_err(int32_t i) + * MyStruct MyStruct_new() * } */ - public static MemorySegment ResultOpaque_new_in_err(SegmentAllocator allocator, int i) { - var mh$ = ResultOpaque_new_in_err.HANDLE; + public static MemorySegment MyStruct_new(SegmentAllocator allocator) { + var mh$ = MyStruct_new.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("ResultOpaque_new_in_err", allocator, i); + traceDowncall("MyStruct_new", allocator); } - return (MemorySegment)mh$.invokeExact(allocator, i); + return (MemorySegment)mh$.invokeExact(allocator); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class ResultOpaque_new_int { + private static class MyStruct_into_a { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - ResultOpaque_new_int_result.layout(), - somelib_h.C_INT + somelib_h.C_CHAR, + MyStruct.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("ResultOpaque_new_int"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyStruct_into_a"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -15606,115 +12259,112 @@ private static class ResultOpaque_new_int { /** * Function descriptor for: * {@snippet lang=c : - * struct ResultOpaque_new_int_result ResultOpaque_new_int(int32_t i) + * uint8_t MyStruct_into_a(MyStruct self) * } */ - public static FunctionDescriptor ResultOpaque_new_int$descriptor() { - return ResultOpaque_new_int.DESC; + public static FunctionDescriptor MyStruct_into_a$descriptor() { + return MyStruct_into_a.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * struct ResultOpaque_new_int_result ResultOpaque_new_int(int32_t i) + * uint8_t MyStruct_into_a(MyStruct self) * } */ - public static MethodHandle ResultOpaque_new_int$handle() { - return ResultOpaque_new_int.HANDLE; + public static MethodHandle MyStruct_into_a$handle() { + return MyStruct_into_a.HANDLE; } /** * Address for: * {@snippet lang=c : - * struct ResultOpaque_new_int_result ResultOpaque_new_int(int32_t i) + * uint8_t MyStruct_into_a(MyStruct self) * } */ - public static MemorySegment ResultOpaque_new_int$address() { - return ResultOpaque_new_int.ADDR; + public static MemorySegment MyStruct_into_a$address() { + return MyStruct_into_a.ADDR; } /** * {@snippet lang=c : - * struct ResultOpaque_new_int_result ResultOpaque_new_int(int32_t i) + * uint8_t MyStruct_into_a(MyStruct self) * } */ - public static MemorySegment ResultOpaque_new_int(SegmentAllocator allocator, int i) { - var mh$ = ResultOpaque_new_int.HANDLE; + public static byte MyStruct_into_a(MemorySegment self) { + var mh$ = MyStruct_into_a.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("ResultOpaque_new_int", allocator, i); + traceDowncall("MyStruct_into_a", self); } - return (MemorySegment)mh$.invokeExact(allocator, i); + return (byte)mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - - private static class ResultOpaque_new_in_enum_err { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - ResultOpaque_new_in_enum_err_result.layout(), - somelib_h.C_INT - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("ResultOpaque_new_in_enum_err"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + private static final int ContiguousEnum_C = (int)0L; + /** + * {@snippet lang=c : + * enum ContiguousEnum.ContiguousEnum_C = 0 + * } + */ + public static int ContiguousEnum_C() { + return ContiguousEnum_C; } - + private static final int ContiguousEnum_D = (int)1L; /** - * Function descriptor for: * {@snippet lang=c : - * struct ResultOpaque_new_in_enum_err_result ResultOpaque_new_in_enum_err(int32_t i) + * enum ContiguousEnum.ContiguousEnum_D = 1 * } */ - public static FunctionDescriptor ResultOpaque_new_in_enum_err$descriptor() { - return ResultOpaque_new_in_enum_err.DESC; + public static int ContiguousEnum_D() { + return ContiguousEnum_D; } - + private static final int ContiguousEnum_E = (int)2L; /** - * Downcall method handle for: * {@snippet lang=c : - * struct ResultOpaque_new_in_enum_err_result ResultOpaque_new_in_enum_err(int32_t i) + * enum ContiguousEnum.ContiguousEnum_E = 2 * } */ - public static MethodHandle ResultOpaque_new_in_enum_err$handle() { - return ResultOpaque_new_in_enum_err.HANDLE; + public static int ContiguousEnum_E() { + return ContiguousEnum_E; } - + private static final int ContiguousEnum_F = (int)3L; /** - * Address for: * {@snippet lang=c : - * struct ResultOpaque_new_in_enum_err_result ResultOpaque_new_in_enum_err(int32_t i) + * enum ContiguousEnum.ContiguousEnum_F = 3 * } */ - public static MemorySegment ResultOpaque_new_in_enum_err$address() { - return ResultOpaque_new_in_enum_err.ADDR; + public static int ContiguousEnum_F() { + return ContiguousEnum_F; } - + private static final int ErrorEnum_Foo = (int)0L; /** * {@snippet lang=c : - * struct ResultOpaque_new_in_enum_err_result ResultOpaque_new_in_enum_err(int32_t i) + * enum ErrorEnum.ErrorEnum_Foo = 0 * } */ - public static MemorySegment ResultOpaque_new_in_enum_err(SegmentAllocator allocator, int i) { - var mh$ = ResultOpaque_new_in_enum_err.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("ResultOpaque_new_in_enum_err", allocator, i); - } - return (MemorySegment)mh$.invokeExact(allocator, i); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } + public static int ErrorEnum_Foo() { + return ErrorEnum_Foo; + } + private static final int ErrorEnum_Bar = (int)1L; + /** + * {@snippet lang=c : + * enum ErrorEnum.ErrorEnum_Bar = 1 + * } + */ + public static int ErrorEnum_Bar() { + return ErrorEnum_Bar; } - private static class ResultOpaque_assert_integer { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class Float64Vec_new_bool { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - somelib_h.C_INT + somelib_h.C_POINTER, + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("ResultOpaque_assert_integer"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_bool"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -15722,56 +12372,58 @@ private static class ResultOpaque_assert_integer { /** * Function descriptor for: * {@snippet lang=c : - * void ResultOpaque_assert_integer(const ResultOpaque *self, int32_t i) + * Float64Vec *Float64Vec_new_bool(const bool *v_data, size_t v_len) * } */ - public static FunctionDescriptor ResultOpaque_assert_integer$descriptor() { - return ResultOpaque_assert_integer.DESC; + public static FunctionDescriptor Float64Vec_new_bool$descriptor() { + return Float64Vec_new_bool.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void ResultOpaque_assert_integer(const ResultOpaque *self, int32_t i) + * Float64Vec *Float64Vec_new_bool(const bool *v_data, size_t v_len) * } */ - public static MethodHandle ResultOpaque_assert_integer$handle() { - return ResultOpaque_assert_integer.HANDLE; + public static MethodHandle Float64Vec_new_bool$handle() { + return Float64Vec_new_bool.HANDLE; } /** * Address for: * {@snippet lang=c : - * void ResultOpaque_assert_integer(const ResultOpaque *self, int32_t i) + * Float64Vec *Float64Vec_new_bool(const bool *v_data, size_t v_len) * } */ - public static MemorySegment ResultOpaque_assert_integer$address() { - return ResultOpaque_assert_integer.ADDR; + public static MemorySegment Float64Vec_new_bool$address() { + return Float64Vec_new_bool.ADDR; } /** * {@snippet lang=c : - * void ResultOpaque_assert_integer(const ResultOpaque *self, int32_t i) + * Float64Vec *Float64Vec_new_bool(const bool *v_data, size_t v_len) * } */ - public static void ResultOpaque_assert_integer(MemorySegment self, int i) { - var mh$ = ResultOpaque_assert_integer.HANDLE; + public static MemorySegment Float64Vec_new_bool(MemorySegment v_data, long v_len) { + var mh$ = Float64Vec_new_bool.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("ResultOpaque_assert_integer", self, i); + traceDowncall("Float64Vec_new_bool", v_data, v_len); } - mh$.invokeExact(self, i); + return (MemorySegment)mh$.invokeExact(v_data, v_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class ResultOpaque_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER + private static class Float64Vec_new_i16 { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("ResultOpaque_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_i16"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -15779,57 +12431,58 @@ private static class ResultOpaque_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void ResultOpaque_destroy(ResultOpaque *self) + * Float64Vec *Float64Vec_new_i16(const int16_t *v_data, size_t v_len) * } */ - public static FunctionDescriptor ResultOpaque_destroy$descriptor() { - return ResultOpaque_destroy.DESC; + public static FunctionDescriptor Float64Vec_new_i16$descriptor() { + return Float64Vec_new_i16.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void ResultOpaque_destroy(ResultOpaque *self) + * Float64Vec *Float64Vec_new_i16(const int16_t *v_data, size_t v_len) * } */ - public static MethodHandle ResultOpaque_destroy$handle() { - return ResultOpaque_destroy.HANDLE; + public static MethodHandle Float64Vec_new_i16$handle() { + return Float64Vec_new_i16.HANDLE; } /** * Address for: * {@snippet lang=c : - * void ResultOpaque_destroy(ResultOpaque *self) + * Float64Vec *Float64Vec_new_i16(const int16_t *v_data, size_t v_len) * } */ - public static MemorySegment ResultOpaque_destroy$address() { - return ResultOpaque_destroy.ADDR; + public static MemorySegment Float64Vec_new_i16$address() { + return Float64Vec_new_i16.ADDR; } /** * {@snippet lang=c : - * void ResultOpaque_destroy(ResultOpaque *self) + * Float64Vec *Float64Vec_new_i16(const int16_t *v_data, size_t v_len) * } */ - public static void ResultOpaque_destroy(MemorySegment self) { - var mh$ = ResultOpaque_destroy.HANDLE; + public static MemorySegment Float64Vec_new_i16(MemorySegment v_data, long v_len) { + var mh$ = Float64Vec_new_i16.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("ResultOpaque_destroy", self); + traceDowncall("Float64Vec_new_i16", v_data, v_len); } - mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(v_data, v_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OptionOpaque_new { + private static class Float64Vec_new_u16 { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - somelib_h.C_INT + somelib_h.C_POINTER, + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaque_new"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_u16"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -15837,197 +12490,58 @@ private static class OptionOpaque_new { /** * Function descriptor for: * {@snippet lang=c : - * OptionOpaque *OptionOpaque_new(int32_t i) + * Float64Vec *Float64Vec_new_u16(const uint16_t *v_data, size_t v_len) * } */ - public static FunctionDescriptor OptionOpaque_new$descriptor() { - return OptionOpaque_new.DESC; + public static FunctionDescriptor Float64Vec_new_u16$descriptor() { + return Float64Vec_new_u16.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * OptionOpaque *OptionOpaque_new(int32_t i) + * Float64Vec *Float64Vec_new_u16(const uint16_t *v_data, size_t v_len) * } */ - public static MethodHandle OptionOpaque_new$handle() { - return OptionOpaque_new.HANDLE; + public static MethodHandle Float64Vec_new_u16$handle() { + return Float64Vec_new_u16.HANDLE; } /** * Address for: * {@snippet lang=c : - * OptionOpaque *OptionOpaque_new(int32_t i) + * Float64Vec *Float64Vec_new_u16(const uint16_t *v_data, size_t v_len) * } */ - public static MemorySegment OptionOpaque_new$address() { - return OptionOpaque_new.ADDR; + public static MemorySegment Float64Vec_new_u16$address() { + return Float64Vec_new_u16.ADDR; } /** * {@snippet lang=c : - * OptionOpaque *OptionOpaque_new(int32_t i) + * Float64Vec *Float64Vec_new_u16(const uint16_t *v_data, size_t v_len) * } */ - public static MemorySegment OptionOpaque_new(int i) { - var mh$ = OptionOpaque_new.HANDLE; + public static MemorySegment Float64Vec_new_u16(MemorySegment v_data, long v_len) { + var mh$ = Float64Vec_new_u16.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OptionOpaque_new", i); + traceDowncall("Float64Vec_new_u16", v_data, v_len); } - return (MemorySegment)mh$.invokeExact(i); + return (MemorySegment)mh$.invokeExact(v_data, v_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - /** - * Variadic invoker class for: - * {@snippet lang=c : - * OptionOpaque *OptionOpaque_new_none() - * } - */ - public static class OptionOpaque_new_none { - private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - somelib_h.C_POINTER ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaque_new_none"); - - private final MethodHandle handle; - private final FunctionDescriptor descriptor; - private final MethodHandle spreader; - - private OptionOpaque_new_none(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { - this.handle = handle; - this.descriptor = descriptor; - this.spreader = spreader; - } - - /** - * Variadic invoker factory for: - * {@snippet lang=c : - * OptionOpaque *OptionOpaque_new_none() - * } - */ - public static OptionOpaque_new_none makeInvoker(MemoryLayout... layouts) { - FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); - Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); - var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); - var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new OptionOpaque_new_none(mh$, desc$, spreader$); - } - - /** - * {@return the address} - */ - public static MemorySegment address() { - return ADDR; - } - - /** - * {@return the specialized method handle} - */ - public MethodHandle handle() { - return handle; - } - - /** - * {@return the specialized descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } - - public MemorySegment apply(Object... x0) { - try { - if (TRACE_DOWNCALLS) { - traceDowncall("OptionOpaque_new_none", x0); - } - return (MemorySegment)spreader.invokeExact(x0); - } catch(IllegalArgumentException | ClassCastException ex$) { - throw ex$; // rethrow IAE from passing wrong number/type of args - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - } - - /** - * Variadic invoker class for: - * {@snippet lang=c : - * struct OptionOpaque_returns_result OptionOpaque_returns() - * } - */ - public static class OptionOpaque_returns { - private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - OptionOpaque_returns_result.layout() ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaque_returns"); - - private final MethodHandle handle; - private final FunctionDescriptor descriptor; - private final MethodHandle spreader; - - private OptionOpaque_returns(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { - this.handle = handle; - this.descriptor = descriptor; - this.spreader = spreader; - } - - /** - * Variadic invoker factory for: - * {@snippet lang=c : - * struct OptionOpaque_returns_result OptionOpaque_returns() - * } - */ - public static OptionOpaque_returns makeInvoker(MemoryLayout... layouts) { - FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); - Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); - var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); - var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new OptionOpaque_returns(mh$, desc$, spreader$); - } - - /** - * {@return the address} - */ - public static MemorySegment address() { - return ADDR; - } - - /** - * {@return the specialized method handle} - */ - public MethodHandle handle() { - return handle; - } - - /** - * {@return the specialized descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } - - public MemorySegment apply(SegmentAllocator allocator, Object... x0) { - try { - if (TRACE_DOWNCALLS) { - traceDowncall("OptionOpaque_returns", allocator, x0); - } - return (MemorySegment)spreader.invokeExact(allocator, x0); - } catch(IllegalArgumentException | ClassCastException ex$) { - throw ex$; // rethrow IAE from passing wrong number/type of args - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - } - - private static class OptionOpaque_option_isize { + private static class Float64Vec_new_isize { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - OptionOpaque_option_isize_result.layout(), - somelib_h.C_POINTER + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaque_option_isize"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_isize"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -16035,57 +12549,58 @@ private static class OptionOpaque_option_isize { /** * Function descriptor for: * {@snippet lang=c : - * struct OptionOpaque_option_isize_result OptionOpaque_option_isize(const OptionOpaque *self) + * Float64Vec *Float64Vec_new_isize(const intptr_t *v_data, size_t v_len) * } */ - public static FunctionDescriptor OptionOpaque_option_isize$descriptor() { - return OptionOpaque_option_isize.DESC; + public static FunctionDescriptor Float64Vec_new_isize$descriptor() { + return Float64Vec_new_isize.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * struct OptionOpaque_option_isize_result OptionOpaque_option_isize(const OptionOpaque *self) + * Float64Vec *Float64Vec_new_isize(const intptr_t *v_data, size_t v_len) * } */ - public static MethodHandle OptionOpaque_option_isize$handle() { - return OptionOpaque_option_isize.HANDLE; + public static MethodHandle Float64Vec_new_isize$handle() { + return Float64Vec_new_isize.HANDLE; } /** * Address for: * {@snippet lang=c : - * struct OptionOpaque_option_isize_result OptionOpaque_option_isize(const OptionOpaque *self) + * Float64Vec *Float64Vec_new_isize(const intptr_t *v_data, size_t v_len) * } */ - public static MemorySegment OptionOpaque_option_isize$address() { - return OptionOpaque_option_isize.ADDR; + public static MemorySegment Float64Vec_new_isize$address() { + return Float64Vec_new_isize.ADDR; } /** * {@snippet lang=c : - * struct OptionOpaque_option_isize_result OptionOpaque_option_isize(const OptionOpaque *self) + * Float64Vec *Float64Vec_new_isize(const intptr_t *v_data, size_t v_len) * } */ - public static MemorySegment OptionOpaque_option_isize(SegmentAllocator allocator, MemorySegment self) { - var mh$ = OptionOpaque_option_isize.HANDLE; + public static MemorySegment Float64Vec_new_isize(MemorySegment v_data, long v_len) { + var mh$ = Float64Vec_new_isize.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OptionOpaque_option_isize", allocator, self); + traceDowncall("Float64Vec_new_isize", v_data, v_len); } - return (MemorySegment)mh$.invokeExact(allocator, self); + return (MemorySegment)mh$.invokeExact(v_data, v_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OptionOpaque_option_usize { + private static class Float64Vec_new_usize { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - OptionOpaque_option_usize_result.layout(), - somelib_h.C_POINTER + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaque_option_usize"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_usize"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -16093,57 +12608,58 @@ private static class OptionOpaque_option_usize { /** * Function descriptor for: * {@snippet lang=c : - * struct OptionOpaque_option_usize_result OptionOpaque_option_usize(const OptionOpaque *self) + * Float64Vec *Float64Vec_new_usize(const size_t *v_data, size_t v_len) * } */ - public static FunctionDescriptor OptionOpaque_option_usize$descriptor() { - return OptionOpaque_option_usize.DESC; + public static FunctionDescriptor Float64Vec_new_usize$descriptor() { + return Float64Vec_new_usize.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * struct OptionOpaque_option_usize_result OptionOpaque_option_usize(const OptionOpaque *self) + * Float64Vec *Float64Vec_new_usize(const size_t *v_data, size_t v_len) * } */ - public static MethodHandle OptionOpaque_option_usize$handle() { - return OptionOpaque_option_usize.HANDLE; + public static MethodHandle Float64Vec_new_usize$handle() { + return Float64Vec_new_usize.HANDLE; } /** * Address for: * {@snippet lang=c : - * struct OptionOpaque_option_usize_result OptionOpaque_option_usize(const OptionOpaque *self) + * Float64Vec *Float64Vec_new_usize(const size_t *v_data, size_t v_len) * } */ - public static MemorySegment OptionOpaque_option_usize$address() { - return OptionOpaque_option_usize.ADDR; + public static MemorySegment Float64Vec_new_usize$address() { + return Float64Vec_new_usize.ADDR; } /** * {@snippet lang=c : - * struct OptionOpaque_option_usize_result OptionOpaque_option_usize(const OptionOpaque *self) + * Float64Vec *Float64Vec_new_usize(const size_t *v_data, size_t v_len) * } */ - public static MemorySegment OptionOpaque_option_usize(SegmentAllocator allocator, MemorySegment self) { - var mh$ = OptionOpaque_option_usize.HANDLE; + public static MemorySegment Float64Vec_new_usize(MemorySegment v_data, long v_len) { + var mh$ = Float64Vec_new_usize.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OptionOpaque_option_usize", allocator, self); + traceDowncall("Float64Vec_new_usize", v_data, v_len); } - return (MemorySegment)mh$.invokeExact(allocator, self); + return (MemorySegment)mh$.invokeExact(v_data, v_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OptionOpaque_option_i32 { + private static class Float64Vec_new_f64_be_bytes { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - OptionOpaque_option_i32_result.layout(), - somelib_h.C_POINTER + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaque_option_i32"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_f64_be_bytes"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -16151,57 +12667,58 @@ private static class OptionOpaque_option_i32 { /** * Function descriptor for: * {@snippet lang=c : - * struct OptionOpaque_option_i32_result OptionOpaque_option_i32(const OptionOpaque *self) + * Float64Vec *Float64Vec_new_f64_be_bytes(const uint8_t *v_data, size_t v_len) * } */ - public static FunctionDescriptor OptionOpaque_option_i32$descriptor() { - return OptionOpaque_option_i32.DESC; + public static FunctionDescriptor Float64Vec_new_f64_be_bytes$descriptor() { + return Float64Vec_new_f64_be_bytes.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * struct OptionOpaque_option_i32_result OptionOpaque_option_i32(const OptionOpaque *self) + * Float64Vec *Float64Vec_new_f64_be_bytes(const uint8_t *v_data, size_t v_len) * } */ - public static MethodHandle OptionOpaque_option_i32$handle() { - return OptionOpaque_option_i32.HANDLE; + public static MethodHandle Float64Vec_new_f64_be_bytes$handle() { + return Float64Vec_new_f64_be_bytes.HANDLE; } /** * Address for: * {@snippet lang=c : - * struct OptionOpaque_option_i32_result OptionOpaque_option_i32(const OptionOpaque *self) + * Float64Vec *Float64Vec_new_f64_be_bytes(const uint8_t *v_data, size_t v_len) * } */ - public static MemorySegment OptionOpaque_option_i32$address() { - return OptionOpaque_option_i32.ADDR; + public static MemorySegment Float64Vec_new_f64_be_bytes$address() { + return Float64Vec_new_f64_be_bytes.ADDR; } /** * {@snippet lang=c : - * struct OptionOpaque_option_i32_result OptionOpaque_option_i32(const OptionOpaque *self) + * Float64Vec *Float64Vec_new_f64_be_bytes(const uint8_t *v_data, size_t v_len) * } */ - public static MemorySegment OptionOpaque_option_i32(SegmentAllocator allocator, MemorySegment self) { - var mh$ = OptionOpaque_option_i32.HANDLE; + public static MemorySegment Float64Vec_new_f64_be_bytes(MemorySegment v_data, long v_len) { + var mh$ = Float64Vec_new_f64_be_bytes.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OptionOpaque_option_i32", allocator, self); + traceDowncall("Float64Vec_new_f64_be_bytes", v_data, v_len); } - return (MemorySegment)mh$.invokeExact(allocator, self); + return (MemorySegment)mh$.invokeExact(v_data, v_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OptionOpaque_option_u32 { + private static class Float64Vec_new_from_owned { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - OptionOpaque_option_u32_result.layout(), - somelib_h.C_POINTER + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaque_option_u32"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_from_owned"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -16209,197 +12726,116 @@ private static class OptionOpaque_option_u32 { /** * Function descriptor for: * {@snippet lang=c : - * struct OptionOpaque_option_u32_result OptionOpaque_option_u32(const OptionOpaque *self) + * Float64Vec *Float64Vec_new_from_owned(double *v_data, size_t v_len) * } */ - public static FunctionDescriptor OptionOpaque_option_u32$descriptor() { - return OptionOpaque_option_u32.DESC; + public static FunctionDescriptor Float64Vec_new_from_owned$descriptor() { + return Float64Vec_new_from_owned.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * struct OptionOpaque_option_u32_result OptionOpaque_option_u32(const OptionOpaque *self) + * Float64Vec *Float64Vec_new_from_owned(double *v_data, size_t v_len) * } */ - public static MethodHandle OptionOpaque_option_u32$handle() { - return OptionOpaque_option_u32.HANDLE; + public static MethodHandle Float64Vec_new_from_owned$handle() { + return Float64Vec_new_from_owned.HANDLE; } /** * Address for: * {@snippet lang=c : - * struct OptionOpaque_option_u32_result OptionOpaque_option_u32(const OptionOpaque *self) + * Float64Vec *Float64Vec_new_from_owned(double *v_data, size_t v_len) * } */ - public static MemorySegment OptionOpaque_option_u32$address() { - return OptionOpaque_option_u32.ADDR; + public static MemorySegment Float64Vec_new_from_owned$address() { + return Float64Vec_new_from_owned.ADDR; } /** * {@snippet lang=c : - * struct OptionOpaque_option_u32_result OptionOpaque_option_u32(const OptionOpaque *self) + * Float64Vec *Float64Vec_new_from_owned(double *v_data, size_t v_len) * } */ - public static MemorySegment OptionOpaque_option_u32(SegmentAllocator allocator, MemorySegment self) { - var mh$ = OptionOpaque_option_u32.HANDLE; + public static MemorySegment Float64Vec_new_from_owned(MemorySegment v_data, long v_len) { + var mh$ = Float64Vec_new_from_owned.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OptionOpaque_option_u32", allocator, self); + traceDowncall("Float64Vec_new_from_owned", v_data, v_len); } - return (MemorySegment)mh$.invokeExact(allocator, self); + return (MemorySegment)mh$.invokeExact(v_data, v_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } + private static class Float64Vec_as_slice { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + DiplomatF64View.layout(), + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_as_slice"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + /** - * Variadic invoker class for: + * Function descriptor for: * {@snippet lang=c : - * OptionStruct OptionOpaque_new_struct() + * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) * } */ - public static class OptionOpaque_new_struct { - private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - OptionStruct.layout() ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaque_new_struct"); - - private final MethodHandle handle; - private final FunctionDescriptor descriptor; - private final MethodHandle spreader; - - private OptionOpaque_new_struct(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { - this.handle = handle; - this.descriptor = descriptor; - this.spreader = spreader; - } - - /** - * Variadic invoker factory for: - * {@snippet lang=c : - * OptionStruct OptionOpaque_new_struct() - * } - */ - public static OptionOpaque_new_struct makeInvoker(MemoryLayout... layouts) { - FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); - Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); - var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); - var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new OptionOpaque_new_struct(mh$, desc$, spreader$); - } - - /** - * {@return the address} - */ - public static MemorySegment address() { - return ADDR; - } - - /** - * {@return the specialized method handle} - */ - public MethodHandle handle() { - return handle; - } - - /** - * {@return the specialized descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } - - public MemorySegment apply(SegmentAllocator allocator, Object... x0) { - try { - if (TRACE_DOWNCALLS) { - traceDowncall("OptionOpaque_new_struct", allocator, x0); - } - return (MemorySegment)spreader.invokeExact(allocator, x0); - } catch(IllegalArgumentException | ClassCastException ex$) { - throw ex$; // rethrow IAE from passing wrong number/type of args - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } + public static FunctionDescriptor Float64Vec_as_slice$descriptor() { + return Float64Vec_as_slice.DESC; } /** - * Variadic invoker class for: + * Downcall method handle for: * {@snippet lang=c : - * OptionStruct OptionOpaque_new_struct_nones() + * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) * } */ - public static class OptionOpaque_new_struct_nones { - private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - OptionStruct.layout() ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaque_new_struct_nones"); - - private final MethodHandle handle; - private final FunctionDescriptor descriptor; - private final MethodHandle spreader; - - private OptionOpaque_new_struct_nones(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { - this.handle = handle; - this.descriptor = descriptor; - this.spreader = spreader; - } - - /** - * Variadic invoker factory for: - * {@snippet lang=c : - * OptionStruct OptionOpaque_new_struct_nones() - * } - */ - public static OptionOpaque_new_struct_nones makeInvoker(MemoryLayout... layouts) { - FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); - Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); - var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); - var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new OptionOpaque_new_struct_nones(mh$, desc$, spreader$); - } - - /** - * {@return the address} - */ - public static MemorySegment address() { - return ADDR; - } - - /** - * {@return the specialized method handle} - */ - public MethodHandle handle() { - return handle; - } + public static MethodHandle Float64Vec_as_slice$handle() { + return Float64Vec_as_slice.HANDLE; + } - /** - * {@return the specialized descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } + /** + * Address for: + * {@snippet lang=c : + * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) + * } + */ + public static MemorySegment Float64Vec_as_slice$address() { + return Float64Vec_as_slice.ADDR; + } - public MemorySegment apply(SegmentAllocator allocator, Object... x0) { - try { - if (TRACE_DOWNCALLS) { - traceDowncall("OptionOpaque_new_struct_nones", allocator, x0); - } - return (MemorySegment)spreader.invokeExact(allocator, x0); - } catch(IllegalArgumentException | ClassCastException ex$) { - throw ex$; // rethrow IAE from passing wrong number/type of args - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); + /** + * {@snippet lang=c : + * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) + * } + */ + public static MemorySegment Float64Vec_as_slice(SegmentAllocator allocator, MemorySegment self) { + var mh$ = Float64Vec_as_slice.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Float64Vec_as_slice", allocator, self); } + return (MemorySegment)mh$.invokeExact(allocator, self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); } } - private static class OptionOpaque_assert_integer { + private static class Float64Vec_fill_slice { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER, - somelib_h.C_INT + somelib_h.C_POINTER, + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaque_assert_integer"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_fill_slice"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -16407,57 +12843,58 @@ private static class OptionOpaque_assert_integer { /** * Function descriptor for: * {@snippet lang=c : - * void OptionOpaque_assert_integer(const OptionOpaque *self, int32_t i) + * void Float64Vec_fill_slice(const Float64Vec *self, double *v_data, size_t v_len) * } */ - public static FunctionDescriptor OptionOpaque_assert_integer$descriptor() { - return OptionOpaque_assert_integer.DESC; + public static FunctionDescriptor Float64Vec_fill_slice$descriptor() { + return Float64Vec_fill_slice.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void OptionOpaque_assert_integer(const OptionOpaque *self, int32_t i) + * void Float64Vec_fill_slice(const Float64Vec *self, double *v_data, size_t v_len) * } */ - public static MethodHandle OptionOpaque_assert_integer$handle() { - return OptionOpaque_assert_integer.HANDLE; + public static MethodHandle Float64Vec_fill_slice$handle() { + return Float64Vec_fill_slice.HANDLE; } /** * Address for: * {@snippet lang=c : - * void OptionOpaque_assert_integer(const OptionOpaque *self, int32_t i) + * void Float64Vec_fill_slice(const Float64Vec *self, double *v_data, size_t v_len) * } */ - public static MemorySegment OptionOpaque_assert_integer$address() { - return OptionOpaque_assert_integer.ADDR; + public static MemorySegment Float64Vec_fill_slice$address() { + return Float64Vec_fill_slice.ADDR; } /** * {@snippet lang=c : - * void OptionOpaque_assert_integer(const OptionOpaque *self, int32_t i) + * void Float64Vec_fill_slice(const Float64Vec *self, double *v_data, size_t v_len) * } */ - public static void OptionOpaque_assert_integer(MemorySegment self, int i) { - var mh$ = OptionOpaque_assert_integer.HANDLE; + public static void Float64Vec_fill_slice(MemorySegment self, MemorySegment v_data, long v_len) { + var mh$ = Float64Vec_fill_slice.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OptionOpaque_assert_integer", self, i); + traceDowncall("Float64Vec_fill_slice", self, v_data, v_len); } - mh$.invokeExact(self, i); + mh$.invokeExact(self, v_data, v_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OptionOpaque_option_opaque_argument { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_BOOL, - somelib_h.C_POINTER + private static class Float64Vec_set_value { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaque_option_opaque_argument"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_set_value"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -16465,56 +12902,57 @@ private static class OptionOpaque_option_opaque_argument { /** * Function descriptor for: * {@snippet lang=c : - * bool OptionOpaque_option_opaque_argument(const OptionOpaque *arg) + * void Float64Vec_set_value(Float64Vec *self, const double *new_slice_data, size_t new_slice_len) * } */ - public static FunctionDescriptor OptionOpaque_option_opaque_argument$descriptor() { - return OptionOpaque_option_opaque_argument.DESC; + public static FunctionDescriptor Float64Vec_set_value$descriptor() { + return Float64Vec_set_value.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * bool OptionOpaque_option_opaque_argument(const OptionOpaque *arg) + * void Float64Vec_set_value(Float64Vec *self, const double *new_slice_data, size_t new_slice_len) * } */ - public static MethodHandle OptionOpaque_option_opaque_argument$handle() { - return OptionOpaque_option_opaque_argument.HANDLE; + public static MethodHandle Float64Vec_set_value$handle() { + return Float64Vec_set_value.HANDLE; } /** * Address for: * {@snippet lang=c : - * bool OptionOpaque_option_opaque_argument(const OptionOpaque *arg) + * void Float64Vec_set_value(Float64Vec *self, const double *new_slice_data, size_t new_slice_len) * } */ - public static MemorySegment OptionOpaque_option_opaque_argument$address() { - return OptionOpaque_option_opaque_argument.ADDR; + public static MemorySegment Float64Vec_set_value$address() { + return Float64Vec_set_value.ADDR; } /** * {@snippet lang=c : - * bool OptionOpaque_option_opaque_argument(const OptionOpaque *arg) + * void Float64Vec_set_value(Float64Vec *self, const double *new_slice_data, size_t new_slice_len) * } */ - public static boolean OptionOpaque_option_opaque_argument(MemorySegment arg) { - var mh$ = OptionOpaque_option_opaque_argument.HANDLE; + public static void Float64Vec_set_value(MemorySegment self, MemorySegment new_slice_data, long new_slice_len) { + var mh$ = Float64Vec_set_value.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OptionOpaque_option_opaque_argument", arg); + traceDowncall("Float64Vec_set_value", self, new_slice_data, new_slice_len); } - return (boolean)mh$.invokeExact(arg); + mh$.invokeExact(self, new_slice_data, new_slice_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OptionOpaque_destroy { + private static class Float64Vec_to_string { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OptionOpaque_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_to_string"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -16522,58 +12960,57 @@ private static class OptionOpaque_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void OptionOpaque_destroy(OptionOpaque *self) + * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) * } */ - public static FunctionDescriptor OptionOpaque_destroy$descriptor() { - return OptionOpaque_destroy.DESC; + public static FunctionDescriptor Float64Vec_to_string$descriptor() { + return Float64Vec_to_string.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void OptionOpaque_destroy(OptionOpaque *self) + * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) * } */ - public static MethodHandle OptionOpaque_destroy$handle() { - return OptionOpaque_destroy.HANDLE; + public static MethodHandle Float64Vec_to_string$handle() { + return Float64Vec_to_string.HANDLE; } /** * Address for: * {@snippet lang=c : - * void OptionOpaque_destroy(OptionOpaque *self) + * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) * } */ - public static MemorySegment OptionOpaque_destroy$address() { - return OptionOpaque_destroy.ADDR; + public static MemorySegment Float64Vec_to_string$address() { + return Float64Vec_to_string.ADDR; } /** * {@snippet lang=c : - * void OptionOpaque_destroy(OptionOpaque *self) + * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) * } */ - public static void OptionOpaque_destroy(MemorySegment self) { - var mh$ = OptionOpaque_destroy.HANDLE; + public static void Float64Vec_to_string(MemorySegment self, MemorySegment write) { + var mh$ = Float64Vec_to_string.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OptionOpaque_destroy", self); + traceDowncall("Float64Vec_to_string", self, write); } - mh$.invokeExact(self); + mh$.invokeExact(self, write); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class namespace_MyIterable_new { + private static class Float64Vec_borrow { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG + DiplomatF64View.layout(), + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_MyIterable_new"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_borrow"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -16581,57 +13018,56 @@ private static class namespace_MyIterable_new { /** * Function descriptor for: * {@snippet lang=c : - * MyIterable *namespace_MyIterable_new(const uint8_t *x_data, size_t x_len) + * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) * } */ - public static FunctionDescriptor namespace_MyIterable_new$descriptor() { - return namespace_MyIterable_new.DESC; + public static FunctionDescriptor Float64Vec_borrow$descriptor() { + return Float64Vec_borrow.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * MyIterable *namespace_MyIterable_new(const uint8_t *x_data, size_t x_len) + * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) * } */ - public static MethodHandle namespace_MyIterable_new$handle() { - return namespace_MyIterable_new.HANDLE; + public static MethodHandle Float64Vec_borrow$handle() { + return Float64Vec_borrow.HANDLE; } /** * Address for: * {@snippet lang=c : - * MyIterable *namespace_MyIterable_new(const uint8_t *x_data, size_t x_len) + * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) * } */ - public static MemorySegment namespace_MyIterable_new$address() { - return namespace_MyIterable_new.ADDR; + public static MemorySegment Float64Vec_borrow$address() { + return Float64Vec_borrow.ADDR; } /** * {@snippet lang=c : - * MyIterable *namespace_MyIterable_new(const uint8_t *x_data, size_t x_len) + * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) * } */ - public static MemorySegment namespace_MyIterable_new(MemorySegment x_data, long x_len) { - var mh$ = namespace_MyIterable_new.HANDLE; + public static MemorySegment Float64Vec_borrow(SegmentAllocator allocator, MemorySegment self) { + var mh$ = Float64Vec_borrow.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("namespace_MyIterable_new", x_data, x_len); + traceDowncall("Float64Vec_borrow", allocator, self); } - return (MemorySegment)mh$.invokeExact(x_data, x_len); + return (MemorySegment)mh$.invokeExact(allocator, self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class namespace_MyIterable_iter { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, + private static class Float64Vec_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_MyIterable_iter"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -16639,56 +13075,61 @@ private static class namespace_MyIterable_iter { /** * Function descriptor for: * {@snippet lang=c : - * MyIterator *namespace_MyIterable_iter(const MyIterable *self) + * void Float64Vec_destroy(Float64Vec *self) * } */ - public static FunctionDescriptor namespace_MyIterable_iter$descriptor() { - return namespace_MyIterable_iter.DESC; + public static FunctionDescriptor Float64Vec_destroy$descriptor() { + return Float64Vec_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * MyIterator *namespace_MyIterable_iter(const MyIterable *self) + * void Float64Vec_destroy(Float64Vec *self) * } */ - public static MethodHandle namespace_MyIterable_iter$handle() { - return namespace_MyIterable_iter.HANDLE; + public static MethodHandle Float64Vec_destroy$handle() { + return Float64Vec_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * MyIterator *namespace_MyIterable_iter(const MyIterable *self) + * void Float64Vec_destroy(Float64Vec *self) * } */ - public static MemorySegment namespace_MyIterable_iter$address() { - return namespace_MyIterable_iter.ADDR; + public static MemorySegment Float64Vec_destroy$address() { + return Float64Vec_destroy.ADDR; } /** * {@snippet lang=c : - * MyIterator *namespace_MyIterable_iter(const MyIterable *self) + * void Float64Vec_destroy(Float64Vec *self) * } */ - public static MemorySegment namespace_MyIterable_iter(MemorySegment self) { - var mh$ = namespace_MyIterable_iter.HANDLE; + public static void Float64Vec_destroy(MemorySegment self) { + var mh$ = Float64Vec_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("namespace_MyIterable_iter", self); + traceDowncall("Float64Vec_destroy", self); } - return (MemorySegment)mh$.invokeExact(self); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class namespace_MyIterable_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER + private static class BorrowedFields_from_bar_and_strings { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + BorrowedFields.layout(), + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG, + somelib_h.C_POINTER, + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_MyIterable_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("BorrowedFields_from_bar_and_strings"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -16696,66 +13137,57 @@ private static class namespace_MyIterable_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void namespace_MyIterable_destroy(MyIterable *self) + * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, const char16_t *dstr16_data, size_t dstr16_len, const char *utf8_str_data, size_t utf8_str_len) * } */ - public static FunctionDescriptor namespace_MyIterable_destroy$descriptor() { - return namespace_MyIterable_destroy.DESC; + public static FunctionDescriptor BorrowedFields_from_bar_and_strings$descriptor() { + return BorrowedFields_from_bar_and_strings.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void namespace_MyIterable_destroy(MyIterable *self) + * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, const char16_t *dstr16_data, size_t dstr16_len, const char *utf8_str_data, size_t utf8_str_len) * } */ - public static MethodHandle namespace_MyIterable_destroy$handle() { - return namespace_MyIterable_destroy.HANDLE; + public static MethodHandle BorrowedFields_from_bar_and_strings$handle() { + return BorrowedFields_from_bar_and_strings.HANDLE; } /** * Address for: * {@snippet lang=c : - * void namespace_MyIterable_destroy(MyIterable *self) + * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, const char16_t *dstr16_data, size_t dstr16_len, const char *utf8_str_data, size_t utf8_str_len) * } */ - public static MemorySegment namespace_MyIterable_destroy$address() { - return namespace_MyIterable_destroy.ADDR; + public static MemorySegment BorrowedFields_from_bar_and_strings$address() { + return BorrowedFields_from_bar_and_strings.ADDR; } /** * {@snippet lang=c : - * void namespace_MyIterable_destroy(MyIterable *self) + * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, const char16_t *dstr16_data, size_t dstr16_len, const char *utf8_str_data, size_t utf8_str_len) * } */ - public static void namespace_MyIterable_destroy(MemorySegment self) { - var mh$ = namespace_MyIterable_destroy.HANDLE; + public static MemorySegment BorrowedFields_from_bar_and_strings(SegmentAllocator allocator, MemorySegment bar, MemorySegment dstr16_data, long dstr16_len, MemorySegment utf8_str_data, long utf8_str_len) { + var mh$ = BorrowedFields_from_bar_and_strings.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("namespace_MyIterable_destroy", self); + traceDowncall("BorrowedFields_from_bar_and_strings", allocator, bar, dstr16_data, dstr16_len, utf8_str_data, utf8_str_len); } - mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(allocator, bar, dstr16_data, dstr16_len, utf8_str_data, utf8_str_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class NestedBorrowedFields_from_bar_and_foo_and_strings { + private static class RefList_node { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - NestedBorrowedFields.layout(), - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG, - somelib_h.C_POINTER, - somelib_h.C_LONG, - somelib_h.C_POINTER, - somelib_h.C_LONG, somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("NestedBorrowedFields_from_bar_and_foo_and_strings"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("RefList_node"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -16763,127 +13195,56 @@ private static class NestedBorrowedFields_from_bar_and_foo_and_strings { /** * Function descriptor for: * {@snippet lang=c : - * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char16_t *dstr16_z_data, size_t dstr16_z_len, const char *utf8_str_y_data, size_t utf8_str_y_len, const char *utf8_str_z_data, size_t utf8_str_z_len) + * RefList *RefList_node(const RefListParameter *data) * } */ - public static FunctionDescriptor NestedBorrowedFields_from_bar_and_foo_and_strings$descriptor() { - return NestedBorrowedFields_from_bar_and_foo_and_strings.DESC; + public static FunctionDescriptor RefList_node$descriptor() { + return RefList_node.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char16_t *dstr16_z_data, size_t dstr16_z_len, const char *utf8_str_y_data, size_t utf8_str_y_len, const char *utf8_str_z_data, size_t utf8_str_z_len) + * RefList *RefList_node(const RefListParameter *data) * } */ - public static MethodHandle NestedBorrowedFields_from_bar_and_foo_and_strings$handle() { - return NestedBorrowedFields_from_bar_and_foo_and_strings.HANDLE; + public static MethodHandle RefList_node$handle() { + return RefList_node.HANDLE; } /** * Address for: * {@snippet lang=c : - * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char16_t *dstr16_z_data, size_t dstr16_z_len, const char *utf8_str_y_data, size_t utf8_str_y_len, const char *utf8_str_z_data, size_t utf8_str_z_len) + * RefList *RefList_node(const RefListParameter *data) * } */ - public static MemorySegment NestedBorrowedFields_from_bar_and_foo_and_strings$address() { - return NestedBorrowedFields_from_bar_and_foo_and_strings.ADDR; + public static MemorySegment RefList_node$address() { + return RefList_node.ADDR; } /** * {@snippet lang=c : - * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char16_t *dstr16_z_data, size_t dstr16_z_len, const char *utf8_str_y_data, size_t utf8_str_y_len, const char *utf8_str_z_data, size_t utf8_str_z_len) + * RefList *RefList_node(const RefListParameter *data) * } */ - public static MemorySegment NestedBorrowedFields_from_bar_and_foo_and_strings(SegmentAllocator allocator, MemorySegment bar, MemorySegment foo, MemorySegment dstr16_x_data, long dstr16_x_len, MemorySegment dstr16_z_data, long dstr16_z_len, MemorySegment utf8_str_y_data, long utf8_str_y_len, MemorySegment utf8_str_z_data, long utf8_str_z_len) { - var mh$ = NestedBorrowedFields_from_bar_and_foo_and_strings.HANDLE; + public static MemorySegment RefList_node(MemorySegment data) { + var mh$ = RefList_node.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("NestedBorrowedFields_from_bar_and_foo_and_strings", allocator, bar, foo, dstr16_x_data, dstr16_x_len, dstr16_z_data, dstr16_z_len, utf8_str_y_data, utf8_str_y_len, utf8_str_z_data, utf8_str_z_len); + traceDowncall("RefList_node", data); } - return (MemorySegment)mh$.invokeExact(allocator, bar, foo, dstr16_x_data, dstr16_x_len, dstr16_z_data, dstr16_z_len, utf8_str_y_data, utf8_str_y_len, utf8_str_z_data, utf8_str_z_len); + return (MemorySegment)mh$.invokeExact(data); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - /** - * Variadic invoker class for: - * {@snippet lang=c : - * MyStruct MyStruct_new() - * } - */ - public static class MyStruct_new { - private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - MyStruct.layout() ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("MyStruct_new"); - - private final MethodHandle handle; - private final FunctionDescriptor descriptor; - private final MethodHandle spreader; - - private MyStruct_new(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { - this.handle = handle; - this.descriptor = descriptor; - this.spreader = spreader; - } - - /** - * Variadic invoker factory for: - * {@snippet lang=c : - * MyStruct MyStruct_new() - * } - */ - public static MyStruct_new makeInvoker(MemoryLayout... layouts) { - FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); - Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); - var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); - var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new MyStruct_new(mh$, desc$, spreader$); - } - - /** - * {@return the address} - */ - public static MemorySegment address() { - return ADDR; - } - - /** - * {@return the specialized method handle} - */ - public MethodHandle handle() { - return handle; - } - - /** - * {@return the specialized descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } - - public MemorySegment apply(SegmentAllocator allocator, Object... x0) { - try { - if (TRACE_DOWNCALLS) { - traceDowncall("MyStruct_new", allocator, x0); - } - return (MemorySegment)spreader.invokeExact(allocator, x0); - } catch(IllegalArgumentException | ClassCastException ex$) { - throw ex$; // rethrow IAE from passing wrong number/type of args - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - } - - private static class MyStruct_into_a { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_CHAR, - MyStruct.layout() + private static class RefList_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyStruct_into_a"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("RefList_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -16891,128 +13252,112 @@ private static class MyStruct_into_a { /** * Function descriptor for: * {@snippet lang=c : - * uint8_t MyStruct_into_a(MyStruct self) + * void RefList_destroy(RefList *self) * } */ - public static FunctionDescriptor MyStruct_into_a$descriptor() { - return MyStruct_into_a.DESC; + public static FunctionDescriptor RefList_destroy$descriptor() { + return RefList_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * uint8_t MyStruct_into_a(MyStruct self) + * void RefList_destroy(RefList *self) * } */ - public static MethodHandle MyStruct_into_a$handle() { - return MyStruct_into_a.HANDLE; + public static MethodHandle RefList_destroy$handle() { + return RefList_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * uint8_t MyStruct_into_a(MyStruct self) + * void RefList_destroy(RefList *self) * } */ - public static MemorySegment MyStruct_into_a$address() { - return MyStruct_into_a.ADDR; + public static MemorySegment RefList_destroy$address() { + return RefList_destroy.ADDR; } /** * {@snippet lang=c : - * uint8_t MyStruct_into_a(MyStruct self) + * void RefList_destroy(RefList *self) * } */ - public static byte MyStruct_into_a(MemorySegment self) { - var mh$ = MyStruct_into_a.HANDLE; + public static void RefList_destroy(MemorySegment self) { + var mh$ = RefList_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyStruct_into_a", self); + traceDowncall("RefList_destroy", self); } - return (byte)mh$.invokeExact(self); + mh$.invokeExact(self); } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - /** - * Variadic invoker class for: - * {@snippet lang=c : - * struct MyStruct_returns_zst_result_result MyStruct_returns_zst_result() - * } - */ - public static class MyStruct_returns_zst_result { - private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - MyStruct_returns_zst_result_result.layout() ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("MyStruct_returns_zst_result"); - - private final MethodHandle handle; - private final FunctionDescriptor descriptor; - private final MethodHandle spreader; - - private MyStruct_returns_zst_result(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { - this.handle = handle; - this.descriptor = descriptor; - this.spreader = spreader; - } - - /** - * Variadic invoker factory for: - * {@snippet lang=c : - * struct MyStruct_returns_zst_result_result MyStruct_returns_zst_result() - * } - */ - public static MyStruct_returns_zst_result makeInvoker(MemoryLayout... layouts) { - FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); - Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); - var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); - var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new MyStruct_returns_zst_result(mh$, desc$, spreader$); - } - - /** - * {@return the address} - */ - public static MemorySegment address() { - return ADDR; + throw new AssertionError("should not reach here", ex$); } + } - /** - * {@return the specialized method handle} - */ - public MethodHandle handle() { - return handle; - } + private static class CyclicStructB_get_a { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + CyclicStructA.layout() ); - /** - * {@return the specialized descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } + public static final MemorySegment ADDR = somelib_h.findOrThrow("CyclicStructB_get_a"); - public MemorySegment apply(SegmentAllocator allocator, Object... x0) { - try { - if (TRACE_DOWNCALLS) { - traceDowncall("MyStruct_returns_zst_result", allocator, x0); - } - return (MemorySegment)spreader.invokeExact(allocator, x0); - } catch(IllegalArgumentException | ClassCastException ex$) { - throw ex$; // rethrow IAE from passing wrong number/type of args - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * CyclicStructA CyclicStructB_get_a() + * } + */ + public static FunctionDescriptor CyclicStructB_get_a$descriptor() { + return CyclicStructB_get_a.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * CyclicStructA CyclicStructB_get_a() + * } + */ + public static MethodHandle CyclicStructB_get_a$handle() { + return CyclicStructB_get_a.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * CyclicStructA CyclicStructB_get_a() + * } + */ + public static MemorySegment CyclicStructB_get_a$address() { + return CyclicStructB_get_a.ADDR; + } + + /** + * {@snippet lang=c : + * CyclicStructA CyclicStructB_get_a() + * } + */ + public static MemorySegment CyclicStructB_get_a(SegmentAllocator allocator) { + var mh$ = CyclicStructB_get_a.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("CyclicStructB_get_a", allocator); } + return (MemorySegment)mh$.invokeExact(allocator); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_new { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG + private static class Two_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Two_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -17020,58 +13365,58 @@ private static class Float64Vec_new { /** * Function descriptor for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new(const double *v_data, size_t v_len) + * void Two_destroy(Two *self) * } */ - public static FunctionDescriptor Float64Vec_new$descriptor() { - return Float64Vec_new.DESC; + public static FunctionDescriptor Two_destroy$descriptor() { + return Two_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new(const double *v_data, size_t v_len) + * void Two_destroy(Two *self) * } */ - public static MethodHandle Float64Vec_new$handle() { - return Float64Vec_new.HANDLE; + public static MethodHandle Two_destroy$handle() { + return Two_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new(const double *v_data, size_t v_len) + * void Two_destroy(Two *self) * } */ - public static MemorySegment Float64Vec_new$address() { - return Float64Vec_new.ADDR; + public static MemorySegment Two_destroy$address() { + return Two_destroy.ADDR; } /** * {@snippet lang=c : - * Float64Vec *Float64Vec_new(const double *v_data, size_t v_len) + * void Two_destroy(Two *self) * } */ - public static MemorySegment Float64Vec_new(MemorySegment v_data, long v_len) { - var mh$ = Float64Vec_new.HANDLE; + public static void Two_destroy(MemorySegment self) { + var mh$ = Two_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_new", v_data, v_len); + traceDowncall("Two_destroy", self); } - return (MemorySegment)mh$.invokeExact(v_data, v_len); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_new_bool { + private static class MyString_new { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_bool"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -17079,43 +13424,43 @@ private static class Float64Vec_new_bool { /** * Function descriptor for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_bool(const bool *v_data, size_t v_len) + * MyString *MyString_new(const char *v_data, size_t v_len) * } */ - public static FunctionDescriptor Float64Vec_new_bool$descriptor() { - return Float64Vec_new_bool.DESC; + public static FunctionDescriptor MyString_new$descriptor() { + return MyString_new.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_bool(const bool *v_data, size_t v_len) + * MyString *MyString_new(const char *v_data, size_t v_len) * } */ - public static MethodHandle Float64Vec_new_bool$handle() { - return Float64Vec_new_bool.HANDLE; + public static MethodHandle MyString_new$handle() { + return MyString_new.HANDLE; } /** * Address for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_bool(const bool *v_data, size_t v_len) + * MyString *MyString_new(const char *v_data, size_t v_len) * } */ - public static MemorySegment Float64Vec_new_bool$address() { - return Float64Vec_new_bool.ADDR; + public static MemorySegment MyString_new$address() { + return MyString_new.ADDR; } /** * {@snippet lang=c : - * Float64Vec *Float64Vec_new_bool(const bool *v_data, size_t v_len) + * MyString *MyString_new(const char *v_data, size_t v_len) * } */ - public static MemorySegment Float64Vec_new_bool(MemorySegment v_data, long v_len) { - var mh$ = Float64Vec_new_bool.HANDLE; + public static MemorySegment MyString_new(MemorySegment v_data, long v_len) { + var mh$ = MyString_new.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_new_bool", v_data, v_len); + traceDowncall("MyString_new", v_data, v_len); } return (MemorySegment)mh$.invokeExact(v_data, v_len); } catch (Throwable ex$) { @@ -17123,14 +13468,14 @@ public static MemorySegment Float64Vec_new_bool(MemorySegment v_data, long v_len } } - private static class Float64Vec_new_i16 { + private static class MyString_new_unsafe { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_i16"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new_unsafe"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -17138,43 +13483,43 @@ private static class Float64Vec_new_i16 { /** * Function descriptor for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_i16(const int16_t *v_data, size_t v_len) + * MyString *MyString_new_unsafe(const char *v_data, size_t v_len) * } */ - public static FunctionDescriptor Float64Vec_new_i16$descriptor() { - return Float64Vec_new_i16.DESC; + public static FunctionDescriptor MyString_new_unsafe$descriptor() { + return MyString_new_unsafe.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_i16(const int16_t *v_data, size_t v_len) + * MyString *MyString_new_unsafe(const char *v_data, size_t v_len) * } */ - public static MethodHandle Float64Vec_new_i16$handle() { - return Float64Vec_new_i16.HANDLE; + public static MethodHandle MyString_new_unsafe$handle() { + return MyString_new_unsafe.HANDLE; } /** * Address for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_i16(const int16_t *v_data, size_t v_len) + * MyString *MyString_new_unsafe(const char *v_data, size_t v_len) * } */ - public static MemorySegment Float64Vec_new_i16$address() { - return Float64Vec_new_i16.ADDR; + public static MemorySegment MyString_new_unsafe$address() { + return MyString_new_unsafe.ADDR; } /** * {@snippet lang=c : - * Float64Vec *Float64Vec_new_i16(const int16_t *v_data, size_t v_len) + * MyString *MyString_new_unsafe(const char *v_data, size_t v_len) * } */ - public static MemorySegment Float64Vec_new_i16(MemorySegment v_data, long v_len) { - var mh$ = Float64Vec_new_i16.HANDLE; + public static MemorySegment MyString_new_unsafe(MemorySegment v_data, long v_len) { + var mh$ = MyString_new_unsafe.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_new_i16", v_data, v_len); + traceDowncall("MyString_new_unsafe", v_data, v_len); } return (MemorySegment)mh$.invokeExact(v_data, v_len); } catch (Throwable ex$) { @@ -17182,14 +13527,14 @@ public static MemorySegment Float64Vec_new_i16(MemorySegment v_data, long v_len) } } - private static class Float64Vec_new_u16 { + private static class MyString_new_owned { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_u16"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new_owned"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -17197,43 +13542,43 @@ private static class Float64Vec_new_u16 { /** * Function descriptor for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_u16(const uint16_t *v_data, size_t v_len) + * MyString *MyString_new_owned(const char *v_data, size_t v_len) * } */ - public static FunctionDescriptor Float64Vec_new_u16$descriptor() { - return Float64Vec_new_u16.DESC; + public static FunctionDescriptor MyString_new_owned$descriptor() { + return MyString_new_owned.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_u16(const uint16_t *v_data, size_t v_len) + * MyString *MyString_new_owned(const char *v_data, size_t v_len) * } */ - public static MethodHandle Float64Vec_new_u16$handle() { - return Float64Vec_new_u16.HANDLE; + public static MethodHandle MyString_new_owned$handle() { + return MyString_new_owned.HANDLE; } /** * Address for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_u16(const uint16_t *v_data, size_t v_len) + * MyString *MyString_new_owned(const char *v_data, size_t v_len) * } */ - public static MemorySegment Float64Vec_new_u16$address() { - return Float64Vec_new_u16.ADDR; + public static MemorySegment MyString_new_owned$address() { + return MyString_new_owned.ADDR; } /** * {@snippet lang=c : - * Float64Vec *Float64Vec_new_u16(const uint16_t *v_data, size_t v_len) + * MyString *MyString_new_owned(const char *v_data, size_t v_len) * } */ - public static MemorySegment Float64Vec_new_u16(MemorySegment v_data, long v_len) { - var mh$ = Float64Vec_new_u16.HANDLE; + public static MemorySegment MyString_new_owned(MemorySegment v_data, long v_len) { + var mh$ = MyString_new_owned.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_new_u16", v_data, v_len); + traceDowncall("MyString_new_owned", v_data, v_len); } return (MemorySegment)mh$.invokeExact(v_data, v_len); } catch (Throwable ex$) { @@ -17241,14 +13586,14 @@ public static MemorySegment Float64Vec_new_u16(MemorySegment v_data, long v_len) } } - private static class Float64Vec_new_isize { + private static class MyString_new_from_first { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_isize"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new_from_first"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -17256,43 +13601,43 @@ private static class Float64Vec_new_isize { /** * Function descriptor for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_isize(const intptr_t *v_data, size_t v_len) + * MyString *MyString_new_from_first(DiplomatStringsView *v_data, size_t v_len) * } */ - public static FunctionDescriptor Float64Vec_new_isize$descriptor() { - return Float64Vec_new_isize.DESC; + public static FunctionDescriptor MyString_new_from_first$descriptor() { + return MyString_new_from_first.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_isize(const intptr_t *v_data, size_t v_len) + * MyString *MyString_new_from_first(DiplomatStringsView *v_data, size_t v_len) * } */ - public static MethodHandle Float64Vec_new_isize$handle() { - return Float64Vec_new_isize.HANDLE; + public static MethodHandle MyString_new_from_first$handle() { + return MyString_new_from_first.HANDLE; } /** * Address for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_isize(const intptr_t *v_data, size_t v_len) + * MyString *MyString_new_from_first(DiplomatStringsView *v_data, size_t v_len) * } */ - public static MemorySegment Float64Vec_new_isize$address() { - return Float64Vec_new_isize.ADDR; + public static MemorySegment MyString_new_from_first$address() { + return MyString_new_from_first.ADDR; } /** * {@snippet lang=c : - * Float64Vec *Float64Vec_new_isize(const intptr_t *v_data, size_t v_len) + * MyString *MyString_new_from_first(DiplomatStringsView *v_data, size_t v_len) * } */ - public static MemorySegment Float64Vec_new_isize(MemorySegment v_data, long v_len) { - var mh$ = Float64Vec_new_isize.HANDLE; + public static MemorySegment MyString_new_from_first(MemorySegment v_data, long v_len) { + var mh$ = MyString_new_from_first.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_new_isize", v_data, v_len); + traceDowncall("MyString_new_from_first", v_data, v_len); } return (MemorySegment)mh$.invokeExact(v_data, v_len); } catch (Throwable ex$) { @@ -17300,14 +13645,14 @@ public static MemorySegment Float64Vec_new_isize(MemorySegment v_data, long v_le } } - private static class Float64Vec_new_usize { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( + private static class MyString_set_str { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_usize"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_set_str"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -17315,58 +13660,57 @@ private static class Float64Vec_new_usize { /** * Function descriptor for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_usize(const size_t *v_data, size_t v_len) + * void MyString_set_str(MyString *self, const char *new_str_data, size_t new_str_len) * } */ - public static FunctionDescriptor Float64Vec_new_usize$descriptor() { - return Float64Vec_new_usize.DESC; + public static FunctionDescriptor MyString_set_str$descriptor() { + return MyString_set_str.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_usize(const size_t *v_data, size_t v_len) + * void MyString_set_str(MyString *self, const char *new_str_data, size_t new_str_len) * } */ - public static MethodHandle Float64Vec_new_usize$handle() { - return Float64Vec_new_usize.HANDLE; + public static MethodHandle MyString_set_str$handle() { + return MyString_set_str.HANDLE; } /** * Address for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_usize(const size_t *v_data, size_t v_len) + * void MyString_set_str(MyString *self, const char *new_str_data, size_t new_str_len) * } */ - public static MemorySegment Float64Vec_new_usize$address() { - return Float64Vec_new_usize.ADDR; + public static MemorySegment MyString_set_str$address() { + return MyString_set_str.ADDR; } /** * {@snippet lang=c : - * Float64Vec *Float64Vec_new_usize(const size_t *v_data, size_t v_len) + * void MyString_set_str(MyString *self, const char *new_str_data, size_t new_str_len) * } */ - public static MemorySegment Float64Vec_new_usize(MemorySegment v_data, long v_len) { - var mh$ = Float64Vec_new_usize.HANDLE; + public static void MyString_set_str(MemorySegment self, MemorySegment new_str_data, long new_str_len) { + var mh$ = MyString_set_str.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_new_usize", v_data, v_len); + traceDowncall("MyString_set_str", self, new_str_data, new_str_len); } - return (MemorySegment)mh$.invokeExact(v_data, v_len); + mh$.invokeExact(self, new_str_data, new_str_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_new_f64_be_bytes { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, + private static class MyString_get_str { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_f64_be_bytes"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_get_str"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -17374,57 +13718,58 @@ private static class Float64Vec_new_f64_be_bytes { /** * Function descriptor for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_f64_be_bytes(const uint8_t *v_data, size_t v_len) + * void MyString_get_str(const MyString *self, DiplomatWrite *write) * } */ - public static FunctionDescriptor Float64Vec_new_f64_be_bytes$descriptor() { - return Float64Vec_new_f64_be_bytes.DESC; + public static FunctionDescriptor MyString_get_str$descriptor() { + return MyString_get_str.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_f64_be_bytes(const uint8_t *v_data, size_t v_len) + * void MyString_get_str(const MyString *self, DiplomatWrite *write) * } */ - public static MethodHandle Float64Vec_new_f64_be_bytes$handle() { - return Float64Vec_new_f64_be_bytes.HANDLE; + public static MethodHandle MyString_get_str$handle() { + return MyString_get_str.HANDLE; } /** * Address for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_f64_be_bytes(const uint8_t *v_data, size_t v_len) + * void MyString_get_str(const MyString *self, DiplomatWrite *write) * } */ - public static MemorySegment Float64Vec_new_f64_be_bytes$address() { - return Float64Vec_new_f64_be_bytes.ADDR; + public static MemorySegment MyString_get_str$address() { + return MyString_get_str.ADDR; } /** * {@snippet lang=c : - * Float64Vec *Float64Vec_new_f64_be_bytes(const uint8_t *v_data, size_t v_len) + * void MyString_get_str(const MyString *self, DiplomatWrite *write) * } */ - public static MemorySegment Float64Vec_new_f64_be_bytes(MemorySegment v_data, long v_len) { - var mh$ = Float64Vec_new_f64_be_bytes.HANDLE; + public static void MyString_get_str(MemorySegment self, MemorySegment write) { + var mh$ = MyString_get_str.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_new_f64_be_bytes", v_data, v_len); + traceDowncall("MyString_get_str", self, write); } - return (MemorySegment)mh$.invokeExact(v_data, v_len); + mh$.invokeExact(self, write); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_as_boxed_slice { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - DiplomatF64View.layout(), + private static class MyString_string_transform { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, + somelib_h.C_LONG, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_as_boxed_slice"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_string_transform"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -17432,57 +13777,56 @@ private static class Float64Vec_as_boxed_slice { /** * Function descriptor for: * {@snippet lang=c : - * DiplomatF64View Float64Vec_as_boxed_slice(const Float64Vec *self) + * void MyString_string_transform(const char *foo_data, size_t foo_len, DiplomatWrite *write) * } */ - public static FunctionDescriptor Float64Vec_as_boxed_slice$descriptor() { - return Float64Vec_as_boxed_slice.DESC; + public static FunctionDescriptor MyString_string_transform$descriptor() { + return MyString_string_transform.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * DiplomatF64View Float64Vec_as_boxed_slice(const Float64Vec *self) + * void MyString_string_transform(const char *foo_data, size_t foo_len, DiplomatWrite *write) * } */ - public static MethodHandle Float64Vec_as_boxed_slice$handle() { - return Float64Vec_as_boxed_slice.HANDLE; + public static MethodHandle MyString_string_transform$handle() { + return MyString_string_transform.HANDLE; } /** * Address for: * {@snippet lang=c : - * DiplomatF64View Float64Vec_as_boxed_slice(const Float64Vec *self) + * void MyString_string_transform(const char *foo_data, size_t foo_len, DiplomatWrite *write) * } */ - public static MemorySegment Float64Vec_as_boxed_slice$address() { - return Float64Vec_as_boxed_slice.ADDR; + public static MemorySegment MyString_string_transform$address() { + return MyString_string_transform.ADDR; } /** * {@snippet lang=c : - * DiplomatF64View Float64Vec_as_boxed_slice(const Float64Vec *self) + * void MyString_string_transform(const char *foo_data, size_t foo_len, DiplomatWrite *write) * } */ - public static MemorySegment Float64Vec_as_boxed_slice(SegmentAllocator allocator, MemorySegment self) { - var mh$ = Float64Vec_as_boxed_slice.HANDLE; + public static void MyString_string_transform(MemorySegment foo_data, long foo_len, MemorySegment write) { + var mh$ = MyString_string_transform.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_as_boxed_slice", allocator, self); + traceDowncall("MyString_string_transform", foo_data, foo_len, write); } - return (MemorySegment)mh$.invokeExact(allocator, self); + mh$.invokeExact(foo_data, foo_len, write); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_as_slice { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - DiplomatF64View.layout(), + private static class MyString_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_as_slice"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -17490,58 +13834,61 @@ private static class Float64Vec_as_slice { /** * Function descriptor for: * {@snippet lang=c : - * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) + * void MyString_destroy(MyString *self) * } */ - public static FunctionDescriptor Float64Vec_as_slice$descriptor() { - return Float64Vec_as_slice.DESC; + public static FunctionDescriptor MyString_destroy$descriptor() { + return MyString_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) + * void MyString_destroy(MyString *self) * } */ - public static MethodHandle Float64Vec_as_slice$handle() { - return Float64Vec_as_slice.HANDLE; + public static MethodHandle MyString_destroy$handle() { + return MyString_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) + * void MyString_destroy(MyString *self) * } */ - public static MemorySegment Float64Vec_as_slice$address() { - return Float64Vec_as_slice.ADDR; + public static MemorySegment MyString_destroy$address() { + return MyString_destroy.ADDR; } /** * {@snippet lang=c : - * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) + * void MyString_destroy(MyString *self) * } */ - public static MemorySegment Float64Vec_as_slice(SegmentAllocator allocator, MemorySegment self) { - var mh$ = Float64Vec_as_slice.HANDLE; + public static void MyString_destroy(MemorySegment self) { + var mh$ = MyString_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_as_slice", allocator, self); + traceDowncall("MyString_destroy", self); } - return (MemorySegment)mh$.invokeExact(allocator, self); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_fill_slice { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class BorrowedFieldsWithBounds_from_foo_and_strings { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + BorrowedFieldsWithBounds.layout(), somelib_h.C_POINTER, somelib_h.C_POINTER, + somelib_h.C_LONG, + somelib_h.C_POINTER, somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_fill_slice"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("BorrowedFieldsWithBounds_from_foo_and_strings"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -17549,58 +13896,55 @@ private static class Float64Vec_fill_slice { /** * Function descriptor for: * {@snippet lang=c : - * void Float64Vec_fill_slice(const Float64Vec *self, double *v_data, size_t v_len) + * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char *utf8_str_z_data, size_t utf8_str_z_len) * } */ - public static FunctionDescriptor Float64Vec_fill_slice$descriptor() { - return Float64Vec_fill_slice.DESC; + public static FunctionDescriptor BorrowedFieldsWithBounds_from_foo_and_strings$descriptor() { + return BorrowedFieldsWithBounds_from_foo_and_strings.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Float64Vec_fill_slice(const Float64Vec *self, double *v_data, size_t v_len) + * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char *utf8_str_z_data, size_t utf8_str_z_len) * } */ - public static MethodHandle Float64Vec_fill_slice$handle() { - return Float64Vec_fill_slice.HANDLE; + public static MethodHandle BorrowedFieldsWithBounds_from_foo_and_strings$handle() { + return BorrowedFieldsWithBounds_from_foo_and_strings.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Float64Vec_fill_slice(const Float64Vec *self, double *v_data, size_t v_len) + * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char *utf8_str_z_data, size_t utf8_str_z_len) * } */ - public static MemorySegment Float64Vec_fill_slice$address() { - return Float64Vec_fill_slice.ADDR; + public static MemorySegment BorrowedFieldsWithBounds_from_foo_and_strings$address() { + return BorrowedFieldsWithBounds_from_foo_and_strings.ADDR; } /** * {@snippet lang=c : - * void Float64Vec_fill_slice(const Float64Vec *self, double *v_data, size_t v_len) + * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char *utf8_str_z_data, size_t utf8_str_z_len) * } */ - public static void Float64Vec_fill_slice(MemorySegment self, MemorySegment v_data, long v_len) { - var mh$ = Float64Vec_fill_slice.HANDLE; + public static MemorySegment BorrowedFieldsWithBounds_from_foo_and_strings(SegmentAllocator allocator, MemorySegment foo, MemorySegment dstr16_x_data, long dstr16_x_len, MemorySegment utf8_str_z_data, long utf8_str_z_len) { + var mh$ = BorrowedFieldsWithBounds_from_foo_and_strings.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_fill_slice", self, v_data, v_len); + traceDowncall("BorrowedFieldsWithBounds_from_foo_and_strings", allocator, foo, dstr16_x_data, dstr16_x_len, utf8_str_z_data, utf8_str_z_len); } - mh$.invokeExact(self, v_data, v_len); + return (MemorySegment)mh$.invokeExact(allocator, foo, dstr16_x_data, dstr16_x_len, utf8_str_z_data, utf8_str_z_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_set_value { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG - ); + private static class Opaque_new { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_set_value"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_new"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -17608,57 +13952,58 @@ private static class Float64Vec_set_value { /** * Function descriptor for: * {@snippet lang=c : - * void Float64Vec_set_value(Float64Vec *self, const double *new_slice_data, size_t new_slice_len) + * Opaque *Opaque_new() * } */ - public static FunctionDescriptor Float64Vec_set_value$descriptor() { - return Float64Vec_set_value.DESC; + public static FunctionDescriptor Opaque_new$descriptor() { + return Opaque_new.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Float64Vec_set_value(Float64Vec *self, const double *new_slice_data, size_t new_slice_len) + * Opaque *Opaque_new() * } */ - public static MethodHandle Float64Vec_set_value$handle() { - return Float64Vec_set_value.HANDLE; + public static MethodHandle Opaque_new$handle() { + return Opaque_new.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Float64Vec_set_value(Float64Vec *self, const double *new_slice_data, size_t new_slice_len) + * Opaque *Opaque_new() * } */ - public static MemorySegment Float64Vec_set_value$address() { - return Float64Vec_set_value.ADDR; + public static MemorySegment Opaque_new$address() { + return Opaque_new.ADDR; } /** * {@snippet lang=c : - * void Float64Vec_set_value(Float64Vec *self, const double *new_slice_data, size_t new_slice_len) + * Opaque *Opaque_new() * } */ - public static void Float64Vec_set_value(MemorySegment self, MemorySegment new_slice_data, long new_slice_len) { - var mh$ = Float64Vec_set_value.HANDLE; + public static MemorySegment Opaque_new() { + var mh$ = Opaque_new.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_set_value", self, new_slice_data, new_slice_len); + traceDowncall("Opaque_new"); } - mh$.invokeExact(self, new_slice_data, new_slice_len); + return (MemorySegment)mh$.invokeExact(); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_to_string { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class Opaque_from_str { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - somelib_h.C_POINTER + somelib_h.C_POINTER, + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_to_string"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_from_str"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -17666,57 +14011,57 @@ private static class Float64Vec_to_string { /** * Function descriptor for: * {@snippet lang=c : - * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) + * Opaque *Opaque_from_str(const char *input_data, size_t input_len) * } */ - public static FunctionDescriptor Float64Vec_to_string$descriptor() { - return Float64Vec_to_string.DESC; + public static FunctionDescriptor Opaque_from_str$descriptor() { + return Opaque_from_str.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) + * Opaque *Opaque_from_str(const char *input_data, size_t input_len) * } */ - public static MethodHandle Float64Vec_to_string$handle() { - return Float64Vec_to_string.HANDLE; + public static MethodHandle Opaque_from_str$handle() { + return Opaque_from_str.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) + * Opaque *Opaque_from_str(const char *input_data, size_t input_len) * } */ - public static MemorySegment Float64Vec_to_string$address() { - return Float64Vec_to_string.ADDR; + public static MemorySegment Opaque_from_str$address() { + return Opaque_from_str.ADDR; } /** * {@snippet lang=c : - * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) + * Opaque *Opaque_from_str(const char *input_data, size_t input_len) * } */ - public static void Float64Vec_to_string(MemorySegment self, MemorySegment write) { - var mh$ = Float64Vec_to_string.HANDLE; + public static MemorySegment Opaque_from_str(MemorySegment input_data, long input_len) { + var mh$ = Opaque_from_str.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_to_string", self, write); + traceDowncall("Opaque_from_str", input_data, input_len); } - mh$.invokeExact(self, write); + return (MemorySegment)mh$.invokeExact(input_data, input_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_borrow { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - DiplomatF64View.layout(), + private static class Opaque_get_debug_str { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_borrow"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_get_debug_str"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -17724,58 +14069,57 @@ private static class Float64Vec_borrow { /** * Function descriptor for: * {@snippet lang=c : - * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) + * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) * } */ - public static FunctionDescriptor Float64Vec_borrow$descriptor() { - return Float64Vec_borrow.DESC; + public static FunctionDescriptor Opaque_get_debug_str$descriptor() { + return Opaque_get_debug_str.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) + * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) * } */ - public static MethodHandle Float64Vec_borrow$handle() { - return Float64Vec_borrow.HANDLE; + public static MethodHandle Opaque_get_debug_str$handle() { + return Opaque_get_debug_str.HANDLE; } /** * Address for: * {@snippet lang=c : - * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) + * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) * } */ - public static MemorySegment Float64Vec_borrow$address() { - return Float64Vec_borrow.ADDR; + public static MemorySegment Opaque_get_debug_str$address() { + return Opaque_get_debug_str.ADDR; } /** * {@snippet lang=c : - * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) + * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) * } */ - public static MemorySegment Float64Vec_borrow(SegmentAllocator allocator, MemorySegment self) { - var mh$ = Float64Vec_borrow.HANDLE; + public static void Opaque_get_debug_str(MemorySegment self, MemorySegment write) { + var mh$ = Opaque_get_debug_str.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_borrow", allocator, self); + traceDowncall("Opaque_get_debug_str", self, write); } - return (MemorySegment)mh$.invokeExact(allocator, self); + mh$.invokeExact(self, write); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_get { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - Float64Vec_get_result.layout(), + private static class Opaque_assert_struct { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER, - somelib_h.C_LONG + MyStruct.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_get"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_assert_struct"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -17783,56 +14127,55 @@ private static class Float64Vec_get { /** * Function descriptor for: * {@snippet lang=c : - * struct Float64Vec_get_result Float64Vec_get(const Float64Vec *self, size_t i) + * void Opaque_assert_struct(const Opaque *self, MyStruct s) * } */ - public static FunctionDescriptor Float64Vec_get$descriptor() { - return Float64Vec_get.DESC; + public static FunctionDescriptor Opaque_assert_struct$descriptor() { + return Opaque_assert_struct.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * struct Float64Vec_get_result Float64Vec_get(const Float64Vec *self, size_t i) + * void Opaque_assert_struct(const Opaque *self, MyStruct s) * } */ - public static MethodHandle Float64Vec_get$handle() { - return Float64Vec_get.HANDLE; + public static MethodHandle Opaque_assert_struct$handle() { + return Opaque_assert_struct.HANDLE; } /** * Address for: * {@snippet lang=c : - * struct Float64Vec_get_result Float64Vec_get(const Float64Vec *self, size_t i) + * void Opaque_assert_struct(const Opaque *self, MyStruct s) * } */ - public static MemorySegment Float64Vec_get$address() { - return Float64Vec_get.ADDR; + public static MemorySegment Opaque_assert_struct$address() { + return Opaque_assert_struct.ADDR; } /** * {@snippet lang=c : - * struct Float64Vec_get_result Float64Vec_get(const Float64Vec *self, size_t i) + * void Opaque_assert_struct(const Opaque *self, MyStruct s) * } */ - public static MemorySegment Float64Vec_get(SegmentAllocator allocator, MemorySegment self, long i) { - var mh$ = Float64Vec_get.HANDLE; + public static void Opaque_assert_struct(MemorySegment self, MemorySegment s) { + var mh$ = Opaque_assert_struct.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_get", allocator, self, i); + traceDowncall("Opaque_assert_struct", self, s); } - return (MemorySegment)mh$.invokeExact(allocator, self, i); + mh$.invokeExact(self, s); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER - ); + private static class Opaque_returns_usize { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_returns_usize"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -17840,61 +14183,57 @@ private static class Float64Vec_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void Float64Vec_destroy(Float64Vec *self) + * size_t Opaque_returns_usize() * } */ - public static FunctionDescriptor Float64Vec_destroy$descriptor() { - return Float64Vec_destroy.DESC; + public static FunctionDescriptor Opaque_returns_usize$descriptor() { + return Opaque_returns_usize.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Float64Vec_destroy(Float64Vec *self) + * size_t Opaque_returns_usize() * } */ - public static MethodHandle Float64Vec_destroy$handle() { - return Float64Vec_destroy.HANDLE; + public static MethodHandle Opaque_returns_usize$handle() { + return Opaque_returns_usize.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Float64Vec_destroy(Float64Vec *self) + * size_t Opaque_returns_usize() * } */ - public static MemorySegment Float64Vec_destroy$address() { - return Float64Vec_destroy.ADDR; + public static MemorySegment Opaque_returns_usize$address() { + return Opaque_returns_usize.ADDR; } /** * {@snippet lang=c : - * void Float64Vec_destroy(Float64Vec *self) + * size_t Opaque_returns_usize() * } */ - public static void Float64Vec_destroy(MemorySegment self) { - var mh$ = Float64Vec_destroy.HANDLE; + public static long Opaque_returns_usize() { + var mh$ = Opaque_returns_usize.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_destroy", self); + traceDowncall("Opaque_returns_usize"); } - mh$.invokeExact(self); + return (long)mh$.invokeExact(); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class BorrowedFieldsWithBounds_from_foo_and_strings { + private static class Opaque_internal_len { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - BorrowedFieldsWithBounds.layout(), - somelib_h.C_POINTER, - somelib_h.C_POINTER, somelib_h.C_LONG, - somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("BorrowedFieldsWithBounds_from_foo_and_strings"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_internal_len"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -17902,57 +14241,55 @@ private static class BorrowedFieldsWithBounds_from_foo_and_strings { /** * Function descriptor for: * {@snippet lang=c : - * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char *utf8_str_z_data, size_t utf8_str_z_len) + * size_t Opaque_internal_len(const Opaque *self) * } */ - public static FunctionDescriptor BorrowedFieldsWithBounds_from_foo_and_strings$descriptor() { - return BorrowedFieldsWithBounds_from_foo_and_strings.DESC; + public static FunctionDescriptor Opaque_internal_len$descriptor() { + return Opaque_internal_len.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char *utf8_str_z_data, size_t utf8_str_z_len) + * size_t Opaque_internal_len(const Opaque *self) * } */ - public static MethodHandle BorrowedFieldsWithBounds_from_foo_and_strings$handle() { - return BorrowedFieldsWithBounds_from_foo_and_strings.HANDLE; + public static MethodHandle Opaque_internal_len$handle() { + return Opaque_internal_len.HANDLE; } /** * Address for: * {@snippet lang=c : - * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char *utf8_str_z_data, size_t utf8_str_z_len) + * size_t Opaque_internal_len(const Opaque *self) * } */ - public static MemorySegment BorrowedFieldsWithBounds_from_foo_and_strings$address() { - return BorrowedFieldsWithBounds_from_foo_and_strings.ADDR; + public static MemorySegment Opaque_internal_len$address() { + return Opaque_internal_len.ADDR; } /** * {@snippet lang=c : - * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char *utf8_str_z_data, size_t utf8_str_z_len) + * size_t Opaque_internal_len(const Opaque *self) * } */ - public static MemorySegment BorrowedFieldsWithBounds_from_foo_and_strings(SegmentAllocator allocator, MemorySegment foo, MemorySegment dstr16_x_data, long dstr16_x_len, MemorySegment utf8_str_z_data, long utf8_str_z_len) { - var mh$ = BorrowedFieldsWithBounds_from_foo_and_strings.HANDLE; + public static long Opaque_internal_len(MemorySegment self) { + var mh$ = Opaque_internal_len.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("BorrowedFieldsWithBounds_from_foo_and_strings", allocator, foo, dstr16_x_data, dstr16_x_len, utf8_str_z_data, utf8_str_z_len); + traceDowncall("Opaque_internal_len", self); } - return (MemorySegment)mh$.invokeExact(allocator, foo, dstr16_x_data, dstr16_x_len, utf8_str_z_data, utf8_str_z_len); + return (long)mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class namespace_OpaqueIterator_next { + private static class Opaque_cmp { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); + somelib_h.C_CHAR ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_OpaqueIterator_next"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_cmp"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -17960,56 +14297,56 @@ private static class namespace_OpaqueIterator_next { /** * Function descriptor for: * {@snippet lang=c : - * AttrOpaque1 *namespace_OpaqueIterator_next(OpaqueIterator *self) + * int8_t Opaque_cmp() * } */ - public static FunctionDescriptor namespace_OpaqueIterator_next$descriptor() { - return namespace_OpaqueIterator_next.DESC; + public static FunctionDescriptor Opaque_cmp$descriptor() { + return Opaque_cmp.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * AttrOpaque1 *namespace_OpaqueIterator_next(OpaqueIterator *self) + * int8_t Opaque_cmp() * } */ - public static MethodHandle namespace_OpaqueIterator_next$handle() { - return namespace_OpaqueIterator_next.HANDLE; + public static MethodHandle Opaque_cmp$handle() { + return Opaque_cmp.HANDLE; } /** * Address for: * {@snippet lang=c : - * AttrOpaque1 *namespace_OpaqueIterator_next(OpaqueIterator *self) + * int8_t Opaque_cmp() * } */ - public static MemorySegment namespace_OpaqueIterator_next$address() { - return namespace_OpaqueIterator_next.ADDR; + public static MemorySegment Opaque_cmp$address() { + return Opaque_cmp.ADDR; } /** * {@snippet lang=c : - * AttrOpaque1 *namespace_OpaqueIterator_next(OpaqueIterator *self) + * int8_t Opaque_cmp() * } */ - public static MemorySegment namespace_OpaqueIterator_next(MemorySegment self) { - var mh$ = namespace_OpaqueIterator_next.HANDLE; + public static byte Opaque_cmp() { + var mh$ = Opaque_cmp.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("namespace_OpaqueIterator_next", self); + traceDowncall("Opaque_cmp"); } - return (MemorySegment)mh$.invokeExact(self); + return (byte)mh$.invokeExact(); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class namespace_OpaqueIterator_destroy { + private static class Opaque_destroy { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("namespace_OpaqueIterator_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -18017,43 +14354,43 @@ private static class namespace_OpaqueIterator_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void namespace_OpaqueIterator_destroy(OpaqueIterator *self) + * void Opaque_destroy(Opaque *self) * } */ - public static FunctionDescriptor namespace_OpaqueIterator_destroy$descriptor() { - return namespace_OpaqueIterator_destroy.DESC; + public static FunctionDescriptor Opaque_destroy$descriptor() { + return Opaque_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void namespace_OpaqueIterator_destroy(OpaqueIterator *self) + * void Opaque_destroy(Opaque *self) * } */ - public static MethodHandle namespace_OpaqueIterator_destroy$handle() { - return namespace_OpaqueIterator_destroy.HANDLE; + public static MethodHandle Opaque_destroy$handle() { + return Opaque_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * void namespace_OpaqueIterator_destroy(OpaqueIterator *self) + * void Opaque_destroy(Opaque *self) * } */ - public static MemorySegment namespace_OpaqueIterator_destroy$address() { - return namespace_OpaqueIterator_destroy.ADDR; + public static MemorySegment Opaque_destroy$address() { + return Opaque_destroy.ADDR; } /** * {@snippet lang=c : - * void namespace_OpaqueIterator_destroy(OpaqueIterator *self) + * void Opaque_destroy(Opaque *self) * } */ - public static void namespace_OpaqueIterator_destroy(MemorySegment self) { - var mh$ = namespace_OpaqueIterator_destroy.HANDLE; + public static void Opaque_destroy(MemorySegment self) { + var mh$ = Opaque_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("namespace_OpaqueIterator_destroy", self); + traceDowncall("Opaque_destroy", self); } mh$.invokeExact(self); } catch (Throwable ex$) { @@ -18099,1142 +14436,1073 @@ public static long __DARWIN_C_FULL() { public static long __DARWIN_C_LEVEL() { return __DARWIN_C_LEVEL; } - private static final int MAC_OS_X_VERSION_10_0 = (int)1000L; - /** - * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_0 1000 - * } - */ - public static int MAC_OS_X_VERSION_10_0() { - return MAC_OS_X_VERSION_10_0; - } - private static final int MAC_OS_X_VERSION_10_1 = (int)1010L; - /** - * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_1 1010 - * } - */ - public static int MAC_OS_X_VERSION_10_1() { - return MAC_OS_X_VERSION_10_1; - } - private static final int MAC_OS_X_VERSION_10_2 = (int)1020L; - /** - * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_2 1020 - * } - */ - public static int MAC_OS_X_VERSION_10_2() { - return MAC_OS_X_VERSION_10_2; - } - private static final int MAC_OS_X_VERSION_10_3 = (int)1030L; - /** - * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_3 1030 - * } - */ - public static int MAC_OS_X_VERSION_10_3() { - return MAC_OS_X_VERSION_10_3; - } - private static final int MAC_OS_X_VERSION_10_4 = (int)1040L; - /** - * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_4 1040 - * } - */ - public static int MAC_OS_X_VERSION_10_4() { - return MAC_OS_X_VERSION_10_4; - } - private static final int MAC_OS_X_VERSION_10_5 = (int)1050L; - /** - * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_5 1050 - * } - */ - public static int MAC_OS_X_VERSION_10_5() { - return MAC_OS_X_VERSION_10_5; - } - private static final int MAC_OS_X_VERSION_10_6 = (int)1060L; - /** - * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_6 1060 - * } - */ - public static int MAC_OS_X_VERSION_10_6() { - return MAC_OS_X_VERSION_10_6; - } - private static final int MAC_OS_X_VERSION_10_7 = (int)1070L; - /** - * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_7 1070 - * } - */ - public static int MAC_OS_X_VERSION_10_7() { - return MAC_OS_X_VERSION_10_7; - } - private static final int MAC_OS_X_VERSION_10_8 = (int)1080L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_8 1080 + * #define __ASSERT_FILE_NAME "jextract$15815410018534479797.h" * } */ - public static int MAC_OS_X_VERSION_10_8() { - return MAC_OS_X_VERSION_10_8; + public static MemorySegment __ASSERT_FILE_NAME() { + class Holder { + static final MemorySegment __ASSERT_FILE_NAME + = somelib_h.LIBRARY_ARENA.allocateFrom("jextract$15815410018534479797.h"); + } + return Holder.__ASSERT_FILE_NAME; } - private static final int MAC_OS_X_VERSION_10_9 = (int)1090L; + private static final MemorySegment NULL = MemorySegment.ofAddress(0L); /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_9 1090 + * #define NULL (void*) 0 * } */ - public static int MAC_OS_X_VERSION_10_9() { - return MAC_OS_X_VERSION_10_9; + public static MemorySegment NULL() { + return NULL; } - private static final int MAC_OS_X_VERSION_10_10 = (int)101000L; + private static final MemorySegment __DARWIN_NULL = MemorySegment.ofAddress(0L); /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_10 101000 + * #define __DARWIN_NULL (void*) 0 * } */ - public static int MAC_OS_X_VERSION_10_10() { - return MAC_OS_X_VERSION_10_10; + public static MemorySegment __DARWIN_NULL() { + return __DARWIN_NULL; } - private static final int MAC_OS_X_VERSION_10_10_2 = (int)101002L; + private static final long USER_ADDR_NULL = 0L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_10_2 101002 + * #define USER_ADDR_NULL 0 * } */ - public static int MAC_OS_X_VERSION_10_10_2() { - return MAC_OS_X_VERSION_10_10_2; + public static long USER_ADDR_NULL() { + return USER_ADDR_NULL; } - private static final int MAC_OS_X_VERSION_10_10_3 = (int)101003L; + private static final long INT64_MAX = 9223372036854775807L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_10_3 101003 + * #define INT64_MAX 9223372036854775807 * } */ - public static int MAC_OS_X_VERSION_10_10_3() { - return MAC_OS_X_VERSION_10_10_3; + public static long INT64_MAX() { + return INT64_MAX; } - private static final int MAC_OS_X_VERSION_10_11 = (int)101100L; + private static final int INT8_MIN = (int)-128L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_11 101100 + * #define INT8_MIN -128 * } */ - public static int MAC_OS_X_VERSION_10_11() { - return MAC_OS_X_VERSION_10_11; + public static int INT8_MIN() { + return INT8_MIN; } - private static final int MAC_OS_X_VERSION_10_11_2 = (int)101102L; + private static final int INT16_MIN = (int)-32768L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_11_2 101102 + * #define INT16_MIN -32768 * } */ - public static int MAC_OS_X_VERSION_10_11_2() { - return MAC_OS_X_VERSION_10_11_2; + public static int INT16_MIN() { + return INT16_MIN; } - private static final int MAC_OS_X_VERSION_10_11_3 = (int)101103L; + private static final int INT32_MIN = (int)-2147483648L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_11_3 101103 + * #define INT32_MIN -2147483648 * } */ - public static int MAC_OS_X_VERSION_10_11_3() { - return MAC_OS_X_VERSION_10_11_3; + public static int INT32_MIN() { + return INT32_MIN; } - private static final int MAC_OS_X_VERSION_10_11_4 = (int)101104L; + private static final long INT64_MIN = -9223372036854775808L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_11_4 101104 + * #define INT64_MIN -9223372036854775808 * } */ - public static int MAC_OS_X_VERSION_10_11_4() { - return MAC_OS_X_VERSION_10_11_4; + public static long INT64_MIN() { + return INT64_MIN; } - private static final int MAC_OS_X_VERSION_10_12 = (int)101200L; + private static final int UINT32_MAX = (int)4294967295L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_12 101200 + * #define UINT32_MAX 4294967295 * } */ - public static int MAC_OS_X_VERSION_10_12() { - return MAC_OS_X_VERSION_10_12; + public static int UINT32_MAX() { + return UINT32_MAX; } - private static final int MAC_OS_X_VERSION_10_12_1 = (int)101201L; + private static final long UINT64_MAX = -1L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_12_1 101201 + * #define UINT64_MAX -1 * } */ - public static int MAC_OS_X_VERSION_10_12_1() { - return MAC_OS_X_VERSION_10_12_1; + public static long UINT64_MAX() { + return UINT64_MAX; } - private static final int MAC_OS_X_VERSION_10_12_2 = (int)101202L; + private static final int INT_LEAST8_MIN = (int)-128L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_12_2 101202 + * #define INT_LEAST8_MIN -128 * } */ - public static int MAC_OS_X_VERSION_10_12_2() { - return MAC_OS_X_VERSION_10_12_2; + public static int INT_LEAST8_MIN() { + return INT_LEAST8_MIN; } - private static final int MAC_OS_X_VERSION_10_12_4 = (int)101204L; + private static final int INT_LEAST16_MIN = (int)-32768L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_12_4 101204 + * #define INT_LEAST16_MIN -32768 * } */ - public static int MAC_OS_X_VERSION_10_12_4() { - return MAC_OS_X_VERSION_10_12_4; + public static int INT_LEAST16_MIN() { + return INT_LEAST16_MIN; } - private static final int MAC_OS_X_VERSION_10_13 = (int)101300L; + private static final int INT_LEAST32_MIN = (int)-2147483648L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_13 101300 + * #define INT_LEAST32_MIN -2147483648 * } */ - public static int MAC_OS_X_VERSION_10_13() { - return MAC_OS_X_VERSION_10_13; + public static int INT_LEAST32_MIN() { + return INT_LEAST32_MIN; } - private static final int MAC_OS_X_VERSION_10_13_1 = (int)101301L; + private static final long INT_LEAST64_MIN = -9223372036854775808L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_13_1 101301 + * #define INT_LEAST64_MIN -9223372036854775808 * } */ - public static int MAC_OS_X_VERSION_10_13_1() { - return MAC_OS_X_VERSION_10_13_1; + public static long INT_LEAST64_MIN() { + return INT_LEAST64_MIN; } - private static final int MAC_OS_X_VERSION_10_13_2 = (int)101302L; + private static final int INT_LEAST8_MAX = (int)127L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_13_2 101302 + * #define INT_LEAST8_MAX 127 * } */ - public static int MAC_OS_X_VERSION_10_13_2() { - return MAC_OS_X_VERSION_10_13_2; + public static int INT_LEAST8_MAX() { + return INT_LEAST8_MAX; } - private static final int MAC_OS_X_VERSION_10_13_4 = (int)101304L; + private static final int INT_LEAST16_MAX = (int)32767L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_13_4 101304 + * #define INT_LEAST16_MAX 32767 * } */ - public static int MAC_OS_X_VERSION_10_13_4() { - return MAC_OS_X_VERSION_10_13_4; + public static int INT_LEAST16_MAX() { + return INT_LEAST16_MAX; } - private static final int MAC_OS_X_VERSION_10_14 = (int)101400L; + private static final int INT_LEAST32_MAX = (int)2147483647L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_14 101400 + * #define INT_LEAST32_MAX 2147483647 * } */ - public static int MAC_OS_X_VERSION_10_14() { - return MAC_OS_X_VERSION_10_14; + public static int INT_LEAST32_MAX() { + return INT_LEAST32_MAX; } - private static final int MAC_OS_X_VERSION_10_14_1 = (int)101401L; + private static final long INT_LEAST64_MAX = 9223372036854775807L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_14_1 101401 + * #define INT_LEAST64_MAX 9223372036854775807 * } */ - public static int MAC_OS_X_VERSION_10_14_1() { - return MAC_OS_X_VERSION_10_14_1; + public static long INT_LEAST64_MAX() { + return INT_LEAST64_MAX; } - private static final int MAC_OS_X_VERSION_10_14_4 = (int)101404L; + private static final int UINT_LEAST8_MAX = (int)255L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_14_4 101404 + * #define UINT_LEAST8_MAX 255 * } */ - public static int MAC_OS_X_VERSION_10_14_4() { - return MAC_OS_X_VERSION_10_14_4; + public static int UINT_LEAST8_MAX() { + return UINT_LEAST8_MAX; } - private static final int MAC_OS_X_VERSION_10_14_5 = (int)101405L; + private static final int UINT_LEAST16_MAX = (int)65535L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_14_5 101405 + * #define UINT_LEAST16_MAX 65535 * } */ - public static int MAC_OS_X_VERSION_10_14_5() { - return MAC_OS_X_VERSION_10_14_5; + public static int UINT_LEAST16_MAX() { + return UINT_LEAST16_MAX; } - private static final int MAC_OS_X_VERSION_10_14_6 = (int)101406L; + private static final int UINT_LEAST32_MAX = (int)4294967295L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_14_6 101406 + * #define UINT_LEAST32_MAX 4294967295 * } */ - public static int MAC_OS_X_VERSION_10_14_6() { - return MAC_OS_X_VERSION_10_14_6; + public static int UINT_LEAST32_MAX() { + return UINT_LEAST32_MAX; } - private static final int MAC_OS_X_VERSION_10_15 = (int)101500L; + private static final long UINT_LEAST64_MAX = -1L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_15 101500 + * #define UINT_LEAST64_MAX -1 * } */ - public static int MAC_OS_X_VERSION_10_15() { - return MAC_OS_X_VERSION_10_15; + public static long UINT_LEAST64_MAX() { + return UINT_LEAST64_MAX; } - private static final int MAC_OS_X_VERSION_10_15_1 = (int)101501L; + private static final int INT_FAST8_MIN = (int)-128L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_15_1 101501 + * #define INT_FAST8_MIN -128 * } */ - public static int MAC_OS_X_VERSION_10_15_1() { - return MAC_OS_X_VERSION_10_15_1; + public static int INT_FAST8_MIN() { + return INT_FAST8_MIN; } - private static final int MAC_OS_X_VERSION_10_15_4 = (int)101504L; + private static final int INT_FAST16_MIN = (int)-32768L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_15_4 101504 + * #define INT_FAST16_MIN -32768 * } */ - public static int MAC_OS_X_VERSION_10_15_4() { - return MAC_OS_X_VERSION_10_15_4; + public static int INT_FAST16_MIN() { + return INT_FAST16_MIN; } - private static final int MAC_OS_X_VERSION_10_16 = (int)101600L; + private static final int INT_FAST32_MIN = (int)-2147483648L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_16 101600 + * #define INT_FAST32_MIN -2147483648 * } */ - public static int MAC_OS_X_VERSION_10_16() { - return MAC_OS_X_VERSION_10_16; + public static int INT_FAST32_MIN() { + return INT_FAST32_MIN; } - private static final int MAC_OS_VERSION_11_0 = (int)110000L; + private static final long INT_FAST64_MIN = -9223372036854775808L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_11_0 110000 + * #define INT_FAST64_MIN -9223372036854775808 * } */ - public static int MAC_OS_VERSION_11_0() { - return MAC_OS_VERSION_11_0; + public static long INT_FAST64_MIN() { + return INT_FAST64_MIN; } - private static final int MAC_OS_VERSION_11_1 = (int)110100L; + private static final int INT_FAST8_MAX = (int)127L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_11_1 110100 + * #define INT_FAST8_MAX 127 * } */ - public static int MAC_OS_VERSION_11_1() { - return MAC_OS_VERSION_11_1; + public static int INT_FAST8_MAX() { + return INT_FAST8_MAX; } - private static final int MAC_OS_VERSION_11_3 = (int)110300L; + private static final int INT_FAST16_MAX = (int)32767L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_11_3 110300 + * #define INT_FAST16_MAX 32767 * } */ - public static int MAC_OS_VERSION_11_3() { - return MAC_OS_VERSION_11_3; + public static int INT_FAST16_MAX() { + return INT_FAST16_MAX; } - private static final int MAC_OS_VERSION_11_4 = (int)110400L; + private static final int INT_FAST32_MAX = (int)2147483647L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_11_4 110400 + * #define INT_FAST32_MAX 2147483647 * } */ - public static int MAC_OS_VERSION_11_4() { - return MAC_OS_VERSION_11_4; + public static int INT_FAST32_MAX() { + return INT_FAST32_MAX; } - private static final int MAC_OS_VERSION_11_5 = (int)110500L; + private static final long INT_FAST64_MAX = 9223372036854775807L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_11_5 110500 + * #define INT_FAST64_MAX 9223372036854775807 * } */ - public static int MAC_OS_VERSION_11_5() { - return MAC_OS_VERSION_11_5; + public static long INT_FAST64_MAX() { + return INT_FAST64_MAX; } - private static final int MAC_OS_VERSION_11_6 = (int)110600L; + private static final int UINT_FAST8_MAX = (int)255L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_11_6 110600 + * #define UINT_FAST8_MAX 255 * } */ - public static int MAC_OS_VERSION_11_6() { - return MAC_OS_VERSION_11_6; + public static int UINT_FAST8_MAX() { + return UINT_FAST8_MAX; } - private static final int MAC_OS_VERSION_12_0 = (int)120000L; + private static final int UINT_FAST16_MAX = (int)65535L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_12_0 120000 + * #define UINT_FAST16_MAX 65535 * } */ - public static int MAC_OS_VERSION_12_0() { - return MAC_OS_VERSION_12_0; + public static int UINT_FAST16_MAX() { + return UINT_FAST16_MAX; } - private static final int MAC_OS_VERSION_12_1 = (int)120100L; + private static final int UINT_FAST32_MAX = (int)4294967295L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_12_1 120100 + * #define UINT_FAST32_MAX 4294967295 * } */ - public static int MAC_OS_VERSION_12_1() { - return MAC_OS_VERSION_12_1; + public static int UINT_FAST32_MAX() { + return UINT_FAST32_MAX; } - private static final int MAC_OS_VERSION_12_2 = (int)120200L; + private static final long UINT_FAST64_MAX = -1L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_12_2 120200 + * #define UINT_FAST64_MAX -1 * } */ - public static int MAC_OS_VERSION_12_2() { - return MAC_OS_VERSION_12_2; + public static long UINT_FAST64_MAX() { + return UINT_FAST64_MAX; } - private static final int MAC_OS_VERSION_12_3 = (int)120300L; + private static final long INTPTR_MAX = 9223372036854775807L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_12_3 120300 + * #define INTPTR_MAX 9223372036854775807 * } */ - public static int MAC_OS_VERSION_12_3() { - return MAC_OS_VERSION_12_3; + public static long INTPTR_MAX() { + return INTPTR_MAX; } - private static final int MAC_OS_VERSION_12_4 = (int)120400L; + private static final long INTPTR_MIN = -9223372036854775808L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_12_4 120400 + * #define INTPTR_MIN -9223372036854775808 * } */ - public static int MAC_OS_VERSION_12_4() { - return MAC_OS_VERSION_12_4; + public static long INTPTR_MIN() { + return INTPTR_MIN; } - private static final int MAC_OS_VERSION_12_5 = (int)120500L; + private static final long UINTPTR_MAX = -1L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_12_5 120500 + * #define UINTPTR_MAX -1 * } */ - public static int MAC_OS_VERSION_12_5() { - return MAC_OS_VERSION_12_5; + public static long UINTPTR_MAX() { + return UINTPTR_MAX; } - private static final int MAC_OS_VERSION_12_6 = (int)120600L; + private static final long INTMAX_MAX = 9223372036854775807L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_12_6 120600 + * #define INTMAX_MAX 9223372036854775807 * } */ - public static int MAC_OS_VERSION_12_6() { - return MAC_OS_VERSION_12_6; + public static long INTMAX_MAX() { + return INTMAX_MAX; } - private static final int MAC_OS_VERSION_12_7 = (int)120700L; + private static final long UINTMAX_MAX = -1L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_12_7 120700 + * #define UINTMAX_MAX -1 * } */ - public static int MAC_OS_VERSION_12_7() { - return MAC_OS_VERSION_12_7; + public static long UINTMAX_MAX() { + return UINTMAX_MAX; } - private static final int MAC_OS_VERSION_13_0 = (int)130000L; + private static final long INTMAX_MIN = -9223372036854775808L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_13_0 130000 + * #define INTMAX_MIN -9223372036854775808 * } */ - public static int MAC_OS_VERSION_13_0() { - return MAC_OS_VERSION_13_0; + public static long INTMAX_MIN() { + return INTMAX_MIN; } - private static final int MAC_OS_VERSION_13_1 = (int)130100L; + private static final long PTRDIFF_MIN = -9223372036854775808L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_13_1 130100 + * #define PTRDIFF_MIN -9223372036854775808 * } */ - public static int MAC_OS_VERSION_13_1() { - return MAC_OS_VERSION_13_1; + public static long PTRDIFF_MIN() { + return PTRDIFF_MIN; } - private static final int MAC_OS_VERSION_13_2 = (int)130200L; + private static final long PTRDIFF_MAX = 9223372036854775807L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_13_2 130200 + * #define PTRDIFF_MAX 9223372036854775807 * } */ - public static int MAC_OS_VERSION_13_2() { - return MAC_OS_VERSION_13_2; + public static long PTRDIFF_MAX() { + return PTRDIFF_MAX; } - private static final int MAC_OS_VERSION_13_3 = (int)130300L; + private static final long SIZE_MAX = -1L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_13_3 130300 + * #define SIZE_MAX -1 * } */ - public static int MAC_OS_VERSION_13_3() { - return MAC_OS_VERSION_13_3; + public static long SIZE_MAX() { + return SIZE_MAX; } - private static final int MAC_OS_VERSION_13_4 = (int)130400L; + private static final long RSIZE_MAX = 9223372036854775807L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_13_4 130400 + * #define RSIZE_MAX 9223372036854775807 * } */ - public static int MAC_OS_VERSION_13_4() { - return MAC_OS_VERSION_13_4; + public static long RSIZE_MAX() { + return RSIZE_MAX; } - private static final int MAC_OS_VERSION_13_5 = (int)130500L; + private static final int WCHAR_MAX = (int)2147483647L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_13_5 130500 + * #define WCHAR_MAX 2147483647 * } */ - public static int MAC_OS_VERSION_13_5() { - return MAC_OS_VERSION_13_5; + public static int WCHAR_MAX() { + return WCHAR_MAX; } - private static final int MAC_OS_VERSION_13_6 = (int)130600L; + private static final int WCHAR_MIN = (int)-2147483648L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_13_6 130600 + * #define WCHAR_MIN -2147483648 * } */ - public static int MAC_OS_VERSION_13_6() { - return MAC_OS_VERSION_13_6; + public static int WCHAR_MIN() { + return WCHAR_MIN; } - private static final int MAC_OS_VERSION_14_0 = (int)140000L; + private static final int WINT_MIN = (int)-2147483648L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_14_0 140000 + * #define WINT_MIN -2147483648 * } */ - public static int MAC_OS_VERSION_14_0() { - return MAC_OS_VERSION_14_0; + public static int WINT_MIN() { + return WINT_MIN; } - private static final int MAC_OS_VERSION_14_1 = (int)140100L; + private static final int WINT_MAX = (int)2147483647L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_14_1 140100 + * #define WINT_MAX 2147483647 * } */ - public static int MAC_OS_VERSION_14_1() { - return MAC_OS_VERSION_14_1; + public static int WINT_MAX() { + return WINT_MAX; } - private static final int MAC_OS_VERSION_14_2 = (int)140200L; + private static final int SIG_ATOMIC_MIN = (int)-2147483648L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_14_2 140200 + * #define SIG_ATOMIC_MIN -2147483648 * } */ - public static int MAC_OS_VERSION_14_2() { - return MAC_OS_VERSION_14_2; + public static int SIG_ATOMIC_MIN() { + return SIG_ATOMIC_MIN; } - private static final int MAC_OS_VERSION_14_3 = (int)140300L; + private static final int SIG_ATOMIC_MAX = (int)2147483647L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_14_3 140300 + * #define SIG_ATOMIC_MAX 2147483647 * } */ - public static int MAC_OS_VERSION_14_3() { - return MAC_OS_VERSION_14_3; + public static int SIG_ATOMIC_MAX() { + return SIG_ATOMIC_MAX; } - private static final int MAC_OS_VERSION_14_4 = (int)140400L; + private static final int MAC_OS_X_VERSION_10_0 = (int)1000L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_14_4 140400 + * #define MAC_OS_X_VERSION_10_0 1000 * } */ - public static int MAC_OS_VERSION_14_4() { - return MAC_OS_VERSION_14_4; + public static int MAC_OS_X_VERSION_10_0() { + return MAC_OS_X_VERSION_10_0; } - private static final int MAC_OS_VERSION_14_5 = (int)140500L; + private static final int MAC_OS_X_VERSION_10_1 = (int)1010L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_14_5 140500 + * #define MAC_OS_X_VERSION_10_1 1010 * } */ - public static int MAC_OS_VERSION_14_5() { - return MAC_OS_VERSION_14_5; + public static int MAC_OS_X_VERSION_10_1() { + return MAC_OS_X_VERSION_10_1; } - private static final int __MAC_OS_X_VERSION_MAX_ALLOWED = (int)140500L; + private static final int MAC_OS_X_VERSION_10_2 = (int)1020L; /** * {@snippet lang=c : - * #define __MAC_OS_X_VERSION_MAX_ALLOWED 140500 + * #define MAC_OS_X_VERSION_10_2 1020 * } */ - public static int __MAC_OS_X_VERSION_MAX_ALLOWED() { - return __MAC_OS_X_VERSION_MAX_ALLOWED; + public static int MAC_OS_X_VERSION_10_2() { + return MAC_OS_X_VERSION_10_2; } - private static final MemorySegment __DARWIN_NULL = MemorySegment.ofAddress(0L); + private static final int MAC_OS_X_VERSION_10_3 = (int)1030L; /** * {@snippet lang=c : - * #define __DARWIN_NULL (void*) 0 + * #define MAC_OS_X_VERSION_10_3 1030 * } */ - public static MemorySegment __DARWIN_NULL() { - return __DARWIN_NULL; + public static int MAC_OS_X_VERSION_10_3() { + return MAC_OS_X_VERSION_10_3; } - private static final int __DARWIN_WCHAR_MAX = (int)2147483647L; + private static final int MAC_OS_X_VERSION_10_4 = (int)1040L; /** * {@snippet lang=c : - * #define __DARWIN_WCHAR_MAX 2147483647 + * #define MAC_OS_X_VERSION_10_4 1040 * } */ - public static int __DARWIN_WCHAR_MAX() { - return __DARWIN_WCHAR_MAX; + public static int MAC_OS_X_VERSION_10_4() { + return MAC_OS_X_VERSION_10_4; } - private static final int __DARWIN_WCHAR_MIN = (int)-2147483648L; + private static final int MAC_OS_X_VERSION_10_5 = (int)1050L; /** * {@snippet lang=c : - * #define __DARWIN_WCHAR_MIN -2147483648 + * #define MAC_OS_X_VERSION_10_5 1050 * } */ - public static int __DARWIN_WCHAR_MIN() { - return __DARWIN_WCHAR_MIN; + public static int MAC_OS_X_VERSION_10_5() { + return MAC_OS_X_VERSION_10_5; } - private static final int __DARWIN_WEOF = (int)-1L; + private static final int MAC_OS_X_VERSION_10_6 = (int)1060L; /** * {@snippet lang=c : - * #define __DARWIN_WEOF -1 + * #define MAC_OS_X_VERSION_10_6 1060 * } */ - public static int __DARWIN_WEOF() { - return __DARWIN_WEOF; + public static int MAC_OS_X_VERSION_10_6() { + return MAC_OS_X_VERSION_10_6; } - private static final long USER_ADDR_NULL = 0L; + private static final int MAC_OS_X_VERSION_10_7 = (int)1070L; /** * {@snippet lang=c : - * #define USER_ADDR_NULL 0 + * #define MAC_OS_X_VERSION_10_7 1070 * } */ - public static long USER_ADDR_NULL() { - return USER_ADDR_NULL; + public static int MAC_OS_X_VERSION_10_7() { + return MAC_OS_X_VERSION_10_7; } - private static final MemorySegment NULL = MemorySegment.ofAddress(0L); + private static final int MAC_OS_X_VERSION_10_8 = (int)1080L; /** * {@snippet lang=c : - * #define NULL (void*) 0 + * #define MAC_OS_X_VERSION_10_8 1080 * } */ - public static MemorySegment NULL() { - return NULL; + public static int MAC_OS_X_VERSION_10_8() { + return MAC_OS_X_VERSION_10_8; } - private static final int EOF = (int)-1L; + private static final int MAC_OS_X_VERSION_10_9 = (int)1090L; /** * {@snippet lang=c : - * #define EOF -1 + * #define MAC_OS_X_VERSION_10_9 1090 * } */ - public static int EOF() { - return EOF; + public static int MAC_OS_X_VERSION_10_9() { + return MAC_OS_X_VERSION_10_9; } + private static final int MAC_OS_X_VERSION_10_10 = (int)101000L; /** * {@snippet lang=c : - * #define P_tmpdir "/var/tmp/" + * #define MAC_OS_X_VERSION_10_10 101000 * } */ - public static MemorySegment P_tmpdir() { - class Holder { - static final MemorySegment P_tmpdir - = somelib_h.LIBRARY_ARENA.allocateFrom("/var/tmp/"); - } - return Holder.P_tmpdir; + public static int MAC_OS_X_VERSION_10_10() { + return MAC_OS_X_VERSION_10_10; } - private static final long INT64_MAX = 9223372036854775807L; + private static final int MAC_OS_X_VERSION_10_10_2 = (int)101002L; /** * {@snippet lang=c : - * #define INT64_MAX 9223372036854775807 + * #define MAC_OS_X_VERSION_10_10_2 101002 * } */ - public static long INT64_MAX() { - return INT64_MAX; + public static int MAC_OS_X_VERSION_10_10_2() { + return MAC_OS_X_VERSION_10_10_2; } - private static final int INT8_MIN = (int)-128L; + private static final int MAC_OS_X_VERSION_10_10_3 = (int)101003L; /** * {@snippet lang=c : - * #define INT8_MIN -128 + * #define MAC_OS_X_VERSION_10_10_3 101003 * } */ - public static int INT8_MIN() { - return INT8_MIN; + public static int MAC_OS_X_VERSION_10_10_3() { + return MAC_OS_X_VERSION_10_10_3; } - private static final int INT16_MIN = (int)-32768L; + private static final int MAC_OS_X_VERSION_10_11 = (int)101100L; /** * {@snippet lang=c : - * #define INT16_MIN -32768 + * #define MAC_OS_X_VERSION_10_11 101100 * } */ - public static int INT16_MIN() { - return INT16_MIN; + public static int MAC_OS_X_VERSION_10_11() { + return MAC_OS_X_VERSION_10_11; } - private static final int INT32_MIN = (int)-2147483648L; + private static final int MAC_OS_X_VERSION_10_11_2 = (int)101102L; /** * {@snippet lang=c : - * #define INT32_MIN -2147483648 + * #define MAC_OS_X_VERSION_10_11_2 101102 * } */ - public static int INT32_MIN() { - return INT32_MIN; + public static int MAC_OS_X_VERSION_10_11_2() { + return MAC_OS_X_VERSION_10_11_2; } - private static final long INT64_MIN = -9223372036854775808L; + private static final int MAC_OS_X_VERSION_10_11_3 = (int)101103L; /** * {@snippet lang=c : - * #define INT64_MIN -9223372036854775808 + * #define MAC_OS_X_VERSION_10_11_3 101103 * } */ - public static long INT64_MIN() { - return INT64_MIN; + public static int MAC_OS_X_VERSION_10_11_3() { + return MAC_OS_X_VERSION_10_11_3; } - private static final int UINT32_MAX = (int)4294967295L; + private static final int MAC_OS_X_VERSION_10_11_4 = (int)101104L; /** * {@snippet lang=c : - * #define UINT32_MAX 4294967295 + * #define MAC_OS_X_VERSION_10_11_4 101104 * } */ - public static int UINT32_MAX() { - return UINT32_MAX; + public static int MAC_OS_X_VERSION_10_11_4() { + return MAC_OS_X_VERSION_10_11_4; } - private static final long UINT64_MAX = -1L; + private static final int MAC_OS_X_VERSION_10_12 = (int)101200L; /** * {@snippet lang=c : - * #define UINT64_MAX -1 + * #define MAC_OS_X_VERSION_10_12 101200 * } */ - public static long UINT64_MAX() { - return UINT64_MAX; + public static int MAC_OS_X_VERSION_10_12() { + return MAC_OS_X_VERSION_10_12; } - private static final int INT_LEAST8_MIN = (int)-128L; + private static final int MAC_OS_X_VERSION_10_12_1 = (int)101201L; /** * {@snippet lang=c : - * #define INT_LEAST8_MIN -128 + * #define MAC_OS_X_VERSION_10_12_1 101201 * } */ - public static int INT_LEAST8_MIN() { - return INT_LEAST8_MIN; + public static int MAC_OS_X_VERSION_10_12_1() { + return MAC_OS_X_VERSION_10_12_1; } - private static final int INT_LEAST16_MIN = (int)-32768L; + private static final int MAC_OS_X_VERSION_10_12_2 = (int)101202L; /** * {@snippet lang=c : - * #define INT_LEAST16_MIN -32768 + * #define MAC_OS_X_VERSION_10_12_2 101202 * } */ - public static int INT_LEAST16_MIN() { - return INT_LEAST16_MIN; + public static int MAC_OS_X_VERSION_10_12_2() { + return MAC_OS_X_VERSION_10_12_2; } - private static final int INT_LEAST32_MIN = (int)-2147483648L; + private static final int MAC_OS_X_VERSION_10_12_4 = (int)101204L; /** * {@snippet lang=c : - * #define INT_LEAST32_MIN -2147483648 + * #define MAC_OS_X_VERSION_10_12_4 101204 * } */ - public static int INT_LEAST32_MIN() { - return INT_LEAST32_MIN; + public static int MAC_OS_X_VERSION_10_12_4() { + return MAC_OS_X_VERSION_10_12_4; } - private static final long INT_LEAST64_MIN = -9223372036854775808L; + private static final int MAC_OS_X_VERSION_10_13 = (int)101300L; /** * {@snippet lang=c : - * #define INT_LEAST64_MIN -9223372036854775808 + * #define MAC_OS_X_VERSION_10_13 101300 * } */ - public static long INT_LEAST64_MIN() { - return INT_LEAST64_MIN; + public static int MAC_OS_X_VERSION_10_13() { + return MAC_OS_X_VERSION_10_13; } - private static final int INT_LEAST8_MAX = (int)127L; + private static final int MAC_OS_X_VERSION_10_13_1 = (int)101301L; /** * {@snippet lang=c : - * #define INT_LEAST8_MAX 127 + * #define MAC_OS_X_VERSION_10_13_1 101301 * } */ - public static int INT_LEAST8_MAX() { - return INT_LEAST8_MAX; + public static int MAC_OS_X_VERSION_10_13_1() { + return MAC_OS_X_VERSION_10_13_1; } - private static final int INT_LEAST16_MAX = (int)32767L; + private static final int MAC_OS_X_VERSION_10_13_2 = (int)101302L; /** * {@snippet lang=c : - * #define INT_LEAST16_MAX 32767 + * #define MAC_OS_X_VERSION_10_13_2 101302 * } */ - public static int INT_LEAST16_MAX() { - return INT_LEAST16_MAX; + public static int MAC_OS_X_VERSION_10_13_2() { + return MAC_OS_X_VERSION_10_13_2; } - private static final int INT_LEAST32_MAX = (int)2147483647L; + private static final int MAC_OS_X_VERSION_10_13_4 = (int)101304L; /** * {@snippet lang=c : - * #define INT_LEAST32_MAX 2147483647 + * #define MAC_OS_X_VERSION_10_13_4 101304 * } */ - public static int INT_LEAST32_MAX() { - return INT_LEAST32_MAX; + public static int MAC_OS_X_VERSION_10_13_4() { + return MAC_OS_X_VERSION_10_13_4; } - private static final long INT_LEAST64_MAX = 9223372036854775807L; + private static final int MAC_OS_X_VERSION_10_14 = (int)101400L; /** * {@snippet lang=c : - * #define INT_LEAST64_MAX 9223372036854775807 + * #define MAC_OS_X_VERSION_10_14 101400 * } */ - public static long INT_LEAST64_MAX() { - return INT_LEAST64_MAX; + public static int MAC_OS_X_VERSION_10_14() { + return MAC_OS_X_VERSION_10_14; } - private static final int UINT_LEAST8_MAX = (int)255L; + private static final int MAC_OS_X_VERSION_10_14_1 = (int)101401L; /** * {@snippet lang=c : - * #define UINT_LEAST8_MAX 255 + * #define MAC_OS_X_VERSION_10_14_1 101401 * } */ - public static int UINT_LEAST8_MAX() { - return UINT_LEAST8_MAX; + public static int MAC_OS_X_VERSION_10_14_1() { + return MAC_OS_X_VERSION_10_14_1; } - private static final int UINT_LEAST16_MAX = (int)65535L; + private static final int MAC_OS_X_VERSION_10_14_4 = (int)101404L; /** * {@snippet lang=c : - * #define UINT_LEAST16_MAX 65535 + * #define MAC_OS_X_VERSION_10_14_4 101404 * } */ - public static int UINT_LEAST16_MAX() { - return UINT_LEAST16_MAX; + public static int MAC_OS_X_VERSION_10_14_4() { + return MAC_OS_X_VERSION_10_14_4; } - private static final int UINT_LEAST32_MAX = (int)4294967295L; + private static final int MAC_OS_X_VERSION_10_14_5 = (int)101405L; /** * {@snippet lang=c : - * #define UINT_LEAST32_MAX 4294967295 + * #define MAC_OS_X_VERSION_10_14_5 101405 * } */ - public static int UINT_LEAST32_MAX() { - return UINT_LEAST32_MAX; + public static int MAC_OS_X_VERSION_10_14_5() { + return MAC_OS_X_VERSION_10_14_5; } - private static final long UINT_LEAST64_MAX = -1L; + private static final int MAC_OS_X_VERSION_10_14_6 = (int)101406L; /** * {@snippet lang=c : - * #define UINT_LEAST64_MAX -1 + * #define MAC_OS_X_VERSION_10_14_6 101406 * } */ - public static long UINT_LEAST64_MAX() { - return UINT_LEAST64_MAX; + public static int MAC_OS_X_VERSION_10_14_6() { + return MAC_OS_X_VERSION_10_14_6; } - private static final int INT_FAST8_MIN = (int)-128L; + private static final int MAC_OS_X_VERSION_10_15 = (int)101500L; /** * {@snippet lang=c : - * #define INT_FAST8_MIN -128 + * #define MAC_OS_X_VERSION_10_15 101500 * } */ - public static int INT_FAST8_MIN() { - return INT_FAST8_MIN; + public static int MAC_OS_X_VERSION_10_15() { + return MAC_OS_X_VERSION_10_15; } - private static final int INT_FAST16_MIN = (int)-32768L; + private static final int MAC_OS_X_VERSION_10_15_1 = (int)101501L; /** * {@snippet lang=c : - * #define INT_FAST16_MIN -32768 + * #define MAC_OS_X_VERSION_10_15_1 101501 * } */ - public static int INT_FAST16_MIN() { - return INT_FAST16_MIN; + public static int MAC_OS_X_VERSION_10_15_1() { + return MAC_OS_X_VERSION_10_15_1; } - private static final int INT_FAST32_MIN = (int)-2147483648L; + private static final int MAC_OS_X_VERSION_10_15_4 = (int)101504L; /** * {@snippet lang=c : - * #define INT_FAST32_MIN -2147483648 + * #define MAC_OS_X_VERSION_10_15_4 101504 * } */ - public static int INT_FAST32_MIN() { - return INT_FAST32_MIN; + public static int MAC_OS_X_VERSION_10_15_4() { + return MAC_OS_X_VERSION_10_15_4; } - private static final long INT_FAST64_MIN = -9223372036854775808L; + private static final int MAC_OS_X_VERSION_10_16 = (int)101600L; /** * {@snippet lang=c : - * #define INT_FAST64_MIN -9223372036854775808 + * #define MAC_OS_X_VERSION_10_16 101600 * } */ - public static long INT_FAST64_MIN() { - return INT_FAST64_MIN; + public static int MAC_OS_X_VERSION_10_16() { + return MAC_OS_X_VERSION_10_16; } - private static final int INT_FAST8_MAX = (int)127L; + private static final int MAC_OS_VERSION_11_0 = (int)110000L; /** * {@snippet lang=c : - * #define INT_FAST8_MAX 127 + * #define MAC_OS_VERSION_11_0 110000 * } */ - public static int INT_FAST8_MAX() { - return INT_FAST8_MAX; + public static int MAC_OS_VERSION_11_0() { + return MAC_OS_VERSION_11_0; } - private static final int INT_FAST16_MAX = (int)32767L; + private static final int MAC_OS_VERSION_11_1 = (int)110100L; /** * {@snippet lang=c : - * #define INT_FAST16_MAX 32767 + * #define MAC_OS_VERSION_11_1 110100 * } */ - public static int INT_FAST16_MAX() { - return INT_FAST16_MAX; + public static int MAC_OS_VERSION_11_1() { + return MAC_OS_VERSION_11_1; } - private static final int INT_FAST32_MAX = (int)2147483647L; + private static final int MAC_OS_VERSION_11_3 = (int)110300L; /** * {@snippet lang=c : - * #define INT_FAST32_MAX 2147483647 + * #define MAC_OS_VERSION_11_3 110300 * } */ - public static int INT_FAST32_MAX() { - return INT_FAST32_MAX; + public static int MAC_OS_VERSION_11_3() { + return MAC_OS_VERSION_11_3; } - private static final long INT_FAST64_MAX = 9223372036854775807L; + private static final int MAC_OS_VERSION_11_4 = (int)110400L; /** * {@snippet lang=c : - * #define INT_FAST64_MAX 9223372036854775807 + * #define MAC_OS_VERSION_11_4 110400 * } */ - public static long INT_FAST64_MAX() { - return INT_FAST64_MAX; + public static int MAC_OS_VERSION_11_4() { + return MAC_OS_VERSION_11_4; } - private static final int UINT_FAST8_MAX = (int)255L; + private static final int MAC_OS_VERSION_11_5 = (int)110500L; /** * {@snippet lang=c : - * #define UINT_FAST8_MAX 255 + * #define MAC_OS_VERSION_11_5 110500 * } */ - public static int UINT_FAST8_MAX() { - return UINT_FAST8_MAX; + public static int MAC_OS_VERSION_11_5() { + return MAC_OS_VERSION_11_5; } - private static final int UINT_FAST16_MAX = (int)65535L; + private static final int MAC_OS_VERSION_11_6 = (int)110600L; /** * {@snippet lang=c : - * #define UINT_FAST16_MAX 65535 + * #define MAC_OS_VERSION_11_6 110600 * } */ - public static int UINT_FAST16_MAX() { - return UINT_FAST16_MAX; + public static int MAC_OS_VERSION_11_6() { + return MAC_OS_VERSION_11_6; } - private static final int UINT_FAST32_MAX = (int)4294967295L; + private static final int MAC_OS_VERSION_12_0 = (int)120000L; /** * {@snippet lang=c : - * #define UINT_FAST32_MAX 4294967295 + * #define MAC_OS_VERSION_12_0 120000 * } */ - public static int UINT_FAST32_MAX() { - return UINT_FAST32_MAX; + public static int MAC_OS_VERSION_12_0() { + return MAC_OS_VERSION_12_0; } - private static final long UINT_FAST64_MAX = -1L; + private static final int MAC_OS_VERSION_12_1 = (int)120100L; /** * {@snippet lang=c : - * #define UINT_FAST64_MAX -1 + * #define MAC_OS_VERSION_12_1 120100 * } */ - public static long UINT_FAST64_MAX() { - return UINT_FAST64_MAX; + public static int MAC_OS_VERSION_12_1() { + return MAC_OS_VERSION_12_1; } - private static final long INTPTR_MAX = 9223372036854775807L; + private static final int MAC_OS_VERSION_12_2 = (int)120200L; /** * {@snippet lang=c : - * #define INTPTR_MAX 9223372036854775807 + * #define MAC_OS_VERSION_12_2 120200 * } */ - public static long INTPTR_MAX() { - return INTPTR_MAX; + public static int MAC_OS_VERSION_12_2() { + return MAC_OS_VERSION_12_2; } - private static final long INTPTR_MIN = -9223372036854775808L; + private static final int MAC_OS_VERSION_12_3 = (int)120300L; /** * {@snippet lang=c : - * #define INTPTR_MIN -9223372036854775808 + * #define MAC_OS_VERSION_12_3 120300 * } */ - public static long INTPTR_MIN() { - return INTPTR_MIN; + public static int MAC_OS_VERSION_12_3() { + return MAC_OS_VERSION_12_3; } - private static final long UINTPTR_MAX = -1L; + private static final int MAC_OS_VERSION_12_4 = (int)120400L; /** * {@snippet lang=c : - * #define UINTPTR_MAX -1 + * #define MAC_OS_VERSION_12_4 120400 * } */ - public static long UINTPTR_MAX() { - return UINTPTR_MAX; + public static int MAC_OS_VERSION_12_4() { + return MAC_OS_VERSION_12_4; } - private static final long INTMAX_MAX = 9223372036854775807L; + private static final int MAC_OS_VERSION_12_5 = (int)120500L; /** * {@snippet lang=c : - * #define INTMAX_MAX 9223372036854775807 + * #define MAC_OS_VERSION_12_5 120500 * } */ - public static long INTMAX_MAX() { - return INTMAX_MAX; + public static int MAC_OS_VERSION_12_5() { + return MAC_OS_VERSION_12_5; } - private static final long UINTMAX_MAX = -1L; + private static final int MAC_OS_VERSION_12_6 = (int)120600L; /** * {@snippet lang=c : - * #define UINTMAX_MAX -1 + * #define MAC_OS_VERSION_12_6 120600 * } */ - public static long UINTMAX_MAX() { - return UINTMAX_MAX; + public static int MAC_OS_VERSION_12_6() { + return MAC_OS_VERSION_12_6; } - private static final long INTMAX_MIN = -9223372036854775808L; + private static final int MAC_OS_VERSION_12_7 = (int)120700L; /** * {@snippet lang=c : - * #define INTMAX_MIN -9223372036854775808 + * #define MAC_OS_VERSION_12_7 120700 * } */ - public static long INTMAX_MIN() { - return INTMAX_MIN; + public static int MAC_OS_VERSION_12_7() { + return MAC_OS_VERSION_12_7; } - private static final long PTRDIFF_MIN = -9223372036854775808L; + private static final int MAC_OS_VERSION_13_0 = (int)130000L; /** * {@snippet lang=c : - * #define PTRDIFF_MIN -9223372036854775808 + * #define MAC_OS_VERSION_13_0 130000 * } */ - public static long PTRDIFF_MIN() { - return PTRDIFF_MIN; + public static int MAC_OS_VERSION_13_0() { + return MAC_OS_VERSION_13_0; } - private static final long PTRDIFF_MAX = 9223372036854775807L; + private static final int MAC_OS_VERSION_13_1 = (int)130100L; /** * {@snippet lang=c : - * #define PTRDIFF_MAX 9223372036854775807 + * #define MAC_OS_VERSION_13_1 130100 * } */ - public static long PTRDIFF_MAX() { - return PTRDIFF_MAX; + public static int MAC_OS_VERSION_13_1() { + return MAC_OS_VERSION_13_1; } - private static final long SIZE_MAX = -1L; + private static final int MAC_OS_VERSION_13_2 = (int)130200L; /** * {@snippet lang=c : - * #define SIZE_MAX -1 + * #define MAC_OS_VERSION_13_2 130200 * } */ - public static long SIZE_MAX() { - return SIZE_MAX; + public static int MAC_OS_VERSION_13_2() { + return MAC_OS_VERSION_13_2; } - private static final long RSIZE_MAX = 9223372036854775807L; + private static final int MAC_OS_VERSION_13_3 = (int)130300L; /** * {@snippet lang=c : - * #define RSIZE_MAX 9223372036854775807 + * #define MAC_OS_VERSION_13_3 130300 * } */ - public static long RSIZE_MAX() { - return RSIZE_MAX; + public static int MAC_OS_VERSION_13_3() { + return MAC_OS_VERSION_13_3; } - private static final int WCHAR_MAX = (int)2147483647L; + private static final int MAC_OS_VERSION_13_4 = (int)130400L; /** * {@snippet lang=c : - * #define WCHAR_MAX 2147483647 + * #define MAC_OS_VERSION_13_4 130400 * } */ - public static int WCHAR_MAX() { - return WCHAR_MAX; + public static int MAC_OS_VERSION_13_4() { + return MAC_OS_VERSION_13_4; } - private static final int WCHAR_MIN = (int)-2147483648L; + private static final int MAC_OS_VERSION_13_5 = (int)130500L; /** * {@snippet lang=c : - * #define WCHAR_MIN -2147483648 + * #define MAC_OS_VERSION_13_5 130500 * } */ - public static int WCHAR_MIN() { - return WCHAR_MIN; + public static int MAC_OS_VERSION_13_5() { + return MAC_OS_VERSION_13_5; } - private static final int WINT_MIN = (int)-2147483648L; + private static final int MAC_OS_VERSION_13_6 = (int)130600L; /** * {@snippet lang=c : - * #define WINT_MIN -2147483648 + * #define MAC_OS_VERSION_13_6 130600 * } */ - public static int WINT_MIN() { - return WINT_MIN; + public static int MAC_OS_VERSION_13_6() { + return MAC_OS_VERSION_13_6; } - private static final int WINT_MAX = (int)2147483647L; + private static final int MAC_OS_VERSION_14_0 = (int)140000L; /** * {@snippet lang=c : - * #define WINT_MAX 2147483647 + * #define MAC_OS_VERSION_14_0 140000 * } */ - public static int WINT_MAX() { - return WINT_MAX; + public static int MAC_OS_VERSION_14_0() { + return MAC_OS_VERSION_14_0; } - private static final int SIG_ATOMIC_MIN = (int)-2147483648L; + private static final int MAC_OS_VERSION_14_1 = (int)140100L; /** * {@snippet lang=c : - * #define SIG_ATOMIC_MIN -2147483648 + * #define MAC_OS_VERSION_14_1 140100 * } */ - public static int SIG_ATOMIC_MIN() { - return SIG_ATOMIC_MIN; + public static int MAC_OS_VERSION_14_1() { + return MAC_OS_VERSION_14_1; } - private static final int SIG_ATOMIC_MAX = (int)2147483647L; + private static final int MAC_OS_VERSION_14_2 = (int)140200L; /** * {@snippet lang=c : - * #define SIG_ATOMIC_MAX 2147483647 + * #define MAC_OS_VERSION_14_2 140200 * } */ - public static int SIG_ATOMIC_MAX() { - return SIG_ATOMIC_MAX; + public static int MAC_OS_VERSION_14_2() { + return MAC_OS_VERSION_14_2; } - private static final int __DARWIN_BYTE_ORDER = (int)1234L; + private static final int MAC_OS_VERSION_14_3 = (int)140300L; /** * {@snippet lang=c : - * #define __DARWIN_BYTE_ORDER 1234 + * #define MAC_OS_VERSION_14_3 140300 * } */ - public static int __DARWIN_BYTE_ORDER() { - return __DARWIN_BYTE_ORDER; + public static int MAC_OS_VERSION_14_3() { + return MAC_OS_VERSION_14_3; } - private static final int LITTLE_ENDIAN = (int)1234L; + private static final int MAC_OS_VERSION_14_4 = (int)140400L; /** * {@snippet lang=c : - * #define LITTLE_ENDIAN 1234 + * #define MAC_OS_VERSION_14_4 140400 * } */ - public static int LITTLE_ENDIAN() { - return LITTLE_ENDIAN; + public static int MAC_OS_VERSION_14_4() { + return MAC_OS_VERSION_14_4; } - private static final int BIG_ENDIAN = (int)4321L; + private static final int MAC_OS_VERSION_14_5 = (int)140500L; /** * {@snippet lang=c : - * #define BIG_ENDIAN 4321 + * #define MAC_OS_VERSION_14_5 140500 * } */ - public static int BIG_ENDIAN() { - return BIG_ENDIAN; + public static int MAC_OS_VERSION_14_5() { + return MAC_OS_VERSION_14_5; } - private static final int PDP_ENDIAN = (int)3412L; + private static final int __MAC_OS_X_VERSION_MAX_ALLOWED = (int)140500L; /** * {@snippet lang=c : - * #define PDP_ENDIAN 3412 + * #define __MAC_OS_X_VERSION_MAX_ALLOWED 140500 * } */ - public static int PDP_ENDIAN() { - return PDP_ENDIAN; + public static int __MAC_OS_X_VERSION_MAX_ALLOWED() { + return __MAC_OS_X_VERSION_MAX_ALLOWED; } - private static final int BYTE_ORDER = (int)1234L; + private static final int __DARWIN_WCHAR_MAX = (int)2147483647L; /** * {@snippet lang=c : - * #define BYTE_ORDER 1234 + * #define __DARWIN_WCHAR_MAX 2147483647 * } */ - public static int BYTE_ORDER() { - return BYTE_ORDER; + public static int __DARWIN_WCHAR_MAX() { + return __DARWIN_WCHAR_MAX; } - private static final long __DARWIN_NFDBITS = 32L; + private static final int __DARWIN_WCHAR_MIN = (int)-2147483648L; /** * {@snippet lang=c : - * #define __DARWIN_NFDBITS 32 + * #define __DARWIN_WCHAR_MIN -2147483648 * } */ - public static long __DARWIN_NFDBITS() { - return __DARWIN_NFDBITS; + public static int __DARWIN_WCHAR_MIN() { + return __DARWIN_WCHAR_MIN; } - private static final int NBBY = (int)8L; + private static final int __DARWIN_WEOF = (int)-1L; /** * {@snippet lang=c : - * #define NBBY 8 + * #define __DARWIN_WEOF -1 * } */ - public static int NBBY() { - return NBBY; + public static int __DARWIN_WEOF() { + return __DARWIN_WEOF; } - private static final long NFDBITS = 32L; + private static final int EOF = (int)-1L; /** * {@snippet lang=c : - * #define NFDBITS 32 + * #define EOF -1 * } */ - public static long NFDBITS() { - return NFDBITS; + public static int EOF() { + return EOF; } - private static final int FD_SETSIZE = (int)1024L; /** * {@snippet lang=c : - * #define FD_SETSIZE 1024 + * #define P_tmpdir "/var/tmp/" * } */ - public static int FD_SETSIZE() { - return FD_SETSIZE; + public static MemorySegment P_tmpdir() { + class Holder { + static final MemorySegment P_tmpdir + = somelib_h.LIBRARY_ARENA.allocateFrom("/var/tmp/"); + } + return Holder.P_tmpdir; } } diff --git a/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/Float64VecTest.java b/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/Float64VecTest.java index e1a5060a3..1e6ee0b38 100644 --- a/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/Float64VecTest.java +++ b/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/Float64VecTest.java @@ -9,8 +9,10 @@ class Float64VecTest { @Test void testFloat64Vec() { - double[] dArray = {0.1, 0.2, 0.3, 0.4}; - var float64Vec = Float64Vec.new_(dArray); + long[] lArray = {1, 2, 3, 4}; + + double[] dArray = {1, 2, 3, 4}; + var float64Vec = Float64Vec.newIsize(lArray); var outArray = float64Vec.asSlice(); assertEquals(dArray.length, outArray.length); for (var i = 0; i < dArray.length; i++) { diff --git a/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/MyStringTest.java b/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/MyStringTest.java index d1de3b90e..0672ea774 100644 --- a/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/MyStringTest.java +++ b/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/MyStringTest.java @@ -14,12 +14,12 @@ void newFromFirst() { var str = "Hi There"; var str1 = "Hi There 1"; var str2 = "Hi There 2"; - var myStr0 = new MyString(str); - assertEquals(myStr0.getStr(), str); + // var myStr0 = new MyString(str); + // assertEquals(myStr0.getStr(), str); var strs = new String[]{str, str1, str2}; var myStr = MyString.newFromFirst(strs); assertEquals(myStr.getStr(), str); - assertEquals(myStr.getBoxedStr(), str); + // assertEquals(myStr.getBoxedStr(), str); } } \ No newline at end of file diff --git a/feature_tests/kotlin/somelib/src/main/kotlin/dev/diplomattest/somelib/MyStruct.kt b/feature_tests/kotlin/somelib/src/main/kotlin/dev/diplomattest/somelib/MyStruct.kt index 2a43f3884..81eaef011 100644 --- a/feature_tests/kotlin/somelib/src/main/kotlin/dev/diplomattest/somelib/MyStruct.kt +++ b/feature_tests/kotlin/somelib/src/main/kotlin/dev/diplomattest/somelib/MyStruct.kt @@ -60,9 +60,9 @@ class MyStruct internal constructor ( val returnVal = lib.MyStruct_returns_zst_result(); if (returnVal.isOk == 1.toByte()) { - return Unit.ok() + Unit.ok() } else { - return MyZst().err() + MyZst().err() } } } diff --git a/feature_tests/kotlin/somelib/src/main/kotlin/dev/diplomattest/somelib/Opaque.kt b/feature_tests/kotlin/somelib/src/main/kotlin/dev/diplomattest/somelib/Opaque.kt index 112968a27..0438c5070 100644 --- a/feature_tests/kotlin/somelib/src/main/kotlin/dev/diplomattest/somelib/Opaque.kt +++ b/feature_tests/kotlin/somelib/src/main/kotlin/dev/diplomattest/somelib/Opaque.kt @@ -12,6 +12,7 @@ internal interface OpaqueLib: Library { fun Opaque_get_debug_str(handle: Pointer, write: Pointer): Unit fun Opaque_assert_struct(handle: Pointer, s: MyStructNative): Unit fun Opaque_returns_usize(): Long + fun Opaque_internal_len(handle: Pointer): Long fun Opaque_returns_imported(): ImportedStructNative fun Opaque_cmp(): Byte } @@ -102,5 +103,11 @@ class Opaque internal constructor ( val returnVal = lib.Opaque_assert_struct(handle, s.nativeStruct); } + + fun internalLen(): ULong { + + val returnVal = lib.Opaque_internal_len(handle); + return returnVal.toULong() + } } diff --git a/feature_tests/src/attrs.rs b/feature_tests/src/attrs.rs index a1e782c62..63bea896d 100644 --- a/feature_tests/src/attrs.rs +++ b/feature_tests/src/attrs.rs @@ -6,6 +6,7 @@ pub mod ffi { #[derive(Clone)] #[diplomat::opaque] #[diplomat::attr(*, rename = "AttrOpaque1Renamed")] + #[diplomat::attr(java, disable)] pub struct AttrOpaque1; impl AttrOpaque1 { @@ -37,8 +38,10 @@ pub mod ffi { } #[diplomat::opaque] + #[diplomat::attr(java, disable)] pub struct AttrOpaque2; + #[diplomat::attr(java, disable)] pub enum AttrEnum { A, B, @@ -49,6 +52,7 @@ pub mod ffi { #[diplomat::opaque] #[diplomat::attr(auto, namespace = "")] #[diplomat::attr(*, rename = "Unnamespaced")] + #[diplomat::attr(java, disable)] pub struct Unnamespaced; impl Unnamespaced { diff --git a/feature_tests/src/imports.rs b/feature_tests/src/imports.rs index 1b5cba93f..6566f3dff 100644 --- a/feature_tests/src/imports.rs +++ b/feature_tests/src/imports.rs @@ -1,11 +1,13 @@ #[diplomat::bridge] pub mod ffi { + #[diplomat::attr(java, disable)] pub enum UnimportedEnum { A, B, C, } + #[diplomat::attr(java, disable)] pub struct ImportedStruct { foo: UnimportedEnum, count: u8, diff --git a/feature_tests/src/structs.rs b/feature_tests/src/structs.rs index 612c3e7df..df6d8dd90 100644 --- a/feature_tests/src/structs.rs +++ b/feature_tests/src/structs.rs @@ -84,6 +84,7 @@ pub mod ffi { self.0.len() } + #[diplomat::attr(java, disable)] pub fn returns_imported() -> ImportedStruct { unimplemented!() } diff --git a/tool/src/java/formatter.rs b/tool/src/java/formatter.rs index 0a39b8c57..2c9b7d821 100644 --- a/tool/src/java/formatter.rs +++ b/tool/src/java/formatter.rs @@ -69,7 +69,7 @@ impl<'cx> JavaFormatter<'cx> { pub fn fmt_native_type<'a, P: TyPosition>(&self, ty: &'a Type

) -> Cow<'a, str> { match ty { - Type::Primitive(ref p) => self.fmt_primitive(p), + Type::Primitive(ref p) => self.fmt_native_primitive(p), Type::Opaque(_) => todo!(), Type::Struct(_) => todo!(), Type::Enum(_) => todo!(), @@ -79,20 +79,20 @@ impl<'cx> JavaFormatter<'cx> { } pub fn fmt_java_type<'a, P: TyPosition>(&self, ty: &'a Type

) -> Cow<'a, str> { match ty { - hir::Type::Primitive(ref p) => self.fmt_primitive(p), + hir::Type::Primitive(ref p) => self.fmt_java_primitive(p), hir::Type::Opaque(o) => self.tcx.resolve_opaque(o.tcx_id).name.to_string().into(), hir::Type::Struct(s) => self.tcx.resolve_type(s.id()).name().to_string().into(), hir::Type::Enum(e) => self.tcx.resolve_enum(e.tcx_id).name.to_string().into(), hir::Type::Slice(Slice::Str(_, _)) => "String".into(), hir::Type::Slice(Slice::Primitive(_, p)) => { - format!("{}[]", self.fmt_primitive(p)).into() + format!("{}[]", self.fmt_java_primitive(p)).into() } hir::Type::Slice(Slice::Strs(_)) => "String []".into(), ty => todo!("haven't implemented, {ty:?}"), } } - pub fn fmt_primitive<'a>(&self, ty: &'a PrimitiveType) -> Cow<'a, str> { + pub fn fmt_java_primitive<'a>(&self, ty: &'a PrimitiveType) -> Cow<'a, str> { match ty { PrimitiveType::Bool => "boolean", PrimitiveType::Char => "int", @@ -109,6 +109,14 @@ impl<'cx> JavaFormatter<'cx> { .into() } + pub fn fmt_native_primitive<'a>(&self, ty: &'a PrimitiveType) -> Cow<'a, str> { + match ty { + PrimitiveType::Bool => "byte".into(), + ref p => self.fmt_java_primitive(p), + } + .into() + } + pub fn fmt_param_name(&self, name: &str) -> String { name.to_lower_camel_case() } diff --git a/tool/src/java/mod.rs b/tool/src/java/mod.rs index 01f2c8060..350f5d98c 100644 --- a/tool/src/java/mod.rs +++ b/tool/src/java/mod.rs @@ -1,16 +1,17 @@ -use std::borrow::Cow; use std::collections::HashSet; use std::fs::File; use std::io::Write; use std::path::Path; +use std::{borrow::Cow, iter::once}; use askama::Template; use diplomat_core::hir::{ - self, BackendAttrSupport, EnumDef, EnumVariant, FloatType, IntSizeType, IntType, MaybeStatic, - Method, OpaqueDef, ReturnType, Slice, SpecialMethod, StringEncoding, StructDef, StructField, - StructPathLike, SuccessType, TyPosition, TypeContext, TypeDef, TypeId, + self, BackendAttrSupport, EnumDef, EnumVariant, FloatType, IntSizeType, IntType, MaybeOwn, + MaybeStatic, Method, OpaqueDef, OpaqueOwner, OpaquePath, ReturnType, Slice, SpecialMethod, + StringEncoding, StructDef, StructPathLike, SuccessType, TyPosition, TypeContext, TypeDef, }; use formatter::JavaFormatter; +use serde::Deserialize; use crate::{c, ErrorStore, FileMap}; @@ -50,6 +51,11 @@ pub(crate) fn run<'a>( conf_path: Option<&Path>, out_folder: &Path, ) -> (FileMap, ErrorStore<'a, String>) { + let conf_path = conf_path.expect("Java library needs to be called with config"); + let conf_str = std::fs::read_to_string(conf_path) + .unwrap_or_else(|err| panic!("Failed to open config file {conf_path:?}: {err}")); + let tcx_config = toml::from_str::(&conf_str) + .expect("Failed to parse config. Required fields are `domain` and `lib_name`"); let (files, errors) = c::run(tcx); let errors = errors.take_all(); @@ -103,7 +109,7 @@ pub(crate) fn run<'a>( .arg("--include-dir") .arg(&tmp_path) .arg("--output") - .arg(out_folder) + .arg(out_folder.join("src/main/java/")) .arg("--target-package") .arg(package) .arg("--library") @@ -147,11 +153,6 @@ pub(crate) fn run<'a>( let formatter = &java_formatter; let error_store = ErrorStore::default(); let errors = &error_store; - let tcx_config = Config { - domain: "dev.diplomattest".into(), - lib_name: "somelib".into(), - }; - let ty_gen_cx = TyGenContext { tcx, tcx_config, @@ -159,29 +160,55 @@ pub(crate) fn run<'a>( errors, }; + let Config { + ref domain, + ref lib_name, + } = ty_gen_cx.tcx_config; + let domain_path = domain.replace(".", "/"); + let errors = ErrorStore::default(); let files = FileMap::default(); - for (id, ty) in tcx.all_types() { + for (_id, ty) in tcx.all_types() { let _guard = ty_gen_cx.errors.set_context_ty(ty.name().as_str().into()); if ty.attrs().disable { continue; } let (file, body) = match ty { - TypeDef::Opaque(opaque) => ty_gen_cx.gen_opaque_def(opaque, id), - TypeDef::Enum(enum_def) => ty_gen_cx.gen_enum_def(enum_def, id), - TypeDef::Struct(struct_def) => ty_gen_cx.gen_struct_def(struct_def, id), - TypeDef::OutStruct(struct_def) => ty_gen_cx.gen_struct_def(struct_def, id), + TypeDef::Opaque(opaque) => ty_gen_cx.gen_opaque_def(opaque), + TypeDef::Enum(enum_def) => ty_gen_cx.gen_enum_def(enum_def), + TypeDef::Struct(struct_def) => ty_gen_cx.gen_struct_def(struct_def), + TypeDef::OutStruct(struct_def) => ty_gen_cx.gen_struct_def(struct_def), unknown => { unreachable!("Encountered unknown variant: {unknown:?} while parsing all types") } }; - files.add_file(format!("src/main/java/{file}"), body); + files.add_file( + format!("src/main/java/{domain_path}/{lib_name}/{file}",), + body, + ); } + let lib_file = LibFile { + domain: domain.clone(), + lib_name: lib_name.clone(), + } + .render() + .expect("Failed to render Lib.java file"); + files.add_file( + format!("src/main/java/{domain_path}/{lib_name}/Lib.java"), + lib_file, + ); (files, errors) } +#[derive(Template, Clone, Debug)] +#[template(path = "java/Lib.java.jinja", escape = "none")] +struct LibFile<'a> { + domain: Cow<'a, str>, + lib_name: Cow<'a, str>, +} + #[derive(Clone, Debug)] struct Param<'a> { name: Cow<'a, str>, @@ -201,7 +228,6 @@ pub(crate) struct MethodTpl<'a> { is_static: bool, return_ty: Cow<'a, str>, native_method: Cow<'a, str>, - make_invoker: bool, native_invocation: Cow<'a, str>, params: Vec>, param_conversions: Vec>, @@ -224,7 +250,8 @@ pub(crate) struct StructTypeTpl<'a> { #[derive(Clone, Debug)] struct FieldTpl<'a> { name: Cow<'a, str>, - field_transform: Option>, + native_name: Cow<'a, str>, + field_val: Cow<'a, str>, ty: Cow<'a, str>, } @@ -255,10 +282,26 @@ pub(crate) struct OpaqueTypeTpl<'a> { class_methods: Vec>, } +#[derive(Debug, Clone)] +struct LifetimeTpl<'a> { + name: Cow<'a, str>, + edges: Vec>, +} + +#[derive(Template, Clone, Debug)] +#[template(path = "java/StructReturn.java.jinja", escape = "none")] +pub(crate) struct StructReturnTpl<'a> { + lifetimes: Vec>, + return_self_edges: Option>, + return_ty: Cow<'a, str>, +} + #[derive(Template, Clone, Debug)] #[template(path = "java/OpaqueReturn.java.jinja", escape = "none")] pub(crate) struct OpaqueReturnTpl<'a> { - lifetime_edges: Vec, + lifetimes: Vec>, + owned_return: bool, + return_self_edges: Option>, return_ty: Cow<'a, str>, } @@ -268,6 +311,7 @@ pub(crate) struct OpaqueConstructorTpl<'a> { return_ty: Cow<'a, str>, } +#[derive(Debug, Clone, Deserialize)] struct Config<'cx> { domain: Cow<'cx, str>, lib_name: Cow<'cx, str>, @@ -287,11 +331,17 @@ impl<'a, 'cx> TyGenContext<'a, 'cx> { ) -> ParamConversion<'b> { let diplomat_core::hir::Param { name, ty, .. } = param; // let java_ty = self.formatter.fmt_java_type(ty); - let converted_value: Cow<'b, str> = format!("{name}Native").into(); let name = self.formatter.fmt_param_name(name.as_str()); + let converted_value: Cow<'b, str> = format!("{name}Native").into(); let (conversion, converted_value) = match ty { - hir::Type::Primitive(_) => (name.into(), converted_value), - hir::Type::Opaque(_) => (format!("{name}.internal").into(), converted_value), + hir::Type::Primitive(_) => ( + format!("var {name}Native = {name};").into(), + converted_value, + ), + hir::Type::Opaque(_) => ( + format!("var {name}Native = {name}.internal;").into(), + converted_value, + ), hir::Type::Struct(_) => ( format!(r#"var {name}Native = {name}.internal;"#).into(), converted_value, @@ -329,7 +379,7 @@ var {name}Len = {name}MemSeg.byteSize();"# } hir::Type::Slice(Slice::Primitive(borrow, p)) => { let primitive_ty = match p { - hir::PrimitiveType::Bool => "JAVA_BOOLEAN", + hir::PrimitiveType::Bool => "JAVA_BYTE", // BYTE is the smallest hir::PrimitiveType::Char => "JAVA_INT", hir::PrimitiveType::Byte => "JAVA_BYTE", hir::PrimitiveType::Int(IntType::I8 | IntType::U8) => "JAVA_BYTE", @@ -344,14 +394,23 @@ var {name}Len = {name}MemSeg.byteSize();"# hir::PrimitiveType::Float(hir::FloatType::F64) => "JAVA_DOUBLE", }; let arena_name = borrow.map(|_| "arena").unwrap_or("Arena.global()"); - ( - format!( + let conversion = match p { + hir::PrimitiveType::Bool => format!( + r#"var {name}Len = {name}.length; +byte[] {name}ByteArray = new byte[{name}Len]; +for (int i = 0; i < {name}Len; i++) {{ + {name}ByteArray[i] = (byte) ({name}[i] ? 1 : 0); +}} +var {name}MemSeg = {arena_name}.allocateFrom({primitive_ty}, {name}ByteArray);"# + ) + .into(), + _ => format!( r#"var {name}Len = {name}.length; var {name}MemSeg = {arena_name}.allocateFrom({primitive_ty}, {name});"# ) .into(), - format!("{name}MemSeg, {name}Len").into(), - ) + }; + (conversion, format!("{name}MemSeg, {name}Len").into()) } hir::Type::Slice(Slice::Strs(StringEncoding::UnvalidatedUtf16)) => ( format!( @@ -411,7 +470,7 @@ var {name}Len = {name}.length;"# hir::PrimitiveType::Float(FloatType::F64) => "F64", }; - let java_primitive_ty = self.formatter.fmt_primitive(p); + let java_primitive_ty = self.formatter.fmt_native_primitive(p); format!( r#"var data = {domain}.{lib_name}.ntv.Diplomat{primitive_ty}View.data(nativeVal); var len = {domain}.{lib_name}.ntv.Diplomat{primitive_ty}View.len(nativeVal); @@ -430,7 +489,8 @@ return SliceUtils.{java_primitive_ty}SliceToArray(nativeVal);"# fn gen_return_conversion( &self, ty: &ReturnType, - lifetime_edges: Vec, + lifetimes: Vec, + return_self_edges: Option>, ) -> Result, String> { let Config { lib_name, .. } = &self.tcx_config; let ret = match ty { @@ -465,10 +525,13 @@ return string;"#, let return_statment: Cow<'cx, str> = match o { hir::Type::Primitive(_) => "return nativeVal;".into(), hir::Type::Opaque(o) => { + let owned_return: bool = o.owner.is_owned(); let ty_name = &self.tcx.resolve_opaque(o.tcx_id).name; OpaqueReturnTpl { - lifetime_edges, + lifetimes, return_ty: ty_name.as_str().into(), + owned_return, + return_self_edges, } .render() .unwrap_or_else(|err| { @@ -481,13 +544,15 @@ return string;"#, } hir::Type::Struct(s) => { let ty_name = &self.tcx.resolve_type(s.id()).name(); - let lifetime_edges = lifetime_edges.join("\n"); - format!( - r#"var returnVal = new {ty_name}(returnArena); -{lifetime_edges} -returnVal.initFromSegment(nativeVal); -return returnVal;"# - ) + StructReturnTpl { + lifetimes, + return_ty: ty_name.as_str().into(), + return_self_edges, + } + .render() + .unwrap_or_else(|err| { + panic!("Failed to render return val for type {ty_name}. Cause: {err}") + }) .into() } hir::Type::Enum(e) => { @@ -503,7 +568,6 @@ return returnVal;"# fn gen_methods( &self, - ty_id: TypeId, ty_name: &str, methods: &[Method], ) -> (Vec>, Vec>) { @@ -550,7 +614,7 @@ return returnVal;"# }) .collect(); let lt_lookup = visitor.borrow_map(); - let (lifetime_edges, boxed_return) = match &method.output { + let (lifetime_edges, return_self_edges, boxed_return) = match &method.output { ReturnType::Fallible(SuccessType::OutType(o), _) | ReturnType::Nullable(SuccessType::OutType(o)) | ReturnType::Infallible(SuccessType::OutType(o)) => { @@ -574,34 +638,56 @@ return returnVal;"# }), _ => None, }; - let method_lts = &method.lifetime_env; + + let self_lt = match o { + hir::Type::Opaque(ref o) => match o.owner { + MaybeOwn::Borrow(hir::Borrow { + lifetime: MaybeStatic::NonStatic(lifetime), + .. + }) => Some(lifetime), + _ => None, + }, + _ => None, + }; + let return_self_edges: Option> = self_lt + .map(|lifetime| lt_lookup.get(&lifetime)) + .flatten() + .map(|param| { + param + .incoming_edges + .iter() + .map(|lt| self.formatter.fmt_param_name(<.param_name)) + .mk_str_iter(", ") + .into() + }); let lifetime_edges = o .lifetimes() .filter_map(|lt| match lt { MaybeStatic::Static => None, - MaybeStatic::NonStatic(lt) => Some(lt), + MaybeStatic::NonStatic(lt) + if !(Some(lt).as_ref() == self_lt.as_ref()) => + { + Some(lt) + } + _ => None, }) - .filter_map(|lt| lt_lookup.get(<).map(|param| (lt, param))) - .map(|(lt, param)| { - let mut iter = param + .filter_map(|lt| lt_lookup.get(<).map(|info| (info, lt))) + .map(|(lifetime_info, lt)| { + let edges = lifetime_info .incoming_edges .iter() - .map(|edge| edge.param_name.as_str()); - let first = iter.next().unwrap_or("").to_string(); - let edges = iter.fold(first, |mut accum, next| { - accum.push_str(", "); - accum.push_str(next); - accum - }); - format!( - "returnVal.{}Edges = List.of({edges});", - method_lts.fmt_lifetime(lt) - ) + .map(|edge| edge.param_name.as_str()) + .map(|param| self.formatter.fmt_param_name(param).into()) + .collect::>(); + LifetimeTpl { + name: method.lifetime_env.fmt_lifetime(lt), + edges, + } }) .collect::>(); - (lifetime_edges, boxed_return) + (lifetime_edges, return_self_edges, boxed_return) } - _ => (Vec::new(), None), + _ => (Vec::new(), None, None), }; let return_conversion = if method_name.is_none() { OpaqueConstructorTpl { @@ -616,7 +702,11 @@ return returnVal;"# }) .cown() } else { - match self.gen_return_conversion(&method.output, lifetime_edges) { + match self.gen_return_conversion( + &method.output, + lifetime_edges, + return_self_edges, + ) { Ok(ok) => ok, Err(err) => { self.errors.push_error(format!( @@ -682,13 +772,7 @@ return returnVal;"# } let native_method: Cow = format!("{lib_name}_h.{}", self.formatter.fmt_c_method_name(method)).into(); - let make_invoker = - method.params.is_empty() && !write_return && method.param_self.is_none(); - let native_invocation = if make_invoker { - "nativeInvoker.apply".into() - } else { - native_method.clone() - }; + let native_invocation = native_method.clone(); let native_return_void = matches!( method.output, ReturnType::Infallible(SuccessType::Unit | SuccessType::Write) @@ -699,7 +783,6 @@ return returnVal;"# return_ty, native_method, native_invocation, - make_invoker, params, param_conversions, return_conversion, @@ -724,7 +807,7 @@ return returnVal;"# (static_methods, class_methods) } - fn gen_enum_def(&self, e: &EnumDef, ty: TypeId) -> (Cow, String) { + fn gen_enum_def(&self, e: &EnumDef) -> (Cow, String) { let Config { domain, lib_name } = &self.tcx_config; let type_name = e.name.as_str(); let variants = e @@ -740,7 +823,7 @@ return returnVal;"# }, ) .collect(); - let (methods, _) = self.gen_methods(ty, e.name.as_str(), &e.methods); + let (methods, _) = self.gen_methods(e.name.as_str(), &e.methods); ( format!("{type_name}.java").into(), EnumTypeTpl { @@ -754,36 +837,117 @@ return returnVal;"# .expect("failed to render struct type"), ) } - fn gen_struct_def( - &self, - s: &StructDef, - ty: TypeId, - ) -> (Cow, String) { + fn gen_struct_def(&self, s: &StructDef) -> (Cow, String) { let Config { domain, lib_name } = &self.tcx_config; let type_name = s.name.as_str(); let fields = s .fields .iter() - .map(|field| { + .map(|ref field| { let name = self.formatter.fmt_field_name(field); - let struct_return = match field.ty { - hir::Type::Enum(ref enum_def) => Some( - format!("{}.fromInt", self.tcx.resolve_enum(enum_def.tcx_id).name).into(), - ), - hir::Type::Struct(ref struct_def) => Some( - format!( - "{}.fromSegment", - self.tcx.resolve_type(struct_def.id()).name() - ) - .into(), - ), - _ => None, + let native_name = field.name.as_str().into(); + let native_val = + format!("{domain}.{lib_name}.ntv.{type_name}.{native_name}(structSegment)"); + let field_val = match &field.ty { + hir::Type::Enum(ref enum_def) => format!( + "{}.fromInt({native_val})", + self.tcx.resolve_enum(enum_def.tcx_id).name + ) + .into(), + hir::Type::Struct(struct_path) => { + let ty_name = self.tcx.resolve_type(struct_path.id()).name().as_str(); + let lt_env = &s.lifetimes; + let lt_edges = struct_path + .lifetimes() + .lifetimes() + .filter_map(|lt| match lt { + MaybeStatic::Static => None, + MaybeStatic::NonStatic(lt) => Some(lt), + }) + .map(|lt| { + let lt_edges = lt_env + .all_longer_lifetimes(<) + .map(|lt| lt_env.fmt_lifetime(lt)) + .map(|lt| format!("{lt}Edges")) + .collect::>(); + match lt_edges.len() { + 0 => "List.of()".into(), + 1 => lt_edges.join(", ").cown(), + _ => format!( + "Stream.concat({}).toList()", + lt_edges + .iter() + .map(|edge| format!("{edge}.stream()")) + .mk_str_iter(", ") + ) + .cown(), + } + }); + let args = once("arena".into()) + .chain(once(format!("{native_val}").cown())) + .chain(lt_edges) + .mk_str_iter(", "); + + format!("new {ty_name}({args})").cown() + } + hir::Type::Primitive(_) => native_val.clone().into(), + hir::Type::Slice(Slice::Str( + _, + StringEncoding::Utf8 | StringEncoding::UnvalidatedUtf8, + )) => format!("SliceUtils.readUtf8({native_val})").into(), + hir::Type::Slice(Slice::Str(_, StringEncoding::UnvalidatedUtf16)) => { + format!("SliceUtils.readUtf16({native_val})").into() + } + hir::Type::Slice(_) => { + todo!("Failed to generate field: {name} for struct {}", s.name) + } + hir::Type::Opaque(OpaquePath { + ref lifetimes, + ref owner, + tcx_id, + .. + }) => { + let ty_name = self.tcx.resolve_opaque(*tcx_id).name.as_str(); + let lt_env = &s.lifetimes; + let self_edges: Cow = match owner.lifetime() { + Some(MaybeStatic::Static) => "List.of()".into(), + Some(MaybeStatic::NonStatic(lt)) => { + let stream_edges = lt_env + .all_longer_lifetimes(lt) + .map(|lt| lt_env.fmt_lifetime(lt)) + .map(|lt| format!("{lt}Edges.stream()")) + .mk_str_iter(", "); + format!("Stream.concat({stream_edges}).toList()").into() + } + None => unreachable!("Struct cannot have owned opaque as field."), + }; + let lt_edges = lifetimes + .lifetimes() + .filter_map(|lt| match lt { + MaybeStatic::Static => None, + MaybeStatic::NonStatic(lt) => Some(lt), + }) + .map(|lt| { + let lt_edges = lt_env + .all_longer_lifetimes(<) + .map(|lt| lt_env.fmt_lifetime(lt)) + .map(|lt| format!("{lt}Edges.stream()")) + .mk_str_iter(", "); + + format!("Stream.concat({lt_edges}).toList()") + }) + .mk_str_iter(", "); + format!("new {ty_name}(arena, {native_val}, {self_edges}, {lt_edges})") + .cown() + } + _ => todo!(), }; let ty = self.formatter.fmt_java_type(&field.ty); FieldTpl { name, + native_name, ty, - field_transform: struct_return, + field_val, } }) .collect(); @@ -797,7 +961,7 @@ return returnVal;"# }) .map(|lt| s.lifetimes.fmt_lifetime(lt)) .collect(); - let (methods, _) = self.gen_methods(ty, s.name.as_str(), &s.methods); + let (methods, _) = self.gen_methods(s.name.as_str(), &s.methods); ( format!("{type_name}.java").into(), StructTypeTpl { @@ -813,9 +977,9 @@ return returnVal;"# ) } - fn gen_opaque_def(&self, o: &OpaqueDef, ty: TypeId) -> (Cow, String) { + fn gen_opaque_def(&self, o: &OpaqueDef) -> (Cow, String) { let Config { domain, lib_name } = &self.tcx_config; - let (static_methods, class_methods) = self.gen_methods(ty, o.name.as_str(), &o.methods); + let (static_methods, class_methods) = self.gen_methods(o.name.as_str(), &o.methods); let edges = o .lifetimes @@ -869,6 +1033,24 @@ impl PostFixCown for String { } } +trait JoinStrIterator: Sized { + fn mk_str_iter(self, sep: S) -> String; +} + +impl JoinStrIterator for I +where + I: IntoIterator, + T: std::fmt::Display, +{ + fn mk_str_iter(self, sep: S) -> String { + let mut iter = self.into_iter(); + match iter.next() { + Some(t) => iter.fold(format!("{t}"), |accum, next| format!("{accum}{sep}{next}")), + None => String::new(), + } + } +} + #[cfg(test)] mod test { @@ -978,7 +1160,7 @@ mod test { for (ty, def) in tcx.all_types() { let rendered = match def { TypeDef::Opaque(opaque) => { - let (_, rendered) = tcx_gen.gen_opaque_def(opaque, ty); + let (_, rendered) = tcx_gen.gen_opaque_def(opaque); rendered } _ => String::new(), @@ -1078,11 +1260,11 @@ mod test { for (ty, def) in tcx.all_types() { let rendered = match (ty, def) { (_, TypeDef::Struct(struct_def)) => { - let (_, rendered) = tcx_gen.gen_struct_def(struct_def, ty); + let (_, rendered) = tcx_gen.gen_struct_def(struct_def); rendered } (_, TypeDef::Enum(enum_def)) => { - let (_, rendered) = tcx_gen.gen_enum_def(enum_def, ty); + let (_, rendered) = tcx_gen.gen_enum_def(enum_def); rendered } _ => String::new(), @@ -1150,16 +1332,16 @@ mod test { for (ty, def) in tcx.all_types() { let rendered = match (ty, def) { (_, TypeDef::Opaque(opaque)) => { - let (_, rendered) = tcx_gen.gen_opaque_def(opaque, ty); + let (_, rendered) = tcx_gen.gen_opaque_def(opaque); rendered } (_, TypeDef::Struct(struct_def)) => { - let (_, rendered) = tcx_gen.gen_struct_def(struct_def, ty); + let (_, rendered) = tcx_gen.gen_struct_def(struct_def); rendered } (_, TypeDef::Enum(enum_def)) => { - let (_, rendered) = tcx_gen.gen_enum_def(enum_def, ty); + let (_, rendered) = tcx_gen.gen_enum_def(enum_def); rendered } _ => String::new(), @@ -1257,16 +1439,16 @@ mod test { for (ty, def) in tcx.all_types() { let rendered = match (ty, def) { (_, TypeDef::Opaque(opaque)) => { - let (_, rendered) = tcx_gen.gen_opaque_def(opaque, ty); + let (_, rendered) = tcx_gen.gen_opaque_def(opaque); rendered } (_, TypeDef::Struct(struct_def)) => { - let (_, rendered) = tcx_gen.gen_struct_def(struct_def, ty); + let (_, rendered) = tcx_gen.gen_struct_def(struct_def); rendered } (TypeId::Enum(enum_id), TypeDef::Enum(enum_def)) => { - let (_, rendered) = tcx_gen.gen_enum_def(enum_def, ty); + let (_, rendered) = tcx_gen.gen_enum_def(enum_def); rendered } _ => String::new(), diff --git a/tool/templates/java/Main.java.jinja b/tool/templates/java/Lib.java.jinja similarity index 93% rename from tool/templates/java/Main.java.jinja rename to tool/templates/java/Lib.java.jinja index 7f58d7053..62cbcdee8 100644 --- a/tool/templates/java/Main.java.jinja +++ b/tool/templates/java/Lib.java.jinja @@ -6,6 +6,7 @@ import java.lang.foreign.*; import java.lang.ref.Cleaner; import java.nio.charset.StandardCharsets; import java.util.function.Consumer; +import java.util.Arrays; import static java.lang.foreign.ValueLayout.*; @@ -45,6 +46,19 @@ public class Lib { class SliceUtils { + + static boolean[] booleanSliceToArray(MemorySegment segment) { + var data = DiplomatU8View.data(segment); + var len = DiplomatU8View.len(segment); + var slice = data.asSlice(0, len * JAVA_BYTE.byteSize()); + var byteArray = slice.toArray(JAVA_BYTE); + var returnArray = new boolean[(int) len]; + for (var i=0; i < len; i++ ) { + returnArray[i] = (byteArray[i] == 1); + } + return returnArray; + } + static byte[] byteSliceToArray(MemorySegment segment) { var data = DiplomatU8View.data(segment); var len = DiplomatU8View.len(segment); diff --git a/tool/templates/java/Method.java.jinja b/tool/templates/java/Method.java.jinja index 73204d5fd..5cc4081a2 100644 --- a/tool/templates/java/Method.java.jinja +++ b/tool/templates/java/Method.java.jinja @@ -14,9 +14,6 @@ public{% if is_static %} static {% else %} {% endif %}{{return_ty}} {% for conv in param_conversions -%} {{conv.conversion_def|indent(8)}} {% endfor -%} - {% if make_invoker -%} - var nativeInvoker = {{native_method}}.makeInvoker(); - {% endif -%} {% if native_return_void %}{% else %}var nativeVal = {% endif %}{{native_invocation}}( {%- for conv in param_conversions -%} {{conv.converted_value}}{% if loop.last %}{% else %}, {% endif -%} @@ -28,9 +25,6 @@ public{% if is_static %} static {% else %} {% endif %}{{return_ty}} {% for conv in param_conversions -%} {{conv.conversion_def|indent(4)}} {% endfor -%} - {% if make_invoker -%} - var nativeInvoker = {{native_method}}.makeInvoker(); - {% endif -%} {% if native_return_void %}{% else %}var nativeVal = {% endif %}{{native_invocation}}( {%- for conv in param_conversions -%} {{conv.converted_value}}{% if loop.last %}{% else %}, {% endif -%} diff --git a/tool/templates/java/Opaque.java.jinja b/tool/templates/java/Opaque.java.jinja index 98c71bec5..ca150c30e 100644 --- a/tool/templates/java/Opaque.java.jinja +++ b/tool/templates/java/Opaque.java.jinja @@ -10,6 +10,7 @@ import java.lang.ref.Cleaner; import java.util.List; import static java.lang.foreign.ValueLayout.*; import java.nio.charset.StandardCharsets; +import java.util.stream.Stream; public class {{type_name}} { @@ -34,6 +35,18 @@ public class {{type_name}} { } {{type_name}}() {} + {{type_name}}(MemorySegment handle, List selfEdges + {%- for edge in edges -%} + , List {{edge}}Edges + {%- endfor -%} + ) { + this.internal = handle; + this.selfEdges = selfEdges; + {% for edge in edges -%} + this.{{edge}}Edges = {{edge}}Edges; + {% endfor %} + + } {% for method in static_methods %} {{method|indent(4)}} {% endfor %} diff --git a/tool/templates/java/OpaqueReturn.java.jinja b/tool/templates/java/OpaqueReturn.java.jinja index 6e4b6a519..37587305f 100644 --- a/tool/templates/java/OpaqueReturn.java.jinja +++ b/tool/templates/java/OpaqueReturn.java.jinja @@ -1,8 +1,25 @@ -var returnVal = new {{return_ty}}(); -{% for lifetime_edge in lifetime_edges %} -{{lifetime_edge}} -{% endfor %} -returnVal.internal = nativeVal; +List selfEdges = +{%- match return_self_edges %} +{%- when Some with (self_edges) %} List.of({{self_edges}}); +{%- when None %} List.of(); +{%- endmatch %} + + +{% for lifetime in lifetimes %} +List {{lifetime.name}}Edges = List.of( +{%- for edge in lifetime.edges -%} +{% if loop.first %}{% else %}, {% endif %}{{edge}} +{%- endfor -%} +); + +{%- endfor %} +var returnVal = new {{return_ty}}(nativeVal, selfEdges +{%- for lifetime in lifetimes -%} +, {{lifetime.name}}Edges +{%- endfor -%} +); +{% if owned_return -%} var cleaner = new {{return_ty}}.{{return_ty}}Cleaner(nativeVal); returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); +{%- endif %} return returnVal; diff --git a/tool/templates/java/Struct.java.jinja b/tool/templates/java/Struct.java.jinja index 8e9ac08b4..1e866d1c1 100644 --- a/tool/templates/java/Struct.java.jinja +++ b/tool/templates/java/Struct.java.jinja @@ -9,6 +9,7 @@ import java.lang.foreign.SegmentAllocator; import java.util.List; import static java.lang.foreign.ValueLayout.*; import java.nio.charset.StandardCharsets; +import java.util.stream.Stream; public class {{type_name}} { {% for field in fields -%} @@ -23,20 +24,24 @@ public class {{type_name}} { {% endfor %} private {{type_name}}(SegmentAllocator arena) { - this.arena = arena + this.arena = arena; } - void initFromSegment(MemorySegment segment) { - this.internal = segment; + {{type_name}}(SegmentAllocator arena, MemorySegment structSegment + {%- for edge in edges -%} + , List {{edge}}Edges + {%- endfor -%} + ) { + this.arena = arena; + this.selfEdges = selfEdges; + {% for edge in edges -%} + this.{{edge}}Edges = {{edge}}Edges; + {% endfor %} {% for field in fields -%} - this.{{field.name}} = {% match field.field_transform -%} - {% when Some with (transform) -%} - {{transform}}({{domain}}.{{lib_name}}.ntv.{{type_name}}.{{field.name}}(segment)); - {% when None -%} - {{domain}}.{{lib_name}}.ntv.{{type_name}}.{{field.name}}(segment); - {% endmatch -%} + this.{{field.name}} = {{field.field_val}}; {% endfor %} + } {% for method in methods %} {{method|indent(4)}} diff --git a/tool/templates/java/StructReturn.java.jinja b/tool/templates/java/StructReturn.java.jinja index 08d171b7f..cd6a929d5 100644 --- a/tool/templates/java/StructReturn.java.jinja +++ b/tool/templates/java/StructReturn.java.jinja @@ -1,3 +1,14 @@ -var returnVal = new {{return_ty}}(returnArena); -returnVal.initFromSegment(nativeVal); +{% for lifetime in lifetimes %} +List {{lifetime.name}}Edges = List.of( +{%- for edge in lifetime.edges -%} +{% if loop.first %}{% else %}, {% endif %}{{edge}} +{%- endfor -%} +); +{%- endfor %} + +var returnVal = new {{return_ty}}(returnArena, nativeVal +{%- for lifetime in lifetimes -%} +, {{lifetime.name}}Edges +{%- endfor -%} +); return returnVal; From 031272d64aa9a18fc497a12172c1e19335ada624 Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Sat, 10 Aug 2024 11:43:49 +0200 Subject: [PATCH 14/69] panama-backend - clippy --- tool/src/java/formatter.rs | 3 +-- tool/src/java/mod.rs | 9 ++++----- tool/src/lib.rs | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/tool/src/java/formatter.rs b/tool/src/java/formatter.rs index 2c9b7d821..2995d8daf 100644 --- a/tool/src/java/formatter.rs +++ b/tool/src/java/formatter.rs @@ -112,9 +112,8 @@ impl<'cx> JavaFormatter<'cx> { pub fn fmt_native_primitive<'a>(&self, ty: &'a PrimitiveType) -> Cow<'a, str> { match ty { PrimitiveType::Bool => "byte".into(), - ref p => self.fmt_java_primitive(p), + p => self.fmt_java_primitive(p), } - .into() } pub fn fmt_param_name(&self, name: &str) -> String { diff --git a/tool/src/java/mod.rs b/tool/src/java/mod.rs index 350f5d98c..a88739ff9 100644 --- a/tool/src/java/mod.rs +++ b/tool/src/java/mod.rs @@ -650,8 +650,7 @@ return string;"#, _ => None, }; let return_self_edges: Option> = self_lt - .map(|lifetime| lt_lookup.get(&lifetime)) - .flatten() + .and_then(|lifetime| lt_lookup.get(&lifetime)) .map(|param| { param .incoming_edges @@ -665,7 +664,7 @@ return string;"#, .filter_map(|lt| match lt { MaybeStatic::Static => None, MaybeStatic::NonStatic(lt) - if !(Some(lt).as_ref() == self_lt.as_ref()) => + if Some(lt).as_ref() != self_lt.as_ref() => { Some(lt) } @@ -843,7 +842,7 @@ return string;"#, let fields = s .fields .iter() - .map(|ref field| { + .map(|field| { let name = self.formatter.fmt_field_name(field); let native_name = field.name.as_str().into(); let native_val = @@ -884,7 +883,7 @@ return string;"#, } }); let args = once("arena".into()) - .chain(once(format!("{native_val}").cown())) + .chain(once(native_val.to_string().cown())) .chain(lt_edges) .mk_str_iter(", "); diff --git a/tool/src/lib.rs b/tool/src/lib.rs index b0806f687..52b091733 100644 --- a/tool/src/lib.rs +++ b/tool/src/lib.rs @@ -88,7 +88,7 @@ pub fn gen( )?; demo_gen::run(&tcx, docs_url_gen) } - "java" => java::run(&tcx, library_config, &out_folder), // we need to pass the out_folder + "java" => java::run(&tcx, library_config, out_folder), // we need to pass the out_folder // to be able to run jextract "kotlin" => kotlin::run(&tcx, library_config), o => panic!("Unknown target: {}", o), From a323918389f2864c69445e326d2015035fd61bd5 Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Sat, 10 Aug 2024 11:47:55 +0200 Subject: [PATCH 15/69] panama-backend - manually address clippy issues --- tool/src/java/formatter.rs | 14 ++------------ tool/src/java/mod.rs | 16 +++------------- 2 files changed, 5 insertions(+), 25 deletions(-) diff --git a/tool/src/java/formatter.rs b/tool/src/java/formatter.rs index 2995d8daf..47eee8f40 100644 --- a/tool/src/java/formatter.rs +++ b/tool/src/java/formatter.rs @@ -30,7 +30,7 @@ impl<'cx> JavaFormatter<'cx> { field: &'a hir::StructField, ) -> Cow<'a, str> { let name = field.name.as_str().to_lower_camel_case(); - if INVALID_NAMES.contains(&&*name) { + if INVALID_NAMES.contains(&&*name) || DISALLOWED_CORE_TYPES.contains(&&*name) { format!("{name}_").into() } else { name.into() @@ -39,7 +39,7 @@ impl<'cx> JavaFormatter<'cx> { pub fn fmt_method_name<'a>(&self, method: &'a hir::Method) -> Cow<'a, str> { let name = method.name.as_str().to_lower_camel_case(); let name = method.attrs.rename.apply(name.into()); - if INVALID_NAMES.contains(&&*name) { + if INVALID_NAMES.contains(&&*name) || DISALLOWED_CORE_TYPES.contains(&&*name) { format!("{name}_").into() } else { name @@ -67,16 +67,6 @@ impl<'cx> JavaFormatter<'cx> { } } - pub fn fmt_native_type<'a, P: TyPosition>(&self, ty: &'a Type

) -> Cow<'a, str> { - match ty { - Type::Primitive(ref p) => self.fmt_native_primitive(p), - Type::Opaque(_) => todo!(), - Type::Struct(_) => todo!(), - Type::Enum(_) => todo!(), - Type::Slice(_) => todo!(), - _ => todo!(), - } - } pub fn fmt_java_type<'a, P: TyPosition>(&self, ty: &'a Type

) -> Cow<'a, str> { match ty { hir::Type::Primitive(ref p) => self.fmt_java_primitive(p), diff --git a/tool/src/java/mod.rs b/tool/src/java/mod.rs index a88739ff9..f9e9d587d 100644 --- a/tool/src/java/mod.rs +++ b/tool/src/java/mod.rs @@ -227,7 +227,6 @@ pub(crate) struct MethodTpl<'a> { method_name: Option>, is_static: bool, return_ty: Cow<'a, str>, - native_method: Cow<'a, str>, native_invocation: Cow<'a, str>, params: Vec>, param_conversions: Vec>, @@ -250,7 +249,6 @@ pub(crate) struct StructTypeTpl<'a> { #[derive(Clone, Debug)] struct FieldTpl<'a> { name: Cow<'a, str>, - native_name: Cow<'a, str>, field_val: Cow<'a, str>, ty: Cow<'a, str>, } @@ -292,7 +290,6 @@ struct LifetimeTpl<'a> { #[template(path = "java/StructReturn.java.jinja", escape = "none")] pub(crate) struct StructReturnTpl<'a> { lifetimes: Vec>, - return_self_edges: Option>, return_ty: Cow<'a, str>, } @@ -547,7 +544,6 @@ return string;"#, StructReturnTpl { lifetimes, return_ty: ty_name.as_str().into(), - return_self_edges, } .render() .unwrap_or_else(|err| { @@ -780,7 +776,6 @@ return string;"#, method_name, is_static: method.param_self.is_none() && !is_valid_constructor, return_ty, - native_method, native_invocation, params, param_conversions, @@ -844,7 +839,7 @@ return string;"#, .iter() .map(|field| { let name = self.formatter.fmt_field_name(field); - let native_name = field.name.as_str().into(); + let native_name = field.name.as_str(); let native_val = format!("{domain}.{lib_name}.ntv.{type_name}.{native_name}(structSegment)"); let field_val = match &field.ty { @@ -944,7 +939,6 @@ return string;"#, let ty = self.formatter.fmt_java_type(&field.ty); FieldTpl { name, - native_name, ty, field_val, } @@ -1011,10 +1005,6 @@ trait PostFix: Sized { fn wrap_ok(self) -> Result { Ok(self) } - fn wrap_err(self) -> Result { - Err(self) - } - fn wrap_some(self) -> Option { Some(self) } @@ -1156,7 +1146,7 @@ mod test { }; let mut res = String::new(); - for (ty, def) in tcx.all_types() { + for (_ty, def) in tcx.all_types() { let rendered = match def { TypeDef::Opaque(opaque) => { let (_, rendered) = tcx_gen.gen_opaque_def(opaque); @@ -1446,7 +1436,7 @@ mod test { rendered } - (TypeId::Enum(enum_id), TypeDef::Enum(enum_def)) => { + (TypeId::Enum(_), TypeDef::Enum(enum_def)) => { let (_, rendered) = tcx_gen.gen_enum_def(enum_def); rendered } From 127d6ff0c8293c89dc711d563776b9a47cdb7a5f Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Sat, 10 Aug 2024 15:32:23 +0200 Subject: [PATCH 16/69] panama-backend - accept tests / gen all code --- Makefile.toml | 1 + feature_tests/c/include/Opaque.h | 2 + feature_tests/cpp/include/Opaque.d.hpp | 2 + feature_tests/cpp/include/Opaque.hpp | 7 + feature_tests/dart/lib/src/Opaque.g.dart | 10 + .../dev/diplomattest/somelib/Float64Vec.java | 3 +- .../diplomattest/somelib/ImportedStruct.java | 40 + .../java/dev/diplomattest/somelib/Lib.java | 11 + .../dev/diplomattest/somelib/MyString.java | 6 +- .../java/dev/diplomattest/somelib/Opaque.java | 13 +- .../diplomattest/somelib/UnimportedEnum.java | 52 + .../dev/diplomattest/somelib/Utf16Wrap.java | 3 +- .../somelib/ntv/ImportedStruct.java | 174 + .../diplomattest/somelib/ntv/somelib_h.java | 5991 +++++++++-------- .../diplomattest/somelib/Float64VecTest.java | 7 + feature_tests/js/api/Opaque.d.ts | 2 + feature_tests/js/api/Opaque.mjs | 10 + feature_tests/src/imports.rs | 2 - feature_tests/src/structs.rs | 1 - tool/src/java/mod.rs | 3 +- ...mat_tool__java__test__enum_and_struct.snap | 34 +- .../diplomat_tool__java__test__lifetimes.snap | 109 +- .../diplomat_tool__java__test__opaque.snap | 28 +- ...lomat_tool__java__test__opaque_render.snap | 7 + ...plomat_tool__kotlin__test__opaque_gen.snap | 10 +- tool/templates/java/Lib.java.jinja | 11 + 26 files changed, 3504 insertions(+), 3035 deletions(-) create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ImportedStruct.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/UnimportedEnum.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ImportedStruct.java diff --git a/Makefile.toml b/Makefile.toml index 94e721d66..8e234232a 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -309,6 +309,7 @@ dependencies = [ "gen-js-feature", "gen-dart-feature", "gen-kotlin-feature", + "gen-java-feature", ] [tasks.gen-example] diff --git a/feature_tests/c/include/Opaque.h b/feature_tests/c/include/Opaque.h index b0379a82d..8306653ba 100644 --- a/feature_tests/c/include/Opaque.h +++ b/feature_tests/c/include/Opaque.h @@ -29,6 +29,8 @@ void Opaque_assert_struct(const Opaque* self, MyStruct s); size_t Opaque_returns_usize(void); +size_t Opaque_internal_len(const Opaque* self); + ImportedStruct Opaque_returns_imported(void); int8_t Opaque_cmp(void); diff --git a/feature_tests/cpp/include/Opaque.d.hpp b/feature_tests/cpp/include/Opaque.d.hpp index 0643b9221..7d1db3f21 100644 --- a/feature_tests/cpp/include/Opaque.d.hpp +++ b/feature_tests/cpp/include/Opaque.d.hpp @@ -34,6 +34,8 @@ class Opaque { inline static size_t returns_usize(); + inline size_t internal_len() const; + inline static ImportedStruct returns_imported(); inline static int8_t cmp(); diff --git a/feature_tests/cpp/include/Opaque.hpp b/feature_tests/cpp/include/Opaque.hpp index df81c8e16..74db86fd1 100644 --- a/feature_tests/cpp/include/Opaque.hpp +++ b/feature_tests/cpp/include/Opaque.hpp @@ -30,6 +30,8 @@ namespace capi { size_t Opaque_returns_usize(void); + size_t Opaque_internal_len(const diplomat::capi::Opaque* self); + diplomat::capi::ImportedStruct Opaque_returns_imported(void); int8_t Opaque_cmp(void); @@ -79,6 +81,11 @@ inline size_t Opaque::returns_usize() { return result; } +inline size_t Opaque::internal_len() const { + auto result = diplomat::capi::Opaque_internal_len(this->AsFFI()); + return result; +} + inline ImportedStruct Opaque::returns_imported() { auto result = diplomat::capi::Opaque_returns_imported(); return ImportedStruct::FromFFI(result); diff --git a/feature_tests/dart/lib/src/Opaque.g.dart b/feature_tests/dart/lib/src/Opaque.g.dart index 3d4b4a9e0..e70c63e65 100644 --- a/feature_tests/dart/lib/src/Opaque.g.dart +++ b/feature_tests/dart/lib/src/Opaque.g.dart @@ -61,6 +61,11 @@ final class Opaque implements ffi.Finalizable { return result; } + int internalLen() { + final result = _Opaque_internal_len(_ffi); + return result; + } + static ImportedStruct returnsImported() { final result = _Opaque_returns_imported(); return ImportedStruct._fromFfi(result); @@ -107,6 +112,11 @@ external void _Opaque_assert_struct(ffi.Pointer self, _MyStructFfi s // ignore: non_constant_identifier_names external int _Opaque_returns_usize(); +@meta.ResourceIdentifier('Opaque_internal_len') +@ffi.Native)>(isLeaf: true, symbol: 'Opaque_internal_len') +// ignore: non_constant_identifier_names +external int _Opaque_internal_len(ffi.Pointer self); + @meta.ResourceIdentifier('Opaque_returns_imported') @ffi.Native<_ImportedStructFfi Function()>(isLeaf: true, symbol: 'Opaque_returns_imported') // ignore: non_constant_identifier_names diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Float64Vec.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Float64Vec.java index b3a2deca2..18f5d1f83 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Float64Vec.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Float64Vec.java @@ -201,8 +201,7 @@ public String toString_() { var writeable = somelib_h.diplomat_buffer_write_create(0); somelib_h.Float64Vec_to_string(internal, writeable); - var buffer = DiplomatWrite.buf(writeable); - var string = buffer.getString(0, StandardCharsets.UTF_8); + var string = SliceUtils. readUtf8FromWriteable(writeable); somelib_h.diplomat_buffer_write_destroy(writeable); return string; } diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ImportedStruct.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ImportedStruct.java new file mode 100644 index 000000000..094a0e531 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ImportedStruct.java @@ -0,0 +1,40 @@ +package dev.diplomattest.somelib; + +import dev.diplomattest.somelib.ntv.somelib_h; + +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import java.lang.foreign.SegmentAllocator; +import java.util.List; +import static java.lang.foreign.ValueLayout.*; +import java.nio.charset.StandardCharsets; +import java.util.stream.Stream; + +public class ImportedStruct { + UnimportedEnum foo; + byte count; + + + MemorySegment internal; + SegmentAllocator arena; + List selfEdges = List.of(); + + + private ImportedStruct(SegmentAllocator arena) { + this.arena = arena; + } + + ImportedStruct(SegmentAllocator arena, MemorySegment structSegment) { + this.arena = arena; + this.selfEdges = selfEdges; + + + this.foo = UnimportedEnum.fromInt(dev.diplomattest.somelib.ntv.ImportedStruct.foo(structSegment)); + this.count = dev.diplomattest.somelib.ntv.ImportedStruct.count(structSegment); + + + } + +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Lib.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Lib.java index 76db853de..0349daaeb 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Lib.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Lib.java @@ -181,6 +181,7 @@ public void accept(MemorySegment memorySegment) { }); return diplomatStrsData; } + static MemorySegment strs8(SegmentAllocator arena, String [] strings) { var diplomatStrsData = DiplomatStringView.allocateArray(strings.length, arena); var layout = DiplomatStringView.layout(); @@ -198,4 +199,14 @@ public void accept(MemorySegment memorySegment) { }); return diplomatStrsData; } + + static String readUtf8FromWriteable(MemorySegment writeable) { + var buffer = DiplomatWrite.buf(writeable); + var len = DiplomatWrite.len(writeable); + var bytes = new byte[(int) len]; + for (var i = 0; i < len; i++) { + bytes[i] = buffer.get(JAVA_BYTE, i); + } + return new String(bytes, StandardCharsets.UTF_8); + } } \ No newline at end of file diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyString.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyString.java index 6089ab482..761e8470c 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyString.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyString.java @@ -113,8 +113,7 @@ public static String stringTransform(String foo) { var fooLen = fooMemSeg.byteSize(); var writeable = somelib_h.diplomat_buffer_write_create(0); somelib_h.MyString_string_transform(fooMemSeg, fooLen - 1, writeable); - var buffer = DiplomatWrite.buf(writeable); - var string = buffer.getString(0, StandardCharsets.UTF_8); + var string = SliceUtils. readUtf8FromWriteable(writeable); somelib_h.diplomat_buffer_write_destroy(writeable); return string; } @@ -137,8 +136,7 @@ public String getStr() { var writeable = somelib_h.diplomat_buffer_write_create(0); somelib_h.MyString_get_str(internal, writeable); - var buffer = DiplomatWrite.buf(writeable); - var string = buffer.getString(0, StandardCharsets.UTF_8); + var string = SliceUtils. readUtf8FromWriteable(writeable); somelib_h.diplomat_buffer_write_destroy(writeable); return string; } diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Opaque.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Opaque.java index 3d7abfdb0..e11fd4f5a 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Opaque.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Opaque.java @@ -76,6 +76,16 @@ public static long returnsUsize() { return nativeVal; } + public static ImportedStruct returnsImported() { + + var returnArena = (SegmentAllocator) Arena.ofAuto(); + var nativeVal = somelib_h.Opaque_returns_imported(returnArena); + + + var returnVal = new ImportedStruct(returnArena, nativeVal); + return returnVal; + } + public static byte cmp() { var nativeVal = somelib_h.Opaque_cmp(); @@ -88,8 +98,7 @@ public String getDebugStr() { var writeable = somelib_h.diplomat_buffer_write_create(0); somelib_h.Opaque_get_debug_str(internal, writeable); - var buffer = DiplomatWrite.buf(writeable); - var string = buffer.getString(0, StandardCharsets.UTF_8); + var string = SliceUtils. readUtf8FromWriteable(writeable); somelib_h.diplomat_buffer_write_destroy(writeable); return string; } diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/UnimportedEnum.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/UnimportedEnum.java new file mode 100644 index 000000000..667a1ac01 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/UnimportedEnum.java @@ -0,0 +1,52 @@ +package dev.diplomattest.somelib; + +import dev.diplomattest.somelib.ntv.somelib_h; + + +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import java.lang.foreign.SegmentAllocator; +import static java.lang.foreign.ValueLayout.*; +import java.nio.charset.StandardCharsets; + +public enum UnimportedEnum { + A, + B, + C, + ; + + static UnimportedEnum fromInt(int i) { + switch (i) { + case 0 -> { + return UnimportedEnum.A; + } + case 1 -> { + return UnimportedEnum.B; + } + case 2 -> { + return UnimportedEnum.C; + } + + } + throw new RuntimeException("Unexpected int for UnimportedEnum:" + i); + } + + int toInt() { + switch (this) { + case A -> { + return 0; + } + case B -> { + return 1; + } + case C -> { + return 2; + } + + } + throw new RuntimeException("Unexpected variant for UnimportedEnum:" + this); + } + + +} diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Utf16Wrap.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Utf16Wrap.java index d15a80648..e50150891 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Utf16Wrap.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Utf16Wrap.java @@ -63,8 +63,7 @@ public String getDebugStr() { var writeable = somelib_h.diplomat_buffer_write_create(0); somelib_h.Utf16Wrap_get_debug_str(internal, writeable); - var buffer = DiplomatWrite.buf(writeable); - var string = buffer.getString(0, StandardCharsets.UTF_8); + var string = SliceUtils. readUtf8FromWriteable(writeable); somelib_h.diplomat_buffer_write_destroy(writeable); return string; } diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ImportedStruct.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ImportedStruct.java new file mode 100644 index 000000000..0ef6656c7 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ImportedStruct.java @@ -0,0 +1,174 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct ImportedStruct { + * UnimportedEnum foo; + * uint8_t count; + * } + * } + */ +public class ImportedStruct { + + ImportedStruct() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + somelib_h.C_INT.withName("foo"), + somelib_h.C_CHAR.withName("count"), + MemoryLayout.paddingLayout(3) + ).withName("ImportedStruct"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt foo$LAYOUT = (OfInt)$LAYOUT.select(groupElement("foo")); + + /** + * Layout for field: + * {@snippet lang=c : + * UnimportedEnum foo + * } + */ + public static final OfInt foo$layout() { + return foo$LAYOUT; + } + + private static final long foo$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * UnimportedEnum foo + * } + */ + public static final long foo$offset() { + return foo$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * UnimportedEnum foo + * } + */ + public static int foo(MemorySegment struct) { + return struct.get(foo$LAYOUT, foo$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * UnimportedEnum foo + * } + */ + public static void foo(MemorySegment struct, int fieldValue) { + struct.set(foo$LAYOUT, foo$OFFSET, fieldValue); + } + + private static final OfByte count$LAYOUT = (OfByte)$LAYOUT.select(groupElement("count")); + + /** + * Layout for field: + * {@snippet lang=c : + * uint8_t count + * } + */ + public static final OfByte count$layout() { + return count$LAYOUT; + } + + private static final long count$OFFSET = 4; + + /** + * Offset for field: + * {@snippet lang=c : + * uint8_t count + * } + */ + public static final long count$offset() { + return count$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * uint8_t count + * } + */ + public static byte count(MemorySegment struct) { + return struct.get(count$LAYOUT, count$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * uint8_t count + * } + */ + public static void count(MemorySegment struct, byte fieldValue) { + struct.set(count$LAYOUT, count$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java index d6b05d147..1ca5246c6 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java @@ -213,168 +213,6 @@ public static int _DARWIN_FEATURE_UNIX_CONFORMANCE() { public static int __has_ptrcheck() { return __has_ptrcheck; } - private static final int true_ = (int)1L; - /** - * {@snippet lang=c : - * #define true 1 - * } - */ - public static int true_() { - return true_; - } - private static final int false_ = (int)0L; - /** - * {@snippet lang=c : - * #define false 0 - * } - */ - public static int false_() { - return false_; - } - private static final int __bool_true_false_are_defined = (int)1L; - /** - * {@snippet lang=c : - * #define __bool_true_false_are_defined 1 - * } - */ - public static int __bool_true_false_are_defined() { - return __bool_true_false_are_defined; - } - private static final int __WORDSIZE = (int)64L; - /** - * {@snippet lang=c : - * #define __WORDSIZE 64 - * } - */ - public static int __WORDSIZE() { - return __WORDSIZE; - } - private static final int __PTHREAD_SIZE__ = (int)8176L; - /** - * {@snippet lang=c : - * #define __PTHREAD_SIZE__ 8176 - * } - */ - public static int __PTHREAD_SIZE__() { - return __PTHREAD_SIZE__; - } - private static final int __PTHREAD_ATTR_SIZE__ = (int)56L; - /** - * {@snippet lang=c : - * #define __PTHREAD_ATTR_SIZE__ 56 - * } - */ - public static int __PTHREAD_ATTR_SIZE__() { - return __PTHREAD_ATTR_SIZE__; - } - private static final int __PTHREAD_MUTEXATTR_SIZE__ = (int)8L; - /** - * {@snippet lang=c : - * #define __PTHREAD_MUTEXATTR_SIZE__ 8 - * } - */ - public static int __PTHREAD_MUTEXATTR_SIZE__() { - return __PTHREAD_MUTEXATTR_SIZE__; - } - private static final int __PTHREAD_MUTEX_SIZE__ = (int)56L; - /** - * {@snippet lang=c : - * #define __PTHREAD_MUTEX_SIZE__ 56 - * } - */ - public static int __PTHREAD_MUTEX_SIZE__() { - return __PTHREAD_MUTEX_SIZE__; - } - private static final int __PTHREAD_CONDATTR_SIZE__ = (int)8L; - /** - * {@snippet lang=c : - * #define __PTHREAD_CONDATTR_SIZE__ 8 - * } - */ - public static int __PTHREAD_CONDATTR_SIZE__() { - return __PTHREAD_CONDATTR_SIZE__; - } - private static final int __PTHREAD_COND_SIZE__ = (int)40L; - /** - * {@snippet lang=c : - * #define __PTHREAD_COND_SIZE__ 40 - * } - */ - public static int __PTHREAD_COND_SIZE__() { - return __PTHREAD_COND_SIZE__; - } - private static final int __PTHREAD_ONCE_SIZE__ = (int)8L; - /** - * {@snippet lang=c : - * #define __PTHREAD_ONCE_SIZE__ 8 - * } - */ - public static int __PTHREAD_ONCE_SIZE__() { - return __PTHREAD_ONCE_SIZE__; - } - private static final int __PTHREAD_RWLOCK_SIZE__ = (int)192L; - /** - * {@snippet lang=c : - * #define __PTHREAD_RWLOCK_SIZE__ 192 - * } - */ - public static int __PTHREAD_RWLOCK_SIZE__() { - return __PTHREAD_RWLOCK_SIZE__; - } - private static final int __PTHREAD_RWLOCKATTR_SIZE__ = (int)16L; - /** - * {@snippet lang=c : - * #define __PTHREAD_RWLOCKATTR_SIZE__ 16 - * } - */ - public static int __PTHREAD_RWLOCKATTR_SIZE__() { - return __PTHREAD_RWLOCKATTR_SIZE__; - } - private static final int INT8_MAX = (int)127L; - /** - * {@snippet lang=c : - * #define INT8_MAX 127 - * } - */ - public static int INT8_MAX() { - return INT8_MAX; - } - private static final int INT16_MAX = (int)32767L; - /** - * {@snippet lang=c : - * #define INT16_MAX 32767 - * } - */ - public static int INT16_MAX() { - return INT16_MAX; - } - private static final int INT32_MAX = (int)2147483647L; - /** - * {@snippet lang=c : - * #define INT32_MAX 2147483647 - * } - */ - public static int INT32_MAX() { - return INT32_MAX; - } - private static final int UINT8_MAX = (int)255L; - /** - * {@snippet lang=c : - * #define UINT8_MAX 255 - * } - */ - public static int UINT8_MAX() { - return UINT8_MAX; - } - private static final int UINT16_MAX = (int)65535L; - /** - * {@snippet lang=c : - * #define UINT16_MAX 65535 - * } - */ - public static int UINT16_MAX() { - return UINT16_MAX; - } private static final int __API_TO_BE_DEPRECATED = (int)100000L; /** * {@snippet lang=c : @@ -2949,6 +2787,87 @@ public static int __VISIONOS_1_2() { public static int __ENABLE_LEGACY_MAC_AVAILABILITY() { return __ENABLE_LEGACY_MAC_AVAILABILITY; } + private static final int __PTHREAD_SIZE__ = (int)8176L; + /** + * {@snippet lang=c : + * #define __PTHREAD_SIZE__ 8176 + * } + */ + public static int __PTHREAD_SIZE__() { + return __PTHREAD_SIZE__; + } + private static final int __PTHREAD_ATTR_SIZE__ = (int)56L; + /** + * {@snippet lang=c : + * #define __PTHREAD_ATTR_SIZE__ 56 + * } + */ + public static int __PTHREAD_ATTR_SIZE__() { + return __PTHREAD_ATTR_SIZE__; + } + private static final int __PTHREAD_MUTEXATTR_SIZE__ = (int)8L; + /** + * {@snippet lang=c : + * #define __PTHREAD_MUTEXATTR_SIZE__ 8 + * } + */ + public static int __PTHREAD_MUTEXATTR_SIZE__() { + return __PTHREAD_MUTEXATTR_SIZE__; + } + private static final int __PTHREAD_MUTEX_SIZE__ = (int)56L; + /** + * {@snippet lang=c : + * #define __PTHREAD_MUTEX_SIZE__ 56 + * } + */ + public static int __PTHREAD_MUTEX_SIZE__() { + return __PTHREAD_MUTEX_SIZE__; + } + private static final int __PTHREAD_CONDATTR_SIZE__ = (int)8L; + /** + * {@snippet lang=c : + * #define __PTHREAD_CONDATTR_SIZE__ 8 + * } + */ + public static int __PTHREAD_CONDATTR_SIZE__() { + return __PTHREAD_CONDATTR_SIZE__; + } + private static final int __PTHREAD_COND_SIZE__ = (int)40L; + /** + * {@snippet lang=c : + * #define __PTHREAD_COND_SIZE__ 40 + * } + */ + public static int __PTHREAD_COND_SIZE__() { + return __PTHREAD_COND_SIZE__; + } + private static final int __PTHREAD_ONCE_SIZE__ = (int)8L; + /** + * {@snippet lang=c : + * #define __PTHREAD_ONCE_SIZE__ 8 + * } + */ + public static int __PTHREAD_ONCE_SIZE__() { + return __PTHREAD_ONCE_SIZE__; + } + private static final int __PTHREAD_RWLOCK_SIZE__ = (int)192L; + /** + * {@snippet lang=c : + * #define __PTHREAD_RWLOCK_SIZE__ 192 + * } + */ + public static int __PTHREAD_RWLOCK_SIZE__() { + return __PTHREAD_RWLOCK_SIZE__; + } + private static final int __PTHREAD_RWLOCKATTR_SIZE__ = (int)16L; + /** + * {@snippet lang=c : + * #define __PTHREAD_RWLOCKATTR_SIZE__ 16 + * } + */ + public static int __PTHREAD_RWLOCKATTR_SIZE__() { + return __PTHREAD_RWLOCKATTR_SIZE__; + } private static final int _FORTIFY_SOURCE = (int)2L; /** * {@snippet lang=c : @@ -3282,234 +3201,87 @@ public static int L_ctermid() { public static int _USE_FORTIFY_LEVEL() { return _USE_FORTIFY_LEVEL; } - - private static class __assert_rtn { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("__assert_rtn"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - + private static final int __WORDSIZE = (int)64L; /** - * Function descriptor for: * {@snippet lang=c : - * void __assert_rtn(const char *, const char *, int, const char *) + * #define __WORDSIZE 64 * } */ - public static FunctionDescriptor __assert_rtn$descriptor() { - return __assert_rtn.DESC; + public static int __WORDSIZE() { + return __WORDSIZE; } - + private static final int INT8_MAX = (int)127L; /** - * Downcall method handle for: * {@snippet lang=c : - * void __assert_rtn(const char *, const char *, int, const char *) + * #define INT8_MAX 127 * } */ - public static MethodHandle __assert_rtn$handle() { - return __assert_rtn.HANDLE; + public static int INT8_MAX() { + return INT8_MAX; } - + private static final int INT16_MAX = (int)32767L; /** - * Address for: * {@snippet lang=c : - * void __assert_rtn(const char *, const char *, int, const char *) + * #define INT16_MAX 32767 * } */ - public static MemorySegment __assert_rtn$address() { - return __assert_rtn.ADDR; + public static int INT16_MAX() { + return INT16_MAX; } - + private static final int INT32_MAX = (int)2147483647L; /** * {@snippet lang=c : - * void __assert_rtn(const char *, const char *, int, const char *) + * #define INT32_MAX 2147483647 * } */ - public static void __assert_rtn(MemorySegment x0, MemorySegment x1, int x2, MemorySegment x3) { - var mh$ = __assert_rtn.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("__assert_rtn", x0, x1, x2, x3); - } - mh$.invokeExact(x0, x1, x2, x3); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } + public static int INT32_MAX() { + return INT32_MAX; } + private static final int UINT8_MAX = (int)255L; /** * {@snippet lang=c : - * typedef long ptrdiff_t - * } - */ - public static final OfLong ptrdiff_t = somelib_h.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned long size_t - * } - */ - public static final OfLong size_t = somelib_h.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned long rsize_t - * } - */ - public static final OfLong rsize_t = somelib_h.C_LONG; - /** - * {@snippet lang=c : - * typedef int wchar_t - * } - */ - public static final OfInt wchar_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef signed char int8_t - * } - */ - public static final OfByte int8_t = somelib_h.C_CHAR; - /** - * {@snippet lang=c : - * typedef short int16_t - * } - */ - public static final OfShort int16_t = somelib_h.C_SHORT; - /** - * {@snippet lang=c : - * typedef int int32_t - * } - */ - public static final OfInt int32_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef long long int64_t - * } - */ - public static final OfLong int64_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef unsigned char uint8_t - * } - */ - public static final OfByte uint8_t = somelib_h.C_CHAR; - /** - * {@snippet lang=c : - * typedef unsigned short uint16_t - * } - */ - public static final OfShort uint16_t = somelib_h.C_SHORT; - /** - * {@snippet lang=c : - * typedef unsigned int uint32_t - * } - */ - public static final OfInt uint32_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef unsigned long long uint64_t - * } - */ - public static final OfLong uint64_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef int8_t int_least8_t - * } - */ - public static final OfByte int_least8_t = somelib_h.C_CHAR; - /** - * {@snippet lang=c : - * typedef int16_t int_least16_t - * } - */ - public static final OfShort int_least16_t = somelib_h.C_SHORT; - /** - * {@snippet lang=c : - * typedef int32_t int_least32_t - * } - */ - public static final OfInt int_least32_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef int64_t int_least64_t - * } - */ - public static final OfLong int_least64_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef uint8_t uint_least8_t - * } - */ - public static final OfByte uint_least8_t = somelib_h.C_CHAR; - /** - * {@snippet lang=c : - * typedef uint16_t uint_least16_t - * } - */ - public static final OfShort uint_least16_t = somelib_h.C_SHORT; - /** - * {@snippet lang=c : - * typedef uint32_t uint_least32_t - * } - */ - public static final OfInt uint_least32_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef uint64_t uint_least64_t - * } - */ - public static final OfLong uint_least64_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef int8_t int_fast8_t - * } - */ - public static final OfByte int_fast8_t = somelib_h.C_CHAR; - /** - * {@snippet lang=c : - * typedef int16_t int_fast16_t - * } - */ - public static final OfShort int_fast16_t = somelib_h.C_SHORT; - /** - * {@snippet lang=c : - * typedef int32_t int_fast32_t - * } - */ - public static final OfInt int_fast32_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef int64_t int_fast64_t + * #define UINT8_MAX 255 * } */ - public static final OfLong int_fast64_t = somelib_h.C_LONG_LONG; + public static int UINT8_MAX() { + return UINT8_MAX; + } + private static final int UINT16_MAX = (int)65535L; /** * {@snippet lang=c : - * typedef uint8_t uint_fast8_t + * #define UINT16_MAX 65535 * } */ - public static final OfByte uint_fast8_t = somelib_h.C_CHAR; + public static int UINT16_MAX() { + return UINT16_MAX; + } + private static final int true_ = (int)1L; /** * {@snippet lang=c : - * typedef uint16_t uint_fast16_t + * #define true 1 * } */ - public static final OfShort uint_fast16_t = somelib_h.C_SHORT; + public static int true_() { + return true_; + } + private static final int false_ = (int)0L; /** * {@snippet lang=c : - * typedef uint32_t uint_fast32_t + * #define false 0 * } */ - public static final OfInt uint_fast32_t = somelib_h.C_INT; + public static int false_() { + return false_; + } + private static final int __bool_true_false_are_defined = (int)1L; /** * {@snippet lang=c : - * typedef uint64_t uint_fast64_t + * #define __bool_true_false_are_defined 1 * } */ - public static final OfLong uint_fast64_t = somelib_h.C_LONG_LONG; + public static int __bool_true_false_are_defined() { + return __bool_true_false_are_defined; + } /** * {@snippet lang=c : * typedef signed char __int8_t @@ -3762,186 +3534,159 @@ public static void __assert_rtn(MemorySegment x0, MemorySegment x1, int x2, Memo public static final AddressLayout __darwin_pthread_t = somelib_h.C_POINTER; /** * {@snippet lang=c : - * typedef unsigned char u_int8_t + * typedef int __darwin_nl_item * } */ - public static final OfByte u_int8_t = somelib_h.C_CHAR; + public static final OfInt __darwin_nl_item = somelib_h.C_INT; /** * {@snippet lang=c : - * typedef unsigned short u_int16_t + * typedef int __darwin_wctrans_t * } */ - public static final OfShort u_int16_t = somelib_h.C_SHORT; + public static final OfInt __darwin_wctrans_t = somelib_h.C_INT; /** * {@snippet lang=c : - * typedef unsigned int u_int32_t + * typedef __uint32_t __darwin_wctype_t * } */ - public static final OfInt u_int32_t = somelib_h.C_INT; + public static final OfInt __darwin_wctype_t = somelib_h.C_INT; /** * {@snippet lang=c : - * typedef unsigned long long u_int64_t + * typedef signed char int8_t * } */ - public static final OfLong u_int64_t = somelib_h.C_LONG_LONG; + public static final OfByte int8_t = somelib_h.C_CHAR; /** * {@snippet lang=c : - * typedef int64_t register_t + * typedef short int16_t * } */ - public static final OfLong register_t = somelib_h.C_LONG_LONG; + public static final OfShort int16_t = somelib_h.C_SHORT; /** * {@snippet lang=c : - * typedef unsigned long uintptr_t + * typedef int int32_t * } */ - public static final OfLong uintptr_t = somelib_h.C_LONG; + public static final OfInt int32_t = somelib_h.C_INT; /** * {@snippet lang=c : - * typedef u_int64_t user_addr_t + * typedef long long int64_t * } */ - public static final OfLong user_addr_t = somelib_h.C_LONG_LONG; + public static final OfLong int64_t = somelib_h.C_LONG_LONG; /** * {@snippet lang=c : - * typedef u_int64_t user_size_t + * typedef unsigned char u_int8_t * } */ - public static final OfLong user_size_t = somelib_h.C_LONG_LONG; + public static final OfByte u_int8_t = somelib_h.C_CHAR; /** * {@snippet lang=c : - * typedef int64_t user_ssize_t + * typedef unsigned short u_int16_t * } */ - public static final OfLong user_ssize_t = somelib_h.C_LONG_LONG; + public static final OfShort u_int16_t = somelib_h.C_SHORT; /** * {@snippet lang=c : - * typedef int64_t user_long_t + * typedef unsigned int u_int32_t * } */ - public static final OfLong user_long_t = somelib_h.C_LONG_LONG; + public static final OfInt u_int32_t = somelib_h.C_INT; /** * {@snippet lang=c : - * typedef u_int64_t user_ulong_t + * typedef unsigned long long u_int64_t * } */ - public static final OfLong user_ulong_t = somelib_h.C_LONG_LONG; + public static final OfLong u_int64_t = somelib_h.C_LONG_LONG; /** * {@snippet lang=c : - * typedef int64_t user_time_t + * typedef int64_t register_t * } */ - public static final OfLong user_time_t = somelib_h.C_LONG_LONG; + public static final OfLong register_t = somelib_h.C_LONG_LONG; /** * {@snippet lang=c : - * typedef int64_t user_off_t + * typedef __darwin_intptr_t intptr_t * } */ - public static final OfLong user_off_t = somelib_h.C_LONG_LONG; + public static final OfLong intptr_t = somelib_h.C_LONG; /** * {@snippet lang=c : - * typedef u_int64_t syscall_arg_t + * typedef unsigned long uintptr_t * } */ - public static final OfLong syscall_arg_t = somelib_h.C_LONG_LONG; + public static final OfLong uintptr_t = somelib_h.C_LONG; /** * {@snippet lang=c : - * typedef __darwin_intptr_t intptr_t + * typedef u_int64_t user_addr_t * } */ - public static final OfLong intptr_t = somelib_h.C_LONG; + public static final OfLong user_addr_t = somelib_h.C_LONG_LONG; /** * {@snippet lang=c : - * typedef long intmax_t + * typedef u_int64_t user_size_t * } */ - public static final OfLong intmax_t = somelib_h.C_LONG; + public static final OfLong user_size_t = somelib_h.C_LONG_LONG; /** * {@snippet lang=c : - * typedef unsigned long uintmax_t + * typedef int64_t user_ssize_t * } */ - public static final OfLong uintmax_t = somelib_h.C_LONG; + public static final OfLong user_ssize_t = somelib_h.C_LONG_LONG; /** * {@snippet lang=c : - * typedef uint_least16_t char16_t + * typedef int64_t user_long_t * } */ - public static final OfShort char16_t = somelib_h.C_SHORT; + public static final OfLong user_long_t = somelib_h.C_LONG_LONG; /** * {@snippet lang=c : - * typedef uint_least32_t char32_t + * typedef u_int64_t user_ulong_t * } */ - public static final OfInt char32_t = somelib_h.C_INT; - - private static class diplomat_is_str { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_BOOL, - somelib_h.C_POINTER, - somelib_h.C_LONG - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_is_str"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - + public static final OfLong user_ulong_t = somelib_h.C_LONG_LONG; /** - * Function descriptor for: * {@snippet lang=c : - * bool diplomat_is_str(const char *buf, size_t len) + * typedef int64_t user_time_t * } */ - public static FunctionDescriptor diplomat_is_str$descriptor() { - return diplomat_is_str.DESC; - } - + public static final OfLong user_time_t = somelib_h.C_LONG_LONG; /** - * Downcall method handle for: * {@snippet lang=c : - * bool diplomat_is_str(const char *buf, size_t len) + * typedef int64_t user_off_t * } */ - public static MethodHandle diplomat_is_str$handle() { - return diplomat_is_str.HANDLE; - } - + public static final OfLong user_off_t = somelib_h.C_LONG_LONG; /** - * Address for: * {@snippet lang=c : - * bool diplomat_is_str(const char *buf, size_t len) + * typedef u_int64_t syscall_arg_t * } */ - public static MemorySegment diplomat_is_str$address() { - return diplomat_is_str.ADDR; - } - + public static final OfLong syscall_arg_t = somelib_h.C_LONG_LONG; /** * {@snippet lang=c : - * bool diplomat_is_str(const char *buf, size_t len) + * typedef __darwin_va_list va_list * } */ - public static boolean diplomat_is_str(MemorySegment buf, long len) { - var mh$ = diplomat_is_str.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("diplomat_is_str", buf, len); - } - return (boolean)mh$.invokeExact(buf, len); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } + public static final AddressLayout va_list = somelib_h.C_POINTER; + /** + * {@snippet lang=c : + * typedef __darwin_size_t size_t + * } + */ + public static final OfLong size_t = somelib_h.C_LONG; - private static class diplomat_simple_write { + private static class renameat { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - DiplomatWrite.layout(), + somelib_h.C_INT, + somelib_h.C_INT, somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_INT, + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_simple_write"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("renameat"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -3949,57 +3694,59 @@ private static class diplomat_simple_write { /** * Function descriptor for: * {@snippet lang=c : - * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) + * int renameat(int, const char *, int, const char *) * } */ - public static FunctionDescriptor diplomat_simple_write$descriptor() { - return diplomat_simple_write.DESC; + public static FunctionDescriptor renameat$descriptor() { + return renameat.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) + * int renameat(int, const char *, int, const char *) * } */ - public static MethodHandle diplomat_simple_write$handle() { - return diplomat_simple_write.HANDLE; + public static MethodHandle renameat$handle() { + return renameat.HANDLE; } /** * Address for: * {@snippet lang=c : - * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) + * int renameat(int, const char *, int, const char *) * } */ - public static MemorySegment diplomat_simple_write$address() { - return diplomat_simple_write.ADDR; + public static MemorySegment renameat$address() { + return renameat.ADDR; } /** * {@snippet lang=c : - * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) + * int renameat(int, const char *, int, const char *) * } */ - public static MemorySegment diplomat_simple_write(SegmentAllocator allocator, MemorySegment buf, long buf_size) { - var mh$ = diplomat_simple_write.HANDLE; + public static int renameat(int x0, MemorySegment x1, int x2, MemorySegment x3) { + var mh$ = renameat.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("diplomat_simple_write", allocator, buf, buf_size); + traceDowncall("renameat", x0, x1, x2, x3); } - return (MemorySegment)mh$.invokeExact(allocator, buf, buf_size); + return (int)mh$.invokeExact(x0, x1, x2, x3); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class diplomat_buffer_write_create { + private static class renamex_np { public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_POINTER, + somelib_h.C_INT ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_create"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("renamex_np"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4007,57 +3754,61 @@ private static class diplomat_buffer_write_create { /** * Function descriptor for: * {@snippet lang=c : - * DiplomatWrite *diplomat_buffer_write_create(size_t cap) + * int renamex_np(const char *, const char *, unsigned int) * } */ - public static FunctionDescriptor diplomat_buffer_write_create$descriptor() { - return diplomat_buffer_write_create.DESC; + public static FunctionDescriptor renamex_np$descriptor() { + return renamex_np.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * DiplomatWrite *diplomat_buffer_write_create(size_t cap) + * int renamex_np(const char *, const char *, unsigned int) * } */ - public static MethodHandle diplomat_buffer_write_create$handle() { - return diplomat_buffer_write_create.HANDLE; + public static MethodHandle renamex_np$handle() { + return renamex_np.HANDLE; } /** * Address for: * {@snippet lang=c : - * DiplomatWrite *diplomat_buffer_write_create(size_t cap) + * int renamex_np(const char *, const char *, unsigned int) * } */ - public static MemorySegment diplomat_buffer_write_create$address() { - return diplomat_buffer_write_create.ADDR; + public static MemorySegment renamex_np$address() { + return renamex_np.ADDR; } /** * {@snippet lang=c : - * DiplomatWrite *diplomat_buffer_write_create(size_t cap) + * int renamex_np(const char *, const char *, unsigned int) * } */ - public static MemorySegment diplomat_buffer_write_create(long cap) { - var mh$ = diplomat_buffer_write_create.HANDLE; + public static int renamex_np(MemorySegment x0, MemorySegment x1, int x2) { + var mh$ = renamex_np.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("diplomat_buffer_write_create", cap); + traceDowncall("renamex_np", x0, x1, x2); } - return (MemorySegment)mh$.invokeExact(cap); + return (int)mh$.invokeExact(x0, x1, x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class diplomat_buffer_write_get_bytes { + private static class renameatx_np { public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_INT, somelib_h.C_POINTER, - somelib_h.C_POINTER + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_INT ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_get_bytes"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("renameatx_np"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4065,199 +3816,197 @@ private static class diplomat_buffer_write_get_bytes { /** * Function descriptor for: * {@snippet lang=c : - * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) + * int renameatx_np(int, const char *, int, const char *, unsigned int) * } */ - public static FunctionDescriptor diplomat_buffer_write_get_bytes$descriptor() { - return diplomat_buffer_write_get_bytes.DESC; + public static FunctionDescriptor renameatx_np$descriptor() { + return renameatx_np.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) + * int renameatx_np(int, const char *, int, const char *, unsigned int) * } */ - public static MethodHandle diplomat_buffer_write_get_bytes$handle() { - return diplomat_buffer_write_get_bytes.HANDLE; + public static MethodHandle renameatx_np$handle() { + return renameatx_np.HANDLE; } /** * Address for: * {@snippet lang=c : - * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) + * int renameatx_np(int, const char *, int, const char *, unsigned int) * } */ - public static MemorySegment diplomat_buffer_write_get_bytes$address() { - return diplomat_buffer_write_get_bytes.ADDR; + public static MemorySegment renameatx_np$address() { + return renameatx_np.ADDR; } /** * {@snippet lang=c : - * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) + * int renameatx_np(int, const char *, int, const char *, unsigned int) * } */ - public static MemorySegment diplomat_buffer_write_get_bytes(MemorySegment t) { - var mh$ = diplomat_buffer_write_get_bytes.HANDLE; + public static int renameatx_np(int x0, MemorySegment x1, int x2, MemorySegment x3, int x4) { + var mh$ = renameatx_np.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("diplomat_buffer_write_get_bytes", t); + traceDowncall("renameatx_np", x0, x1, x2, x3, x4); } - return (MemorySegment)mh$.invokeExact(t); + return (int)mh$.invokeExact(x0, x1, x2, x3, x4); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } + /** + * {@snippet lang=c : + * typedef __darwin_off_t fpos_t + * } + */ + public static final OfLong fpos_t = somelib_h.C_LONG_LONG; - private static class diplomat_buffer_write_len { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_LONG, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_len"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + private static class __stdinp$constants { + public static final AddressLayout LAYOUT = somelib_h.C_POINTER; + public static final MemorySegment SEGMENT = somelib_h.findOrThrow("__stdinp").reinterpret(LAYOUT.byteSize()); } /** - * Function descriptor for: + * Layout for variable: * {@snippet lang=c : - * size_t diplomat_buffer_write_len(DiplomatWrite *t) + * extern FILE *__stdinp * } */ - public static FunctionDescriptor diplomat_buffer_write_len$descriptor() { - return diplomat_buffer_write_len.DESC; + public static AddressLayout __stdinp$layout() { + return __stdinp$constants.LAYOUT; } /** - * Downcall method handle for: + * Segment for variable: * {@snippet lang=c : - * size_t diplomat_buffer_write_len(DiplomatWrite *t) + * extern FILE *__stdinp * } */ - public static MethodHandle diplomat_buffer_write_len$handle() { - return diplomat_buffer_write_len.HANDLE; + public static MemorySegment __stdinp$segment() { + return __stdinp$constants.SEGMENT; } /** - * Address for: + * Getter for variable: * {@snippet lang=c : - * size_t diplomat_buffer_write_len(DiplomatWrite *t) + * extern FILE *__stdinp * } */ - public static MemorySegment diplomat_buffer_write_len$address() { - return diplomat_buffer_write_len.ADDR; + public static MemorySegment __stdinp() { + return __stdinp$constants.SEGMENT.get(__stdinp$constants.LAYOUT, 0L); } /** + * Setter for variable: * {@snippet lang=c : - * size_t diplomat_buffer_write_len(DiplomatWrite *t) + * extern FILE *__stdinp * } */ - public static long diplomat_buffer_write_len(MemorySegment t) { - var mh$ = diplomat_buffer_write_len.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("diplomat_buffer_write_len", t); - } - return (long)mh$.invokeExact(t); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } + public static void __stdinp(MemorySegment varValue) { + __stdinp$constants.SEGMENT.set(__stdinp$constants.LAYOUT, 0L, varValue); } - private static class diplomat_buffer_write_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_destroy"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + private static class __stdoutp$constants { + public static final AddressLayout LAYOUT = somelib_h.C_POINTER; + public static final MemorySegment SEGMENT = somelib_h.findOrThrow("__stdoutp").reinterpret(LAYOUT.byteSize()); } /** - * Function descriptor for: + * Layout for variable: * {@snippet lang=c : - * void diplomat_buffer_write_destroy(DiplomatWrite *t) + * extern FILE *__stdoutp * } */ - public static FunctionDescriptor diplomat_buffer_write_destroy$descriptor() { - return diplomat_buffer_write_destroy.DESC; + public static AddressLayout __stdoutp$layout() { + return __stdoutp$constants.LAYOUT; } /** - * Downcall method handle for: + * Segment for variable: * {@snippet lang=c : - * void diplomat_buffer_write_destroy(DiplomatWrite *t) + * extern FILE *__stdoutp * } */ - public static MethodHandle diplomat_buffer_write_destroy$handle() { - return diplomat_buffer_write_destroy.HANDLE; + public static MemorySegment __stdoutp$segment() { + return __stdoutp$constants.SEGMENT; } /** - * Address for: + * Getter for variable: * {@snippet lang=c : - * void diplomat_buffer_write_destroy(DiplomatWrite *t) + * extern FILE *__stdoutp * } */ - public static MemorySegment diplomat_buffer_write_destroy$address() { - return diplomat_buffer_write_destroy.ADDR; + public static MemorySegment __stdoutp() { + return __stdoutp$constants.SEGMENT.get(__stdoutp$constants.LAYOUT, 0L); } /** + * Setter for variable: * {@snippet lang=c : - * void diplomat_buffer_write_destroy(DiplomatWrite *t) + * extern FILE *__stdoutp * } */ - public static void diplomat_buffer_write_destroy(MemorySegment t) { - var mh$ = diplomat_buffer_write_destroy.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("diplomat_buffer_write_destroy", t); - } - mh$.invokeExact(t); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } + public static void __stdoutp(MemorySegment varValue) { + __stdoutp$constants.SEGMENT.set(__stdoutp$constants.LAYOUT, 0L, varValue); + } + + private static class __stderrp$constants { + public static final AddressLayout LAYOUT = somelib_h.C_POINTER; + public static final MemorySegment SEGMENT = somelib_h.findOrThrow("__stderrp").reinterpret(LAYOUT.byteSize()); } + /** + * Layout for variable: * {@snippet lang=c : - * typedef int __darwin_nl_item + * extern FILE *__stderrp * } */ - public static final OfInt __darwin_nl_item = somelib_h.C_INT; + public static AddressLayout __stderrp$layout() { + return __stderrp$constants.LAYOUT; + } + /** + * Segment for variable: * {@snippet lang=c : - * typedef int __darwin_wctrans_t + * extern FILE *__stderrp * } */ - public static final OfInt __darwin_wctrans_t = somelib_h.C_INT; + public static MemorySegment __stderrp$segment() { + return __stderrp$constants.SEGMENT; + } + /** + * Getter for variable: * {@snippet lang=c : - * typedef __uint32_t __darwin_wctype_t + * extern FILE *__stderrp * } */ - public static final OfInt __darwin_wctype_t = somelib_h.C_INT; + public static MemorySegment __stderrp() { + return __stderrp$constants.SEGMENT.get(__stderrp$constants.LAYOUT, 0L); + } + /** + * Setter for variable: * {@snippet lang=c : - * typedef __darwin_va_list va_list + * extern FILE *__stderrp * } */ - public static final AddressLayout va_list = somelib_h.C_POINTER; + public static void __stderrp(MemorySegment varValue) { + __stderrp$constants.SEGMENT.set(__stderrp$constants.LAYOUT, 0L, varValue); + } - private static class renameat { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_INT, + private static class clearerr { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("renameat"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("clearerr"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4265,59 +4014,57 @@ private static class renameat { /** * Function descriptor for: * {@snippet lang=c : - * int renameat(int, const char *, int, const char *) + * void clearerr(FILE *) * } */ - public static FunctionDescriptor renameat$descriptor() { - return renameat.DESC; + public static FunctionDescriptor clearerr$descriptor() { + return clearerr.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int renameat(int, const char *, int, const char *) + * void clearerr(FILE *) * } */ - public static MethodHandle renameat$handle() { - return renameat.HANDLE; + public static MethodHandle clearerr$handle() { + return clearerr.HANDLE; } /** * Address for: * {@snippet lang=c : - * int renameat(int, const char *, int, const char *) + * void clearerr(FILE *) * } */ - public static MemorySegment renameat$address() { - return renameat.ADDR; + public static MemorySegment clearerr$address() { + return clearerr.ADDR; } /** * {@snippet lang=c : - * int renameat(int, const char *, int, const char *) + * void clearerr(FILE *) * } */ - public static int renameat(int x0, MemorySegment x1, int x2, MemorySegment x3) { - var mh$ = renameat.HANDLE; + public static void clearerr(MemorySegment x0) { + var mh$ = clearerr.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("renameat", x0, x1, x2, x3); + traceDowncall("clearerr", x0); } - return (int)mh$.invokeExact(x0, x1, x2, x3); + mh$.invokeExact(x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class renamex_np { + private static class fclose { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_INT + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("renamex_np"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fclose"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4325,61 +4072,57 @@ private static class renamex_np { /** * Function descriptor for: * {@snippet lang=c : - * int renamex_np(const char *, const char *, unsigned int) + * int fclose(FILE *) * } */ - public static FunctionDescriptor renamex_np$descriptor() { - return renamex_np.DESC; + public static FunctionDescriptor fclose$descriptor() { + return fclose.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int renamex_np(const char *, const char *, unsigned int) + * int fclose(FILE *) * } */ - public static MethodHandle renamex_np$handle() { - return renamex_np.HANDLE; + public static MethodHandle fclose$handle() { + return fclose.HANDLE; } /** * Address for: * {@snippet lang=c : - * int renamex_np(const char *, const char *, unsigned int) + * int fclose(FILE *) * } */ - public static MemorySegment renamex_np$address() { - return renamex_np.ADDR; + public static MemorySegment fclose$address() { + return fclose.ADDR; } /** * {@snippet lang=c : - * int renamex_np(const char *, const char *, unsigned int) + * int fclose(FILE *) * } */ - public static int renamex_np(MemorySegment x0, MemorySegment x1, int x2) { - var mh$ = renamex_np.HANDLE; + public static int fclose(MemorySegment x0) { + var mh$ = fclose.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("renamex_np", x0, x1, x2); + traceDowncall("fclose", x0); } - return (int)mh$.invokeExact(x0, x1, x2); + return (int)mh$.invokeExact(x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class renameatx_np { + private static class feof { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_INT, - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_INT + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("renameatx_np"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("feof"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4387,197 +4130,115 @@ private static class renameatx_np { /** * Function descriptor for: * {@snippet lang=c : - * int renameatx_np(int, const char *, int, const char *, unsigned int) + * int feof(FILE *) * } */ - public static FunctionDescriptor renameatx_np$descriptor() { - return renameatx_np.DESC; + public static FunctionDescriptor feof$descriptor() { + return feof.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int renameatx_np(int, const char *, int, const char *, unsigned int) + * int feof(FILE *) * } */ - public static MethodHandle renameatx_np$handle() { - return renameatx_np.HANDLE; + public static MethodHandle feof$handle() { + return feof.HANDLE; } /** * Address for: * {@snippet lang=c : - * int renameatx_np(int, const char *, int, const char *, unsigned int) + * int feof(FILE *) * } */ - public static MemorySegment renameatx_np$address() { - return renameatx_np.ADDR; + public static MemorySegment feof$address() { + return feof.ADDR; } /** * {@snippet lang=c : - * int renameatx_np(int, const char *, int, const char *, unsigned int) + * int feof(FILE *) * } */ - public static int renameatx_np(int x0, MemorySegment x1, int x2, MemorySegment x3, int x4) { - var mh$ = renameatx_np.HANDLE; + public static int feof(MemorySegment x0) { + var mh$ = feof.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("renameatx_np", x0, x1, x2, x3, x4); + traceDowncall("feof", x0); } - return (int)mh$.invokeExact(x0, x1, x2, x3, x4); + return (int)mh$.invokeExact(x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - /** - * {@snippet lang=c : - * typedef __darwin_off_t fpos_t - * } - */ - public static final OfLong fpos_t = somelib_h.C_LONG_LONG; - private static class __stdinp$constants { - public static final AddressLayout LAYOUT = somelib_h.C_POINTER; - public static final MemorySegment SEGMENT = somelib_h.findOrThrow("__stdinp").reinterpret(LAYOUT.byteSize()); + private static class ferror { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("ferror"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } /** - * Layout for variable: + * Function descriptor for: * {@snippet lang=c : - * extern FILE *__stdinp + * int ferror(FILE *) * } */ - public static AddressLayout __stdinp$layout() { - return __stdinp$constants.LAYOUT; + public static FunctionDescriptor ferror$descriptor() { + return ferror.DESC; } /** - * Segment for variable: + * Downcall method handle for: * {@snippet lang=c : - * extern FILE *__stdinp + * int ferror(FILE *) * } */ - public static MemorySegment __stdinp$segment() { - return __stdinp$constants.SEGMENT; + public static MethodHandle ferror$handle() { + return ferror.HANDLE; } /** - * Getter for variable: + * Address for: * {@snippet lang=c : - * extern FILE *__stdinp + * int ferror(FILE *) * } */ - public static MemorySegment __stdinp() { - return __stdinp$constants.SEGMENT.get(__stdinp$constants.LAYOUT, 0L); + public static MemorySegment ferror$address() { + return ferror.ADDR; } /** - * Setter for variable: * {@snippet lang=c : - * extern FILE *__stdinp + * int ferror(FILE *) * } */ - public static void __stdinp(MemorySegment varValue) { - __stdinp$constants.SEGMENT.set(__stdinp$constants.LAYOUT, 0L, varValue); - } - - private static class __stdoutp$constants { - public static final AddressLayout LAYOUT = somelib_h.C_POINTER; - public static final MemorySegment SEGMENT = somelib_h.findOrThrow("__stdoutp").reinterpret(LAYOUT.byteSize()); - } - - /** - * Layout for variable: - * {@snippet lang=c : - * extern FILE *__stdoutp - * } - */ - public static AddressLayout __stdoutp$layout() { - return __stdoutp$constants.LAYOUT; - } - - /** - * Segment for variable: - * {@snippet lang=c : - * extern FILE *__stdoutp - * } - */ - public static MemorySegment __stdoutp$segment() { - return __stdoutp$constants.SEGMENT; - } - - /** - * Getter for variable: - * {@snippet lang=c : - * extern FILE *__stdoutp - * } - */ - public static MemorySegment __stdoutp() { - return __stdoutp$constants.SEGMENT.get(__stdoutp$constants.LAYOUT, 0L); - } - - /** - * Setter for variable: - * {@snippet lang=c : - * extern FILE *__stdoutp - * } - */ - public static void __stdoutp(MemorySegment varValue) { - __stdoutp$constants.SEGMENT.set(__stdoutp$constants.LAYOUT, 0L, varValue); - } - - private static class __stderrp$constants { - public static final AddressLayout LAYOUT = somelib_h.C_POINTER; - public static final MemorySegment SEGMENT = somelib_h.findOrThrow("__stderrp").reinterpret(LAYOUT.byteSize()); - } - - /** - * Layout for variable: - * {@snippet lang=c : - * extern FILE *__stderrp - * } - */ - public static AddressLayout __stderrp$layout() { - return __stderrp$constants.LAYOUT; - } - - /** - * Segment for variable: - * {@snippet lang=c : - * extern FILE *__stderrp - * } - */ - public static MemorySegment __stderrp$segment() { - return __stderrp$constants.SEGMENT; - } - - /** - * Getter for variable: - * {@snippet lang=c : - * extern FILE *__stderrp - * } - */ - public static MemorySegment __stderrp() { - return __stderrp$constants.SEGMENT.get(__stderrp$constants.LAYOUT, 0L); - } - - /** - * Setter for variable: - * {@snippet lang=c : - * extern FILE *__stderrp - * } - */ - public static void __stderrp(MemorySegment varValue) { - __stderrp$constants.SEGMENT.set(__stderrp$constants.LAYOUT, 0L, varValue); + public static int ferror(MemorySegment x0) { + var mh$ = ferror.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("ferror", x0); + } + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } } - private static class clearerr { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class fflush { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("clearerr"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fflush"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4585,57 +4246,57 @@ private static class clearerr { /** * Function descriptor for: * {@snippet lang=c : - * void clearerr(FILE *) + * int fflush(FILE *) * } */ - public static FunctionDescriptor clearerr$descriptor() { - return clearerr.DESC; + public static FunctionDescriptor fflush$descriptor() { + return fflush.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void clearerr(FILE *) + * int fflush(FILE *) * } */ - public static MethodHandle clearerr$handle() { - return clearerr.HANDLE; + public static MethodHandle fflush$handle() { + return fflush.HANDLE; } /** * Address for: * {@snippet lang=c : - * void clearerr(FILE *) + * int fflush(FILE *) * } */ - public static MemorySegment clearerr$address() { - return clearerr.ADDR; + public static MemorySegment fflush$address() { + return fflush.ADDR; } /** * {@snippet lang=c : - * void clearerr(FILE *) + * int fflush(FILE *) * } */ - public static void clearerr(MemorySegment x0) { - var mh$ = clearerr.HANDLE; + public static int fflush(MemorySegment x0) { + var mh$ = fflush.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("clearerr", x0); + traceDowncall("fflush", x0); } - mh$.invokeExact(x0); + return (int)mh$.invokeExact(x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class fclose { + private static class fgetc { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_INT, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("fclose"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fgetc"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4643,43 +4304,43 @@ private static class fclose { /** * Function descriptor for: * {@snippet lang=c : - * int fclose(FILE *) + * int fgetc(FILE *) * } */ - public static FunctionDescriptor fclose$descriptor() { - return fclose.DESC; + public static FunctionDescriptor fgetc$descriptor() { + return fgetc.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int fclose(FILE *) + * int fgetc(FILE *) * } */ - public static MethodHandle fclose$handle() { - return fclose.HANDLE; + public static MethodHandle fgetc$handle() { + return fgetc.HANDLE; } /** * Address for: * {@snippet lang=c : - * int fclose(FILE *) + * int fgetc(FILE *) * } */ - public static MemorySegment fclose$address() { - return fclose.ADDR; + public static MemorySegment fgetc$address() { + return fgetc.ADDR; } /** * {@snippet lang=c : - * int fclose(FILE *) + * int fgetc(FILE *) * } */ - public static int fclose(MemorySegment x0) { - var mh$ = fclose.HANDLE; + public static int fgetc(MemorySegment x0) { + var mh$ = fgetc.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("fclose", x0); + traceDowncall("fgetc", x0); } return (int)mh$.invokeExact(x0); } catch (Throwable ex$) { @@ -4687,13 +4348,14 @@ public static int fclose(MemorySegment x0) { } } - private static class feof { + private static class fgetpos { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_INT, + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("feof"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fgetpos"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4701,57 +4363,59 @@ private static class feof { /** * Function descriptor for: * {@snippet lang=c : - * int feof(FILE *) + * int fgetpos(FILE *restrict, fpos_t *) * } */ - public static FunctionDescriptor feof$descriptor() { - return feof.DESC; + public static FunctionDescriptor fgetpos$descriptor() { + return fgetpos.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int feof(FILE *) + * int fgetpos(FILE *restrict, fpos_t *) * } */ - public static MethodHandle feof$handle() { - return feof.HANDLE; + public static MethodHandle fgetpos$handle() { + return fgetpos.HANDLE; } /** * Address for: * {@snippet lang=c : - * int feof(FILE *) + * int fgetpos(FILE *restrict, fpos_t *) * } */ - public static MemorySegment feof$address() { - return feof.ADDR; + public static MemorySegment fgetpos$address() { + return fgetpos.ADDR; } /** * {@snippet lang=c : - * int feof(FILE *) + * int fgetpos(FILE *restrict, fpos_t *) * } */ - public static int feof(MemorySegment x0) { - var mh$ = feof.HANDLE; + public static int fgetpos(MemorySegment x0, MemorySegment x1) { + var mh$ = fgetpos.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("feof", x0); + traceDowncall("fgetpos", x0, x1); } - return (int)mh$.invokeExact(x0); + return (int)mh$.invokeExact(x0, x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class ferror { + private static class fgets { public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, somelib_h.C_INT, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("ferror"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fgets"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4759,57 +4423,58 @@ private static class ferror { /** * Function descriptor for: * {@snippet lang=c : - * int ferror(FILE *) + * char *fgets(char *restrict, int, FILE *) * } */ - public static FunctionDescriptor ferror$descriptor() { - return ferror.DESC; + public static FunctionDescriptor fgets$descriptor() { + return fgets.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int ferror(FILE *) + * char *fgets(char *restrict, int, FILE *) * } */ - public static MethodHandle ferror$handle() { - return ferror.HANDLE; + public static MethodHandle fgets$handle() { + return fgets.HANDLE; } /** * Address for: * {@snippet lang=c : - * int ferror(FILE *) + * char *fgets(char *restrict, int, FILE *) * } */ - public static MemorySegment ferror$address() { - return ferror.ADDR; + public static MemorySegment fgets$address() { + return fgets.ADDR; } /** * {@snippet lang=c : - * int ferror(FILE *) + * char *fgets(char *restrict, int, FILE *) * } */ - public static int ferror(MemorySegment x0) { - var mh$ = ferror.HANDLE; + public static MemorySegment fgets(MemorySegment x0, int x1, MemorySegment x2) { + var mh$ = fgets.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("ferror", x0); + traceDowncall("fgets", x0, x1, x2); } - return (int)mh$.invokeExact(x0); + return (MemorySegment)mh$.invokeExact(x0, x1, x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class fflush { + private static class fopen { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("fflush"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fopen"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4817,272 +4482,36 @@ private static class fflush { /** * Function descriptor for: * {@snippet lang=c : - * int fflush(FILE *) + * FILE *fopen(const char *restrict __filename, const char *restrict __mode) * } */ - public static FunctionDescriptor fflush$descriptor() { - return fflush.DESC; + public static FunctionDescriptor fopen$descriptor() { + return fopen.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int fflush(FILE *) + * FILE *fopen(const char *restrict __filename, const char *restrict __mode) * } */ - public static MethodHandle fflush$handle() { - return fflush.HANDLE; + public static MethodHandle fopen$handle() { + return fopen.HANDLE; } /** * Address for: * {@snippet lang=c : - * int fflush(FILE *) + * FILE *fopen(const char *restrict __filename, const char *restrict __mode) * } */ - public static MemorySegment fflush$address() { - return fflush.ADDR; + public static MemorySegment fopen$address() { + return fopen.ADDR; } /** * {@snippet lang=c : - * int fflush(FILE *) - * } - */ - public static int fflush(MemorySegment x0) { - var mh$ = fflush.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("fflush", x0); - } - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class fgetc { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("fgetc"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int fgetc(FILE *) - * } - */ - public static FunctionDescriptor fgetc$descriptor() { - return fgetc.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int fgetc(FILE *) - * } - */ - public static MethodHandle fgetc$handle() { - return fgetc.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int fgetc(FILE *) - * } - */ - public static MemorySegment fgetc$address() { - return fgetc.ADDR; - } - - /** - * {@snippet lang=c : - * int fgetc(FILE *) - * } - */ - public static int fgetc(MemorySegment x0) { - var mh$ = fgetc.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("fgetc", x0); - } - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class fgetpos { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("fgetpos"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int fgetpos(FILE *restrict, fpos_t *) - * } - */ - public static FunctionDescriptor fgetpos$descriptor() { - return fgetpos.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int fgetpos(FILE *restrict, fpos_t *) - * } - */ - public static MethodHandle fgetpos$handle() { - return fgetpos.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int fgetpos(FILE *restrict, fpos_t *) - * } - */ - public static MemorySegment fgetpos$address() { - return fgetpos.ADDR; - } - - /** - * {@snippet lang=c : - * int fgetpos(FILE *restrict, fpos_t *) - * } - */ - public static int fgetpos(MemorySegment x0, MemorySegment x1) { - var mh$ = fgetpos.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("fgetpos", x0, x1); - } - return (int)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class fgets { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("fgets"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * char *fgets(char *restrict, int, FILE *) - * } - */ - public static FunctionDescriptor fgets$descriptor() { - return fgets.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * char *fgets(char *restrict, int, FILE *) - * } - */ - public static MethodHandle fgets$handle() { - return fgets.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * char *fgets(char *restrict, int, FILE *) - * } - */ - public static MemorySegment fgets$address() { - return fgets.ADDR; - } - - /** - * {@snippet lang=c : - * char *fgets(char *restrict, int, FILE *) - * } - */ - public static MemorySegment fgets(MemorySegment x0, int x1, MemorySegment x2) { - var mh$ = fgets.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("fgets", x0, x1, x2); - } - return (MemorySegment)mh$.invokeExact(x0, x1, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class fopen { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("fopen"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * FILE *fopen(const char *restrict __filename, const char *restrict __mode) - * } - */ - public static FunctionDescriptor fopen$descriptor() { - return fopen.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * FILE *fopen(const char *restrict __filename, const char *restrict __mode) - * } - */ - public static MethodHandle fopen$handle() { - return fopen.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * FILE *fopen(const char *restrict __filename, const char *restrict __mode) - * } - */ - public static MemorySegment fopen$address() { - return fopen.ADDR; - } - - /** - * {@snippet lang=c : - * FILE *fopen(const char *restrict __filename, const char *restrict __mode) + * FILE *fopen(const char *restrict __filename, const char *restrict __mode) * } */ public static MemorySegment fopen(MemorySegment __filename, MemorySegment __mode) { @@ -9838,73 +9267,412 @@ public static int __vsnprintf_chk(MemorySegment x0, long x1, int x2, long x3, Me throw new AssertionError("should not reach here", ex$); } } - - private static class Foo_new { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_new"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - /** - * Function descriptor for: * {@snippet lang=c : - * Foo *Foo_new(const char *x_data, size_t x_len) + * typedef unsigned char uint8_t * } */ - public static FunctionDescriptor Foo_new$descriptor() { - return Foo_new.DESC; - } - + public static final OfByte uint8_t = somelib_h.C_CHAR; /** - * Downcall method handle for: * {@snippet lang=c : - * Foo *Foo_new(const char *x_data, size_t x_len) + * typedef unsigned short uint16_t + * } + */ + public static final OfShort uint16_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef unsigned int uint32_t + * } + */ + public static final OfInt uint32_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef unsigned long long uint64_t + * } + */ + public static final OfLong uint64_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef int8_t int_least8_t + * } + */ + public static final OfByte int_least8_t = somelib_h.C_CHAR; + /** + * {@snippet lang=c : + * typedef int16_t int_least16_t + * } + */ + public static final OfShort int_least16_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef int32_t int_least32_t + * } + */ + public static final OfInt int_least32_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef int64_t int_least64_t + * } + */ + public static final OfLong int_least64_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef uint8_t uint_least8_t + * } + */ + public static final OfByte uint_least8_t = somelib_h.C_CHAR; + /** + * {@snippet lang=c : + * typedef uint16_t uint_least16_t + * } + */ + public static final OfShort uint_least16_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef uint32_t uint_least32_t + * } + */ + public static final OfInt uint_least32_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef uint64_t uint_least64_t + * } + */ + public static final OfLong uint_least64_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef int8_t int_fast8_t + * } + */ + public static final OfByte int_fast8_t = somelib_h.C_CHAR; + /** + * {@snippet lang=c : + * typedef int16_t int_fast16_t + * } + */ + public static final OfShort int_fast16_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef int32_t int_fast32_t + * } + */ + public static final OfInt int_fast32_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef int64_t int_fast64_t + * } + */ + public static final OfLong int_fast64_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef uint8_t uint_fast8_t + * } + */ + public static final OfByte uint_fast8_t = somelib_h.C_CHAR; + /** + * {@snippet lang=c : + * typedef uint16_t uint_fast16_t + * } + */ + public static final OfShort uint_fast16_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef uint32_t uint_fast32_t + * } + */ + public static final OfInt uint_fast32_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef uint64_t uint_fast64_t + * } + */ + public static final OfLong uint_fast64_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef long intmax_t + * } + */ + public static final OfLong intmax_t = somelib_h.C_LONG; + /** + * {@snippet lang=c : + * typedef unsigned long uintmax_t + * } + */ + public static final OfLong uintmax_t = somelib_h.C_LONG; + /** + * {@snippet lang=c : + * typedef long ptrdiff_t + * } + */ + public static final OfLong ptrdiff_t = somelib_h.C_LONG; + /** + * {@snippet lang=c : + * typedef unsigned long rsize_t + * } + */ + public static final OfLong rsize_t = somelib_h.C_LONG; + /** + * {@snippet lang=c : + * typedef int wchar_t + * } + */ + public static final OfInt wchar_t = somelib_h.C_INT; + + private static class __assert_rtn { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("__assert_rtn"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void __assert_rtn(const char *, const char *, int, const char *) + * } + */ + public static FunctionDescriptor __assert_rtn$descriptor() { + return __assert_rtn.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void __assert_rtn(const char *, const char *, int, const char *) + * } + */ + public static MethodHandle __assert_rtn$handle() { + return __assert_rtn.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void __assert_rtn(const char *, const char *, int, const char *) + * } + */ + public static MemorySegment __assert_rtn$address() { + return __assert_rtn.ADDR; + } + + /** + * {@snippet lang=c : + * void __assert_rtn(const char *, const char *, int, const char *) + * } + */ + public static void __assert_rtn(MemorySegment x0, MemorySegment x1, int x2, MemorySegment x3) { + var mh$ = __assert_rtn.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("__assert_rtn", x0, x1, x2, x3); + } + mh$.invokeExact(x0, x1, x2, x3); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + /** + * {@snippet lang=c : + * typedef uint_least16_t char16_t + * } + */ + public static final OfShort char16_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef uint_least32_t char32_t + * } + */ + public static final OfInt char32_t = somelib_h.C_INT; + + private static class diplomat_is_str { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_BOOL, + somelib_h.C_POINTER, + somelib_h.C_LONG + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_is_str"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * bool diplomat_is_str(const char *buf, size_t len) + * } + */ + public static FunctionDescriptor diplomat_is_str$descriptor() { + return diplomat_is_str.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * bool diplomat_is_str(const char *buf, size_t len) + * } + */ + public static MethodHandle diplomat_is_str$handle() { + return diplomat_is_str.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * bool diplomat_is_str(const char *buf, size_t len) + * } + */ + public static MemorySegment diplomat_is_str$address() { + return diplomat_is_str.ADDR; + } + + /** + * {@snippet lang=c : + * bool diplomat_is_str(const char *buf, size_t len) + * } + */ + public static boolean diplomat_is_str(MemorySegment buf, long len) { + var mh$ = diplomat_is_str.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("diplomat_is_str", buf, len); + } + return (boolean)mh$.invokeExact(buf, len); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class diplomat_simple_write { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + DiplomatWrite.layout(), + somelib_h.C_POINTER, + somelib_h.C_LONG + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_simple_write"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) + * } + */ + public static FunctionDescriptor diplomat_simple_write$descriptor() { + return diplomat_simple_write.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) + * } + */ + public static MethodHandle diplomat_simple_write$handle() { + return diplomat_simple_write.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) + * } + */ + public static MemorySegment diplomat_simple_write$address() { + return diplomat_simple_write.ADDR; + } + + /** + * {@snippet lang=c : + * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) + * } + */ + public static MemorySegment diplomat_simple_write(SegmentAllocator allocator, MemorySegment buf, long buf_size) { + var mh$ = diplomat_simple_write.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("diplomat_simple_write", allocator, buf, buf_size); + } + return (MemorySegment)mh$.invokeExact(allocator, buf, buf_size); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class diplomat_buffer_write_create { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_LONG + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_create"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * DiplomatWrite *diplomat_buffer_write_create(size_t cap) * } */ - public static MethodHandle Foo_new$handle() { - return Foo_new.HANDLE; + public static FunctionDescriptor diplomat_buffer_write_create$descriptor() { + return diplomat_buffer_write_create.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * DiplomatWrite *diplomat_buffer_write_create(size_t cap) + * } + */ + public static MethodHandle diplomat_buffer_write_create$handle() { + return diplomat_buffer_write_create.HANDLE; } /** * Address for: * {@snippet lang=c : - * Foo *Foo_new(const char *x_data, size_t x_len) + * DiplomatWrite *diplomat_buffer_write_create(size_t cap) * } */ - public static MemorySegment Foo_new$address() { - return Foo_new.ADDR; + public static MemorySegment diplomat_buffer_write_create$address() { + return diplomat_buffer_write_create.ADDR; } /** * {@snippet lang=c : - * Foo *Foo_new(const char *x_data, size_t x_len) + * DiplomatWrite *diplomat_buffer_write_create(size_t cap) * } */ - public static MemorySegment Foo_new(MemorySegment x_data, long x_len) { - var mh$ = Foo_new.HANDLE; + public static MemorySegment diplomat_buffer_write_create(long cap) { + var mh$ = diplomat_buffer_write_create.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Foo_new", x_data, x_len); + traceDowncall("diplomat_buffer_write_create", cap); } - return (MemorySegment)mh$.invokeExact(x_data, x_len); + return (MemorySegment)mh$.invokeExact(cap); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Foo_get_bar { + private static class diplomat_buffer_write_get_bytes { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_get_bar"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_get_bytes"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -9912,43 +9680,216 @@ private static class Foo_get_bar { /** * Function descriptor for: * {@snippet lang=c : - * Bar *Foo_get_bar(const Foo *self) + * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) * } */ - public static FunctionDescriptor Foo_get_bar$descriptor() { - return Foo_get_bar.DESC; + public static FunctionDescriptor diplomat_buffer_write_get_bytes$descriptor() { + return diplomat_buffer_write_get_bytes.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Bar *Foo_get_bar(const Foo *self) + * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) * } */ - public static MethodHandle Foo_get_bar$handle() { - return Foo_get_bar.HANDLE; + public static MethodHandle diplomat_buffer_write_get_bytes$handle() { + return diplomat_buffer_write_get_bytes.HANDLE; } /** * Address for: * {@snippet lang=c : - * Bar *Foo_get_bar(const Foo *self) + * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) * } */ - public static MemorySegment Foo_get_bar$address() { - return Foo_get_bar.ADDR; + public static MemorySegment diplomat_buffer_write_get_bytes$address() { + return diplomat_buffer_write_get_bytes.ADDR; } /** * {@snippet lang=c : - * Bar *Foo_get_bar(const Foo *self) + * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) * } */ - public static MemorySegment Foo_get_bar(MemorySegment self) { - var mh$ = Foo_get_bar.HANDLE; + public static MemorySegment diplomat_buffer_write_get_bytes(MemorySegment t) { + var mh$ = diplomat_buffer_write_get_bytes.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Foo_get_bar", self); + traceDowncall("diplomat_buffer_write_get_bytes", t); + } + return (MemorySegment)mh$.invokeExact(t); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class diplomat_buffer_write_len { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_LONG, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_len"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * size_t diplomat_buffer_write_len(DiplomatWrite *t) + * } + */ + public static FunctionDescriptor diplomat_buffer_write_len$descriptor() { + return diplomat_buffer_write_len.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * size_t diplomat_buffer_write_len(DiplomatWrite *t) + * } + */ + public static MethodHandle diplomat_buffer_write_len$handle() { + return diplomat_buffer_write_len.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * size_t diplomat_buffer_write_len(DiplomatWrite *t) + * } + */ + public static MemorySegment diplomat_buffer_write_len$address() { + return diplomat_buffer_write_len.ADDR; + } + + /** + * {@snippet lang=c : + * size_t diplomat_buffer_write_len(DiplomatWrite *t) + * } + */ + public static long diplomat_buffer_write_len(MemorySegment t) { + var mh$ = diplomat_buffer_write_len.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("diplomat_buffer_write_len", t); + } + return (long)mh$.invokeExact(t); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class diplomat_buffer_write_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_destroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void diplomat_buffer_write_destroy(DiplomatWrite *t) + * } + */ + public static FunctionDescriptor diplomat_buffer_write_destroy$descriptor() { + return diplomat_buffer_write_destroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void diplomat_buffer_write_destroy(DiplomatWrite *t) + * } + */ + public static MethodHandle diplomat_buffer_write_destroy$handle() { + return diplomat_buffer_write_destroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void diplomat_buffer_write_destroy(DiplomatWrite *t) + * } + */ + public static MemorySegment diplomat_buffer_write_destroy$address() { + return diplomat_buffer_write_destroy.ADDR; + } + + /** + * {@snippet lang=c : + * void diplomat_buffer_write_destroy(DiplomatWrite *t) + * } + */ + public static void diplomat_buffer_write_destroy(MemorySegment t) { + var mh$ = diplomat_buffer_write_destroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("diplomat_buffer_write_destroy", t); + } + mh$.invokeExact(t); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class Bar_foo { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("Bar_foo"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * const Foo *Bar_foo(const Bar *self) + * } + */ + public static FunctionDescriptor Bar_foo$descriptor() { + return Bar_foo.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * const Foo *Bar_foo(const Bar *self) + * } + */ + public static MethodHandle Bar_foo$handle() { + return Bar_foo.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * const Foo *Bar_foo(const Bar *self) + * } + */ + public static MemorySegment Bar_foo$address() { + return Bar_foo.ADDR; + } + + /** + * {@snippet lang=c : + * const Foo *Bar_foo(const Bar *self) + * } + */ + public static MemorySegment Bar_foo(MemorySegment self) { + var mh$ = Bar_foo.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Bar_foo", self); } return (MemorySegment)mh$.invokeExact(self); } catch (Throwable ex$) { @@ -9956,14 +9897,12 @@ public static MemorySegment Foo_get_bar(MemorySegment self) { } } - private static class Foo_new_static { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG + private static class Bar_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_new_static"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Bar_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -9971,57 +9910,61 @@ private static class Foo_new_static { /** * Function descriptor for: * {@snippet lang=c : - * Foo *Foo_new_static(const char *x_data, size_t x_len) + * void Bar_destroy(Bar *self) * } */ - public static FunctionDescriptor Foo_new_static$descriptor() { - return Foo_new_static.DESC; + public static FunctionDescriptor Bar_destroy$descriptor() { + return Bar_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Foo *Foo_new_static(const char *x_data, size_t x_len) + * void Bar_destroy(Bar *self) * } */ - public static MethodHandle Foo_new_static$handle() { - return Foo_new_static.HANDLE; + public static MethodHandle Bar_destroy$handle() { + return Bar_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * Foo *Foo_new_static(const char *x_data, size_t x_len) + * void Bar_destroy(Bar *self) * } */ - public static MemorySegment Foo_new_static$address() { - return Foo_new_static.ADDR; + public static MemorySegment Bar_destroy$address() { + return Bar_destroy.ADDR; } /** * {@snippet lang=c : - * Foo *Foo_new_static(const char *x_data, size_t x_len) + * void Bar_destroy(Bar *self) * } */ - public static MemorySegment Foo_new_static(MemorySegment x_data, long x_len) { - var mh$ = Foo_new_static.HANDLE; + public static void Bar_destroy(MemorySegment self) { + var mh$ = Bar_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Foo_new_static", x_data, x_len); + traceDowncall("Bar_destroy", self); } - return (MemorySegment)mh$.invokeExact(x_data, x_len); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Foo_as_returning { + private static class BorrowedFields_from_bar_and_strings { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - BorrowedFieldsReturning.layout(), - somelib_h.C_POINTER + BorrowedFields.layout(), + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG, + somelib_h.C_POINTER, + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_as_returning"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("BorrowedFields_from_bar_and_strings"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10029,57 +9972,55 @@ private static class Foo_as_returning { /** * Function descriptor for: * {@snippet lang=c : - * BorrowedFieldsReturning Foo_as_returning(const Foo *self) + * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, const char16_t *dstr16_data, size_t dstr16_len, const char *utf8_str_data, size_t utf8_str_len) * } */ - public static FunctionDescriptor Foo_as_returning$descriptor() { - return Foo_as_returning.DESC; + public static FunctionDescriptor BorrowedFields_from_bar_and_strings$descriptor() { + return BorrowedFields_from_bar_and_strings.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * BorrowedFieldsReturning Foo_as_returning(const Foo *self) + * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, const char16_t *dstr16_data, size_t dstr16_len, const char *utf8_str_data, size_t utf8_str_len) * } */ - public static MethodHandle Foo_as_returning$handle() { - return Foo_as_returning.HANDLE; + public static MethodHandle BorrowedFields_from_bar_and_strings$handle() { + return BorrowedFields_from_bar_and_strings.HANDLE; } /** * Address for: * {@snippet lang=c : - * BorrowedFieldsReturning Foo_as_returning(const Foo *self) + * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, const char16_t *dstr16_data, size_t dstr16_len, const char *utf8_str_data, size_t utf8_str_len) * } */ - public static MemorySegment Foo_as_returning$address() { - return Foo_as_returning.ADDR; + public static MemorySegment BorrowedFields_from_bar_and_strings$address() { + return BorrowedFields_from_bar_and_strings.ADDR; } /** * {@snippet lang=c : - * BorrowedFieldsReturning Foo_as_returning(const Foo *self) + * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, const char16_t *dstr16_data, size_t dstr16_len, const char *utf8_str_data, size_t utf8_str_len) * } */ - public static MemorySegment Foo_as_returning(SegmentAllocator allocator, MemorySegment self) { - var mh$ = Foo_as_returning.HANDLE; + public static MemorySegment BorrowedFields_from_bar_and_strings(SegmentAllocator allocator, MemorySegment bar, MemorySegment dstr16_data, long dstr16_len, MemorySegment utf8_str_data, long utf8_str_len) { + var mh$ = BorrowedFields_from_bar_and_strings.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Foo_as_returning", allocator, self); + traceDowncall("BorrowedFields_from_bar_and_strings", allocator, bar, dstr16_data, dstr16_len, utf8_str_data, utf8_str_len); } - return (MemorySegment)mh$.invokeExact(allocator, self); + return (MemorySegment)mh$.invokeExact(allocator, bar, dstr16_data, dstr16_len, utf8_str_data, utf8_str_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Foo_extract_from_fields { + private static class CyclicStructA_get_b { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - BorrowedFields.layout() - ); + CyclicStructB.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_extract_from_fields"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("CyclicStructA_get_b"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10087,59 +10028,93 @@ private static class Foo_extract_from_fields { /** * Function descriptor for: * {@snippet lang=c : - * Foo *Foo_extract_from_fields(BorrowedFields fields) + * CyclicStructB CyclicStructA_get_b() * } */ - public static FunctionDescriptor Foo_extract_from_fields$descriptor() { - return Foo_extract_from_fields.DESC; + public static FunctionDescriptor CyclicStructA_get_b$descriptor() { + return CyclicStructA_get_b.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Foo *Foo_extract_from_fields(BorrowedFields fields) + * CyclicStructB CyclicStructA_get_b() * } */ - public static MethodHandle Foo_extract_from_fields$handle() { - return Foo_extract_from_fields.HANDLE; + public static MethodHandle CyclicStructA_get_b$handle() { + return CyclicStructA_get_b.HANDLE; } /** * Address for: * {@snippet lang=c : - * Foo *Foo_extract_from_fields(BorrowedFields fields) + * CyclicStructB CyclicStructA_get_b() * } */ - public static MemorySegment Foo_extract_from_fields$address() { - return Foo_extract_from_fields.ADDR; + public static MemorySegment CyclicStructA_get_b$address() { + return CyclicStructA_get_b.ADDR; } /** * {@snippet lang=c : - * Foo *Foo_extract_from_fields(BorrowedFields fields) + * CyclicStructB CyclicStructA_get_b() * } */ - public static MemorySegment Foo_extract_from_fields(MemorySegment fields) { - var mh$ = Foo_extract_from_fields.HANDLE; + public static MemorySegment CyclicStructA_get_b(SegmentAllocator allocator) { + var mh$ = CyclicStructA_get_b.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Foo_extract_from_fields", fields); + traceDowncall("CyclicStructA_get_b", allocator); } - return (MemorySegment)mh$.invokeExact(fields); + return (MemorySegment)mh$.invokeExact(allocator); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } + private static final int UnimportedEnum_A = (int)0L; + /** + * {@snippet lang=c : + * enum UnimportedEnum.UnimportedEnum_A = 0 + * } + */ + public static int UnimportedEnum_A() { + return UnimportedEnum_A; + } + private static final int UnimportedEnum_B = (int)1L; + /** + * {@snippet lang=c : + * enum UnimportedEnum.UnimportedEnum_B = 1 + * } + */ + public static int UnimportedEnum_B() { + return UnimportedEnum_B; + } + private static final int UnimportedEnum_C = (int)2L; + /** + * {@snippet lang=c : + * enum UnimportedEnum.UnimportedEnum_C = 2 + * } + */ + public static int UnimportedEnum_C() { + return UnimportedEnum_C; + } - private static class Foo_extract_from_bounds { + private static class NestedBorrowedFields_from_bar_and_foo_and_strings { public static final FunctionDescriptor DESC = FunctionDescriptor.of( + NestedBorrowedFields.layout(), somelib_h.C_POINTER, - BorrowedFieldsWithBounds.layout(), + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG, + somelib_h.C_POINTER, + somelib_h.C_LONG, + somelib_h.C_POINTER, + somelib_h.C_LONG, somelib_h.C_POINTER, somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_extract_from_bounds"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("NestedBorrowedFields_from_bar_and_foo_and_strings"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10147,56 +10122,74 @@ private static class Foo_extract_from_bounds { /** * Function descriptor for: * {@snippet lang=c : - * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, const char *another_string_data, size_t another_string_len) + * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char16_t *dstr16_z_data, size_t dstr16_z_len, const char *utf8_str_y_data, size_t utf8_str_y_len, const char *utf8_str_z_data, size_t utf8_str_z_len) * } */ - public static FunctionDescriptor Foo_extract_from_bounds$descriptor() { - return Foo_extract_from_bounds.DESC; + public static FunctionDescriptor NestedBorrowedFields_from_bar_and_foo_and_strings$descriptor() { + return NestedBorrowedFields_from_bar_and_foo_and_strings.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, const char *another_string_data, size_t another_string_len) + * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char16_t *dstr16_z_data, size_t dstr16_z_len, const char *utf8_str_y_data, size_t utf8_str_y_len, const char *utf8_str_z_data, size_t utf8_str_z_len) * } */ - public static MethodHandle Foo_extract_from_bounds$handle() { - return Foo_extract_from_bounds.HANDLE; + public static MethodHandle NestedBorrowedFields_from_bar_and_foo_and_strings$handle() { + return NestedBorrowedFields_from_bar_and_foo_and_strings.HANDLE; } /** * Address for: * {@snippet lang=c : - * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, const char *another_string_data, size_t another_string_len) + * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char16_t *dstr16_z_data, size_t dstr16_z_len, const char *utf8_str_y_data, size_t utf8_str_y_len, const char *utf8_str_z_data, size_t utf8_str_z_len) * } */ - public static MemorySegment Foo_extract_from_bounds$address() { - return Foo_extract_from_bounds.ADDR; + public static MemorySegment NestedBorrowedFields_from_bar_and_foo_and_strings$address() { + return NestedBorrowedFields_from_bar_and_foo_and_strings.ADDR; } /** * {@snippet lang=c : - * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, const char *another_string_data, size_t another_string_len) + * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char16_t *dstr16_z_data, size_t dstr16_z_len, const char *utf8_str_y_data, size_t utf8_str_y_len, const char *utf8_str_z_data, size_t utf8_str_z_len) * } */ - public static MemorySegment Foo_extract_from_bounds(MemorySegment bounds, MemorySegment another_string_data, long another_string_len) { - var mh$ = Foo_extract_from_bounds.HANDLE; + public static MemorySegment NestedBorrowedFields_from_bar_and_foo_and_strings(SegmentAllocator allocator, MemorySegment bar, MemorySegment foo, MemorySegment dstr16_x_data, long dstr16_x_len, MemorySegment dstr16_z_data, long dstr16_z_len, MemorySegment utf8_str_y_data, long utf8_str_y_len, MemorySegment utf8_str_z_data, long utf8_str_z_len) { + var mh$ = NestedBorrowedFields_from_bar_and_foo_and_strings.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Foo_extract_from_bounds", bounds, another_string_data, another_string_len); + traceDowncall("NestedBorrowedFields_from_bar_and_foo_and_strings", allocator, bar, foo, dstr16_x_data, dstr16_x_len, dstr16_z_data, dstr16_z_len, utf8_str_y_data, utf8_str_y_len, utf8_str_z_data, utf8_str_z_len); } - return (MemorySegment)mh$.invokeExact(bounds, another_string_data, another_string_len); + return (MemorySegment)mh$.invokeExact(allocator, bar, foo, dstr16_x_data, dstr16_x_len, dstr16_z_data, dstr16_z_len, utf8_str_y_data, utf8_str_y_len, utf8_str_z_data, utf8_str_z_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } + private static final int ErrorEnum_Foo = (int)0L; + /** + * {@snippet lang=c : + * enum ErrorEnum.ErrorEnum_Foo = 0 + * } + */ + public static int ErrorEnum_Foo() { + return ErrorEnum_Foo; + } + private static final int ErrorEnum_Bar = (int)1L; + /** + * {@snippet lang=c : + * enum ErrorEnum.ErrorEnum_Bar = 1 + * } + */ + public static int ErrorEnum_Bar() { + return ErrorEnum_Bar; + } - private static class Foo_destroy { + private static class RefListParameter_destroy { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("RefListParameter_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10204,43 +10197,43 @@ private static class Foo_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void Foo_destroy(Foo *self) + * void RefListParameter_destroy(RefListParameter *self) * } */ - public static FunctionDescriptor Foo_destroy$descriptor() { - return Foo_destroy.DESC; + public static FunctionDescriptor RefListParameter_destroy$descriptor() { + return RefListParameter_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Foo_destroy(Foo *self) + * void RefListParameter_destroy(RefListParameter *self) * } */ - public static MethodHandle Foo_destroy$handle() { - return Foo_destroy.HANDLE; + public static MethodHandle RefListParameter_destroy$handle() { + return RefListParameter_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Foo_destroy(Foo *self) + * void RefListParameter_destroy(RefListParameter *self) * } */ - public static MemorySegment Foo_destroy$address() { - return Foo_destroy.ADDR; + public static MemorySegment RefListParameter_destroy$address() { + return RefListParameter_destroy.ADDR; } /** * {@snippet lang=c : - * void Foo_destroy(Foo *self) + * void RefListParameter_destroy(RefListParameter *self) * } */ - public static void Foo_destroy(MemorySegment self) { - var mh$ = Foo_destroy.HANDLE; + public static void RefListParameter_destroy(MemorySegment self) { + var mh$ = RefListParameter_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Foo_destroy", self); + traceDowncall("RefListParameter_destroy", self); } mh$.invokeExact(self); } catch (Throwable ex$) { @@ -10248,11 +10241,14 @@ public static void Foo_destroy(MemorySegment self) { } } - private static class CyclicStructA_get_b { + private static class MyString_new { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - CyclicStructB.layout() ); + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG + ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("CyclicStructA_get_b"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10260,66 +10256,58 @@ private static class CyclicStructA_get_b { /** * Function descriptor for: * {@snippet lang=c : - * CyclicStructB CyclicStructA_get_b() + * MyString *MyString_new(const char *v_data, size_t v_len) * } */ - public static FunctionDescriptor CyclicStructA_get_b$descriptor() { - return CyclicStructA_get_b.DESC; + public static FunctionDescriptor MyString_new$descriptor() { + return MyString_new.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * CyclicStructB CyclicStructA_get_b() + * MyString *MyString_new(const char *v_data, size_t v_len) * } */ - public static MethodHandle CyclicStructA_get_b$handle() { - return CyclicStructA_get_b.HANDLE; + public static MethodHandle MyString_new$handle() { + return MyString_new.HANDLE; } /** * Address for: * {@snippet lang=c : - * CyclicStructB CyclicStructA_get_b() + * MyString *MyString_new(const char *v_data, size_t v_len) * } */ - public static MemorySegment CyclicStructA_get_b$address() { - return CyclicStructA_get_b.ADDR; + public static MemorySegment MyString_new$address() { + return MyString_new.ADDR; } /** * {@snippet lang=c : - * CyclicStructB CyclicStructA_get_b() + * MyString *MyString_new(const char *v_data, size_t v_len) * } */ - public static MemorySegment CyclicStructA_get_b(SegmentAllocator allocator) { - var mh$ = CyclicStructA_get_b.HANDLE; + public static MemorySegment MyString_new(MemorySegment v_data, long v_len) { + var mh$ = MyString_new.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("CyclicStructA_get_b", allocator); + traceDowncall("MyString_new", v_data, v_len); } - return (MemorySegment)mh$.invokeExact(allocator); + return (MemorySegment)mh$.invokeExact(v_data, v_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class NestedBorrowedFields_from_bar_and_foo_and_strings { + private static class MyString_new_unsafe { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - NestedBorrowedFields.layout(), - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG, - somelib_h.C_POINTER, - somelib_h.C_LONG, somelib_h.C_POINTER, - somelib_h.C_LONG, somelib_h.C_POINTER, somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("NestedBorrowedFields_from_bar_and_foo_and_strings"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new_unsafe"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10327,57 +10315,58 @@ private static class NestedBorrowedFields_from_bar_and_foo_and_strings { /** * Function descriptor for: * {@snippet lang=c : - * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char16_t *dstr16_z_data, size_t dstr16_z_len, const char *utf8_str_y_data, size_t utf8_str_y_len, const char *utf8_str_z_data, size_t utf8_str_z_len) + * MyString *MyString_new_unsafe(const char *v_data, size_t v_len) * } */ - public static FunctionDescriptor NestedBorrowedFields_from_bar_and_foo_and_strings$descriptor() { - return NestedBorrowedFields_from_bar_and_foo_and_strings.DESC; + public static FunctionDescriptor MyString_new_unsafe$descriptor() { + return MyString_new_unsafe.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char16_t *dstr16_z_data, size_t dstr16_z_len, const char *utf8_str_y_data, size_t utf8_str_y_len, const char *utf8_str_z_data, size_t utf8_str_z_len) + * MyString *MyString_new_unsafe(const char *v_data, size_t v_len) * } */ - public static MethodHandle NestedBorrowedFields_from_bar_and_foo_and_strings$handle() { - return NestedBorrowedFields_from_bar_and_foo_and_strings.HANDLE; + public static MethodHandle MyString_new_unsafe$handle() { + return MyString_new_unsafe.HANDLE; } /** * Address for: * {@snippet lang=c : - * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char16_t *dstr16_z_data, size_t dstr16_z_len, const char *utf8_str_y_data, size_t utf8_str_y_len, const char *utf8_str_z_data, size_t utf8_str_z_len) + * MyString *MyString_new_unsafe(const char *v_data, size_t v_len) * } */ - public static MemorySegment NestedBorrowedFields_from_bar_and_foo_and_strings$address() { - return NestedBorrowedFields_from_bar_and_foo_and_strings.ADDR; + public static MemorySegment MyString_new_unsafe$address() { + return MyString_new_unsafe.ADDR; } /** * {@snippet lang=c : - * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char16_t *dstr16_z_data, size_t dstr16_z_len, const char *utf8_str_y_data, size_t utf8_str_y_len, const char *utf8_str_z_data, size_t utf8_str_z_len) + * MyString *MyString_new_unsafe(const char *v_data, size_t v_len) * } */ - public static MemorySegment NestedBorrowedFields_from_bar_and_foo_and_strings(SegmentAllocator allocator, MemorySegment bar, MemorySegment foo, MemorySegment dstr16_x_data, long dstr16_x_len, MemorySegment dstr16_z_data, long dstr16_z_len, MemorySegment utf8_str_y_data, long utf8_str_y_len, MemorySegment utf8_str_z_data, long utf8_str_z_len) { - var mh$ = NestedBorrowedFields_from_bar_and_foo_and_strings.HANDLE; + public static MemorySegment MyString_new_unsafe(MemorySegment v_data, long v_len) { + var mh$ = MyString_new_unsafe.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("NestedBorrowedFields_from_bar_and_foo_and_strings", allocator, bar, foo, dstr16_x_data, dstr16_x_len, dstr16_z_data, dstr16_z_len, utf8_str_y_data, utf8_str_y_len, utf8_str_z_data, utf8_str_z_len); + traceDowncall("MyString_new_unsafe", v_data, v_len); } - return (MemorySegment)mh$.invokeExact(allocator, bar, foo, dstr16_x_data, dstr16_x_len, dstr16_z_data, dstr16_z_len, utf8_str_y_data, utf8_str_y_len, utf8_str_z_data, utf8_str_z_len); + return (MemorySegment)mh$.invokeExact(v_data, v_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Bar_foo { + private static class MyString_new_owned { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - somelib_h.C_POINTER + somelib_h.C_POINTER, + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Bar_foo"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new_owned"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10385,56 +10374,58 @@ private static class Bar_foo { /** * Function descriptor for: * {@snippet lang=c : - * const Foo *Bar_foo(const Bar *self) + * MyString *MyString_new_owned(const char *v_data, size_t v_len) * } */ - public static FunctionDescriptor Bar_foo$descriptor() { - return Bar_foo.DESC; + public static FunctionDescriptor MyString_new_owned$descriptor() { + return MyString_new_owned.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * const Foo *Bar_foo(const Bar *self) + * MyString *MyString_new_owned(const char *v_data, size_t v_len) * } */ - public static MethodHandle Bar_foo$handle() { - return Bar_foo.HANDLE; + public static MethodHandle MyString_new_owned$handle() { + return MyString_new_owned.HANDLE; } /** * Address for: * {@snippet lang=c : - * const Foo *Bar_foo(const Bar *self) + * MyString *MyString_new_owned(const char *v_data, size_t v_len) * } */ - public static MemorySegment Bar_foo$address() { - return Bar_foo.ADDR; + public static MemorySegment MyString_new_owned$address() { + return MyString_new_owned.ADDR; } /** * {@snippet lang=c : - * const Foo *Bar_foo(const Bar *self) + * MyString *MyString_new_owned(const char *v_data, size_t v_len) * } */ - public static MemorySegment Bar_foo(MemorySegment self) { - var mh$ = Bar_foo.HANDLE; + public static MemorySegment MyString_new_owned(MemorySegment v_data, long v_len) { + var mh$ = MyString_new_owned.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Bar_foo", self); + traceDowncall("MyString_new_owned", v_data, v_len); } - return (MemorySegment)mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(v_data, v_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Bar_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER + private static class MyString_new_from_first { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Bar_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new_from_first"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10442,57 +10433,58 @@ private static class Bar_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void Bar_destroy(Bar *self) + * MyString *MyString_new_from_first(DiplomatStringsView *v_data, size_t v_len) * } */ - public static FunctionDescriptor Bar_destroy$descriptor() { - return Bar_destroy.DESC; + public static FunctionDescriptor MyString_new_from_first$descriptor() { + return MyString_new_from_first.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Bar_destroy(Bar *self) + * MyString *MyString_new_from_first(DiplomatStringsView *v_data, size_t v_len) * } */ - public static MethodHandle Bar_destroy$handle() { - return Bar_destroy.HANDLE; + public static MethodHandle MyString_new_from_first$handle() { + return MyString_new_from_first.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Bar_destroy(Bar *self) + * MyString *MyString_new_from_first(DiplomatStringsView *v_data, size_t v_len) * } */ - public static MemorySegment Bar_destroy$address() { - return Bar_destroy.ADDR; + public static MemorySegment MyString_new_from_first$address() { + return MyString_new_from_first.ADDR; } /** * {@snippet lang=c : - * void Bar_destroy(Bar *self) + * MyString *MyString_new_from_first(DiplomatStringsView *v_data, size_t v_len) * } */ - public static void Bar_destroy(MemorySegment self) { - var mh$ = Bar_destroy.HANDLE; + public static MemorySegment MyString_new_from_first(MemorySegment v_data, long v_len) { + var mh$ = MyString_new_from_first.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Bar_destroy", self); + traceDowncall("MyString_new_from_first", v_data, v_len); } - mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(v_data, v_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OpaqueMutexedString_from_usize { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( + private static class MyString_set_str { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_from_usize"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_set_str"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10500,57 +10492,57 @@ private static class OpaqueMutexedString_from_usize { /** * Function descriptor for: * {@snippet lang=c : - * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) + * void MyString_set_str(MyString *self, const char *new_str_data, size_t new_str_len) * } */ - public static FunctionDescriptor OpaqueMutexedString_from_usize$descriptor() { - return OpaqueMutexedString_from_usize.DESC; + public static FunctionDescriptor MyString_set_str$descriptor() { + return MyString_set_str.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) + * void MyString_set_str(MyString *self, const char *new_str_data, size_t new_str_len) * } */ - public static MethodHandle OpaqueMutexedString_from_usize$handle() { - return OpaqueMutexedString_from_usize.HANDLE; + public static MethodHandle MyString_set_str$handle() { + return MyString_set_str.HANDLE; } /** * Address for: * {@snippet lang=c : - * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) + * void MyString_set_str(MyString *self, const char *new_str_data, size_t new_str_len) * } */ - public static MemorySegment OpaqueMutexedString_from_usize$address() { - return OpaqueMutexedString_from_usize.ADDR; + public static MemorySegment MyString_set_str$address() { + return MyString_set_str.ADDR; } /** * {@snippet lang=c : - * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) + * void MyString_set_str(MyString *self, const char *new_str_data, size_t new_str_len) * } */ - public static MemorySegment OpaqueMutexedString_from_usize(long number) { - var mh$ = OpaqueMutexedString_from_usize.HANDLE; + public static void MyString_set_str(MemorySegment self, MemorySegment new_str_data, long new_str_len) { + var mh$ = MyString_set_str.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_from_usize", number); + traceDowncall("MyString_set_str", self, new_str_data, new_str_len); } - return (MemorySegment)mh$.invokeExact(number); + mh$.invokeExact(self, new_str_data, new_str_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OpaqueMutexedString_change { + private static class MyString_get_str { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_change"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_get_str"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10558,57 +10550,58 @@ private static class OpaqueMutexedString_change { /** * Function descriptor for: * {@snippet lang=c : - * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) + * void MyString_get_str(const MyString *self, DiplomatWrite *write) * } */ - public static FunctionDescriptor OpaqueMutexedString_change$descriptor() { - return OpaqueMutexedString_change.DESC; + public static FunctionDescriptor MyString_get_str$descriptor() { + return MyString_get_str.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) + * void MyString_get_str(const MyString *self, DiplomatWrite *write) * } */ - public static MethodHandle OpaqueMutexedString_change$handle() { - return OpaqueMutexedString_change.HANDLE; + public static MethodHandle MyString_get_str$handle() { + return MyString_get_str.HANDLE; } /** * Address for: * {@snippet lang=c : - * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) + * void MyString_get_str(const MyString *self, DiplomatWrite *write) * } */ - public static MemorySegment OpaqueMutexedString_change$address() { - return OpaqueMutexedString_change.ADDR; + public static MemorySegment MyString_get_str$address() { + return MyString_get_str.ADDR; } /** * {@snippet lang=c : - * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) + * void MyString_get_str(const MyString *self, DiplomatWrite *write) * } */ - public static void OpaqueMutexedString_change(MemorySegment self, long number) { - var mh$ = OpaqueMutexedString_change.HANDLE; + public static void MyString_get_str(MemorySegment self, MemorySegment write) { + var mh$ = MyString_get_str.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_change", self, number); + traceDowncall("MyString_get_str", self, write); } - mh$.invokeExact(self, number); + mh$.invokeExact(self, write); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OpaqueMutexedString_borrow { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( + private static class MyString_string_transform { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER, + somelib_h.C_LONG, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_borrow"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_string_transform"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10616,57 +10609,56 @@ private static class OpaqueMutexedString_borrow { /** * Function descriptor for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) + * void MyString_string_transform(const char *foo_data, size_t foo_len, DiplomatWrite *write) * } */ - public static FunctionDescriptor OpaqueMutexedString_borrow$descriptor() { - return OpaqueMutexedString_borrow.DESC; + public static FunctionDescriptor MyString_string_transform$descriptor() { + return MyString_string_transform.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) + * void MyString_string_transform(const char *foo_data, size_t foo_len, DiplomatWrite *write) * } */ - public static MethodHandle OpaqueMutexedString_borrow$handle() { - return OpaqueMutexedString_borrow.HANDLE; + public static MethodHandle MyString_string_transform$handle() { + return MyString_string_transform.HANDLE; } /** * Address for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) + * void MyString_string_transform(const char *foo_data, size_t foo_len, DiplomatWrite *write) * } */ - public static MemorySegment OpaqueMutexedString_borrow$address() { - return OpaqueMutexedString_borrow.ADDR; + public static MemorySegment MyString_string_transform$address() { + return MyString_string_transform.ADDR; } /** * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) + * void MyString_string_transform(const char *foo_data, size_t foo_len, DiplomatWrite *write) * } */ - public static MemorySegment OpaqueMutexedString_borrow(MemorySegment self) { - var mh$ = OpaqueMutexedString_borrow.HANDLE; + public static void MyString_string_transform(MemorySegment foo_data, long foo_len, MemorySegment write) { + var mh$ = MyString_string_transform.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_borrow", self); + traceDowncall("MyString_string_transform", foo_data, foo_len, write); } - return (MemorySegment)mh$.invokeExact(self); + mh$.invokeExact(foo_data, foo_len, write); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OpaqueMutexedString_borrow_other { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, + private static class MyString_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_borrow_other"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10674,58 +10666,58 @@ private static class OpaqueMutexedString_borrow_other { /** * Function descriptor for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) + * void MyString_destroy(MyString *self) * } */ - public static FunctionDescriptor OpaqueMutexedString_borrow_other$descriptor() { - return OpaqueMutexedString_borrow_other.DESC; + public static FunctionDescriptor MyString_destroy$descriptor() { + return MyString_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) + * void MyString_destroy(MyString *self) * } */ - public static MethodHandle OpaqueMutexedString_borrow_other$handle() { - return OpaqueMutexedString_borrow_other.HANDLE; + public static MethodHandle MyString_destroy$handle() { + return MyString_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) + * void MyString_destroy(MyString *self) * } */ - public static MemorySegment OpaqueMutexedString_borrow_other$address() { - return OpaqueMutexedString_borrow_other.ADDR; + public static MemorySegment MyString_destroy$address() { + return MyString_destroy.ADDR; } /** * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) + * void MyString_destroy(MyString *self) * } */ - public static MemorySegment OpaqueMutexedString_borrow_other(MemorySegment other) { - var mh$ = OpaqueMutexedString_borrow_other.HANDLE; + public static void MyString_destroy(MemorySegment self) { + var mh$ = MyString_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_borrow_other", other); + traceDowncall("MyString_destroy", self); } - return (MemorySegment)mh$.invokeExact(other); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OpaqueMutexedString_borrow_self_or_other { + private static class One_transitivity { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_borrow_self_or_other"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_transitivity"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10733,58 +10725,58 @@ private static class OpaqueMutexedString_borrow_self_or_other { /** * Function descriptor for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) + * One *One_transitivity(const One *hold, const One *nohold) * } */ - public static FunctionDescriptor OpaqueMutexedString_borrow_self_or_other$descriptor() { - return OpaqueMutexedString_borrow_self_or_other.DESC; + public static FunctionDescriptor One_transitivity$descriptor() { + return One_transitivity.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) + * One *One_transitivity(const One *hold, const One *nohold) * } */ - public static MethodHandle OpaqueMutexedString_borrow_self_or_other$handle() { - return OpaqueMutexedString_borrow_self_or_other.HANDLE; + public static MethodHandle One_transitivity$handle() { + return One_transitivity.HANDLE; } /** * Address for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) + * One *One_transitivity(const One *hold, const One *nohold) * } */ - public static MemorySegment OpaqueMutexedString_borrow_self_or_other$address() { - return OpaqueMutexedString_borrow_self_or_other.ADDR; + public static MemorySegment One_transitivity$address() { + return One_transitivity.ADDR; } /** * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) + * One *One_transitivity(const One *hold, const One *nohold) * } */ - public static MemorySegment OpaqueMutexedString_borrow_self_or_other(MemorySegment self, MemorySegment other) { - var mh$ = OpaqueMutexedString_borrow_self_or_other.HANDLE; + public static MemorySegment One_transitivity(MemorySegment hold, MemorySegment nohold) { + var mh$ = One_transitivity.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_borrow_self_or_other", self, other); + traceDowncall("One_transitivity", hold, nohold); } - return (MemorySegment)mh$.invokeExact(self, other); + return (MemorySegment)mh$.invokeExact(hold, nohold); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OpaqueMutexedString_get_len_and_add { + private static class One_cycle { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_LONG, somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_POINTER, + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_get_len_and_add"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_cycle"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10792,57 +10784,61 @@ private static class OpaqueMutexedString_get_len_and_add { /** * Function descriptor for: * {@snippet lang=c : - * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) + * One *One_cycle(const Two *hold, const One *nohold) * } */ - public static FunctionDescriptor OpaqueMutexedString_get_len_and_add$descriptor() { - return OpaqueMutexedString_get_len_and_add.DESC; + public static FunctionDescriptor One_cycle$descriptor() { + return One_cycle.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) + * One *One_cycle(const Two *hold, const One *nohold) * } */ - public static MethodHandle OpaqueMutexedString_get_len_and_add$handle() { - return OpaqueMutexedString_get_len_and_add.HANDLE; + public static MethodHandle One_cycle$handle() { + return One_cycle.HANDLE; } /** * Address for: * {@snippet lang=c : - * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) + * One *One_cycle(const Two *hold, const One *nohold) * } */ - public static MemorySegment OpaqueMutexedString_get_len_and_add$address() { - return OpaqueMutexedString_get_len_and_add.ADDR; + public static MemorySegment One_cycle$address() { + return One_cycle.ADDR; } /** * {@snippet lang=c : - * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) + * One *One_cycle(const Two *hold, const One *nohold) * } */ - public static long OpaqueMutexedString_get_len_and_add(MemorySegment self, long other) { - var mh$ = OpaqueMutexedString_get_len_and_add.HANDLE; + public static MemorySegment One_cycle(MemorySegment hold, MemorySegment nohold) { + var mh$ = One_cycle.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_get_len_and_add", self, other); + traceDowncall("One_cycle", hold, nohold); } - return (long)mh$.invokeExact(self, other); + return (MemorySegment)mh$.invokeExact(hold, nohold); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OpaqueMutexedString_dummy_str { + private static class One_many_dependents { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - DiplomatStringView.layout(), + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_dummy_str"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_many_dependents"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10850,57 +10846,58 @@ private static class OpaqueMutexedString_dummy_str { /** * Function descriptor for: * {@snippet lang=c : - * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) + * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) * } */ - public static FunctionDescriptor OpaqueMutexedString_dummy_str$descriptor() { - return OpaqueMutexedString_dummy_str.DESC; + public static FunctionDescriptor One_many_dependents$descriptor() { + return One_many_dependents.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) + * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) * } */ - public static MethodHandle OpaqueMutexedString_dummy_str$handle() { - return OpaqueMutexedString_dummy_str.HANDLE; + public static MethodHandle One_many_dependents$handle() { + return One_many_dependents.HANDLE; } /** * Address for: * {@snippet lang=c : - * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) + * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) * } */ - public static MemorySegment OpaqueMutexedString_dummy_str$address() { - return OpaqueMutexedString_dummy_str.ADDR; + public static MemorySegment One_many_dependents$address() { + return One_many_dependents.ADDR; } /** * {@snippet lang=c : - * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) + * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) * } */ - public static MemorySegment OpaqueMutexedString_dummy_str(SegmentAllocator allocator, MemorySegment self) { - var mh$ = OpaqueMutexedString_dummy_str.HANDLE; + public static MemorySegment One_many_dependents(MemorySegment a, MemorySegment b, MemorySegment c, MemorySegment d, MemorySegment nohold) { + var mh$ = One_many_dependents.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_dummy_str", allocator, self); + traceDowncall("One_many_dependents", a, b, c, d, nohold); } - return (MemorySegment)mh$.invokeExact(allocator, self); + return (MemorySegment)mh$.invokeExact(a, b, c, d, nohold); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OpaqueMutexedString_wrapper { + private static class One_return_outlives_param { public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_wrapper"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_return_outlives_param"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10908,56 +10905,60 @@ private static class OpaqueMutexedString_wrapper { /** * Function descriptor for: * {@snippet lang=c : - * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) + * One *One_return_outlives_param(const Two *hold, const One *nohold) * } */ - public static FunctionDescriptor OpaqueMutexedString_wrapper$descriptor() { - return OpaqueMutexedString_wrapper.DESC; + public static FunctionDescriptor One_return_outlives_param$descriptor() { + return One_return_outlives_param.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) + * One *One_return_outlives_param(const Two *hold, const One *nohold) * } */ - public static MethodHandle OpaqueMutexedString_wrapper$handle() { - return OpaqueMutexedString_wrapper.HANDLE; + public static MethodHandle One_return_outlives_param$handle() { + return One_return_outlives_param.HANDLE; } /** * Address for: * {@snippet lang=c : - * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) + * One *One_return_outlives_param(const Two *hold, const One *nohold) * } */ - public static MemorySegment OpaqueMutexedString_wrapper$address() { - return OpaqueMutexedString_wrapper.ADDR; + public static MemorySegment One_return_outlives_param$address() { + return One_return_outlives_param.ADDR; } /** * {@snippet lang=c : - * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) + * One *One_return_outlives_param(const Two *hold, const One *nohold) * } */ - public static MemorySegment OpaqueMutexedString_wrapper(MemorySegment self) { - var mh$ = OpaqueMutexedString_wrapper.HANDLE; + public static MemorySegment One_return_outlives_param(MemorySegment hold, MemorySegment nohold) { + var mh$ = One_return_outlives_param.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_wrapper", self); + traceDowncall("One_return_outlives_param", hold, nohold); } - return (MemorySegment)mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(hold, nohold); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OpaqueMutexedString_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class One_diamond_top { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_top"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10965,58 +10966,60 @@ private static class OpaqueMutexedString_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) + * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static FunctionDescriptor OpaqueMutexedString_destroy$descriptor() { - return OpaqueMutexedString_destroy.DESC; + public static FunctionDescriptor One_diamond_top$descriptor() { + return One_diamond_top.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) + * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MethodHandle OpaqueMutexedString_destroy$handle() { - return OpaqueMutexedString_destroy.HANDLE; + public static MethodHandle One_diamond_top$handle() { + return One_diamond_top.HANDLE; } /** * Address for: * {@snippet lang=c : - * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) + * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MemorySegment OpaqueMutexedString_destroy$address() { - return OpaqueMutexedString_destroy.ADDR; + public static MemorySegment One_diamond_top$address() { + return One_diamond_top.ADDR; } /** * {@snippet lang=c : - * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) + * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static void OpaqueMutexedString_destroy(MemorySegment self) { - var mh$ = OpaqueMutexedString_destroy.HANDLE; + public static MemorySegment One_diamond_top(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { + var mh$ = One_diamond_top.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_destroy", self); + traceDowncall("One_diamond_top", top, left, right, bottom); } - mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(top, left, right, bottom); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_transitivity { + private static class One_diamond_left { public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_transitivity"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_left"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11024,58 +11027,60 @@ private static class One_transitivity { /** * Function descriptor for: * {@snippet lang=c : - * One *One_transitivity(const One *hold, const One *nohold) + * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static FunctionDescriptor One_transitivity$descriptor() { - return One_transitivity.DESC; + public static FunctionDescriptor One_diamond_left$descriptor() { + return One_diamond_left.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_transitivity(const One *hold, const One *nohold) + * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MethodHandle One_transitivity$handle() { - return One_transitivity.HANDLE; + public static MethodHandle One_diamond_left$handle() { + return One_diamond_left.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_transitivity(const One *hold, const One *nohold) + * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MemorySegment One_transitivity$address() { - return One_transitivity.ADDR; + public static MemorySegment One_diamond_left$address() { + return One_diamond_left.ADDR; } /** * {@snippet lang=c : - * One *One_transitivity(const One *hold, const One *nohold) + * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MemorySegment One_transitivity(MemorySegment hold, MemorySegment nohold) { - var mh$ = One_transitivity.HANDLE; + public static MemorySegment One_diamond_left(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { + var mh$ = One_diamond_left.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_transitivity", hold, nohold); + traceDowncall("One_diamond_left", top, left, right, bottom); } - return (MemorySegment)mh$.invokeExact(hold, nohold); + return (MemorySegment)mh$.invokeExact(top, left, right, bottom); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_cycle { + private static class One_diamond_right { public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_cycle"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_right"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11083,61 +11088,60 @@ private static class One_cycle { /** * Function descriptor for: * {@snippet lang=c : - * One *One_cycle(const Two *hold, const One *nohold) + * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static FunctionDescriptor One_cycle$descriptor() { - return One_cycle.DESC; + public static FunctionDescriptor One_diamond_right$descriptor() { + return One_diamond_right.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_cycle(const Two *hold, const One *nohold) + * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MethodHandle One_cycle$handle() { - return One_cycle.HANDLE; + public static MethodHandle One_diamond_right$handle() { + return One_diamond_right.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_cycle(const Two *hold, const One *nohold) + * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MemorySegment One_cycle$address() { - return One_cycle.ADDR; + public static MemorySegment One_diamond_right$address() { + return One_diamond_right.ADDR; } /** * {@snippet lang=c : - * One *One_cycle(const Two *hold, const One *nohold) + * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MemorySegment One_cycle(MemorySegment hold, MemorySegment nohold) { - var mh$ = One_cycle.HANDLE; + public static MemorySegment One_diamond_right(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { + var mh$ = One_diamond_right.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_cycle", hold, nohold); + traceDowncall("One_diamond_right", top, left, right, bottom); } - return (MemorySegment)mh$.invokeExact(hold, nohold); + return (MemorySegment)mh$.invokeExact(top, left, right, bottom); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_many_dependents { + private static class One_diamond_bottom { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_POINTER, - somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_many_dependents"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_bottom"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11145,58 +11149,61 @@ private static class One_many_dependents { /** * Function descriptor for: * {@snippet lang=c : - * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) + * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static FunctionDescriptor One_many_dependents$descriptor() { - return One_many_dependents.DESC; + public static FunctionDescriptor One_diamond_bottom$descriptor() { + return One_diamond_bottom.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) + * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) * } - */ - public static MethodHandle One_many_dependents$handle() { - return One_many_dependents.HANDLE; + */ + public static MethodHandle One_diamond_bottom$handle() { + return One_diamond_bottom.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) + * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MemorySegment One_many_dependents$address() { - return One_many_dependents.ADDR; + public static MemorySegment One_diamond_bottom$address() { + return One_diamond_bottom.ADDR; } /** * {@snippet lang=c : - * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) + * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MemorySegment One_many_dependents(MemorySegment a, MemorySegment b, MemorySegment c, MemorySegment d, MemorySegment nohold) { - var mh$ = One_many_dependents.HANDLE; + public static MemorySegment One_diamond_bottom(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { + var mh$ = One_diamond_bottom.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_many_dependents", a, b, c, d, nohold); + traceDowncall("One_diamond_bottom", top, left, right, bottom); } - return (MemorySegment)mh$.invokeExact(a, b, c, d, nohold); + return (MemorySegment)mh$.invokeExact(top, left, right, bottom); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_return_outlives_param { + private static class One_diamond_and_nested_types { public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_return_outlives_param"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_and_nested_types"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11204,60 +11211,59 @@ private static class One_return_outlives_param { /** * Function descriptor for: * {@snippet lang=c : - * One *One_return_outlives_param(const Two *hold, const One *nohold) + * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) * } */ - public static FunctionDescriptor One_return_outlives_param$descriptor() { - return One_return_outlives_param.DESC; + public static FunctionDescriptor One_diamond_and_nested_types$descriptor() { + return One_diamond_and_nested_types.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_return_outlives_param(const Two *hold, const One *nohold) + * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) * } */ - public static MethodHandle One_return_outlives_param$handle() { - return One_return_outlives_param.HANDLE; + public static MethodHandle One_diamond_and_nested_types$handle() { + return One_diamond_and_nested_types.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_return_outlives_param(const Two *hold, const One *nohold) + * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) * } */ - public static MemorySegment One_return_outlives_param$address() { - return One_return_outlives_param.ADDR; + public static MemorySegment One_diamond_and_nested_types$address() { + return One_diamond_and_nested_types.ADDR; } /** * {@snippet lang=c : - * One *One_return_outlives_param(const Two *hold, const One *nohold) + * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) * } */ - public static MemorySegment One_return_outlives_param(MemorySegment hold, MemorySegment nohold) { - var mh$ = One_return_outlives_param.HANDLE; + public static MemorySegment One_diamond_and_nested_types(MemorySegment a, MemorySegment b, MemorySegment c, MemorySegment d, MemorySegment nohold) { + var mh$ = One_diamond_and_nested_types.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_return_outlives_param", hold, nohold); + traceDowncall("One_diamond_and_nested_types", a, b, c, d, nohold); } - return (MemorySegment)mh$.invokeExact(hold, nohold); + return (MemorySegment)mh$.invokeExact(a, b, c, d, nohold); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_diamond_top { + private static class One_implicit_bounds { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_POINTER, - somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_top"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_implicit_bounds"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11265,51 +11271,51 @@ private static class One_diamond_top { /** * Function descriptor for: * {@snippet lang=c : - * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) + * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) * } */ - public static FunctionDescriptor One_diamond_top$descriptor() { - return One_diamond_top.DESC; + public static FunctionDescriptor One_implicit_bounds$descriptor() { + return One_implicit_bounds.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) + * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) * } */ - public static MethodHandle One_diamond_top$handle() { - return One_diamond_top.HANDLE; + public static MethodHandle One_implicit_bounds$handle() { + return One_implicit_bounds.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) + * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) * } */ - public static MemorySegment One_diamond_top$address() { - return One_diamond_top.ADDR; + public static MemorySegment One_implicit_bounds$address() { + return One_implicit_bounds.ADDR; } /** * {@snippet lang=c : - * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) + * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) * } */ - public static MemorySegment One_diamond_top(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { - var mh$ = One_diamond_top.HANDLE; + public static MemorySegment One_implicit_bounds(MemorySegment explicit_hold, MemorySegment implicit_hold, MemorySegment nohold) { + var mh$ = One_implicit_bounds.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_diamond_top", top, left, right, bottom); + traceDowncall("One_implicit_bounds", explicit_hold, implicit_hold, nohold); } - return (MemorySegment)mh$.invokeExact(top, left, right, bottom); + return (MemorySegment)mh$.invokeExact(explicit_hold, implicit_hold, nohold); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_diamond_left { + private static class One_implicit_bounds_deep { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, somelib_h.C_POINTER, @@ -11318,7 +11324,7 @@ private static class One_diamond_left { somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_left"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_implicit_bounds_deep"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11326,60 +11332,56 @@ private static class One_diamond_left { /** * Function descriptor for: * {@snippet lang=c : - * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) + * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) * } */ - public static FunctionDescriptor One_diamond_left$descriptor() { - return One_diamond_left.DESC; + public static FunctionDescriptor One_implicit_bounds_deep$descriptor() { + return One_implicit_bounds_deep.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) + * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) * } */ - public static MethodHandle One_diamond_left$handle() { - return One_diamond_left.HANDLE; + public static MethodHandle One_implicit_bounds_deep$handle() { + return One_implicit_bounds_deep.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) + * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) * } */ - public static MemorySegment One_diamond_left$address() { - return One_diamond_left.ADDR; + public static MemorySegment One_implicit_bounds_deep$address() { + return One_implicit_bounds_deep.ADDR; } /** * {@snippet lang=c : - * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) + * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) * } */ - public static MemorySegment One_diamond_left(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { - var mh$ = One_diamond_left.HANDLE; + public static MemorySegment One_implicit_bounds_deep(MemorySegment explicit_, MemorySegment implicit_1, MemorySegment implicit_2, MemorySegment nohold) { + var mh$ = One_implicit_bounds_deep.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_diamond_left", top, left, right, bottom); + traceDowncall("One_implicit_bounds_deep", explicit_, implicit_1, implicit_2, nohold); } - return (MemorySegment)mh$.invokeExact(top, left, right, bottom); + return (MemorySegment)mh$.invokeExact(explicit_, implicit_1, implicit_2, nohold); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_diamond_right { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, + private static class One_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_right"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11387,60 +11389,57 @@ private static class One_diamond_right { /** * Function descriptor for: * {@snippet lang=c : - * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) + * void One_destroy(One *self) * } */ - public static FunctionDescriptor One_diamond_right$descriptor() { - return One_diamond_right.DESC; + public static FunctionDescriptor One_destroy$descriptor() { + return One_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) + * void One_destroy(One *self) * } */ - public static MethodHandle One_diamond_right$handle() { - return One_diamond_right.HANDLE; + public static MethodHandle One_destroy$handle() { + return One_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) + * void One_destroy(One *self) * } */ - public static MemorySegment One_diamond_right$address() { - return One_diamond_right.ADDR; + public static MemorySegment One_destroy$address() { + return One_destroy.ADDR; } /** * {@snippet lang=c : - * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) + * void One_destroy(One *self) * } */ - public static MemorySegment One_diamond_right(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { - var mh$ = One_diamond_right.HANDLE; + public static void One_destroy(MemorySegment self) { + var mh$ = One_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_diamond_right", top, left, right, bottom); + traceDowncall("One_destroy", self); } - return (MemorySegment)mh$.invokeExact(top, left, right, bottom); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_diamond_bottom { + private static class RefList_node { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_bottom"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("RefList_node"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11448,61 +11447,56 @@ private static class One_diamond_bottom { /** * Function descriptor for: * {@snippet lang=c : - * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) + * RefList *RefList_node(const RefListParameter *data) * } */ - public static FunctionDescriptor One_diamond_bottom$descriptor() { - return One_diamond_bottom.DESC; + public static FunctionDescriptor RefList_node$descriptor() { + return RefList_node.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) + * RefList *RefList_node(const RefListParameter *data) * } */ - public static MethodHandle One_diamond_bottom$handle() { - return One_diamond_bottom.HANDLE; + public static MethodHandle RefList_node$handle() { + return RefList_node.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) + * RefList *RefList_node(const RefListParameter *data) * } */ - public static MemorySegment One_diamond_bottom$address() { - return One_diamond_bottom.ADDR; + public static MemorySegment RefList_node$address() { + return RefList_node.ADDR; } /** * {@snippet lang=c : - * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) + * RefList *RefList_node(const RefListParameter *data) * } */ - public static MemorySegment One_diamond_bottom(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { - var mh$ = One_diamond_bottom.HANDLE; + public static MemorySegment RefList_node(MemorySegment data) { + var mh$ = RefList_node.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_diamond_bottom", top, left, right, bottom); + traceDowncall("RefList_node", data); } - return (MemorySegment)mh$.invokeExact(top, left, right, bottom); + return (MemorySegment)mh$.invokeExact(data); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_diamond_and_nested_types { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, + private static class RefList_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_and_nested_types"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("RefList_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11510,59 +11504,58 @@ private static class One_diamond_and_nested_types { /** * Function descriptor for: * {@snippet lang=c : - * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) + * void RefList_destroy(RefList *self) * } */ - public static FunctionDescriptor One_diamond_and_nested_types$descriptor() { - return One_diamond_and_nested_types.DESC; + public static FunctionDescriptor RefList_destroy$descriptor() { + return RefList_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) + * void RefList_destroy(RefList *self) * } */ - public static MethodHandle One_diamond_and_nested_types$handle() { - return One_diamond_and_nested_types.HANDLE; + public static MethodHandle RefList_destroy$handle() { + return RefList_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) + * void RefList_destroy(RefList *self) * } */ - public static MemorySegment One_diamond_and_nested_types$address() { - return One_diamond_and_nested_types.ADDR; + public static MemorySegment RefList_destroy$address() { + return RefList_destroy.ADDR; } /** * {@snippet lang=c : - * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) + * void RefList_destroy(RefList *self) * } */ - public static MemorySegment One_diamond_and_nested_types(MemorySegment a, MemorySegment b, MemorySegment c, MemorySegment d, MemorySegment nohold) { - var mh$ = One_diamond_and_nested_types.HANDLE; + public static void RefList_destroy(MemorySegment self) { + var mh$ = RefList_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_diamond_and_nested_types", a, b, c, d, nohold); + traceDowncall("RefList_destroy", self); } - return (MemorySegment)mh$.invokeExact(a, b, c, d, nohold); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_implicit_bounds { + private static class Float64Vec_new_bool { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_implicit_bounds"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_bool"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11570,60 +11563,58 @@ private static class One_implicit_bounds { /** * Function descriptor for: * {@snippet lang=c : - * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) + * Float64Vec *Float64Vec_new_bool(const bool *v_data, size_t v_len) * } */ - public static FunctionDescriptor One_implicit_bounds$descriptor() { - return One_implicit_bounds.DESC; + public static FunctionDescriptor Float64Vec_new_bool$descriptor() { + return Float64Vec_new_bool.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) + * Float64Vec *Float64Vec_new_bool(const bool *v_data, size_t v_len) * } */ - public static MethodHandle One_implicit_bounds$handle() { - return One_implicit_bounds.HANDLE; + public static MethodHandle Float64Vec_new_bool$handle() { + return Float64Vec_new_bool.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) + * Float64Vec *Float64Vec_new_bool(const bool *v_data, size_t v_len) * } */ - public static MemorySegment One_implicit_bounds$address() { - return One_implicit_bounds.ADDR; + public static MemorySegment Float64Vec_new_bool$address() { + return Float64Vec_new_bool.ADDR; } /** * {@snippet lang=c : - * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) + * Float64Vec *Float64Vec_new_bool(const bool *v_data, size_t v_len) * } */ - public static MemorySegment One_implicit_bounds(MemorySegment explicit_hold, MemorySegment implicit_hold, MemorySegment nohold) { - var mh$ = One_implicit_bounds.HANDLE; + public static MemorySegment Float64Vec_new_bool(MemorySegment v_data, long v_len) { + var mh$ = Float64Vec_new_bool.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_implicit_bounds", explicit_hold, implicit_hold, nohold); + traceDowncall("Float64Vec_new_bool", v_data, v_len); } - return (MemorySegment)mh$.invokeExact(explicit_hold, implicit_hold, nohold); + return (MemorySegment)mh$.invokeExact(v_data, v_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_implicit_bounds_deep { + private static class Float64Vec_new_i16 { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_implicit_bounds_deep"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_i16"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11631,56 +11622,58 @@ private static class One_implicit_bounds_deep { /** * Function descriptor for: * {@snippet lang=c : - * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) + * Float64Vec *Float64Vec_new_i16(const int16_t *v_data, size_t v_len) * } */ - public static FunctionDescriptor One_implicit_bounds_deep$descriptor() { - return One_implicit_bounds_deep.DESC; + public static FunctionDescriptor Float64Vec_new_i16$descriptor() { + return Float64Vec_new_i16.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) + * Float64Vec *Float64Vec_new_i16(const int16_t *v_data, size_t v_len) * } */ - public static MethodHandle One_implicit_bounds_deep$handle() { - return One_implicit_bounds_deep.HANDLE; + public static MethodHandle Float64Vec_new_i16$handle() { + return Float64Vec_new_i16.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) + * Float64Vec *Float64Vec_new_i16(const int16_t *v_data, size_t v_len) * } */ - public static MemorySegment One_implicit_bounds_deep$address() { - return One_implicit_bounds_deep.ADDR; + public static MemorySegment Float64Vec_new_i16$address() { + return Float64Vec_new_i16.ADDR; } /** * {@snippet lang=c : - * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) + * Float64Vec *Float64Vec_new_i16(const int16_t *v_data, size_t v_len) * } */ - public static MemorySegment One_implicit_bounds_deep(MemorySegment explicit_, MemorySegment implicit_1, MemorySegment implicit_2, MemorySegment nohold) { - var mh$ = One_implicit_bounds_deep.HANDLE; + public static MemorySegment Float64Vec_new_i16(MemorySegment v_data, long v_len) { + var mh$ = Float64Vec_new_i16.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_implicit_bounds_deep", explicit_, implicit_1, implicit_2, nohold); + traceDowncall("Float64Vec_new_i16", v_data, v_len); } - return (MemorySegment)mh$.invokeExact(explicit_, implicit_1, implicit_2, nohold); + return (MemorySegment)mh$.invokeExact(v_data, v_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER + private static class Float64Vec_new_u16 { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_u16"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11688,58 +11681,58 @@ private static class One_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void One_destroy(One *self) + * Float64Vec *Float64Vec_new_u16(const uint16_t *v_data, size_t v_len) * } */ - public static FunctionDescriptor One_destroy$descriptor() { - return One_destroy.DESC; + public static FunctionDescriptor Float64Vec_new_u16$descriptor() { + return Float64Vec_new_u16.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void One_destroy(One *self) + * Float64Vec *Float64Vec_new_u16(const uint16_t *v_data, size_t v_len) * } */ - public static MethodHandle One_destroy$handle() { - return One_destroy.HANDLE; + public static MethodHandle Float64Vec_new_u16$handle() { + return Float64Vec_new_u16.HANDLE; } /** * Address for: * {@snippet lang=c : - * void One_destroy(One *self) + * Float64Vec *Float64Vec_new_u16(const uint16_t *v_data, size_t v_len) * } */ - public static MemorySegment One_destroy$address() { - return One_destroy.ADDR; + public static MemorySegment Float64Vec_new_u16$address() { + return Float64Vec_new_u16.ADDR; } /** * {@snippet lang=c : - * void One_destroy(One *self) + * Float64Vec *Float64Vec_new_u16(const uint16_t *v_data, size_t v_len) * } */ - public static void One_destroy(MemorySegment self) { - var mh$ = One_destroy.HANDLE; + public static MemorySegment Float64Vec_new_u16(MemorySegment v_data, long v_len) { + var mh$ = Float64Vec_new_u16.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_destroy", self); + traceDowncall("Float64Vec_new_u16", v_data, v_len); } - mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(v_data, v_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Utf16Wrap_from_utf16 { + private static class Float64Vec_new_isize { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_from_utf16"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_isize"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11747,57 +11740,58 @@ private static class Utf16Wrap_from_utf16 { /** * Function descriptor for: * {@snippet lang=c : - * Utf16Wrap *Utf16Wrap_from_utf16(const char16_t *input_data, size_t input_len) + * Float64Vec *Float64Vec_new_isize(const intptr_t *v_data, size_t v_len) * } */ - public static FunctionDescriptor Utf16Wrap_from_utf16$descriptor() { - return Utf16Wrap_from_utf16.DESC; + public static FunctionDescriptor Float64Vec_new_isize$descriptor() { + return Float64Vec_new_isize.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Utf16Wrap *Utf16Wrap_from_utf16(const char16_t *input_data, size_t input_len) + * Float64Vec *Float64Vec_new_isize(const intptr_t *v_data, size_t v_len) * } */ - public static MethodHandle Utf16Wrap_from_utf16$handle() { - return Utf16Wrap_from_utf16.HANDLE; + public static MethodHandle Float64Vec_new_isize$handle() { + return Float64Vec_new_isize.HANDLE; } /** * Address for: * {@snippet lang=c : - * Utf16Wrap *Utf16Wrap_from_utf16(const char16_t *input_data, size_t input_len) + * Float64Vec *Float64Vec_new_isize(const intptr_t *v_data, size_t v_len) * } */ - public static MemorySegment Utf16Wrap_from_utf16$address() { - return Utf16Wrap_from_utf16.ADDR; + public static MemorySegment Float64Vec_new_isize$address() { + return Float64Vec_new_isize.ADDR; } /** * {@snippet lang=c : - * Utf16Wrap *Utf16Wrap_from_utf16(const char16_t *input_data, size_t input_len) + * Float64Vec *Float64Vec_new_isize(const intptr_t *v_data, size_t v_len) * } */ - public static MemorySegment Utf16Wrap_from_utf16(MemorySegment input_data, long input_len) { - var mh$ = Utf16Wrap_from_utf16.HANDLE; + public static MemorySegment Float64Vec_new_isize(MemorySegment v_data, long v_len) { + var mh$ = Float64Vec_new_isize.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Utf16Wrap_from_utf16", input_data, input_len); + traceDowncall("Float64Vec_new_isize", v_data, v_len); } - return (MemorySegment)mh$.invokeExact(input_data, input_len); + return (MemorySegment)mh$.invokeExact(v_data, v_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Utf16Wrap_get_debug_str { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class Float64Vec_new_usize { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - somelib_h.C_POINTER + somelib_h.C_POINTER, + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_get_debug_str"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_usize"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11805,57 +11799,58 @@ private static class Utf16Wrap_get_debug_str { /** * Function descriptor for: * {@snippet lang=c : - * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) + * Float64Vec *Float64Vec_new_usize(const size_t *v_data, size_t v_len) * } */ - public static FunctionDescriptor Utf16Wrap_get_debug_str$descriptor() { - return Utf16Wrap_get_debug_str.DESC; + public static FunctionDescriptor Float64Vec_new_usize$descriptor() { + return Float64Vec_new_usize.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) + * Float64Vec *Float64Vec_new_usize(const size_t *v_data, size_t v_len) * } */ - public static MethodHandle Utf16Wrap_get_debug_str$handle() { - return Utf16Wrap_get_debug_str.HANDLE; + public static MethodHandle Float64Vec_new_usize$handle() { + return Float64Vec_new_usize.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) + * Float64Vec *Float64Vec_new_usize(const size_t *v_data, size_t v_len) * } */ - public static MemorySegment Utf16Wrap_get_debug_str$address() { - return Utf16Wrap_get_debug_str.ADDR; + public static MemorySegment Float64Vec_new_usize$address() { + return Float64Vec_new_usize.ADDR; } /** * {@snippet lang=c : - * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) + * Float64Vec *Float64Vec_new_usize(const size_t *v_data, size_t v_len) * } */ - public static void Utf16Wrap_get_debug_str(MemorySegment self, MemorySegment write) { - var mh$ = Utf16Wrap_get_debug_str.HANDLE; + public static MemorySegment Float64Vec_new_usize(MemorySegment v_data, long v_len) { + var mh$ = Float64Vec_new_usize.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Utf16Wrap_get_debug_str", self, write); + traceDowncall("Float64Vec_new_usize", v_data, v_len); } - mh$.invokeExact(self, write); + return (MemorySegment)mh$.invokeExact(v_data, v_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Utf16Wrap_borrow_cont { + private static class Float64Vec_new_f64_be_bytes { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - DiplomatString16View.layout(), - somelib_h.C_POINTER + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_borrow_cont"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_f64_be_bytes"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11863,56 +11858,58 @@ private static class Utf16Wrap_borrow_cont { /** * Function descriptor for: * {@snippet lang=c : - * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) + * Float64Vec *Float64Vec_new_f64_be_bytes(const uint8_t *v_data, size_t v_len) * } */ - public static FunctionDescriptor Utf16Wrap_borrow_cont$descriptor() { - return Utf16Wrap_borrow_cont.DESC; + public static FunctionDescriptor Float64Vec_new_f64_be_bytes$descriptor() { + return Float64Vec_new_f64_be_bytes.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) + * Float64Vec *Float64Vec_new_f64_be_bytes(const uint8_t *v_data, size_t v_len) * } */ - public static MethodHandle Utf16Wrap_borrow_cont$handle() { - return Utf16Wrap_borrow_cont.HANDLE; + public static MethodHandle Float64Vec_new_f64_be_bytes$handle() { + return Float64Vec_new_f64_be_bytes.HANDLE; } /** * Address for: * {@snippet lang=c : - * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) + * Float64Vec *Float64Vec_new_f64_be_bytes(const uint8_t *v_data, size_t v_len) * } */ - public static MemorySegment Utf16Wrap_borrow_cont$address() { - return Utf16Wrap_borrow_cont.ADDR; + public static MemorySegment Float64Vec_new_f64_be_bytes$address() { + return Float64Vec_new_f64_be_bytes.ADDR; } /** * {@snippet lang=c : - * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) + * Float64Vec *Float64Vec_new_f64_be_bytes(const uint8_t *v_data, size_t v_len) * } */ - public static MemorySegment Utf16Wrap_borrow_cont(SegmentAllocator allocator, MemorySegment self) { - var mh$ = Utf16Wrap_borrow_cont.HANDLE; + public static MemorySegment Float64Vec_new_f64_be_bytes(MemorySegment v_data, long v_len) { + var mh$ = Float64Vec_new_f64_be_bytes.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Utf16Wrap_borrow_cont", allocator, self); + traceDowncall("Float64Vec_new_f64_be_bytes", v_data, v_len); } - return (MemorySegment)mh$.invokeExact(allocator, self); + return (MemorySegment)mh$.invokeExact(v_data, v_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Utf16Wrap_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER + private static class Float64Vec_new_from_owned { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_from_owned"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11920,111 +11917,116 @@ private static class Utf16Wrap_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void Utf16Wrap_destroy(Utf16Wrap *self) + * Float64Vec *Float64Vec_new_from_owned(double *v_data, size_t v_len) * } */ - public static FunctionDescriptor Utf16Wrap_destroy$descriptor() { - return Utf16Wrap_destroy.DESC; + public static FunctionDescriptor Float64Vec_new_from_owned$descriptor() { + return Float64Vec_new_from_owned.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Utf16Wrap_destroy(Utf16Wrap *self) + * Float64Vec *Float64Vec_new_from_owned(double *v_data, size_t v_len) * } */ - public static MethodHandle Utf16Wrap_destroy$handle() { - return Utf16Wrap_destroy.HANDLE; + public static MethodHandle Float64Vec_new_from_owned$handle() { + return Float64Vec_new_from_owned.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Utf16Wrap_destroy(Utf16Wrap *self) + * Float64Vec *Float64Vec_new_from_owned(double *v_data, size_t v_len) * } */ - public static MemorySegment Utf16Wrap_destroy$address() { - return Utf16Wrap_destroy.ADDR; + public static MemorySegment Float64Vec_new_from_owned$address() { + return Float64Vec_new_from_owned.ADDR; } /** * {@snippet lang=c : - * void Utf16Wrap_destroy(Utf16Wrap *self) + * Float64Vec *Float64Vec_new_from_owned(double *v_data, size_t v_len) * } */ - public static void Utf16Wrap_destroy(MemorySegment self) { - var mh$ = Utf16Wrap_destroy.HANDLE; + public static MemorySegment Float64Vec_new_from_owned(MemorySegment v_data, long v_len) { + var mh$ = Float64Vec_new_from_owned.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Utf16Wrap_destroy", self); + traceDowncall("Float64Vec_new_from_owned", v_data, v_len); } - mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(v_data, v_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static final int MyEnum_A = (int)-2L; - /** - * {@snippet lang=c : - * enum MyEnum.MyEnum_A = -2 - * } - */ - public static int MyEnum_A() { - return MyEnum_A; - } - private static final int MyEnum_B = (int)-1L; - /** - * {@snippet lang=c : - * enum MyEnum.MyEnum_B = -1 - * } - */ - public static int MyEnum_B() { - return MyEnum_B; + + private static class Float64Vec_as_slice { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + DiplomatF64View.layout(), + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_as_slice"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } - private static final int MyEnum_C = (int)0L; + /** + * Function descriptor for: * {@snippet lang=c : - * enum MyEnum.MyEnum_C = 0 + * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) * } */ - public static int MyEnum_C() { - return MyEnum_C; + public static FunctionDescriptor Float64Vec_as_slice$descriptor() { + return Float64Vec_as_slice.DESC; } - private static final int MyEnum_D = (int)1L; + /** + * Downcall method handle for: * {@snippet lang=c : - * enum MyEnum.MyEnum_D = 1 + * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) * } */ - public static int MyEnum_D() { - return MyEnum_D; + public static MethodHandle Float64Vec_as_slice$handle() { + return Float64Vec_as_slice.HANDLE; } - private static final int MyEnum_E = (int)2L; + /** + * Address for: * {@snippet lang=c : - * enum MyEnum.MyEnum_E = 2 + * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) * } */ - public static int MyEnum_E() { - return MyEnum_E; + public static MemorySegment Float64Vec_as_slice$address() { + return Float64Vec_as_slice.ADDR; } - private static final int MyEnum_F = (int)3L; + /** * {@snippet lang=c : - * enum MyEnum.MyEnum_F = 3 + * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) * } */ - public static int MyEnum_F() { - return MyEnum_F; + public static MemorySegment Float64Vec_as_slice(SegmentAllocator allocator, MemorySegment self) { + var mh$ = Float64Vec_as_slice.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Float64Vec_as_slice", allocator, self); + } + return (MemorySegment)mh$.invokeExact(allocator, self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } } - private static class MyEnum_into_value { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_CHAR, - somelib_h.C_INT + private static class Float64Vec_fill_slice { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyEnum_into_value"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_fill_slice"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12032,55 +12034,58 @@ private static class MyEnum_into_value { /** * Function descriptor for: * {@snippet lang=c : - * int8_t MyEnum_into_value(MyEnum self) + * void Float64Vec_fill_slice(const Float64Vec *self, double *v_data, size_t v_len) * } */ - public static FunctionDescriptor MyEnum_into_value$descriptor() { - return MyEnum_into_value.DESC; + public static FunctionDescriptor Float64Vec_fill_slice$descriptor() { + return Float64Vec_fill_slice.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int8_t MyEnum_into_value(MyEnum self) + * void Float64Vec_fill_slice(const Float64Vec *self, double *v_data, size_t v_len) * } */ - public static MethodHandle MyEnum_into_value$handle() { - return MyEnum_into_value.HANDLE; + public static MethodHandle Float64Vec_fill_slice$handle() { + return Float64Vec_fill_slice.HANDLE; } /** * Address for: * {@snippet lang=c : - * int8_t MyEnum_into_value(MyEnum self) + * void Float64Vec_fill_slice(const Float64Vec *self, double *v_data, size_t v_len) * } */ - public static MemorySegment MyEnum_into_value$address() { - return MyEnum_into_value.ADDR; + public static MemorySegment Float64Vec_fill_slice$address() { + return Float64Vec_fill_slice.ADDR; } /** * {@snippet lang=c : - * int8_t MyEnum_into_value(MyEnum self) + * void Float64Vec_fill_slice(const Float64Vec *self, double *v_data, size_t v_len) * } */ - public static byte MyEnum_into_value(int self) { - var mh$ = MyEnum_into_value.HANDLE; + public static void Float64Vec_fill_slice(MemorySegment self, MemorySegment v_data, long v_len) { + var mh$ = Float64Vec_fill_slice.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyEnum_into_value", self); + traceDowncall("Float64Vec_fill_slice", self, v_data, v_len); } - return (byte)mh$.invokeExact(self); + mh$.invokeExact(self, v_data, v_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyEnum_get_a { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT ); + private static class Float64Vec_set_value { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG + ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyEnum_get_a"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_set_value"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12088,56 +12093,57 @@ private static class MyEnum_get_a { /** * Function descriptor for: * {@snippet lang=c : - * MyEnum MyEnum_get_a() + * void Float64Vec_set_value(Float64Vec *self, const double *new_slice_data, size_t new_slice_len) * } */ - public static FunctionDescriptor MyEnum_get_a$descriptor() { - return MyEnum_get_a.DESC; + public static FunctionDescriptor Float64Vec_set_value$descriptor() { + return Float64Vec_set_value.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * MyEnum MyEnum_get_a() + * void Float64Vec_set_value(Float64Vec *self, const double *new_slice_data, size_t new_slice_len) * } */ - public static MethodHandle MyEnum_get_a$handle() { - return MyEnum_get_a.HANDLE; + public static MethodHandle Float64Vec_set_value$handle() { + return Float64Vec_set_value.HANDLE; } /** * Address for: * {@snippet lang=c : - * MyEnum MyEnum_get_a() + * void Float64Vec_set_value(Float64Vec *self, const double *new_slice_data, size_t new_slice_len) * } */ - public static MemorySegment MyEnum_get_a$address() { - return MyEnum_get_a.ADDR; + public static MemorySegment Float64Vec_set_value$address() { + return Float64Vec_set_value.ADDR; } /** * {@snippet lang=c : - * MyEnum MyEnum_get_a() + * void Float64Vec_set_value(Float64Vec *self, const double *new_slice_data, size_t new_slice_len) * } */ - public static int MyEnum_get_a() { - var mh$ = MyEnum_get_a.HANDLE; + public static void Float64Vec_set_value(MemorySegment self, MemorySegment new_slice_data, long new_slice_len) { + var mh$ = Float64Vec_set_value.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyEnum_get_a"); + traceDowncall("Float64Vec_set_value", self, new_slice_data, new_slice_len); } - return (int)mh$.invokeExact(); + mh$.invokeExact(self, new_slice_data, new_slice_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class RefListParameter_destroy { + private static class Float64Vec_to_string { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("RefListParameter_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_to_string"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12145,55 +12151,57 @@ private static class RefListParameter_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void RefListParameter_destroy(RefListParameter *self) + * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) * } */ - public static FunctionDescriptor RefListParameter_destroy$descriptor() { - return RefListParameter_destroy.DESC; + public static FunctionDescriptor Float64Vec_to_string$descriptor() { + return Float64Vec_to_string.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void RefListParameter_destroy(RefListParameter *self) + * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) * } */ - public static MethodHandle RefListParameter_destroy$handle() { - return RefListParameter_destroy.HANDLE; + public static MethodHandle Float64Vec_to_string$handle() { + return Float64Vec_to_string.HANDLE; } /** * Address for: * {@snippet lang=c : - * void RefListParameter_destroy(RefListParameter *self) + * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) * } */ - public static MemorySegment RefListParameter_destroy$address() { - return RefListParameter_destroy.ADDR; + public static MemorySegment Float64Vec_to_string$address() { + return Float64Vec_to_string.ADDR; } /** * {@snippet lang=c : - * void RefListParameter_destroy(RefListParameter *self) + * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) * } */ - public static void RefListParameter_destroy(MemorySegment self) { - var mh$ = RefListParameter_destroy.HANDLE; + public static void Float64Vec_to_string(MemorySegment self, MemorySegment write) { + var mh$ = Float64Vec_to_string.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("RefListParameter_destroy", self); + traceDowncall("Float64Vec_to_string", self, write); } - mh$.invokeExact(self); + mh$.invokeExact(self, write); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyStruct_new { + private static class Float64Vec_borrow { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - MyStruct.layout() ); + DiplomatF64View.layout(), + somelib_h.C_POINTER + ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyStruct_new"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_borrow"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12201,57 +12209,56 @@ private static class MyStruct_new { /** * Function descriptor for: * {@snippet lang=c : - * MyStruct MyStruct_new() + * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) * } */ - public static FunctionDescriptor MyStruct_new$descriptor() { - return MyStruct_new.DESC; + public static FunctionDescriptor Float64Vec_borrow$descriptor() { + return Float64Vec_borrow.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * MyStruct MyStruct_new() + * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) * } */ - public static MethodHandle MyStruct_new$handle() { - return MyStruct_new.HANDLE; + public static MethodHandle Float64Vec_borrow$handle() { + return Float64Vec_borrow.HANDLE; } /** * Address for: * {@snippet lang=c : - * MyStruct MyStruct_new() + * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) * } */ - public static MemorySegment MyStruct_new$address() { - return MyStruct_new.ADDR; + public static MemorySegment Float64Vec_borrow$address() { + return Float64Vec_borrow.ADDR; } /** * {@snippet lang=c : - * MyStruct MyStruct_new() + * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) * } */ - public static MemorySegment MyStruct_new(SegmentAllocator allocator) { - var mh$ = MyStruct_new.HANDLE; + public static MemorySegment Float64Vec_borrow(SegmentAllocator allocator, MemorySegment self) { + var mh$ = Float64Vec_borrow.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyStruct_new", allocator); + traceDowncall("Float64Vec_borrow", allocator, self); } - return (MemorySegment)mh$.invokeExact(allocator); + return (MemorySegment)mh$.invokeExact(allocator, self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyStruct_into_a { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_CHAR, - MyStruct.layout() + private static class Float64Vec_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyStruct_into_a"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12259,112 +12266,167 @@ private static class MyStruct_into_a { /** * Function descriptor for: * {@snippet lang=c : - * uint8_t MyStruct_into_a(MyStruct self) + * void Float64Vec_destroy(Float64Vec *self) * } */ - public static FunctionDescriptor MyStruct_into_a$descriptor() { - return MyStruct_into_a.DESC; + public static FunctionDescriptor Float64Vec_destroy$descriptor() { + return Float64Vec_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * uint8_t MyStruct_into_a(MyStruct self) + * void Float64Vec_destroy(Float64Vec *self) * } */ - public static MethodHandle MyStruct_into_a$handle() { - return MyStruct_into_a.HANDLE; + public static MethodHandle Float64Vec_destroy$handle() { + return Float64Vec_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * uint8_t MyStruct_into_a(MyStruct self) + * void Float64Vec_destroy(Float64Vec *self) * } */ - public static MemorySegment MyStruct_into_a$address() { - return MyStruct_into_a.ADDR; + public static MemorySegment Float64Vec_destroy$address() { + return Float64Vec_destroy.ADDR; } /** * {@snippet lang=c : - * uint8_t MyStruct_into_a(MyStruct self) + * void Float64Vec_destroy(Float64Vec *self) * } */ - public static byte MyStruct_into_a(MemorySegment self) { - var mh$ = MyStruct_into_a.HANDLE; + public static void Float64Vec_destroy(MemorySegment self) { + var mh$ = Float64Vec_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyStruct_into_a", self); + traceDowncall("Float64Vec_destroy", self); } - return (byte)mh$.invokeExact(self); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static final int ContiguousEnum_C = (int)0L; + private static final int MyEnum_A = (int)-2L; + /** + * {@snippet lang=c : + * enum MyEnum.MyEnum_A = -2 + * } + */ + public static int MyEnum_A() { + return MyEnum_A; + } + private static final int MyEnum_B = (int)-1L; + /** + * {@snippet lang=c : + * enum MyEnum.MyEnum_B = -1 + * } + */ + public static int MyEnum_B() { + return MyEnum_B; + } + private static final int MyEnum_C = (int)0L; + /** + * {@snippet lang=c : + * enum MyEnum.MyEnum_C = 0 + * } + */ + public static int MyEnum_C() { + return MyEnum_C; + } + private static final int MyEnum_D = (int)1L; + /** + * {@snippet lang=c : + * enum MyEnum.MyEnum_D = 1 + * } + */ + public static int MyEnum_D() { + return MyEnum_D; + } + private static final int MyEnum_E = (int)2L; /** * {@snippet lang=c : - * enum ContiguousEnum.ContiguousEnum_C = 0 + * enum MyEnum.MyEnum_E = 2 * } */ - public static int ContiguousEnum_C() { - return ContiguousEnum_C; + public static int MyEnum_E() { + return MyEnum_E; } - private static final int ContiguousEnum_D = (int)1L; + private static final int MyEnum_F = (int)3L; /** * {@snippet lang=c : - * enum ContiguousEnum.ContiguousEnum_D = 1 + * enum MyEnum.MyEnum_F = 3 * } */ - public static int ContiguousEnum_D() { - return ContiguousEnum_D; + public static int MyEnum_F() { + return MyEnum_F; } - private static final int ContiguousEnum_E = (int)2L; + + private static class MyEnum_into_value { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_CHAR, + somelib_h.C_INT + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyEnum_into_value"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + /** + * Function descriptor for: * {@snippet lang=c : - * enum ContiguousEnum.ContiguousEnum_E = 2 + * int8_t MyEnum_into_value(MyEnum self) * } */ - public static int ContiguousEnum_E() { - return ContiguousEnum_E; + public static FunctionDescriptor MyEnum_into_value$descriptor() { + return MyEnum_into_value.DESC; } - private static final int ContiguousEnum_F = (int)3L; + /** + * Downcall method handle for: * {@snippet lang=c : - * enum ContiguousEnum.ContiguousEnum_F = 3 + * int8_t MyEnum_into_value(MyEnum self) * } */ - public static int ContiguousEnum_F() { - return ContiguousEnum_F; + public static MethodHandle MyEnum_into_value$handle() { + return MyEnum_into_value.HANDLE; } - private static final int ErrorEnum_Foo = (int)0L; + /** + * Address for: * {@snippet lang=c : - * enum ErrorEnum.ErrorEnum_Foo = 0 + * int8_t MyEnum_into_value(MyEnum self) * } */ - public static int ErrorEnum_Foo() { - return ErrorEnum_Foo; + public static MemorySegment MyEnum_into_value$address() { + return MyEnum_into_value.ADDR; } - private static final int ErrorEnum_Bar = (int)1L; + /** * {@snippet lang=c : - * enum ErrorEnum.ErrorEnum_Bar = 1 + * int8_t MyEnum_into_value(MyEnum self) * } */ - public static int ErrorEnum_Bar() { - return ErrorEnum_Bar; + public static byte MyEnum_into_value(int self) { + var mh$ = MyEnum_into_value.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("MyEnum_into_value", self); + } + return (byte)mh$.invokeExact(self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } } - private static class Float64Vec_new_bool { + private static class MyEnum_get_a { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG - ); + somelib_h.C_INT ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_bool"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyEnum_get_a"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12372,58 +12434,57 @@ private static class Float64Vec_new_bool { /** * Function descriptor for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_bool(const bool *v_data, size_t v_len) + * MyEnum MyEnum_get_a() * } */ - public static FunctionDescriptor Float64Vec_new_bool$descriptor() { - return Float64Vec_new_bool.DESC; + public static FunctionDescriptor MyEnum_get_a$descriptor() { + return MyEnum_get_a.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_bool(const bool *v_data, size_t v_len) + * MyEnum MyEnum_get_a() * } */ - public static MethodHandle Float64Vec_new_bool$handle() { - return Float64Vec_new_bool.HANDLE; + public static MethodHandle MyEnum_get_a$handle() { + return MyEnum_get_a.HANDLE; } /** * Address for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_bool(const bool *v_data, size_t v_len) + * MyEnum MyEnum_get_a() * } */ - public static MemorySegment Float64Vec_new_bool$address() { - return Float64Vec_new_bool.ADDR; + public static MemorySegment MyEnum_get_a$address() { + return MyEnum_get_a.ADDR; } /** * {@snippet lang=c : - * Float64Vec *Float64Vec_new_bool(const bool *v_data, size_t v_len) + * MyEnum MyEnum_get_a() * } */ - public static MemorySegment Float64Vec_new_bool(MemorySegment v_data, long v_len) { - var mh$ = Float64Vec_new_bool.HANDLE; + public static int MyEnum_get_a() { + var mh$ = MyEnum_get_a.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_new_bool", v_data, v_len); + traceDowncall("MyEnum_get_a"); } - return (MemorySegment)mh$.invokeExact(v_data, v_len); + return (int)mh$.invokeExact(); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_new_i16 { + private static class OpaqueMutexedString_from_usize { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_i16"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_from_usize"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12431,58 +12492,57 @@ private static class Float64Vec_new_i16 { /** * Function descriptor for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_i16(const int16_t *v_data, size_t v_len) + * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) * } */ - public static FunctionDescriptor Float64Vec_new_i16$descriptor() { - return Float64Vec_new_i16.DESC; + public static FunctionDescriptor OpaqueMutexedString_from_usize$descriptor() { + return OpaqueMutexedString_from_usize.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_i16(const int16_t *v_data, size_t v_len) + * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) * } */ - public static MethodHandle Float64Vec_new_i16$handle() { - return Float64Vec_new_i16.HANDLE; + public static MethodHandle OpaqueMutexedString_from_usize$handle() { + return OpaqueMutexedString_from_usize.HANDLE; } /** * Address for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_i16(const int16_t *v_data, size_t v_len) + * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) * } */ - public static MemorySegment Float64Vec_new_i16$address() { - return Float64Vec_new_i16.ADDR; + public static MemorySegment OpaqueMutexedString_from_usize$address() { + return OpaqueMutexedString_from_usize.ADDR; } /** * {@snippet lang=c : - * Float64Vec *Float64Vec_new_i16(const int16_t *v_data, size_t v_len) + * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) * } */ - public static MemorySegment Float64Vec_new_i16(MemorySegment v_data, long v_len) { - var mh$ = Float64Vec_new_i16.HANDLE; + public static MemorySegment OpaqueMutexedString_from_usize(long number) { + var mh$ = OpaqueMutexedString_from_usize.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_new_i16", v_data, v_len); + traceDowncall("OpaqueMutexedString_from_usize", number); } - return (MemorySegment)mh$.invokeExact(v_data, v_len); + return (MemorySegment)mh$.invokeExact(number); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_new_u16 { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, + private static class OpaqueMutexedString_change { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER, somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_u16"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_change"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12490,58 +12550,57 @@ private static class Float64Vec_new_u16 { /** * Function descriptor for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_u16(const uint16_t *v_data, size_t v_len) + * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) * } */ - public static FunctionDescriptor Float64Vec_new_u16$descriptor() { - return Float64Vec_new_u16.DESC; + public static FunctionDescriptor OpaqueMutexedString_change$descriptor() { + return OpaqueMutexedString_change.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_u16(const uint16_t *v_data, size_t v_len) + * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) * } */ - public static MethodHandle Float64Vec_new_u16$handle() { - return Float64Vec_new_u16.HANDLE; + public static MethodHandle OpaqueMutexedString_change$handle() { + return OpaqueMutexedString_change.HANDLE; } /** * Address for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_u16(const uint16_t *v_data, size_t v_len) + * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) * } */ - public static MemorySegment Float64Vec_new_u16$address() { - return Float64Vec_new_u16.ADDR; + public static MemorySegment OpaqueMutexedString_change$address() { + return OpaqueMutexedString_change.ADDR; } /** * {@snippet lang=c : - * Float64Vec *Float64Vec_new_u16(const uint16_t *v_data, size_t v_len) + * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) * } */ - public static MemorySegment Float64Vec_new_u16(MemorySegment v_data, long v_len) { - var mh$ = Float64Vec_new_u16.HANDLE; + public static void OpaqueMutexedString_change(MemorySegment self, long number) { + var mh$ = OpaqueMutexedString_change.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_new_u16", v_data, v_len); + traceDowncall("OpaqueMutexedString_change", self, number); } - return (MemorySegment)mh$.invokeExact(v_data, v_len); + mh$.invokeExact(self, number); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_new_isize { + private static class OpaqueMutexedString_borrow { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_isize"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_borrow"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12549,58 +12608,57 @@ private static class Float64Vec_new_isize { /** * Function descriptor for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_isize(const intptr_t *v_data, size_t v_len) + * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) * } */ - public static FunctionDescriptor Float64Vec_new_isize$descriptor() { - return Float64Vec_new_isize.DESC; + public static FunctionDescriptor OpaqueMutexedString_borrow$descriptor() { + return OpaqueMutexedString_borrow.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_isize(const intptr_t *v_data, size_t v_len) + * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) * } */ - public static MethodHandle Float64Vec_new_isize$handle() { - return Float64Vec_new_isize.HANDLE; + public static MethodHandle OpaqueMutexedString_borrow$handle() { + return OpaqueMutexedString_borrow.HANDLE; } /** * Address for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_isize(const intptr_t *v_data, size_t v_len) + * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) * } */ - public static MemorySegment Float64Vec_new_isize$address() { - return Float64Vec_new_isize.ADDR; + public static MemorySegment OpaqueMutexedString_borrow$address() { + return OpaqueMutexedString_borrow.ADDR; } /** * {@snippet lang=c : - * Float64Vec *Float64Vec_new_isize(const intptr_t *v_data, size_t v_len) + * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) * } */ - public static MemorySegment Float64Vec_new_isize(MemorySegment v_data, long v_len) { - var mh$ = Float64Vec_new_isize.HANDLE; + public static MemorySegment OpaqueMutexedString_borrow(MemorySegment self) { + var mh$ = OpaqueMutexedString_borrow.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_new_isize", v_data, v_len); + traceDowncall("OpaqueMutexedString_borrow", self); } - return (MemorySegment)mh$.invokeExact(v_data, v_len); + return (MemorySegment)mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_new_usize { + private static class OpaqueMutexedString_borrow_other { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_usize"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_borrow_other"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12608,58 +12666,58 @@ private static class Float64Vec_new_usize { /** * Function descriptor for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_usize(const size_t *v_data, size_t v_len) + * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) * } */ - public static FunctionDescriptor Float64Vec_new_usize$descriptor() { - return Float64Vec_new_usize.DESC; + public static FunctionDescriptor OpaqueMutexedString_borrow_other$descriptor() { + return OpaqueMutexedString_borrow_other.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_usize(const size_t *v_data, size_t v_len) + * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) * } */ - public static MethodHandle Float64Vec_new_usize$handle() { - return Float64Vec_new_usize.HANDLE; + public static MethodHandle OpaqueMutexedString_borrow_other$handle() { + return OpaqueMutexedString_borrow_other.HANDLE; } /** * Address for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_usize(const size_t *v_data, size_t v_len) + * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) * } */ - public static MemorySegment Float64Vec_new_usize$address() { - return Float64Vec_new_usize.ADDR; + public static MemorySegment OpaqueMutexedString_borrow_other$address() { + return OpaqueMutexedString_borrow_other.ADDR; } /** * {@snippet lang=c : - * Float64Vec *Float64Vec_new_usize(const size_t *v_data, size_t v_len) + * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) * } */ - public static MemorySegment Float64Vec_new_usize(MemorySegment v_data, long v_len) { - var mh$ = Float64Vec_new_usize.HANDLE; + public static MemorySegment OpaqueMutexedString_borrow_other(MemorySegment other) { + var mh$ = OpaqueMutexedString_borrow_other.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_new_usize", v_data, v_len); + traceDowncall("OpaqueMutexedString_borrow_other", other); } - return (MemorySegment)mh$.invokeExact(v_data, v_len); + return (MemorySegment)mh$.invokeExact(other); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_new_f64_be_bytes { + private static class OpaqueMutexedString_borrow_self_or_other { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_f64_be_bytes"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_borrow_self_or_other"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12667,58 +12725,58 @@ private static class Float64Vec_new_f64_be_bytes { /** * Function descriptor for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_f64_be_bytes(const uint8_t *v_data, size_t v_len) + * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) * } */ - public static FunctionDescriptor Float64Vec_new_f64_be_bytes$descriptor() { - return Float64Vec_new_f64_be_bytes.DESC; + public static FunctionDescriptor OpaqueMutexedString_borrow_self_or_other$descriptor() { + return OpaqueMutexedString_borrow_self_or_other.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_f64_be_bytes(const uint8_t *v_data, size_t v_len) + * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) * } */ - public static MethodHandle Float64Vec_new_f64_be_bytes$handle() { - return Float64Vec_new_f64_be_bytes.HANDLE; + public static MethodHandle OpaqueMutexedString_borrow_self_or_other$handle() { + return OpaqueMutexedString_borrow_self_or_other.HANDLE; } /** * Address for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_f64_be_bytes(const uint8_t *v_data, size_t v_len) + * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) * } */ - public static MemorySegment Float64Vec_new_f64_be_bytes$address() { - return Float64Vec_new_f64_be_bytes.ADDR; + public static MemorySegment OpaqueMutexedString_borrow_self_or_other$address() { + return OpaqueMutexedString_borrow_self_or_other.ADDR; } /** * {@snippet lang=c : - * Float64Vec *Float64Vec_new_f64_be_bytes(const uint8_t *v_data, size_t v_len) + * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) * } */ - public static MemorySegment Float64Vec_new_f64_be_bytes(MemorySegment v_data, long v_len) { - var mh$ = Float64Vec_new_f64_be_bytes.HANDLE; + public static MemorySegment OpaqueMutexedString_borrow_self_or_other(MemorySegment self, MemorySegment other) { + var mh$ = OpaqueMutexedString_borrow_self_or_other.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_new_f64_be_bytes", v_data, v_len); + traceDowncall("OpaqueMutexedString_borrow_self_or_other", self, other); } - return (MemorySegment)mh$.invokeExact(v_data, v_len); + return (MemorySegment)mh$.invokeExact(self, other); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_new_from_owned { + private static class OpaqueMutexedString_get_len_and_add { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, + somelib_h.C_LONG, somelib_h.C_POINTER, somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_from_owned"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_get_len_and_add"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12726,57 +12784,57 @@ private static class Float64Vec_new_from_owned { /** * Function descriptor for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_from_owned(double *v_data, size_t v_len) + * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) * } */ - public static FunctionDescriptor Float64Vec_new_from_owned$descriptor() { - return Float64Vec_new_from_owned.DESC; + public static FunctionDescriptor OpaqueMutexedString_get_len_and_add$descriptor() { + return OpaqueMutexedString_get_len_and_add.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_from_owned(double *v_data, size_t v_len) + * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) * } */ - public static MethodHandle Float64Vec_new_from_owned$handle() { - return Float64Vec_new_from_owned.HANDLE; + public static MethodHandle OpaqueMutexedString_get_len_and_add$handle() { + return OpaqueMutexedString_get_len_and_add.HANDLE; } /** * Address for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_from_owned(double *v_data, size_t v_len) + * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) * } */ - public static MemorySegment Float64Vec_new_from_owned$address() { - return Float64Vec_new_from_owned.ADDR; + public static MemorySegment OpaqueMutexedString_get_len_and_add$address() { + return OpaqueMutexedString_get_len_and_add.ADDR; } /** * {@snippet lang=c : - * Float64Vec *Float64Vec_new_from_owned(double *v_data, size_t v_len) + * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) * } */ - public static MemorySegment Float64Vec_new_from_owned(MemorySegment v_data, long v_len) { - var mh$ = Float64Vec_new_from_owned.HANDLE; + public static long OpaqueMutexedString_get_len_and_add(MemorySegment self, long other) { + var mh$ = OpaqueMutexedString_get_len_and_add.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_new_from_owned", v_data, v_len); + traceDowncall("OpaqueMutexedString_get_len_and_add", self, other); } - return (MemorySegment)mh$.invokeExact(v_data, v_len); + return (long)mh$.invokeExact(self, other); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_as_slice { + private static class OpaqueMutexedString_dummy_str { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - DiplomatF64View.layout(), + DiplomatStringView.layout(), somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_as_slice"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_dummy_str"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12784,43 +12842,43 @@ private static class Float64Vec_as_slice { /** * Function descriptor for: * {@snippet lang=c : - * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) + * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) * } */ - public static FunctionDescriptor Float64Vec_as_slice$descriptor() { - return Float64Vec_as_slice.DESC; + public static FunctionDescriptor OpaqueMutexedString_dummy_str$descriptor() { + return OpaqueMutexedString_dummy_str.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) + * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) * } */ - public static MethodHandle Float64Vec_as_slice$handle() { - return Float64Vec_as_slice.HANDLE; + public static MethodHandle OpaqueMutexedString_dummy_str$handle() { + return OpaqueMutexedString_dummy_str.HANDLE; } /** * Address for: * {@snippet lang=c : - * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) + * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) * } */ - public static MemorySegment Float64Vec_as_slice$address() { - return Float64Vec_as_slice.ADDR; + public static MemorySegment OpaqueMutexedString_dummy_str$address() { + return OpaqueMutexedString_dummy_str.ADDR; } /** * {@snippet lang=c : - * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) + * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) * } */ - public static MemorySegment Float64Vec_as_slice(SegmentAllocator allocator, MemorySegment self) { - var mh$ = Float64Vec_as_slice.HANDLE; + public static MemorySegment OpaqueMutexedString_dummy_str(SegmentAllocator allocator, MemorySegment self) { + var mh$ = OpaqueMutexedString_dummy_str.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_as_slice", allocator, self); + traceDowncall("OpaqueMutexedString_dummy_str", allocator, self); } return (MemorySegment)mh$.invokeExact(allocator, self); } catch (Throwable ex$) { @@ -12828,14 +12886,13 @@ public static MemorySegment Float64Vec_as_slice(SegmentAllocator allocator, Memo } } - private static class Float64Vec_fill_slice { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER, + private static class OpaqueMutexedString_wrapper { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_fill_slice"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_wrapper"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12843,58 +12900,56 @@ private static class Float64Vec_fill_slice { /** * Function descriptor for: * {@snippet lang=c : - * void Float64Vec_fill_slice(const Float64Vec *self, double *v_data, size_t v_len) + * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) * } */ - public static FunctionDescriptor Float64Vec_fill_slice$descriptor() { - return Float64Vec_fill_slice.DESC; + public static FunctionDescriptor OpaqueMutexedString_wrapper$descriptor() { + return OpaqueMutexedString_wrapper.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Float64Vec_fill_slice(const Float64Vec *self, double *v_data, size_t v_len) + * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) * } */ - public static MethodHandle Float64Vec_fill_slice$handle() { - return Float64Vec_fill_slice.HANDLE; + public static MethodHandle OpaqueMutexedString_wrapper$handle() { + return OpaqueMutexedString_wrapper.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Float64Vec_fill_slice(const Float64Vec *self, double *v_data, size_t v_len) + * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) * } */ - public static MemorySegment Float64Vec_fill_slice$address() { - return Float64Vec_fill_slice.ADDR; + public static MemorySegment OpaqueMutexedString_wrapper$address() { + return OpaqueMutexedString_wrapper.ADDR; } /** * {@snippet lang=c : - * void Float64Vec_fill_slice(const Float64Vec *self, double *v_data, size_t v_len) + * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) * } */ - public static void Float64Vec_fill_slice(MemorySegment self, MemorySegment v_data, long v_len) { - var mh$ = Float64Vec_fill_slice.HANDLE; + public static MemorySegment OpaqueMutexedString_wrapper(MemorySegment self) { + var mh$ = OpaqueMutexedString_wrapper.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_fill_slice", self, v_data, v_len); + traceDowncall("OpaqueMutexedString_wrapper", self); } - mh$.invokeExact(self, v_data, v_len); + return (MemorySegment)mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_set_value { + private static class OpaqueMutexedString_destroy { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_set_value"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12902,57 +12957,55 @@ private static class Float64Vec_set_value { /** * Function descriptor for: * {@snippet lang=c : - * void Float64Vec_set_value(Float64Vec *self, const double *new_slice_data, size_t new_slice_len) + * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) * } */ - public static FunctionDescriptor Float64Vec_set_value$descriptor() { - return Float64Vec_set_value.DESC; + public static FunctionDescriptor OpaqueMutexedString_destroy$descriptor() { + return OpaqueMutexedString_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Float64Vec_set_value(Float64Vec *self, const double *new_slice_data, size_t new_slice_len) + * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) * } */ - public static MethodHandle Float64Vec_set_value$handle() { - return Float64Vec_set_value.HANDLE; + public static MethodHandle OpaqueMutexedString_destroy$handle() { + return OpaqueMutexedString_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Float64Vec_set_value(Float64Vec *self, const double *new_slice_data, size_t new_slice_len) + * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) * } */ - public static MemorySegment Float64Vec_set_value$address() { - return Float64Vec_set_value.ADDR; + public static MemorySegment OpaqueMutexedString_destroy$address() { + return OpaqueMutexedString_destroy.ADDR; } /** * {@snippet lang=c : - * void Float64Vec_set_value(Float64Vec *self, const double *new_slice_data, size_t new_slice_len) + * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) * } */ - public static void Float64Vec_set_value(MemorySegment self, MemorySegment new_slice_data, long new_slice_len) { - var mh$ = Float64Vec_set_value.HANDLE; + public static void OpaqueMutexedString_destroy(MemorySegment self) { + var mh$ = OpaqueMutexedString_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_set_value", self, new_slice_data, new_slice_len); + traceDowncall("OpaqueMutexedString_destroy", self); } - mh$.invokeExact(self, new_slice_data, new_slice_len); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_to_string { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); + private static class CyclicStructB_get_a { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + CyclicStructA.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_to_string"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("CyclicStructB_get_a"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12960,57 +13013,91 @@ private static class Float64Vec_to_string { /** * Function descriptor for: * {@snippet lang=c : - * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) + * CyclicStructA CyclicStructB_get_a() * } */ - public static FunctionDescriptor Float64Vec_to_string$descriptor() { - return Float64Vec_to_string.DESC; + public static FunctionDescriptor CyclicStructB_get_a$descriptor() { + return CyclicStructB_get_a.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) + * CyclicStructA CyclicStructB_get_a() * } */ - public static MethodHandle Float64Vec_to_string$handle() { - return Float64Vec_to_string.HANDLE; + public static MethodHandle CyclicStructB_get_a$handle() { + return CyclicStructB_get_a.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) + * CyclicStructA CyclicStructB_get_a() * } */ - public static MemorySegment Float64Vec_to_string$address() { - return Float64Vec_to_string.ADDR; + public static MemorySegment CyclicStructB_get_a$address() { + return CyclicStructB_get_a.ADDR; } /** * {@snippet lang=c : - * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) + * CyclicStructA CyclicStructB_get_a() * } */ - public static void Float64Vec_to_string(MemorySegment self, MemorySegment write) { - var mh$ = Float64Vec_to_string.HANDLE; + public static MemorySegment CyclicStructB_get_a(SegmentAllocator allocator) { + var mh$ = CyclicStructB_get_a.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_to_string", self, write); + traceDowncall("CyclicStructB_get_a", allocator); } - mh$.invokeExact(self, write); + return (MemorySegment)mh$.invokeExact(allocator); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } + private static final int ContiguousEnum_C = (int)0L; + /** + * {@snippet lang=c : + * enum ContiguousEnum.ContiguousEnum_C = 0 + * } + */ + public static int ContiguousEnum_C() { + return ContiguousEnum_C; + } + private static final int ContiguousEnum_D = (int)1L; + /** + * {@snippet lang=c : + * enum ContiguousEnum.ContiguousEnum_D = 1 + * } + */ + public static int ContiguousEnum_D() { + return ContiguousEnum_D; + } + private static final int ContiguousEnum_E = (int)2L; + /** + * {@snippet lang=c : + * enum ContiguousEnum.ContiguousEnum_E = 2 + * } + */ + public static int ContiguousEnum_E() { + return ContiguousEnum_E; + } + private static final int ContiguousEnum_F = (int)3L; + /** + * {@snippet lang=c : + * enum ContiguousEnum.ContiguousEnum_F = 3 + * } + */ + public static int ContiguousEnum_F() { + return ContiguousEnum_F; + } - private static class Float64Vec_borrow { + private static class Opaque_new { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - DiplomatF64View.layout(), - somelib_h.C_POINTER - ); + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_borrow"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_new"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13018,56 +13105,58 @@ private static class Float64Vec_borrow { /** * Function descriptor for: * {@snippet lang=c : - * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) + * Opaque *Opaque_new() * } */ - public static FunctionDescriptor Float64Vec_borrow$descriptor() { - return Float64Vec_borrow.DESC; + public static FunctionDescriptor Opaque_new$descriptor() { + return Opaque_new.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) + * Opaque *Opaque_new() * } */ - public static MethodHandle Float64Vec_borrow$handle() { - return Float64Vec_borrow.HANDLE; + public static MethodHandle Opaque_new$handle() { + return Opaque_new.HANDLE; } /** * Address for: * {@snippet lang=c : - * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) + * Opaque *Opaque_new() * } */ - public static MemorySegment Float64Vec_borrow$address() { - return Float64Vec_borrow.ADDR; + public static MemorySegment Opaque_new$address() { + return Opaque_new.ADDR; } /** * {@snippet lang=c : - * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) + * Opaque *Opaque_new() * } */ - public static MemorySegment Float64Vec_borrow(SegmentAllocator allocator, MemorySegment self) { - var mh$ = Float64Vec_borrow.HANDLE; + public static MemorySegment Opaque_new() { + var mh$ = Opaque_new.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_borrow", allocator, self); + traceDowncall("Opaque_new"); } - return (MemorySegment)mh$.invokeExact(allocator, self); + return (MemorySegment)mh$.invokeExact(); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER + private static class Opaque_from_str { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_from_str"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13075,61 +13164,57 @@ private static class Float64Vec_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void Float64Vec_destroy(Float64Vec *self) + * Opaque *Opaque_from_str(const char *input_data, size_t input_len) * } */ - public static FunctionDescriptor Float64Vec_destroy$descriptor() { - return Float64Vec_destroy.DESC; + public static FunctionDescriptor Opaque_from_str$descriptor() { + return Opaque_from_str.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Float64Vec_destroy(Float64Vec *self) + * Opaque *Opaque_from_str(const char *input_data, size_t input_len) * } */ - public static MethodHandle Float64Vec_destroy$handle() { - return Float64Vec_destroy.HANDLE; + public static MethodHandle Opaque_from_str$handle() { + return Opaque_from_str.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Float64Vec_destroy(Float64Vec *self) + * Opaque *Opaque_from_str(const char *input_data, size_t input_len) * } */ - public static MemorySegment Float64Vec_destroy$address() { - return Float64Vec_destroy.ADDR; + public static MemorySegment Opaque_from_str$address() { + return Opaque_from_str.ADDR; } /** * {@snippet lang=c : - * void Float64Vec_destroy(Float64Vec *self) + * Opaque *Opaque_from_str(const char *input_data, size_t input_len) * } */ - public static void Float64Vec_destroy(MemorySegment self) { - var mh$ = Float64Vec_destroy.HANDLE; + public static MemorySegment Opaque_from_str(MemorySegment input_data, long input_len) { + var mh$ = Opaque_from_str.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_destroy", self); + traceDowncall("Opaque_from_str", input_data, input_len); } - mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(input_data, input_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class BorrowedFields_from_bar_and_strings { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - BorrowedFields.layout(), - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG, + private static class Opaque_get_debug_str { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("BorrowedFields_from_bar_and_strings"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_get_debug_str"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13137,57 +13222,57 @@ private static class BorrowedFields_from_bar_and_strings { /** * Function descriptor for: * {@snippet lang=c : - * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, const char16_t *dstr16_data, size_t dstr16_len, const char *utf8_str_data, size_t utf8_str_len) + * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) * } */ - public static FunctionDescriptor BorrowedFields_from_bar_and_strings$descriptor() { - return BorrowedFields_from_bar_and_strings.DESC; + public static FunctionDescriptor Opaque_get_debug_str$descriptor() { + return Opaque_get_debug_str.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, const char16_t *dstr16_data, size_t dstr16_len, const char *utf8_str_data, size_t utf8_str_len) + * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) * } */ - public static MethodHandle BorrowedFields_from_bar_and_strings$handle() { - return BorrowedFields_from_bar_and_strings.HANDLE; + public static MethodHandle Opaque_get_debug_str$handle() { + return Opaque_get_debug_str.HANDLE; } /** * Address for: * {@snippet lang=c : - * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, const char16_t *dstr16_data, size_t dstr16_len, const char *utf8_str_data, size_t utf8_str_len) + * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) * } */ - public static MemorySegment BorrowedFields_from_bar_and_strings$address() { - return BorrowedFields_from_bar_and_strings.ADDR; + public static MemorySegment Opaque_get_debug_str$address() { + return Opaque_get_debug_str.ADDR; } /** * {@snippet lang=c : - * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, const char16_t *dstr16_data, size_t dstr16_len, const char *utf8_str_data, size_t utf8_str_len) + * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) * } */ - public static MemorySegment BorrowedFields_from_bar_and_strings(SegmentAllocator allocator, MemorySegment bar, MemorySegment dstr16_data, long dstr16_len, MemorySegment utf8_str_data, long utf8_str_len) { - var mh$ = BorrowedFields_from_bar_and_strings.HANDLE; + public static void Opaque_get_debug_str(MemorySegment self, MemorySegment write) { + var mh$ = Opaque_get_debug_str.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("BorrowedFields_from_bar_and_strings", allocator, bar, dstr16_data, dstr16_len, utf8_str_data, utf8_str_len); + traceDowncall("Opaque_get_debug_str", self, write); } - return (MemorySegment)mh$.invokeExact(allocator, bar, dstr16_data, dstr16_len, utf8_str_data, utf8_str_len); + mh$.invokeExact(self, write); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class RefList_node { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( + private static class Opaque_assert_struct { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER, - somelib_h.C_POINTER + MyStruct.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("RefList_node"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_assert_struct"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13195,56 +13280,55 @@ private static class RefList_node { /** * Function descriptor for: * {@snippet lang=c : - * RefList *RefList_node(const RefListParameter *data) + * void Opaque_assert_struct(const Opaque *self, MyStruct s) * } */ - public static FunctionDescriptor RefList_node$descriptor() { - return RefList_node.DESC; + public static FunctionDescriptor Opaque_assert_struct$descriptor() { + return Opaque_assert_struct.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * RefList *RefList_node(const RefListParameter *data) + * void Opaque_assert_struct(const Opaque *self, MyStruct s) * } */ - public static MethodHandle RefList_node$handle() { - return RefList_node.HANDLE; + public static MethodHandle Opaque_assert_struct$handle() { + return Opaque_assert_struct.HANDLE; } /** * Address for: * {@snippet lang=c : - * RefList *RefList_node(const RefListParameter *data) + * void Opaque_assert_struct(const Opaque *self, MyStruct s) * } */ - public static MemorySegment RefList_node$address() { - return RefList_node.ADDR; + public static MemorySegment Opaque_assert_struct$address() { + return Opaque_assert_struct.ADDR; } /** * {@snippet lang=c : - * RefList *RefList_node(const RefListParameter *data) + * void Opaque_assert_struct(const Opaque *self, MyStruct s) * } */ - public static MemorySegment RefList_node(MemorySegment data) { - var mh$ = RefList_node.HANDLE; + public static void Opaque_assert_struct(MemorySegment self, MemorySegment s) { + var mh$ = Opaque_assert_struct.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("RefList_node", data); + traceDowncall("Opaque_assert_struct", self, s); } - return (MemorySegment)mh$.invokeExact(data); + mh$.invokeExact(self, s); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class RefList_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER - ); + private static class Opaque_returns_usize { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("RefList_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_returns_usize"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13252,55 +13336,57 @@ private static class RefList_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void RefList_destroy(RefList *self) + * size_t Opaque_returns_usize() * } */ - public static FunctionDescriptor RefList_destroy$descriptor() { - return RefList_destroy.DESC; + public static FunctionDescriptor Opaque_returns_usize$descriptor() { + return Opaque_returns_usize.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void RefList_destroy(RefList *self) + * size_t Opaque_returns_usize() * } */ - public static MethodHandle RefList_destroy$handle() { - return RefList_destroy.HANDLE; + public static MethodHandle Opaque_returns_usize$handle() { + return Opaque_returns_usize.HANDLE; } /** * Address for: * {@snippet lang=c : - * void RefList_destroy(RefList *self) + * size_t Opaque_returns_usize() * } */ - public static MemorySegment RefList_destroy$address() { - return RefList_destroy.ADDR; + public static MemorySegment Opaque_returns_usize$address() { + return Opaque_returns_usize.ADDR; } /** * {@snippet lang=c : - * void RefList_destroy(RefList *self) + * size_t Opaque_returns_usize() * } */ - public static void RefList_destroy(MemorySegment self) { - var mh$ = RefList_destroy.HANDLE; + public static long Opaque_returns_usize() { + var mh$ = Opaque_returns_usize.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("RefList_destroy", self); + traceDowncall("Opaque_returns_usize"); } - mh$.invokeExact(self); + return (long)mh$.invokeExact(); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class CyclicStructB_get_a { + private static class Opaque_internal_len { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - CyclicStructA.layout() ); + somelib_h.C_LONG, + somelib_h.C_POINTER + ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("CyclicStructB_get_a"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_internal_len"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13308,56 +13394,55 @@ private static class CyclicStructB_get_a { /** * Function descriptor for: * {@snippet lang=c : - * CyclicStructA CyclicStructB_get_a() + * size_t Opaque_internal_len(const Opaque *self) * } */ - public static FunctionDescriptor CyclicStructB_get_a$descriptor() { - return CyclicStructB_get_a.DESC; + public static FunctionDescriptor Opaque_internal_len$descriptor() { + return Opaque_internal_len.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * CyclicStructA CyclicStructB_get_a() + * size_t Opaque_internal_len(const Opaque *self) * } */ - public static MethodHandle CyclicStructB_get_a$handle() { - return CyclicStructB_get_a.HANDLE; + public static MethodHandle Opaque_internal_len$handle() { + return Opaque_internal_len.HANDLE; } /** * Address for: * {@snippet lang=c : - * CyclicStructA CyclicStructB_get_a() + * size_t Opaque_internal_len(const Opaque *self) * } */ - public static MemorySegment CyclicStructB_get_a$address() { - return CyclicStructB_get_a.ADDR; + public static MemorySegment Opaque_internal_len$address() { + return Opaque_internal_len.ADDR; } /** * {@snippet lang=c : - * CyclicStructA CyclicStructB_get_a() + * size_t Opaque_internal_len(const Opaque *self) * } */ - public static MemorySegment CyclicStructB_get_a(SegmentAllocator allocator) { - var mh$ = CyclicStructB_get_a.HANDLE; + public static long Opaque_internal_len(MemorySegment self) { + var mh$ = Opaque_internal_len.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("CyclicStructB_get_a", allocator); + traceDowncall("Opaque_internal_len", self); } - return (MemorySegment)mh$.invokeExact(allocator); + return (long)mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Two_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER - ); + private static class Opaque_returns_imported { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + ImportedStruct.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Two_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_returns_imported"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13365,58 +13450,55 @@ private static class Two_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void Two_destroy(Two *self) + * ImportedStruct Opaque_returns_imported() * } */ - public static FunctionDescriptor Two_destroy$descriptor() { - return Two_destroy.DESC; + public static FunctionDescriptor Opaque_returns_imported$descriptor() { + return Opaque_returns_imported.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Two_destroy(Two *self) + * ImportedStruct Opaque_returns_imported() * } */ - public static MethodHandle Two_destroy$handle() { - return Two_destroy.HANDLE; + public static MethodHandle Opaque_returns_imported$handle() { + return Opaque_returns_imported.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Two_destroy(Two *self) + * ImportedStruct Opaque_returns_imported() * } */ - public static MemorySegment Two_destroy$address() { - return Two_destroy.ADDR; + public static MemorySegment Opaque_returns_imported$address() { + return Opaque_returns_imported.ADDR; } /** * {@snippet lang=c : - * void Two_destroy(Two *self) + * ImportedStruct Opaque_returns_imported() * } */ - public static void Two_destroy(MemorySegment self) { - var mh$ = Two_destroy.HANDLE; + public static MemorySegment Opaque_returns_imported(SegmentAllocator allocator) { + var mh$ = Opaque_returns_imported.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Two_destroy", self); + traceDowncall("Opaque_returns_imported", allocator); } - mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(allocator); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyString_new { + private static class Opaque_cmp { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG - ); + somelib_h.C_CHAR ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_cmp"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13424,58 +13506,56 @@ private static class MyString_new { /** * Function descriptor for: * {@snippet lang=c : - * MyString *MyString_new(const char *v_data, size_t v_len) + * int8_t Opaque_cmp() * } */ - public static FunctionDescriptor MyString_new$descriptor() { - return MyString_new.DESC; + public static FunctionDescriptor Opaque_cmp$descriptor() { + return Opaque_cmp.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * MyString *MyString_new(const char *v_data, size_t v_len) + * int8_t Opaque_cmp() * } */ - public static MethodHandle MyString_new$handle() { - return MyString_new.HANDLE; + public static MethodHandle Opaque_cmp$handle() { + return Opaque_cmp.HANDLE; } /** * Address for: * {@snippet lang=c : - * MyString *MyString_new(const char *v_data, size_t v_len) + * int8_t Opaque_cmp() * } */ - public static MemorySegment MyString_new$address() { - return MyString_new.ADDR; + public static MemorySegment Opaque_cmp$address() { + return Opaque_cmp.ADDR; } /** * {@snippet lang=c : - * MyString *MyString_new(const char *v_data, size_t v_len) + * int8_t Opaque_cmp() * } */ - public static MemorySegment MyString_new(MemorySegment v_data, long v_len) { - var mh$ = MyString_new.HANDLE; + public static byte Opaque_cmp() { + var mh$ = Opaque_cmp.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyString_new", v_data, v_len); + traceDowncall("Opaque_cmp"); } - return (MemorySegment)mh$.invokeExact(v_data, v_len); + return (byte)mh$.invokeExact(); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyString_new_unsafe { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG + private static class Opaque_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new_unsafe"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13483,58 +13563,58 @@ private static class MyString_new_unsafe { /** * Function descriptor for: * {@snippet lang=c : - * MyString *MyString_new_unsafe(const char *v_data, size_t v_len) + * void Opaque_destroy(Opaque *self) * } */ - public static FunctionDescriptor MyString_new_unsafe$descriptor() { - return MyString_new_unsafe.DESC; + public static FunctionDescriptor Opaque_destroy$descriptor() { + return Opaque_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * MyString *MyString_new_unsafe(const char *v_data, size_t v_len) + * void Opaque_destroy(Opaque *self) * } */ - public static MethodHandle MyString_new_unsafe$handle() { - return MyString_new_unsafe.HANDLE; + public static MethodHandle Opaque_destroy$handle() { + return Opaque_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * MyString *MyString_new_unsafe(const char *v_data, size_t v_len) + * void Opaque_destroy(Opaque *self) * } */ - public static MemorySegment MyString_new_unsafe$address() { - return MyString_new_unsafe.ADDR; + public static MemorySegment Opaque_destroy$address() { + return Opaque_destroy.ADDR; } /** * {@snippet lang=c : - * MyString *MyString_new_unsafe(const char *v_data, size_t v_len) + * void Opaque_destroy(Opaque *self) * } */ - public static MemorySegment MyString_new_unsafe(MemorySegment v_data, long v_len) { - var mh$ = MyString_new_unsafe.HANDLE; + public static void Opaque_destroy(MemorySegment self) { + var mh$ = Opaque_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyString_new_unsafe", v_data, v_len); + traceDowncall("Opaque_destroy", self); } - return (MemorySegment)mh$.invokeExact(v_data, v_len); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyString_new_owned { + private static class Foo_new { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new_owned"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_new"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13542,58 +13622,57 @@ private static class MyString_new_owned { /** * Function descriptor for: * {@snippet lang=c : - * MyString *MyString_new_owned(const char *v_data, size_t v_len) + * Foo *Foo_new(const char *x_data, size_t x_len) * } */ - public static FunctionDescriptor MyString_new_owned$descriptor() { - return MyString_new_owned.DESC; + public static FunctionDescriptor Foo_new$descriptor() { + return Foo_new.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * MyString *MyString_new_owned(const char *v_data, size_t v_len) + * Foo *Foo_new(const char *x_data, size_t x_len) * } */ - public static MethodHandle MyString_new_owned$handle() { - return MyString_new_owned.HANDLE; + public static MethodHandle Foo_new$handle() { + return Foo_new.HANDLE; } /** * Address for: * {@snippet lang=c : - * MyString *MyString_new_owned(const char *v_data, size_t v_len) + * Foo *Foo_new(const char *x_data, size_t x_len) * } */ - public static MemorySegment MyString_new_owned$address() { - return MyString_new_owned.ADDR; + public static MemorySegment Foo_new$address() { + return Foo_new.ADDR; } /** * {@snippet lang=c : - * MyString *MyString_new_owned(const char *v_data, size_t v_len) + * Foo *Foo_new(const char *x_data, size_t x_len) * } */ - public static MemorySegment MyString_new_owned(MemorySegment v_data, long v_len) { - var mh$ = MyString_new_owned.HANDLE; + public static MemorySegment Foo_new(MemorySegment x_data, long x_len) { + var mh$ = Foo_new.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyString_new_owned", v_data, v_len); + traceDowncall("Foo_new", x_data, x_len); } - return (MemorySegment)mh$.invokeExact(v_data, v_len); + return (MemorySegment)mh$.invokeExact(x_data, x_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyString_new_from_first { + private static class Foo_get_bar { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new_from_first"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_get_bar"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13601,58 +13680,58 @@ private static class MyString_new_from_first { /** * Function descriptor for: * {@snippet lang=c : - * MyString *MyString_new_from_first(DiplomatStringsView *v_data, size_t v_len) + * Bar *Foo_get_bar(const Foo *self) * } */ - public static FunctionDescriptor MyString_new_from_first$descriptor() { - return MyString_new_from_first.DESC; + public static FunctionDescriptor Foo_get_bar$descriptor() { + return Foo_get_bar.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * MyString *MyString_new_from_first(DiplomatStringsView *v_data, size_t v_len) + * Bar *Foo_get_bar(const Foo *self) * } */ - public static MethodHandle MyString_new_from_first$handle() { - return MyString_new_from_first.HANDLE; + public static MethodHandle Foo_get_bar$handle() { + return Foo_get_bar.HANDLE; } /** * Address for: * {@snippet lang=c : - * MyString *MyString_new_from_first(DiplomatStringsView *v_data, size_t v_len) + * Bar *Foo_get_bar(const Foo *self) * } */ - public static MemorySegment MyString_new_from_first$address() { - return MyString_new_from_first.ADDR; + public static MemorySegment Foo_get_bar$address() { + return Foo_get_bar.ADDR; } /** * {@snippet lang=c : - * MyString *MyString_new_from_first(DiplomatStringsView *v_data, size_t v_len) + * Bar *Foo_get_bar(const Foo *self) * } */ - public static MemorySegment MyString_new_from_first(MemorySegment v_data, long v_len) { - var mh$ = MyString_new_from_first.HANDLE; + public static MemorySegment Foo_get_bar(MemorySegment self) { + var mh$ = Foo_get_bar.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyString_new_from_first", v_data, v_len); + traceDowncall("Foo_get_bar", self); } - return (MemorySegment)mh$.invokeExact(v_data, v_len); + return (MemorySegment)mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyString_set_str { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class Foo_new_static { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_set_str"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_new_static"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13660,57 +13739,57 @@ private static class MyString_set_str { /** * Function descriptor for: * {@snippet lang=c : - * void MyString_set_str(MyString *self, const char *new_str_data, size_t new_str_len) + * Foo *Foo_new_static(const char *x_data, size_t x_len) * } */ - public static FunctionDescriptor MyString_set_str$descriptor() { - return MyString_set_str.DESC; + public static FunctionDescriptor Foo_new_static$descriptor() { + return Foo_new_static.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void MyString_set_str(MyString *self, const char *new_str_data, size_t new_str_len) + * Foo *Foo_new_static(const char *x_data, size_t x_len) * } */ - public static MethodHandle MyString_set_str$handle() { - return MyString_set_str.HANDLE; + public static MethodHandle Foo_new_static$handle() { + return Foo_new_static.HANDLE; } /** * Address for: * {@snippet lang=c : - * void MyString_set_str(MyString *self, const char *new_str_data, size_t new_str_len) + * Foo *Foo_new_static(const char *x_data, size_t x_len) * } */ - public static MemorySegment MyString_set_str$address() { - return MyString_set_str.ADDR; + public static MemorySegment Foo_new_static$address() { + return Foo_new_static.ADDR; } /** * {@snippet lang=c : - * void MyString_set_str(MyString *self, const char *new_str_data, size_t new_str_len) + * Foo *Foo_new_static(const char *x_data, size_t x_len) * } */ - public static void MyString_set_str(MemorySegment self, MemorySegment new_str_data, long new_str_len) { - var mh$ = MyString_set_str.HANDLE; + public static MemorySegment Foo_new_static(MemorySegment x_data, long x_len) { + var mh$ = Foo_new_static.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyString_set_str", self, new_str_data, new_str_len); + traceDowncall("Foo_new_static", x_data, x_len); } - mh$.invokeExact(self, new_str_data, new_str_len); + return (MemorySegment)mh$.invokeExact(x_data, x_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyString_get_str { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER, + private static class Foo_as_returning { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + BorrowedFieldsReturning.layout(), somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_get_str"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_as_returning"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13718,58 +13797,57 @@ private static class MyString_get_str { /** * Function descriptor for: * {@snippet lang=c : - * void MyString_get_str(const MyString *self, DiplomatWrite *write) + * BorrowedFieldsReturning Foo_as_returning(const Foo *self) * } */ - public static FunctionDescriptor MyString_get_str$descriptor() { - return MyString_get_str.DESC; + public static FunctionDescriptor Foo_as_returning$descriptor() { + return Foo_as_returning.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void MyString_get_str(const MyString *self, DiplomatWrite *write) + * BorrowedFieldsReturning Foo_as_returning(const Foo *self) * } */ - public static MethodHandle MyString_get_str$handle() { - return MyString_get_str.HANDLE; + public static MethodHandle Foo_as_returning$handle() { + return Foo_as_returning.HANDLE; } /** * Address for: * {@snippet lang=c : - * void MyString_get_str(const MyString *self, DiplomatWrite *write) + * BorrowedFieldsReturning Foo_as_returning(const Foo *self) * } */ - public static MemorySegment MyString_get_str$address() { - return MyString_get_str.ADDR; + public static MemorySegment Foo_as_returning$address() { + return Foo_as_returning.ADDR; } /** * {@snippet lang=c : - * void MyString_get_str(const MyString *self, DiplomatWrite *write) + * BorrowedFieldsReturning Foo_as_returning(const Foo *self) * } */ - public static void MyString_get_str(MemorySegment self, MemorySegment write) { - var mh$ = MyString_get_str.HANDLE; + public static MemorySegment Foo_as_returning(SegmentAllocator allocator, MemorySegment self) { + var mh$ = Foo_as_returning.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyString_get_str", self, write); + traceDowncall("Foo_as_returning", allocator, self); } - mh$.invokeExact(self, write); + return (MemorySegment)mh$.invokeExact(allocator, self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyString_string_transform { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class Foo_extract_from_fields { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - somelib_h.C_LONG, - somelib_h.C_POINTER + BorrowedFields.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_string_transform"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_extract_from_fields"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13777,56 +13855,59 @@ private static class MyString_string_transform { /** * Function descriptor for: * {@snippet lang=c : - * void MyString_string_transform(const char *foo_data, size_t foo_len, DiplomatWrite *write) + * Foo *Foo_extract_from_fields(BorrowedFields fields) * } */ - public static FunctionDescriptor MyString_string_transform$descriptor() { - return MyString_string_transform.DESC; + public static FunctionDescriptor Foo_extract_from_fields$descriptor() { + return Foo_extract_from_fields.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void MyString_string_transform(const char *foo_data, size_t foo_len, DiplomatWrite *write) + * Foo *Foo_extract_from_fields(BorrowedFields fields) * } */ - public static MethodHandle MyString_string_transform$handle() { - return MyString_string_transform.HANDLE; + public static MethodHandle Foo_extract_from_fields$handle() { + return Foo_extract_from_fields.HANDLE; } /** * Address for: * {@snippet lang=c : - * void MyString_string_transform(const char *foo_data, size_t foo_len, DiplomatWrite *write) + * Foo *Foo_extract_from_fields(BorrowedFields fields) * } */ - public static MemorySegment MyString_string_transform$address() { - return MyString_string_transform.ADDR; + public static MemorySegment Foo_extract_from_fields$address() { + return Foo_extract_from_fields.ADDR; } /** * {@snippet lang=c : - * void MyString_string_transform(const char *foo_data, size_t foo_len, DiplomatWrite *write) + * Foo *Foo_extract_from_fields(BorrowedFields fields) * } */ - public static void MyString_string_transform(MemorySegment foo_data, long foo_len, MemorySegment write) { - var mh$ = MyString_string_transform.HANDLE; + public static MemorySegment Foo_extract_from_fields(MemorySegment fields) { + var mh$ = Foo_extract_from_fields.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyString_string_transform", foo_data, foo_len, write); + traceDowncall("Foo_extract_from_fields", fields); } - mh$.invokeExact(foo_data, foo_len, write); + return (MemorySegment)mh$.invokeExact(fields); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyString_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER + private static class Foo_extract_from_bounds { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + BorrowedFieldsWithBounds.layout(), + somelib_h.C_POINTER, + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_extract_from_bounds"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13834,61 +13915,56 @@ private static class MyString_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void MyString_destroy(MyString *self) + * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, const char *another_string_data, size_t another_string_len) * } */ - public static FunctionDescriptor MyString_destroy$descriptor() { - return MyString_destroy.DESC; + public static FunctionDescriptor Foo_extract_from_bounds$descriptor() { + return Foo_extract_from_bounds.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void MyString_destroy(MyString *self) + * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, const char *another_string_data, size_t another_string_len) * } */ - public static MethodHandle MyString_destroy$handle() { - return MyString_destroy.HANDLE; + public static MethodHandle Foo_extract_from_bounds$handle() { + return Foo_extract_from_bounds.HANDLE; } /** * Address for: * {@snippet lang=c : - * void MyString_destroy(MyString *self) + * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, const char *another_string_data, size_t another_string_len) * } */ - public static MemorySegment MyString_destroy$address() { - return MyString_destroy.ADDR; + public static MemorySegment Foo_extract_from_bounds$address() { + return Foo_extract_from_bounds.ADDR; } /** * {@snippet lang=c : - * void MyString_destroy(MyString *self) + * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, const char *another_string_data, size_t another_string_len) * } */ - public static void MyString_destroy(MemorySegment self) { - var mh$ = MyString_destroy.HANDLE; + public static MemorySegment Foo_extract_from_bounds(MemorySegment bounds, MemorySegment another_string_data, long another_string_len) { + var mh$ = Foo_extract_from_bounds.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyString_destroy", self); + traceDowncall("Foo_extract_from_bounds", bounds, another_string_data, another_string_len); } - mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(bounds, another_string_data, another_string_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class BorrowedFieldsWithBounds_from_foo_and_strings { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - BorrowedFieldsWithBounds.layout(), - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG, - somelib_h.C_POINTER, - somelib_h.C_LONG + private static class Foo_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("BorrowedFieldsWithBounds_from_foo_and_strings"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13896,55 +13972,56 @@ private static class BorrowedFieldsWithBounds_from_foo_and_strings { /** * Function descriptor for: * {@snippet lang=c : - * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char *utf8_str_z_data, size_t utf8_str_z_len) + * void Foo_destroy(Foo *self) * } */ - public static FunctionDescriptor BorrowedFieldsWithBounds_from_foo_and_strings$descriptor() { - return BorrowedFieldsWithBounds_from_foo_and_strings.DESC; + public static FunctionDescriptor Foo_destroy$descriptor() { + return Foo_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char *utf8_str_z_data, size_t utf8_str_z_len) + * void Foo_destroy(Foo *self) * } */ - public static MethodHandle BorrowedFieldsWithBounds_from_foo_and_strings$handle() { - return BorrowedFieldsWithBounds_from_foo_and_strings.HANDLE; + public static MethodHandle Foo_destroy$handle() { + return Foo_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char *utf8_str_z_data, size_t utf8_str_z_len) + * void Foo_destroy(Foo *self) * } */ - public static MemorySegment BorrowedFieldsWithBounds_from_foo_and_strings$address() { - return BorrowedFieldsWithBounds_from_foo_and_strings.ADDR; + public static MemorySegment Foo_destroy$address() { + return Foo_destroy.ADDR; } /** * {@snippet lang=c : - * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char *utf8_str_z_data, size_t utf8_str_z_len) + * void Foo_destroy(Foo *self) * } */ - public static MemorySegment BorrowedFieldsWithBounds_from_foo_and_strings(SegmentAllocator allocator, MemorySegment foo, MemorySegment dstr16_x_data, long dstr16_x_len, MemorySegment utf8_str_z_data, long utf8_str_z_len) { - var mh$ = BorrowedFieldsWithBounds_from_foo_and_strings.HANDLE; + public static void Foo_destroy(MemorySegment self) { + var mh$ = Foo_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("BorrowedFieldsWithBounds_from_foo_and_strings", allocator, foo, dstr16_x_data, dstr16_x_len, utf8_str_z_data, utf8_str_z_len); + traceDowncall("Foo_destroy", self); } - return (MemorySegment)mh$.invokeExact(allocator, foo, dstr16_x_data, dstr16_x_len, utf8_str_z_data, utf8_str_z_len); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Opaque_new { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER ); + private static class Two_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_new"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Two_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13952,58 +14029,61 @@ private static class Opaque_new { /** * Function descriptor for: * {@snippet lang=c : - * Opaque *Opaque_new() + * void Two_destroy(Two *self) * } */ - public static FunctionDescriptor Opaque_new$descriptor() { - return Opaque_new.DESC; + public static FunctionDescriptor Two_destroy$descriptor() { + return Two_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Opaque *Opaque_new() + * void Two_destroy(Two *self) * } */ - public static MethodHandle Opaque_new$handle() { - return Opaque_new.HANDLE; + public static MethodHandle Two_destroy$handle() { + return Two_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * Opaque *Opaque_new() + * void Two_destroy(Two *self) * } */ - public static MemorySegment Opaque_new$address() { - return Opaque_new.ADDR; + public static MemorySegment Two_destroy$address() { + return Two_destroy.ADDR; } /** * {@snippet lang=c : - * Opaque *Opaque_new() + * void Two_destroy(Two *self) * } */ - public static MemorySegment Opaque_new() { - var mh$ = Opaque_new.HANDLE; + public static void Two_destroy(MemorySegment self) { + var mh$ = Two_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_new"); + traceDowncall("Two_destroy", self); } - return (MemorySegment)mh$.invokeExact(); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Opaque_from_str { + private static class BorrowedFieldsWithBounds_from_foo_and_strings { public static final FunctionDescriptor DESC = FunctionDescriptor.of( + BorrowedFieldsWithBounds.layout(), + somelib_h.C_POINTER, somelib_h.C_POINTER, + somelib_h.C_LONG, somelib_h.C_POINTER, somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_from_str"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("BorrowedFieldsWithBounds_from_foo_and_strings"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14011,57 +14091,55 @@ private static class Opaque_from_str { /** * Function descriptor for: * {@snippet lang=c : - * Opaque *Opaque_from_str(const char *input_data, size_t input_len) + * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char *utf8_str_z_data, size_t utf8_str_z_len) * } */ - public static FunctionDescriptor Opaque_from_str$descriptor() { - return Opaque_from_str.DESC; + public static FunctionDescriptor BorrowedFieldsWithBounds_from_foo_and_strings$descriptor() { + return BorrowedFieldsWithBounds_from_foo_and_strings.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Opaque *Opaque_from_str(const char *input_data, size_t input_len) + * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char *utf8_str_z_data, size_t utf8_str_z_len) * } */ - public static MethodHandle Opaque_from_str$handle() { - return Opaque_from_str.HANDLE; + public static MethodHandle BorrowedFieldsWithBounds_from_foo_and_strings$handle() { + return BorrowedFieldsWithBounds_from_foo_and_strings.HANDLE; } /** * Address for: * {@snippet lang=c : - * Opaque *Opaque_from_str(const char *input_data, size_t input_len) + * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char *utf8_str_z_data, size_t utf8_str_z_len) * } */ - public static MemorySegment Opaque_from_str$address() { - return Opaque_from_str.ADDR; + public static MemorySegment BorrowedFieldsWithBounds_from_foo_and_strings$address() { + return BorrowedFieldsWithBounds_from_foo_and_strings.ADDR; } /** * {@snippet lang=c : - * Opaque *Opaque_from_str(const char *input_data, size_t input_len) + * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char *utf8_str_z_data, size_t utf8_str_z_len) * } */ - public static MemorySegment Opaque_from_str(MemorySegment input_data, long input_len) { - var mh$ = Opaque_from_str.HANDLE; + public static MemorySegment BorrowedFieldsWithBounds_from_foo_and_strings(SegmentAllocator allocator, MemorySegment foo, MemorySegment dstr16_x_data, long dstr16_x_len, MemorySegment utf8_str_z_data, long utf8_str_z_len) { + var mh$ = BorrowedFieldsWithBounds_from_foo_and_strings.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_from_str", input_data, input_len); + traceDowncall("BorrowedFieldsWithBounds_from_foo_and_strings", allocator, foo, dstr16_x_data, dstr16_x_len, utf8_str_z_data, utf8_str_z_len); } - return (MemorySegment)mh$.invokeExact(input_data, input_len); + return (MemorySegment)mh$.invokeExact(allocator, foo, dstr16_x_data, dstr16_x_len, utf8_str_z_data, utf8_str_z_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Opaque_get_debug_str { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); + private static class MyStruct_new { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + MyStruct.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_get_debug_str"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyStruct_new"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14069,57 +14147,57 @@ private static class Opaque_get_debug_str { /** * Function descriptor for: * {@snippet lang=c : - * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) + * MyStruct MyStruct_new() * } */ - public static FunctionDescriptor Opaque_get_debug_str$descriptor() { - return Opaque_get_debug_str.DESC; + public static FunctionDescriptor MyStruct_new$descriptor() { + return MyStruct_new.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) + * MyStruct MyStruct_new() * } */ - public static MethodHandle Opaque_get_debug_str$handle() { - return Opaque_get_debug_str.HANDLE; + public static MethodHandle MyStruct_new$handle() { + return MyStruct_new.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) + * MyStruct MyStruct_new() * } */ - public static MemorySegment Opaque_get_debug_str$address() { - return Opaque_get_debug_str.ADDR; + public static MemorySegment MyStruct_new$address() { + return MyStruct_new.ADDR; } /** * {@snippet lang=c : - * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) + * MyStruct MyStruct_new() * } */ - public static void Opaque_get_debug_str(MemorySegment self, MemorySegment write) { - var mh$ = Opaque_get_debug_str.HANDLE; + public static MemorySegment MyStruct_new(SegmentAllocator allocator) { + var mh$ = MyStruct_new.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_get_debug_str", self, write); + traceDowncall("MyStruct_new", allocator); } - mh$.invokeExact(self, write); + return (MemorySegment)mh$.invokeExact(allocator); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Opaque_assert_struct { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER, + private static class MyStruct_into_a { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_CHAR, MyStruct.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_assert_struct"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyStruct_into_a"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14127,55 +14205,58 @@ private static class Opaque_assert_struct { /** * Function descriptor for: * {@snippet lang=c : - * void Opaque_assert_struct(const Opaque *self, MyStruct s) + * uint8_t MyStruct_into_a(MyStruct self) * } */ - public static FunctionDescriptor Opaque_assert_struct$descriptor() { - return Opaque_assert_struct.DESC; + public static FunctionDescriptor MyStruct_into_a$descriptor() { + return MyStruct_into_a.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Opaque_assert_struct(const Opaque *self, MyStruct s) + * uint8_t MyStruct_into_a(MyStruct self) * } */ - public static MethodHandle Opaque_assert_struct$handle() { - return Opaque_assert_struct.HANDLE; + public static MethodHandle MyStruct_into_a$handle() { + return MyStruct_into_a.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Opaque_assert_struct(const Opaque *self, MyStruct s) + * uint8_t MyStruct_into_a(MyStruct self) * } */ - public static MemorySegment Opaque_assert_struct$address() { - return Opaque_assert_struct.ADDR; + public static MemorySegment MyStruct_into_a$address() { + return MyStruct_into_a.ADDR; } /** * {@snippet lang=c : - * void Opaque_assert_struct(const Opaque *self, MyStruct s) + * uint8_t MyStruct_into_a(MyStruct self) * } */ - public static void Opaque_assert_struct(MemorySegment self, MemorySegment s) { - var mh$ = Opaque_assert_struct.HANDLE; + public static byte MyStruct_into_a(MemorySegment self) { + var mh$ = MyStruct_into_a.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_assert_struct", self, s); + traceDowncall("MyStruct_into_a", self); } - mh$.invokeExact(self, s); + return (byte)mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Opaque_returns_usize { + private static class Utf16Wrap_from_utf16 { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_LONG ); + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_LONG + ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_returns_usize"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_from_utf16"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14183,57 +14264,57 @@ private static class Opaque_returns_usize { /** * Function descriptor for: * {@snippet lang=c : - * size_t Opaque_returns_usize() + * Utf16Wrap *Utf16Wrap_from_utf16(const char16_t *input_data, size_t input_len) * } */ - public static FunctionDescriptor Opaque_returns_usize$descriptor() { - return Opaque_returns_usize.DESC; + public static FunctionDescriptor Utf16Wrap_from_utf16$descriptor() { + return Utf16Wrap_from_utf16.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * size_t Opaque_returns_usize() + * Utf16Wrap *Utf16Wrap_from_utf16(const char16_t *input_data, size_t input_len) * } */ - public static MethodHandle Opaque_returns_usize$handle() { - return Opaque_returns_usize.HANDLE; + public static MethodHandle Utf16Wrap_from_utf16$handle() { + return Utf16Wrap_from_utf16.HANDLE; } /** * Address for: * {@snippet lang=c : - * size_t Opaque_returns_usize() + * Utf16Wrap *Utf16Wrap_from_utf16(const char16_t *input_data, size_t input_len) * } */ - public static MemorySegment Opaque_returns_usize$address() { - return Opaque_returns_usize.ADDR; + public static MemorySegment Utf16Wrap_from_utf16$address() { + return Utf16Wrap_from_utf16.ADDR; } /** * {@snippet lang=c : - * size_t Opaque_returns_usize() + * Utf16Wrap *Utf16Wrap_from_utf16(const char16_t *input_data, size_t input_len) * } */ - public static long Opaque_returns_usize() { - var mh$ = Opaque_returns_usize.HANDLE; + public static MemorySegment Utf16Wrap_from_utf16(MemorySegment input_data, long input_len) { + var mh$ = Utf16Wrap_from_utf16.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_returns_usize"); + traceDowncall("Utf16Wrap_from_utf16", input_data, input_len); } - return (long)mh$.invokeExact(); + return (MemorySegment)mh$.invokeExact(input_data, input_len); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Opaque_internal_len { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_LONG, + private static class Utf16Wrap_get_debug_str { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_internal_len"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_get_debug_str"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14241,55 +14322,57 @@ private static class Opaque_internal_len { /** * Function descriptor for: * {@snippet lang=c : - * size_t Opaque_internal_len(const Opaque *self) + * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) * } */ - public static FunctionDescriptor Opaque_internal_len$descriptor() { - return Opaque_internal_len.DESC; + public static FunctionDescriptor Utf16Wrap_get_debug_str$descriptor() { + return Utf16Wrap_get_debug_str.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * size_t Opaque_internal_len(const Opaque *self) + * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) * } */ - public static MethodHandle Opaque_internal_len$handle() { - return Opaque_internal_len.HANDLE; + public static MethodHandle Utf16Wrap_get_debug_str$handle() { + return Utf16Wrap_get_debug_str.HANDLE; } /** * Address for: * {@snippet lang=c : - * size_t Opaque_internal_len(const Opaque *self) + * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) * } */ - public static MemorySegment Opaque_internal_len$address() { - return Opaque_internal_len.ADDR; + public static MemorySegment Utf16Wrap_get_debug_str$address() { + return Utf16Wrap_get_debug_str.ADDR; } /** * {@snippet lang=c : - * size_t Opaque_internal_len(const Opaque *self) + * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) * } */ - public static long Opaque_internal_len(MemorySegment self) { - var mh$ = Opaque_internal_len.HANDLE; + public static void Utf16Wrap_get_debug_str(MemorySegment self, MemorySegment write) { + var mh$ = Utf16Wrap_get_debug_str.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_internal_len", self); + traceDowncall("Utf16Wrap_get_debug_str", self, write); } - return (long)mh$.invokeExact(self); + mh$.invokeExact(self, write); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Opaque_cmp { + private static class Utf16Wrap_borrow_cont { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_CHAR ); + DiplomatString16View.layout(), + somelib_h.C_POINTER + ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_cmp"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_borrow_cont"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14297,56 +14380,56 @@ private static class Opaque_cmp { /** * Function descriptor for: * {@snippet lang=c : - * int8_t Opaque_cmp() + * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) * } */ - public static FunctionDescriptor Opaque_cmp$descriptor() { - return Opaque_cmp.DESC; + public static FunctionDescriptor Utf16Wrap_borrow_cont$descriptor() { + return Utf16Wrap_borrow_cont.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int8_t Opaque_cmp() + * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) * } */ - public static MethodHandle Opaque_cmp$handle() { - return Opaque_cmp.HANDLE; + public static MethodHandle Utf16Wrap_borrow_cont$handle() { + return Utf16Wrap_borrow_cont.HANDLE; } /** * Address for: * {@snippet lang=c : - * int8_t Opaque_cmp() + * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) * } */ - public static MemorySegment Opaque_cmp$address() { - return Opaque_cmp.ADDR; + public static MemorySegment Utf16Wrap_borrow_cont$address() { + return Utf16Wrap_borrow_cont.ADDR; } /** * {@snippet lang=c : - * int8_t Opaque_cmp() + * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) * } */ - public static byte Opaque_cmp() { - var mh$ = Opaque_cmp.HANDLE; + public static MemorySegment Utf16Wrap_borrow_cont(SegmentAllocator allocator, MemorySegment self) { + var mh$ = Utf16Wrap_borrow_cont.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_cmp"); + traceDowncall("Utf16Wrap_borrow_cont", allocator, self); } - return (byte)mh$.invokeExact(); + return (MemorySegment)mh$.invokeExact(allocator, self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Opaque_destroy { + private static class Utf16Wrap_destroy { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14354,43 +14437,43 @@ private static class Opaque_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void Opaque_destroy(Opaque *self) + * void Utf16Wrap_destroy(Utf16Wrap *self) * } */ - public static FunctionDescriptor Opaque_destroy$descriptor() { - return Opaque_destroy.DESC; + public static FunctionDescriptor Utf16Wrap_destroy$descriptor() { + return Utf16Wrap_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Opaque_destroy(Opaque *self) + * void Utf16Wrap_destroy(Utf16Wrap *self) * } */ - public static MethodHandle Opaque_destroy$handle() { - return Opaque_destroy.HANDLE; + public static MethodHandle Utf16Wrap_destroy$handle() { + return Utf16Wrap_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Opaque_destroy(Opaque *self) + * void Utf16Wrap_destroy(Utf16Wrap *self) * } */ - public static MemorySegment Opaque_destroy$address() { - return Opaque_destroy.ADDR; + public static MemorySegment Utf16Wrap_destroy$address() { + return Utf16Wrap_destroy.ADDR; } /** * {@snippet lang=c : - * void Opaque_destroy(Opaque *self) + * void Utf16Wrap_destroy(Utf16Wrap *self) * } */ - public static void Opaque_destroy(MemorySegment self) { - var mh$ = Opaque_destroy.HANDLE; + public static void Utf16Wrap_destroy(MemorySegment self) { + var mh$ = Utf16Wrap_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_destroy", self); + traceDowncall("Utf16Wrap_destroy", self); } mh$.invokeExact(self); } catch (Throwable ex$) { @@ -14436,1073 +14519,1073 @@ public static long __DARWIN_C_FULL() { public static long __DARWIN_C_LEVEL() { return __DARWIN_C_LEVEL; } + private static final int MAC_OS_X_VERSION_10_0 = (int)1000L; /** * {@snippet lang=c : - * #define __ASSERT_FILE_NAME "jextract$15815410018534479797.h" + * #define MAC_OS_X_VERSION_10_0 1000 * } */ - public static MemorySegment __ASSERT_FILE_NAME() { - class Holder { - static final MemorySegment __ASSERT_FILE_NAME - = somelib_h.LIBRARY_ARENA.allocateFrom("jextract$15815410018534479797.h"); - } - return Holder.__ASSERT_FILE_NAME; + public static int MAC_OS_X_VERSION_10_0() { + return MAC_OS_X_VERSION_10_0; } - private static final MemorySegment NULL = MemorySegment.ofAddress(0L); + private static final int MAC_OS_X_VERSION_10_1 = (int)1010L; /** * {@snippet lang=c : - * #define NULL (void*) 0 + * #define MAC_OS_X_VERSION_10_1 1010 * } */ - public static MemorySegment NULL() { - return NULL; + public static int MAC_OS_X_VERSION_10_1() { + return MAC_OS_X_VERSION_10_1; } - private static final MemorySegment __DARWIN_NULL = MemorySegment.ofAddress(0L); + private static final int MAC_OS_X_VERSION_10_2 = (int)1020L; /** * {@snippet lang=c : - * #define __DARWIN_NULL (void*) 0 + * #define MAC_OS_X_VERSION_10_2 1020 * } */ - public static MemorySegment __DARWIN_NULL() { - return __DARWIN_NULL; + public static int MAC_OS_X_VERSION_10_2() { + return MAC_OS_X_VERSION_10_2; } - private static final long USER_ADDR_NULL = 0L; + private static final int MAC_OS_X_VERSION_10_3 = (int)1030L; /** * {@snippet lang=c : - * #define USER_ADDR_NULL 0 + * #define MAC_OS_X_VERSION_10_3 1030 * } */ - public static long USER_ADDR_NULL() { - return USER_ADDR_NULL; + public static int MAC_OS_X_VERSION_10_3() { + return MAC_OS_X_VERSION_10_3; } - private static final long INT64_MAX = 9223372036854775807L; + private static final int MAC_OS_X_VERSION_10_4 = (int)1040L; /** * {@snippet lang=c : - * #define INT64_MAX 9223372036854775807 + * #define MAC_OS_X_VERSION_10_4 1040 * } */ - public static long INT64_MAX() { - return INT64_MAX; + public static int MAC_OS_X_VERSION_10_4() { + return MAC_OS_X_VERSION_10_4; } - private static final int INT8_MIN = (int)-128L; + private static final int MAC_OS_X_VERSION_10_5 = (int)1050L; /** * {@snippet lang=c : - * #define INT8_MIN -128 + * #define MAC_OS_X_VERSION_10_5 1050 * } */ - public static int INT8_MIN() { - return INT8_MIN; + public static int MAC_OS_X_VERSION_10_5() { + return MAC_OS_X_VERSION_10_5; } - private static final int INT16_MIN = (int)-32768L; + private static final int MAC_OS_X_VERSION_10_6 = (int)1060L; /** * {@snippet lang=c : - * #define INT16_MIN -32768 + * #define MAC_OS_X_VERSION_10_6 1060 * } */ - public static int INT16_MIN() { - return INT16_MIN; + public static int MAC_OS_X_VERSION_10_6() { + return MAC_OS_X_VERSION_10_6; } - private static final int INT32_MIN = (int)-2147483648L; + private static final int MAC_OS_X_VERSION_10_7 = (int)1070L; /** * {@snippet lang=c : - * #define INT32_MIN -2147483648 + * #define MAC_OS_X_VERSION_10_7 1070 * } */ - public static int INT32_MIN() { - return INT32_MIN; + public static int MAC_OS_X_VERSION_10_7() { + return MAC_OS_X_VERSION_10_7; } - private static final long INT64_MIN = -9223372036854775808L; + private static final int MAC_OS_X_VERSION_10_8 = (int)1080L; /** * {@snippet lang=c : - * #define INT64_MIN -9223372036854775808 + * #define MAC_OS_X_VERSION_10_8 1080 * } */ - public static long INT64_MIN() { - return INT64_MIN; + public static int MAC_OS_X_VERSION_10_8() { + return MAC_OS_X_VERSION_10_8; } - private static final int UINT32_MAX = (int)4294967295L; + private static final int MAC_OS_X_VERSION_10_9 = (int)1090L; /** * {@snippet lang=c : - * #define UINT32_MAX 4294967295 + * #define MAC_OS_X_VERSION_10_9 1090 * } */ - public static int UINT32_MAX() { - return UINT32_MAX; + public static int MAC_OS_X_VERSION_10_9() { + return MAC_OS_X_VERSION_10_9; } - private static final long UINT64_MAX = -1L; + private static final int MAC_OS_X_VERSION_10_10 = (int)101000L; /** * {@snippet lang=c : - * #define UINT64_MAX -1 + * #define MAC_OS_X_VERSION_10_10 101000 * } */ - public static long UINT64_MAX() { - return UINT64_MAX; + public static int MAC_OS_X_VERSION_10_10() { + return MAC_OS_X_VERSION_10_10; } - private static final int INT_LEAST8_MIN = (int)-128L; + private static final int MAC_OS_X_VERSION_10_10_2 = (int)101002L; /** * {@snippet lang=c : - * #define INT_LEAST8_MIN -128 + * #define MAC_OS_X_VERSION_10_10_2 101002 * } */ - public static int INT_LEAST8_MIN() { - return INT_LEAST8_MIN; + public static int MAC_OS_X_VERSION_10_10_2() { + return MAC_OS_X_VERSION_10_10_2; } - private static final int INT_LEAST16_MIN = (int)-32768L; + private static final int MAC_OS_X_VERSION_10_10_3 = (int)101003L; /** * {@snippet lang=c : - * #define INT_LEAST16_MIN -32768 + * #define MAC_OS_X_VERSION_10_10_3 101003 * } */ - public static int INT_LEAST16_MIN() { - return INT_LEAST16_MIN; + public static int MAC_OS_X_VERSION_10_10_3() { + return MAC_OS_X_VERSION_10_10_3; } - private static final int INT_LEAST32_MIN = (int)-2147483648L; + private static final int MAC_OS_X_VERSION_10_11 = (int)101100L; /** * {@snippet lang=c : - * #define INT_LEAST32_MIN -2147483648 + * #define MAC_OS_X_VERSION_10_11 101100 * } */ - public static int INT_LEAST32_MIN() { - return INT_LEAST32_MIN; + public static int MAC_OS_X_VERSION_10_11() { + return MAC_OS_X_VERSION_10_11; } - private static final long INT_LEAST64_MIN = -9223372036854775808L; + private static final int MAC_OS_X_VERSION_10_11_2 = (int)101102L; /** * {@snippet lang=c : - * #define INT_LEAST64_MIN -9223372036854775808 + * #define MAC_OS_X_VERSION_10_11_2 101102 * } */ - public static long INT_LEAST64_MIN() { - return INT_LEAST64_MIN; + public static int MAC_OS_X_VERSION_10_11_2() { + return MAC_OS_X_VERSION_10_11_2; } - private static final int INT_LEAST8_MAX = (int)127L; + private static final int MAC_OS_X_VERSION_10_11_3 = (int)101103L; /** * {@snippet lang=c : - * #define INT_LEAST8_MAX 127 + * #define MAC_OS_X_VERSION_10_11_3 101103 * } */ - public static int INT_LEAST8_MAX() { - return INT_LEAST8_MAX; + public static int MAC_OS_X_VERSION_10_11_3() { + return MAC_OS_X_VERSION_10_11_3; } - private static final int INT_LEAST16_MAX = (int)32767L; + private static final int MAC_OS_X_VERSION_10_11_4 = (int)101104L; /** * {@snippet lang=c : - * #define INT_LEAST16_MAX 32767 + * #define MAC_OS_X_VERSION_10_11_4 101104 * } */ - public static int INT_LEAST16_MAX() { - return INT_LEAST16_MAX; + public static int MAC_OS_X_VERSION_10_11_4() { + return MAC_OS_X_VERSION_10_11_4; } - private static final int INT_LEAST32_MAX = (int)2147483647L; + private static final int MAC_OS_X_VERSION_10_12 = (int)101200L; /** * {@snippet lang=c : - * #define INT_LEAST32_MAX 2147483647 + * #define MAC_OS_X_VERSION_10_12 101200 * } */ - public static int INT_LEAST32_MAX() { - return INT_LEAST32_MAX; + public static int MAC_OS_X_VERSION_10_12() { + return MAC_OS_X_VERSION_10_12; } - private static final long INT_LEAST64_MAX = 9223372036854775807L; + private static final int MAC_OS_X_VERSION_10_12_1 = (int)101201L; /** * {@snippet lang=c : - * #define INT_LEAST64_MAX 9223372036854775807 + * #define MAC_OS_X_VERSION_10_12_1 101201 * } */ - public static long INT_LEAST64_MAX() { - return INT_LEAST64_MAX; + public static int MAC_OS_X_VERSION_10_12_1() { + return MAC_OS_X_VERSION_10_12_1; } - private static final int UINT_LEAST8_MAX = (int)255L; + private static final int MAC_OS_X_VERSION_10_12_2 = (int)101202L; /** * {@snippet lang=c : - * #define UINT_LEAST8_MAX 255 + * #define MAC_OS_X_VERSION_10_12_2 101202 * } */ - public static int UINT_LEAST8_MAX() { - return UINT_LEAST8_MAX; + public static int MAC_OS_X_VERSION_10_12_2() { + return MAC_OS_X_VERSION_10_12_2; } - private static final int UINT_LEAST16_MAX = (int)65535L; + private static final int MAC_OS_X_VERSION_10_12_4 = (int)101204L; /** * {@snippet lang=c : - * #define UINT_LEAST16_MAX 65535 + * #define MAC_OS_X_VERSION_10_12_4 101204 * } */ - public static int UINT_LEAST16_MAX() { - return UINT_LEAST16_MAX; + public static int MAC_OS_X_VERSION_10_12_4() { + return MAC_OS_X_VERSION_10_12_4; } - private static final int UINT_LEAST32_MAX = (int)4294967295L; + private static final int MAC_OS_X_VERSION_10_13 = (int)101300L; /** * {@snippet lang=c : - * #define UINT_LEAST32_MAX 4294967295 + * #define MAC_OS_X_VERSION_10_13 101300 * } */ - public static int UINT_LEAST32_MAX() { - return UINT_LEAST32_MAX; + public static int MAC_OS_X_VERSION_10_13() { + return MAC_OS_X_VERSION_10_13; } - private static final long UINT_LEAST64_MAX = -1L; + private static final int MAC_OS_X_VERSION_10_13_1 = (int)101301L; /** * {@snippet lang=c : - * #define UINT_LEAST64_MAX -1 + * #define MAC_OS_X_VERSION_10_13_1 101301 * } */ - public static long UINT_LEAST64_MAX() { - return UINT_LEAST64_MAX; + public static int MAC_OS_X_VERSION_10_13_1() { + return MAC_OS_X_VERSION_10_13_1; } - private static final int INT_FAST8_MIN = (int)-128L; + private static final int MAC_OS_X_VERSION_10_13_2 = (int)101302L; /** * {@snippet lang=c : - * #define INT_FAST8_MIN -128 + * #define MAC_OS_X_VERSION_10_13_2 101302 * } */ - public static int INT_FAST8_MIN() { - return INT_FAST8_MIN; + public static int MAC_OS_X_VERSION_10_13_2() { + return MAC_OS_X_VERSION_10_13_2; } - private static final int INT_FAST16_MIN = (int)-32768L; + private static final int MAC_OS_X_VERSION_10_13_4 = (int)101304L; /** * {@snippet lang=c : - * #define INT_FAST16_MIN -32768 + * #define MAC_OS_X_VERSION_10_13_4 101304 * } */ - public static int INT_FAST16_MIN() { - return INT_FAST16_MIN; + public static int MAC_OS_X_VERSION_10_13_4() { + return MAC_OS_X_VERSION_10_13_4; } - private static final int INT_FAST32_MIN = (int)-2147483648L; + private static final int MAC_OS_X_VERSION_10_14 = (int)101400L; /** * {@snippet lang=c : - * #define INT_FAST32_MIN -2147483648 + * #define MAC_OS_X_VERSION_10_14 101400 * } */ - public static int INT_FAST32_MIN() { - return INT_FAST32_MIN; + public static int MAC_OS_X_VERSION_10_14() { + return MAC_OS_X_VERSION_10_14; } - private static final long INT_FAST64_MIN = -9223372036854775808L; + private static final int MAC_OS_X_VERSION_10_14_1 = (int)101401L; /** * {@snippet lang=c : - * #define INT_FAST64_MIN -9223372036854775808 + * #define MAC_OS_X_VERSION_10_14_1 101401 * } */ - public static long INT_FAST64_MIN() { - return INT_FAST64_MIN; + public static int MAC_OS_X_VERSION_10_14_1() { + return MAC_OS_X_VERSION_10_14_1; } - private static final int INT_FAST8_MAX = (int)127L; + private static final int MAC_OS_X_VERSION_10_14_4 = (int)101404L; /** * {@snippet lang=c : - * #define INT_FAST8_MAX 127 + * #define MAC_OS_X_VERSION_10_14_4 101404 * } */ - public static int INT_FAST8_MAX() { - return INT_FAST8_MAX; + public static int MAC_OS_X_VERSION_10_14_4() { + return MAC_OS_X_VERSION_10_14_4; } - private static final int INT_FAST16_MAX = (int)32767L; + private static final int MAC_OS_X_VERSION_10_14_5 = (int)101405L; /** * {@snippet lang=c : - * #define INT_FAST16_MAX 32767 + * #define MAC_OS_X_VERSION_10_14_5 101405 * } */ - public static int INT_FAST16_MAX() { - return INT_FAST16_MAX; + public static int MAC_OS_X_VERSION_10_14_5() { + return MAC_OS_X_VERSION_10_14_5; } - private static final int INT_FAST32_MAX = (int)2147483647L; + private static final int MAC_OS_X_VERSION_10_14_6 = (int)101406L; /** * {@snippet lang=c : - * #define INT_FAST32_MAX 2147483647 + * #define MAC_OS_X_VERSION_10_14_6 101406 * } */ - public static int INT_FAST32_MAX() { - return INT_FAST32_MAX; + public static int MAC_OS_X_VERSION_10_14_6() { + return MAC_OS_X_VERSION_10_14_6; } - private static final long INT_FAST64_MAX = 9223372036854775807L; + private static final int MAC_OS_X_VERSION_10_15 = (int)101500L; /** * {@snippet lang=c : - * #define INT_FAST64_MAX 9223372036854775807 + * #define MAC_OS_X_VERSION_10_15 101500 * } */ - public static long INT_FAST64_MAX() { - return INT_FAST64_MAX; + public static int MAC_OS_X_VERSION_10_15() { + return MAC_OS_X_VERSION_10_15; } - private static final int UINT_FAST8_MAX = (int)255L; + private static final int MAC_OS_X_VERSION_10_15_1 = (int)101501L; /** * {@snippet lang=c : - * #define UINT_FAST8_MAX 255 + * #define MAC_OS_X_VERSION_10_15_1 101501 * } */ - public static int UINT_FAST8_MAX() { - return UINT_FAST8_MAX; + public static int MAC_OS_X_VERSION_10_15_1() { + return MAC_OS_X_VERSION_10_15_1; } - private static final int UINT_FAST16_MAX = (int)65535L; + private static final int MAC_OS_X_VERSION_10_15_4 = (int)101504L; /** * {@snippet lang=c : - * #define UINT_FAST16_MAX 65535 + * #define MAC_OS_X_VERSION_10_15_4 101504 * } */ - public static int UINT_FAST16_MAX() { - return UINT_FAST16_MAX; + public static int MAC_OS_X_VERSION_10_15_4() { + return MAC_OS_X_VERSION_10_15_4; } - private static final int UINT_FAST32_MAX = (int)4294967295L; + private static final int MAC_OS_X_VERSION_10_16 = (int)101600L; /** * {@snippet lang=c : - * #define UINT_FAST32_MAX 4294967295 + * #define MAC_OS_X_VERSION_10_16 101600 * } */ - public static int UINT_FAST32_MAX() { - return UINT_FAST32_MAX; + public static int MAC_OS_X_VERSION_10_16() { + return MAC_OS_X_VERSION_10_16; } - private static final long UINT_FAST64_MAX = -1L; + private static final int MAC_OS_VERSION_11_0 = (int)110000L; /** * {@snippet lang=c : - * #define UINT_FAST64_MAX -1 + * #define MAC_OS_VERSION_11_0 110000 * } */ - public static long UINT_FAST64_MAX() { - return UINT_FAST64_MAX; + public static int MAC_OS_VERSION_11_0() { + return MAC_OS_VERSION_11_0; } - private static final long INTPTR_MAX = 9223372036854775807L; + private static final int MAC_OS_VERSION_11_1 = (int)110100L; /** * {@snippet lang=c : - * #define INTPTR_MAX 9223372036854775807 + * #define MAC_OS_VERSION_11_1 110100 * } */ - public static long INTPTR_MAX() { - return INTPTR_MAX; + public static int MAC_OS_VERSION_11_1() { + return MAC_OS_VERSION_11_1; } - private static final long INTPTR_MIN = -9223372036854775808L; + private static final int MAC_OS_VERSION_11_3 = (int)110300L; /** * {@snippet lang=c : - * #define INTPTR_MIN -9223372036854775808 + * #define MAC_OS_VERSION_11_3 110300 * } */ - public static long INTPTR_MIN() { - return INTPTR_MIN; + public static int MAC_OS_VERSION_11_3() { + return MAC_OS_VERSION_11_3; } - private static final long UINTPTR_MAX = -1L; + private static final int MAC_OS_VERSION_11_4 = (int)110400L; /** * {@snippet lang=c : - * #define UINTPTR_MAX -1 + * #define MAC_OS_VERSION_11_4 110400 * } */ - public static long UINTPTR_MAX() { - return UINTPTR_MAX; + public static int MAC_OS_VERSION_11_4() { + return MAC_OS_VERSION_11_4; } - private static final long INTMAX_MAX = 9223372036854775807L; + private static final int MAC_OS_VERSION_11_5 = (int)110500L; /** * {@snippet lang=c : - * #define INTMAX_MAX 9223372036854775807 + * #define MAC_OS_VERSION_11_5 110500 * } */ - public static long INTMAX_MAX() { - return INTMAX_MAX; + public static int MAC_OS_VERSION_11_5() { + return MAC_OS_VERSION_11_5; } - private static final long UINTMAX_MAX = -1L; + private static final int MAC_OS_VERSION_11_6 = (int)110600L; /** * {@snippet lang=c : - * #define UINTMAX_MAX -1 + * #define MAC_OS_VERSION_11_6 110600 * } */ - public static long UINTMAX_MAX() { - return UINTMAX_MAX; + public static int MAC_OS_VERSION_11_6() { + return MAC_OS_VERSION_11_6; } - private static final long INTMAX_MIN = -9223372036854775808L; + private static final int MAC_OS_VERSION_12_0 = (int)120000L; /** * {@snippet lang=c : - * #define INTMAX_MIN -9223372036854775808 + * #define MAC_OS_VERSION_12_0 120000 * } */ - public static long INTMAX_MIN() { - return INTMAX_MIN; + public static int MAC_OS_VERSION_12_0() { + return MAC_OS_VERSION_12_0; } - private static final long PTRDIFF_MIN = -9223372036854775808L; + private static final int MAC_OS_VERSION_12_1 = (int)120100L; /** * {@snippet lang=c : - * #define PTRDIFF_MIN -9223372036854775808 + * #define MAC_OS_VERSION_12_1 120100 * } */ - public static long PTRDIFF_MIN() { - return PTRDIFF_MIN; + public static int MAC_OS_VERSION_12_1() { + return MAC_OS_VERSION_12_1; } - private static final long PTRDIFF_MAX = 9223372036854775807L; + private static final int MAC_OS_VERSION_12_2 = (int)120200L; /** * {@snippet lang=c : - * #define PTRDIFF_MAX 9223372036854775807 + * #define MAC_OS_VERSION_12_2 120200 * } */ - public static long PTRDIFF_MAX() { - return PTRDIFF_MAX; + public static int MAC_OS_VERSION_12_2() { + return MAC_OS_VERSION_12_2; } - private static final long SIZE_MAX = -1L; + private static final int MAC_OS_VERSION_12_3 = (int)120300L; /** * {@snippet lang=c : - * #define SIZE_MAX -1 + * #define MAC_OS_VERSION_12_3 120300 * } */ - public static long SIZE_MAX() { - return SIZE_MAX; + public static int MAC_OS_VERSION_12_3() { + return MAC_OS_VERSION_12_3; } - private static final long RSIZE_MAX = 9223372036854775807L; + private static final int MAC_OS_VERSION_12_4 = (int)120400L; /** * {@snippet lang=c : - * #define RSIZE_MAX 9223372036854775807 + * #define MAC_OS_VERSION_12_4 120400 * } */ - public static long RSIZE_MAX() { - return RSIZE_MAX; + public static int MAC_OS_VERSION_12_4() { + return MAC_OS_VERSION_12_4; } - private static final int WCHAR_MAX = (int)2147483647L; + private static final int MAC_OS_VERSION_12_5 = (int)120500L; /** * {@snippet lang=c : - * #define WCHAR_MAX 2147483647 + * #define MAC_OS_VERSION_12_5 120500 * } */ - public static int WCHAR_MAX() { - return WCHAR_MAX; + public static int MAC_OS_VERSION_12_5() { + return MAC_OS_VERSION_12_5; } - private static final int WCHAR_MIN = (int)-2147483648L; + private static final int MAC_OS_VERSION_12_6 = (int)120600L; /** * {@snippet lang=c : - * #define WCHAR_MIN -2147483648 + * #define MAC_OS_VERSION_12_6 120600 * } */ - public static int WCHAR_MIN() { - return WCHAR_MIN; + public static int MAC_OS_VERSION_12_6() { + return MAC_OS_VERSION_12_6; } - private static final int WINT_MIN = (int)-2147483648L; + private static final int MAC_OS_VERSION_12_7 = (int)120700L; /** * {@snippet lang=c : - * #define WINT_MIN -2147483648 + * #define MAC_OS_VERSION_12_7 120700 * } */ - public static int WINT_MIN() { - return WINT_MIN; + public static int MAC_OS_VERSION_12_7() { + return MAC_OS_VERSION_12_7; } - private static final int WINT_MAX = (int)2147483647L; + private static final int MAC_OS_VERSION_13_0 = (int)130000L; /** * {@snippet lang=c : - * #define WINT_MAX 2147483647 + * #define MAC_OS_VERSION_13_0 130000 * } */ - public static int WINT_MAX() { - return WINT_MAX; + public static int MAC_OS_VERSION_13_0() { + return MAC_OS_VERSION_13_0; } - private static final int SIG_ATOMIC_MIN = (int)-2147483648L; + private static final int MAC_OS_VERSION_13_1 = (int)130100L; /** * {@snippet lang=c : - * #define SIG_ATOMIC_MIN -2147483648 + * #define MAC_OS_VERSION_13_1 130100 * } */ - public static int SIG_ATOMIC_MIN() { - return SIG_ATOMIC_MIN; + public static int MAC_OS_VERSION_13_1() { + return MAC_OS_VERSION_13_1; } - private static final int SIG_ATOMIC_MAX = (int)2147483647L; + private static final int MAC_OS_VERSION_13_2 = (int)130200L; /** * {@snippet lang=c : - * #define SIG_ATOMIC_MAX 2147483647 + * #define MAC_OS_VERSION_13_2 130200 * } */ - public static int SIG_ATOMIC_MAX() { - return SIG_ATOMIC_MAX; + public static int MAC_OS_VERSION_13_2() { + return MAC_OS_VERSION_13_2; } - private static final int MAC_OS_X_VERSION_10_0 = (int)1000L; + private static final int MAC_OS_VERSION_13_3 = (int)130300L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_0 1000 + * #define MAC_OS_VERSION_13_3 130300 * } */ - public static int MAC_OS_X_VERSION_10_0() { - return MAC_OS_X_VERSION_10_0; + public static int MAC_OS_VERSION_13_3() { + return MAC_OS_VERSION_13_3; } - private static final int MAC_OS_X_VERSION_10_1 = (int)1010L; + private static final int MAC_OS_VERSION_13_4 = (int)130400L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_1 1010 + * #define MAC_OS_VERSION_13_4 130400 * } */ - public static int MAC_OS_X_VERSION_10_1() { - return MAC_OS_X_VERSION_10_1; + public static int MAC_OS_VERSION_13_4() { + return MAC_OS_VERSION_13_4; } - private static final int MAC_OS_X_VERSION_10_2 = (int)1020L; + private static final int MAC_OS_VERSION_13_5 = (int)130500L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_2 1020 + * #define MAC_OS_VERSION_13_5 130500 * } */ - public static int MAC_OS_X_VERSION_10_2() { - return MAC_OS_X_VERSION_10_2; + public static int MAC_OS_VERSION_13_5() { + return MAC_OS_VERSION_13_5; } - private static final int MAC_OS_X_VERSION_10_3 = (int)1030L; + private static final int MAC_OS_VERSION_13_6 = (int)130600L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_3 1030 + * #define MAC_OS_VERSION_13_6 130600 * } */ - public static int MAC_OS_X_VERSION_10_3() { - return MAC_OS_X_VERSION_10_3; + public static int MAC_OS_VERSION_13_6() { + return MAC_OS_VERSION_13_6; } - private static final int MAC_OS_X_VERSION_10_4 = (int)1040L; + private static final int MAC_OS_VERSION_14_0 = (int)140000L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_4 1040 + * #define MAC_OS_VERSION_14_0 140000 * } */ - public static int MAC_OS_X_VERSION_10_4() { - return MAC_OS_X_VERSION_10_4; + public static int MAC_OS_VERSION_14_0() { + return MAC_OS_VERSION_14_0; } - private static final int MAC_OS_X_VERSION_10_5 = (int)1050L; + private static final int MAC_OS_VERSION_14_1 = (int)140100L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_5 1050 + * #define MAC_OS_VERSION_14_1 140100 * } */ - public static int MAC_OS_X_VERSION_10_5() { - return MAC_OS_X_VERSION_10_5; + public static int MAC_OS_VERSION_14_1() { + return MAC_OS_VERSION_14_1; } - private static final int MAC_OS_X_VERSION_10_6 = (int)1060L; + private static final int MAC_OS_VERSION_14_2 = (int)140200L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_6 1060 + * #define MAC_OS_VERSION_14_2 140200 * } */ - public static int MAC_OS_X_VERSION_10_6() { - return MAC_OS_X_VERSION_10_6; + public static int MAC_OS_VERSION_14_2() { + return MAC_OS_VERSION_14_2; } - private static final int MAC_OS_X_VERSION_10_7 = (int)1070L; + private static final int MAC_OS_VERSION_14_3 = (int)140300L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_7 1070 + * #define MAC_OS_VERSION_14_3 140300 * } */ - public static int MAC_OS_X_VERSION_10_7() { - return MAC_OS_X_VERSION_10_7; + public static int MAC_OS_VERSION_14_3() { + return MAC_OS_VERSION_14_3; } - private static final int MAC_OS_X_VERSION_10_8 = (int)1080L; + private static final int MAC_OS_VERSION_14_4 = (int)140400L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_8 1080 + * #define MAC_OS_VERSION_14_4 140400 * } */ - public static int MAC_OS_X_VERSION_10_8() { - return MAC_OS_X_VERSION_10_8; + public static int MAC_OS_VERSION_14_4() { + return MAC_OS_VERSION_14_4; } - private static final int MAC_OS_X_VERSION_10_9 = (int)1090L; + private static final int MAC_OS_VERSION_14_5 = (int)140500L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_9 1090 + * #define MAC_OS_VERSION_14_5 140500 * } */ - public static int MAC_OS_X_VERSION_10_9() { - return MAC_OS_X_VERSION_10_9; + public static int MAC_OS_VERSION_14_5() { + return MAC_OS_VERSION_14_5; } - private static final int MAC_OS_X_VERSION_10_10 = (int)101000L; + private static final int __MAC_OS_X_VERSION_MAX_ALLOWED = (int)140500L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_10 101000 + * #define __MAC_OS_X_VERSION_MAX_ALLOWED 140500 * } */ - public static int MAC_OS_X_VERSION_10_10() { - return MAC_OS_X_VERSION_10_10; + public static int __MAC_OS_X_VERSION_MAX_ALLOWED() { + return __MAC_OS_X_VERSION_MAX_ALLOWED; } - private static final int MAC_OS_X_VERSION_10_10_2 = (int)101002L; + private static final MemorySegment __DARWIN_NULL = MemorySegment.ofAddress(0L); /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_10_2 101002 + * #define __DARWIN_NULL (void*) 0 * } */ - public static int MAC_OS_X_VERSION_10_10_2() { - return MAC_OS_X_VERSION_10_10_2; + public static MemorySegment __DARWIN_NULL() { + return __DARWIN_NULL; } - private static final int MAC_OS_X_VERSION_10_10_3 = (int)101003L; + private static final int __DARWIN_WCHAR_MAX = (int)2147483647L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_10_3 101003 + * #define __DARWIN_WCHAR_MAX 2147483647 * } */ - public static int MAC_OS_X_VERSION_10_10_3() { - return MAC_OS_X_VERSION_10_10_3; + public static int __DARWIN_WCHAR_MAX() { + return __DARWIN_WCHAR_MAX; } - private static final int MAC_OS_X_VERSION_10_11 = (int)101100L; + private static final int __DARWIN_WCHAR_MIN = (int)-2147483648L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_11 101100 + * #define __DARWIN_WCHAR_MIN -2147483648 * } */ - public static int MAC_OS_X_VERSION_10_11() { - return MAC_OS_X_VERSION_10_11; + public static int __DARWIN_WCHAR_MIN() { + return __DARWIN_WCHAR_MIN; } - private static final int MAC_OS_X_VERSION_10_11_2 = (int)101102L; + private static final int __DARWIN_WEOF = (int)-1L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_11_2 101102 + * #define __DARWIN_WEOF -1 * } */ - public static int MAC_OS_X_VERSION_10_11_2() { - return MAC_OS_X_VERSION_10_11_2; + public static int __DARWIN_WEOF() { + return __DARWIN_WEOF; } - private static final int MAC_OS_X_VERSION_10_11_3 = (int)101103L; + private static final long USER_ADDR_NULL = 0L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_11_3 101103 + * #define USER_ADDR_NULL 0 * } */ - public static int MAC_OS_X_VERSION_10_11_3() { - return MAC_OS_X_VERSION_10_11_3; + public static long USER_ADDR_NULL() { + return USER_ADDR_NULL; } - private static final int MAC_OS_X_VERSION_10_11_4 = (int)101104L; + private static final MemorySegment NULL = MemorySegment.ofAddress(0L); /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_11_4 101104 + * #define NULL (void*) 0 * } */ - public static int MAC_OS_X_VERSION_10_11_4() { - return MAC_OS_X_VERSION_10_11_4; + public static MemorySegment NULL() { + return NULL; } - private static final int MAC_OS_X_VERSION_10_12 = (int)101200L; + private static final int EOF = (int)-1L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_12 101200 + * #define EOF -1 * } */ - public static int MAC_OS_X_VERSION_10_12() { - return MAC_OS_X_VERSION_10_12; + public static int EOF() { + return EOF; } - private static final int MAC_OS_X_VERSION_10_12_1 = (int)101201L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_12_1 101201 + * #define P_tmpdir "/var/tmp/" * } */ - public static int MAC_OS_X_VERSION_10_12_1() { - return MAC_OS_X_VERSION_10_12_1; + public static MemorySegment P_tmpdir() { + class Holder { + static final MemorySegment P_tmpdir + = somelib_h.LIBRARY_ARENA.allocateFrom("/var/tmp/"); + } + return Holder.P_tmpdir; } - private static final int MAC_OS_X_VERSION_10_12_2 = (int)101202L; + private static final long INT64_MAX = 9223372036854775807L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_12_2 101202 + * #define INT64_MAX 9223372036854775807 * } */ - public static int MAC_OS_X_VERSION_10_12_2() { - return MAC_OS_X_VERSION_10_12_2; + public static long INT64_MAX() { + return INT64_MAX; } - private static final int MAC_OS_X_VERSION_10_12_4 = (int)101204L; + private static final int INT8_MIN = (int)-128L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_12_4 101204 + * #define INT8_MIN -128 * } */ - public static int MAC_OS_X_VERSION_10_12_4() { - return MAC_OS_X_VERSION_10_12_4; + public static int INT8_MIN() { + return INT8_MIN; } - private static final int MAC_OS_X_VERSION_10_13 = (int)101300L; + private static final int INT16_MIN = (int)-32768L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_13 101300 + * #define INT16_MIN -32768 * } */ - public static int MAC_OS_X_VERSION_10_13() { - return MAC_OS_X_VERSION_10_13; + public static int INT16_MIN() { + return INT16_MIN; } - private static final int MAC_OS_X_VERSION_10_13_1 = (int)101301L; + private static final int INT32_MIN = (int)-2147483648L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_13_1 101301 + * #define INT32_MIN -2147483648 * } */ - public static int MAC_OS_X_VERSION_10_13_1() { - return MAC_OS_X_VERSION_10_13_1; + public static int INT32_MIN() { + return INT32_MIN; } - private static final int MAC_OS_X_VERSION_10_13_2 = (int)101302L; + private static final long INT64_MIN = -9223372036854775808L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_13_2 101302 + * #define INT64_MIN -9223372036854775808 * } */ - public static int MAC_OS_X_VERSION_10_13_2() { - return MAC_OS_X_VERSION_10_13_2; + public static long INT64_MIN() { + return INT64_MIN; } - private static final int MAC_OS_X_VERSION_10_13_4 = (int)101304L; + private static final int UINT32_MAX = (int)4294967295L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_13_4 101304 + * #define UINT32_MAX 4294967295 * } */ - public static int MAC_OS_X_VERSION_10_13_4() { - return MAC_OS_X_VERSION_10_13_4; + public static int UINT32_MAX() { + return UINT32_MAX; } - private static final int MAC_OS_X_VERSION_10_14 = (int)101400L; + private static final long UINT64_MAX = -1L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_14 101400 + * #define UINT64_MAX -1 * } */ - public static int MAC_OS_X_VERSION_10_14() { - return MAC_OS_X_VERSION_10_14; + public static long UINT64_MAX() { + return UINT64_MAX; } - private static final int MAC_OS_X_VERSION_10_14_1 = (int)101401L; + private static final int INT_LEAST8_MIN = (int)-128L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_14_1 101401 + * #define INT_LEAST8_MIN -128 * } */ - public static int MAC_OS_X_VERSION_10_14_1() { - return MAC_OS_X_VERSION_10_14_1; + public static int INT_LEAST8_MIN() { + return INT_LEAST8_MIN; } - private static final int MAC_OS_X_VERSION_10_14_4 = (int)101404L; + private static final int INT_LEAST16_MIN = (int)-32768L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_14_4 101404 + * #define INT_LEAST16_MIN -32768 * } */ - public static int MAC_OS_X_VERSION_10_14_4() { - return MAC_OS_X_VERSION_10_14_4; + public static int INT_LEAST16_MIN() { + return INT_LEAST16_MIN; } - private static final int MAC_OS_X_VERSION_10_14_5 = (int)101405L; + private static final int INT_LEAST32_MIN = (int)-2147483648L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_14_5 101405 + * #define INT_LEAST32_MIN -2147483648 * } */ - public static int MAC_OS_X_VERSION_10_14_5() { - return MAC_OS_X_VERSION_10_14_5; + public static int INT_LEAST32_MIN() { + return INT_LEAST32_MIN; } - private static final int MAC_OS_X_VERSION_10_14_6 = (int)101406L; + private static final long INT_LEAST64_MIN = -9223372036854775808L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_14_6 101406 + * #define INT_LEAST64_MIN -9223372036854775808 * } */ - public static int MAC_OS_X_VERSION_10_14_6() { - return MAC_OS_X_VERSION_10_14_6; + public static long INT_LEAST64_MIN() { + return INT_LEAST64_MIN; } - private static final int MAC_OS_X_VERSION_10_15 = (int)101500L; + private static final int INT_LEAST8_MAX = (int)127L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_15 101500 + * #define INT_LEAST8_MAX 127 * } */ - public static int MAC_OS_X_VERSION_10_15() { - return MAC_OS_X_VERSION_10_15; + public static int INT_LEAST8_MAX() { + return INT_LEAST8_MAX; } - private static final int MAC_OS_X_VERSION_10_15_1 = (int)101501L; + private static final int INT_LEAST16_MAX = (int)32767L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_15_1 101501 + * #define INT_LEAST16_MAX 32767 * } */ - public static int MAC_OS_X_VERSION_10_15_1() { - return MAC_OS_X_VERSION_10_15_1; + public static int INT_LEAST16_MAX() { + return INT_LEAST16_MAX; } - private static final int MAC_OS_X_VERSION_10_15_4 = (int)101504L; + private static final int INT_LEAST32_MAX = (int)2147483647L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_15_4 101504 + * #define INT_LEAST32_MAX 2147483647 * } */ - public static int MAC_OS_X_VERSION_10_15_4() { - return MAC_OS_X_VERSION_10_15_4; + public static int INT_LEAST32_MAX() { + return INT_LEAST32_MAX; } - private static final int MAC_OS_X_VERSION_10_16 = (int)101600L; + private static final long INT_LEAST64_MAX = 9223372036854775807L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_16 101600 + * #define INT_LEAST64_MAX 9223372036854775807 * } */ - public static int MAC_OS_X_VERSION_10_16() { - return MAC_OS_X_VERSION_10_16; + public static long INT_LEAST64_MAX() { + return INT_LEAST64_MAX; } - private static final int MAC_OS_VERSION_11_0 = (int)110000L; + private static final int UINT_LEAST8_MAX = (int)255L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_11_0 110000 + * #define UINT_LEAST8_MAX 255 * } */ - public static int MAC_OS_VERSION_11_0() { - return MAC_OS_VERSION_11_0; + public static int UINT_LEAST8_MAX() { + return UINT_LEAST8_MAX; } - private static final int MAC_OS_VERSION_11_1 = (int)110100L; + private static final int UINT_LEAST16_MAX = (int)65535L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_11_1 110100 + * #define UINT_LEAST16_MAX 65535 * } */ - public static int MAC_OS_VERSION_11_1() { - return MAC_OS_VERSION_11_1; + public static int UINT_LEAST16_MAX() { + return UINT_LEAST16_MAX; } - private static final int MAC_OS_VERSION_11_3 = (int)110300L; + private static final int UINT_LEAST32_MAX = (int)4294967295L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_11_3 110300 + * #define UINT_LEAST32_MAX 4294967295 * } */ - public static int MAC_OS_VERSION_11_3() { - return MAC_OS_VERSION_11_3; + public static int UINT_LEAST32_MAX() { + return UINT_LEAST32_MAX; } - private static final int MAC_OS_VERSION_11_4 = (int)110400L; + private static final long UINT_LEAST64_MAX = -1L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_11_4 110400 + * #define UINT_LEAST64_MAX -1 * } */ - public static int MAC_OS_VERSION_11_4() { - return MAC_OS_VERSION_11_4; + public static long UINT_LEAST64_MAX() { + return UINT_LEAST64_MAX; } - private static final int MAC_OS_VERSION_11_5 = (int)110500L; + private static final int INT_FAST8_MIN = (int)-128L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_11_5 110500 + * #define INT_FAST8_MIN -128 * } */ - public static int MAC_OS_VERSION_11_5() { - return MAC_OS_VERSION_11_5; + public static int INT_FAST8_MIN() { + return INT_FAST8_MIN; } - private static final int MAC_OS_VERSION_11_6 = (int)110600L; + private static final int INT_FAST16_MIN = (int)-32768L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_11_6 110600 + * #define INT_FAST16_MIN -32768 * } */ - public static int MAC_OS_VERSION_11_6() { - return MAC_OS_VERSION_11_6; + public static int INT_FAST16_MIN() { + return INT_FAST16_MIN; } - private static final int MAC_OS_VERSION_12_0 = (int)120000L; + private static final int INT_FAST32_MIN = (int)-2147483648L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_12_0 120000 + * #define INT_FAST32_MIN -2147483648 * } */ - public static int MAC_OS_VERSION_12_0() { - return MAC_OS_VERSION_12_0; + public static int INT_FAST32_MIN() { + return INT_FAST32_MIN; } - private static final int MAC_OS_VERSION_12_1 = (int)120100L; + private static final long INT_FAST64_MIN = -9223372036854775808L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_12_1 120100 + * #define INT_FAST64_MIN -9223372036854775808 * } */ - public static int MAC_OS_VERSION_12_1() { - return MAC_OS_VERSION_12_1; + public static long INT_FAST64_MIN() { + return INT_FAST64_MIN; } - private static final int MAC_OS_VERSION_12_2 = (int)120200L; + private static final int INT_FAST8_MAX = (int)127L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_12_2 120200 + * #define INT_FAST8_MAX 127 * } */ - public static int MAC_OS_VERSION_12_2() { - return MAC_OS_VERSION_12_2; + public static int INT_FAST8_MAX() { + return INT_FAST8_MAX; } - private static final int MAC_OS_VERSION_12_3 = (int)120300L; + private static final int INT_FAST16_MAX = (int)32767L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_12_3 120300 + * #define INT_FAST16_MAX 32767 * } */ - public static int MAC_OS_VERSION_12_3() { - return MAC_OS_VERSION_12_3; + public static int INT_FAST16_MAX() { + return INT_FAST16_MAX; } - private static final int MAC_OS_VERSION_12_4 = (int)120400L; + private static final int INT_FAST32_MAX = (int)2147483647L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_12_4 120400 + * #define INT_FAST32_MAX 2147483647 * } */ - public static int MAC_OS_VERSION_12_4() { - return MAC_OS_VERSION_12_4; + public static int INT_FAST32_MAX() { + return INT_FAST32_MAX; } - private static final int MAC_OS_VERSION_12_5 = (int)120500L; + private static final long INT_FAST64_MAX = 9223372036854775807L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_12_5 120500 + * #define INT_FAST64_MAX 9223372036854775807 * } */ - public static int MAC_OS_VERSION_12_5() { - return MAC_OS_VERSION_12_5; + public static long INT_FAST64_MAX() { + return INT_FAST64_MAX; } - private static final int MAC_OS_VERSION_12_6 = (int)120600L; + private static final int UINT_FAST8_MAX = (int)255L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_12_6 120600 + * #define UINT_FAST8_MAX 255 * } */ - public static int MAC_OS_VERSION_12_6() { - return MAC_OS_VERSION_12_6; + public static int UINT_FAST8_MAX() { + return UINT_FAST8_MAX; } - private static final int MAC_OS_VERSION_12_7 = (int)120700L; + private static final int UINT_FAST16_MAX = (int)65535L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_12_7 120700 + * #define UINT_FAST16_MAX 65535 * } */ - public static int MAC_OS_VERSION_12_7() { - return MAC_OS_VERSION_12_7; + public static int UINT_FAST16_MAX() { + return UINT_FAST16_MAX; } - private static final int MAC_OS_VERSION_13_0 = (int)130000L; + private static final int UINT_FAST32_MAX = (int)4294967295L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_13_0 130000 + * #define UINT_FAST32_MAX 4294967295 * } */ - public static int MAC_OS_VERSION_13_0() { - return MAC_OS_VERSION_13_0; + public static int UINT_FAST32_MAX() { + return UINT_FAST32_MAX; } - private static final int MAC_OS_VERSION_13_1 = (int)130100L; + private static final long UINT_FAST64_MAX = -1L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_13_1 130100 + * #define UINT_FAST64_MAX -1 * } */ - public static int MAC_OS_VERSION_13_1() { - return MAC_OS_VERSION_13_1; + public static long UINT_FAST64_MAX() { + return UINT_FAST64_MAX; } - private static final int MAC_OS_VERSION_13_2 = (int)130200L; + private static final long INTPTR_MAX = 9223372036854775807L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_13_2 130200 + * #define INTPTR_MAX 9223372036854775807 * } */ - public static int MAC_OS_VERSION_13_2() { - return MAC_OS_VERSION_13_2; + public static long INTPTR_MAX() { + return INTPTR_MAX; } - private static final int MAC_OS_VERSION_13_3 = (int)130300L; + private static final long INTPTR_MIN = -9223372036854775808L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_13_3 130300 + * #define INTPTR_MIN -9223372036854775808 * } */ - public static int MAC_OS_VERSION_13_3() { - return MAC_OS_VERSION_13_3; + public static long INTPTR_MIN() { + return INTPTR_MIN; } - private static final int MAC_OS_VERSION_13_4 = (int)130400L; + private static final long UINTPTR_MAX = -1L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_13_4 130400 + * #define UINTPTR_MAX -1 * } */ - public static int MAC_OS_VERSION_13_4() { - return MAC_OS_VERSION_13_4; + public static long UINTPTR_MAX() { + return UINTPTR_MAX; } - private static final int MAC_OS_VERSION_13_5 = (int)130500L; + private static final long INTMAX_MAX = 9223372036854775807L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_13_5 130500 + * #define INTMAX_MAX 9223372036854775807 * } */ - public static int MAC_OS_VERSION_13_5() { - return MAC_OS_VERSION_13_5; + public static long INTMAX_MAX() { + return INTMAX_MAX; } - private static final int MAC_OS_VERSION_13_6 = (int)130600L; + private static final long UINTMAX_MAX = -1L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_13_6 130600 + * #define UINTMAX_MAX -1 * } */ - public static int MAC_OS_VERSION_13_6() { - return MAC_OS_VERSION_13_6; + public static long UINTMAX_MAX() { + return UINTMAX_MAX; } - private static final int MAC_OS_VERSION_14_0 = (int)140000L; + private static final long INTMAX_MIN = -9223372036854775808L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_14_0 140000 + * #define INTMAX_MIN -9223372036854775808 * } */ - public static int MAC_OS_VERSION_14_0() { - return MAC_OS_VERSION_14_0; + public static long INTMAX_MIN() { + return INTMAX_MIN; } - private static final int MAC_OS_VERSION_14_1 = (int)140100L; + private static final long PTRDIFF_MIN = -9223372036854775808L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_14_1 140100 + * #define PTRDIFF_MIN -9223372036854775808 * } */ - public static int MAC_OS_VERSION_14_1() { - return MAC_OS_VERSION_14_1; + public static long PTRDIFF_MIN() { + return PTRDIFF_MIN; } - private static final int MAC_OS_VERSION_14_2 = (int)140200L; + private static final long PTRDIFF_MAX = 9223372036854775807L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_14_2 140200 + * #define PTRDIFF_MAX 9223372036854775807 * } */ - public static int MAC_OS_VERSION_14_2() { - return MAC_OS_VERSION_14_2; + public static long PTRDIFF_MAX() { + return PTRDIFF_MAX; } - private static final int MAC_OS_VERSION_14_3 = (int)140300L; + private static final long SIZE_MAX = -1L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_14_3 140300 + * #define SIZE_MAX -1 * } */ - public static int MAC_OS_VERSION_14_3() { - return MAC_OS_VERSION_14_3; + public static long SIZE_MAX() { + return SIZE_MAX; } - private static final int MAC_OS_VERSION_14_4 = (int)140400L; + private static final long RSIZE_MAX = 9223372036854775807L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_14_4 140400 + * #define RSIZE_MAX 9223372036854775807 * } */ - public static int MAC_OS_VERSION_14_4() { - return MAC_OS_VERSION_14_4; + public static long RSIZE_MAX() { + return RSIZE_MAX; } - private static final int MAC_OS_VERSION_14_5 = (int)140500L; + private static final int WCHAR_MAX = (int)2147483647L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_14_5 140500 + * #define WCHAR_MAX 2147483647 * } */ - public static int MAC_OS_VERSION_14_5() { - return MAC_OS_VERSION_14_5; + public static int WCHAR_MAX() { + return WCHAR_MAX; } - private static final int __MAC_OS_X_VERSION_MAX_ALLOWED = (int)140500L; + private static final int WCHAR_MIN = (int)-2147483648L; /** * {@snippet lang=c : - * #define __MAC_OS_X_VERSION_MAX_ALLOWED 140500 + * #define WCHAR_MIN -2147483648 * } */ - public static int __MAC_OS_X_VERSION_MAX_ALLOWED() { - return __MAC_OS_X_VERSION_MAX_ALLOWED; + public static int WCHAR_MIN() { + return WCHAR_MIN; } - private static final int __DARWIN_WCHAR_MAX = (int)2147483647L; + private static final int WINT_MIN = (int)-2147483648L; /** * {@snippet lang=c : - * #define __DARWIN_WCHAR_MAX 2147483647 + * #define WINT_MIN -2147483648 * } */ - public static int __DARWIN_WCHAR_MAX() { - return __DARWIN_WCHAR_MAX; + public static int WINT_MIN() { + return WINT_MIN; } - private static final int __DARWIN_WCHAR_MIN = (int)-2147483648L; + private static final int WINT_MAX = (int)2147483647L; /** * {@snippet lang=c : - * #define __DARWIN_WCHAR_MIN -2147483648 + * #define WINT_MAX 2147483647 * } */ - public static int __DARWIN_WCHAR_MIN() { - return __DARWIN_WCHAR_MIN; + public static int WINT_MAX() { + return WINT_MAX; } - private static final int __DARWIN_WEOF = (int)-1L; + private static final int SIG_ATOMIC_MIN = (int)-2147483648L; /** * {@snippet lang=c : - * #define __DARWIN_WEOF -1 + * #define SIG_ATOMIC_MIN -2147483648 * } */ - public static int __DARWIN_WEOF() { - return __DARWIN_WEOF; + public static int SIG_ATOMIC_MIN() { + return SIG_ATOMIC_MIN; } - private static final int EOF = (int)-1L; + private static final int SIG_ATOMIC_MAX = (int)2147483647L; /** * {@snippet lang=c : - * #define EOF -1 + * #define SIG_ATOMIC_MAX 2147483647 * } */ - public static int EOF() { - return EOF; + public static int SIG_ATOMIC_MAX() { + return SIG_ATOMIC_MAX; } /** * {@snippet lang=c : - * #define P_tmpdir "/var/tmp/" + * #define __ASSERT_FILE_NAME "jextract$14286507266664310341.h" * } */ - public static MemorySegment P_tmpdir() { + public static MemorySegment __ASSERT_FILE_NAME() { class Holder { - static final MemorySegment P_tmpdir - = somelib_h.LIBRARY_ARENA.allocateFrom("/var/tmp/"); + static final MemorySegment __ASSERT_FILE_NAME + = somelib_h.LIBRARY_ARENA.allocateFrom("jextract$14286507266664310341.h"); } - return Holder.P_tmpdir; + return Holder.__ASSERT_FILE_NAME; } } diff --git a/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/Float64VecTest.java b/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/Float64VecTest.java index 1e6ee0b38..4e1363153 100644 --- a/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/Float64VecTest.java +++ b/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/Float64VecTest.java @@ -18,6 +18,13 @@ void testFloat64Vec() { for (var i = 0; i < dArray.length; i++) { assertEquals(dArray[i], outArray[i]); } + + var newVec = Float64Vec.newFromOwned(dArray); + var newArray = newVec.asSlice(); + assertEquals(dArray.length, newArray.length); + for (var i = 0; i < dArray.length; i++) { + assertEquals(dArray[i], newArray[i]); + } } } \ No newline at end of file diff --git a/feature_tests/js/api/Opaque.d.ts b/feature_tests/js/api/Opaque.d.ts index ceb6cd37a..c58a82d78 100644 --- a/feature_tests/js/api/Opaque.d.ts +++ b/feature_tests/js/api/Opaque.d.ts @@ -20,6 +20,8 @@ export class Opaque { static returnsUsize(): number; + internalLen(): number; + static returnsImported(): ImportedStruct; static cmp(): number; diff --git a/feature_tests/js/api/Opaque.mjs b/feature_tests/js/api/Opaque.mjs index e4a4d7ee4..524127fb8 100644 --- a/feature_tests/js/api/Opaque.mjs +++ b/feature_tests/js/api/Opaque.mjs @@ -104,6 +104,16 @@ export class Opaque { finally {} } + internalLen() { + const result = wasm.Opaque_internal_len(this.ffiValue); + + try { + return result; + } + + finally {} + } + static returnsImported() { const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, false); diff --git a/feature_tests/src/imports.rs b/feature_tests/src/imports.rs index 6566f3dff..1b5cba93f 100644 --- a/feature_tests/src/imports.rs +++ b/feature_tests/src/imports.rs @@ -1,13 +1,11 @@ #[diplomat::bridge] pub mod ffi { - #[diplomat::attr(java, disable)] pub enum UnimportedEnum { A, B, C, } - #[diplomat::attr(java, disable)] pub struct ImportedStruct { foo: UnimportedEnum, count: u8, diff --git a/feature_tests/src/structs.rs b/feature_tests/src/structs.rs index df6d8dd90..612c3e7df 100644 --- a/feature_tests/src/structs.rs +++ b/feature_tests/src/structs.rs @@ -84,7 +84,6 @@ pub mod ffi { self.0.len() } - #[diplomat::attr(java, disable)] pub fn returns_imported() -> ImportedStruct { unimplemented!() } diff --git a/tool/src/java/mod.rs b/tool/src/java/mod.rs index f9e9d587d..2a20cfed1 100644 --- a/tool/src/java/mod.rs +++ b/tool/src/java/mod.rs @@ -506,8 +506,7 @@ return SliceUtils.{java_primitive_ty}SliceToArray(nativeVal);"# */ SuccessType::Write => { let write_return: Cow<'cx, str> = format!( - r#"var buffer = DiplomatWrite.buf(writeable); -var string = buffer.getString(0, StandardCharsets.UTF_8); + r#"var string = SliceUtils. readUtf8FromWriteable(writeable); {}_h.diplomat_buffer_write_destroy(writeable); return string;"#, lib_name diff --git a/tool/src/java/snapshots/diplomat_tool__java__test__enum_and_struct.snap b/tool/src/java/snapshots/diplomat_tool__java__test__enum_and_struct.snap index 8a6e0839a..376e6c2b2 100644 --- a/tool/src/java/snapshots/diplomat_tool__java__test__enum_and_struct.snap +++ b/tool/src/java/snapshots/diplomat_tool__java__test__enum_and_struct.snap @@ -13,6 +13,7 @@ import java.lang.foreign.SegmentAllocator; import java.util.List; import static java.lang.foreign.ValueLayout.*; import java.nio.charset.StandardCharsets; +import java.util.stream.Stream; public class MyStruct { byte a; @@ -30,30 +31,32 @@ public class MyStruct { private MyStruct(SegmentAllocator arena) { - this.arena = arena + this.arena = arena; } - void initFromSegment(MemorySegment segment) { - this.internal = segment; + MyStruct(SegmentAllocator arena, MemorySegment structSegment) { + this.arena = arena; + this.selfEdges = selfEdges; + - this.a = dev.diplomattest.somelib.ntv.MyStruct.a(segment); - this.b = dev.diplomattest.somelib.ntv.MyStruct.b(segment); - this.c = dev.diplomattest.somelib.ntv.MyStruct.c(segment); - this.d = dev.diplomattest.somelib.ntv.MyStruct.d(segment); - this.e = dev.diplomattest.somelib.ntv.MyStruct.e(segment); - this.f = dev.diplomattest.somelib.ntv.MyStruct.f(segment); - this.g = MyEnum.fromInt(dev.diplomattest.somelib.ntv.MyStruct.g(segment)); + this.a = dev.diplomattest.somelib.ntv.MyStruct.a(structSegment); + this.b = dev.diplomattest.somelib.ntv.MyStruct.b(structSegment); + this.c = dev.diplomattest.somelib.ntv.MyStruct.c(structSegment); + this.d = dev.diplomattest.somelib.ntv.MyStruct.d(structSegment); + this.e = dev.diplomattest.somelib.ntv.MyStruct.e(structSegment); + this.f = dev.diplomattest.somelib.ntv.MyStruct.f(structSegment); + this.g = MyEnum.fromInt(dev.diplomattest.somelib.ntv.MyStruct.g(structSegment)); + } public static MyStruct new_() { var returnArena = (SegmentAllocator) Arena.ofAuto(); - var nativeInvoker = somelib_h.MyStruct_new.makeInvoker(); - var nativeVal = nativeInvoker.apply(returnArena); - var returnVal = new MyStruct(returnArena); + var nativeVal = somelib_h.MyStruct_new(returnArena); + - returnVal.initFromSegment(nativeVal); + var returnVal = new MyStruct(returnArena, nativeVal); return returnVal; } @@ -135,8 +138,7 @@ public enum MyEnum { public static MyEnum getA() { - var nativeInvoker = somelib_h.MyEnum_get_a.makeInvoker(); - var nativeVal = nativeInvoker.apply(); + var nativeVal = somelib_h.MyEnum_get_a(); return MyEnum.fromInt(nativeVal); } diff --git a/tool/src/java/snapshots/diplomat_tool__java__test__lifetimes.snap b/tool/src/java/snapshots/diplomat_tool__java__test__lifetimes.snap index 607c6e71b..64b95c481 100644 --- a/tool/src/java/snapshots/diplomat_tool__java__test__lifetimes.snap +++ b/tool/src/java/snapshots/diplomat_tool__java__test__lifetimes.snap @@ -13,6 +13,7 @@ import java.lang.foreign.SegmentAllocator; import java.util.List; import static java.lang.foreign.ValueLayout.*; import java.nio.charset.StandardCharsets; +import java.util.stream.Stream; public class BorrowedFields { String a; @@ -27,16 +28,20 @@ public class BorrowedFields { private BorrowedFields(SegmentAllocator arena) { - this.arena = arena + this.arena = arena; } - void initFromSegment(MemorySegment segment) { - this.internal = segment; + BorrowedFields(SegmentAllocator arena, MemorySegment structSegment, List aEdges) { + this.arena = arena; + this.selfEdges = selfEdges; + this.aEdges = aEdges; + - this.a = dev.diplomattest.somelib.ntv.BorrowedFields.a(segment); - this.b = dev.diplomattest.somelib.ntv.BorrowedFields.b(segment); - this.c = dev.diplomattest.somelib.ntv.BorrowedFields.c(segment); + this.a = SliceUtils.readUtf16(dev.diplomattest.somelib.ntv.BorrowedFields.a(structSegment)); + this.b = SliceUtils.readUtf8(dev.diplomattest.somelib.ntv.BorrowedFields.b(structSegment)); + this.c = SliceUtils.readUtf8(dev.diplomattest.somelib.ntv.BorrowedFields.c(structSegment)); + } } @@ -54,6 +59,7 @@ import java.lang.foreign.SegmentAllocator; import java.util.List; import static java.lang.foreign.ValueLayout.*; import java.nio.charset.StandardCharsets; +import java.util.stream.Stream; public class BorrowedFieldsReturning { String bytes; @@ -66,14 +72,18 @@ public class BorrowedFieldsReturning { private BorrowedFieldsReturning(SegmentAllocator arena) { - this.arena = arena + this.arena = arena; } - void initFromSegment(MemorySegment segment) { - this.internal = segment; + BorrowedFieldsReturning(SegmentAllocator arena, MemorySegment structSegment, List aEdges) { + this.arena = arena; + this.selfEdges = selfEdges; + this.aEdges = aEdges; + - this.bytes = dev.diplomattest.somelib.ntv.BorrowedFieldsReturning.bytes(segment); + this.bytes = SliceUtils.readUtf8(dev.diplomattest.somelib.ntv.BorrowedFieldsReturning.bytes(structSegment)); + } } @@ -91,6 +101,7 @@ import java.lang.foreign.SegmentAllocator; import java.util.List; import static java.lang.foreign.ValueLayout.*; import java.nio.charset.StandardCharsets; +import java.util.stream.Stream; public class BorrowedFieldsWithBounds { String fieldA; @@ -107,16 +118,22 @@ public class BorrowedFieldsWithBounds { private BorrowedFieldsWithBounds(SegmentAllocator arena) { - this.arena = arena + this.arena = arena; } - void initFromSegment(MemorySegment segment) { - this.internal = segment; + BorrowedFieldsWithBounds(SegmentAllocator arena, MemorySegment structSegment, List aEdges, List bEdges, List cEdges) { + this.arena = arena; + this.selfEdges = selfEdges; + this.aEdges = aEdges; + this.bEdges = bEdges; + this.cEdges = cEdges; + - this.fieldA = dev.diplomattest.somelib.ntv.BorrowedFieldsWithBounds.fieldA(segment); - this.fieldB = dev.diplomattest.somelib.ntv.BorrowedFieldsWithBounds.fieldB(segment); - this.fieldC = dev.diplomattest.somelib.ntv.BorrowedFieldsWithBounds.fieldC(segment); + this.fieldA = SliceUtils.readUtf16(dev.diplomattest.somelib.ntv.BorrowedFieldsWithBounds.field_a(structSegment)); + this.fieldB = SliceUtils.readUtf8(dev.diplomattest.somelib.ntv.BorrowedFieldsWithBounds.field_b(structSegment)); + this.fieldC = SliceUtils.readUtf8(dev.diplomattest.somelib.ntv.BorrowedFieldsWithBounds.field_c(structSegment)); + } } @@ -135,6 +152,7 @@ import java.lang.ref.Cleaner; import java.util.List; import static java.lang.foreign.ValueLayout.*; import java.nio.charset.StandardCharsets; +import java.util.stream.Stream; public class Bar { @@ -159,6 +177,14 @@ public class Bar { } Bar() {} + Bar(MemorySegment handle, List selfEdges, List bEdges, List aEdges) { + this.internal = handle; + this.selfEdges = selfEdges; + this.bEdges = bEdges; + this.aEdges = aEdges; + + + } } @@ -175,6 +201,7 @@ import java.lang.ref.Cleaner; import java.util.List; import static java.lang.foreign.ValueLayout.*; import java.nio.charset.StandardCharsets; +import java.util.stream.Stream; public class Foo { @@ -198,6 +225,13 @@ public class Foo { } Foo() {} + Foo(MemorySegment handle, List selfEdges, List aEdges) { + this.internal = handle; + this.selfEdges = selfEdges; + this.aEdges = aEdges; + + + } public static Foo new_(String x) { @@ -205,11 +239,12 @@ public class Foo { var xMemSeg = arena.allocateFrom(x, StandardCharsets.UTF_8); var xLen = xMemSeg.byteSize(); var nativeVal = somelib_h.Foo_new(xMemSeg, xLen - 1); - var returnVal = new Foo(); + List selfEdges = List.of(); - returnVal.aEdges = List.of(x); - returnVal.internal = nativeVal; + + List aEdges = List.of(x); + var returnVal = new Foo(nativeVal, selfEdges, aEdges); var cleaner = new Foo.FooCleaner(nativeVal); returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; @@ -222,11 +257,12 @@ public class Foo { var xMemSeg = arena.allocateFrom(x, StandardCharsets.UTF_8); var xLen = xMemSeg.byteSize(); var nativeVal = somelib_h.Foo_new_static(xMemSeg, xLen - 1); - var returnVal = new Foo(); + List selfEdges = List.of(); + - returnVal.aEdges = List.of(); - returnVal.internal = nativeVal; + List aEdges = List.of(); + var returnVal = new Foo(nativeVal, selfEdges, aEdges); var cleaner = new Foo.FooCleaner(nativeVal); returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; @@ -237,11 +273,12 @@ public class Foo { var fieldsNative = fields.internal; var nativeVal = somelib_h.Foo_extract_from_fields(fieldsNative); - var returnVal = new Foo(); + List selfEdges = List.of(); - returnVal.aEdges = List.of(fields); - returnVal.internal = nativeVal; + + List aEdges = List.of(fields); + var returnVal = new Foo(nativeVal, selfEdges, aEdges); var cleaner = new Foo.FooCleaner(nativeVal); returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; @@ -254,11 +291,12 @@ public class Foo { var anotherStringMemSeg = arena.allocateFrom(anotherString, StandardCharsets.UTF_8); var anotherStringLen = anotherStringMemSeg.byteSize(); var nativeVal = somelib_h.Foo_extract_from_bounds(boundsNative, anotherStringMemSeg, anotherStringLen - 1); - var returnVal = new Foo(); + List selfEdges = List.of(); + - returnVal.aEdges = List.of(bounds, bounds, anotherString); - returnVal.internal = nativeVal; + List aEdges = List.of(bounds, bounds, anotherString); + var returnVal = new Foo(nativeVal, selfEdges, aEdges); var cleaner = new Foo.FooCleaner(nativeVal); returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; @@ -270,13 +308,13 @@ public class Foo { var nativeVal = somelib_h.Foo_get_bar(internal); - var returnVal = new Bar(); + List selfEdges = List.of(); - returnVal.bEdges = List.of(this); - returnVal.aEdges = List.of(this); - returnVal.internal = nativeVal; + List bEdges = List.of(this); + List aEdges = List.of(this); + var returnVal = new Bar(nativeVal, selfEdges, bEdges, aEdges); var cleaner = new Bar.BarCleaner(nativeVal); returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; @@ -287,9 +325,10 @@ public class Foo { var returnArena = (SegmentAllocator) Arena.ofAuto(); var nativeVal = somelib_h.Foo_as_returning(returnArena, internal); - var returnVal = new BorrowedFieldsReturning(returnArena); - returnVal.aEdges = List.of(this); - returnVal.initFromSegment(nativeVal); + + List aEdges = List.of(this); + + var returnVal = new BorrowedFieldsReturning(returnArena, nativeVal, aEdges); return returnVal; } diff --git a/tool/src/java/snapshots/diplomat_tool__java__test__opaque.snap b/tool/src/java/snapshots/diplomat_tool__java__test__opaque.snap index 1d386f5fe..d1d5e719a 100644 --- a/tool/src/java/snapshots/diplomat_tool__java__test__opaque.snap +++ b/tool/src/java/snapshots/diplomat_tool__java__test__opaque.snap @@ -14,6 +14,7 @@ import java.lang.ref.Cleaner; import java.util.List; import static java.lang.foreign.ValueLayout.*; import java.nio.charset.StandardCharsets; +import java.util.stream.Stream; public class Opaque { @@ -36,14 +37,21 @@ public class Opaque { } Opaque() {} + Opaque(MemorySegment handle, List selfEdges) { + this.internal = handle; + this.selfEdges = selfEdges; + + + } public static Opaque new_() { - var nativeInvoker = somelib_h.Opaque_new.makeInvoker(); - var nativeVal = nativeInvoker.apply(); - var returnVal = new Opaque(); + var nativeVal = somelib_h.Opaque_new(); + List selfEdges = List.of(); + - returnVal.internal = nativeVal; + + var returnVal = new Opaque(nativeVal, selfEdges); var cleaner = new Opaque.OpaqueCleaner(nativeVal); returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; @@ -55,9 +63,11 @@ public class Opaque { var inputMemSeg = arena.allocateFrom(input, StandardCharsets.UTF_8); var inputLen = inputMemSeg.byteSize(); var nativeVal = somelib_h.Opaque_from_str(inputMemSeg, inputLen - 1); - var returnVal = new Opaque(); + List selfEdges = List.of(); + + - returnVal.internal = nativeVal; + var returnVal = new Opaque(nativeVal, selfEdges); var cleaner = new Opaque.OpaqueCleaner(nativeVal); returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; @@ -66,8 +76,7 @@ public class Opaque { public static long returnsUsize() { - var nativeInvoker = somelib_h.Opaque_returns_usize.makeInvoker(); - var nativeVal = nativeInvoker.apply(); + var nativeVal = somelib_h.Opaque_returns_usize(); return nativeVal; } @@ -84,8 +93,7 @@ public class Opaque { var writeable = somelib_h.diplomat_buffer_write_create(0); somelib_h.Opaque_get_debug_str(internal, writeable); - var buffer = DiplomatWrite.buf(writeable); - var string = buffer.getString(0, StandardCharsets.UTF_8); + var string = SliceUtils. readUtf8FromWriteable(writeable); somelib_h.diplomat_buffer_write_destroy(writeable); return string; } diff --git a/tool/src/java/snapshots/diplomat_tool__java__test__opaque_render.snap b/tool/src/java/snapshots/diplomat_tool__java__test__opaque_render.snap index fa697f7a7..3fa537c3a 100644 --- a/tool/src/java/snapshots/diplomat_tool__java__test__opaque_render.snap +++ b/tool/src/java/snapshots/diplomat_tool__java__test__opaque_render.snap @@ -14,6 +14,7 @@ import java.lang.ref.Cleaner; import java.util.List; import static java.lang.foreign.ValueLayout.*; import java.nio.charset.StandardCharsets; +import java.util.stream.Stream; public class Opaque2 { @@ -36,6 +37,12 @@ public class Opaque2 { } Opaque2() {} + Opaque2(MemorySegment handle, List selfEdges) { + this.internal = handle; + this.selfEdges = selfEdges; + + + } } diff --git a/tool/src/kotlin/snapshots/diplomat_tool__kotlin__test__opaque_gen.snap b/tool/src/kotlin/snapshots/diplomat_tool__kotlin__test__opaque_gen.snap index 5c0651d8c..9ed263f38 100644 --- a/tool/src/kotlin/snapshots/diplomat_tool__kotlin__test__opaque_gen.snap +++ b/tool/src/kotlin/snapshots/diplomat_tool__kotlin__test__opaque_gen.snap @@ -2,7 +2,7 @@ source: tool/src/kotlin/mod.rs expression: res --- -package dev.gigapixel.somelib +package dev.diplomattest.somelib import com.sun.jna.Library import com.sun.jna.Native @@ -38,7 +38,7 @@ class OwndingStruct internal constructor ( } ======================= -package dev.gigapixel.somelib +package dev.diplomattest.somelib import com.sun.jna.Library import com.sun.jna.Native @@ -71,7 +71,7 @@ class OwnedStruct internal constructor ( } ======================= -package dev.gigapixel.somelib; +package dev.diplomattest.somelib; import com.sun.jna.Library import com.sun.jna.Native import com.sun.jna.Pointer @@ -104,7 +104,7 @@ class BorrowWrapper internal constructor ( } ======================= -package dev.gigapixel.somelib; +package dev.diplomattest.somelib; import com.sun.jna.Library import com.sun.jna.Native import com.sun.jna.Pointer @@ -135,7 +135,7 @@ class InputStruct internal constructor ( } ======================= -package dev.gigapixel.somelib; +package dev.diplomattest.somelib; import com.sun.jna.Library import com.sun.jna.Native import com.sun.jna.Pointer diff --git a/tool/templates/java/Lib.java.jinja b/tool/templates/java/Lib.java.jinja index 62cbcdee8..da5462b71 100644 --- a/tool/templates/java/Lib.java.jinja +++ b/tool/templates/java/Lib.java.jinja @@ -181,6 +181,7 @@ class SliceUtils { }); return diplomatStrsData; } + static MemorySegment strs8(SegmentAllocator arena, String [] strings) { var diplomatStrsData = DiplomatStringView.allocateArray(strings.length, arena); var layout = DiplomatStringView.layout(); @@ -198,4 +199,14 @@ class SliceUtils { }); return diplomatStrsData; } + + static String readUtf8FromWriteable(MemorySegment writeable) { + var buffer = DiplomatWrite.buf(writeable); + var len = DiplomatWrite.len(writeable); + var bytes = new byte[(int) len]; + for (var i = 0; i < len; i++) { + bytes[i] = buffer.get(JAVA_BYTE, i); + } + return new String(bytes, StandardCharsets.UTF_8); + } } From 2b10d7a718cc88061a8fbb0f29808334eed6754d Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Sat, 10 Aug 2024 15:37:17 +0200 Subject: [PATCH 17/69] panama-backend - remove java from gen as ci would need jextract --- Makefile.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile.toml b/Makefile.toml index 8e234232a..94e721d66 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -309,7 +309,6 @@ dependencies = [ "gen-js-feature", "gen-dart-feature", "gen-kotlin-feature", - "gen-java-feature", ] [tasks.gen-example] From 69cbab6497b05fe8788349a721751a3e6e46c70f Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Sat, 10 Aug 2024 15:46:22 +0200 Subject: [PATCH 18/69] panama-backend - fix test --- tool/src/java/mod.rs | 9 +-- .../diplomat_tool__java__test__slice.snap | 72 ++++++++++++------- 2 files changed, 47 insertions(+), 34 deletions(-) diff --git a/tool/src/java/mod.rs b/tool/src/java/mod.rs index 2a20cfed1..9da770177 100644 --- a/tool/src/java/mod.rs +++ b/tool/src/java/mod.rs @@ -1103,8 +1103,8 @@ mod test { } #[diplomat::skip_if_ast] - pub fn get_boxed_str(&self) -> Box { - self.0.as_str().into() + pub fn get_boxed_str<'a>(&'a self) -> &'a str { + self.0.as_str() } } @@ -1116,11 +1116,6 @@ mod test { Box::new(Self(v.to_vec())) } - #[diplomat::attr(supports = accessors, getter = "asBoxedSlice")] - pub fn as_boxed_slice(&self) -> Box<[f64]> { - self.0.clone().into() - } - #[diplomat::attr(supports = accessors, getter = "asSlice")] pub fn as_slice<'a>(&'a self) -> &'a [f64] { &self.0 diff --git a/tool/src/java/snapshots/diplomat_tool__java__test__slice.snap b/tool/src/java/snapshots/diplomat_tool__java__test__slice.snap index 40932b537..0aec7a1ab 100644 --- a/tool/src/java/snapshots/diplomat_tool__java__test__slice.snap +++ b/tool/src/java/snapshots/diplomat_tool__java__test__slice.snap @@ -14,6 +14,7 @@ import java.lang.ref.Cleaner; import java.util.List; import static java.lang.foreign.ValueLayout.*; import java.nio.charset.StandardCharsets; +import java.util.stream.Stream; public class Float64Vec { @@ -36,6 +37,12 @@ public class Float64Vec { } Float64Vec() {} + Float64Vec(MemorySegment handle, List selfEdges) { + this.internal = handle; + this.selfEdges = selfEdges; + + + } public static Float64Vec new_(double[] v) { @@ -43,9 +50,11 @@ public class Float64Vec { var vLen = v.length; var vMemSeg = arena.allocateFrom(JAVA_DOUBLE, v); var nativeVal = somelib_h.Float64Vec_new(vMemSeg, vLen); - var returnVal = new Float64Vec(); + List selfEdges = List.of(); + - returnVal.internal = nativeVal; + + var returnVal = new Float64Vec(nativeVal, selfEdges); var cleaner = new Float64Vec.Float64VecCleaner(nativeVal); returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; @@ -53,16 +62,6 @@ public class Float64Vec { } - public double[] asBoxedSlice() { - - var boxArena = Arena.ofConfined(); - - var nativeVal = somelib_h.Float64Vec_as_boxed_slice(boxArena, internal); - var data = dev.diplomattest.somelib.ntv.DiplomatF64View.data(nativeVal); - var len = dev.diplomattest.somelib.ntv.DiplomatF64View.len(nativeVal); - return SliceUtils.doubleSliceToArray(nativeVal); - } - public double[] asSlice() { try (var arena = Arena.ofConfined()) { @@ -89,6 +88,7 @@ import java.lang.ref.Cleaner; import java.util.List; import static java.lang.foreign.ValueLayout.*; import java.nio.charset.StandardCharsets; +import java.util.stream.Stream; public class MyString { @@ -111,16 +111,27 @@ public class MyString { } MyString() {} + MyString(MemorySegment handle, List selfEdges) { + this.internal = handle; + this.selfEdges = selfEdges; + + + } - public MyString(String v) { + public static MyString new_(String v) { try (var arena = Arena.ofConfined()) { var vMemSeg = arena.allocateFrom(v, StandardCharsets.UTF_8); var vLen = vMemSeg.byteSize(); var nativeVal = somelib_h.MyString_new(vMemSeg, vLen - 1); - this.internal = nativeVal; + List selfEdges = List.of(); + + + + var returnVal = new MyString(nativeVal, selfEdges); var cleaner = new MyString.MyStringCleaner(nativeVal); - this.cleanable = Lib.cleaner.register(this, cleaner); + returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); + return returnVal; } } @@ -130,9 +141,11 @@ public class MyString { var vMemSeg = arena.allocateFrom(v, StandardCharsets.UTF_8); var vLen = vMemSeg.byteSize(); var nativeVal = somelib_h.MyString_new_unsafe(vMemSeg, vLen - 1); - var returnVal = new MyString(); + List selfEdges = List.of(); + - returnVal.internal = nativeVal; + + var returnVal = new MyString(nativeVal, selfEdges); var cleaner = new MyString.MyStringCleaner(nativeVal); returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; @@ -144,9 +157,11 @@ public class MyString { var vMemSeg = Arena.global().allocateFrom(v, StandardCharsets.UTF_8); var vLen = vMemSeg.byteSize(); var nativeVal = somelib_h.MyString_new_owned(vMemSeg, vLen - 1); - var returnVal = new MyString(); + List selfEdges = List.of(); + + - returnVal.internal = nativeVal; + var returnVal = new MyString(nativeVal, selfEdges); var cleaner = new MyString.MyStringCleaner(nativeVal); returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; @@ -158,9 +173,11 @@ public class MyString { var vData = SliceUtils.strs8(arena, v); var vLen = v.length; var nativeVal = somelib_h.MyString_new_from_first(vData, vLen); - var returnVal = new MyString(); + List selfEdges = List.of(); - returnVal.internal = nativeVal; + + + var returnVal = new MyString(nativeVal, selfEdges); var cleaner = new MyString.MyStringCleaner(nativeVal); returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; @@ -184,18 +201,19 @@ public class MyString { var writeable = somelib_h.diplomat_buffer_write_create(0); somelib_h.MyString_get_str(internal, writeable); - var buffer = DiplomatWrite.buf(writeable); - var string = buffer.getString(0, StandardCharsets.UTF_8); + var string = SliceUtils. readUtf8FromWriteable(writeable); somelib_h.diplomat_buffer_write_destroy(writeable); return string; } public String getBoxedStr() { - var boxArena = Arena.ofConfined(); - - var nativeVal = somelib_h.MyString_get_boxed_str(boxArena, internal); - return SliceUtils.readUtf8(nativeVal); + try (var arena = Arena.ofConfined()) { + + + var nativeVal = somelib_h.MyString_get_boxed_str(arena, internal); + return SliceUtils.readUtf8(nativeVal); + } } } From eb6e8903aa46a43e79d867cbf4b00f7d320e8ec3 Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Sat, 10 Aug 2024 15:49:20 +0200 Subject: [PATCH 19/69] panama-backend - remove printlns --- tool/src/java/mod.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tool/src/java/mod.rs b/tool/src/java/mod.rs index 9da770177..11df0076a 100644 --- a/tool/src/java/mod.rs +++ b/tool/src/java/mod.rs @@ -122,8 +122,6 @@ pub(crate) fn run<'a>( command.arg("-r").arg(tmp_path).output() }; - println!("Running: {:?}", command); - match command.output() { Err(err) => match err.kind() { std::io::ErrorKind::NotFound => { @@ -569,12 +567,10 @@ return string;"#, let Config { lib_name, .. } = &self.tcx_config; let mut static_methods = Vec::new(); let mut class_methods = Vec::new(); - println!("Working on type {ty_name}"); methods .iter() .filter(|method| !method.attrs.disable) .filter_map(|method| -> Option<(bool, Cow<'cx, str>)> { - println!("Working on method {}", method.name); let mut visitor = method.borrowing_param_visitor(self.tcx); let (method_name, is_valid_constructor) = match method.attrs.special_method { From ee583389ce995868953c60163d9c1651b667cd9d Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Sat, 10 Aug 2024 16:08:02 +0200 Subject: [PATCH 20/69] panama-backend - fix merge issues --- tool/src/java/mod.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tool/src/java/mod.rs b/tool/src/java/mod.rs index 11df0076a..a1688512d 100644 --- a/tool/src/java/mod.rs +++ b/tool/src/java/mod.rs @@ -1084,12 +1084,12 @@ mod test { } #[diplomat::skip_if_ast] - pub fn new_from_first(v: &[&DiplomatStr]) -> Box { + pub fn new_from_first<'a>(v: &[DiplomatStrSlice]) -> Box { Box::new(Self(core::str::from_utf8(v[0]).unwrap().into())) } #[diplomat::attr(supports = accessors, setter = "str")] - pub fn set_str(&mut self, new_str: &DiplomatStr) { + pub fn set_str<'a>(&'a mut self, new_str: DiplomatStrSlice<'a>) { self.0 = String::from_utf8(new_str.to_owned()).unwrap(); } @@ -1347,19 +1347,19 @@ mod test { pub struct Bar<'b, 'a: 'b>(&'b Foo<'a>); pub struct BorrowedFields<'a> { - a: &'a DiplomatStr16, - b: &'a DiplomatStr, - c: &'a str, + a: DiplomatStr16Slice<'a>, + b: DiplomatStrSlice<'a>, + c: DiplomatStrSlice<'a>, } pub struct BorrowedFieldsWithBounds<'a, 'b: 'a, 'c: 'b> { - field_a: &'a DiplomatStr16, - field_b: &'b DiplomatStr, - field_c: &'c str, + field_a: DiplomatStr16Slice<'a>, + field_b: DiplomatStrSlice<'b>, + field_c: DiplomatStrSlice<'c>, } pub struct BorrowedFieldsReturning<'a> { - bytes: &'a DiplomatStr, + bytes: DiplomatStrSlice<'a>, } impl<'a> Foo<'a> { From d620460c050ebfc74c5e4c6d529bafd48b7989d1 Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Sat, 10 Aug 2024 16:35:06 +0200 Subject: [PATCH 21/69] panama-backend - change attribute goals --- tool/src/java/mod.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tool/src/java/mod.rs b/tool/src/java/mod.rs index a1688512d..704dc47d6 100644 --- a/tool/src/java/mod.rs +++ b/tool/src/java/mod.rs @@ -29,18 +29,18 @@ pub(crate) fn attr_support() -> BackendAttrSupport { a.namespacing = false; // TODO a.memory_sharing = false; a.non_exhaustive_structs = true; - a.method_overloading = true; + a.method_overloading = false; a.utf8_strings = false; a.utf16_strings = true; a.constructors = false; // TODO a.named_constructors = false; // TODO - a.fallible_constructors = false; // TODO - a.accessors = false; - a.stringifiers = false; // TODO + a.fallible_constructors = false; + a.accessors = false; // TODO + a.stringifiers = false; a.comparators = false; // TODO - a.iterators = false; - a.iterables = false; + a.iterators = false; // TODO + a.iterables = false; // TODO a.indexing = false; a From 18a5762f48e46bd11b4e958f92a3064a237ccd29 Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Wed, 14 Aug 2024 21:11:30 +0200 Subject: [PATCH 22/69] panama-backend - fix diplomat view changes --- .../java/somelib/hs_err_pid98653.log | 1247 ++++ .../java/somelib/hs_err_pid98695.log | 1291 ++++ .../java/somelib/hs_err_pid98776.log | 1291 ++++ .../java/somelib/hs_err_pid98821.log | 1245 ++++ .../java/somelib/hs_err_pid98829.log | 1291 ++++ .../java/somelib/hs_err_pid98866.log | 1291 ++++ .../diplomattest/somelib/BorrowedFields.java | 18 +- .../somelib/BorrowedFieldsReturning.java | 2 +- .../somelib/BorrowedFieldsWithBounds.java | 18 +- .../diplomattest/somelib/CyclicStructA.java | 2 +- .../diplomattest/somelib/CyclicStructB.java | 2 +- .../dev/diplomattest/somelib/ErrorStruct.java | 2 +- .../dev/diplomattest/somelib/Float64Vec.java | 72 +- .../java/dev/diplomattest/somelib/Foo.java | 27 +- .../diplomattest/somelib/ImportedStruct.java | 2 +- .../java/dev/diplomattest/somelib/Lib.java | 14 +- .../dev/diplomattest/somelib/MyString.java | 49 +- .../dev/diplomattest/somelib/MyStruct.java | 2 +- .../java/dev/diplomattest/somelib/MyZst.java | 2 +- .../somelib/NestedBorrowedFields.java | 32 +- .../java/dev/diplomattest/somelib/Opaque.java | 9 +- .../dev/diplomattest/somelib/Utf16Wrap.java | 9 +- .../diplomattest/somelib/ntv/somelib_h.java | 6284 ++++++++--------- tool/src/java/mod.rs | 46 +- tool/templates/java/Lib.java.jinja | 14 +- tool/templates/java/Struct.java.jinja | 2 +- 26 files changed, 11007 insertions(+), 3257 deletions(-) create mode 100644 feature_tests/java/somelib/hs_err_pid98653.log create mode 100644 feature_tests/java/somelib/hs_err_pid98695.log create mode 100644 feature_tests/java/somelib/hs_err_pid98776.log create mode 100644 feature_tests/java/somelib/hs_err_pid98821.log create mode 100644 feature_tests/java/somelib/hs_err_pid98829.log create mode 100644 feature_tests/java/somelib/hs_err_pid98866.log diff --git a/feature_tests/java/somelib/hs_err_pid98653.log b/feature_tests/java/somelib/hs_err_pid98653.log new file mode 100644 index 000000000..430243240 --- /dev/null +++ b/feature_tests/java/somelib/hs_err_pid98653.log @@ -0,0 +1,1247 @@ +# +# A fatal error has been detected by the Java Runtime Environment: +# +# SIGSEGV (0xb) at pc=0x00000001059e9aec, pid=98653, tid=8707 +# +# JRE version: OpenJDK Runtime Environment Temurin-22.0.1+8 (22.0.1+8) (build 22.0.1+8) +# Java VM: OpenJDK 64-Bit Server VM Temurin-22.0.1+8 (22.0.1+8, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-aarch64) +# Problematic frame: +# C [libsomelib.dylib+0x5aec] Float64Vec_new_isize+0xb4 +# +# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again +# +# If you would like to submit a bug report, please visit: +# https://github.com/adoptium/adoptium-support/issues +# The crash happened outside the Java Virtual Machine in native code. +# See problematic frame for where to report the bug. +# + +--------------- S U M M A R Y ------------ + +Command Line: -ea -Didea.test.cyclic.buffer.size=1048576 -javaagent:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/lib/idea_rt.jar=60545:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/bin -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit5 dev.diplomattest.somelib.Float64VecTest,testFloat64Vec + +Host: "MacBookPro18,3" arm64, 8 cores, 16G, Darwin 23.5.0, macOS 14.5 (23F79) +Time: Wed Aug 14 21:05:02 2024 CEST elapsed time: 0.332978 seconds (0d 0h 0m 0s) + +--------------- T H R E A D --------------- + +Current thread (0x000000013980aa00): JavaThread "main" [_thread_in_native, id=8707, stack(0x000000016ba98000,0x000000016bc9b000) (2060K)] + +Stack: [0x000000016ba98000,0x000000016bc9b000], sp=0x000000016bc97870, free space=2046k +Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) +C [libsomelib.dylib+0x5aec] Float64Vec_new_isize+0xb4 +v ~RuntimeStub::nep_invoker_blob 0x00000001167986bc +j java.lang.invoke.LambdaForm$MH+0x000000ff001d0400.invoke(Ljava/lang/Object;JJJ)J+12 java.base@22.0.1 +j java.lang.invoke.LambdaForm$MH+0x000000ff001d3000.invokeExact_MT(Ljava/lang/Object;JJJLjava/lang/Object;)J+23 java.base@22.0.1 +j jdk.internal.foreign.abi.DowncallStub+0x000000ff001d1000.invoke(Ljava/lang/foreign/SegmentAllocator;Ljava/lang/foreign/MemorySegment;Ljava/lang/foreign/MemorySegment;)Ljava/lang/foreign/MemorySegment;+69 java.base@22.0.1 +j java.lang.invoke.LambdaForm$DMH+0x000000ff001d1400.invokeStaticInit(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+14 java.base@22.0.1 +j java.lang.invoke.LambdaForm$MH+0x000000ff001d2400.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+44 java.base@22.0.1 +j java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+19 java.base@22.0.1 +j dev.diplomattest.somelib.ntv.somelib_h.Float64Vec_new_isize(Ljava/lang/foreign/MemorySegment;)Ljava/lang/foreign/MemorySegment;+26 +j dev.diplomattest.somelib.Float64Vec.newIsize([J)Ldev/diplomattest/somelib/Float64Vec;+38 +j dev.diplomattest.somelib.Float64VecTest.testFloat64Vec()V+53 +j java.lang.invoke.LambdaForm$DMH+0x000000ff0014c000.invokeVirtual(Ljava/lang/Object;Ljava/lang/Object;)V+10 java.base@22.0.1 +j java.lang.invoke.LambdaForm$MH+0x000000ff0014c800.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+31 java.base@22.0.1 +j java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+19 java.base@22.0.1 +j jdk.internal.reflect.DirectMethodHandleAccessor.invokeImpl(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+41 java.base@22.0.1 +j jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+23 java.base@22.0.1 +j java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+102 java.base@22.0.1 +j org.junit.platform.commons.util.ReflectionUtils.invokeMethod(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+42 +j org.junit.jupiter.engine.execution.MethodInvocation.proceed()Ljava/lang/Object;+16 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed()Ljava/lang/Object;+8 +j org.junit.jupiter.engine.extension.TimeoutExtension.intercept(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/TimeoutDuration;Lorg/junit/jupiter/engine/extension/TimeoutExtension$TimeoutProvider;)Ljava/lang/Object;+28 +j org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/TimeoutExtension$TimeoutProvider;)Ljava/lang/Object;+31 +j org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)V+9 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda+0x000000ff00117b80.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)V+5 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall$VoidMethodInterceptorCall;Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)Ljava/lang/Void;+6 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall$$Lambda+0x000000ff00115800.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)Ljava/lang/Object;+9 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+6 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$$Lambda+0x000000ff00146cc8.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+14 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed()Ljava/lang/Object;+12 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+1 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/engine/execution/InvocationInterceptorChain$InterceptorCall;Ljava/util/List;)Ljava/lang/Object;+24 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InvocationInterceptorChain$InterceptorCall;)Ljava/lang/Object;+31 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;)Ljava/lang/Object;+15 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(Ljava/lang/reflect/Method;Ljava/lang/Object;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;)Ljava/lang/Object;+55 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;)V+28 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda+0x000000ff00144c10.execute()V+12 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)V+21 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;+44 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;+6 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+79 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x000000ff00135638.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x000000ff00135418.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 +j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x000000ff00135000.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService$$Lambda+0x000000ff00134a30.accept(Ljava/lang/Object;)V+4 +j java.util.ArrayList.forEach(Ljava/util/function/Consumer;)V+46 java.base@22.0.1 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(Ljava/util/List;)V+6 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+116 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x000000ff00135638.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x000000ff00135418.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 +j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x000000ff00135000.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService$$Lambda+0x000000ff00134a30.accept(Ljava/lang/Object;)V+4 +j java.util.ArrayList.forEach(Ljava/util/function/Consumer;)V+46 java.base@22.0.1 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(Ljava/util/List;)V+6 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+116 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x000000ff00135638.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x000000ff00135418.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 +j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x000000ff00135000.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(Lorg/junit/platform/engine/support/hierarchical/HierarchicalTestExecutorService$TestTask;)Ljava/util/concurrent/Future;+1 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute()Ljava/util/concurrent/Future;+74 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(Lorg/junit/platform/engine/ExecutionRequest;)V+31 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/engine/TestDescriptor;Lorg/junit/platform/engine/EngineExecutionListener;Lorg/junit/platform/engine/ConfigurationParameters;Lorg/junit/platform/engine/TestEngine;)V+24 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/LauncherDiscoveryResult;Lorg/junit/platform/engine/EngineExecutionListener;)V+115 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;Lorg/junit/platform/engine/EngineExecutionListener;Lorg/junit/platform/launcher/TestExecutionListener;)V+55 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(Lorg/junit/platform/launcher/core/InternalTestPlan;Lorg/junit/platform/launcher/TestExecutionListener;)V+6 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator$$Lambda+0x000000ff001220e0.accept(Ljava/lang/Object;)V+12 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(Lorg/junit/platform/engine/ConfigurationParameters;Lorg/junit/platform/launcher/core/ListenerRegistry;Ljava/util/function/Consumer;)V+51 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;[Lorg/junit/platform/launcher/TestExecutionListener;)V+23 +j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;[Lorg/junit/platform/launcher/TestExecutionListener;)V+6 +j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+34 +j org.junit.platform.launcher.core.DelegatingLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+6 +j org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+13 +j com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs([Ljava/lang/String;Ljava/lang/String;IZ)I+203 +j com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(Z)I+17 +j com.intellij.rt.execution.junit.TestsRepeater.repeat(IZLcom/intellij/rt/execution/junit/TestsRepeater$TestRun;)I+7 +j com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(Lcom/intellij/rt/junit/IdeaTestRunner;[Ljava/lang/String;Ljava/util/ArrayList;Ljava/lang/String;IZ)I+25 +j com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart([Ljava/lang/String;Ljava/lang/String;Ljava/util/ArrayList;Ljava/lang/String;)I+117 +j com.intellij.rt.junit.JUnitStarter.main([Ljava/lang/String;)V+97 +v ~StubRoutines::call_stub 0x0000000116654154 +...... +Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) +v ~RuntimeStub::nep_invoker_blob 0x000000011679868c +j java.lang.invoke.LambdaForm$MH+0x000000ff001d0400.invoke(Ljava/lang/Object;JJJ)J+12 java.base@22.0.1 +j java.lang.invoke.LambdaForm$MH+0x000000ff001d3000.invokeExact_MT(Ljava/lang/Object;JJJLjava/lang/Object;)J+23 java.base@22.0.1 +j jdk.internal.foreign.abi.DowncallStub+0x000000ff001d1000.invoke(Ljava/lang/foreign/SegmentAllocator;Ljava/lang/foreign/MemorySegment;Ljava/lang/foreign/MemorySegment;)Ljava/lang/foreign/MemorySegment;+69 java.base@22.0.1 +j java.lang.invoke.LambdaForm$DMH+0x000000ff001d1400.invokeStaticInit(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+14 java.base@22.0.1 +j java.lang.invoke.LambdaForm$MH+0x000000ff001d2400.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+44 java.base@22.0.1 +j java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+19 java.base@22.0.1 +j dev.diplomattest.somelib.ntv.somelib_h.Float64Vec_new_isize(Ljava/lang/foreign/MemorySegment;)Ljava/lang/foreign/MemorySegment;+26 +j dev.diplomattest.somelib.Float64Vec.newIsize([J)Ldev/diplomattest/somelib/Float64Vec;+38 +j dev.diplomattest.somelib.Float64VecTest.testFloat64Vec()V+53 +j java.lang.invoke.LambdaForm$DMH+0x000000ff0014c000.invokeVirtual(Ljava/lang/Object;Ljava/lang/Object;)V+10 java.base@22.0.1 +j java.lang.invoke.LambdaForm$MH+0x000000ff0014c800.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+31 java.base@22.0.1 +j java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+19 java.base@22.0.1 +j jdk.internal.reflect.DirectMethodHandleAccessor.invokeImpl(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+41 java.base@22.0.1 +j jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+23 java.base@22.0.1 +j java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+102 java.base@22.0.1 +j org.junit.platform.commons.util.ReflectionUtils.invokeMethod(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+42 +j org.junit.jupiter.engine.execution.MethodInvocation.proceed()Ljava/lang/Object;+16 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed()Ljava/lang/Object;+8 +j org.junit.jupiter.engine.extension.TimeoutExtension.intercept(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/TimeoutDuration;Lorg/junit/jupiter/engine/extension/TimeoutExtension$TimeoutProvider;)Ljava/lang/Object;+28 +j org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/TimeoutExtension$TimeoutProvider;)Ljava/lang/Object;+31 +j org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)V+9 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda+0x000000ff00117b80.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)V+5 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall$VoidMethodInterceptorCall;Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)Ljava/lang/Void;+6 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall$$Lambda+0x000000ff00115800.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)Ljava/lang/Object;+9 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+6 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$$Lambda+0x000000ff00146cc8.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+14 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed()Ljava/lang/Object;+12 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+1 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/engine/execution/InvocationInterceptorChain$InterceptorCall;Ljava/util/List;)Ljava/lang/Object;+24 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InvocationInterceptorChain$InterceptorCall;)Ljava/lang/Object;+31 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;)Ljava/lang/Object;+15 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(Ljava/lang/reflect/Method;Ljava/lang/Object;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;)Ljava/lang/Object;+55 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;)V+28 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda+0x000000ff00144c10.execute()V+12 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)V+21 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;+44 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;+6 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+79 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x000000ff00135638.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x000000ff00135418.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 +j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x000000ff00135000.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService$$Lambda+0x000000ff00134a30.accept(Ljava/lang/Object;)V+4 +j java.util.ArrayList.forEach(Ljava/util/function/Consumer;)V+46 java.base@22.0.1 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(Ljava/util/List;)V+6 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+116 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x000000ff00135638.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x000000ff00135418.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 +j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x000000ff00135000.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService$$Lambda+0x000000ff00134a30.accept(Ljava/lang/Object;)V+4 +j java.util.ArrayList.forEach(Ljava/util/function/Consumer;)V+46 java.base@22.0.1 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(Ljava/util/List;)V+6 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+116 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x000000ff00135638.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x000000ff00135418.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 +j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x000000ff00135000.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(Lorg/junit/platform/engine/support/hierarchical/HierarchicalTestExecutorService$TestTask;)Ljava/util/concurrent/Future;+1 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute()Ljava/util/concurrent/Future;+74 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(Lorg/junit/platform/engine/ExecutionRequest;)V+31 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/engine/TestDescriptor;Lorg/junit/platform/engine/EngineExecutionListener;Lorg/junit/platform/engine/ConfigurationParameters;Lorg/junit/platform/engine/TestEngine;)V+24 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/LauncherDiscoveryResult;Lorg/junit/platform/engine/EngineExecutionListener;)V+115 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;Lorg/junit/platform/engine/EngineExecutionListener;Lorg/junit/platform/launcher/TestExecutionListener;)V+55 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(Lorg/junit/platform/launcher/core/InternalTestPlan;Lorg/junit/platform/launcher/TestExecutionListener;)V+6 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator$$Lambda+0x000000ff001220e0.accept(Ljava/lang/Object;)V+12 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(Lorg/junit/platform/engine/ConfigurationParameters;Lorg/junit/platform/launcher/core/ListenerRegistry;Ljava/util/function/Consumer;)V+51 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;[Lorg/junit/platform/launcher/TestExecutionListener;)V+23 +j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;[Lorg/junit/platform/launcher/TestExecutionListener;)V+6 +j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+34 +j org.junit.platform.launcher.core.DelegatingLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+6 +j org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+13 +j com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs([Ljava/lang/String;Ljava/lang/String;IZ)I+203 +j com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(Z)I+17 +j com.intellij.rt.execution.junit.TestsRepeater.repeat(IZLcom/intellij/rt/execution/junit/TestsRepeater$TestRun;)I+7 +j com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(Lcom/intellij/rt/junit/IdeaTestRunner;[Ljava/lang/String;Ljava/util/ArrayList;Ljava/lang/String;IZ)I+25 +j com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart([Ljava/lang/String;Ljava/lang/String;Ljava/util/ArrayList;Ljava/lang/String;)I+117 +j com.intellij.rt.junit.JUnitStarter.main([Ljava/lang/String;)V+97 +v ~StubRoutines::call_stub 0x0000000116654154 + +siginfo: si_signo: 11 (SIGSEGV), si_code: 2 (SEGV_ACCERR), si_addr: 0x0000000000000001 + +Registers: + x0=0x000060000115f350 x1=0x00000000f3a657fb x2=0x0000000000000010 x3=0x0000000000000000 + x4=0x0000000000000003 x5=0x0000000073c00000 x6=0x000060000115f350 x7=0x0000000000000eb0 + x8=0x0000000000000000 x9=0x0000000000000000 x10=0x0000000000003350 x11=0x0000000000000010 +x12=0x0000000000000001 x13=0x00000000ffffff35 x14=0x00000000000007fb x15=0x00000000f3a657fb +x16=0x0000000000000335 x17=0x00000000000000ca x18=0x0000000000000000 x19=0x0000000000000010 +x20=0x0000000000000002 x21=0x000060000115f350 x22=0x0000000105a34141 x23=0x0000000000000001 +x24=0x000000016bc979b8 x25=0x000000010191c000 x26=0x0000000125c21bf8 x27=0x0000000000000000 +x28=0x000000013980aa00 fp=0x000000016bc978a0 lr=0x00000001059e9a7c sp=0x000000016bc97870 +pc=0x00000001059e9aec cpsr=0x0000000080001000 + +Register to memory mapping: + +x0 =0x000060000115f350 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00 +x1 =0x00000000f3a657fb is an unknown value +x2 =0x0000000000000010 is an unknown value +x3 =0x0 is null +x4 =0x0000000000000003 is an unknown value +x5 =0x0000000073c00000 is an unknown value +x6 =0x000060000115f350 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00 +x7 =0x0000000000000eb0 is an unknown value +x8 =0x0 is null +x9 =0x0 is null +x10=0x0000000000003350 is an unknown value +x11=0x0000000000000010 is an unknown value +x12=0x0000000000000001 is an unknown value +x13=0x00000000ffffff35 is an unknown value +x14=0x00000000000007fb is an unknown value +x15=0x00000000f3a657fb is an unknown value +x16=0x0000000000000335 is an unknown value +x17=0x00000000000000ca is an unknown value +x18=0x0 is null +x19=0x0000000000000010 is an unknown value +x20=0x0000000000000002 is an unknown value +x21=0x000060000115f350 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00 +x22=0x0000000105a34141: __rust_no_alloc_shim_is_unstable+0 in /Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/libsomelib.dylib at 0x00000001059e4000 +x23=0x0000000000000001 is an unknown value +x24=0x000000016bc979b8 is pointing into the stack for thread: 0x000000013980aa00 +x25=0x000000010191c000 is an unknown value +x26=0x0000000125c21bf8 is pointing into metadata +x27=0x0 is null +x28=0x000000013980aa00 is a thread + fp=0x000000016bc978a0 is pointing into the stack for thread: 0x000000013980aa00 + lr=0x00000001059e9a7c: Float64Vec_new_isize+0x44 in /Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/libsomelib.dylib at 0x00000001059e4000 + sp=0x000000016bc97870 is pointing into the stack for thread: 0x000000013980aa00 + +Top of Stack: (sp=0x000000016bc97870) +0x000000016bc97870: 000000016bc979b8 000000010191c000 +0x000000016bc97880: 0000000125c21a54 00000001067dd2b0 +0x000000016bc97890: 000000016bc978e8 000000016bc978d0 +0x000000016bc978a0: 000000016bc978c0 00000001167986bc +0x000000016bc978b0: 000000016bc97970 b116000116667504 +0x000000016bc978c0: 000000016bc97970 00000001166591b0 +0x000000016bc978d0: 000000070ee4fd68 fffffffffffffff2 +0x000000016bc978e0: 0000000000000000 000000070ec68e08 +0x000000016bc978f0: 0000000000000002 0000000000000000 +0x000000016bc97900: 0000000000000001 0000000000000000 +0x000000016bc97910: 00000001059e9a38 0000000000000000 +0x000000016bc97920: fffffffffffffff6 0000000125c21a54 +0x000000016bc97930: 0000000000000009 0000000125c21bf8 +0x000000016bc97940: 000000070ec75fb8 ffffffffffffffec +0x000000016bc97950: 0000000000000000 0000000125c21a60 +0x000000016bc97960: ffffffffffffffef 000000016bc97970 +0x000000016bc97970: 000000016bc97a10 00000001166591b0 +0x000000016bc97980: 000000070ec68e08 0000000000000002 +0x000000016bc97990: 0000000000000000 0000000000000001 +0x000000016bc979a0: 0000000000000000 00000001059e9a38 +0x000000016bc979b0: 0000000000000000 000000070ec760d0 +0x000000016bc979c0: fffffffffffffff6 0000000125c2729f +0x000000016bc979d0: 0000000000000009 0000000125c27460 +0x000000016bc979e0: 000000070ece16c0 ffffffffffffffec +0x000000016bc979f0: 0000000000000000 0000000125c272b0 +0x000000016bc97a00: ffffffffffffffef 000000016bc97a10 +0x000000016bc97a10: 000000016bc97ab0 00000001166591b0 +0x000000016bc97a20: 000000070efd3c48 0000000000000002 +0x000000016bc97a30: 0000000000000000 0000000000000001 +0x000000016bc97a40: 0000000000000000 00000001059e9a38 +0x000000016bc97a50: 0000000000000000 000000070ec760d0 +0x000000016bc97a60: fffffffffffffff6 0000000125c23465 + +Instructions: (pc=0x00000001059e9aec) +0x00000001059e99ec: f6 57 41 a9 f8 5f c4 a8 c0 03 5f d6 00 01 80 52 +0x00000001059e99fc: 01 03 80 52 c7 d9 00 94 20 00 20 d4 16 00 80 d2 +0x00000001059e9a0c: e0 03 16 aa e1 03 15 aa bd d9 00 94 f5 03 00 aa +0x00000001059e9a1c: b3 00 00 b4 61 f2 7d d3 e0 03 14 aa 02 01 80 52 +0x00000001059e9a2c: 3a 03 00 94 e0 03 15 aa 54 db 00 94 f8 5f bc a9 +0x00000001059e9a3c: f6 57 01 a9 f4 4f 02 a9 fd 7b 03 a9 fd c3 00 91 +0x00000001059e9a4c: f4 03 01 aa 15 01 80 52 3f 00 00 f1 b7 02 80 9a +0x00000001059e9a5c: 33 f0 7d d3 56 02 00 f0 d6 06 05 91 e1 04 00 b4 +0x00000001059e9a6c: df 02 40 39 e0 03 13 aa 01 01 80 52 26 03 00 94 +0x00000001059e9a7c: 40 06 00 b4 f5 03 00 aa 08 00 80 d2 9f 22 00 f1 +0x00000001059e9a8c: e3 02 00 54 a9 02 17 cb 3f 01 01 f1 83 02 00 54 +0x00000001059e9a9c: 09 00 80 d2 88 f2 7d 92 ea 82 00 91 eb 03 08 aa +0x00000001059e9aac: 4c 01 09 8b 80 05 7f ad 82 0d 40 ad 00 d8 61 4e +0x00000001059e9abc: 21 d8 61 4e 42 d8 61 4e 63 d8 61 4e ac 02 09 8b +0x00000001059e9acc: 80 05 00 ad 82 0d 01 ad 29 01 01 91 6b 21 00 f1 +0x00000001059e9adc: 81 fe ff 54 1f 01 14 eb 00 01 00 54 09 f1 7d d3 +0x00000001059e9aec: e0 6a 69 fc 00 d8 61 5e a0 6a 29 fc 08 05 00 91 +0x00000001059e9afc: 9f 02 08 eb 41 ff ff 54 df 02 40 39 00 03 80 52 +0x00000001059e9b0c: 01 01 80 52 00 03 00 94 00 01 00 b4 14 54 00 a9 +0x00000001059e9b1c: 14 08 00 f9 fd 7b 43 a9 f4 4f 42 a9 f6 57 41 a9 +0x00000001059e9b2c: f8 5f c4 a8 c0 03 5f d6 00 01 80 52 01 03 80 52 +0x00000001059e9b3c: 78 d9 00 94 20 00 20 d4 00 01 80 52 e1 03 13 aa +0x00000001059e9b4c: 6f d9 00 94 f6 03 00 aa b4 00 00 b4 e0 03 15 aa +0x00000001059e9b5c: e1 03 13 aa 02 01 80 52 ec 02 00 94 e0 03 16 aa +0x00000001059e9b6c: 06 db 00 94 f8 5f bc a9 f6 57 01 a9 f4 4f 02 a9 +0x00000001059e9b7c: fd 7b 03 a9 fd c3 00 91 f4 03 01 aa 15 01 80 52 +0x00000001059e9b8c: 3f 00 00 f1 b7 02 80 9a 33 f0 7d d3 56 02 00 f0 +0x00000001059e9b9c: d6 06 05 91 e1 04 00 b4 df 02 40 39 e0 03 13 aa +0x00000001059e9bac: 01 01 80 52 d8 02 00 94 40 06 00 b4 f5 03 00 aa +0x00000001059e9bbc: 08 00 80 d2 9f 22 00 f1 e3 02 00 54 a9 02 17 cb +0x00000001059e9bcc: 3f 01 01 f1 83 02 00 54 09 00 80 d2 88 f2 7d 92 +0x00000001059e9bdc: ea 82 00 91 eb 03 08 aa 4c 01 09 8b 80 05 7f ad + + +Stack slot to memory mapping: + +stack at sp + 0 slots: 0x000000016bc979b8 is pointing into the stack for thread: 0x000000013980aa00 +stack at sp + 1 slots: 0x000000010191c000 is an unknown value +stack at sp + 2 slots: 0x0000000125c21a54 is pointing into metadata +stack at sp + 3 slots: 0x00000001067dd2b0: _ZN19TemplateInterpreter13_active_tableE+0 in /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/server/libjvm.dylib at 0x0000000105a88000 +stack at sp + 4 slots: 0x000000016bc978e8 is pointing into the stack for thread: 0x000000013980aa00 +stack at sp + 5 slots: 0x000000016bc978d0 is pointing into the stack for thread: 0x000000013980aa00 +stack at sp + 6 slots: 0x000000016bc978c0 is pointing into the stack for thread: 0x000000013980aa00 +stack at sp + 7 slots: 0x00000001167986bc is at code_begin+60 in +[CodeBlob (0x0000000116798610)] +Framesize: 4 +Runtime Stub (0x0000000116798610): nep_invoker_blob +-------------------------------------------------------------------------------- +Decoding CodeBlob, name: nep_invoker_blob, at [0x0000000116798680, 0x0000000116798750] 208 bytes +[MachCode] + 0x0000000116798680: fd7b bfa9 | fd03 0091 | bf43 00d1 | 0900 0010 | 89d7 01f9 | e903 0091 | 89d3 01f9 | 9ddb 01f9 + 0x00000001167986a0: e903 7eb2 | 8a53 1191 | 49fd 9f88 | e903 01aa | e103 03aa | e003 02aa | 2001 3fd6 | a900 80d2 + 0x00000001167986c0: 8957 04b9 | bf3b 03d5 | 8963 1191 | 29fd dfc8 | bf03 09eb | e801 0054 | 8953 44b9 | a901 0035 + 0x00000001167986e0: e903 7db2 | 8a53 1191 | 49fd 9f88 | 8943 5339 | 3f09 0071 | e001 0054 | 9fd3 01f9 | 9fdb 01f9 + 0x0000000116798700: 9fd7 01f9 | bf03 0091 | fd7b c1a8 | c003 5fd6 | e003 00f9 | e003 1caa | 897d 9cd2 | 89be a0f2 + 0x0000000116798720: 2900 c0f2 | 2001 3fd6 | e003 40f9 | edff ff17 | e003 00f9 | 0919 95d2 | a9c6 a0f2 | 2900 c0f2 + 0x0000000116798740: 2001 3fd6 | e003 40f9 | ecff ff17 | 0000 0000 +[/MachCode] +-------------------------------------------------------------------------------- + +-------------------------------------------------------------------------------- +Decoding CodeBlob, name: nep_invoker_blob, at [0x0000000116798680, 0x0000000116798750] 208 bytes +[MachCode] + 0x0000000116798680: fd7b bfa9 | fd03 0091 | bf43 00d1 | 0900 0010 | 89d7 01f9 | e903 0091 | 89d3 01f9 | 9ddb 01f9 + 0x00000001167986a0: e903 7eb2 | 8a53 1191 | 49fd 9f88 | e903 01aa | e103 03aa | e003 02aa | 2001 3fd6 | a900 80d2 + 0x00000001167986c0: 8957 04b9 | bf3b 03d5 | 8963 1191 | 29fd dfc8 | bf03 09eb | e801 0054 | 8953 44b9 | a901 0035 + 0x00000001167986e0: e903 7db2 | 8a53 1191 | 49fd 9f88 | 8943 5339 | 3f09 0071 | e001 0054 | 9fd3 01f9 | 9fdb 01f9 + 0x0000000116798700: 9fd7 01f9 | bf03 0091 | fd7b c1a8 | c003 5fd6 | e003 00f9 | e003 1caa | 897d 9cd2 | 89be a0f2 + 0x0000000116798720: 2900 c0f2 | 2001 3fd6 | e003 40f9 | edff ff17 | e003 00f9 | 0919 95d2 | a9c6 a0f2 | 2900 c0f2 + 0x0000000116798740: 2001 3fd6 | e003 40f9 | ecff ff17 | 0000 0000 +[/MachCode] +-------------------------------------------------------------------------------- + + +--------------- P R O C E S S --------------- + +Threads class SMR info: +_java_thread_list=0x000060000134c300, length=11, elements={ +0x000000013980aa00, 0x000000013b852c00, 0x000000013b853400, 0x000000013b01c800, +0x000000013985f000, 0x0000000129834c00, 0x000000013b01d000, 0x000000013b00c400, +0x000000013b00cc00, 0x000000013b85dc00, 0x000000013b8e0600 +} + +Java Threads: ( => current thread ) +=>0x000000013980aa00 JavaThread "main" [_thread_in_native, id=8707, stack(0x000000016ba98000,0x000000016bc9b000) (2060K)] + 0x000000013b852c00 JavaThread "Reference Handler" daemon [_thread_blocked, id=23555, stack(0x000000016cc10000,0x000000016ce13000) (2060K)] + 0x000000013b853400 JavaThread "Finalizer" daemon [_thread_blocked, id=28163, stack(0x000000016ce1c000,0x000000016d01f000) (2060K)] + 0x000000013b01c800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=23811, stack(0x000000016d028000,0x000000016d22b000) (2060K)] + 0x000000013985f000 JavaThread "Service Thread" daemon [_thread_blocked, id=24067, stack(0x000000016d234000,0x000000016d437000) (2060K)] + 0x0000000129834c00 JavaThread "Monitor Deflation Thread" daemon [_thread_blocked, id=24579, stack(0x000000016d440000,0x000000016d643000) (2060K)] + 0x000000013b01d000 JavaThread "C2 CompilerThread0" daemon [_thread_in_vm, id=27395, stack(0x000000016d64c000,0x000000016d84f000) (2060K)] + 0x000000013b00c400 JavaThread "C1 CompilerThread0" daemon [_thread_in_vm, id=25347, stack(0x000000016d858000,0x000000016da5b000) (2060K)] + 0x000000013b00cc00 JavaThread "Common-Cleaner" daemon [_thread_blocked, id=26883, stack(0x000000016da64000,0x000000016dc67000) (2060K)] + 0x000000013b85dc00 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=25859, stack(0x000000016dc70000,0x000000016de73000) (2060K)] + 0x000000013b8e0600 JavaThread "Notification Thread" daemon [_thread_blocked, id=26115, stack(0x000000016de7c000,0x000000016e07f000) (2060K)] +Total: 11 + +Other Threads: + 0x0000000104704fe0 VMThread "VM Thread" [id=20227, stack(0x000000016c8ec000,0x000000016caef000) (2060K)] + 0x0000000129605af0 WatcherThread "VM Periodic Task Thread" [id=17667, stack(0x000000016c6e0000,0x000000016c8e3000) (2060K)] + 0x0000000139607d70 WorkerThread "GC Thread#0" [id=12291, stack(0x000000016bca4000,0x000000016bea7000) (2060K)] + 0x000000013a9053c0 ConcurrentGCThread "G1 Main Marker" [id=13571, stack(0x000000016beb0000,0x000000016c0b3000) (2060K)] + 0x000000013a905d40 WorkerThread "G1 Conc#0" [id=12803, stack(0x000000016c0bc000,0x000000016c2bf000) (2060K)] + 0x0000000129820600 ConcurrentGCThread "G1 Refine#0" [id=21507, stack(0x000000016c2c8000,0x000000016c4cb000) (2060K)] + 0x0000000129604760 ConcurrentGCThread "G1 Service" [id=16899, stack(0x000000016c4d4000,0x000000016c6d7000) (2060K)] +Total: 7 + +Threads with active compile tasks: +C2 CompilerThread0 340 1206 4 jdk.internal.org.objectweb.asm.SymbolTable::addConstantUtf8Reference (101 bytes) +C1 CompilerThread0 340 1221 3 jdk.internal.classfile.impl.StackMapGenerator::processBlock (2767 bytes) +Total: 2 + +VM state: not at safepoint (normal execution) + +VM Mutex/Monitor currently owned by a thread: ([mutex/lock_event]) +[0x00000001068467d8] MethodCompileQueue_lock - owner thread: 0x000000013b00c400 +[0x0000000106847198] CodeCache_lock - owner thread: 0x000000013b00c400 +[0x0000000106847258] Compile_lock - owner thread: 0x000000013b00c400 + +Heap address: 0x0000000700000000, size: 4096 MB, Compressed Oops mode: Zero based, Oop shift amount: 3 + +CDS archive(s) not mapped +Compressed class space mapped at: 0x000000ff00000000-0x000000ff40000000, reserved size: 1073741824 +Narrow klass base: 0x000000ff00000000, Narrow klass shift: 0, Narrow klass range: 0x40000000 + +GC Precious Log: + CardTable entry size: 512 + Card Set container configuration: InlinePtr #cards 4 size 8 Array Of Cards #cards 16 size 48 Howl #buckets 8 coarsen threshold 3686 Howl Bitmap #cards 512 size 80 coarsen threshold 460 Card regions per heap region 1 cards per card region 4096 + CPUs: 8 total, 8 available + Memory: 16384M + Large Page Support: Disabled + NUMA Support: Disabled + Compressed Oops: Enabled (Zero based) + Heap Region Size: 2M + Heap Min Capacity: 8M + Heap Initial Capacity: 256M + Heap Max Capacity: 4G + Pre-touch: Disabled + Parallel Workers: 8 + Concurrent Workers: 2 + Concurrent Refinement Workers: 8 + Periodic GC: Disabled + +Heap: + garbage-first heap total reserved 4194304K, committed 262144K, used 18432K [0x0000000700000000, 0x0000000800000000) + region size 2048K, 10 young (20480K), 0 survivors (0K) + Metaspace used 15418K, committed 15808K, reserved 1114112K + class space used 1719K, committed 1920K, reserved 1048576K + +Heap Regions: E=young(eden), S=young(survivor), O=old, HS=humongous(starts), HC=humongous(continues), CS=collection set, F=free, TAMS=top-at-mark-start, PB=parsable bottom +| 0|0x0000000700000000, 0x0000000700000000, 0x0000000700200000| 0%| F| |TAMS 0x0000000700000000| PB 0x0000000700000000| Untracked | 0 +| 1|0x0000000700200000, 0x0000000700200000, 0x0000000700400000| 0%| F| |TAMS 0x0000000700200000| PB 0x0000000700200000| Untracked | 0 +| 2|0x0000000700400000, 0x0000000700400000, 0x0000000700600000| 0%| F| |TAMS 0x0000000700400000| PB 0x0000000700400000| Untracked | 0 +| 3|0x0000000700600000, 0x0000000700600000, 0x0000000700800000| 0%| F| |TAMS 0x0000000700600000| PB 0x0000000700600000| Untracked | 0 +| 4|0x0000000700800000, 0x0000000700800000, 0x0000000700a00000| 0%| F| |TAMS 0x0000000700800000| PB 0x0000000700800000| Untracked | 0 +| 5|0x0000000700a00000, 0x0000000700a00000, 0x0000000700c00000| 0%| F| |TAMS 0x0000000700a00000| PB 0x0000000700a00000| Untracked | 0 +| 6|0x0000000700c00000, 0x0000000700c00000, 0x0000000700e00000| 0%| F| |TAMS 0x0000000700c00000| PB 0x0000000700c00000| Untracked | 0 +| 7|0x0000000700e00000, 0x0000000700e00000, 0x0000000701000000| 0%| F| |TAMS 0x0000000700e00000| PB 0x0000000700e00000| Untracked | 0 +| 8|0x0000000701000000, 0x0000000701000000, 0x0000000701200000| 0%| F| |TAMS 0x0000000701000000| PB 0x0000000701000000| Untracked | 0 +| 9|0x0000000701200000, 0x0000000701200000, 0x0000000701400000| 0%| F| |TAMS 0x0000000701200000| PB 0x0000000701200000| Untracked | 0 +| 10|0x0000000701400000, 0x0000000701400000, 0x0000000701600000| 0%| F| |TAMS 0x0000000701400000| PB 0x0000000701400000| Untracked | 0 +| 11|0x0000000701600000, 0x0000000701600000, 0x0000000701800000| 0%| F| |TAMS 0x0000000701600000| PB 0x0000000701600000| Untracked | 0 +| 12|0x0000000701800000, 0x0000000701800000, 0x0000000701a00000| 0%| F| |TAMS 0x0000000701800000| PB 0x0000000701800000| Untracked | 0 +| 13|0x0000000701a00000, 0x0000000701a00000, 0x0000000701c00000| 0%| F| |TAMS 0x0000000701a00000| PB 0x0000000701a00000| Untracked | 0 +| 14|0x0000000701c00000, 0x0000000701c00000, 0x0000000701e00000| 0%| F| |TAMS 0x0000000701c00000| PB 0x0000000701c00000| Untracked | 0 +| 15|0x0000000701e00000, 0x0000000701e00000, 0x0000000702000000| 0%| F| |TAMS 0x0000000701e00000| PB 0x0000000701e00000| Untracked | 0 +| 16|0x0000000702000000, 0x0000000702000000, 0x0000000702200000| 0%| F| |TAMS 0x0000000702000000| PB 0x0000000702000000| Untracked | 0 +| 17|0x0000000702200000, 0x0000000702200000, 0x0000000702400000| 0%| F| |TAMS 0x0000000702200000| PB 0x0000000702200000| Untracked | 0 +| 18|0x0000000702400000, 0x0000000702400000, 0x0000000702600000| 0%| F| |TAMS 0x0000000702400000| PB 0x0000000702400000| Untracked | 0 +| 19|0x0000000702600000, 0x0000000702600000, 0x0000000702800000| 0%| F| |TAMS 0x0000000702600000| PB 0x0000000702600000| Untracked | 0 +| 20|0x0000000702800000, 0x0000000702800000, 0x0000000702a00000| 0%| F| |TAMS 0x0000000702800000| PB 0x0000000702800000| Untracked | 0 +| 21|0x0000000702a00000, 0x0000000702a00000, 0x0000000702c00000| 0%| F| |TAMS 0x0000000702a00000| PB 0x0000000702a00000| Untracked | 0 +| 22|0x0000000702c00000, 0x0000000702c00000, 0x0000000702e00000| 0%| F| |TAMS 0x0000000702c00000| PB 0x0000000702c00000| Untracked | 0 +| 23|0x0000000702e00000, 0x0000000702e00000, 0x0000000703000000| 0%| F| |TAMS 0x0000000702e00000| PB 0x0000000702e00000| Untracked | 0 +| 24|0x0000000703000000, 0x0000000703000000, 0x0000000703200000| 0%| F| |TAMS 0x0000000703000000| PB 0x0000000703000000| Untracked | 0 +| 25|0x0000000703200000, 0x0000000703200000, 0x0000000703400000| 0%| F| |TAMS 0x0000000703200000| PB 0x0000000703200000| Untracked | 0 +| 26|0x0000000703400000, 0x0000000703400000, 0x0000000703600000| 0%| F| |TAMS 0x0000000703400000| PB 0x0000000703400000| Untracked | 0 +| 27|0x0000000703600000, 0x0000000703600000, 0x0000000703800000| 0%| F| |TAMS 0x0000000703600000| PB 0x0000000703600000| Untracked | 0 +| 28|0x0000000703800000, 0x0000000703800000, 0x0000000703a00000| 0%| F| |TAMS 0x0000000703800000| PB 0x0000000703800000| Untracked | 0 +| 29|0x0000000703a00000, 0x0000000703a00000, 0x0000000703c00000| 0%| F| |TAMS 0x0000000703a00000| PB 0x0000000703a00000| Untracked | 0 +| 30|0x0000000703c00000, 0x0000000703c00000, 0x0000000703e00000| 0%| F| |TAMS 0x0000000703c00000| PB 0x0000000703c00000| Untracked | 0 +| 31|0x0000000703e00000, 0x0000000703e00000, 0x0000000704000000| 0%| F| |TAMS 0x0000000703e00000| PB 0x0000000703e00000| Untracked | 0 +| 32|0x0000000704000000, 0x0000000704000000, 0x0000000704200000| 0%| F| |TAMS 0x0000000704000000| PB 0x0000000704000000| Untracked | 0 +| 33|0x0000000704200000, 0x0000000704200000, 0x0000000704400000| 0%| F| |TAMS 0x0000000704200000| PB 0x0000000704200000| Untracked | 0 +| 34|0x0000000704400000, 0x0000000704400000, 0x0000000704600000| 0%| F| |TAMS 0x0000000704400000| PB 0x0000000704400000| Untracked | 0 +| 35|0x0000000704600000, 0x0000000704600000, 0x0000000704800000| 0%| F| |TAMS 0x0000000704600000| PB 0x0000000704600000| Untracked | 0 +| 36|0x0000000704800000, 0x0000000704800000, 0x0000000704a00000| 0%| F| |TAMS 0x0000000704800000| PB 0x0000000704800000| Untracked | 0 +| 37|0x0000000704a00000, 0x0000000704a00000, 0x0000000704c00000| 0%| F| |TAMS 0x0000000704a00000| PB 0x0000000704a00000| Untracked | 0 +| 38|0x0000000704c00000, 0x0000000704c00000, 0x0000000704e00000| 0%| F| |TAMS 0x0000000704c00000| PB 0x0000000704c00000| Untracked | 0 +| 39|0x0000000704e00000, 0x0000000704e00000, 0x0000000705000000| 0%| F| |TAMS 0x0000000704e00000| PB 0x0000000704e00000| Untracked | 0 +| 40|0x0000000705000000, 0x0000000705000000, 0x0000000705200000| 0%| F| |TAMS 0x0000000705000000| PB 0x0000000705000000| Untracked | 0 +| 41|0x0000000705200000, 0x0000000705200000, 0x0000000705400000| 0%| F| |TAMS 0x0000000705200000| PB 0x0000000705200000| Untracked | 0 +| 42|0x0000000705400000, 0x0000000705400000, 0x0000000705600000| 0%| F| |TAMS 0x0000000705400000| PB 0x0000000705400000| Untracked | 0 +| 43|0x0000000705600000, 0x0000000705600000, 0x0000000705800000| 0%| F| |TAMS 0x0000000705600000| PB 0x0000000705600000| Untracked | 0 +| 44|0x0000000705800000, 0x0000000705800000, 0x0000000705a00000| 0%| F| |TAMS 0x0000000705800000| PB 0x0000000705800000| Untracked | 0 +| 45|0x0000000705a00000, 0x0000000705a00000, 0x0000000705c00000| 0%| F| |TAMS 0x0000000705a00000| PB 0x0000000705a00000| Untracked | 0 +| 46|0x0000000705c00000, 0x0000000705c00000, 0x0000000705e00000| 0%| F| |TAMS 0x0000000705c00000| PB 0x0000000705c00000| Untracked | 0 +| 47|0x0000000705e00000, 0x0000000705e00000, 0x0000000706000000| 0%| F| |TAMS 0x0000000705e00000| PB 0x0000000705e00000| Untracked | 0 +| 48|0x0000000706000000, 0x0000000706000000, 0x0000000706200000| 0%| F| |TAMS 0x0000000706000000| PB 0x0000000706000000| Untracked | 0 +| 49|0x0000000706200000, 0x0000000706200000, 0x0000000706400000| 0%| F| |TAMS 0x0000000706200000| PB 0x0000000706200000| Untracked | 0 +| 50|0x0000000706400000, 0x0000000706400000, 0x0000000706600000| 0%| F| |TAMS 0x0000000706400000| PB 0x0000000706400000| Untracked | 0 +| 51|0x0000000706600000, 0x0000000706600000, 0x0000000706800000| 0%| F| |TAMS 0x0000000706600000| PB 0x0000000706600000| Untracked | 0 +| 52|0x0000000706800000, 0x0000000706800000, 0x0000000706a00000| 0%| F| |TAMS 0x0000000706800000| PB 0x0000000706800000| Untracked | 0 +| 53|0x0000000706a00000, 0x0000000706a00000, 0x0000000706c00000| 0%| F| |TAMS 0x0000000706a00000| PB 0x0000000706a00000| Untracked | 0 +| 54|0x0000000706c00000, 0x0000000706c00000, 0x0000000706e00000| 0%| F| |TAMS 0x0000000706c00000| PB 0x0000000706c00000| Untracked | 0 +| 55|0x0000000706e00000, 0x0000000706e00000, 0x0000000707000000| 0%| F| |TAMS 0x0000000706e00000| PB 0x0000000706e00000| Untracked | 0 +| 56|0x0000000707000000, 0x0000000707000000, 0x0000000707200000| 0%| F| |TAMS 0x0000000707000000| PB 0x0000000707000000| Untracked | 0 +| 57|0x0000000707200000, 0x0000000707200000, 0x0000000707400000| 0%| F| |TAMS 0x0000000707200000| PB 0x0000000707200000| Untracked | 0 +| 58|0x0000000707400000, 0x0000000707400000, 0x0000000707600000| 0%| F| |TAMS 0x0000000707400000| PB 0x0000000707400000| Untracked | 0 +| 59|0x0000000707600000, 0x0000000707600000, 0x0000000707800000| 0%| F| |TAMS 0x0000000707600000| PB 0x0000000707600000| Untracked | 0 +| 60|0x0000000707800000, 0x0000000707800000, 0x0000000707a00000| 0%| F| |TAMS 0x0000000707800000| PB 0x0000000707800000| Untracked | 0 +| 61|0x0000000707a00000, 0x0000000707a00000, 0x0000000707c00000| 0%| F| |TAMS 0x0000000707a00000| PB 0x0000000707a00000| Untracked | 0 +| 62|0x0000000707c00000, 0x0000000707c00000, 0x0000000707e00000| 0%| F| |TAMS 0x0000000707c00000| PB 0x0000000707c00000| Untracked | 0 +| 63|0x0000000707e00000, 0x0000000707e00000, 0x0000000708000000| 0%| F| |TAMS 0x0000000707e00000| PB 0x0000000707e00000| Untracked | 0 +| 64|0x0000000708000000, 0x0000000708000000, 0x0000000708200000| 0%| F| |TAMS 0x0000000708000000| PB 0x0000000708000000| Untracked | 0 +| 65|0x0000000708200000, 0x0000000708200000, 0x0000000708400000| 0%| F| |TAMS 0x0000000708200000| PB 0x0000000708200000| Untracked | 0 +| 66|0x0000000708400000, 0x0000000708400000, 0x0000000708600000| 0%| F| |TAMS 0x0000000708400000| PB 0x0000000708400000| Untracked | 0 +| 67|0x0000000708600000, 0x0000000708600000, 0x0000000708800000| 0%| F| |TAMS 0x0000000708600000| PB 0x0000000708600000| Untracked | 0 +| 68|0x0000000708800000, 0x0000000708800000, 0x0000000708a00000| 0%| F| |TAMS 0x0000000708800000| PB 0x0000000708800000| Untracked | 0 +| 69|0x0000000708a00000, 0x0000000708a00000, 0x0000000708c00000| 0%| F| |TAMS 0x0000000708a00000| PB 0x0000000708a00000| Untracked | 0 +| 70|0x0000000708c00000, 0x0000000708c00000, 0x0000000708e00000| 0%| F| |TAMS 0x0000000708c00000| PB 0x0000000708c00000| Untracked | 0 +| 71|0x0000000708e00000, 0x0000000708e00000, 0x0000000709000000| 0%| F| |TAMS 0x0000000708e00000| PB 0x0000000708e00000| Untracked | 0 +| 72|0x0000000709000000, 0x0000000709000000, 0x0000000709200000| 0%| F| |TAMS 0x0000000709000000| PB 0x0000000709000000| Untracked | 0 +| 73|0x0000000709200000, 0x0000000709200000, 0x0000000709400000| 0%| F| |TAMS 0x0000000709200000| PB 0x0000000709200000| Untracked | 0 +| 74|0x0000000709400000, 0x0000000709400000, 0x0000000709600000| 0%| F| |TAMS 0x0000000709400000| PB 0x0000000709400000| Untracked | 0 +| 75|0x0000000709600000, 0x0000000709600000, 0x0000000709800000| 0%| F| |TAMS 0x0000000709600000| PB 0x0000000709600000| Untracked | 0 +| 76|0x0000000709800000, 0x0000000709800000, 0x0000000709a00000| 0%| F| |TAMS 0x0000000709800000| PB 0x0000000709800000| Untracked | 0 +| 77|0x0000000709a00000, 0x0000000709a00000, 0x0000000709c00000| 0%| F| |TAMS 0x0000000709a00000| PB 0x0000000709a00000| Untracked | 0 +| 78|0x0000000709c00000, 0x0000000709c00000, 0x0000000709e00000| 0%| F| |TAMS 0x0000000709c00000| PB 0x0000000709c00000| Untracked | 0 +| 79|0x0000000709e00000, 0x0000000709e00000, 0x000000070a000000| 0%| F| |TAMS 0x0000000709e00000| PB 0x0000000709e00000| Untracked | 0 +| 80|0x000000070a000000, 0x000000070a000000, 0x000000070a200000| 0%| F| |TAMS 0x000000070a000000| PB 0x000000070a000000| Untracked | 0 +| 81|0x000000070a200000, 0x000000070a200000, 0x000000070a400000| 0%| F| |TAMS 0x000000070a200000| PB 0x000000070a200000| Untracked | 0 +| 82|0x000000070a400000, 0x000000070a400000, 0x000000070a600000| 0%| F| |TAMS 0x000000070a400000| PB 0x000000070a400000| Untracked | 0 +| 83|0x000000070a600000, 0x000000070a600000, 0x000000070a800000| 0%| F| |TAMS 0x000000070a600000| PB 0x000000070a600000| Untracked | 0 +| 84|0x000000070a800000, 0x000000070a800000, 0x000000070aa00000| 0%| F| |TAMS 0x000000070a800000| PB 0x000000070a800000| Untracked | 0 +| 85|0x000000070aa00000, 0x000000070aa00000, 0x000000070ac00000| 0%| F| |TAMS 0x000000070aa00000| PB 0x000000070aa00000| Untracked | 0 +| 86|0x000000070ac00000, 0x000000070ac00000, 0x000000070ae00000| 0%| F| |TAMS 0x000000070ac00000| PB 0x000000070ac00000| Untracked | 0 +| 87|0x000000070ae00000, 0x000000070ae00000, 0x000000070b000000| 0%| F| |TAMS 0x000000070ae00000| PB 0x000000070ae00000| Untracked | 0 +| 88|0x000000070b000000, 0x000000070b000000, 0x000000070b200000| 0%| F| |TAMS 0x000000070b000000| PB 0x000000070b000000| Untracked | 0 +| 89|0x000000070b200000, 0x000000070b200000, 0x000000070b400000| 0%| F| |TAMS 0x000000070b200000| PB 0x000000070b200000| Untracked | 0 +| 90|0x000000070b400000, 0x000000070b400000, 0x000000070b600000| 0%| F| |TAMS 0x000000070b400000| PB 0x000000070b400000| Untracked | 0 +| 91|0x000000070b600000, 0x000000070b600000, 0x000000070b800000| 0%| F| |TAMS 0x000000070b600000| PB 0x000000070b600000| Untracked | 0 +| 92|0x000000070b800000, 0x000000070b800000, 0x000000070ba00000| 0%| F| |TAMS 0x000000070b800000| PB 0x000000070b800000| Untracked | 0 +| 93|0x000000070ba00000, 0x000000070ba00000, 0x000000070bc00000| 0%| F| |TAMS 0x000000070ba00000| PB 0x000000070ba00000| Untracked | 0 +| 94|0x000000070bc00000, 0x000000070bc00000, 0x000000070be00000| 0%| F| |TAMS 0x000000070bc00000| PB 0x000000070bc00000| Untracked | 0 +| 95|0x000000070be00000, 0x000000070be00000, 0x000000070c000000| 0%| F| |TAMS 0x000000070be00000| PB 0x000000070be00000| Untracked | 0 +| 96|0x000000070c000000, 0x000000070c000000, 0x000000070c200000| 0%| F| |TAMS 0x000000070c000000| PB 0x000000070c000000| Untracked | 0 +| 97|0x000000070c200000, 0x000000070c200000, 0x000000070c400000| 0%| F| |TAMS 0x000000070c200000| PB 0x000000070c200000| Untracked | 0 +| 98|0x000000070c400000, 0x000000070c400000, 0x000000070c600000| 0%| F| |TAMS 0x000000070c400000| PB 0x000000070c400000| Untracked | 0 +| 99|0x000000070c600000, 0x000000070c600000, 0x000000070c800000| 0%| F| |TAMS 0x000000070c600000| PB 0x000000070c600000| Untracked | 0 +| 100|0x000000070c800000, 0x000000070c800000, 0x000000070ca00000| 0%| F| |TAMS 0x000000070c800000| PB 0x000000070c800000| Untracked | 0 +| 101|0x000000070ca00000, 0x000000070ca00000, 0x000000070cc00000| 0%| F| |TAMS 0x000000070ca00000| PB 0x000000070ca00000| Untracked | 0 +| 102|0x000000070cc00000, 0x000000070cc00000, 0x000000070ce00000| 0%| F| |TAMS 0x000000070cc00000| PB 0x000000070cc00000| Untracked | 0 +| 103|0x000000070ce00000, 0x000000070ce00000, 0x000000070d000000| 0%| F| |TAMS 0x000000070ce00000| PB 0x000000070ce00000| Untracked | 0 +| 104|0x000000070d000000, 0x000000070d000000, 0x000000070d200000| 0%| F| |TAMS 0x000000070d000000| PB 0x000000070d000000| Untracked | 0 +| 105|0x000000070d200000, 0x000000070d200000, 0x000000070d400000| 0%| F| |TAMS 0x000000070d200000| PB 0x000000070d200000| Untracked | 0 +| 106|0x000000070d400000, 0x000000070d400000, 0x000000070d600000| 0%| F| |TAMS 0x000000070d400000| PB 0x000000070d400000| Untracked | 0 +| 107|0x000000070d600000, 0x000000070d600000, 0x000000070d800000| 0%| F| |TAMS 0x000000070d600000| PB 0x000000070d600000| Untracked | 0 +| 108|0x000000070d800000, 0x000000070d800000, 0x000000070da00000| 0%| F| |TAMS 0x000000070d800000| PB 0x000000070d800000| Untracked | 0 +| 109|0x000000070da00000, 0x000000070da00000, 0x000000070dc00000| 0%| F| |TAMS 0x000000070da00000| PB 0x000000070da00000| Untracked | 0 +| 110|0x000000070dc00000, 0x000000070dc00000, 0x000000070de00000| 0%| F| |TAMS 0x000000070dc00000| PB 0x000000070dc00000| Untracked | 0 +| 111|0x000000070de00000, 0x000000070de00000, 0x000000070e000000| 0%| F| |TAMS 0x000000070de00000| PB 0x000000070de00000| Untracked | 0 +| 112|0x000000070e000000, 0x000000070e000000, 0x000000070e200000| 0%| F| |TAMS 0x000000070e000000| PB 0x000000070e000000| Untracked | 0 +| 113|0x000000070e200000, 0x000000070e200000, 0x000000070e400000| 0%| F| |TAMS 0x000000070e200000| PB 0x000000070e200000| Untracked | 0 +| 114|0x000000070e400000, 0x000000070e400000, 0x000000070e600000| 0%| F| |TAMS 0x000000070e400000| PB 0x000000070e400000| Untracked | 0 +| 115|0x000000070e600000, 0x000000070e600000, 0x000000070e800000| 0%| F| |TAMS 0x000000070e600000| PB 0x000000070e600000| Untracked | 0 +| 116|0x000000070e800000, 0x000000070e800000, 0x000000070ea00000| 0%| F| |TAMS 0x000000070e800000| PB 0x000000070e800000| Untracked | 0 +| 117|0x000000070ea00000, 0x000000070ea00000, 0x000000070ec00000| 0%| F| |TAMS 0x000000070ea00000| PB 0x000000070ea00000| Untracked | 0 +| 118|0x000000070ec00000, 0x000000070ecf5cd8, 0x000000070ee00000| 48%| E| |TAMS 0x000000070ec00000| PB 0x000000070ec00000| Complete | 0 +| 119|0x000000070ee00000, 0x000000070f000000, 0x000000070f000000|100%| E|CS|TAMS 0x000000070ee00000| PB 0x000000070ee00000| Complete | 0 +| 120|0x000000070f000000, 0x000000070f200000, 0x000000070f200000|100%| E|CS|TAMS 0x000000070f000000| PB 0x000000070f000000| Complete | 0 +| 121|0x000000070f200000, 0x000000070f400000, 0x000000070f400000|100%| E|CS|TAMS 0x000000070f200000| PB 0x000000070f200000| Complete | 0 +| 122|0x000000070f400000, 0x000000070f600000, 0x000000070f600000|100%| E|CS|TAMS 0x000000070f400000| PB 0x000000070f400000| Complete | 0 +| 123|0x000000070f600000, 0x000000070f800000, 0x000000070f800000|100%| E|CS|TAMS 0x000000070f600000| PB 0x000000070f600000| Complete | 0 +| 124|0x000000070f800000, 0x000000070fa00000, 0x000000070fa00000|100%| E|CS|TAMS 0x000000070f800000| PB 0x000000070f800000| Complete | 0 +| 125|0x000000070fa00000, 0x000000070fc00000, 0x000000070fc00000|100%| E|CS|TAMS 0x000000070fa00000| PB 0x000000070fa00000| Complete | 0 +| 126|0x000000070fc00000, 0x000000070fe00000, 0x000000070fe00000|100%| E|CS|TAMS 0x000000070fc00000| PB 0x000000070fc00000| Complete | 0 +| 127|0x000000070fe00000, 0x0000000710000000, 0x0000000710000000|100%| E|CS|TAMS 0x000000070fe00000| PB 0x000000070fe00000| Complete | 0 + +Card table byte_map: [0x000000010511c000,0x000000010591c000] _byte_map_base: 0x000000010191c000 + +Marking Bits: (CMBitMap*) 0x000000013b809a10 + Bits: [0x000000011e120000, 0x0000000122120000) + +Polling page: 0x0000000104408000 + +Metaspace: + +Usage: + Non-class: 13.38 MB used. + Class: 1.68 MB used. + Both: 15.06 MB used. + +Virtual space: + Non-class space: 64.00 MB reserved, 13.56 MB ( 21%) committed, 1 nodes. + Class space: 1.00 GB reserved, 1.88 MB ( <1%) committed, 1 nodes. + Both: 1.06 GB reserved, 15.44 MB ( 1%) committed. + +Chunk freelists: + Non-Class: 2.35 MB + Class: 14.17 MB + Both: 16.52 MB + +MaxMetaspaceSize: unlimited +CompressedClassSpaceSize: 1.00 GB +Initial GC threshold: 21.00 MB +Current GC threshold: 21.00 MB +CDS: off + - commit_granule_bytes: 65536. + - commit_granule_words: 8192. + - virtual_space_node_default_size: 8388608. + - enlarge_chunks_in_place: 1. + - use_allocation_guard: 0. + + +Internal statistics: + +num_allocs_failed_limit: 0. +num_arena_births: 342. +num_arena_deaths: 0. +num_vsnodes_births: 2. +num_vsnodes_deaths: 0. +num_space_committed: 247. +num_space_uncommitted: 0. +num_chunks_returned_to_freelist: 0. +num_chunks_taken_from_freelist: 562. +num_chunk_merges: 0. +num_chunk_splits: 330. +num_chunks_enlarged: 189. +num_inconsistent_stats: 0. + +CodeHeap 'non-profiled nmethods': size=120032Kb used=371Kb max_used=371Kb free=119660Kb + bounds [0x0000000116be8000, 0x0000000116e58000, 0x000000011e120000] +CodeHeap 'profiled nmethods': size=120016Kb used=2312Kb max_used=2312Kb free=117703Kb + bounds [0x000000010f120000, 0x000000010f390000, 0x0000000116654000] +CodeHeap 'non-nmethods': size=5712Kb used=1327Kb max_used=1341Kb free=4384Kb + bounds [0x0000000116654000, 0x00000001168c4000, 0x0000000116be8000] + total_blobs=1701 nmethods=1217 adapters=391 + compilation: enabled + stopped_count=0, restarted_count=0 + full_count=0 + +Compilation events (20 events): +Event: 0.325 Thread 0x000000013b00c400 nmethod 1209 0x000000010f344710 code [0x000000010f3448c0, 0x000000010f344a38] +Event: 0.325 Thread 0x000000013b00c400 1210 3 jdk.internal.classfile.impl.DirectCodeBuilder::with (9 bytes) +Event: 0.326 Thread 0x000000013b00c400 nmethod 1210 0x000000010f344b10 code [0x000000010f344d40, 0x000000010f345600] +Event: 0.326 Thread 0x000000013b00c400 1213 3 jdk.internal.classfile.impl.RawBytecodeHelper::isLastBytecode (17 bytes) +Event: 0.326 Thread 0x000000013b00c400 nmethod 1213 0x000000010f345890 code [0x000000010f345a40, 0x000000010f345bb0] +Event: 0.326 Thread 0x000000013b00c400 1211 3 jdk.internal.classfile.impl.DirectCodeBuilder::with (30 bytes) +Event: 0.326 Thread 0x000000013b00c400 nmethod 1211 0x000000010f345c90 code [0x000000010f345ec0, 0x000000010f346610] +Event: 0.326 Thread 0x000000013b00c400 1212 3 jdk.internal.classfile.impl.SplitConstantPool::map (145 bytes) +Event: 0.326 Thread 0x000000013b00c400 nmethod 1212 0x000000010f346810 code [0x000000010f346b00, 0x000000010f347880] +Event: 0.326 Thread 0x000000013b00c400 1214 3 jdk.internal.classfile.impl.AbstractPoolEntry::width (23 bytes) +Event: 0.326 Thread 0x000000013b00c400 nmethod 1214 0x000000010f347c90 code [0x000000010f347e40, 0x000000010f347ff8] +Event: 0.326 Thread 0x000000013b00c400 1215 3 jdk.internal.classfile.impl.Util::checkKind (41 bytes) +Event: 0.326 Thread 0x000000013b00c400 nmethod 1215 0x000000010f348090 code [0x000000010f348380, 0x000000010f349150] +Event: 0.326 Thread 0x000000013b00c400 1216 3 jdk.internal.classfile.impl.AbstractPoolEntry::phiMix (12 bytes) +Event: 0.326 Thread 0x000000013b00c400 nmethod 1216 0x000000010f349610 code [0x000000010f349780, 0x000000010f349868] +Event: 0.326 Thread 0x000000013b00c400 1217 3 jdk.internal.classfile.impl.BufWriterImpl::writeU2 (8 bytes) +Event: 0.326 Thread 0x000000013b00c400 nmethod 1217 0x000000010f349910 code [0x000000010f349ac0, 0x000000010f349c38] +Event: 0.328 Thread 0x000000013b00c400 1219 3 java.util.ArrayList::isEmpty (13 bytes) +Event: 0.328 Thread 0x000000013b00c400 nmethod 1219 0x000000010f349d10 code [0x000000010f349ec0, 0x000000010f34a030] +Event: 0.328 Thread 0x000000013b00c400 1221 3 jdk.internal.classfile.impl.StackMapGenerator::processBlock (2767 bytes) + +GC Heap History (0 events): +No events + +Dll operation events (10 events): +Event: 0.005 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjava.dylib +Event: 0.058 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libzip.dylib +Event: 0.060 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libinstrument.dylib +Event: 0.063 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libnio.dylib +Event: 0.068 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libzip.dylib +Event: 0.080 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libnet.dylib +Event: 0.087 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libextnet.dylib +Event: 0.117 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjimage.dylib +Event: 0.265 Loaded shared library libsomelib.dylib +Event: 0.268 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libsyslookup.dylib + +Deoptimization events (20 events): +Event: 0.249 Thread 0x000000013980aa00 DEOPT PACKING pc=0x000000010f1b6fb4 sp=0x000000016bc972d0 +Event: 0.249 Thread 0x000000013980aa00 DEOPT UNPACKING pc=0x0000000116696e7c sp=0x000000016bc96fe0 mode 0 +Event: 0.250 Thread 0x000000013980aa00 Uncommon trap: trap_request=0xffffff45 fr.pc=0x0000000116c28560 relative=0x0000000000000060 +Event: 0.250 Thread 0x000000013980aa00 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000116c28560 method=java.lang.CharacterData.of(I)Ljava/lang/CharacterData; @ 4 c2 +Event: 0.250 Thread 0x000000013980aa00 DEOPT PACKING pc=0x0000000116c28560 sp=0x000000016bc96b60 +Event: 0.250 Thread 0x000000013980aa00 DEOPT UNPACKING pc=0x000000011669701c sp=0x000000016bc96b00 mode 2 +Event: 0.251 Thread 0x000000013980aa00 Uncommon trap: trap_request=0xffffff45 fr.pc=0x0000000116bf17f0 relative=0x00000000000000b0 +Event: 0.251 Thread 0x000000013980aa00 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000116bf17f0 method=java.lang.String.isLatin1()Z @ 10 c2 +Event: 0.251 Thread 0x000000013980aa00 DEOPT PACKING pc=0x0000000116bf17f0 sp=0x000000016bc974a0 +Event: 0.251 Thread 0x000000013980aa00 DEOPT UNPACKING pc=0x000000011669701c sp=0x000000016bc973d0 mode 2 +Event: 0.251 Thread 0x000000013980aa00 Uncommon trap: trap_request=0xffffff45 fr.pc=0x0000000116c05650 relative=0x0000000000000190 +Event: 0.251 Thread 0x000000013980aa00 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000116c05650 method=jdk.internal.util.ArraysSupport.vectorizedHashCode(Ljava/lang/Object;IIII)I @ 2 c2 +Event: 0.251 Thread 0x000000013980aa00 DEOPT PACKING pc=0x0000000116c05650 sp=0x000000016bc97370 +Event: 0.251 Thread 0x000000013980aa00 DEOPT UNPACKING pc=0x000000011669701c sp=0x000000016bc97310 mode 2 +Event: 0.258 Thread 0x000000013980aa00 Uncommon trap: trap_request=0xffffff45 fr.pc=0x0000000116c2d220 relative=0x00000000000000e0 +Event: 0.258 Thread 0x000000013980aa00 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000116c2d220 method=sun.net.www.ParseUtil.firstEncodeIndex(Ljava/lang/String;)I @ 51 c2 +Event: 0.258 Thread 0x000000013980aa00 DEOPT PACKING pc=0x0000000116c2d220 sp=0x000000016bc967c0 +Event: 0.258 Thread 0x000000013980aa00 DEOPT UNPACKING pc=0x000000011669701c sp=0x000000016bc96740 mode 2 +Event: 0.302 Thread 0x000000013980aa00 DEOPT PACKING pc=0x000000010f2f6fe0 sp=0x000000016bc966e0 +Event: 0.302 Thread 0x000000013980aa00 DEOPT UNPACKING pc=0x0000000116696e7c sp=0x000000016bc96450 mode 3 + +Classes loaded (20 events): +Event: 0.329 Loading class jdk/internal/classfile/impl/BufferedCodeBuilder +Event: 0.329 Loading class jdk/internal/classfile/impl/BufferedCodeBuilder done +Event: 0.329 Loading class jdk/internal/classfile/impl/TransformingCodeBuilder +Event: 0.329 Loading class jdk/internal/classfile/impl/TransformingCodeBuilder done +Event: 0.330 Loading class java/lang/classfile/instruction/ThrowInstruction +Event: 0.330 Loading class java/lang/classfile/instruction/ThrowInstruction done +Event: 0.330 Loading class jdk/internal/classfile/impl/AbstractInstruction$UnboundThrowInstruction +Event: 0.330 Loading class jdk/internal/classfile/impl/AbstractInstruction$UnboundThrowInstruction done +Event: 0.330 Loading class java/lang/classfile/instruction/ExceptionCatch +Event: 0.330 Loading class java/lang/classfile/instruction/ExceptionCatch done +Event: 0.330 Loading class jdk/internal/classfile/impl/AbstractPseudoInstruction$ExceptionCatchImpl +Event: 0.330 Loading class jdk/internal/classfile/impl/AbstractPseudoInstruction +Event: 0.330 Loading class jdk/internal/classfile/impl/AbstractPseudoInstruction done +Event: 0.330 Loading class jdk/internal/classfile/impl/AbstractPseudoInstruction$ExceptionCatchImpl done +Event: 0.330 Loading class jdk/internal/classfile/impl/StackMapGenerator$RawExceptionCatch +Event: 0.330 Loading class jdk/internal/classfile/impl/StackMapGenerator$RawExceptionCatch done +Event: 0.331 Loading class jdk/internal/classfile/impl/SplitConstantPool$1 +Event: 0.331 Loading class jdk/internal/classfile/impl/SplitConstantPool$1 done +Event: 0.331 Loading class java/lang/invoke/ConstantBootstraps +Event: 0.332 Loading class java/lang/invoke/ConstantBootstraps done + +Classes unloaded (0 events): +No events + +Classes redefined (0 events): +No events + +Internal exceptions (20 events): +Event: 0.302 Thread 0x000000013980aa00 Exception (0x000000070ef3b8c8) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 0.304 Thread 0x000000013980aa00 Exception (0x000000070ef5aba0) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 0.304 Thread 0x000000013980aa00 Exception (0x000000070ef5f1f0) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 0.304 Thread 0x000000013980aa00 Exception (0x000000070ef62da8) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 0.305 Thread 0x000000013980aa00 Exception (0x000000070ef6a8f8) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 0.305 Thread 0x000000013980aa00 Exception (0x000000070ef71cd8) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 0.305 Thread 0x000000013980aa00 Exception (0x000000070ef78ca8) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 0.305 Thread 0x000000013980aa00 Exception (0x000000070ef7d760) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 0.306 Thread 0x000000013980aa00 Exception (0x000000070ef9ba38) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 0.313 Thread 0x000000013980aa00 Exception (0x000000070efc2808) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 841] +Event: 0.314 Thread 0x000000013980aa00 Exception (0x000000070efd4930) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 0.319 Thread 0x000000013980aa00 Exception (0x000000070ec31260) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 0.319 Thread 0x000000013980aa00 Exception (0x000000070ec3b858) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 0.320 Thread 0x000000013980aa00 Exception (0x000000070ec4d198) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 0.321 Thread 0x000000013980aa00 Exception (0x000000070ec69808) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 0.322 Thread 0x000000013980aa00 Exception (0x000000070ec6ecd8) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 0.323 Thread 0x000000013980aa00 Exception (0x000000070ec78c30) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 0.328 Thread 0x000000013980aa00 Exception (0x000000070eca4bd0) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 0.331 Thread 0x000000013980aa00 Exception (0x000000070ecc5d20) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 0.332 Thread 0x000000013980aa00 Exception (0x000000070ecd74f8) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] + +ZGC Phase Switch (0 events): +No events + +VM Operations (12 events): +Event: 0.052 Executing VM operation: HandshakeAllThreads (Deoptimize) +Event: 0.052 Executing VM operation: HandshakeAllThreads (Deoptimize) done +Event: 0.141 Executing VM operation: HandshakeAllThreads (Deoptimize) +Event: 0.141 Executing VM operation: HandshakeAllThreads (Deoptimize) done +Event: 0.205 Executing VM operation: ICBufferFull +Event: 0.205 Executing VM operation: ICBufferFull done +Event: 0.246 Executing VM operation: HandshakeAllThreads (Deoptimize) +Event: 0.246 Executing VM operation: HandshakeAllThreads (Deoptimize) done +Event: 0.250 Executing VM operation: HandshakeAllThreads (Deoptimize) +Event: 0.250 Executing VM operation: HandshakeAllThreads (Deoptimize) done +Event: 0.326 Executing VM operation: ICBufferFull +Event: 0.326 Executing VM operation: ICBufferFull done + +Events (20 events): +Event: 0.023 Thread 0x000000013b852c00 Thread added: 0x000000013b852c00 +Event: 0.023 Protecting memory [0x000000016cc10000,0x000000016cc1c000] with protection modes 0 +Event: 0.023 Thread 0x000000013b853400 Thread added: 0x000000013b853400 +Event: 0.023 Protecting memory [0x000000016ce1c000,0x000000016ce28000] with protection modes 0 +Event: 0.024 Thread 0x000000013b01c800 Thread added: 0x000000013b01c800 +Event: 0.024 Protecting memory [0x000000016d028000,0x000000016d034000] with protection modes 0 +Event: 0.024 Thread 0x000000013985f000 Thread added: 0x000000013985f000 +Event: 0.024 Protecting memory [0x000000016d234000,0x000000016d240000] with protection modes 0 +Event: 0.024 Thread 0x0000000129834c00 Thread added: 0x0000000129834c00 +Event: 0.024 Protecting memory [0x000000016d440000,0x000000016d44c000] with protection modes 0 +Event: 0.024 Thread 0x000000013b01d000 Thread added: 0x000000013b01d000 +Event: 0.024 Protecting memory [0x000000016d64c000,0x000000016d658000] with protection modes 0 +Event: 0.024 Thread 0x000000013b00c400 Thread added: 0x000000013b00c400 +Event: 0.024 Protecting memory [0x000000016d858000,0x000000016d864000] with protection modes 0 +Event: 0.045 Thread 0x000000013b00cc00 Thread added: 0x000000013b00cc00 +Event: 0.045 Protecting memory [0x000000016da64000,0x000000016da70000] with protection modes 0 +Event: 0.077 Thread 0x000000013b85dc00 Thread added: 0x000000013b85dc00 +Event: 0.077 Protecting memory [0x000000016dc70000,0x000000016dc7c000] with protection modes 0 +Event: 0.077 Thread 0x000000013b8e0600 Thread added: 0x000000013b8e0600 +Event: 0.077 Protecting memory [0x000000016de7c000,0x000000016de88000] with protection modes 0 + + +Dynamic libraries: +0x000000010487c000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjli.dylib +0x00000001a96bb000 /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa +0x0000000192c62000 /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit +0x0000000195cce000 /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData +0x0000000190515000 /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation +0x000000019bfdc000 /usr/lib/libSystem.B.dylib +0x0000000193f9f000 /System/Library/PrivateFrameworks/UIFoundation.framework/Versions/A/UIFoundation +0x000000022ab7f000 /System/Library/PrivateFrameworks/CollectionViewCore.framework/Versions/A/CollectionViewCore +0x00000001a3255000 /System/Library/PrivateFrameworks/RemoteViewServices.framework/Versions/A/RemoteViewServices +0x0000000199e89000 /System/Library/PrivateFrameworks/XCTTargetBootstrap.framework/Versions/A/XCTTargetBootstrap +0x000000019e618000 /System/Library/PrivateFrameworks/InternationalSupport.framework/Versions/A/InternationalSupport +0x000000019e66c000 /System/Library/PrivateFrameworks/UserActivity.framework/Versions/A/UserActivity +0x000000024efd6000 /System/Library/PrivateFrameworks/WindowManagement.framework/Versions/A/WindowManagement +0x0000000190195000 /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration +0x000000019da86000 /usr/lib/libspindump.dylib +0x0000000194154000 /System/Library/Frameworks/UniformTypeIdentifiers.framework/Versions/A/UniformTypeIdentifiers +0x0000000197d00000 /usr/lib/libapp_launch_measurement.dylib +0x0000000197126000 /System/Library/PrivateFrameworks/CoreAnalytics.framework/Versions/A/CoreAnalytics +0x0000000197d07000 /System/Library/PrivateFrameworks/CoreAutoLayout.framework/Versions/A/CoreAutoLayout +0x00000001996a9000 /System/Library/Frameworks/Metal.framework/Versions/A/Metal +0x000000019a631000 /usr/lib/liblangid.dylib +0x0000000199e8f000 /System/Library/PrivateFrameworks/CoreSVG.framework/Versions/A/CoreSVG +0x0000000194b19000 /System/Library/PrivateFrameworks/SkyLight.framework/Versions/A/SkyLight +0x0000000194fba000 /System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics +0x00000001a392f000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate +0x000000019d8e0000 /System/Library/PrivateFrameworks/IconServices.framework/Versions/A/IconServices +0x0000000199687000 /System/Library/Frameworks/IOSurface.framework/Versions/A/IOSurface +0x0000000197155000 /usr/lib/libDiagnosticMessagesClient.dylib +0x000000019bf1e000 /usr/lib/libz.1.dylib +0x00000001a70d4000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices +0x0000000199e71000 /System/Library/PrivateFrameworks/DFRFoundation.framework/Versions/A/DFRFoundation +0x00000001924bc000 /usr/lib/libicucore.A.dylib +0x000000019f676000 /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox +0x000000019e627000 /System/Library/PrivateFrameworks/DataDetectorsCore.framework/Versions/A/DataDetectorsCore +0x00000001b809a000 /System/Library/PrivateFrameworks/TextInput.framework/Versions/A/TextInput +0x0000000194a6a000 /usr/lib/libMobileGestalt.dylib +0x0000000199bad000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox +0x000000019762c000 /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore +0x00000001920e9000 /System/Library/Frameworks/Security.framework/Versions/A/Security +0x00000001a3295000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SpeechRecognition.framework/Versions/A/SpeechRecognition +0x0000000197a2e000 /System/Library/PrivateFrameworks/CoreUI.framework/Versions/A/CoreUI +0x00000001919e2000 /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio +0x0000000197239000 /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration +0x000000019dee2000 /System/Library/PrivateFrameworks/MultitouchSupport.framework/Versions/A/MultitouchSupport +0x0000000194a68000 /usr/lib/libenergytrace.dylib +0x00000001ad793000 /System/Library/PrivateFrameworks/RenderBox.framework/Versions/A/RenderBox +0x0000000192b16000 /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit +0x00000001a366a000 /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices +0x0000000197c8c000 /System/Library/PrivateFrameworks/PerformanceAnalysis.framework/Versions/A/PerformanceAnalysis +0x00000001e603f000 /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL +0x0000000197d51000 /usr/lib/libxml2.2.dylib +0x000000019b360000 /System/Library/PrivateFrameworks/MobileKeyBag.framework/Versions/A/MobileKeyBag +0x000000018ef80000 /usr/lib/libobjc.A.dylib +0x000000018f274000 /usr/lib/libc++.1.dylib +0x00000001a35e7000 /System/Library/Frameworks/Accessibility.framework/Versions/A/Accessibility +0x000000019569a000 /System/Library/Frameworks/ColorSync.framework/Versions/A/ColorSync +0x000000018f3c0000 /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation +0x000000019a1ec000 /System/Library/Frameworks/CoreImage.framework/Versions/A/CoreImage +0x00000001917ed000 /System/Library/Frameworks/CoreText.framework/Versions/A/CoreText +0x00000001ea89e000 /System/Library/Frameworks/CoreTransferable.framework/Versions/A/CoreTransferable +0x00000001ead63000 /System/Library/Frameworks/DeveloperToolsSupport.framework/Versions/A/DeveloperToolsSupport +0x0000000199eca000 /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO +0x0000000224d1f000 /System/Library/Frameworks/Symbols.framework/Versions/A/Symbols +0x000000019bfe2000 /System/Library/PrivateFrameworks/SoftLinking.framework/Versions/A/SoftLinking +0x000000019f028000 /usr/lib/swift/libswiftCore.dylib +0x00000001b4d27000 /usr/lib/swift/libswiftCoreFoundation.dylib +0x00000001b2790000 /usr/lib/swift/libswiftCoreGraphics.dylib +0x00000001b4d71000 /usr/lib/swift/libswiftCoreImage.dylib +0x00000001b2797000 /usr/lib/swift/libswiftDarwin.dylib +0x00000001a4cda000 /usr/lib/swift/libswiftDispatch.dylib +0x00000001b4d72000 /usr/lib/swift/libswiftIOKit.dylib +0x00000001c07cc000 /usr/lib/swift/libswiftMetal.dylib +0x00000001cde91000 /usr/lib/swift/libswiftOSLog.dylib +0x00000001a754f000 /usr/lib/swift/libswiftObjectiveC.dylib +0x00000001c4f00000 /usr/lib/swift/libswiftQuartzCore.dylib +0x00000001c9005000 /usr/lib/swift/libswiftUniformTypeIdentifiers.dylib +0x00000001b4d39000 /usr/lib/swift/libswiftXPC.dylib +0x000000025747d000 /usr/lib/swift/libswift_Concurrency.dylib +0x00000001a7553000 /usr/lib/swift/libswiftos.dylib +0x00000001b7ffe000 /usr/lib/swift/libswiftsimd.dylib +0x000000019c191000 /usr/lib/libcompression.dylib +0x000000019e572000 /System/Library/PrivateFrameworks/TextureIO.framework/Versions/A/TextureIO +0x000000019d58c000 /usr/lib/libate.dylib +0x000000019bfd6000 /usr/lib/system/libcache.dylib +0x000000019bf90000 /usr/lib/system/libcommonCrypto.dylib +0x000000019bfbc000 /usr/lib/system/libcompiler_rt.dylib +0x000000019bfb2000 /usr/lib/system/libcopyfile.dylib +0x000000018f0c4000 /usr/lib/system/libcorecrypto.dylib +0x000000018f1aa000 /usr/lib/system/libdispatch.dylib +0x000000018f365000 /usr/lib/system/libdyld.dylib +0x000000019bfcc000 /usr/lib/system/libkeymgr.dylib +0x000000019bf68000 /usr/lib/system/libmacho.dylib +0x000000019b448000 /usr/lib/system/libquarantine.dylib +0x000000019bfc9000 /usr/lib/system/libremovefile.dylib +0x0000000194ae0000 /usr/lib/system/libsystem_asl.dylib +0x000000018f059000 /usr/lib/system/libsystem_blocks.dylib +0x000000018f1f5000 /usr/lib/system/libsystem_c.dylib +0x000000019bfc0000 /usr/lib/system/libsystem_collections.dylib +0x000000019a620000 /usr/lib/system/libsystem_configuration.dylib +0x000000019965c000 /usr/lib/system/libsystem_containermanager.dylib +0x000000019bbff000 /usr/lib/system/libsystem_coreservices.dylib +0x0000000192783000 /usr/lib/system/libsystem_darwin.dylib +0x00000002577ca000 /usr/lib/system/libsystem_darwindirectory.dylib +0x000000019bfcd000 /usr/lib/system/libsystem_dnssd.dylib +0x00000002577ce000 /usr/lib/system/libsystem_eligibility.dylib +0x000000018f1f2000 /usr/lib/system/libsystem_featureflags.dylib +0x000000018f393000 /usr/lib/system/libsystem_info.dylib +0x000000019bf2d000 /usr/lib/system/libsystem_m.dylib +0x000000018f16d000 /usr/lib/system/libsystem_malloc.dylib +0x0000000194a4d000 /usr/lib/system/libsystem_networkextension.dylib +0x0000000192bf9000 /usr/lib/system/libsystem_notify.dylib +0x000000019a625000 /usr/lib/system/libsystem_sandbox.dylib +0x00000002577d2000 /usr/lib/system/libsystem_sanitizers.dylib +0x000000019bfc5000 /usr/lib/system/libsystem_secinit.dylib +0x000000018f31d000 /usr/lib/system/libsystem_kernel.dylib +0x000000018f38b000 /usr/lib/system/libsystem_platform.dylib +0x000000018f358000 /usr/lib/system/libsystem_pthread.dylib +0x00000001964d0000 /usr/lib/system/libsystem_symptoms.dylib +0x000000018f0a9000 /usr/lib/system/libsystem_trace.dylib +0x000000019bf9e000 /usr/lib/system/libunwind.dylib +0x000000018f05e000 /usr/lib/system/libxpc.dylib +0x000000018f301000 /usr/lib/libc++abi.dylib +0x000000019bfaa000 /usr/lib/liboah.dylib +0x000000019d438000 /usr/lib/liblzma.5.dylib +0x000000019bfde000 /usr/lib/libfakelink.dylib +0x0000000194679000 /System/Library/Frameworks/CFNetwork.framework/Versions/A/CFNetwork +0x000000019c032000 /usr/lib/libarchive.2.dylib +0x00000001a1568000 /System/Library/Frameworks/Combine.framework/Versions/A/Combine +0x000000022ab93000 /System/Library/PrivateFrameworks/CollectionsInternal.framework/Versions/A/CollectionsInternal +0x0000000241543000 /System/Library/PrivateFrameworks/ReflectionInternal.framework/Versions/A/ReflectionInternal +0x0000000241ad5000 /System/Library/PrivateFrameworks/RuntimeInternal.framework/Versions/A/RuntimeInternal +0x00000002575d1000 /usr/lib/swift/libswift_StringProcessing.dylib +0x0000000192a94000 /System/Library/PrivateFrameworks/CoreServicesInternal.framework/Versions/A/CoreServicesInternal +0x000000019b46f000 /usr/lib/libbsm.0.dylib +0x000000019bf70000 /usr/lib/system/libkxld.dylib +0x0000000197cc8000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/FSEvents.framework/Versions/A/FSEvents +0x000000019278e000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore +0x000000019719e000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata +0x000000019bc05000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices +0x000000019c0bb000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit +0x0000000196451000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE +0x000000018f899000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices +0x000000019d3e1000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/DictionaryServices.framework/Versions/A/DictionaryServices +0x0000000197cd5000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SharedFileList.framework/Versions/A/SharedFileList +0x000000019c15b000 /usr/lib/libapple_nghttp2.dylib +0x00000001960c5000 /usr/lib/libsqlite3.dylib +0x00000001964d9000 /System/Library/Frameworks/Network.framework/Versions/A/Network +0x0000000255e8e000 /usr/lib/libCoreEntitlements.dylib +0x000000023c44d000 /System/Library/PrivateFrameworks/MessageSecurity.framework/Versions/A/MessageSecurity +0x00000001960ab000 /System/Library/PrivateFrameworks/ProtocolBuffer.framework/Versions/A/ProtocolBuffer +0x000000019bb2e000 /System/Library/PrivateFrameworks/AppleFSCompression.framework/Versions/A/AppleFSCompression +0x000000019b457000 /usr/lib/libcoretls.dylib +0x000000019d457000 /usr/lib/libcoretls_cfhelpers.dylib +0x000000019c18b000 /usr/lib/libpam.2.dylib +0x000000019d4c9000 /usr/lib/libxar.1.dylib +0x000000019d8b7000 /usr/lib/libheimdal-asn1.dylib +0x0000000194678000 /usr/lib/libnetwork.dylib +0x000000019bfe3000 /usr/lib/libpcap.A.dylib +0x00000001964c5000 /usr/lib/libdns_services.dylib +0x000000019a62d000 /System/Library/PrivateFrameworks/AppleSystemInfo.framework/Versions/A/AppleSystemInfo +0x000000019b155000 /System/Library/PrivateFrameworks/IOMobileFramebuffer.framework/Versions/A/IOMobileFramebuffer +0x0000000257528000 /usr/lib/swift/libswift_RegexParser.dylib +0x000000019bbf2000 /usr/lib/libbz2.1.0.dylib +0x000000019b44b000 /usr/lib/libCheckFix.dylib +0x0000000194af8000 /System/Library/PrivateFrameworks/TCC.framework/Versions/A/TCC +0x000000019a633000 /System/Library/PrivateFrameworks/CoreNLP.framework/Versions/A/CoreNLP +0x0000000197157000 /System/Library/PrivateFrameworks/MetadataUtilities.framework/Versions/A/MetadataUtilities +0x000000019b481000 /usr/lib/libmecab.dylib +0x0000000190229000 /usr/lib/libCRFSuite.dylib +0x000000019b4dd000 /usr/lib/libgermantok.dylib +0x000000019c132000 /usr/lib/libThaiTokenizer.dylib +0x0000000197242000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.framework/Versions/A/vImage +0x00000001a3641000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/vecLib +0x000000019d510000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvMisc.dylib +0x000000019b030000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvDSP.dylib +0x000000018fca0000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib +0x000000019c266000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib +0x000000019b4e0000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLinearAlgebra.dylib +0x000000019c176000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparseBLAS.dylib +0x000000019c261000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libQuadrature.dylib +0x000000019a75c000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBNNS.dylib +0x000000019012e000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparse.dylib +0x000000023ab9c000 /System/Library/PrivateFrameworks/MIL.framework/Versions/A/MIL +0x000000019c019000 /usr/lib/libiconv.2.dylib +0x000000019bf64000 /usr/lib/libcharset.1.dylib +0x0000000197ca8000 /System/Library/Frameworks/OpenDirectory.framework/Versions/A/Frameworks/CFOpenDirectory.framework/Versions/A/CFOpenDirectory +0x0000000197c98000 /System/Library/Frameworks/OpenDirectory.framework/Versions/A/OpenDirectory +0x000000019d459000 /System/Library/PrivateFrameworks/APFS.framework/Versions/A/APFS +0x000000019b387000 /System/Library/Frameworks/SecurityFoundation.framework/Versions/A/SecurityFoundation +0x000000019d4d8000 /usr/lib/libutil.dylib +0x0000000238cfd000 /System/Library/PrivateFrameworks/InstalledContentLibrary.framework/Versions/A/InstalledContentLibrary +0x0000000192ad5000 /System/Library/PrivateFrameworks/CoreServicesStore.framework/Versions/A/CoreServicesStore +0x0000000228340000 /System/Library/PrivateFrameworks/AppleMobileFileIntegrity.framework/Versions/A/AppleMobileFileIntegrity +0x00000001b4cf5000 /usr/lib/libmis.dylib +0x00000001c53e7000 /System/Library/PrivateFrameworks/MobileSystemServices.framework/Versions/A/MobileSystemServices +0x00000001e3449000 /System/Library/PrivateFrameworks/ConfigProfileHelper.framework/Versions/A/ConfigProfileHelper +0x000000019c134000 /System/Library/PrivateFrameworks/AppleSauce.framework/Versions/A/AppleSauce +0x0000000191173000 /System/Library/PrivateFrameworks/LanguageModeling.framework/Versions/A/LanguageModeling +0x000000019d4dc000 /usr/lib/libxslt.1.dylib +0x000000019c020000 /usr/lib/libcmph.dylib +0x000000019b121000 /System/Library/PrivateFrameworks/CoreEmoji.framework/Versions/A/CoreEmoji +0x000000019a756000 /System/Library/PrivateFrameworks/LinguisticData.framework/Versions/A/LinguisticData +0x000000019003c000 /System/Library/PrivateFrameworks/Lexicon.framework/Versions/A/Lexicon +0x000000019b415000 /System/Library/PrivateFrameworks/BackgroundTaskManagement.framework/Versions/A/BackgroundTaskManagement +0x0000000256078000 /usr/lib/libTLE.dylib +0x000000019dda8000 /System/Library/PrivateFrameworks/AppleJPEG.framework/Versions/A/AppleJPEG +0x000000019d89c000 /usr/lib/libexpat.1.dylib +0x000000019e3d0000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libPng.dylib +0x000000019e3fb000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib +0x000000019e4e6000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libGIF.dylib +0x000000019ddee000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJP2.dylib +0x000000019e48b000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib +0x000000019e482000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libRadiance.dylib +0x0000000199a48000 /System/Library/PrivateFrameworks/FontServices.framework/libFontParser.dylib +0x00000001963ea000 /System/Library/PrivateFrameworks/RunningBoardServices.framework/Versions/A/RunningBoardServices +0x00000001a9f95000 /System/Library/PrivateFrameworks/IOSurfaceAccelerator.framework/Versions/A/IOSurfaceAccelerator +0x000000019dede000 /System/Library/PrivateFrameworks/WatchdogClient.framework/Versions/A/WatchdogClient +0x0000000191359000 /System/Library/Frameworks/CoreDisplay.framework/Versions/A/CoreDisplay +0x00000001998ff000 /System/Library/Frameworks/CoreMedia.framework/Versions/A/CoreMedia +0x000000019969f000 /System/Library/PrivateFrameworks/IOAccelerator.framework/Versions/A/IOAccelerator +0x0000000197e3b000 /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo +0x000000019c189000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/MetalPerformanceShaders +0x000000019df21000 /System/Library/Frameworks/VideoToolbox.framework/Versions/A/VideoToolbox +0x0000000197ed7000 /System/Library/PrivateFrameworks/UserManagement.framework/Versions/A/UserManagement +0x0000000196311000 /System/Library/PrivateFrameworks/BaseBoard.framework/Versions/A/BaseBoard +0x000000019a62b000 /System/Library/PrivateFrameworks/AggregateDictionary.framework/Versions/A/AggregateDictionary +0x000000022817a000 /System/Library/PrivateFrameworks/AppleKeyStore.framework/Versions/A/AppleKeyStore +0x000000019e47d000 /System/Library/PrivateFrameworks/GPUWrangler.framework/Versions/A/GPUWrangler +0x000000019e45d000 /System/Library/PrivateFrameworks/IOPresentment.framework/Versions/A/IOPresentment +0x000000019e485000 /System/Library/PrivateFrameworks/DSExternalDisplay.framework/Versions/A/DSExternalDisplay +0x0000000234d8a000 /System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/32023/Libraries/libllvm-flatbuffers.dylib +0x00000001e6032000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCoreFSCache.dylib +0x00000002319ee000 /System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/32023/Libraries/libGPUCompilerUtils.dylib +0x000000019e4ec000 /System/Library/PrivateFrameworks/CMCaptureCore.framework/Versions/A/CMCaptureCore +0x00000001eae86000 /System/Library/Frameworks/ExtensionFoundation.framework/Versions/A/ExtensionFoundation +0x00000001a5543000 /System/Library/PrivateFrameworks/CoreTime.framework/Versions/A/CoreTime +0x000000019da70000 /System/Library/PrivateFrameworks/AppServerSupport.framework/Versions/A/AppServerSupport +0x00000001a0004000 /System/Library/PrivateFrameworks/perfdata.framework/Versions/A/perfdata +0x000000019147d000 /System/Library/PrivateFrameworks/AudioToolboxCore.framework/Versions/A/AudioToolboxCore +0x00000001998d5000 /System/Library/PrivateFrameworks/caulk.framework/Versions/A/caulk +0x000000019f872000 /usr/lib/libAudioStatistics.dylib +0x00000001b402e000 /System/Library/PrivateFrameworks/SystemPolicy.framework/Versions/A/SystemPolicy +0x000000019fb4b000 /usr/lib/libSMC.dylib +0x00000001a953d000 /System/Library/Frameworks/CoreMIDI.framework/Versions/A/CoreMIDI +0x000000019e397000 /usr/lib/libAudioToolboxUtility.dylib +0x00000001af42f000 /System/Library/PrivateFrameworks/OSAServicesClient.framework/Versions/A/OSAServicesClient +0x00000001a0012000 /usr/lib/libperfcheck.dylib +0x00000001a4ffa000 /System/Library/PrivateFrameworks/BoardServices.framework/Versions/A/BoardServices +0x000000019d784000 /System/Library/PrivateFrameworks/PlugInKit.framework/Versions/A/PlugInKit +0x000000019b379000 /System/Library/PrivateFrameworks/AssertionServices.framework/Versions/A/AssertionServices +0x00000001a864e000 /System/Library/PrivateFrameworks/ASEProcessing.framework/Versions/A/ASEProcessing +0x00000001d1318000 /System/Library/PrivateFrameworks/Symbolication.framework/Versions/A/Symbolication +0x0000000240330000 /System/Library/PrivateFrameworks/PhotosensitivityProcessing.framework/Versions/A/PhotosensitivityProcessing +0x000000019da21000 /System/Library/PrivateFrameworks/GraphVisualizer.framework/Versions/A/GraphVisualizer +0x00000001e6094000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib +0x00000001e6053000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGFXShared.dylib +0x00000001e622c000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib +0x00000001e605c000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLImage.dylib +0x00000001e6050000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCVMSPluginSupport.dylib +0x0000000256030000 /usr/lib/libRosetta.dylib +0x00000001e6039000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCoreVMClient.dylib +0x000000022fbf4000 /System/Library/PrivateFrameworks/FontServices.framework/Versions/A/FontServices +0x000000019da2d000 /System/Library/PrivateFrameworks/OTSVG.framework/Versions/A/OTSVG +0x00000001979dc000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/Resources/libFontRegistry.dylib +0x000000019da7b000 /System/Library/PrivateFrameworks/FontServices.framework/libhvf.dylib +0x000000022fbf5000 /System/Library/PrivateFrameworks/FontServices.framework/libXTFontStaticRegistryData.dylib +0x000000019a572000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSCore.framework/Versions/A/MPSCore +0x000000019ba9c000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSImage.framework/Versions/A/MPSImage +0x000000019b4f5000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSNeuralNetwork.framework/Versions/A/MPSNeuralNetwork +0x000000019b940000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSMatrix.framework/Versions/A/MPSMatrix +0x000000019b74b000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSRayIntersector.framework/Versions/A/MPSRayIntersector +0x000000019b972000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSNDArray.framework/Versions/A/MPSNDArray +0x00000001ec760000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSFunctions.framework/Versions/A/MPSFunctions +0x00000001ec745000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSBenchmarkLoop.framework/Versions/A/MPSBenchmarkLoop +0x000000018fb54000 /System/Library/PrivateFrameworks/MetalTools.framework/Versions/A/MetalTools +0x00000001b91d7000 /System/Library/PrivateFrameworks/IOAccelMemoryInfo.framework/Versions/A/IOAccelMemoryInfo +0x00000001c52e0000 /System/Library/PrivateFrameworks/kperf.framework/Versions/A/kperf +0x00000001b4d1a000 /System/Library/PrivateFrameworks/GPURawCounter.framework/Versions/A/GPURawCounter +0x00000001a5415000 /System/Library/PrivateFrameworks/CoreSymbolication.framework/Versions/A/CoreSymbolication +0x00000001b4cc6000 /System/Library/PrivateFrameworks/MallocStackLogging.framework/Versions/A/MallocStackLogging +0x000000019d626000 /System/Library/PrivateFrameworks/CrashReporterSupport.framework/Versions/A/CrashReporterSupport +0x00000001a53d0000 /System/Library/PrivateFrameworks/DebugSymbols.framework/Versions/A/DebugSymbols +0x00000001c3c47000 /System/Library/PrivateFrameworks/OSAnalytics.framework/Versions/A/OSAnalytics +0x000000024d229000 /System/Library/PrivateFrameworks/VideoToolboxParavirtualizationSupport.framework/Versions/A/VideoToolboxParavirtualizationSupport +0x000000019d850000 /System/Library/PrivateFrameworks/AppleVA.framework/Versions/A/AppleVA +0x000000019f8ba000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS +0x0000000195849000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices +0x000000019e4fa000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/PrintCore +0x000000019fca4000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/QD.framework/Versions/A/QD +0x000000019fc98000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSyncLegacy.framework/Versions/A/ColorSyncLegacy +0x000000019f88a000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis +0x000000019e4b6000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATSUI.framework/Versions/A/ATSUI +0x000000019fc2b000 /usr/lib/libcups.2.dylib +0x00000001a0020000 /System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos +0x00000001a0031000 /System/Library/Frameworks/GSS.framework/Versions/A/GSS +0x000000019f939000 /usr/lib/libresolv.9.dylib +0x000000019da8c000 /System/Library/PrivateFrameworks/Heimdal.framework/Versions/A/Heimdal +0x00000001a74bc000 /System/Library/Frameworks/Kerberos.framework/Versions/A/Libraries/libHeimdalProxy.dylib +0x00000001a008b000 /System/Library/PrivateFrameworks/CommonAuth.framework/Versions/A/CommonAuth +0x00000001e9c6c000 /System/Library/Frameworks/AVFAudio.framework/Versions/A/AVFAudio +0x00000001af47e000 /System/Library/PrivateFrameworks/AXCoreUtilities.framework/Versions/A/AXCoreUtilities +0x000000023a274000 /System/Library/PrivateFrameworks/IsolatedCoreAudioClient.framework/Versions/A/IsolatedCoreAudioClient +0x000000019f7f6000 /System/Library/PrivateFrameworks/AudioSession.framework/Versions/A/AudioSession +0x00000001a1307000 /System/Library/Frameworks/IOBluetooth.framework/Versions/A/IOBluetooth +0x000000019d95b000 /System/Library/PrivateFrameworks/MediaExperience.framework/Versions/A/MediaExperience +0x000000019f635000 /System/Library/PrivateFrameworks/AudioSession.framework/libSessionUtility.dylib +0x000000019fcb0000 /System/Library/PrivateFrameworks/AudioResourceArbitration.framework/Versions/A/AudioResourceArbitration +0x00000001a4388000 /System/Library/PrivateFrameworks/PowerLog.framework/Versions/A/PowerLog +0x00000001a42a6000 /System/Library/Frameworks/CoreBluetooth.framework/Versions/A/CoreBluetooth +0x00000001a74bd000 /System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit +0x000000019b1e2000 /System/Library/PrivateFrameworks/CoreUtils.framework/Versions/A/CoreUtils +0x000000022de3f000 /System/Library/PrivateFrameworks/CoreUtilsExtras.framework/Versions/A/CoreUtilsExtras +0x0000000238b8a000 /System/Library/PrivateFrameworks/IO80211.framework/Versions/A/IO80211 +0x00000001a4f3e000 /System/Library/PrivateFrameworks/FrontBoardServices.framework/Versions/A/FrontBoardServices +0x00000001a6a85000 /System/Library/PrivateFrameworks/BackBoardServices.framework/Versions/A/BackBoardServices +0x000000019d8c2000 /System/Library/PrivateFrameworks/IconFoundation.framework/Versions/A/IconFoundation +0x00000001a3281000 /System/Library/PrivateFrameworks/SpeechRecognitionCore.framework/Versions/A/SpeechRecognitionCore +0x00000001af49d000 /usr/lib/libAccessibility.dylib +0x00000001a397b000 /System/Library/Frameworks/MediaAccessibility.framework/Versions/A/MediaAccessibility +0x00000001d49cc000 /System/Library/Frameworks/OSLog.framework/Versions/A/OSLog +0x00000001b4c54000 /System/Library/PrivateFrameworks/LoggingSupport.framework/Versions/A/LoggingSupport +0x0000000105a88000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/server/libjvm.dylib +0x000000010441c000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjimage.dylib +0x0000000104448000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libinstrument.dylib +0x0000000104490000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjava.dylib +0x000000010591c000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libzip.dylib +0x0000000105944000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libnio.dylib +0x0000000104478000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libnet.dylib +0x0000000105964000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libextnet.dylib +0x00000001059e4000 /Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/libsomelib.dylib +0x000000010446c000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libsyslookup.dylib + + +VM Arguments: +jvm_args: -ea -Didea.test.cyclic.buffer.size=1048576 -javaagent:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/lib/idea_rt.jar=60545:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/bin -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 +java_command: com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit5 dev.diplomattest.somelib.Float64VecTest,testFloat64Vec +java_class_path (initial): /Users/cristina/.m2/repository/org/junit/platform/junit-platform-launcher/1.10.3/junit-platform-launcher-1.10.3.jar:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/lib/idea_rt.jar:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/plugins/junit/lib/junit5-rt.jar:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/plugins/junit/lib/junit-rt.jar:/Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/target/test-classes:/Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/target/classes:/Users/cristina/.m2/repository/net/java/dev/jna/jna/5.14.0/jna-5.14.0.jar:/Users/cristina/.m2/repository/org/junit/jupiter/junit-jupiter/5.10.3/junit-jupiter-5.10.3.jar:/Users/cristina/.m2/repository/org/junit/jupiter/junit-jupiter-api/5.10.3/junit-jupiter-api-5.10.3.jar:/Users/cristina/.m2/repository/org/opentest4j/opentest4j/1.3.0/opentest4j-1.3.0.jar:/Users/cristina/.m2/repository/org/junit/platform/junit-platform-commons/1.10.3/junit-platform-commons-1.10.3.jar:/Users/cristina/.m2/repository/org/apiguardian/apiguardian-api/1.1.2/apiguardian-api-1.1.2.jar:/Users/cristina/.m2/repository/org/junit/jupiter/junit-jupiter-params/5.10.3/junit-jupiter-params-5.10.3.jar:/Users/cristina/.m2/repository/org/junit/jupiter/junit-jupiter-engine/5.10.3/junit-jupiter-engine-5.10.3.jar:/Users/cristina/.m2/repository/org/junit/platform/junit-platform-engine/1.10.3/junit-platform-engine-1.10.3.jar:/Users/cristina/.m2/repository/org/openjdk/jmh/jmh-core/1.37/jmh-core-1.37.jar:/Users/cristina/.m2/repository/net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4.jar:/Users/cristina/.m2/repository/org/apache/commons/commons-math3/3.6.1/commons-math3-3.6.1.jar:/Users/cristina/.m2/repository/org/openjdk/jmh/jmh-generator-annprocess/1.37/jmh-generator-annprocess-1.37.jar +Launcher Type: SUN_STANDARD + +[Global flags] + intx CICompilerCount = 4 {product} {ergonomic} + uint ConcGCThreads = 2 {product} {ergonomic} + uint G1ConcRefinementThreads = 8 {product} {ergonomic} + size_t G1HeapRegionSize = 2097152 {product} {ergonomic} + size_t InitialHeapSize = 268435456 {product} {ergonomic} + size_t MarkStackSize = 4194304 {product} {ergonomic} + size_t MaxHeapSize = 4294967296 {product} {ergonomic} + size_t MaxNewSize = 2575302656 {product} {ergonomic} + size_t MinHeapDeltaBytes = 2097152 {product} {ergonomic} + size_t MinHeapSize = 8388608 {product} {ergonomic} + uintx NonNMethodCodeHeapSize = 5839564 {pd product} {ergonomic} + uintx NonProfiledCodeHeapSize = 122909338 {pd product} {ergonomic} + uintx ProfiledCodeHeapSize = 122909338 {pd product} {ergonomic} + uintx ReservedCodeCacheSize = 251658240 {pd product} {ergonomic} + bool SegmentedCodeCache = true {product} {ergonomic} + size_t SoftMaxHeapSize = 4294967296 {manageable} {ergonomic} + bool UseCompressedOops = true {product lp64_product} {ergonomic} + bool UseG1GC = true {product} {ergonomic} + bool UseNUMA = false {product} {ergonomic} + bool UseNUMAInterleaving = false {product} {ergonomic} + +Logging: +Log output configuration: + #0: stdout all=warning uptime,level,tags foldmultilines=false + #1: stderr all=off uptime,level,tags foldmultilines=false + +Environment Variables: +JAVA_HOME=/Users/cristina/Library/Java/JavaVirtualMachines/corretto-19.0.1/Contents/Home/ +PATH=/Users/cristina/bin/jextract-22/bin:/bin:/Users/cristina/.modular/pkg/packages.modular.com_mojo/bin:/Users/cristina/Downloads/dart-sdk/bin:/opt/homebrew/Cellar/llvm/15.0.6/bin:/opt/homebrew/opt/openjdk/bin:/Users/cristina/.elan/bin:/Users/cristina/bin:/Users/cristina/Library/Application Support/Coursier/bin:/Users/cristina/Library/Python/3.8/bin:/Users/cristina/.local/bin:/Users/cristina/.cargo/bin:/Users/cristina/.cargo:/opt/homebrew/bin:/Users/cristina/.fzf/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/X11/bin:/Library/Apple/usr/bin:/usr/local/go/bin:/Library/TeX/texbin:/Users/cristina/.krew/bin +SHELL=/opt/homebrew/bin/fish +LC_CTYPE=en_US.UTF-8 +TMPDIR=/var/folders/x_/9qhndrhs79j640bxvmbkddfw0000gn/T/ + +Active Locale: +LC_ALL=C/en_US.UTF-8/C/C/C/C +LC_COLLATE=C +LC_CTYPE=en_US.UTF-8 +LC_MESSAGES=C +LC_MONETARY=C +LC_NUMERIC=C +LC_TIME=C + +Signal Handlers: + SIGSEGV: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_ONSTACK|SA_RESTART|SA_SIGINFO, unblocked + SIGBUS: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, unblocked + SIGFPE: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, unblocked + SIGPIPE: javaSignalHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked + SIGXFSZ: javaSignalHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked + SIGILL: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, unblocked + SIGUSR2: SR_handler in libjvm.dylib, mask=00100000000000000000000000000000, flags=SA_RESTART|SA_SIGINFO, blocked + SIGHUP: UserHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked + SIGINT: UserHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked + SIGTERM: UserHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked + SIGQUIT: UserHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked + SIGTRAP: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, unblocked + + +Periodic native trim disabled + +--------------- S Y S T E M --------------- + +OS: +uname: Darwin 23.5.0 Darwin Kernel Version 23.5.0: Wed May 1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000 arm64 +OS uptime: 45 days 10:04 hours +rlimit (soft/hard): STACK 8176k/65520k , CORE 0k/infinity , NPROC 2666/4000 , NOFILE 10240/infinity , AS infinity/infinity , CPU infinity/infinity , DATA infinity/infinity , FSIZE infinity/infinity , MEMLOCK infinity/infinity , RSS infinity/infinity +load average: 4.77 4.54 4.54 + +CPU: total 8 (initial active 8) 0x61:0x0:0x1b588bb3:0, fp, asimd, aes, pmull, sha1, sha256, crc32, lse, sha3, sha512 +machdep.cpu.brand_string:Apple M1 Pro +hw.cachelinesize:128 +hw.l1icachesize:131072 +hw.l1dcachesize:65536 +hw.l2cachesize:4194304 + +Memory: 16k page, physical 16777216k(32960k free), swap 3145728k(1371968k free) + +vm_info: OpenJDK 64-Bit Server VM (22.0.1+8) for bsd-aarch64 JRE (22.0.1+8), built on 2024-04-16T00:00:00Z by "admin" with clang Apple LLVM 15.0.0 (clang-1500.1.0.2.5) + +END. diff --git a/feature_tests/java/somelib/hs_err_pid98695.log b/feature_tests/java/somelib/hs_err_pid98695.log new file mode 100644 index 000000000..8dd0d17f1 --- /dev/null +++ b/feature_tests/java/somelib/hs_err_pid98695.log @@ -0,0 +1,1291 @@ +# +# A fatal error has been detected by the Java Runtime Environment: +# +# SIGSEGV (0xb) at pc=0x00000001019b9aec, pid=98695, tid=10499 +# +# JRE version: OpenJDK Runtime Environment Temurin-22.0.1+8 (22.0.1+8) (build 22.0.1+8) +# Java VM: OpenJDK 64-Bit Server VM Temurin-22.0.1+8 (22.0.1+8, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-aarch64) +# Problematic frame: +# C [libsomelib.dylib+0x5aec] Float64Vec_new_isize+0xb4 +# +# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again +# +# If you would like to submit a bug report, please visit: +# https://github.com/adoptium/adoptium-support/issues +# The crash happened outside the Java Virtual Machine in native code. +# See problematic frame for where to report the bug. +# + +--------------- S U M M A R Y ------------ + +Command Line: -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:60556,suspend=y,server=n -ea -Didea.test.cyclic.buffer.size=1048576 -javaagent:/Users/cristina/Library/Caches/JetBrains/IdeaIC2024.1/captureAgent/debugger-agent.jar -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit5 dev.diplomattest.somelib.Float64VecTest,testFloat64Vec + +Host: "MacBookPro18,3" arm64, 8 cores, 16G, Darwin 23.5.0, macOS 14.5 (23F79) +Time: Wed Aug 14 21:05:38 2024 CEST elapsed time: 3.057476 seconds (0d 0h 0m 3s) + +--------------- T H R E A D --------------- + +Current thread (0x0000000131818400): JavaThread "main" [_thread_in_native, id=10499, stack(0x000000016fa6c000,0x000000016fc6f000) (2060K)] + +Stack: [0x000000016fa6c000,0x000000016fc6f000], sp=0x000000016fc6b870, free space=2046k +Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) +C [libsomelib.dylib+0x5aec] Float64Vec_new_isize+0xb4 +v ~RuntimeStub::nep_invoker_blob 0x00000001127a653c +j java.lang.invoke.LambdaForm$MH+0x00000ffc001d0400.invoke(Ljava/lang/Object;JJJ)J+12 java.base@22.0.1 +j java.lang.invoke.LambdaForm$MH+0x00000ffc001d3000.invokeExact_MT(Ljava/lang/Object;JJJLjava/lang/Object;)J+23 java.base@22.0.1 +j jdk.internal.foreign.abi.DowncallStub+0x00000ffc001d1000.invoke(Ljava/lang/foreign/SegmentAllocator;Ljava/lang/foreign/MemorySegment;Ljava/lang/foreign/MemorySegment;)Ljava/lang/foreign/MemorySegment;+69 java.base@22.0.1 +j java.lang.invoke.LambdaForm$DMH+0x00000ffc001d1400.invokeStaticInit(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+14 java.base@22.0.1 +j java.lang.invoke.LambdaForm$MH+0x00000ffc001d2400.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+44 java.base@22.0.1 +j java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+19 java.base@22.0.1 +j dev.diplomattest.somelib.ntv.somelib_h.Float64Vec_new_isize(Ljava/lang/foreign/MemorySegment;)Ljava/lang/foreign/MemorySegment;+26 +j dev.diplomattest.somelib.Float64Vec.newIsize([J)Ldev/diplomattest/somelib/Float64Vec;+38 +j dev.diplomattest.somelib.Float64VecTest.testFloat64Vec()V+53 +j java.lang.invoke.LambdaForm$DMH+0x00000ffc00140c00.invokeVirtual(Ljava/lang/Object;Ljava/lang/Object;)V+10 java.base@22.0.1 +j java.lang.invoke.LambdaForm$MH+0x00000ffc00148400.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+31 java.base@22.0.1 +j java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+19 java.base@22.0.1 +j jdk.internal.reflect.DirectMethodHandleAccessor.invokeImpl(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+41 java.base@22.0.1 +j jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+23 java.base@22.0.1 +j java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+102 java.base@22.0.1 +j org.junit.platform.commons.util.ReflectionUtils.invokeMethod(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+42 +j org.junit.jupiter.engine.execution.MethodInvocation.proceed()Ljava/lang/Object;+16 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed()Ljava/lang/Object;+8 +j org.junit.jupiter.engine.extension.TimeoutExtension.intercept(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/TimeoutDuration;Lorg/junit/jupiter/engine/extension/TimeoutExtension$TimeoutProvider;)Ljava/lang/Object;+28 +j org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/TimeoutExtension$TimeoutProvider;)Ljava/lang/Object;+31 +j org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)V+9 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda+0x00000ffc00117998.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)V+5 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall$VoidMethodInterceptorCall;Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)Ljava/lang/Void;+6 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall$$Lambda+0x00000ffc00117da8.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)Ljava/lang/Object;+9 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+6 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$$Lambda+0x00000ffc001465f0.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+14 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed()Ljava/lang/Object;+12 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+1 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/engine/execution/InvocationInterceptorChain$InterceptorCall;Ljava/util/List;)Ljava/lang/Object;+24 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InvocationInterceptorChain$InterceptorCall;)Ljava/lang/Object;+31 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;)Ljava/lang/Object;+15 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(Ljava/lang/reflect/Method;Ljava/lang/Object;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;)Ljava/lang/Object;+55 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;)V+28 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda+0x00000ffc00142aa8.execute()V+12 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)V+21 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;+44 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;+6 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+79 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00000ffc00136220.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00000ffc00136000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 +j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00000ffc00133bc0.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService$$Lambda+0x00000ffc00136d10.accept(Ljava/lang/Object;)V+4 +j java.util.ArrayList.forEach(Ljava/util/function/Consumer;)V+46 java.base@22.0.1 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(Ljava/util/List;)V+6 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+116 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00000ffc00136220.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00000ffc00136000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 +j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00000ffc00133bc0.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService$$Lambda+0x00000ffc00136d10.accept(Ljava/lang/Object;)V+4 +j java.util.ArrayList.forEach(Ljava/util/function/Consumer;)V+46 java.base@22.0.1 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(Ljava/util/List;)V+6 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+116 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00000ffc00136220.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00000ffc00136000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 +j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00000ffc00133bc0.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(Lorg/junit/platform/engine/support/hierarchical/HierarchicalTestExecutorService$TestTask;)Ljava/util/concurrent/Future;+1 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute()Ljava/util/concurrent/Future;+74 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(Lorg/junit/platform/engine/ExecutionRequest;)V+31 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/engine/TestDescriptor;Lorg/junit/platform/engine/EngineExecutionListener;Lorg/junit/platform/engine/ConfigurationParameters;Lorg/junit/platform/engine/TestEngine;)V+24 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/LauncherDiscoveryResult;Lorg/junit/platform/engine/EngineExecutionListener;)V+115 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;Lorg/junit/platform/engine/EngineExecutionListener;Lorg/junit/platform/launcher/TestExecutionListener;)V+55 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(Lorg/junit/platform/launcher/core/InternalTestPlan;Lorg/junit/platform/launcher/TestExecutionListener;)V+6 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator$$Lambda+0x00000ffc00120000.accept(Ljava/lang/Object;)V+12 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(Lorg/junit/platform/engine/ConfigurationParameters;Lorg/junit/platform/launcher/core/ListenerRegistry;Ljava/util/function/Consumer;)V+51 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;[Lorg/junit/platform/launcher/TestExecutionListener;)V+23 +j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;[Lorg/junit/platform/launcher/TestExecutionListener;)V+6 +j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+34 +j org.junit.platform.launcher.core.DelegatingLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+6 +j org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+13 +j com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs([Ljava/lang/String;Ljava/lang/String;IZ)I+203 +j com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(Z)I+17 +j com.intellij.rt.execution.junit.TestsRepeater.repeat(IZLcom/intellij/rt/execution/junit/TestsRepeater$TestRun;)I+7 +j com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(Lcom/intellij/rt/junit/IdeaTestRunner;[Ljava/lang/String;Ljava/util/ArrayList;Ljava/lang/String;IZ)I+25 +j com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart([Ljava/lang/String;Ljava/lang/String;Ljava/util/ArrayList;Ljava/lang/String;)I+117 +j com.intellij.rt.junit.JUnitStarter.main([Ljava/lang/String;)V+97 +v ~StubRoutines::call_stub 0x0000000112680154 +...... +Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) +v ~RuntimeStub::nep_invoker_blob 0x00000001127a650c +j java.lang.invoke.LambdaForm$MH+0x00000ffc001d0400.invoke(Ljava/lang/Object;JJJ)J+12 java.base@22.0.1 +j java.lang.invoke.LambdaForm$MH+0x00000ffc001d3000.invokeExact_MT(Ljava/lang/Object;JJJLjava/lang/Object;)J+23 java.base@22.0.1 +j jdk.internal.foreign.abi.DowncallStub+0x00000ffc001d1000.invoke(Ljava/lang/foreign/SegmentAllocator;Ljava/lang/foreign/MemorySegment;Ljava/lang/foreign/MemorySegment;)Ljava/lang/foreign/MemorySegment;+69 java.base@22.0.1 +j java.lang.invoke.LambdaForm$DMH+0x00000ffc001d1400.invokeStaticInit(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+14 java.base@22.0.1 +j java.lang.invoke.LambdaForm$MH+0x00000ffc001d2400.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+44 java.base@22.0.1 +j java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+19 java.base@22.0.1 +j dev.diplomattest.somelib.ntv.somelib_h.Float64Vec_new_isize(Ljava/lang/foreign/MemorySegment;)Ljava/lang/foreign/MemorySegment;+26 +j dev.diplomattest.somelib.Float64Vec.newIsize([J)Ldev/diplomattest/somelib/Float64Vec;+38 +j dev.diplomattest.somelib.Float64VecTest.testFloat64Vec()V+53 +j java.lang.invoke.LambdaForm$DMH+0x00000ffc00140c00.invokeVirtual(Ljava/lang/Object;Ljava/lang/Object;)V+10 java.base@22.0.1 +j java.lang.invoke.LambdaForm$MH+0x00000ffc00148400.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+31 java.base@22.0.1 +j java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+19 java.base@22.0.1 +j jdk.internal.reflect.DirectMethodHandleAccessor.invokeImpl(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+41 java.base@22.0.1 +j jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+23 java.base@22.0.1 +j java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+102 java.base@22.0.1 +j org.junit.platform.commons.util.ReflectionUtils.invokeMethod(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+42 +j org.junit.jupiter.engine.execution.MethodInvocation.proceed()Ljava/lang/Object;+16 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed()Ljava/lang/Object;+8 +j org.junit.jupiter.engine.extension.TimeoutExtension.intercept(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/TimeoutDuration;Lorg/junit/jupiter/engine/extension/TimeoutExtension$TimeoutProvider;)Ljava/lang/Object;+28 +j org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/TimeoutExtension$TimeoutProvider;)Ljava/lang/Object;+31 +j org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)V+9 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda+0x00000ffc00117998.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)V+5 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall$VoidMethodInterceptorCall;Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)Ljava/lang/Void;+6 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall$$Lambda+0x00000ffc00117da8.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)Ljava/lang/Object;+9 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+6 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$$Lambda+0x00000ffc001465f0.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+14 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed()Ljava/lang/Object;+12 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+1 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/engine/execution/InvocationInterceptorChain$InterceptorCall;Ljava/util/List;)Ljava/lang/Object;+24 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InvocationInterceptorChain$InterceptorCall;)Ljava/lang/Object;+31 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;)Ljava/lang/Object;+15 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(Ljava/lang/reflect/Method;Ljava/lang/Object;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;)Ljava/lang/Object;+55 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;)V+28 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda+0x00000ffc00142aa8.execute()V+12 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)V+21 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;+44 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;+6 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+79 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00000ffc00136220.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00000ffc00136000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 +j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00000ffc00133bc0.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService$$Lambda+0x00000ffc00136d10.accept(Ljava/lang/Object;)V+4 +j java.util.ArrayList.forEach(Ljava/util/function/Consumer;)V+46 java.base@22.0.1 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(Ljava/util/List;)V+6 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+116 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00000ffc00136220.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00000ffc00136000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 +j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00000ffc00133bc0.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService$$Lambda+0x00000ffc00136d10.accept(Ljava/lang/Object;)V+4 +j java.util.ArrayList.forEach(Ljava/util/function/Consumer;)V+46 java.base@22.0.1 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(Ljava/util/List;)V+6 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+116 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00000ffc00136220.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00000ffc00136000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 +j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00000ffc00133bc0.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(Lorg/junit/platform/engine/support/hierarchical/HierarchicalTestExecutorService$TestTask;)Ljava/util/concurrent/Future;+1 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute()Ljava/util/concurrent/Future;+74 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(Lorg/junit/platform/engine/ExecutionRequest;)V+31 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/engine/TestDescriptor;Lorg/junit/platform/engine/EngineExecutionListener;Lorg/junit/platform/engine/ConfigurationParameters;Lorg/junit/platform/engine/TestEngine;)V+24 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/LauncherDiscoveryResult;Lorg/junit/platform/engine/EngineExecutionListener;)V+115 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;Lorg/junit/platform/engine/EngineExecutionListener;Lorg/junit/platform/launcher/TestExecutionListener;)V+55 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(Lorg/junit/platform/launcher/core/InternalTestPlan;Lorg/junit/platform/launcher/TestExecutionListener;)V+6 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator$$Lambda+0x00000ffc00120000.accept(Ljava/lang/Object;)V+12 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(Lorg/junit/platform/engine/ConfigurationParameters;Lorg/junit/platform/launcher/core/ListenerRegistry;Ljava/util/function/Consumer;)V+51 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;[Lorg/junit/platform/launcher/TestExecutionListener;)V+23 +j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;[Lorg/junit/platform/launcher/TestExecutionListener;)V+6 +j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+34 +j org.junit.platform.launcher.core.DelegatingLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+6 +j org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+13 +j com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs([Ljava/lang/String;Ljava/lang/String;IZ)I+203 +j com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(Z)I+17 +j com.intellij.rt.execution.junit.TestsRepeater.repeat(IZLcom/intellij/rt/execution/junit/TestsRepeater$TestRun;)I+7 +j com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(Lcom/intellij/rt/junit/IdeaTestRunner;[Ljava/lang/String;Ljava/util/ArrayList;Ljava/lang/String;IZ)I+25 +j com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart([Ljava/lang/String;Ljava/lang/String;Ljava/util/ArrayList;Ljava/lang/String;)I+117 +j com.intellij.rt.junit.JUnitStarter.main([Ljava/lang/String;)V+97 +v ~StubRoutines::call_stub 0x0000000112680154 + +siginfo: si_signo: 11 (SIGSEGV), si_code: 2 (SEGV_ACCERR), si_addr: 0x0000000000000001 + +Registers: + x0=0x0000600001d51680 x1=0x00000000cf0f8969 x2=0x0000000000000010 x3=0x0000000000000000 + x4=0x0000000000000002 x5=0x0000000000001680 x6=0x0000600001d51680 x7=0x0000000000000eb0 + x8=0x0000000000000000 x9=0x0000000000000000 x10=0x00003cf8d0890000 x11=0x0000000000000010 +x12=0x0000600001d6d474 x13=0x00000000001ff800 x14=0x00000000000007fb x15=0x00000000cf0f8969 +x16=0x0000000000000168 x17=0x00000000cf2f87fb x18=0x0000000000000000 x19=0x0000000000000010 +x20=0x0000000000000002 x21=0x0000600001d51680 x22=0x0000000101a04141 x23=0x0000000000000001 +x24=0x000000016fc6b9b8 x25=0x00000000fd948000 x26=0x0000000122d1fc08 x27=0x0000000000000000 +x28=0x0000000131818400 fp=0x000000016fc6b8a0 lr=0x00000001019b9a7c sp=0x000000016fc6b870 +pc=0x00000001019b9aec cpsr=0x0000000080001000 + +Register to memory mapping: + +x0 =0x0000600001d51680 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00 +x1 =0x00000000cf0f8969 is an unknown value +x2 =0x0000000000000010 is an unknown value +x3 =0x0 is null +x4 =0x0000000000000002 is an unknown value +x5 =0x0000000000001680 is an unknown value +x6 =0x0000600001d51680 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00 +x7 =0x0000000000000eb0 is an unknown value +x8 =0x0 is null +x9 =0x0 is null +x10=0x00003cf8d0890000 is an unknown value +x11=0x0000000000000010 is an unknown value +x12=0x0000600001d6d474 points into unknown readable memory: fb 87 2f cf +x13=0x00000000001ff800 is an unknown value +x14=0x00000000000007fb is an unknown value +x15=0x00000000cf0f8969 is an unknown value +x16=0x0000000000000168 is an unknown value +x17=0x00000000cf2f87fb is an unknown value +x18=0x0 is null +x19=0x0000000000000010 is an unknown value +x20=0x0000000000000002 is an unknown value +x21=0x0000600001d51680 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00 +x22=0x0000000101a04141: __rust_no_alloc_shim_is_unstable+0 in /Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/libsomelib.dylib at 0x00000001019b4000 +x23=0x0000000000000001 is an unknown value +x24=0x000000016fc6b9b8 is pointing into the stack for thread: 0x0000000131818400 +x25=0x00000000fd948000 is an unknown value +x26=0x0000000122d1fc08 is pointing into metadata +x27=0x0 is null +x28=0x0000000131818400 is a thread + fp=0x000000016fc6b8a0 is pointing into the stack for thread: 0x0000000131818400 + lr=0x00000001019b9a7c: Float64Vec_new_isize+0x44 in /Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/libsomelib.dylib at 0x00000001019b4000 + sp=0x000000016fc6b870 is pointing into the stack for thread: 0x0000000131818400 + +Top of Stack: (sp=0x000000016fc6b870) +0x000000016fc6b870: 000000016fc6b9b8 000000070eb0b188 +0x000000016fc6b880: 0000000122d1fa54 00000001028092b0 +0x000000016fc6b890: 000000016fc6b8e8 000000016fc6b8d0 +0x000000016fc6b8a0: 000000016fc6b8c0 00000001127a653c +0x000000016fc6b8b0: 000000016fc6b970 a51d000112699844 +0x000000016fc6b8c0: 000000016fc6b970 00000001126857a8 +0x000000016fc6b8d0: 000000070e6cdad8 fffffffffffffff2 +0x000000016fc6b8e0: 0000000000000000 000000070e600220 +0x000000016fc6b8f0: 0000000000000002 0000000000000000 +0x000000016fc6b900: 0000000000000001 0000000000000000 +0x000000016fc6b910: 00000001019b9a38 0000000000000000 +0x000000016fc6b920: fffffffffffffff6 0000000122d1fa54 +0x000000016fc6b930: 0000000000000009 0000000122d1fc08 +0x000000016fc6b940: 000000070e6200b8 ffffffffffffffec +0x000000016fc6b950: 0000000000000000 0000000122d1fa60 +0x000000016fc6b960: ffffffffffffffef 000000016fc6b970 +0x000000016fc6b970: 000000016fc6ba10 00000001126857a8 +0x000000016fc6b980: 000000070e600220 0000000000000002 +0x000000016fc6b990: 0000000000000000 0000000000000001 +0x000000016fc6b9a0: 0000000000000000 00000001019b9a38 +0x000000016fc6b9b0: 0000000000000000 000000070e600110 +0x000000016fc6b9c0: fffffffffffffff6 0000000122d2529f +0x000000016fc6b9d0: 0000000000000009 0000000122d25470 +0x000000016fc6b9e0: 000000070ff2c2c8 ffffffffffffffec +0x000000016fc6b9f0: 0000000000000000 0000000122d252b0 +0x000000016fc6ba00: ffffffffffffffef 000000016fc6ba10 +0x000000016fc6ba10: 000000016fc6bab0 00000001126857a8 +0x000000016fc6ba20: 000000070e6001f8 0000000000000002 +0x000000016fc6ba30: 0000000000000000 0000000000000001 +0x000000016fc6ba40: 0000000000000000 00000001019b9a38 +0x000000016fc6ba50: 0000000000000000 000000070e600110 +0x000000016fc6ba60: fffffffffffffff6 0000000122d21465 + +Instructions: (pc=0x00000001019b9aec) +0x00000001019b99ec: f6 57 41 a9 f8 5f c4 a8 c0 03 5f d6 00 01 80 52 +0x00000001019b99fc: 01 03 80 52 c7 d9 00 94 20 00 20 d4 16 00 80 d2 +0x00000001019b9a0c: e0 03 16 aa e1 03 15 aa bd d9 00 94 f5 03 00 aa +0x00000001019b9a1c: b3 00 00 b4 61 f2 7d d3 e0 03 14 aa 02 01 80 52 +0x00000001019b9a2c: 3a 03 00 94 e0 03 15 aa 54 db 00 94 f8 5f bc a9 +0x00000001019b9a3c: f6 57 01 a9 f4 4f 02 a9 fd 7b 03 a9 fd c3 00 91 +0x00000001019b9a4c: f4 03 01 aa 15 01 80 52 3f 00 00 f1 b7 02 80 9a +0x00000001019b9a5c: 33 f0 7d d3 56 02 00 f0 d6 06 05 91 e1 04 00 b4 +0x00000001019b9a6c: df 02 40 39 e0 03 13 aa 01 01 80 52 26 03 00 94 +0x00000001019b9a7c: 40 06 00 b4 f5 03 00 aa 08 00 80 d2 9f 22 00 f1 +0x00000001019b9a8c: e3 02 00 54 a9 02 17 cb 3f 01 01 f1 83 02 00 54 +0x00000001019b9a9c: 09 00 80 d2 88 f2 7d 92 ea 82 00 91 eb 03 08 aa +0x00000001019b9aac: 4c 01 09 8b 80 05 7f ad 82 0d 40 ad 00 d8 61 4e +0x00000001019b9abc: 21 d8 61 4e 42 d8 61 4e 63 d8 61 4e ac 02 09 8b +0x00000001019b9acc: 80 05 00 ad 82 0d 01 ad 29 01 01 91 6b 21 00 f1 +0x00000001019b9adc: 81 fe ff 54 1f 01 14 eb 00 01 00 54 09 f1 7d d3 +0x00000001019b9aec: e0 6a 69 fc 00 d8 61 5e a0 6a 29 fc 08 05 00 91 +0x00000001019b9afc: 9f 02 08 eb 41 ff ff 54 df 02 40 39 00 03 80 52 +0x00000001019b9b0c: 01 01 80 52 00 03 00 94 00 01 00 b4 14 54 00 a9 +0x00000001019b9b1c: 14 08 00 f9 fd 7b 43 a9 f4 4f 42 a9 f6 57 41 a9 +0x00000001019b9b2c: f8 5f c4 a8 c0 03 5f d6 00 01 80 52 01 03 80 52 +0x00000001019b9b3c: 78 d9 00 94 20 00 20 d4 00 01 80 52 e1 03 13 aa +0x00000001019b9b4c: 6f d9 00 94 f6 03 00 aa b4 00 00 b4 e0 03 15 aa +0x00000001019b9b5c: e1 03 13 aa 02 01 80 52 ec 02 00 94 e0 03 16 aa +0x00000001019b9b6c: 06 db 00 94 f8 5f bc a9 f6 57 01 a9 f4 4f 02 a9 +0x00000001019b9b7c: fd 7b 03 a9 fd c3 00 91 f4 03 01 aa 15 01 80 52 +0x00000001019b9b8c: 3f 00 00 f1 b7 02 80 9a 33 f0 7d d3 56 02 00 f0 +0x00000001019b9b9c: d6 06 05 91 e1 04 00 b4 df 02 40 39 e0 03 13 aa +0x00000001019b9bac: 01 01 80 52 d8 02 00 94 40 06 00 b4 f5 03 00 aa +0x00000001019b9bbc: 08 00 80 d2 9f 22 00 f1 e3 02 00 54 a9 02 17 cb +0x00000001019b9bcc: 3f 01 01 f1 83 02 00 54 09 00 80 d2 88 f2 7d 92 +0x00000001019b9bdc: ea 82 00 91 eb 03 08 aa 4c 01 09 8b 80 05 7f ad + + +Stack slot to memory mapping: + +stack at sp + 0 slots: 0x000000016fc6b9b8 is pointing into the stack for thread: 0x0000000131818400 +stack at sp + 1 slots: 0x000000070eb0b188 is an oop: jdk.internal.org.objectweb.asm.SymbolTable$Entry +{0x000000070eb0b188} - klass: 'jdk/internal/org/objectweb/asm/SymbolTable$Entry' + - ---- fields (total size 7 words): + - final 'index' 'I' @12 45 (0x0000002d) + - final 'data' 'J' @16 0 (0x0000000000000000) + - final 'tag' 'I' @24 1 (0x00000001) + - 'info' 'I' @28 0 (0x00000000) + - final 'owner' 'Ljava/lang/String;' @32 null (0x00000000) + - final 'name' 'Ljava/lang/String;' @36 null (0x00000000) + - final 'value' 'Ljava/lang/String;' @40 "SourceFile"{0x000000070fe74df0} (0xe1fce9be) + - final 'hashCode' 'I' @44 881600600 (0x348c2858) + - 'next' 'Ljdk/internal/org/objectweb/asm/SymbolTable$Entry;' @48 null (0x00000000) +stack at sp + 2 slots: 0x0000000122d1fa54 is pointing into metadata +stack at sp + 3 slots: 0x00000001028092b0: _ZN19TemplateInterpreter13_active_tableE+0 in /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/server/libjvm.dylib at 0x0000000101ab4000 +stack at sp + 4 slots: 0x000000016fc6b8e8 is pointing into the stack for thread: 0x0000000131818400 +stack at sp + 5 slots: 0x000000016fc6b8d0 is pointing into the stack for thread: 0x0000000131818400 +stack at sp + 6 slots: 0x000000016fc6b8c0 is pointing into the stack for thread: 0x0000000131818400 +stack at sp + 7 slots: 0x00000001127a653c is at code_begin+60 in +[CodeBlob (0x00000001127a6490)] +Framesize: 4 +Runtime Stub (0x00000001127a6490): nep_invoker_blob +-------------------------------------------------------------------------------- +Decoding CodeBlob, name: nep_invoker_blob, at [0x00000001127a6500, 0x00000001127a65d0] 208 bytes +[MachCode] + 0x00000001127a6500: fd7b bfa9 | fd03 0091 | bf43 00d1 | 0900 0010 | 89d7 01f9 | e903 0091 | 89d3 01f9 | 9ddb 01f9 + 0x00000001127a6520: e903 7eb2 | 8a53 1191 | 49fd 9f88 | e903 01aa | e103 03aa | e003 02aa | 2001 3fd6 | a900 80d2 + 0x00000001127a6540: 8957 04b9 | bf3b 03d5 | 8963 1191 | 29fd dfc8 | bf03 09eb | e801 0054 | 8953 44b9 | a901 0035 + 0x00000001127a6560: e903 7db2 | 8a53 1191 | 49fd 9f88 | 8943 5339 | 3f09 0071 | e001 0054 | 9fd3 01f9 | 9fdb 01f9 + 0x00000001127a6580: 9fd7 01f9 | bf03 0091 | fd7b c1a8 | c003 5fd6 | e003 00f9 | e003 1caa | 897d 94d2 | e93e a0f2 + 0x00000001127a65a0: 2900 c0f2 | 2001 3fd6 | e003 40f9 | edff ff17 | e003 00f9 | 0919 8dd2 | 0947 a0f2 | 2900 c0f2 + 0x00000001127a65c0: 2001 3fd6 | e003 40f9 | ecff ff17 | 0000 0000 +[/MachCode] +-------------------------------------------------------------------------------- + +-------------------------------------------------------------------------------- +Decoding CodeBlob, name: nep_invoker_blob, at [0x00000001127a6500, 0x00000001127a65d0] 208 bytes +[MachCode] + 0x00000001127a6500: fd7b bfa9 | fd03 0091 | bf43 00d1 | 0900 0010 | 89d7 01f9 | e903 0091 | 89d3 01f9 | 9ddb 01f9 + 0x00000001127a6520: e903 7eb2 | 8a53 1191 | 49fd 9f88 | e903 01aa | e103 03aa | e003 02aa | 2001 3fd6 | a900 80d2 + 0x00000001127a6540: 8957 04b9 | bf3b 03d5 | 8963 1191 | 29fd dfc8 | bf03 09eb | e801 0054 | 8953 44b9 | a901 0035 + 0x00000001127a6560: e903 7db2 | 8a53 1191 | 49fd 9f88 | 8943 5339 | 3f09 0071 | e001 0054 | 9fd3 01f9 | 9fdb 01f9 + 0x00000001127a6580: 9fd7 01f9 | bf03 0091 | fd7b c1a8 | c003 5fd6 | e003 00f9 | e003 1caa | 897d 94d2 | e93e a0f2 + 0x00000001127a65a0: 2900 c0f2 | 2001 3fd6 | e003 40f9 | edff ff17 | e003 00f9 | 0919 8dd2 | 0947 a0f2 | 2900 c0f2 + 0x00000001127a65c0: 2001 3fd6 | e003 40f9 | ecff ff17 | 0000 0000 +[/MachCode] +-------------------------------------------------------------------------------- + + +--------------- P R O C E S S --------------- + +Threads class SMR info: +_java_thread_list=0x0000600001f62400, length=13, elements={ +0x0000000131818400, 0x0000000120810800, 0x0000000120812000, 0x0000000142009a00, +0x000000014200a200, 0x0000000142017000, 0x0000000142017800, 0x0000000142018000, +0x0000000142038800, 0x00000001420b2e00, 0x00000001420b3600, 0x00000001420b3e00, +0x000000014180e600 +} + +Java Threads: ( => current thread ) +=>0x0000000131818400 JavaThread "main" [_thread_in_native, id=10499, stack(0x000000016fa6c000,0x000000016fc6f000) (2060K)] + 0x0000000120810800 JavaThread "Reference Handler" daemon [_thread_blocked, id=28675, stack(0x0000000170be4000,0x0000000170de7000) (2060K)] + 0x0000000120812000 JavaThread "Finalizer" daemon [_thread_blocked, id=28419, stack(0x0000000170df0000,0x0000000170ff3000) (2060K)] + 0x0000000142009a00 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=24067, stack(0x0000000170ffc000,0x00000001711ff000) (2060K)] + 0x000000014200a200 JavaThread "Service Thread" daemon [_thread_blocked, id=24579, stack(0x0000000171208000,0x000000017140b000) (2060K)] + 0x0000000142017000 JavaThread "Monitor Deflation Thread" daemon [_thread_blocked, id=27907, stack(0x0000000171414000,0x0000000171617000) (2060K)] + 0x0000000142017800 JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=25347, stack(0x0000000171620000,0x0000000171823000) (2060K)] + 0x0000000142018000 JavaThread "C1 CompilerThread0" daemon [_thread_in_vm, id=27395, stack(0x000000017182c000,0x0000000171a2f000) (2060K)] + 0x0000000142038800 JavaThread "Common-Cleaner" daemon [_thread_blocked, id=27139, stack(0x0000000171a38000,0x0000000171c3b000) (2060K)] + 0x00000001420b2e00 JavaThread "JDWP Transport Listener: dt_socket" daemon [_thread_blocked, id=25859, stack(0x0000000171c44000,0x0000000171e47000) (2060K)] + 0x00000001420b3600 JavaThread "JDWP Event Helper Thread" daemon [_thread_blocked, id=26371, stack(0x0000000171e50000,0x0000000172053000) (2060K)] + 0x00000001420b3e00 JavaThread "JDWP Command Reader" daemon [_thread_in_native, id=32771, stack(0x000000017205c000,0x000000017225f000) (2060K)] + 0x000000014180e600 JavaThread "Notification Thread" daemon [_thread_blocked, id=33283, stack(0x0000000172268000,0x000000017246b000) (2060K)] +Total: 13 + +Other Threads: + 0x0000000121605040 VMThread "VM Thread" [id=19459, stack(0x00000001708c0000,0x0000000170ac3000) (2060K)] + 0x000000013160b950 WatcherThread "VM Periodic Task Thread" [id=20995, stack(0x00000001706b4000,0x00000001708b7000) (2060K)] + 0x0000000131606f80 WorkerThread "GC Thread#0" [id=14083, stack(0x000000016fc78000,0x000000016fe7b000) (2060K)] + 0x000000014172b590 WorkerThread "GC Thread#1" [id=33539, stack(0x0000000172474000,0x0000000172677000) (2060K)] + 0x000000014172bb00 WorkerThread "GC Thread#2" [id=43011, stack(0x0000000172680000,0x0000000172883000) (2060K)] + 0x000000014172c070 WorkerThread "GC Thread#3" [id=42755, stack(0x000000017288c000,0x0000000172a8f000) (2060K)] + 0x0000000131630bb0 WorkerThread "GC Thread#4" [id=42499, stack(0x0000000172a98000,0x0000000172c9b000) (2060K)] + 0x000000014163a2f0 WorkerThread "GC Thread#5" [id=34819, stack(0x0000000172ca4000,0x0000000172ea7000) (2060K)] + 0x000000014163a690 WorkerThread "GC Thread#6" [id=35075, stack(0x0000000172eb0000,0x00000001730b3000) (2060K)] + 0x000000014163ac00 WorkerThread "GC Thread#7" [id=35587, stack(0x00000001730bc000,0x00000001732bf000) (2060K)] + 0x0000000131607720 ConcurrentGCThread "G1 Main Marker" [id=13571, stack(0x000000016fe84000,0x0000000170087000) (2060K)] + 0x00000001316080a0 WorkerThread "G1 Conc#0" [id=13059, stack(0x0000000170090000,0x0000000170293000) (2060K)] + 0x00000001318a0e00 ConcurrentGCThread "G1 Refine#0" [id=16643, stack(0x000000017029c000,0x000000017049f000) (2060K)] + 0x000000013160a5c0 ConcurrentGCThread "G1 Service" [id=17155, stack(0x00000001704a8000,0x00000001706ab000) (2060K)] +Total: 14 + +Threads with active compile tasks: +C2 CompilerThread0 3063 1240 4 jdk.internal.org.objectweb.asm.SymbolTable::addConstantUtf8Reference (101 bytes) +C1 CompilerThread0 3063 1250 3 jdk.internal.classfile.impl.StackMapGenerator::processBlock (2767 bytes) +Total: 2 + +VM state: not at safepoint (normal execution) + +VM Mutex/Monitor currently owned by a thread: ([mutex/lock_event]) +[0x00000001028727d8] MethodCompileQueue_lock - owner thread: 0x0000000142018000 +[0x0000000102873198] CodeCache_lock - owner thread: 0x0000000142018000 +[0x0000000102873258] Compile_lock - owner thread: 0x0000000142018000 + +Heap address: 0x0000000700000000, size: 4096 MB, Compressed Oops mode: Zero based, Oop shift amount: 3 + +CDS archive(s) not mapped +Compressed class space mapped at: 0x00000ffc00000000-0x00000ffc40000000, reserved size: 1073741824 +Narrow klass base: 0x00000ffc00000000, Narrow klass shift: 0, Narrow klass range: 0x40000000 + +GC Precious Log: + CardTable entry size: 512 + Card Set container configuration: InlinePtr #cards 4 size 8 Array Of Cards #cards 16 size 48 Howl #buckets 8 coarsen threshold 3686 Howl Bitmap #cards 512 size 80 coarsen threshold 460 Card regions per heap region 1 cards per card region 4096 + CPUs: 8 total, 8 available + Memory: 16384M + Large Page Support: Disabled + NUMA Support: Disabled + Compressed Oops: Enabled (Zero based) + Heap Region Size: 2M + Heap Min Capacity: 8M + Heap Initial Capacity: 256M + Heap Max Capacity: 4G + Pre-touch: Disabled + Parallel Workers: 8 + Concurrent Workers: 2 + Concurrent Refinement Workers: 8 + Periodic GC: Disabled + +Heap: + garbage-first heap total reserved 4194304K, committed 262144K, used 2773K [0x0000000700000000, 0x0000000800000000) + region size 2048K, 3 young (6144K), 2 survivors (4096K) + Metaspace used 15174K, committed 15552K, reserved 1114112K + class space used 1680K, committed 1856K, reserved 1048576K + +Heap Regions: E=young(eden), S=young(survivor), O=old, HS=humongous(starts), HC=humongous(continues), CS=collection set, F=free, TAMS=top-at-mark-start, PB=parsable bottom +| 0|0x0000000700000000, 0x0000000700000000, 0x0000000700200000| 0%| F| |TAMS 0x0000000700000000| PB 0x0000000700000000| Untracked | 0 +| 1|0x0000000700200000, 0x0000000700200000, 0x0000000700400000| 0%| F| |TAMS 0x0000000700200000| PB 0x0000000700200000| Untracked | 0 +| 2|0x0000000700400000, 0x0000000700400000, 0x0000000700600000| 0%| F| |TAMS 0x0000000700400000| PB 0x0000000700400000| Untracked | 0 +| 3|0x0000000700600000, 0x0000000700600000, 0x0000000700800000| 0%| F| |TAMS 0x0000000700600000| PB 0x0000000700600000| Untracked | 0 +| 4|0x0000000700800000, 0x0000000700800000, 0x0000000700a00000| 0%| F| |TAMS 0x0000000700800000| PB 0x0000000700800000| Untracked | 0 +| 5|0x0000000700a00000, 0x0000000700a00000, 0x0000000700c00000| 0%| F| |TAMS 0x0000000700a00000| PB 0x0000000700a00000| Untracked | 0 +| 6|0x0000000700c00000, 0x0000000700c00000, 0x0000000700e00000| 0%| F| |TAMS 0x0000000700c00000| PB 0x0000000700c00000| Untracked | 0 +| 7|0x0000000700e00000, 0x0000000700e00000, 0x0000000701000000| 0%| F| |TAMS 0x0000000700e00000| PB 0x0000000700e00000| Untracked | 0 +| 8|0x0000000701000000, 0x0000000701000000, 0x0000000701200000| 0%| F| |TAMS 0x0000000701000000| PB 0x0000000701000000| Untracked | 0 +| 9|0x0000000701200000, 0x0000000701200000, 0x0000000701400000| 0%| F| |TAMS 0x0000000701200000| PB 0x0000000701200000| Untracked | 0 +| 10|0x0000000701400000, 0x0000000701400000, 0x0000000701600000| 0%| F| |TAMS 0x0000000701400000| PB 0x0000000701400000| Untracked | 0 +| 11|0x0000000701600000, 0x0000000701600000, 0x0000000701800000| 0%| F| |TAMS 0x0000000701600000| PB 0x0000000701600000| Untracked | 0 +| 12|0x0000000701800000, 0x0000000701800000, 0x0000000701a00000| 0%| F| |TAMS 0x0000000701800000| PB 0x0000000701800000| Untracked | 0 +| 13|0x0000000701a00000, 0x0000000701a00000, 0x0000000701c00000| 0%| F| |TAMS 0x0000000701a00000| PB 0x0000000701a00000| Untracked | 0 +| 14|0x0000000701c00000, 0x0000000701c00000, 0x0000000701e00000| 0%| F| |TAMS 0x0000000701c00000| PB 0x0000000701c00000| Untracked | 0 +| 15|0x0000000701e00000, 0x0000000701e00000, 0x0000000702000000| 0%| F| |TAMS 0x0000000701e00000| PB 0x0000000701e00000| Untracked | 0 +| 16|0x0000000702000000, 0x0000000702000000, 0x0000000702200000| 0%| F| |TAMS 0x0000000702000000| PB 0x0000000702000000| Untracked | 0 +| 17|0x0000000702200000, 0x0000000702200000, 0x0000000702400000| 0%| F| |TAMS 0x0000000702200000| PB 0x0000000702200000| Untracked | 0 +| 18|0x0000000702400000, 0x0000000702400000, 0x0000000702600000| 0%| F| |TAMS 0x0000000702400000| PB 0x0000000702400000| Untracked | 0 +| 19|0x0000000702600000, 0x0000000702600000, 0x0000000702800000| 0%| F| |TAMS 0x0000000702600000| PB 0x0000000702600000| Untracked | 0 +| 20|0x0000000702800000, 0x0000000702800000, 0x0000000702a00000| 0%| F| |TAMS 0x0000000702800000| PB 0x0000000702800000| Untracked | 0 +| 21|0x0000000702a00000, 0x0000000702a00000, 0x0000000702c00000| 0%| F| |TAMS 0x0000000702a00000| PB 0x0000000702a00000| Untracked | 0 +| 22|0x0000000702c00000, 0x0000000702c00000, 0x0000000702e00000| 0%| F| |TAMS 0x0000000702c00000| PB 0x0000000702c00000| Untracked | 0 +| 23|0x0000000702e00000, 0x0000000702e00000, 0x0000000703000000| 0%| F| |TAMS 0x0000000702e00000| PB 0x0000000702e00000| Untracked | 0 +| 24|0x0000000703000000, 0x0000000703000000, 0x0000000703200000| 0%| F| |TAMS 0x0000000703000000| PB 0x0000000703000000| Untracked | 0 +| 25|0x0000000703200000, 0x0000000703200000, 0x0000000703400000| 0%| F| |TAMS 0x0000000703200000| PB 0x0000000703200000| Untracked | 0 +| 26|0x0000000703400000, 0x0000000703400000, 0x0000000703600000| 0%| F| |TAMS 0x0000000703400000| PB 0x0000000703400000| Untracked | 0 +| 27|0x0000000703600000, 0x0000000703600000, 0x0000000703800000| 0%| F| |TAMS 0x0000000703600000| PB 0x0000000703600000| Untracked | 0 +| 28|0x0000000703800000, 0x0000000703800000, 0x0000000703a00000| 0%| F| |TAMS 0x0000000703800000| PB 0x0000000703800000| Untracked | 0 +| 29|0x0000000703a00000, 0x0000000703a00000, 0x0000000703c00000| 0%| F| |TAMS 0x0000000703a00000| PB 0x0000000703a00000| Untracked | 0 +| 30|0x0000000703c00000, 0x0000000703c00000, 0x0000000703e00000| 0%| F| |TAMS 0x0000000703c00000| PB 0x0000000703c00000| Untracked | 0 +| 31|0x0000000703e00000, 0x0000000703e00000, 0x0000000704000000| 0%| F| |TAMS 0x0000000703e00000| PB 0x0000000703e00000| Untracked | 0 +| 32|0x0000000704000000, 0x0000000704000000, 0x0000000704200000| 0%| F| |TAMS 0x0000000704000000| PB 0x0000000704000000| Untracked | 0 +| 33|0x0000000704200000, 0x0000000704200000, 0x0000000704400000| 0%| F| |TAMS 0x0000000704200000| PB 0x0000000704200000| Untracked | 0 +| 34|0x0000000704400000, 0x0000000704400000, 0x0000000704600000| 0%| F| |TAMS 0x0000000704400000| PB 0x0000000704400000| Untracked | 0 +| 35|0x0000000704600000, 0x0000000704600000, 0x0000000704800000| 0%| F| |TAMS 0x0000000704600000| PB 0x0000000704600000| Untracked | 0 +| 36|0x0000000704800000, 0x0000000704800000, 0x0000000704a00000| 0%| F| |TAMS 0x0000000704800000| PB 0x0000000704800000| Untracked | 0 +| 37|0x0000000704a00000, 0x0000000704a00000, 0x0000000704c00000| 0%| F| |TAMS 0x0000000704a00000| PB 0x0000000704a00000| Untracked | 0 +| 38|0x0000000704c00000, 0x0000000704c00000, 0x0000000704e00000| 0%| F| |TAMS 0x0000000704c00000| PB 0x0000000704c00000| Untracked | 0 +| 39|0x0000000704e00000, 0x0000000704e00000, 0x0000000705000000| 0%| F| |TAMS 0x0000000704e00000| PB 0x0000000704e00000| Untracked | 0 +| 40|0x0000000705000000, 0x0000000705000000, 0x0000000705200000| 0%| F| |TAMS 0x0000000705000000| PB 0x0000000705000000| Untracked | 0 +| 41|0x0000000705200000, 0x0000000705200000, 0x0000000705400000| 0%| F| |TAMS 0x0000000705200000| PB 0x0000000705200000| Untracked | 0 +| 42|0x0000000705400000, 0x0000000705400000, 0x0000000705600000| 0%| F| |TAMS 0x0000000705400000| PB 0x0000000705400000| Untracked | 0 +| 43|0x0000000705600000, 0x0000000705600000, 0x0000000705800000| 0%| F| |TAMS 0x0000000705600000| PB 0x0000000705600000| Untracked | 0 +| 44|0x0000000705800000, 0x0000000705800000, 0x0000000705a00000| 0%| F| |TAMS 0x0000000705800000| PB 0x0000000705800000| Untracked | 0 +| 45|0x0000000705a00000, 0x0000000705a00000, 0x0000000705c00000| 0%| F| |TAMS 0x0000000705a00000| PB 0x0000000705a00000| Untracked | 0 +| 46|0x0000000705c00000, 0x0000000705c00000, 0x0000000705e00000| 0%| F| |TAMS 0x0000000705c00000| PB 0x0000000705c00000| Untracked | 0 +| 47|0x0000000705e00000, 0x0000000705e00000, 0x0000000706000000| 0%| F| |TAMS 0x0000000705e00000| PB 0x0000000705e00000| Untracked | 0 +| 48|0x0000000706000000, 0x0000000706000000, 0x0000000706200000| 0%| F| |TAMS 0x0000000706000000| PB 0x0000000706000000| Untracked | 0 +| 49|0x0000000706200000, 0x0000000706200000, 0x0000000706400000| 0%| F| |TAMS 0x0000000706200000| PB 0x0000000706200000| Untracked | 0 +| 50|0x0000000706400000, 0x0000000706400000, 0x0000000706600000| 0%| F| |TAMS 0x0000000706400000| PB 0x0000000706400000| Untracked | 0 +| 51|0x0000000706600000, 0x0000000706600000, 0x0000000706800000| 0%| F| |TAMS 0x0000000706600000| PB 0x0000000706600000| Untracked | 0 +| 52|0x0000000706800000, 0x0000000706800000, 0x0000000706a00000| 0%| F| |TAMS 0x0000000706800000| PB 0x0000000706800000| Untracked | 0 +| 53|0x0000000706a00000, 0x0000000706a00000, 0x0000000706c00000| 0%| F| |TAMS 0x0000000706a00000| PB 0x0000000706a00000| Untracked | 0 +| 54|0x0000000706c00000, 0x0000000706c00000, 0x0000000706e00000| 0%| F| |TAMS 0x0000000706c00000| PB 0x0000000706c00000| Untracked | 0 +| 55|0x0000000706e00000, 0x0000000706e00000, 0x0000000707000000| 0%| F| |TAMS 0x0000000706e00000| PB 0x0000000706e00000| Untracked | 0 +| 56|0x0000000707000000, 0x0000000707000000, 0x0000000707200000| 0%| F| |TAMS 0x0000000707000000| PB 0x0000000707000000| Untracked | 0 +| 57|0x0000000707200000, 0x0000000707200000, 0x0000000707400000| 0%| F| |TAMS 0x0000000707200000| PB 0x0000000707200000| Untracked | 0 +| 58|0x0000000707400000, 0x0000000707400000, 0x0000000707600000| 0%| F| |TAMS 0x0000000707400000| PB 0x0000000707400000| Untracked | 0 +| 59|0x0000000707600000, 0x0000000707600000, 0x0000000707800000| 0%| F| |TAMS 0x0000000707600000| PB 0x0000000707600000| Untracked | 0 +| 60|0x0000000707800000, 0x0000000707800000, 0x0000000707a00000| 0%| F| |TAMS 0x0000000707800000| PB 0x0000000707800000| Untracked | 0 +| 61|0x0000000707a00000, 0x0000000707a00000, 0x0000000707c00000| 0%| F| |TAMS 0x0000000707a00000| PB 0x0000000707a00000| Untracked | 0 +| 62|0x0000000707c00000, 0x0000000707c00000, 0x0000000707e00000| 0%| F| |TAMS 0x0000000707c00000| PB 0x0000000707c00000| Untracked | 0 +| 63|0x0000000707e00000, 0x0000000707e00000, 0x0000000708000000| 0%| F| |TAMS 0x0000000707e00000| PB 0x0000000707e00000| Untracked | 0 +| 64|0x0000000708000000, 0x0000000708000000, 0x0000000708200000| 0%| F| |TAMS 0x0000000708000000| PB 0x0000000708000000| Untracked | 0 +| 65|0x0000000708200000, 0x0000000708200000, 0x0000000708400000| 0%| F| |TAMS 0x0000000708200000| PB 0x0000000708200000| Untracked | 0 +| 66|0x0000000708400000, 0x0000000708400000, 0x0000000708600000| 0%| F| |TAMS 0x0000000708400000| PB 0x0000000708400000| Untracked | 0 +| 67|0x0000000708600000, 0x0000000708600000, 0x0000000708800000| 0%| F| |TAMS 0x0000000708600000| PB 0x0000000708600000| Untracked | 0 +| 68|0x0000000708800000, 0x0000000708800000, 0x0000000708a00000| 0%| F| |TAMS 0x0000000708800000| PB 0x0000000708800000| Untracked | 0 +| 69|0x0000000708a00000, 0x0000000708a00000, 0x0000000708c00000| 0%| F| |TAMS 0x0000000708a00000| PB 0x0000000708a00000| Untracked | 0 +| 70|0x0000000708c00000, 0x0000000708c00000, 0x0000000708e00000| 0%| F| |TAMS 0x0000000708c00000| PB 0x0000000708c00000| Untracked | 0 +| 71|0x0000000708e00000, 0x0000000708e00000, 0x0000000709000000| 0%| F| |TAMS 0x0000000708e00000| PB 0x0000000708e00000| Untracked | 0 +| 72|0x0000000709000000, 0x0000000709000000, 0x0000000709200000| 0%| F| |TAMS 0x0000000709000000| PB 0x0000000709000000| Untracked | 0 +| 73|0x0000000709200000, 0x0000000709200000, 0x0000000709400000| 0%| F| |TAMS 0x0000000709200000| PB 0x0000000709200000| Untracked | 0 +| 74|0x0000000709400000, 0x0000000709400000, 0x0000000709600000| 0%| F| |TAMS 0x0000000709400000| PB 0x0000000709400000| Untracked | 0 +| 75|0x0000000709600000, 0x0000000709600000, 0x0000000709800000| 0%| F| |TAMS 0x0000000709600000| PB 0x0000000709600000| Untracked | 0 +| 76|0x0000000709800000, 0x0000000709800000, 0x0000000709a00000| 0%| F| |TAMS 0x0000000709800000| PB 0x0000000709800000| Untracked | 0 +| 77|0x0000000709a00000, 0x0000000709a00000, 0x0000000709c00000| 0%| F| |TAMS 0x0000000709a00000| PB 0x0000000709a00000| Untracked | 0 +| 78|0x0000000709c00000, 0x0000000709c00000, 0x0000000709e00000| 0%| F| |TAMS 0x0000000709c00000| PB 0x0000000709c00000| Untracked | 0 +| 79|0x0000000709e00000, 0x0000000709e00000, 0x000000070a000000| 0%| F| |TAMS 0x0000000709e00000| PB 0x0000000709e00000| Untracked | 0 +| 80|0x000000070a000000, 0x000000070a000000, 0x000000070a200000| 0%| F| |TAMS 0x000000070a000000| PB 0x000000070a000000| Untracked | 0 +| 81|0x000000070a200000, 0x000000070a200000, 0x000000070a400000| 0%| F| |TAMS 0x000000070a200000| PB 0x000000070a200000| Untracked | 0 +| 82|0x000000070a400000, 0x000000070a400000, 0x000000070a600000| 0%| F| |TAMS 0x000000070a400000| PB 0x000000070a400000| Untracked | 0 +| 83|0x000000070a600000, 0x000000070a600000, 0x000000070a800000| 0%| F| |TAMS 0x000000070a600000| PB 0x000000070a600000| Untracked | 0 +| 84|0x000000070a800000, 0x000000070a800000, 0x000000070aa00000| 0%| F| |TAMS 0x000000070a800000| PB 0x000000070a800000| Untracked | 0 +| 85|0x000000070aa00000, 0x000000070aa00000, 0x000000070ac00000| 0%| F| |TAMS 0x000000070aa00000| PB 0x000000070aa00000| Untracked | 0 +| 86|0x000000070ac00000, 0x000000070ac00000, 0x000000070ae00000| 0%| F| |TAMS 0x000000070ac00000| PB 0x000000070ac00000| Untracked | 0 +| 87|0x000000070ae00000, 0x000000070ae00000, 0x000000070b000000| 0%| F| |TAMS 0x000000070ae00000| PB 0x000000070ae00000| Untracked | 0 +| 88|0x000000070b000000, 0x000000070b000000, 0x000000070b200000| 0%| F| |TAMS 0x000000070b000000| PB 0x000000070b000000| Untracked | 0 +| 89|0x000000070b200000, 0x000000070b200000, 0x000000070b400000| 0%| F| |TAMS 0x000000070b200000| PB 0x000000070b200000| Untracked | 0 +| 90|0x000000070b400000, 0x000000070b400000, 0x000000070b600000| 0%| F| |TAMS 0x000000070b400000| PB 0x000000070b400000| Untracked | 0 +| 91|0x000000070b600000, 0x000000070b600000, 0x000000070b800000| 0%| F| |TAMS 0x000000070b600000| PB 0x000000070b600000| Untracked | 0 +| 92|0x000000070b800000, 0x000000070b800000, 0x000000070ba00000| 0%| F| |TAMS 0x000000070b800000| PB 0x000000070b800000| Untracked | 0 +| 93|0x000000070ba00000, 0x000000070ba00000, 0x000000070bc00000| 0%| F| |TAMS 0x000000070ba00000| PB 0x000000070ba00000| Untracked | 0 +| 94|0x000000070bc00000, 0x000000070bc00000, 0x000000070be00000| 0%| F| |TAMS 0x000000070bc00000| PB 0x000000070bc00000| Untracked | 0 +| 95|0x000000070be00000, 0x000000070be00000, 0x000000070c000000| 0%| F| |TAMS 0x000000070be00000| PB 0x000000070be00000| Untracked | 0 +| 96|0x000000070c000000, 0x000000070c000000, 0x000000070c200000| 0%| F| |TAMS 0x000000070c000000| PB 0x000000070c000000| Untracked | 0 +| 97|0x000000070c200000, 0x000000070c200000, 0x000000070c400000| 0%| F| |TAMS 0x000000070c200000| PB 0x000000070c200000| Untracked | 0 +| 98|0x000000070c400000, 0x000000070c400000, 0x000000070c600000| 0%| F| |TAMS 0x000000070c400000| PB 0x000000070c400000| Untracked | 0 +| 99|0x000000070c600000, 0x000000070c600000, 0x000000070c800000| 0%| F| |TAMS 0x000000070c600000| PB 0x000000070c600000| Untracked | 0 +| 100|0x000000070c800000, 0x000000070c800000, 0x000000070ca00000| 0%| F| |TAMS 0x000000070c800000| PB 0x000000070c800000| Untracked | 0 +| 101|0x000000070ca00000, 0x000000070ca00000, 0x000000070cc00000| 0%| F| |TAMS 0x000000070ca00000| PB 0x000000070ca00000| Untracked | 0 +| 102|0x000000070cc00000, 0x000000070cc00000, 0x000000070ce00000| 0%| F| |TAMS 0x000000070cc00000| PB 0x000000070cc00000| Untracked | 0 +| 103|0x000000070ce00000, 0x000000070ce00000, 0x000000070d000000| 0%| F| |TAMS 0x000000070ce00000| PB 0x000000070ce00000| Untracked | 0 +| 104|0x000000070d000000, 0x000000070d000000, 0x000000070d200000| 0%| F| |TAMS 0x000000070d000000| PB 0x000000070d000000| Untracked | 0 +| 105|0x000000070d200000, 0x000000070d200000, 0x000000070d400000| 0%| F| |TAMS 0x000000070d200000| PB 0x000000070d200000| Untracked | 0 +| 106|0x000000070d400000, 0x000000070d400000, 0x000000070d600000| 0%| F| |TAMS 0x000000070d400000| PB 0x000000070d400000| Untracked | 0 +| 107|0x000000070d600000, 0x000000070d600000, 0x000000070d800000| 0%| F| |TAMS 0x000000070d600000| PB 0x000000070d600000| Untracked | 0 +| 108|0x000000070d800000, 0x000000070d800000, 0x000000070da00000| 0%| F| |TAMS 0x000000070d800000| PB 0x000000070d800000| Untracked | 0 +| 109|0x000000070da00000, 0x000000070da00000, 0x000000070dc00000| 0%| F| |TAMS 0x000000070da00000| PB 0x000000070da00000| Untracked | 0 +| 110|0x000000070dc00000, 0x000000070dc00000, 0x000000070de00000| 0%| F| |TAMS 0x000000070dc00000| PB 0x000000070dc00000| Untracked | 0 +| 111|0x000000070de00000, 0x000000070de00000, 0x000000070e000000| 0%| F| |TAMS 0x000000070de00000| PB 0x000000070de00000| Untracked | 0 +| 112|0x000000070e000000, 0x000000070e000000, 0x000000070e200000| 0%| F| |TAMS 0x000000070e000000| PB 0x000000070e000000| Untracked | 0 +| 113|0x000000070e200000, 0x000000070e200000, 0x000000070e400000| 0%| F| |TAMS 0x000000070e200000| PB 0x000000070e200000| Untracked | 0 +| 114|0x000000070e400000, 0x000000070e4b5528, 0x000000070e600000| 35%| S|CS|TAMS 0x000000070e400000| PB 0x000000070e400000| Complete | 0 +| 115|0x000000070e600000, 0x000000070e800000, 0x000000070e800000|100%| S|CS|TAMS 0x000000070e600000| PB 0x000000070e600000| Complete | 0 +| 116|0x000000070e800000, 0x000000070e800000, 0x000000070ea00000| 0%| F| |TAMS 0x000000070e800000| PB 0x000000070e800000| Untracked | 0 +| 117|0x000000070ea00000, 0x000000070ea00000, 0x000000070ec00000| 0%| F| |TAMS 0x000000070ea00000| PB 0x000000070ea00000| Untracked | 0 +| 118|0x000000070ec00000, 0x000000070ec00000, 0x000000070ee00000| 0%| F| |TAMS 0x000000070ec00000| PB 0x000000070ec00000| Untracked | 0 +| 119|0x000000070ee00000, 0x000000070ee00000, 0x000000070f000000| 0%| F| |TAMS 0x000000070ee00000| PB 0x000000070ee00000| Untracked | 0 +| 120|0x000000070f000000, 0x000000070f000000, 0x000000070f200000| 0%| F| |TAMS 0x000000070f000000| PB 0x000000070f000000| Untracked | 0 +| 121|0x000000070f200000, 0x000000070f200000, 0x000000070f400000| 0%| F| |TAMS 0x000000070f200000| PB 0x000000070f200000| Untracked | 0 +| 122|0x000000070f400000, 0x000000070f400000, 0x000000070f600000| 0%| F| |TAMS 0x000000070f400000| PB 0x000000070f400000| Untracked | 0 +| 123|0x000000070f600000, 0x000000070f600000, 0x000000070f800000| 0%| F| |TAMS 0x000000070f600000| PB 0x000000070f600000| Untracked | 0 +| 124|0x000000070f800000, 0x000000070f800000, 0x000000070fa00000| 0%| F| |TAMS 0x000000070f800000| PB 0x000000070f800000| Untracked | 0 +| 125|0x000000070fa00000, 0x000000070fa00000, 0x000000070fc00000| 0%| F| |TAMS 0x000000070fa00000| PB 0x000000070fa00000| Untracked | 0 +| 126|0x000000070fc00000, 0x000000070fc00000, 0x000000070fe00000| 0%| F| |TAMS 0x000000070fc00000| PB 0x000000070fc00000| Untracked | 0 +| 127|0x000000070fe00000, 0x000000070ff64b80, 0x0000000710000000| 69%| E| |TAMS 0x000000070fe00000| PB 0x000000070fe00000| Complete | 0 + +Card table byte_map: [0x0000000101148000,0x0000000101948000] _byte_map_base: 0x00000000fd948000 + +Marking Bits: (CMBitMap*) 0x0000000131840810 + Bits: [0x000000011a14c000, 0x000000011e14c000) + +Polling page: 0x0000000100434000 + +Metaspace: + +Usage: + Non-class: 13.18 MB used. + Class: 1.64 MB used. + Both: 14.82 MB used. + +Virtual space: + Non-class space: 64.00 MB reserved, 13.38 MB ( 21%) committed, 1 nodes. + Class space: 1.00 GB reserved, 1.81 MB ( <1%) committed, 1 nodes. + Both: 1.06 GB reserved, 15.19 MB ( 1%) committed. + +Chunk freelists: + Non-Class: 2.35 MB + Class: 14.17 MB + Both: 16.53 MB + +MaxMetaspaceSize: unlimited +CompressedClassSpaceSize: 1.00 GB +Initial GC threshold: 21.00 MB +Current GC threshold: 21.00 MB +CDS: off + - commit_granule_bytes: 65536. + - commit_granule_words: 8192. + - virtual_space_node_default_size: 8388608. + - enlarge_chunks_in_place: 1. + - use_allocation_guard: 0. + + +Internal statistics: + +num_allocs_failed_limit: 0. +num_arena_births: 342. +num_arena_deaths: 0. +num_vsnodes_births: 2. +num_vsnodes_deaths: 0. +num_space_committed: 243. +num_space_uncommitted: 0. +num_chunks_returned_to_freelist: 0. +num_chunks_taken_from_freelist: 560. +num_chunk_merges: 0. +num_chunk_splits: 335. +num_chunks_enlarged: 197. +num_inconsistent_stats: 0. + +CodeHeap 'non-profiled nmethods': size=120032Kb used=381Kb max_used=381Kb free=119650Kb + bounds [0x0000000112c14000, 0x0000000112e84000, 0x000000011a14c000] +CodeHeap 'profiled nmethods': size=120016Kb used=2365Kb max_used=2365Kb free=117650Kb + bounds [0x000000010b14c000, 0x000000010b3bc000, 0x0000000112680000] +CodeHeap 'non-nmethods': size=5712Kb used=1356Kb max_used=1368Kb free=4355Kb + bounds [0x0000000112680000, 0x00000001128f0000, 0x0000000112c14000] + total_blobs=1721 nmethods=1245 adapters=383 + compilation: enabled + stopped_count=0, restarted_count=0 + full_count=0 + +Compilation events (20 events): +Event: 3.051 Thread 0x0000000142018000 nmethod 1231 0x000000010b37bd10 code [0x000000010b37bec0, 0x000000010b37c168] +Event: 3.051 Thread 0x0000000142018000 1232 3 java.lang.ref.NativeReferenceQueue::signal (8 bytes) +Event: 3.051 Thread 0x0000000142018000 nmethod 1232 0x000000010b37c290 code [0x000000010b37c440, 0x000000010b37c5c8] +Event: 3.051 Thread 0x0000000142018000 1241 3 java.lang.constant.ConstantUtils::skipOverFieldSignature (296 bytes) +Event: 3.051 Thread 0x0000000142018000 nmethod 1241 0x000000010b37c690 code [0x000000010b37cb80, 0x000000010b37e838] +Event: 3.051 Thread 0x0000000142018000 1242 3 jdk.internal.classfile.impl.DirectCodeBuilder::with (9 bytes) +Event: 3.052 Thread 0x0000000142018000 nmethod 1242 0x000000010b37f310 code [0x000000010b37f540, 0x000000010b37fe10] +Event: 3.052 Thread 0x0000000142018000 1243 3 jdk.internal.classfile.impl.RawBytecodeHelper::isLastBytecode (17 bytes) +Event: 3.052 Thread 0x0000000142018000 nmethod 1243 0x000000010b380090 code [0x000000010b380240, 0x000000010b3803b0] +Event: 3.052 Thread 0x0000000142018000 1216 3 java.lang.invoke.LambdaForm::fixResult (31 bytes) +Event: 3.052 Thread 0x0000000142018000 nmethod 1216 0x000000010b380490 code [0x000000010b380640, 0x000000010b380808] +Event: 3.052 Thread 0x0000000142018000 1245 3 jdk.internal.classfile.impl.SplitConstantPool::map (145 bytes) +Event: 3.052 Thread 0x0000000142018000 nmethod 1245 0x000000010b380910 code [0x000000010b380c00, 0x000000010b381990] +Event: 3.052 Thread 0x0000000142018000 1246 3 jdk.internal.org.objectweb.asm.MethodVisitor::visitInsn (16 bytes) +Event: 3.052 Thread 0x0000000142018000 nmethod 1246 0x000000010b381e10 code [0x000000010b381fc0, 0x000000010b382218] +Event: 3.053 Thread 0x0000000142018000 1248 3 jdk.internal.classfile.impl.AbstractElement:: (5 bytes) +Event: 3.053 Thread 0x0000000142018000 nmethod 1248 0x000000010b382310 code [0x000000010b3824c0, 0x000000010b382638] +Event: 3.054 Thread 0x0000000142018000 1249 1 java.lang.constant.PrimitiveClassDescImpl::descriptorString (5 bytes) +Event: 3.054 Thread 0x0000000142018000 nmethod 1249 0x0000000112c72890 code [0x0000000112c72a00, 0x0000000112c72aa8] +Event: 3.054 Thread 0x0000000142018000 1250 3 jdk.internal.classfile.impl.StackMapGenerator::processBlock (2767 bytes) + +GC Heap History (2 events): +Event: 3.045 GC heap before +{Heap before GC invocations=0 (full 0): + garbage-first heap total reserved 4194304K, committed 262144K, used 22528K [0x0000000700000000, 0x0000000800000000) + region size 2048K, 12 young (24576K), 0 survivors (0K) + Metaspace used 14795K, committed 15104K, reserved 1114112K + class space used 1618K, committed 1792K, reserved 1048576K +} +Event: 3.048 GC heap after +{Heap after GC invocations=1 (full 0): + garbage-first heap total reserved 4194304K, committed 262144K, used 2773K [0x0000000700000000, 0x0000000800000000) + region size 2048K, 2 young (4096K), 2 survivors (4096K) + Metaspace used 14795K, committed 15104K, reserved 1114112K + class space used 1618K, committed 1792K, reserved 1048576K +} + +Dll operation events (8 events): +Event: 0.005 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjava.dylib +Event: 0.006 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libzip.dylib +Event: 0.071 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libinstrument.dylib +Event: 0.080 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libnio.dylib +Event: 0.085 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libzip.dylib +Event: 0.127 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjimage.dylib +Event: 2.995 Loaded shared library libsomelib.dylib +Event: 3.000 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libsyslookup.dylib + +Deoptimization events (20 events): +Event: 0.272 Thread 0x0000000131818400 DEOPT PACKING pc=0x0000000112c31160 sp=0x000000016fc6b350 +Event: 0.272 Thread 0x0000000131818400 DEOPT UNPACKING pc=0x00000001126c301c sp=0x000000016fc6b310 mode 2 +Event: 2.983 Thread 0x0000000131818400 Uncommon trap: trap_request=0xffffff45 fr.pc=0x0000000112c5b820 relative=0x00000000000000e0 +Event: 2.983 Thread 0x0000000131818400 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000112c5b820 method=sun.net.www.ParseUtil.firstEncodeIndex(Ljava/lang/String;)I @ 51 c2 +Event: 2.983 Thread 0x0000000131818400 DEOPT PACKING pc=0x0000000112c5b820 sp=0x000000016fc6a780 +Event: 2.983 Thread 0x0000000131818400 DEOPT UNPACKING pc=0x00000001126c301c sp=0x000000016fc6a700 mode 2 +Event: 3.032 Thread 0x0000000131818400 DEOPT PACKING pc=0x000000010b3333c8 sp=0x000000016fc6a500 +Event: 3.032 Thread 0x0000000131818400 DEOPT UNPACKING pc=0x00000001126c2e7c sp=0x000000016fc6a300 mode 3 +Event: 3.048 Thread 0x0000000131818400 Uncommon trap: trap_request=0xffffff45 fr.pc=0x0000000112c5299c relative=0x000000000000025c +Event: 3.048 Thread 0x0000000131818400 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000112c5299c method=java.util.concurrent.ConcurrentHashMap.get(Ljava/lang/Object;)Ljava/lang/Object; @ 76 c2 +Event: 3.048 Thread 0x0000000131818400 DEOPT PACKING pc=0x0000000112c5299c sp=0x000000016fc69870 +Event: 3.048 Thread 0x0000000131818400 DEOPT UNPACKING pc=0x00000001126c301c sp=0x000000016fc697f0 mode 2 +Event: 3.049 Thread 0x0000000131818400 Uncommon trap: trap_request=0xffffff45 fr.pc=0x0000000112c52fe8 relative=0x00000000000000a8 +Event: 3.049 Thread 0x0000000131818400 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000112c52fe8 method=java.lang.ref.ReferenceQueue.headIsNull()Z @ 4 c2 +Event: 3.049 Thread 0x0000000131818400 DEOPT PACKING pc=0x0000000112c52fe8 sp=0x000000016fc6a0a0 +Event: 3.049 Thread 0x0000000131818400 DEOPT UNPACKING pc=0x00000001126c301c sp=0x000000016fc69f60 mode 2 +Event: 3.049 Thread 0x0000000131818400 Uncommon trap: trap_request=0xffffff45 fr.pc=0x0000000112c554ec relative=0x000000000000006c +Event: 3.049 Thread 0x0000000131818400 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000112c554ec method=java.lang.ref.ReferenceQueue.headIsNull()Z @ 4 c2 +Event: 3.049 Thread 0x0000000131818400 DEOPT PACKING pc=0x0000000112c554ec sp=0x000000016fc6a010 +Event: 3.049 Thread 0x0000000131818400 DEOPT UNPACKING pc=0x00000001126c301c sp=0x000000016fc69f40 mode 2 + +Classes loaded (20 events): +Event: 3.054 Loading class jdk/internal/classfile/impl/BufferedCodeBuilder +Event: 3.054 Loading class jdk/internal/classfile/impl/BufferedCodeBuilder done +Event: 3.054 Loading class jdk/internal/classfile/impl/TransformingCodeBuilder +Event: 3.054 Loading class jdk/internal/classfile/impl/TransformingCodeBuilder done +Event: 3.054 Loading class java/lang/classfile/instruction/ThrowInstruction +Event: 3.055 Loading class java/lang/classfile/instruction/ThrowInstruction done +Event: 3.055 Loading class jdk/internal/classfile/impl/AbstractInstruction$UnboundThrowInstruction +Event: 3.055 Loading class jdk/internal/classfile/impl/AbstractInstruction$UnboundThrowInstruction done +Event: 3.055 Loading class java/lang/classfile/instruction/ExceptionCatch +Event: 3.055 Loading class java/lang/classfile/instruction/ExceptionCatch done +Event: 3.055 Loading class jdk/internal/classfile/impl/AbstractPseudoInstruction$ExceptionCatchImpl +Event: 3.055 Loading class jdk/internal/classfile/impl/AbstractPseudoInstruction +Event: 3.055 Loading class jdk/internal/classfile/impl/AbstractPseudoInstruction done +Event: 3.055 Loading class jdk/internal/classfile/impl/AbstractPseudoInstruction$ExceptionCatchImpl done +Event: 3.055 Loading class jdk/internal/classfile/impl/StackMapGenerator$RawExceptionCatch +Event: 3.055 Loading class jdk/internal/classfile/impl/StackMapGenerator$RawExceptionCatch done +Event: 3.055 Loading class jdk/internal/classfile/impl/SplitConstantPool$1 +Event: 3.055 Loading class jdk/internal/classfile/impl/SplitConstantPool$1 done +Event: 3.056 Loading class java/lang/invoke/ConstantBootstraps +Event: 3.056 Loading class java/lang/invoke/ConstantBootstraps done + +Classes unloaded (0 events): +No events + +Classes redefined (0 events): +No events + +Internal exceptions (20 events): +Event: 3.032 Thread 0x0000000131818400 Exception (0x000000070e87d458) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 3.034 Thread 0x0000000131818400 Exception (0x000000070e8a0820) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 3.034 Thread 0x0000000131818400 Exception (0x000000070e8a4e70) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 3.034 Thread 0x0000000131818400 Exception (0x000000070e8a8a28) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 3.034 Thread 0x0000000131818400 Exception (0x000000070e8b0578) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 3.034 Thread 0x0000000131818400 Exception (0x000000070e8b7550) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 3.034 Thread 0x0000000131818400 Exception (0x000000070e8be520) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 3.034 Thread 0x0000000131818400 Exception (0x000000070e8c2fd8) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 3.035 Thread 0x0000000131818400 Exception (0x000000070e8e12b0) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 3.039 Thread 0x0000000131818400 Exception (0x000000070e92fd70) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 841] +Event: 3.040 Thread 0x0000000131818400 Exception (0x000000070e9468c8) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 3.043 Thread 0x0000000131818400 Exception (0x000000070e9b1470) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 3.043 Thread 0x0000000131818400 Exception (0x000000070e9bc278) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 3.044 Thread 0x0000000131818400 Exception (0x000000070e9cdbb8) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 3.045 Thread 0x0000000131818400 Exception (0x000000070e9ea228) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 3.045 Thread 0x0000000131818400 Exception (0x000000070e9ef6f8) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 3.048 Thread 0x0000000131818400 Exception (0x000000070fe0bcf8) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 3.053 Thread 0x0000000131818400 Exception (0x000000070fe4ba20) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 3.055 Thread 0x0000000131818400 Exception (0x000000070ff0dfe8) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 3.056 Thread 0x0000000131818400 Exception (0x000000070ff22048) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] + +ZGC Phase Switch (0 events): +No events + +VM Operations (20 events): +Event: 0.269 Executing VM operation: ICBufferFull +Event: 0.269 Executing VM operation: ICBufferFull done +Event: 0.271 Executing VM operation: HandshakeAllThreads (Deoptimize) +Event: 0.271 Executing VM operation: HandshakeAllThreads (Deoptimize) done +Event: 0.277 Executing VM operation: get/set locals +Event: 0.277 Executing VM operation: get/set locals done +Event: 0.278 Executing VM operation: get/set locals +Event: 0.278 Executing VM operation: get/set locals done +Event: 2.495 Executing VM operation: get/set locals +Event: 2.495 Executing VM operation: get/set locals done +Event: 2.495 Executing VM operation: get/set locals +Event: 2.495 Executing VM operation: get/set locals done +Event: 2.497 Executing VM operation: get/set locals +Event: 2.497 Executing VM operation: get/set locals done +Event: 2.972 Executing VM operation: ChangeBreakpoints +Event: 2.972 Executing VM operation: ChangeBreakpoints done +Event: 2.973 Executing VM operation: ChangeBreakpoints +Event: 2.973 Executing VM operation: ChangeBreakpoints done +Event: 3.045 Executing VM operation: G1CollectForAllocation (G1 Evacuation Pause) +Event: 3.048 Executing VM operation: G1CollectForAllocation (G1 Evacuation Pause) done + +Events (20 events): +Event: 0.024 Thread 0x0000000142009a00 Thread added: 0x0000000142009a00 +Event: 0.024 Protecting memory [0x0000000170ffc000,0x0000000171008000] with protection modes 0 +Event: 0.024 Thread 0x000000014200a200 Thread added: 0x000000014200a200 +Event: 0.024 Protecting memory [0x0000000171208000,0x0000000171214000] with protection modes 0 +Event: 0.024 Thread 0x0000000142017000 Thread added: 0x0000000142017000 +Event: 0.024 Protecting memory [0x0000000171414000,0x0000000171420000] with protection modes 0 +Event: 0.024 Thread 0x0000000142017800 Thread added: 0x0000000142017800 +Event: 0.024 Protecting memory [0x0000000171620000,0x000000017162c000] with protection modes 0 +Event: 0.024 Thread 0x0000000142018000 Thread added: 0x0000000142018000 +Event: 0.024 Protecting memory [0x000000017182c000,0x0000000171838000] with protection modes 0 +Event: 0.044 Thread 0x0000000142038800 Thread added: 0x0000000142038800 +Event: 0.044 Protecting memory [0x0000000171a38000,0x0000000171a44000] with protection modes 0 +Event: 0.060 Thread 0x00000001420b2e00 Thread added: 0x00000001420b2e00 +Event: 0.060 Protecting memory [0x0000000171c44000,0x0000000171c50000] with protection modes 0 +Event: 0.060 Thread 0x00000001420b3600 Thread added: 0x00000001420b3600 +Event: 0.060 Protecting memory [0x0000000171e50000,0x0000000171e5c000] with protection modes 0 +Event: 0.060 Thread 0x00000001420b3e00 Thread added: 0x00000001420b3e00 +Event: 0.060 Protecting memory [0x000000017205c000,0x0000000172068000] with protection modes 0 +Event: 0.077 Thread 0x000000014180e600 Thread added: 0x000000014180e600 +Event: 0.077 Protecting memory [0x0000000172268000,0x0000000172274000] with protection modes 0 + + +Dynamic libraries: +0x00000001008a8000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjli.dylib +0x00000001a96bb000 /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa +0x0000000192c62000 /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit +0x0000000195cce000 /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData +0x0000000190515000 /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation +0x000000019bfdc000 /usr/lib/libSystem.B.dylib +0x0000000193f9f000 /System/Library/PrivateFrameworks/UIFoundation.framework/Versions/A/UIFoundation +0x000000022ab7f000 /System/Library/PrivateFrameworks/CollectionViewCore.framework/Versions/A/CollectionViewCore +0x00000001a3255000 /System/Library/PrivateFrameworks/RemoteViewServices.framework/Versions/A/RemoteViewServices +0x0000000199e89000 /System/Library/PrivateFrameworks/XCTTargetBootstrap.framework/Versions/A/XCTTargetBootstrap +0x000000019e618000 /System/Library/PrivateFrameworks/InternationalSupport.framework/Versions/A/InternationalSupport +0x000000019e66c000 /System/Library/PrivateFrameworks/UserActivity.framework/Versions/A/UserActivity +0x000000024efd6000 /System/Library/PrivateFrameworks/WindowManagement.framework/Versions/A/WindowManagement +0x0000000190195000 /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration +0x000000019da86000 /usr/lib/libspindump.dylib +0x0000000194154000 /System/Library/Frameworks/UniformTypeIdentifiers.framework/Versions/A/UniformTypeIdentifiers +0x0000000197d00000 /usr/lib/libapp_launch_measurement.dylib +0x0000000197126000 /System/Library/PrivateFrameworks/CoreAnalytics.framework/Versions/A/CoreAnalytics +0x0000000197d07000 /System/Library/PrivateFrameworks/CoreAutoLayout.framework/Versions/A/CoreAutoLayout +0x00000001996a9000 /System/Library/Frameworks/Metal.framework/Versions/A/Metal +0x000000019a631000 /usr/lib/liblangid.dylib +0x0000000199e8f000 /System/Library/PrivateFrameworks/CoreSVG.framework/Versions/A/CoreSVG +0x0000000194b19000 /System/Library/PrivateFrameworks/SkyLight.framework/Versions/A/SkyLight +0x0000000194fba000 /System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics +0x00000001a392f000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate +0x000000019d8e0000 /System/Library/PrivateFrameworks/IconServices.framework/Versions/A/IconServices +0x0000000199687000 /System/Library/Frameworks/IOSurface.framework/Versions/A/IOSurface +0x0000000197155000 /usr/lib/libDiagnosticMessagesClient.dylib +0x000000019bf1e000 /usr/lib/libz.1.dylib +0x00000001a70d4000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices +0x0000000199e71000 /System/Library/PrivateFrameworks/DFRFoundation.framework/Versions/A/DFRFoundation +0x00000001924bc000 /usr/lib/libicucore.A.dylib +0x000000019f676000 /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox +0x000000019e627000 /System/Library/PrivateFrameworks/DataDetectorsCore.framework/Versions/A/DataDetectorsCore +0x00000001b809a000 /System/Library/PrivateFrameworks/TextInput.framework/Versions/A/TextInput +0x0000000194a6a000 /usr/lib/libMobileGestalt.dylib +0x0000000199bad000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox +0x000000019762c000 /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore +0x00000001920e9000 /System/Library/Frameworks/Security.framework/Versions/A/Security +0x00000001a3295000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SpeechRecognition.framework/Versions/A/SpeechRecognition +0x0000000197a2e000 /System/Library/PrivateFrameworks/CoreUI.framework/Versions/A/CoreUI +0x00000001919e2000 /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio +0x0000000197239000 /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration +0x000000019dee2000 /System/Library/PrivateFrameworks/MultitouchSupport.framework/Versions/A/MultitouchSupport +0x0000000194a68000 /usr/lib/libenergytrace.dylib +0x00000001ad793000 /System/Library/PrivateFrameworks/RenderBox.framework/Versions/A/RenderBox +0x0000000192b16000 /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit +0x00000001a366a000 /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices +0x0000000197c8c000 /System/Library/PrivateFrameworks/PerformanceAnalysis.framework/Versions/A/PerformanceAnalysis +0x00000001e603f000 /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL +0x0000000197d51000 /usr/lib/libxml2.2.dylib +0x000000019b360000 /System/Library/PrivateFrameworks/MobileKeyBag.framework/Versions/A/MobileKeyBag +0x000000018ef80000 /usr/lib/libobjc.A.dylib +0x000000018f274000 /usr/lib/libc++.1.dylib +0x00000001a35e7000 /System/Library/Frameworks/Accessibility.framework/Versions/A/Accessibility +0x000000019569a000 /System/Library/Frameworks/ColorSync.framework/Versions/A/ColorSync +0x000000018f3c0000 /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation +0x000000019a1ec000 /System/Library/Frameworks/CoreImage.framework/Versions/A/CoreImage +0x00000001917ed000 /System/Library/Frameworks/CoreText.framework/Versions/A/CoreText +0x00000001ea89e000 /System/Library/Frameworks/CoreTransferable.framework/Versions/A/CoreTransferable +0x00000001ead63000 /System/Library/Frameworks/DeveloperToolsSupport.framework/Versions/A/DeveloperToolsSupport +0x0000000199eca000 /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO +0x0000000224d1f000 /System/Library/Frameworks/Symbols.framework/Versions/A/Symbols +0x000000019bfe2000 /System/Library/PrivateFrameworks/SoftLinking.framework/Versions/A/SoftLinking +0x000000019f028000 /usr/lib/swift/libswiftCore.dylib +0x00000001b4d27000 /usr/lib/swift/libswiftCoreFoundation.dylib +0x00000001b2790000 /usr/lib/swift/libswiftCoreGraphics.dylib +0x00000001b4d71000 /usr/lib/swift/libswiftCoreImage.dylib +0x00000001b2797000 /usr/lib/swift/libswiftDarwin.dylib +0x00000001a4cda000 /usr/lib/swift/libswiftDispatch.dylib +0x00000001b4d72000 /usr/lib/swift/libswiftIOKit.dylib +0x00000001c07cc000 /usr/lib/swift/libswiftMetal.dylib +0x00000001cde91000 /usr/lib/swift/libswiftOSLog.dylib +0x00000001a754f000 /usr/lib/swift/libswiftObjectiveC.dylib +0x00000001c4f00000 /usr/lib/swift/libswiftQuartzCore.dylib +0x00000001c9005000 /usr/lib/swift/libswiftUniformTypeIdentifiers.dylib +0x00000001b4d39000 /usr/lib/swift/libswiftXPC.dylib +0x000000025747d000 /usr/lib/swift/libswift_Concurrency.dylib +0x00000001a7553000 /usr/lib/swift/libswiftos.dylib +0x00000001b7ffe000 /usr/lib/swift/libswiftsimd.dylib +0x000000019c191000 /usr/lib/libcompression.dylib +0x000000019e572000 /System/Library/PrivateFrameworks/TextureIO.framework/Versions/A/TextureIO +0x000000019d58c000 /usr/lib/libate.dylib +0x000000019bfd6000 /usr/lib/system/libcache.dylib +0x000000019bf90000 /usr/lib/system/libcommonCrypto.dylib +0x000000019bfbc000 /usr/lib/system/libcompiler_rt.dylib +0x000000019bfb2000 /usr/lib/system/libcopyfile.dylib +0x000000018f0c4000 /usr/lib/system/libcorecrypto.dylib +0x000000018f1aa000 /usr/lib/system/libdispatch.dylib +0x000000018f365000 /usr/lib/system/libdyld.dylib +0x000000019bfcc000 /usr/lib/system/libkeymgr.dylib +0x000000019bf68000 /usr/lib/system/libmacho.dylib +0x000000019b448000 /usr/lib/system/libquarantine.dylib +0x000000019bfc9000 /usr/lib/system/libremovefile.dylib +0x0000000194ae0000 /usr/lib/system/libsystem_asl.dylib +0x000000018f059000 /usr/lib/system/libsystem_blocks.dylib +0x000000018f1f5000 /usr/lib/system/libsystem_c.dylib +0x000000019bfc0000 /usr/lib/system/libsystem_collections.dylib +0x000000019a620000 /usr/lib/system/libsystem_configuration.dylib +0x000000019965c000 /usr/lib/system/libsystem_containermanager.dylib +0x000000019bbff000 /usr/lib/system/libsystem_coreservices.dylib +0x0000000192783000 /usr/lib/system/libsystem_darwin.dylib +0x00000002577ca000 /usr/lib/system/libsystem_darwindirectory.dylib +0x000000019bfcd000 /usr/lib/system/libsystem_dnssd.dylib +0x00000002577ce000 /usr/lib/system/libsystem_eligibility.dylib +0x000000018f1f2000 /usr/lib/system/libsystem_featureflags.dylib +0x000000018f393000 /usr/lib/system/libsystem_info.dylib +0x000000019bf2d000 /usr/lib/system/libsystem_m.dylib +0x000000018f16d000 /usr/lib/system/libsystem_malloc.dylib +0x0000000194a4d000 /usr/lib/system/libsystem_networkextension.dylib +0x0000000192bf9000 /usr/lib/system/libsystem_notify.dylib +0x000000019a625000 /usr/lib/system/libsystem_sandbox.dylib +0x00000002577d2000 /usr/lib/system/libsystem_sanitizers.dylib +0x000000019bfc5000 /usr/lib/system/libsystem_secinit.dylib +0x000000018f31d000 /usr/lib/system/libsystem_kernel.dylib +0x000000018f38b000 /usr/lib/system/libsystem_platform.dylib +0x000000018f358000 /usr/lib/system/libsystem_pthread.dylib +0x00000001964d0000 /usr/lib/system/libsystem_symptoms.dylib +0x000000018f0a9000 /usr/lib/system/libsystem_trace.dylib +0x000000019bf9e000 /usr/lib/system/libunwind.dylib +0x000000018f05e000 /usr/lib/system/libxpc.dylib +0x000000018f301000 /usr/lib/libc++abi.dylib +0x000000019bfaa000 /usr/lib/liboah.dylib +0x000000019d438000 /usr/lib/liblzma.5.dylib +0x000000019bfde000 /usr/lib/libfakelink.dylib +0x0000000194679000 /System/Library/Frameworks/CFNetwork.framework/Versions/A/CFNetwork +0x000000019c032000 /usr/lib/libarchive.2.dylib +0x00000001a1568000 /System/Library/Frameworks/Combine.framework/Versions/A/Combine +0x000000022ab93000 /System/Library/PrivateFrameworks/CollectionsInternal.framework/Versions/A/CollectionsInternal +0x0000000241543000 /System/Library/PrivateFrameworks/ReflectionInternal.framework/Versions/A/ReflectionInternal +0x0000000241ad5000 /System/Library/PrivateFrameworks/RuntimeInternal.framework/Versions/A/RuntimeInternal +0x00000002575d1000 /usr/lib/swift/libswift_StringProcessing.dylib +0x0000000192a94000 /System/Library/PrivateFrameworks/CoreServicesInternal.framework/Versions/A/CoreServicesInternal +0x000000019b46f000 /usr/lib/libbsm.0.dylib +0x000000019bf70000 /usr/lib/system/libkxld.dylib +0x0000000197cc8000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/FSEvents.framework/Versions/A/FSEvents +0x000000019278e000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore +0x000000019719e000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata +0x000000019bc05000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices +0x000000019c0bb000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit +0x0000000196451000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE +0x000000018f899000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices +0x000000019d3e1000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/DictionaryServices.framework/Versions/A/DictionaryServices +0x0000000197cd5000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SharedFileList.framework/Versions/A/SharedFileList +0x000000019c15b000 /usr/lib/libapple_nghttp2.dylib +0x00000001960c5000 /usr/lib/libsqlite3.dylib +0x00000001964d9000 /System/Library/Frameworks/Network.framework/Versions/A/Network +0x0000000255e8e000 /usr/lib/libCoreEntitlements.dylib +0x000000023c44d000 /System/Library/PrivateFrameworks/MessageSecurity.framework/Versions/A/MessageSecurity +0x00000001960ab000 /System/Library/PrivateFrameworks/ProtocolBuffer.framework/Versions/A/ProtocolBuffer +0x000000019bb2e000 /System/Library/PrivateFrameworks/AppleFSCompression.framework/Versions/A/AppleFSCompression +0x000000019b457000 /usr/lib/libcoretls.dylib +0x000000019d457000 /usr/lib/libcoretls_cfhelpers.dylib +0x000000019c18b000 /usr/lib/libpam.2.dylib +0x000000019d4c9000 /usr/lib/libxar.1.dylib +0x000000019d8b7000 /usr/lib/libheimdal-asn1.dylib +0x0000000194678000 /usr/lib/libnetwork.dylib +0x000000019bfe3000 /usr/lib/libpcap.A.dylib +0x00000001964c5000 /usr/lib/libdns_services.dylib +0x000000019a62d000 /System/Library/PrivateFrameworks/AppleSystemInfo.framework/Versions/A/AppleSystemInfo +0x000000019b155000 /System/Library/PrivateFrameworks/IOMobileFramebuffer.framework/Versions/A/IOMobileFramebuffer +0x0000000257528000 /usr/lib/swift/libswift_RegexParser.dylib +0x000000019bbf2000 /usr/lib/libbz2.1.0.dylib +0x000000019b44b000 /usr/lib/libCheckFix.dylib +0x0000000194af8000 /System/Library/PrivateFrameworks/TCC.framework/Versions/A/TCC +0x000000019a633000 /System/Library/PrivateFrameworks/CoreNLP.framework/Versions/A/CoreNLP +0x0000000197157000 /System/Library/PrivateFrameworks/MetadataUtilities.framework/Versions/A/MetadataUtilities +0x000000019b481000 /usr/lib/libmecab.dylib +0x0000000190229000 /usr/lib/libCRFSuite.dylib +0x000000019b4dd000 /usr/lib/libgermantok.dylib +0x000000019c132000 /usr/lib/libThaiTokenizer.dylib +0x0000000197242000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.framework/Versions/A/vImage +0x00000001a3641000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/vecLib +0x000000019d510000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvMisc.dylib +0x000000019b030000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvDSP.dylib +0x000000018fca0000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib +0x000000019c266000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib +0x000000019b4e0000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLinearAlgebra.dylib +0x000000019c176000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparseBLAS.dylib +0x000000019c261000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libQuadrature.dylib +0x000000019a75c000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBNNS.dylib +0x000000019012e000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparse.dylib +0x000000023ab9c000 /System/Library/PrivateFrameworks/MIL.framework/Versions/A/MIL +0x000000019c019000 /usr/lib/libiconv.2.dylib +0x000000019bf64000 /usr/lib/libcharset.1.dylib +0x0000000197ca8000 /System/Library/Frameworks/OpenDirectory.framework/Versions/A/Frameworks/CFOpenDirectory.framework/Versions/A/CFOpenDirectory +0x0000000197c98000 /System/Library/Frameworks/OpenDirectory.framework/Versions/A/OpenDirectory +0x000000019d459000 /System/Library/PrivateFrameworks/APFS.framework/Versions/A/APFS +0x000000019b387000 /System/Library/Frameworks/SecurityFoundation.framework/Versions/A/SecurityFoundation +0x000000019d4d8000 /usr/lib/libutil.dylib +0x0000000238cfd000 /System/Library/PrivateFrameworks/InstalledContentLibrary.framework/Versions/A/InstalledContentLibrary +0x0000000192ad5000 /System/Library/PrivateFrameworks/CoreServicesStore.framework/Versions/A/CoreServicesStore +0x0000000228340000 /System/Library/PrivateFrameworks/AppleMobileFileIntegrity.framework/Versions/A/AppleMobileFileIntegrity +0x00000001b4cf5000 /usr/lib/libmis.dylib +0x00000001c53e7000 /System/Library/PrivateFrameworks/MobileSystemServices.framework/Versions/A/MobileSystemServices +0x00000001e3449000 /System/Library/PrivateFrameworks/ConfigProfileHelper.framework/Versions/A/ConfigProfileHelper +0x000000019c134000 /System/Library/PrivateFrameworks/AppleSauce.framework/Versions/A/AppleSauce +0x0000000191173000 /System/Library/PrivateFrameworks/LanguageModeling.framework/Versions/A/LanguageModeling +0x000000019d4dc000 /usr/lib/libxslt.1.dylib +0x000000019c020000 /usr/lib/libcmph.dylib +0x000000019b121000 /System/Library/PrivateFrameworks/CoreEmoji.framework/Versions/A/CoreEmoji +0x000000019a756000 /System/Library/PrivateFrameworks/LinguisticData.framework/Versions/A/LinguisticData +0x000000019003c000 /System/Library/PrivateFrameworks/Lexicon.framework/Versions/A/Lexicon +0x000000019b415000 /System/Library/PrivateFrameworks/BackgroundTaskManagement.framework/Versions/A/BackgroundTaskManagement +0x0000000256078000 /usr/lib/libTLE.dylib +0x000000019dda8000 /System/Library/PrivateFrameworks/AppleJPEG.framework/Versions/A/AppleJPEG +0x000000019d89c000 /usr/lib/libexpat.1.dylib +0x000000019e3d0000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libPng.dylib +0x000000019e3fb000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib +0x000000019e4e6000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libGIF.dylib +0x000000019ddee000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJP2.dylib +0x000000019e48b000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib +0x000000019e482000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libRadiance.dylib +0x0000000199a48000 /System/Library/PrivateFrameworks/FontServices.framework/libFontParser.dylib +0x00000001963ea000 /System/Library/PrivateFrameworks/RunningBoardServices.framework/Versions/A/RunningBoardServices +0x00000001a9f95000 /System/Library/PrivateFrameworks/IOSurfaceAccelerator.framework/Versions/A/IOSurfaceAccelerator +0x000000019dede000 /System/Library/PrivateFrameworks/WatchdogClient.framework/Versions/A/WatchdogClient +0x0000000191359000 /System/Library/Frameworks/CoreDisplay.framework/Versions/A/CoreDisplay +0x00000001998ff000 /System/Library/Frameworks/CoreMedia.framework/Versions/A/CoreMedia +0x000000019969f000 /System/Library/PrivateFrameworks/IOAccelerator.framework/Versions/A/IOAccelerator +0x0000000197e3b000 /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo +0x000000019c189000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/MetalPerformanceShaders +0x000000019df21000 /System/Library/Frameworks/VideoToolbox.framework/Versions/A/VideoToolbox +0x0000000197ed7000 /System/Library/PrivateFrameworks/UserManagement.framework/Versions/A/UserManagement +0x0000000196311000 /System/Library/PrivateFrameworks/BaseBoard.framework/Versions/A/BaseBoard +0x000000019a62b000 /System/Library/PrivateFrameworks/AggregateDictionary.framework/Versions/A/AggregateDictionary +0x000000022817a000 /System/Library/PrivateFrameworks/AppleKeyStore.framework/Versions/A/AppleKeyStore +0x000000019e47d000 /System/Library/PrivateFrameworks/GPUWrangler.framework/Versions/A/GPUWrangler +0x000000019e45d000 /System/Library/PrivateFrameworks/IOPresentment.framework/Versions/A/IOPresentment +0x000000019e485000 /System/Library/PrivateFrameworks/DSExternalDisplay.framework/Versions/A/DSExternalDisplay +0x0000000234d8a000 /System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/32023/Libraries/libllvm-flatbuffers.dylib +0x00000001e6032000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCoreFSCache.dylib +0x00000002319ee000 /System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/32023/Libraries/libGPUCompilerUtils.dylib +0x000000019e4ec000 /System/Library/PrivateFrameworks/CMCaptureCore.framework/Versions/A/CMCaptureCore +0x00000001eae86000 /System/Library/Frameworks/ExtensionFoundation.framework/Versions/A/ExtensionFoundation +0x00000001a5543000 /System/Library/PrivateFrameworks/CoreTime.framework/Versions/A/CoreTime +0x000000019da70000 /System/Library/PrivateFrameworks/AppServerSupport.framework/Versions/A/AppServerSupport +0x00000001a0004000 /System/Library/PrivateFrameworks/perfdata.framework/Versions/A/perfdata +0x000000019147d000 /System/Library/PrivateFrameworks/AudioToolboxCore.framework/Versions/A/AudioToolboxCore +0x00000001998d5000 /System/Library/PrivateFrameworks/caulk.framework/Versions/A/caulk +0x000000019f872000 /usr/lib/libAudioStatistics.dylib +0x00000001b402e000 /System/Library/PrivateFrameworks/SystemPolicy.framework/Versions/A/SystemPolicy +0x000000019fb4b000 /usr/lib/libSMC.dylib +0x00000001a953d000 /System/Library/Frameworks/CoreMIDI.framework/Versions/A/CoreMIDI +0x000000019e397000 /usr/lib/libAudioToolboxUtility.dylib +0x00000001af42f000 /System/Library/PrivateFrameworks/OSAServicesClient.framework/Versions/A/OSAServicesClient +0x00000001a0012000 /usr/lib/libperfcheck.dylib +0x00000001a4ffa000 /System/Library/PrivateFrameworks/BoardServices.framework/Versions/A/BoardServices +0x000000019d784000 /System/Library/PrivateFrameworks/PlugInKit.framework/Versions/A/PlugInKit +0x000000019b379000 /System/Library/PrivateFrameworks/AssertionServices.framework/Versions/A/AssertionServices +0x00000001a864e000 /System/Library/PrivateFrameworks/ASEProcessing.framework/Versions/A/ASEProcessing +0x00000001d1318000 /System/Library/PrivateFrameworks/Symbolication.framework/Versions/A/Symbolication +0x0000000240330000 /System/Library/PrivateFrameworks/PhotosensitivityProcessing.framework/Versions/A/PhotosensitivityProcessing +0x000000019da21000 /System/Library/PrivateFrameworks/GraphVisualizer.framework/Versions/A/GraphVisualizer +0x00000001e6094000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib +0x00000001e6053000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGFXShared.dylib +0x00000001e622c000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib +0x00000001e605c000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLImage.dylib +0x00000001e6050000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCVMSPluginSupport.dylib +0x0000000256030000 /usr/lib/libRosetta.dylib +0x00000001e6039000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCoreVMClient.dylib +0x000000022fbf4000 /System/Library/PrivateFrameworks/FontServices.framework/Versions/A/FontServices +0x000000019da2d000 /System/Library/PrivateFrameworks/OTSVG.framework/Versions/A/OTSVG +0x00000001979dc000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/Resources/libFontRegistry.dylib +0x000000019da7b000 /System/Library/PrivateFrameworks/FontServices.framework/libhvf.dylib +0x000000022fbf5000 /System/Library/PrivateFrameworks/FontServices.framework/libXTFontStaticRegistryData.dylib +0x000000019a572000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSCore.framework/Versions/A/MPSCore +0x000000019ba9c000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSImage.framework/Versions/A/MPSImage +0x000000019b4f5000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSNeuralNetwork.framework/Versions/A/MPSNeuralNetwork +0x000000019b940000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSMatrix.framework/Versions/A/MPSMatrix +0x000000019b74b000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSRayIntersector.framework/Versions/A/MPSRayIntersector +0x000000019b972000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSNDArray.framework/Versions/A/MPSNDArray +0x00000001ec760000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSFunctions.framework/Versions/A/MPSFunctions +0x00000001ec745000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSBenchmarkLoop.framework/Versions/A/MPSBenchmarkLoop +0x000000018fb54000 /System/Library/PrivateFrameworks/MetalTools.framework/Versions/A/MetalTools +0x00000001b91d7000 /System/Library/PrivateFrameworks/IOAccelMemoryInfo.framework/Versions/A/IOAccelMemoryInfo +0x00000001c52e0000 /System/Library/PrivateFrameworks/kperf.framework/Versions/A/kperf +0x00000001b4d1a000 /System/Library/PrivateFrameworks/GPURawCounter.framework/Versions/A/GPURawCounter +0x00000001a5415000 /System/Library/PrivateFrameworks/CoreSymbolication.framework/Versions/A/CoreSymbolication +0x00000001b4cc6000 /System/Library/PrivateFrameworks/MallocStackLogging.framework/Versions/A/MallocStackLogging +0x000000019d626000 /System/Library/PrivateFrameworks/CrashReporterSupport.framework/Versions/A/CrashReporterSupport +0x00000001a53d0000 /System/Library/PrivateFrameworks/DebugSymbols.framework/Versions/A/DebugSymbols +0x00000001c3c47000 /System/Library/PrivateFrameworks/OSAnalytics.framework/Versions/A/OSAnalytics +0x000000024d229000 /System/Library/PrivateFrameworks/VideoToolboxParavirtualizationSupport.framework/Versions/A/VideoToolboxParavirtualizationSupport +0x000000019d850000 /System/Library/PrivateFrameworks/AppleVA.framework/Versions/A/AppleVA +0x000000019f8ba000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS +0x0000000195849000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices +0x000000019e4fa000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/PrintCore +0x000000019fca4000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/QD.framework/Versions/A/QD +0x000000019fc98000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSyncLegacy.framework/Versions/A/ColorSyncLegacy +0x000000019f88a000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis +0x000000019e4b6000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATSUI.framework/Versions/A/ATSUI +0x000000019fc2b000 /usr/lib/libcups.2.dylib +0x00000001a0020000 /System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos +0x00000001a0031000 /System/Library/Frameworks/GSS.framework/Versions/A/GSS +0x000000019f939000 /usr/lib/libresolv.9.dylib +0x000000019da8c000 /System/Library/PrivateFrameworks/Heimdal.framework/Versions/A/Heimdal +0x00000001a74bc000 /System/Library/Frameworks/Kerberos.framework/Versions/A/Libraries/libHeimdalProxy.dylib +0x00000001a008b000 /System/Library/PrivateFrameworks/CommonAuth.framework/Versions/A/CommonAuth +0x00000001e9c6c000 /System/Library/Frameworks/AVFAudio.framework/Versions/A/AVFAudio +0x00000001af47e000 /System/Library/PrivateFrameworks/AXCoreUtilities.framework/Versions/A/AXCoreUtilities +0x000000023a274000 /System/Library/PrivateFrameworks/IsolatedCoreAudioClient.framework/Versions/A/IsolatedCoreAudioClient +0x000000019f7f6000 /System/Library/PrivateFrameworks/AudioSession.framework/Versions/A/AudioSession +0x00000001a1307000 /System/Library/Frameworks/IOBluetooth.framework/Versions/A/IOBluetooth +0x000000019d95b000 /System/Library/PrivateFrameworks/MediaExperience.framework/Versions/A/MediaExperience +0x000000019f635000 /System/Library/PrivateFrameworks/AudioSession.framework/libSessionUtility.dylib +0x000000019fcb0000 /System/Library/PrivateFrameworks/AudioResourceArbitration.framework/Versions/A/AudioResourceArbitration +0x00000001a4388000 /System/Library/PrivateFrameworks/PowerLog.framework/Versions/A/PowerLog +0x00000001a42a6000 /System/Library/Frameworks/CoreBluetooth.framework/Versions/A/CoreBluetooth +0x00000001a74bd000 /System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit +0x000000019b1e2000 /System/Library/PrivateFrameworks/CoreUtils.framework/Versions/A/CoreUtils +0x000000022de3f000 /System/Library/PrivateFrameworks/CoreUtilsExtras.framework/Versions/A/CoreUtilsExtras +0x0000000238b8a000 /System/Library/PrivateFrameworks/IO80211.framework/Versions/A/IO80211 +0x00000001a4f3e000 /System/Library/PrivateFrameworks/FrontBoardServices.framework/Versions/A/FrontBoardServices +0x00000001a6a85000 /System/Library/PrivateFrameworks/BackBoardServices.framework/Versions/A/BackBoardServices +0x000000019d8c2000 /System/Library/PrivateFrameworks/IconFoundation.framework/Versions/A/IconFoundation +0x00000001a3281000 /System/Library/PrivateFrameworks/SpeechRecognitionCore.framework/Versions/A/SpeechRecognitionCore +0x00000001af49d000 /usr/lib/libAccessibility.dylib +0x00000001a397b000 /System/Library/Frameworks/MediaAccessibility.framework/Versions/A/MediaAccessibility +0x00000001d49cc000 /System/Library/Frameworks/OSLog.framework/Versions/A/OSLog +0x00000001b4c54000 /System/Library/PrivateFrameworks/LoggingSupport.framework/Versions/A/LoggingSupport +0x0000000101ab4000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/server/libjvm.dylib +0x0000000100448000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjimage.dylib +0x00000001004a8000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjdwp.dylib +0x00000001004f4000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjava.dylib +0x0000000100474000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libinstrument.dylib +0x000000010054c000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libzip.dylib +0x0000000255d1b000 /usr/lib/i18n/libiconv_std.dylib +0x0000000255d03000 /usr/lib/i18n/libUTF8.dylib +0x0000000255d23000 /usr/lib/i18n/libmapper_none.dylib +0x0000000100524000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libdt_socket.dylib +0x00000001007d4000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libnio.dylib +0x00000001007b4000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libnet.dylib +0x00000001019b4000 /Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/libsomelib.dylib +0x000000010049c000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libsyslookup.dylib + + +VM Arguments: +jvm_args: -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:60556,suspend=y,server=n -ea -Didea.test.cyclic.buffer.size=1048576 -javaagent:/Users/cristina/Library/Caches/JetBrains/IdeaIC2024.1/captureAgent/debugger-agent.jar -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 +java_command: com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit5 dev.diplomattest.somelib.Float64VecTest,testFloat64Vec +java_class_path (initial): /Users/cristina/.m2/repository/org/junit/platform/junit-platform-launcher/1.10.3/junit-platform-launcher-1.10.3.jar:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/lib/idea_rt.jar:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/plugins/junit/lib/junit5-rt.jar:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/plugins/junit/lib/junit-rt.jar:/Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/target/test-classes:/Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/target/classes:/Users/cristina/.m2/repository/net/java/dev/jna/jna/5.14.0/jna-5.14.0.jar:/Users/cristina/.m2/repository/org/junit/jupiter/junit-jupiter/5.10.3/junit-jupiter-5.10.3.jar:/Users/cristina/.m2/repository/org/junit/jupiter/junit-jupiter-api/5.10.3/junit-jupiter-api-5.10.3.jar:/Users/cristina/.m2/repository/org/opentest4j/opentest4j/1.3.0/opentest4j-1.3.0.jar:/Users/cristina/.m2/repository/org/junit/platform/junit-platform-commons/1.10.3/junit-platform-commons-1.10.3.jar:/Users/cristina/.m2/repository/org/apiguardian/apiguardian-api/1.1.2/apiguardian-api-1.1.2.jar:/Users/cristina/.m2/repository/org/junit/jupiter/junit-jupiter-params/5.10.3/junit-jupiter-params-5.10.3.jar:/Users/cristina/.m2/repository/org/junit/jupiter/junit-jupiter-engine/5.10.3/junit-jupiter-engine-5.10.3.jar:/Users/cristina/.m2/repository/org/junit/platform/junit-platform-engine/1.10.3/junit-platform-engine-1.10.3.jar:/Users/cristina/.m2/repository/org/openjdk/jmh/jmh-core/1.37/jmh-core-1.37.jar:/Users/cristina/.m2/repository/net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4.jar:/Users/cristina/.m2/repository/org/apache/commons/commons-math3/3.6.1/commons-math3-3.6.1.jar:/Users/cristina/.m2/repository/org/openjdk/jmh/jmh-generator-annprocess/1.37/jmh-generator-annprocess-1.37.jar +Launcher Type: SUN_STANDARD + +[Global flags] + intx CICompilerCount = 4 {product} {ergonomic} + uint ConcGCThreads = 2 {product} {ergonomic} + uint G1ConcRefinementThreads = 8 {product} {ergonomic} + size_t G1HeapRegionSize = 2097152 {product} {ergonomic} + size_t InitialHeapSize = 268435456 {product} {ergonomic} + size_t MarkStackSize = 4194304 {product} {ergonomic} + size_t MaxHeapSize = 4294967296 {product} {ergonomic} + size_t MaxNewSize = 2575302656 {product} {ergonomic} + size_t MinHeapDeltaBytes = 2097152 {product} {ergonomic} + size_t MinHeapSize = 8388608 {product} {ergonomic} + uintx NonNMethodCodeHeapSize = 5839564 {pd product} {ergonomic} + uintx NonProfiledCodeHeapSize = 122909338 {pd product} {ergonomic} + uintx ProfiledCodeHeapSize = 122909338 {pd product} {ergonomic} + uintx ReservedCodeCacheSize = 251658240 {pd product} {ergonomic} + bool SegmentedCodeCache = true {product} {ergonomic} + size_t SoftMaxHeapSize = 4294967296 {manageable} {ergonomic} + bool UseCompressedOops = true {product lp64_product} {ergonomic} + bool UseG1GC = true {product} {ergonomic} + bool UseNUMA = false {product} {ergonomic} + bool UseNUMAInterleaving = false {product} {ergonomic} + +Logging: +Log output configuration: + #0: stdout all=warning uptime,level,tags foldmultilines=false + #1: stderr all=off uptime,level,tags foldmultilines=false + +Environment Variables: +JAVA_HOME=/Users/cristina/Library/Java/JavaVirtualMachines/corretto-19.0.1/Contents/Home/ +PATH=/Users/cristina/bin/jextract-22/bin:/bin:/Users/cristina/.modular/pkg/packages.modular.com_mojo/bin:/Users/cristina/Downloads/dart-sdk/bin:/opt/homebrew/Cellar/llvm/15.0.6/bin:/opt/homebrew/opt/openjdk/bin:/Users/cristina/.elan/bin:/Users/cristina/bin:/Users/cristina/Library/Application Support/Coursier/bin:/Users/cristina/Library/Python/3.8/bin:/Users/cristina/.local/bin:/Users/cristina/.cargo/bin:/Users/cristina/.cargo:/opt/homebrew/bin:/Users/cristina/.fzf/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/X11/bin:/Library/Apple/usr/bin:/usr/local/go/bin:/Library/TeX/texbin:/Users/cristina/.krew/bin +SHELL=/opt/homebrew/bin/fish +LC_CTYPE=en_US.UTF-8 +TMPDIR=/var/folders/x_/9qhndrhs79j640bxvmbkddfw0000gn/T/ + +Active Locale: +LC_ALL=C/en_US.UTF-8/C/C/C/C +LC_COLLATE=C +LC_CTYPE=en_US.UTF-8 +LC_MESSAGES=C +LC_MONETARY=C +LC_NUMERIC=C +LC_TIME=C + +Signal Handlers: + SIGSEGV: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_ONSTACK|SA_RESTART|SA_SIGINFO, unblocked + SIGBUS: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, unblocked + SIGFPE: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, unblocked + SIGPIPE: javaSignalHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked + SIGXFSZ: javaSignalHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked + SIGILL: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, unblocked + SIGUSR2: SR_handler in libjvm.dylib, mask=00100000000000000000000000000000, flags=SA_RESTART|SA_SIGINFO, blocked + SIGHUP: UserHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked + SIGINT: UserHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked + SIGTERM: UserHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked + SIGQUIT: UserHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked + SIGTRAP: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, unblocked + + +Periodic native trim disabled + +--------------- S Y S T E M --------------- + +OS: +uname: Darwin 23.5.0 Darwin Kernel Version 23.5.0: Wed May 1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000 arm64 +OS uptime: 45 days 10:04 hours +rlimit (soft/hard): STACK 8176k/65520k , CORE 0k/infinity , NPROC 2666/4000 , NOFILE 10240/infinity , AS infinity/infinity , CPU infinity/infinity , DATA infinity/infinity , FSIZE infinity/infinity , MEMLOCK infinity/infinity , RSS infinity/infinity +load average: 4.11 4.43 4.50 + +CPU: total 8 (initial active 8) 0x61:0x0:0x1b588bb3:0, fp, asimd, aes, pmull, sha1, sha256, crc32, lse, sha3, sha512 +machdep.cpu.brand_string:Apple M1 Pro +hw.cachelinesize:128 +hw.l1icachesize:131072 +hw.l1dcachesize:65536 +hw.l2cachesize:4194304 + +Memory: 16k page, physical 16777216k(56976k free), swap 3145728k(1371968k free) + +vm_info: OpenJDK 64-Bit Server VM (22.0.1+8) for bsd-aarch64 JRE (22.0.1+8), built on 2024-04-16T00:00:00Z by "admin" with clang Apple LLVM 15.0.0 (clang-1500.1.0.2.5) + +END. diff --git a/feature_tests/java/somelib/hs_err_pid98776.log b/feature_tests/java/somelib/hs_err_pid98776.log new file mode 100644 index 000000000..d0a99d97d --- /dev/null +++ b/feature_tests/java/somelib/hs_err_pid98776.log @@ -0,0 +1,1291 @@ +# +# A fatal error has been detected by the Java Runtime Environment: +# +# SIGSEGV (0xb) at pc=0x0000000104081aec, pid=98776, tid=9987 +# +# JRE version: OpenJDK Runtime Environment Temurin-22.0.1+8 (22.0.1+8) (build 22.0.1+8) +# Java VM: OpenJDK 64-Bit Server VM Temurin-22.0.1+8 (22.0.1+8, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-aarch64) +# Problematic frame: +# C [libsomelib.dylib+0x5aec] Float64Vec_new_isize+0xb4 +# +# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again +# +# If you would like to submit a bug report, please visit: +# https://github.com/adoptium/adoptium-support/issues +# The crash happened outside the Java Virtual Machine in native code. +# See problematic frame for where to report the bug. +# + +--------------- S U M M A R Y ------------ + +Command Line: -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:60574,suspend=y,server=n -ea -Didea.test.cyclic.buffer.size=1048576 -javaagent:/Users/cristina/Library/Caches/JetBrains/IdeaIC2024.1/captureAgent/debugger-agent.jar -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit5 dev.diplomattest.somelib.Float64VecTest,testFloat64Vec + +Host: "MacBookPro18,3" arm64, 8 cores, 16G, Darwin 23.5.0, macOS 14.5 (23F79) +Time: Wed Aug 14 21:06:47 2024 CEST elapsed time: 2.572020 seconds (0d 0h 0m 2s) + +--------------- T H R E A D --------------- + +Current thread (0x0000000153008200): JavaThread "main" [_thread_in_native, id=9987, stack(0x000000016d3a4000,0x000000016d5a7000) (2060K)] + +Stack: [0x000000016d3a4000,0x000000016d5a7000], sp=0x000000016d5a3870, free space=2046k +Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) +C [libsomelib.dylib+0x5aec] Float64Vec_new_isize+0xb4 +v ~RuntimeStub::nep_invoker_blob 0x0000000114e703bc +j java.lang.invoke.LambdaForm$MH+0x00003c00001d0400.invoke(Ljava/lang/Object;JJJ)J+12 java.base@22.0.1 +j java.lang.invoke.LambdaForm$MH+0x00003c00001d3000.invokeExact_MT(Ljava/lang/Object;JJJLjava/lang/Object;)J+23 java.base@22.0.1 +j jdk.internal.foreign.abi.DowncallStub+0x00003c00001d1000.invoke(Ljava/lang/foreign/SegmentAllocator;Ljava/lang/foreign/MemorySegment;Ljava/lang/foreign/MemorySegment;)Ljava/lang/foreign/MemorySegment;+69 java.base@22.0.1 +j java.lang.invoke.LambdaForm$DMH+0x00003c00001d1400.invokeStaticInit(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+14 java.base@22.0.1 +j java.lang.invoke.LambdaForm$MH+0x00003c00001d2400.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+44 java.base@22.0.1 +j java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+19 java.base@22.0.1 +j dev.diplomattest.somelib.ntv.somelib_h.Float64Vec_new_isize(Ljava/lang/foreign/MemorySegment;)Ljava/lang/foreign/MemorySegment;+26 +j dev.diplomattest.somelib.Float64Vec.newIsize([J)Ldev/diplomattest/somelib/Float64Vec;+38 +j dev.diplomattest.somelib.Float64VecTest.testFloat64Vec()V+53 +j java.lang.invoke.LambdaForm$DMH+0x00003c0000140c00.invokeVirtual(Ljava/lang/Object;Ljava/lang/Object;)V+10 java.base@22.0.1 +j java.lang.invoke.LambdaForm$MH+0x00003c0000148400.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+31 java.base@22.0.1 +j java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+19 java.base@22.0.1 +j jdk.internal.reflect.DirectMethodHandleAccessor.invokeImpl(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+41 java.base@22.0.1 +j jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+23 java.base@22.0.1 +j java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+102 java.base@22.0.1 +j org.junit.platform.commons.util.ReflectionUtils.invokeMethod(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+42 +j org.junit.jupiter.engine.execution.MethodInvocation.proceed()Ljava/lang/Object;+16 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed()Ljava/lang/Object;+8 +j org.junit.jupiter.engine.extension.TimeoutExtension.intercept(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/TimeoutDuration;Lorg/junit/jupiter/engine/extension/TimeoutExtension$TimeoutProvider;)Ljava/lang/Object;+28 +j org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/TimeoutExtension$TimeoutProvider;)Ljava/lang/Object;+31 +j org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)V+9 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda+0x00003c0000117998.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)V+5 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall$VoidMethodInterceptorCall;Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)Ljava/lang/Void;+6 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall$$Lambda+0x00003c0000117da8.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)Ljava/lang/Object;+9 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+6 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$$Lambda+0x00003c00001465f0.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+14 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed()Ljava/lang/Object;+12 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+1 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/engine/execution/InvocationInterceptorChain$InterceptorCall;Ljava/util/List;)Ljava/lang/Object;+24 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InvocationInterceptorChain$InterceptorCall;)Ljava/lang/Object;+31 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;)Ljava/lang/Object;+15 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(Ljava/lang/reflect/Method;Ljava/lang/Object;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;)Ljava/lang/Object;+55 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;)V+28 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda+0x00003c0000142aa8.execute()V+12 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)V+21 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;+44 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;+6 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+79 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00003c0000136220.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00003c0000136000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 +j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00003c0000133bc0.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService$$Lambda+0x00003c0000136d10.accept(Ljava/lang/Object;)V+4 +j java.util.ArrayList.forEach(Ljava/util/function/Consumer;)V+46 java.base@22.0.1 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(Ljava/util/List;)V+6 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+116 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00003c0000136220.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00003c0000136000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 +j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00003c0000133bc0.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService$$Lambda+0x00003c0000136d10.accept(Ljava/lang/Object;)V+4 +j java.util.ArrayList.forEach(Ljava/util/function/Consumer;)V+46 java.base@22.0.1 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(Ljava/util/List;)V+6 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+116 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00003c0000136220.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00003c0000136000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 +j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00003c0000133bc0.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(Lorg/junit/platform/engine/support/hierarchical/HierarchicalTestExecutorService$TestTask;)Ljava/util/concurrent/Future;+1 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute()Ljava/util/concurrent/Future;+74 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(Lorg/junit/platform/engine/ExecutionRequest;)V+31 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/engine/TestDescriptor;Lorg/junit/platform/engine/EngineExecutionListener;Lorg/junit/platform/engine/ConfigurationParameters;Lorg/junit/platform/engine/TestEngine;)V+24 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/LauncherDiscoveryResult;Lorg/junit/platform/engine/EngineExecutionListener;)V+115 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;Lorg/junit/platform/engine/EngineExecutionListener;Lorg/junit/platform/launcher/TestExecutionListener;)V+55 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(Lorg/junit/platform/launcher/core/InternalTestPlan;Lorg/junit/platform/launcher/TestExecutionListener;)V+6 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator$$Lambda+0x00003c0000120000.accept(Ljava/lang/Object;)V+12 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(Lorg/junit/platform/engine/ConfigurationParameters;Lorg/junit/platform/launcher/core/ListenerRegistry;Ljava/util/function/Consumer;)V+51 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;[Lorg/junit/platform/launcher/TestExecutionListener;)V+23 +j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;[Lorg/junit/platform/launcher/TestExecutionListener;)V+6 +j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+34 +j org.junit.platform.launcher.core.DelegatingLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+6 +j org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+13 +j com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs([Ljava/lang/String;Ljava/lang/String;IZ)I+203 +j com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(Z)I+17 +j com.intellij.rt.execution.junit.TestsRepeater.repeat(IZLcom/intellij/rt/execution/junit/TestsRepeater$TestRun;)I+7 +j com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(Lcom/intellij/rt/junit/IdeaTestRunner;[Ljava/lang/String;Ljava/util/ArrayList;Ljava/lang/String;IZ)I+25 +j com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart([Ljava/lang/String;Ljava/lang/String;Ljava/util/ArrayList;Ljava/lang/String;)I+117 +j com.intellij.rt.junit.JUnitStarter.main([Ljava/lang/String;)V+97 +v ~StubRoutines::call_stub 0x0000000114d48154 +...... +Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) +v ~RuntimeStub::nep_invoker_blob 0x0000000114e7038c +j java.lang.invoke.LambdaForm$MH+0x00003c00001d0400.invoke(Ljava/lang/Object;JJJ)J+12 java.base@22.0.1 +j java.lang.invoke.LambdaForm$MH+0x00003c00001d3000.invokeExact_MT(Ljava/lang/Object;JJJLjava/lang/Object;)J+23 java.base@22.0.1 +j jdk.internal.foreign.abi.DowncallStub+0x00003c00001d1000.invoke(Ljava/lang/foreign/SegmentAllocator;Ljava/lang/foreign/MemorySegment;Ljava/lang/foreign/MemorySegment;)Ljava/lang/foreign/MemorySegment;+69 java.base@22.0.1 +j java.lang.invoke.LambdaForm$DMH+0x00003c00001d1400.invokeStaticInit(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+14 java.base@22.0.1 +j java.lang.invoke.LambdaForm$MH+0x00003c00001d2400.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+44 java.base@22.0.1 +j java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+19 java.base@22.0.1 +j dev.diplomattest.somelib.ntv.somelib_h.Float64Vec_new_isize(Ljava/lang/foreign/MemorySegment;)Ljava/lang/foreign/MemorySegment;+26 +j dev.diplomattest.somelib.Float64Vec.newIsize([J)Ldev/diplomattest/somelib/Float64Vec;+38 +j dev.diplomattest.somelib.Float64VecTest.testFloat64Vec()V+53 +j java.lang.invoke.LambdaForm$DMH+0x00003c0000140c00.invokeVirtual(Ljava/lang/Object;Ljava/lang/Object;)V+10 java.base@22.0.1 +j java.lang.invoke.LambdaForm$MH+0x00003c0000148400.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+31 java.base@22.0.1 +j java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+19 java.base@22.0.1 +j jdk.internal.reflect.DirectMethodHandleAccessor.invokeImpl(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+41 java.base@22.0.1 +j jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+23 java.base@22.0.1 +j java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+102 java.base@22.0.1 +j org.junit.platform.commons.util.ReflectionUtils.invokeMethod(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+42 +j org.junit.jupiter.engine.execution.MethodInvocation.proceed()Ljava/lang/Object;+16 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed()Ljava/lang/Object;+8 +j org.junit.jupiter.engine.extension.TimeoutExtension.intercept(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/TimeoutDuration;Lorg/junit/jupiter/engine/extension/TimeoutExtension$TimeoutProvider;)Ljava/lang/Object;+28 +j org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/TimeoutExtension$TimeoutProvider;)Ljava/lang/Object;+31 +j org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)V+9 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda+0x00003c0000117998.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)V+5 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall$VoidMethodInterceptorCall;Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)Ljava/lang/Void;+6 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall$$Lambda+0x00003c0000117da8.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)Ljava/lang/Object;+9 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+6 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$$Lambda+0x00003c00001465f0.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+14 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed()Ljava/lang/Object;+12 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+1 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/engine/execution/InvocationInterceptorChain$InterceptorCall;Ljava/util/List;)Ljava/lang/Object;+24 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InvocationInterceptorChain$InterceptorCall;)Ljava/lang/Object;+31 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;)Ljava/lang/Object;+15 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(Ljava/lang/reflect/Method;Ljava/lang/Object;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;)Ljava/lang/Object;+55 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;)V+28 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda+0x00003c0000142aa8.execute()V+12 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)V+21 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;+44 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;+6 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+79 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00003c0000136220.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00003c0000136000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 +j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00003c0000133bc0.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService$$Lambda+0x00003c0000136d10.accept(Ljava/lang/Object;)V+4 +j java.util.ArrayList.forEach(Ljava/util/function/Consumer;)V+46 java.base@22.0.1 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(Ljava/util/List;)V+6 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+116 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00003c0000136220.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00003c0000136000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 +j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00003c0000133bc0.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService$$Lambda+0x00003c0000136d10.accept(Ljava/lang/Object;)V+4 +j java.util.ArrayList.forEach(Ljava/util/function/Consumer;)V+46 java.base@22.0.1 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(Ljava/util/List;)V+6 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+116 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00003c0000136220.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00003c0000136000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 +j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00003c0000133bc0.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(Lorg/junit/platform/engine/support/hierarchical/HierarchicalTestExecutorService$TestTask;)Ljava/util/concurrent/Future;+1 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute()Ljava/util/concurrent/Future;+74 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(Lorg/junit/platform/engine/ExecutionRequest;)V+31 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/engine/TestDescriptor;Lorg/junit/platform/engine/EngineExecutionListener;Lorg/junit/platform/engine/ConfigurationParameters;Lorg/junit/platform/engine/TestEngine;)V+24 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/LauncherDiscoveryResult;Lorg/junit/platform/engine/EngineExecutionListener;)V+115 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;Lorg/junit/platform/engine/EngineExecutionListener;Lorg/junit/platform/launcher/TestExecutionListener;)V+55 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(Lorg/junit/platform/launcher/core/InternalTestPlan;Lorg/junit/platform/launcher/TestExecutionListener;)V+6 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator$$Lambda+0x00003c0000120000.accept(Ljava/lang/Object;)V+12 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(Lorg/junit/platform/engine/ConfigurationParameters;Lorg/junit/platform/launcher/core/ListenerRegistry;Ljava/util/function/Consumer;)V+51 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;[Lorg/junit/platform/launcher/TestExecutionListener;)V+23 +j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;[Lorg/junit/platform/launcher/TestExecutionListener;)V+6 +j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+34 +j org.junit.platform.launcher.core.DelegatingLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+6 +j org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+13 +j com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs([Ljava/lang/String;Ljava/lang/String;IZ)I+203 +j com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(Z)I+17 +j com.intellij.rt.execution.junit.TestsRepeater.repeat(IZLcom/intellij/rt/execution/junit/TestsRepeater$TestRun;)I+7 +j com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(Lcom/intellij/rt/junit/IdeaTestRunner;[Ljava/lang/String;Ljava/util/ArrayList;Ljava/lang/String;IZ)I+25 +j com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart([Ljava/lang/String;Ljava/lang/String;Ljava/util/ArrayList;Ljava/lang/String;)I+117 +j com.intellij.rt.junit.JUnitStarter.main([Ljava/lang/String;)V+97 +v ~StubRoutines::call_stub 0x0000000114d48154 + +siginfo: si_signo: 11 (SIGSEGV), si_code: 2 (SEGV_ACCERR), si_addr: 0x0000000000000001 + +Registers: + x0=0x0000600002a9b350 x1=0x00000000b3e657fb x2=0x0000000000000010 x3=0x0000000000000000 + x4=0x0000000000000003 x5=0x0000000034000000 x6=0x0000600002a9b350 x7=0x0000000000000eb0 + x8=0x0000000000000000 x9=0x0000000000000000 x10=0x0000000000003350 x11=0x0000000000000010 +x12=0x0000000000000001 x13=0x00000000ffffff35 x14=0x00000000000007fb x15=0x00000000b3e657fb +x16=0x0000000000000335 x17=0x00000000000000ca x18=0x0000000000000000 x19=0x0000000000000010 +x20=0x0000000000000002 x21=0x0000600002a9b350 x22=0x00000001040cc141 x23=0x0000000000000001 +x24=0x000000016d5a39b8 x25=0x0000000100010000 x26=0x0000000123d1fc08 x27=0x0000000000000000 +x28=0x0000000153008200 fp=0x000000016d5a38a0 lr=0x0000000104081a7c sp=0x000000016d5a3870 +pc=0x0000000104081aec cpsr=0x0000000080001000 + +Register to memory mapping: + +x0 =0x0000600002a9b350 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00 +x1 =0x00000000b3e657fb is an unknown value +x2 =0x0000000000000010 is an unknown value +x3 =0x0 is null +x4 =0x0000000000000003 is an unknown value +x5 =0x0000000034000000 is an unknown value +x6 =0x0000600002a9b350 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00 +x7 =0x0000000000000eb0 is an unknown value +x8 =0x0 is null +x9 =0x0 is null +x10=0x0000000000003350 is an unknown value +x11=0x0000000000000010 is an unknown value +x12=0x0000000000000001 is an unknown value +x13=0x00000000ffffff35 is an unknown value +x14=0x00000000000007fb is an unknown value +x15=0x00000000b3e657fb is an unknown value +x16=0x0000000000000335 is an unknown value +x17=0x00000000000000ca is an unknown value +x18=0x0 is null +x19=0x0000000000000010 is an unknown value +x20=0x0000000000000002 is an unknown value +x21=0x0000600002a9b350 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00 +x22=0x00000001040cc141: __rust_no_alloc_shim_is_unstable+0 in /Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/libsomelib.dylib at 0x000000010407c000 +x23=0x0000000000000001 is an unknown value +x24=0x000000016d5a39b8 is pointing into the stack for thread: 0x0000000153008200 +x25=0x0000000100010000 is an unknown value +x26=0x0000000123d1fc08 is pointing into metadata +x27=0x0 is null +x28=0x0000000153008200 is a thread + fp=0x000000016d5a38a0 is pointing into the stack for thread: 0x0000000153008200 + lr=0x0000000104081a7c: Float64Vec_new_isize+0x44 in /Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/libsomelib.dylib at 0x000000010407c000 + sp=0x000000016d5a3870 is pointing into the stack for thread: 0x0000000153008200 + +Top of Stack: (sp=0x000000016d5a3870) +0x000000016d5a3870: 000000016d5a39b8 000000070eb0b148 +0x000000016d5a3880: 0000000123d1fa54 0000000104ed12b0 +0x000000016d5a3890: 000000016d5a38e8 000000016d5a38d0 +0x000000016d5a38a0: 000000016d5a38c0 0000000114e703bc +0x000000016d5a38b0: 000000016d5a3970 ec17000114d61844 +0x000000016d5a38c0: 000000016d5a3970 0000000114d4d7a8 +0x000000016d5a38d0: 000000070e783670 fffffffffffffff2 +0x000000016d5a38e0: 0000000000000000 000000070e620218 +0x000000016d5a38f0: 0000000000000002 0000000000000000 +0x000000016d5a3900: 0000000000000001 0000000000000000 +0x000000016d5a3910: 0000000104081a38 0000000000000000 +0x000000016d5a3920: fffffffffffffff6 0000000123d1fa54 +0x000000016d5a3930: 0000000000000009 0000000123d1fc08 +0x000000016d5a3940: 000000070e615748 ffffffffffffffec +0x000000016d5a3950: 0000000000000000 0000000123d1fa60 +0x000000016d5a3960: ffffffffffffffef 000000016d5a3970 +0x000000016d5a3970: 000000016d5a3a10 0000000114d4d7a8 +0x000000016d5a3980: 000000070e620218 0000000000000002 +0x000000016d5a3990: 0000000000000000 0000000000000001 +0x000000016d5a39a0: 0000000000000000 0000000104081a38 +0x000000016d5a39b0: 0000000000000000 000000070e620108 +0x000000016d5a39c0: fffffffffffffff6 0000000123d2529f +0x000000016d5a39d0: 0000000000000009 0000000123d25470 +0x000000016d5a39e0: 000000070ff2c310 ffffffffffffffec +0x000000016d5a39f0: 0000000000000000 0000000123d252b0 +0x000000016d5a3a00: ffffffffffffffef 000000016d5a3a10 +0x000000016d5a3a10: 000000016d5a3ab0 0000000114d4d7a8 +0x000000016d5a3a20: 000000070e6201f0 0000000000000002 +0x000000016d5a3a30: 0000000000000000 0000000000000001 +0x000000016d5a3a40: 0000000000000000 0000000104081a38 +0x000000016d5a3a50: 0000000000000000 000000070e620108 +0x000000016d5a3a60: fffffffffffffff6 0000000123d21465 + +Instructions: (pc=0x0000000104081aec) +0x00000001040819ec: f6 57 41 a9 f8 5f c4 a8 c0 03 5f d6 00 01 80 52 +0x00000001040819fc: 01 03 80 52 c7 d9 00 94 20 00 20 d4 16 00 80 d2 +0x0000000104081a0c: e0 03 16 aa e1 03 15 aa bd d9 00 94 f5 03 00 aa +0x0000000104081a1c: b3 00 00 b4 61 f2 7d d3 e0 03 14 aa 02 01 80 52 +0x0000000104081a2c: 3a 03 00 94 e0 03 15 aa 54 db 00 94 f8 5f bc a9 +0x0000000104081a3c: f6 57 01 a9 f4 4f 02 a9 fd 7b 03 a9 fd c3 00 91 +0x0000000104081a4c: f4 03 01 aa 15 01 80 52 3f 00 00 f1 b7 02 80 9a +0x0000000104081a5c: 33 f0 7d d3 56 02 00 f0 d6 06 05 91 e1 04 00 b4 +0x0000000104081a6c: df 02 40 39 e0 03 13 aa 01 01 80 52 26 03 00 94 +0x0000000104081a7c: 40 06 00 b4 f5 03 00 aa 08 00 80 d2 9f 22 00 f1 +0x0000000104081a8c: e3 02 00 54 a9 02 17 cb 3f 01 01 f1 83 02 00 54 +0x0000000104081a9c: 09 00 80 d2 88 f2 7d 92 ea 82 00 91 eb 03 08 aa +0x0000000104081aac: 4c 01 09 8b 80 05 7f ad 82 0d 40 ad 00 d8 61 4e +0x0000000104081abc: 21 d8 61 4e 42 d8 61 4e 63 d8 61 4e ac 02 09 8b +0x0000000104081acc: 80 05 00 ad 82 0d 01 ad 29 01 01 91 6b 21 00 f1 +0x0000000104081adc: 81 fe ff 54 1f 01 14 eb 00 01 00 54 09 f1 7d d3 +0x0000000104081aec: e0 6a 69 fc 00 d8 61 5e a0 6a 29 fc 08 05 00 91 +0x0000000104081afc: 9f 02 08 eb 41 ff ff 54 df 02 40 39 00 03 80 52 +0x0000000104081b0c: 01 01 80 52 00 03 00 94 00 01 00 b4 14 54 00 a9 +0x0000000104081b1c: 14 08 00 f9 fd 7b 43 a9 f4 4f 42 a9 f6 57 41 a9 +0x0000000104081b2c: f8 5f c4 a8 c0 03 5f d6 00 01 80 52 01 03 80 52 +0x0000000104081b3c: 78 d9 00 94 20 00 20 d4 00 01 80 52 e1 03 13 aa +0x0000000104081b4c: 6f d9 00 94 f6 03 00 aa b4 00 00 b4 e0 03 15 aa +0x0000000104081b5c: e1 03 13 aa 02 01 80 52 ec 02 00 94 e0 03 16 aa +0x0000000104081b6c: 06 db 00 94 f8 5f bc a9 f6 57 01 a9 f4 4f 02 a9 +0x0000000104081b7c: fd 7b 03 a9 fd c3 00 91 f4 03 01 aa 15 01 80 52 +0x0000000104081b8c: 3f 00 00 f1 b7 02 80 9a 33 f0 7d d3 56 02 00 f0 +0x0000000104081b9c: d6 06 05 91 e1 04 00 b4 df 02 40 39 e0 03 13 aa +0x0000000104081bac: 01 01 80 52 d8 02 00 94 40 06 00 b4 f5 03 00 aa +0x0000000104081bbc: 08 00 80 d2 9f 22 00 f1 e3 02 00 54 a9 02 17 cb +0x0000000104081bcc: 3f 01 01 f1 83 02 00 54 09 00 80 d2 88 f2 7d 92 +0x0000000104081bdc: ea 82 00 91 eb 03 08 aa 4c 01 09 8b 80 05 7f ad + + +Stack slot to memory mapping: + +stack at sp + 0 slots: 0x000000016d5a39b8 is pointing into the stack for thread: 0x0000000153008200 +stack at sp + 1 slots: 0x000000070eb0b148 is an oop: jdk.internal.org.objectweb.asm.SymbolTable$Entry +{0x000000070eb0b148} - klass: 'jdk/internal/org/objectweb/asm/SymbolTable$Entry' + - ---- fields (total size 7 words): + - final 'index' 'I' @12 45 (0x0000002d) + - final 'data' 'J' @16 0 (0x0000000000000000) + - final 'tag' 'I' @24 1 (0x00000001) + - 'info' 'I' @28 0 (0x00000000) + - final 'owner' 'Ljava/lang/String;' @32 null (0x00000000) + - final 'name' 'Ljava/lang/String;' @36 null (0x00000000) + - final 'value' 'Ljava/lang/String;' @40 a 'java/util/ArrayList$Itr'{0x000000070fe74df0} (0xe1fce9be) + - final 'hashCode' 'I' @44 881600600 (0x348c2858) + - 'next' 'Ljdk/internal/org/objectweb/asm/SymbolTable$Entry;' @48 null (0x00000000) +stack at sp + 2 slots: 0x0000000123d1fa54 is pointing into metadata +stack at sp + 3 slots: 0x0000000104ed12b0: _ZN19TemplateInterpreter13_active_tableE+0 in /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/server/libjvm.dylib at 0x000000010417c000 +stack at sp + 4 slots: 0x000000016d5a38e8 is pointing into the stack for thread: 0x0000000153008200 +stack at sp + 5 slots: 0x000000016d5a38d0 is pointing into the stack for thread: 0x0000000153008200 +stack at sp + 6 slots: 0x000000016d5a38c0 is pointing into the stack for thread: 0x0000000153008200 +stack at sp + 7 slots: 0x0000000114e703bc is at code_begin+60 in +[CodeBlob (0x0000000114e70310)] +Framesize: 4 +Runtime Stub (0x0000000114e70310): nep_invoker_blob +-------------------------------------------------------------------------------- +Decoding CodeBlob, name: nep_invoker_blob, at [0x0000000114e70380, 0x0000000114e70450] 208 bytes +[MachCode] + 0x0000000114e70380: fd7b bfa9 | fd03 0091 | bf43 00d1 | 0900 0010 | 89d7 01f9 | e903 0091 | 89d3 01f9 | 9ddb 01f9 + 0x0000000114e703a0: e903 7eb2 | 8a53 1191 | 49fd 9f88 | e903 01aa | e103 03aa | e003 02aa | 2001 3fd6 | a900 80d2 + 0x0000000114e703c0: 8957 04b9 | bf3b 03d5 | 8963 1191 | 29fd dfc8 | bf03 09eb | e801 0054 | 8953 44b9 | a901 0035 + 0x0000000114e703e0: e903 7db2 | 8a53 1191 | 49fd 9f88 | 8943 5339 | 3f09 0071 | e001 0054 | 9fd3 01f9 | 9fdb 01f9 + 0x0000000114e70400: 9fd7 01f9 | bf03 0091 | fd7b c1a8 | c003 5fd6 | e003 00f9 | e003 1caa | 897d 84d2 | 898c a0f2 + 0x0000000114e70420: 2900 c0f2 | 2001 3fd6 | e003 40f9 | edff ff17 | e003 00f9 | 0919 9dd2 | 8994 a0f2 | 2900 c0f2 + 0x0000000114e70440: 2001 3fd6 | e003 40f9 | ecff ff17 | 0000 0000 +[/MachCode] +-------------------------------------------------------------------------------- + +-------------------------------------------------------------------------------- +Decoding CodeBlob, name: nep_invoker_blob, at [0x0000000114e70380, 0x0000000114e70450] 208 bytes +[MachCode] + 0x0000000114e70380: fd7b bfa9 | fd03 0091 | bf43 00d1 | 0900 0010 | 89d7 01f9 | e903 0091 | 89d3 01f9 | 9ddb 01f9 + 0x0000000114e703a0: e903 7eb2 | 8a53 1191 | 49fd 9f88 | e903 01aa | e103 03aa | e003 02aa | 2001 3fd6 | a900 80d2 + 0x0000000114e703c0: 8957 04b9 | bf3b 03d5 | 8963 1191 | 29fd dfc8 | bf03 09eb | e801 0054 | 8953 44b9 | a901 0035 + 0x0000000114e703e0: e903 7db2 | 8a53 1191 | 49fd 9f88 | 8943 5339 | 3f09 0071 | e001 0054 | 9fd3 01f9 | 9fdb 01f9 + 0x0000000114e70400: 9fd7 01f9 | bf03 0091 | fd7b c1a8 | c003 5fd6 | e003 00f9 | e003 1caa | 897d 84d2 | 898c a0f2 + 0x0000000114e70420: 2900 c0f2 | 2001 3fd6 | e003 40f9 | edff ff17 | e003 00f9 | 0919 9dd2 | 8994 a0f2 | 2900 c0f2 + 0x0000000114e70440: 2001 3fd6 | e003 40f9 | ecff ff17 | 0000 0000 +[/MachCode] +-------------------------------------------------------------------------------- + + +--------------- P R O C E S S --------------- + +Threads class SMR info: +_java_thread_list=0x000060000289ade0, length=13, elements={ +0x0000000153008200, 0x0000000152019a00, 0x0000000152017e00, 0x000000015201a200, +0x000000015180f200, 0x000000015180e400, 0x0000000151809a00, 0x000000015180a200, +0x0000000131008200, 0x00000001518c8200, 0x00000001518c8a00, 0x00000001518c9200, +0x000000013102fa00 +} + +Java Threads: ( => current thread ) +=>0x0000000153008200 JavaThread "main" [_thread_in_native, id=9987, stack(0x000000016d3a4000,0x000000016d5a7000) (2060K)] + 0x0000000152019a00 JavaThread "Reference Handler" daemon [_thread_blocked, id=24323, stack(0x000000016e51c000,0x000000016e71f000) (2060K)] + 0x0000000152017e00 JavaThread "Finalizer" daemon [_thread_blocked, id=28931, stack(0x000000016e728000,0x000000016e92b000) (2060K)] + 0x000000015201a200 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=28675, stack(0x000000016e934000,0x000000016eb37000) (2060K)] + 0x000000015180f200 JavaThread "Service Thread" daemon [_thread_blocked, id=28419, stack(0x000000016eb40000,0x000000016ed43000) (2060K)] + 0x000000015180e400 JavaThread "Monitor Deflation Thread" daemon [_thread_blocked, id=28163, stack(0x000000016ed4c000,0x000000016ef4f000) (2060K)] + 0x0000000151809a00 JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=27907, stack(0x000000016ef58000,0x000000016f15b000) (2060K)] + 0x000000015180a200 JavaThread "C1 CompilerThread0" daemon [_thread_in_vm, id=27395, stack(0x000000016f164000,0x000000016f367000) (2060K)] + 0x0000000131008200 JavaThread "Common-Cleaner" daemon [_thread_blocked, id=26883, stack(0x000000016f370000,0x000000016f573000) (2060K)] + 0x00000001518c8200 JavaThread "JDWP Transport Listener: dt_socket" daemon [_thread_blocked, id=26371, stack(0x000000016f57c000,0x000000016f77f000) (2060K)] + 0x00000001518c8a00 JavaThread "JDWP Event Helper Thread" daemon [_thread_blocked, id=26115, stack(0x000000016f788000,0x000000016f98b000) (2060K)] + 0x00000001518c9200 JavaThread "JDWP Command Reader" daemon [_thread_in_native, id=32771, stack(0x000000016f994000,0x000000016fb97000) (2060K)] + 0x000000013102fa00 JavaThread "Notification Thread" daemon [_thread_blocked, id=33027, stack(0x000000016fba0000,0x000000016fda3000) (2060K)] +Total: 13 + +Other Threads: + 0x0000000140f0c5c0 VMThread "VM Thread" [id=17923, stack(0x000000016e1f8000,0x000000016e3fb000) (2060K)] + 0x0000000140f09640 WatcherThread "VM Periodic Task Thread" [id=20227, stack(0x000000016dfec000,0x000000016e1ef000) (2060K)] + 0x0000000140f06830 WorkerThread "GC Thread#0" [id=11779, stack(0x000000016d5b0000,0x000000016d7b3000) (2060K)] + 0x0000000150f2fe60 WorkerThread "GC Thread#1" [id=33539, stack(0x000000016fdac000,0x000000016ffaf000) (2060K)] + 0x0000000150f303d0 WorkerThread "GC Thread#2" [id=34051, stack(0x0000000300004000,0x0000000300207000) (2060K)] + 0x0000000150e41d70 WorkerThread "GC Thread#3" [id=43011, stack(0x0000000300210000,0x0000000300413000) (2060K)] + 0x0000000152819700 WorkerThread "GC Thread#4" [id=42755, stack(0x000000030041c000,0x000000030061f000) (2060K)] + 0x0000000152819c70 WorkerThread "GC Thread#5" [id=42499, stack(0x0000000300628000,0x000000030082b000) (2060K)] + 0x0000000140f30ac0 WorkerThread "GC Thread#6" [id=41987, stack(0x0000000300834000,0x0000000300a37000) (2060K)] + 0x0000000140f31030 WorkerThread "GC Thread#7" [id=35331, stack(0x0000000300a40000,0x0000000300c43000) (2060K)] + 0x0000000140f06fd0 ConcurrentGCThread "G1 Main Marker" [id=12291, stack(0x000000016d7bc000,0x000000016d9bf000) (2060K)] + 0x0000000140f07950 WorkerThread "G1 Conc#0" [id=12803, stack(0x000000016d9c8000,0x000000016dbcb000) (2060K)] + 0x000000015105ee00 ConcurrentGCThread "G1 Refine#0" [id=16643, stack(0x000000016dbd4000,0x000000016ddd7000) (2060K)] + 0x0000000140f082b0 ConcurrentGCThread "G1 Service" [id=21251, stack(0x000000016dde0000,0x000000016dfe3000) (2060K)] +Total: 14 + +Threads with active compile tasks: +C2 CompilerThread0 2578 1251 4 jdk.internal.org.objectweb.asm.SymbolTable::addConstantUtf8Reference (101 bytes) +C1 CompilerThread0 2578 1262 3 jdk.internal.classfile.impl.StackMapGenerator::processBlock (2767 bytes) +Total: 2 + +VM state: not at safepoint (normal execution) + +VM Mutex/Monitor currently owned by a thread: ([mutex/lock_event]) +[0x0000000104f3a7d8] MethodCompileQueue_lock - owner thread: 0x000000015180a200 +[0x0000000104f3b198] CodeCache_lock - owner thread: 0x000000015180a200 +[0x0000000104f3b258] Compile_lock - owner thread: 0x000000015180a200 + +Heap address: 0x0000000700000000, size: 4096 MB, Compressed Oops mode: Zero based, Oop shift amount: 3 + +CDS archive(s) not mapped +Compressed class space mapped at: 0x00003c0000000000-0x00003c0040000000, reserved size: 1073741824 +Narrow klass base: 0x00003c0000000000, Narrow klass shift: 0, Narrow klass range: 0x40000000 + +GC Precious Log: + CardTable entry size: 512 + Card Set container configuration: InlinePtr #cards 4 size 8 Array Of Cards #cards 16 size 48 Howl #buckets 8 coarsen threshold 3686 Howl Bitmap #cards 512 size 80 coarsen threshold 460 Card regions per heap region 1 cards per card region 4096 + CPUs: 8 total, 8 available + Memory: 16384M + Large Page Support: Disabled + NUMA Support: Disabled + Compressed Oops: Enabled (Zero based) + Heap Region Size: 2M + Heap Min Capacity: 8M + Heap Initial Capacity: 256M + Heap Max Capacity: 4G + Pre-touch: Disabled + Parallel Workers: 8 + Concurrent Workers: 2 + Concurrent Refinement Workers: 8 + Periodic GC: Disabled + +Heap: + garbage-first heap total reserved 4194304K, committed 262144K, used 2742K [0x0000000700000000, 0x0000000800000000) + region size 2048K, 3 young (6144K), 2 survivors (4096K) + Metaspace used 15170K, committed 15552K, reserved 1114112K + class space used 1680K, committed 1856K, reserved 1048576K + +Heap Regions: E=young(eden), S=young(survivor), O=old, HS=humongous(starts), HC=humongous(continues), CS=collection set, F=free, TAMS=top-at-mark-start, PB=parsable bottom +| 0|0x0000000700000000, 0x0000000700000000, 0x0000000700200000| 0%| F| |TAMS 0x0000000700000000| PB 0x0000000700000000| Untracked | 0 +| 1|0x0000000700200000, 0x0000000700200000, 0x0000000700400000| 0%| F| |TAMS 0x0000000700200000| PB 0x0000000700200000| Untracked | 0 +| 2|0x0000000700400000, 0x0000000700400000, 0x0000000700600000| 0%| F| |TAMS 0x0000000700400000| PB 0x0000000700400000| Untracked | 0 +| 3|0x0000000700600000, 0x0000000700600000, 0x0000000700800000| 0%| F| |TAMS 0x0000000700600000| PB 0x0000000700600000| Untracked | 0 +| 4|0x0000000700800000, 0x0000000700800000, 0x0000000700a00000| 0%| F| |TAMS 0x0000000700800000| PB 0x0000000700800000| Untracked | 0 +| 5|0x0000000700a00000, 0x0000000700a00000, 0x0000000700c00000| 0%| F| |TAMS 0x0000000700a00000| PB 0x0000000700a00000| Untracked | 0 +| 6|0x0000000700c00000, 0x0000000700c00000, 0x0000000700e00000| 0%| F| |TAMS 0x0000000700c00000| PB 0x0000000700c00000| Untracked | 0 +| 7|0x0000000700e00000, 0x0000000700e00000, 0x0000000701000000| 0%| F| |TAMS 0x0000000700e00000| PB 0x0000000700e00000| Untracked | 0 +| 8|0x0000000701000000, 0x0000000701000000, 0x0000000701200000| 0%| F| |TAMS 0x0000000701000000| PB 0x0000000701000000| Untracked | 0 +| 9|0x0000000701200000, 0x0000000701200000, 0x0000000701400000| 0%| F| |TAMS 0x0000000701200000| PB 0x0000000701200000| Untracked | 0 +| 10|0x0000000701400000, 0x0000000701400000, 0x0000000701600000| 0%| F| |TAMS 0x0000000701400000| PB 0x0000000701400000| Untracked | 0 +| 11|0x0000000701600000, 0x0000000701600000, 0x0000000701800000| 0%| F| |TAMS 0x0000000701600000| PB 0x0000000701600000| Untracked | 0 +| 12|0x0000000701800000, 0x0000000701800000, 0x0000000701a00000| 0%| F| |TAMS 0x0000000701800000| PB 0x0000000701800000| Untracked | 0 +| 13|0x0000000701a00000, 0x0000000701a00000, 0x0000000701c00000| 0%| F| |TAMS 0x0000000701a00000| PB 0x0000000701a00000| Untracked | 0 +| 14|0x0000000701c00000, 0x0000000701c00000, 0x0000000701e00000| 0%| F| |TAMS 0x0000000701c00000| PB 0x0000000701c00000| Untracked | 0 +| 15|0x0000000701e00000, 0x0000000701e00000, 0x0000000702000000| 0%| F| |TAMS 0x0000000701e00000| PB 0x0000000701e00000| Untracked | 0 +| 16|0x0000000702000000, 0x0000000702000000, 0x0000000702200000| 0%| F| |TAMS 0x0000000702000000| PB 0x0000000702000000| Untracked | 0 +| 17|0x0000000702200000, 0x0000000702200000, 0x0000000702400000| 0%| F| |TAMS 0x0000000702200000| PB 0x0000000702200000| Untracked | 0 +| 18|0x0000000702400000, 0x0000000702400000, 0x0000000702600000| 0%| F| |TAMS 0x0000000702400000| PB 0x0000000702400000| Untracked | 0 +| 19|0x0000000702600000, 0x0000000702600000, 0x0000000702800000| 0%| F| |TAMS 0x0000000702600000| PB 0x0000000702600000| Untracked | 0 +| 20|0x0000000702800000, 0x0000000702800000, 0x0000000702a00000| 0%| F| |TAMS 0x0000000702800000| PB 0x0000000702800000| Untracked | 0 +| 21|0x0000000702a00000, 0x0000000702a00000, 0x0000000702c00000| 0%| F| |TAMS 0x0000000702a00000| PB 0x0000000702a00000| Untracked | 0 +| 22|0x0000000702c00000, 0x0000000702c00000, 0x0000000702e00000| 0%| F| |TAMS 0x0000000702c00000| PB 0x0000000702c00000| Untracked | 0 +| 23|0x0000000702e00000, 0x0000000702e00000, 0x0000000703000000| 0%| F| |TAMS 0x0000000702e00000| PB 0x0000000702e00000| Untracked | 0 +| 24|0x0000000703000000, 0x0000000703000000, 0x0000000703200000| 0%| F| |TAMS 0x0000000703000000| PB 0x0000000703000000| Untracked | 0 +| 25|0x0000000703200000, 0x0000000703200000, 0x0000000703400000| 0%| F| |TAMS 0x0000000703200000| PB 0x0000000703200000| Untracked | 0 +| 26|0x0000000703400000, 0x0000000703400000, 0x0000000703600000| 0%| F| |TAMS 0x0000000703400000| PB 0x0000000703400000| Untracked | 0 +| 27|0x0000000703600000, 0x0000000703600000, 0x0000000703800000| 0%| F| |TAMS 0x0000000703600000| PB 0x0000000703600000| Untracked | 0 +| 28|0x0000000703800000, 0x0000000703800000, 0x0000000703a00000| 0%| F| |TAMS 0x0000000703800000| PB 0x0000000703800000| Untracked | 0 +| 29|0x0000000703a00000, 0x0000000703a00000, 0x0000000703c00000| 0%| F| |TAMS 0x0000000703a00000| PB 0x0000000703a00000| Untracked | 0 +| 30|0x0000000703c00000, 0x0000000703c00000, 0x0000000703e00000| 0%| F| |TAMS 0x0000000703c00000| PB 0x0000000703c00000| Untracked | 0 +| 31|0x0000000703e00000, 0x0000000703e00000, 0x0000000704000000| 0%| F| |TAMS 0x0000000703e00000| PB 0x0000000703e00000| Untracked | 0 +| 32|0x0000000704000000, 0x0000000704000000, 0x0000000704200000| 0%| F| |TAMS 0x0000000704000000| PB 0x0000000704000000| Untracked | 0 +| 33|0x0000000704200000, 0x0000000704200000, 0x0000000704400000| 0%| F| |TAMS 0x0000000704200000| PB 0x0000000704200000| Untracked | 0 +| 34|0x0000000704400000, 0x0000000704400000, 0x0000000704600000| 0%| F| |TAMS 0x0000000704400000| PB 0x0000000704400000| Untracked | 0 +| 35|0x0000000704600000, 0x0000000704600000, 0x0000000704800000| 0%| F| |TAMS 0x0000000704600000| PB 0x0000000704600000| Untracked | 0 +| 36|0x0000000704800000, 0x0000000704800000, 0x0000000704a00000| 0%| F| |TAMS 0x0000000704800000| PB 0x0000000704800000| Untracked | 0 +| 37|0x0000000704a00000, 0x0000000704a00000, 0x0000000704c00000| 0%| F| |TAMS 0x0000000704a00000| PB 0x0000000704a00000| Untracked | 0 +| 38|0x0000000704c00000, 0x0000000704c00000, 0x0000000704e00000| 0%| F| |TAMS 0x0000000704c00000| PB 0x0000000704c00000| Untracked | 0 +| 39|0x0000000704e00000, 0x0000000704e00000, 0x0000000705000000| 0%| F| |TAMS 0x0000000704e00000| PB 0x0000000704e00000| Untracked | 0 +| 40|0x0000000705000000, 0x0000000705000000, 0x0000000705200000| 0%| F| |TAMS 0x0000000705000000| PB 0x0000000705000000| Untracked | 0 +| 41|0x0000000705200000, 0x0000000705200000, 0x0000000705400000| 0%| F| |TAMS 0x0000000705200000| PB 0x0000000705200000| Untracked | 0 +| 42|0x0000000705400000, 0x0000000705400000, 0x0000000705600000| 0%| F| |TAMS 0x0000000705400000| PB 0x0000000705400000| Untracked | 0 +| 43|0x0000000705600000, 0x0000000705600000, 0x0000000705800000| 0%| F| |TAMS 0x0000000705600000| PB 0x0000000705600000| Untracked | 0 +| 44|0x0000000705800000, 0x0000000705800000, 0x0000000705a00000| 0%| F| |TAMS 0x0000000705800000| PB 0x0000000705800000| Untracked | 0 +| 45|0x0000000705a00000, 0x0000000705a00000, 0x0000000705c00000| 0%| F| |TAMS 0x0000000705a00000| PB 0x0000000705a00000| Untracked | 0 +| 46|0x0000000705c00000, 0x0000000705c00000, 0x0000000705e00000| 0%| F| |TAMS 0x0000000705c00000| PB 0x0000000705c00000| Untracked | 0 +| 47|0x0000000705e00000, 0x0000000705e00000, 0x0000000706000000| 0%| F| |TAMS 0x0000000705e00000| PB 0x0000000705e00000| Untracked | 0 +| 48|0x0000000706000000, 0x0000000706000000, 0x0000000706200000| 0%| F| |TAMS 0x0000000706000000| PB 0x0000000706000000| Untracked | 0 +| 49|0x0000000706200000, 0x0000000706200000, 0x0000000706400000| 0%| F| |TAMS 0x0000000706200000| PB 0x0000000706200000| Untracked | 0 +| 50|0x0000000706400000, 0x0000000706400000, 0x0000000706600000| 0%| F| |TAMS 0x0000000706400000| PB 0x0000000706400000| Untracked | 0 +| 51|0x0000000706600000, 0x0000000706600000, 0x0000000706800000| 0%| F| |TAMS 0x0000000706600000| PB 0x0000000706600000| Untracked | 0 +| 52|0x0000000706800000, 0x0000000706800000, 0x0000000706a00000| 0%| F| |TAMS 0x0000000706800000| PB 0x0000000706800000| Untracked | 0 +| 53|0x0000000706a00000, 0x0000000706a00000, 0x0000000706c00000| 0%| F| |TAMS 0x0000000706a00000| PB 0x0000000706a00000| Untracked | 0 +| 54|0x0000000706c00000, 0x0000000706c00000, 0x0000000706e00000| 0%| F| |TAMS 0x0000000706c00000| PB 0x0000000706c00000| Untracked | 0 +| 55|0x0000000706e00000, 0x0000000706e00000, 0x0000000707000000| 0%| F| |TAMS 0x0000000706e00000| PB 0x0000000706e00000| Untracked | 0 +| 56|0x0000000707000000, 0x0000000707000000, 0x0000000707200000| 0%| F| |TAMS 0x0000000707000000| PB 0x0000000707000000| Untracked | 0 +| 57|0x0000000707200000, 0x0000000707200000, 0x0000000707400000| 0%| F| |TAMS 0x0000000707200000| PB 0x0000000707200000| Untracked | 0 +| 58|0x0000000707400000, 0x0000000707400000, 0x0000000707600000| 0%| F| |TAMS 0x0000000707400000| PB 0x0000000707400000| Untracked | 0 +| 59|0x0000000707600000, 0x0000000707600000, 0x0000000707800000| 0%| F| |TAMS 0x0000000707600000| PB 0x0000000707600000| Untracked | 0 +| 60|0x0000000707800000, 0x0000000707800000, 0x0000000707a00000| 0%| F| |TAMS 0x0000000707800000| PB 0x0000000707800000| Untracked | 0 +| 61|0x0000000707a00000, 0x0000000707a00000, 0x0000000707c00000| 0%| F| |TAMS 0x0000000707a00000| PB 0x0000000707a00000| Untracked | 0 +| 62|0x0000000707c00000, 0x0000000707c00000, 0x0000000707e00000| 0%| F| |TAMS 0x0000000707c00000| PB 0x0000000707c00000| Untracked | 0 +| 63|0x0000000707e00000, 0x0000000707e00000, 0x0000000708000000| 0%| F| |TAMS 0x0000000707e00000| PB 0x0000000707e00000| Untracked | 0 +| 64|0x0000000708000000, 0x0000000708000000, 0x0000000708200000| 0%| F| |TAMS 0x0000000708000000| PB 0x0000000708000000| Untracked | 0 +| 65|0x0000000708200000, 0x0000000708200000, 0x0000000708400000| 0%| F| |TAMS 0x0000000708200000| PB 0x0000000708200000| Untracked | 0 +| 66|0x0000000708400000, 0x0000000708400000, 0x0000000708600000| 0%| F| |TAMS 0x0000000708400000| PB 0x0000000708400000| Untracked | 0 +| 67|0x0000000708600000, 0x0000000708600000, 0x0000000708800000| 0%| F| |TAMS 0x0000000708600000| PB 0x0000000708600000| Untracked | 0 +| 68|0x0000000708800000, 0x0000000708800000, 0x0000000708a00000| 0%| F| |TAMS 0x0000000708800000| PB 0x0000000708800000| Untracked | 0 +| 69|0x0000000708a00000, 0x0000000708a00000, 0x0000000708c00000| 0%| F| |TAMS 0x0000000708a00000| PB 0x0000000708a00000| Untracked | 0 +| 70|0x0000000708c00000, 0x0000000708c00000, 0x0000000708e00000| 0%| F| |TAMS 0x0000000708c00000| PB 0x0000000708c00000| Untracked | 0 +| 71|0x0000000708e00000, 0x0000000708e00000, 0x0000000709000000| 0%| F| |TAMS 0x0000000708e00000| PB 0x0000000708e00000| Untracked | 0 +| 72|0x0000000709000000, 0x0000000709000000, 0x0000000709200000| 0%| F| |TAMS 0x0000000709000000| PB 0x0000000709000000| Untracked | 0 +| 73|0x0000000709200000, 0x0000000709200000, 0x0000000709400000| 0%| F| |TAMS 0x0000000709200000| PB 0x0000000709200000| Untracked | 0 +| 74|0x0000000709400000, 0x0000000709400000, 0x0000000709600000| 0%| F| |TAMS 0x0000000709400000| PB 0x0000000709400000| Untracked | 0 +| 75|0x0000000709600000, 0x0000000709600000, 0x0000000709800000| 0%| F| |TAMS 0x0000000709600000| PB 0x0000000709600000| Untracked | 0 +| 76|0x0000000709800000, 0x0000000709800000, 0x0000000709a00000| 0%| F| |TAMS 0x0000000709800000| PB 0x0000000709800000| Untracked | 0 +| 77|0x0000000709a00000, 0x0000000709a00000, 0x0000000709c00000| 0%| F| |TAMS 0x0000000709a00000| PB 0x0000000709a00000| Untracked | 0 +| 78|0x0000000709c00000, 0x0000000709c00000, 0x0000000709e00000| 0%| F| |TAMS 0x0000000709c00000| PB 0x0000000709c00000| Untracked | 0 +| 79|0x0000000709e00000, 0x0000000709e00000, 0x000000070a000000| 0%| F| |TAMS 0x0000000709e00000| PB 0x0000000709e00000| Untracked | 0 +| 80|0x000000070a000000, 0x000000070a000000, 0x000000070a200000| 0%| F| |TAMS 0x000000070a000000| PB 0x000000070a000000| Untracked | 0 +| 81|0x000000070a200000, 0x000000070a200000, 0x000000070a400000| 0%| F| |TAMS 0x000000070a200000| PB 0x000000070a200000| Untracked | 0 +| 82|0x000000070a400000, 0x000000070a400000, 0x000000070a600000| 0%| F| |TAMS 0x000000070a400000| PB 0x000000070a400000| Untracked | 0 +| 83|0x000000070a600000, 0x000000070a600000, 0x000000070a800000| 0%| F| |TAMS 0x000000070a600000| PB 0x000000070a600000| Untracked | 0 +| 84|0x000000070a800000, 0x000000070a800000, 0x000000070aa00000| 0%| F| |TAMS 0x000000070a800000| PB 0x000000070a800000| Untracked | 0 +| 85|0x000000070aa00000, 0x000000070aa00000, 0x000000070ac00000| 0%| F| |TAMS 0x000000070aa00000| PB 0x000000070aa00000| Untracked | 0 +| 86|0x000000070ac00000, 0x000000070ac00000, 0x000000070ae00000| 0%| F| |TAMS 0x000000070ac00000| PB 0x000000070ac00000| Untracked | 0 +| 87|0x000000070ae00000, 0x000000070ae00000, 0x000000070b000000| 0%| F| |TAMS 0x000000070ae00000| PB 0x000000070ae00000| Untracked | 0 +| 88|0x000000070b000000, 0x000000070b000000, 0x000000070b200000| 0%| F| |TAMS 0x000000070b000000| PB 0x000000070b000000| Untracked | 0 +| 89|0x000000070b200000, 0x000000070b200000, 0x000000070b400000| 0%| F| |TAMS 0x000000070b200000| PB 0x000000070b200000| Untracked | 0 +| 90|0x000000070b400000, 0x000000070b400000, 0x000000070b600000| 0%| F| |TAMS 0x000000070b400000| PB 0x000000070b400000| Untracked | 0 +| 91|0x000000070b600000, 0x000000070b600000, 0x000000070b800000| 0%| F| |TAMS 0x000000070b600000| PB 0x000000070b600000| Untracked | 0 +| 92|0x000000070b800000, 0x000000070b800000, 0x000000070ba00000| 0%| F| |TAMS 0x000000070b800000| PB 0x000000070b800000| Untracked | 0 +| 93|0x000000070ba00000, 0x000000070ba00000, 0x000000070bc00000| 0%| F| |TAMS 0x000000070ba00000| PB 0x000000070ba00000| Untracked | 0 +| 94|0x000000070bc00000, 0x000000070bc00000, 0x000000070be00000| 0%| F| |TAMS 0x000000070bc00000| PB 0x000000070bc00000| Untracked | 0 +| 95|0x000000070be00000, 0x000000070be00000, 0x000000070c000000| 0%| F| |TAMS 0x000000070be00000| PB 0x000000070be00000| Untracked | 0 +| 96|0x000000070c000000, 0x000000070c000000, 0x000000070c200000| 0%| F| |TAMS 0x000000070c000000| PB 0x000000070c000000| Untracked | 0 +| 97|0x000000070c200000, 0x000000070c200000, 0x000000070c400000| 0%| F| |TAMS 0x000000070c200000| PB 0x000000070c200000| Untracked | 0 +| 98|0x000000070c400000, 0x000000070c400000, 0x000000070c600000| 0%| F| |TAMS 0x000000070c400000| PB 0x000000070c400000| Untracked | 0 +| 99|0x000000070c600000, 0x000000070c600000, 0x000000070c800000| 0%| F| |TAMS 0x000000070c600000| PB 0x000000070c600000| Untracked | 0 +| 100|0x000000070c800000, 0x000000070c800000, 0x000000070ca00000| 0%| F| |TAMS 0x000000070c800000| PB 0x000000070c800000| Untracked | 0 +| 101|0x000000070ca00000, 0x000000070ca00000, 0x000000070cc00000| 0%| F| |TAMS 0x000000070ca00000| PB 0x000000070ca00000| Untracked | 0 +| 102|0x000000070cc00000, 0x000000070cc00000, 0x000000070ce00000| 0%| F| |TAMS 0x000000070cc00000| PB 0x000000070cc00000| Untracked | 0 +| 103|0x000000070ce00000, 0x000000070ce00000, 0x000000070d000000| 0%| F| |TAMS 0x000000070ce00000| PB 0x000000070ce00000| Untracked | 0 +| 104|0x000000070d000000, 0x000000070d000000, 0x000000070d200000| 0%| F| |TAMS 0x000000070d000000| PB 0x000000070d000000| Untracked | 0 +| 105|0x000000070d200000, 0x000000070d200000, 0x000000070d400000| 0%| F| |TAMS 0x000000070d200000| PB 0x000000070d200000| Untracked | 0 +| 106|0x000000070d400000, 0x000000070d400000, 0x000000070d600000| 0%| F| |TAMS 0x000000070d400000| PB 0x000000070d400000| Untracked | 0 +| 107|0x000000070d600000, 0x000000070d600000, 0x000000070d800000| 0%| F| |TAMS 0x000000070d600000| PB 0x000000070d600000| Untracked | 0 +| 108|0x000000070d800000, 0x000000070d800000, 0x000000070da00000| 0%| F| |TAMS 0x000000070d800000| PB 0x000000070d800000| Untracked | 0 +| 109|0x000000070da00000, 0x000000070da00000, 0x000000070dc00000| 0%| F| |TAMS 0x000000070da00000| PB 0x000000070da00000| Untracked | 0 +| 110|0x000000070dc00000, 0x000000070dc00000, 0x000000070de00000| 0%| F| |TAMS 0x000000070dc00000| PB 0x000000070dc00000| Untracked | 0 +| 111|0x000000070de00000, 0x000000070de00000, 0x000000070e000000| 0%| F| |TAMS 0x000000070de00000| PB 0x000000070de00000| Untracked | 0 +| 112|0x000000070e000000, 0x000000070e000000, 0x000000070e200000| 0%| F| |TAMS 0x000000070e000000| PB 0x000000070e000000| Untracked | 0 +| 113|0x000000070e200000, 0x000000070e200000, 0x000000070e400000| 0%| F| |TAMS 0x000000070e200000| PB 0x000000070e200000| Untracked | 0 +| 114|0x000000070e400000, 0x000000070e4ad9d0, 0x000000070e600000| 33%| S|CS|TAMS 0x000000070e400000| PB 0x000000070e400000| Complete | 0 +| 115|0x000000070e600000, 0x000000070e800000, 0x000000070e800000|100%| S|CS|TAMS 0x000000070e600000| PB 0x000000070e600000| Complete | 0 +| 116|0x000000070e800000, 0x000000070e800000, 0x000000070ea00000| 0%| F| |TAMS 0x000000070e800000| PB 0x000000070e800000| Untracked | 0 +| 117|0x000000070ea00000, 0x000000070ea00000, 0x000000070ec00000| 0%| F| |TAMS 0x000000070ea00000| PB 0x000000070ea00000| Untracked | 0 +| 118|0x000000070ec00000, 0x000000070ec00000, 0x000000070ee00000| 0%| F| |TAMS 0x000000070ec00000| PB 0x000000070ec00000| Untracked | 0 +| 119|0x000000070ee00000, 0x000000070ee00000, 0x000000070f000000| 0%| F| |TAMS 0x000000070ee00000| PB 0x000000070ee00000| Untracked | 0 +| 120|0x000000070f000000, 0x000000070f000000, 0x000000070f200000| 0%| F| |TAMS 0x000000070f000000| PB 0x000000070f000000| Untracked | 0 +| 121|0x000000070f200000, 0x000000070f200000, 0x000000070f400000| 0%| F| |TAMS 0x000000070f200000| PB 0x000000070f200000| Untracked | 0 +| 122|0x000000070f400000, 0x000000070f400000, 0x000000070f600000| 0%| F| |TAMS 0x000000070f400000| PB 0x000000070f400000| Untracked | 0 +| 123|0x000000070f600000, 0x000000070f600000, 0x000000070f800000| 0%| F| |TAMS 0x000000070f600000| PB 0x000000070f600000| Untracked | 0 +| 124|0x000000070f800000, 0x000000070f800000, 0x000000070fa00000| 0%| F| |TAMS 0x000000070f800000| PB 0x000000070f800000| Untracked | 0 +| 125|0x000000070fa00000, 0x000000070fa00000, 0x000000070fc00000| 0%| F| |TAMS 0x000000070fa00000| PB 0x000000070fa00000| Untracked | 0 +| 126|0x000000070fc00000, 0x000000070fc00000, 0x000000070fe00000| 0%| F| |TAMS 0x000000070fc00000| PB 0x000000070fc00000| Untracked | 0 +| 127|0x000000070fe00000, 0x000000070ff64b80, 0x0000000710000000| 69%| E| |TAMS 0x000000070fe00000| PB 0x000000070fe00000| Complete | 0 + +Card table byte_map: [0x0000000103810000,0x0000000104010000] _byte_map_base: 0x0000000100010000 + +Marking Bits: (CMBitMap*) 0x0000000153039810 + Bits: [0x000000011c814000, 0x0000000120814000) + +Polling page: 0x0000000102afc000 + +Metaspace: + +Usage: + Non-class: 13.17 MB used. + Class: 1.64 MB used. + Both: 14.82 MB used. + +Virtual space: + Non-class space: 64.00 MB reserved, 13.38 MB ( 21%) committed, 1 nodes. + Class space: 1.00 GB reserved, 1.81 MB ( <1%) committed, 1 nodes. + Both: 1.06 GB reserved, 15.19 MB ( 1%) committed. + +Chunk freelists: + Non-Class: 2.35 MB + Class: 14.17 MB + Both: 16.53 MB + +MaxMetaspaceSize: unlimited +CompressedClassSpaceSize: 1.00 GB +Initial GC threshold: 21.00 MB +Current GC threshold: 21.00 MB +CDS: off + - commit_granule_bytes: 65536. + - commit_granule_words: 8192. + - virtual_space_node_default_size: 8388608. + - enlarge_chunks_in_place: 1. + - use_allocation_guard: 0. + + +Internal statistics: + +num_allocs_failed_limit: 0. +num_arena_births: 342. +num_arena_deaths: 0. +num_vsnodes_births: 2. +num_vsnodes_deaths: 0. +num_space_committed: 243. +num_space_uncommitted: 0. +num_chunks_returned_to_freelist: 0. +num_chunks_taken_from_freelist: 560. +num_chunk_merges: 0. +num_chunk_splits: 335. +num_chunks_enlarged: 197. +num_inconsistent_stats: 0. + +CodeHeap 'non-profiled nmethods': size=120032Kb used=384Kb max_used=384Kb free=119647Kb + bounds [0x00000001152dc000, 0x000000011554c000, 0x000000011c814000] +CodeHeap 'profiled nmethods': size=120016Kb used=2434Kb max_used=2434Kb free=117581Kb + bounds [0x000000010d814000, 0x000000010da84000, 0x0000000114d48000] +CodeHeap 'non-nmethods': size=5712Kb used=1357Kb max_used=1371Kb free=4355Kb + bounds [0x0000000114d48000, 0x0000000114fb8000, 0x00000001152dc000] + total_blobs=1734 nmethods=1258 adapters=383 + compilation: enabled + stopped_count=0, restarted_count=0 + full_count=0 + +Compilation events (20 events): +Event: 2.564 Thread 0x000000015180a200 nmethod 1250 0x000000010da51990 code [0x000000010da51dc0, 0x000000010da52f58] +Event: 2.564 Thread 0x000000015180a200 1227 3 java.util.Arrays::copyOfRange (90 bytes) +Event: 2.564 Thread 0x000000015180a200 nmethod 1227 0x000000010da53690 code [0x000000010da539c0, 0x000000010da54630] +Event: 2.565 Thread 0x000000015180a200 1252 3 jdk.internal.classfile.impl.AbstractElement:: (5 bytes) +Event: 2.565 Thread 0x000000015180a200 nmethod 1252 0x000000010da54b90 code [0x000000010da54d40, 0x000000010da54eb8] +Event: 2.565 Thread 0x000000015180a200 1253 3 java.lang.constant.ConstantUtils::skipOverFieldSignature (296 bytes) +Event: 2.565 Thread 0x000000015180a200 nmethod 1253 0x000000010da54f90 code [0x000000010da55480, 0x000000010da57138] +Event: 2.565 Thread 0x000000015180a200 1254 3 jdk.internal.classfile.impl.DirectCodeBuilder::with (9 bytes) +Event: 2.566 Thread 0x000000015180a200 nmethod 1254 0x000000010da57c10 code [0x000000010da57e40, 0x000000010da58710] +Event: 2.566 Thread 0x000000015180a200 1255 3 jdk.internal.classfile.impl.DirectCodeBuilder::with (30 bytes) +Event: 2.566 Thread 0x000000015180a200 nmethod 1255 0x000000010da58990 code [0x000000010da58bc0, 0x000000010da59330] +Event: 2.566 Thread 0x000000015180a200 1256 3 jdk.internal.classfile.impl.SplitConstantPool::map (145 bytes) +Event: 2.567 Thread 0x000000015180a200 nmethod 1256 0x000000010da59590 code [0x000000010da59880, 0x000000010da5a610] +Event: 2.567 Thread 0x000000015180a200 1258 3 jdk.internal.util.ReferencedKeyMap::removeStaleReferences (30 bytes) +Event: 2.567 Thread 0x000000015180a200 nmethod 1258 0x000000010da5aa90 code [0x000000010da5ac80, 0x000000010da5b060] +Event: 2.567 Thread 0x000000015180a200 1259 3 java.util.stream.Sink$ChainedReference::cancellationRequested (10 bytes) +Event: 2.567 Thread 0x000000015180a200 nmethod 1259 0x000000010da5b190 code [0x000000010da5b340, 0x000000010da5b560] +Event: 2.567 Thread 0x000000015180a200 1257 3 jdk.internal.org.objectweb.asm.MethodVisitor::visitInsn (16 bytes) +Event: 2.567 Thread 0x000000015180a200 nmethod 1257 0x000000010da5b610 code [0x000000010da5b7c0, 0x000000010da5ba18] +Event: 2.568 Thread 0x000000015180a200 1262 3 jdk.internal.classfile.impl.StackMapGenerator::processBlock (2767 bytes) + +GC Heap History (2 events): +Event: 2.558 GC heap before +{Heap before GC invocations=0 (full 0): + garbage-first heap total reserved 4194304K, committed 262144K, used 22528K [0x0000000700000000, 0x0000000800000000) + region size 2048K, 12 young (24576K), 0 survivors (0K) + Metaspace used 14793K, committed 15104K, reserved 1114112K + class space used 1618K, committed 1792K, reserved 1048576K +} +Event: 2.561 GC heap after +{Heap after GC invocations=1 (full 0): + garbage-first heap total reserved 4194304K, committed 262144K, used 2742K [0x0000000700000000, 0x0000000800000000) + region size 2048K, 2 young (4096K), 2 survivors (4096K) + Metaspace used 14793K, committed 15104K, reserved 1114112K + class space used 1618K, committed 1792K, reserved 1048576K +} + +Dll operation events (8 events): +Event: 0.006 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjava.dylib +Event: 0.006 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libzip.dylib +Event: 0.069 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libinstrument.dylib +Event: 0.079 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libnio.dylib +Event: 0.083 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libzip.dylib +Event: 0.122 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjimage.dylib +Event: 2.507 Loaded shared library libsomelib.dylib +Event: 2.511 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libsyslookup.dylib + +Deoptimization events (20 events): +Event: 2.489 Thread 0x0000000153008200 DEOPT PACKING pc=0x00000001153242bc sp=0x000000016d5a2920 +Event: 2.489 Thread 0x0000000153008200 DEOPT UNPACKING pc=0x0000000114d8b01c sp=0x000000016d5a28b0 mode 2 +Event: 2.489 Thread 0x0000000153008200 Uncommon trap: trap_request=0xffffffde fr.pc=0x00000001153242bc relative=0x00000000000000fc +Event: 2.489 Thread 0x0000000153008200 Uncommon trap: reason=class_check action=maybe_recompile pc=0x00000001153242bc method=jdk.internal.misc.Unsafe.allocateUninitializedArray(Ljava/lang/Class;I)Ljava/lang/Object; @ 51 c2 +Event: 2.489 Thread 0x0000000153008200 DEOPT PACKING pc=0x00000001153242bc sp=0x000000016d5a2920 +Event: 2.489 Thread 0x0000000153008200 DEOPT UNPACKING pc=0x0000000114d8b01c sp=0x000000016d5a28b0 mode 2 +Event: 2.499 Thread 0x0000000153008200 Uncommon trap: trap_request=0xffffff45 fr.pc=0x0000000115323920 relative=0x00000000000000e0 +Event: 2.499 Thread 0x0000000153008200 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000115323920 method=sun.net.www.ParseUtil.firstEncodeIndex(Ljava/lang/String;)I @ 51 c2 +Event: 2.499 Thread 0x0000000153008200 DEOPT PACKING pc=0x0000000115323920 sp=0x000000016d5a2780 +Event: 2.499 Thread 0x0000000153008200 DEOPT UNPACKING pc=0x0000000114d8b01c sp=0x000000016d5a2700 mode 2 +Event: 2.544 Thread 0x0000000153008200 DEOPT PACKING pc=0x000000010d9ef3c8 sp=0x000000016d5a2500 +Event: 2.544 Thread 0x0000000153008200 DEOPT UNPACKING pc=0x0000000114d8ae7c sp=0x000000016d5a2300 mode 3 +Event: 2.562 Thread 0x0000000153008200 Uncommon trap: trap_request=0xffffff45 fr.pc=0x000000011532e4e8 relative=0x00000000000000a8 +Event: 2.562 Thread 0x0000000153008200 Uncommon trap: reason=unstable_if action=reinterpret pc=0x000000011532e4e8 method=java.lang.ref.ReferenceQueue.headIsNull()Z @ 4 c2 +Event: 2.562 Thread 0x0000000153008200 DEOPT PACKING pc=0x000000011532e4e8 sp=0x000000016d5a1890 +Event: 2.562 Thread 0x0000000153008200 DEOPT UNPACKING pc=0x0000000114d8b01c sp=0x000000016d5a1750 mode 2 +Event: 2.562 Thread 0x0000000153008200 Uncommon trap: trap_request=0xffffff45 fr.pc=0x0000000115320dec relative=0x000000000000006c +Event: 2.562 Thread 0x0000000153008200 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000115320dec method=java.lang.ref.ReferenceQueue.headIsNull()Z @ 4 c2 +Event: 2.562 Thread 0x0000000153008200 DEOPT PACKING pc=0x0000000115320dec sp=0x000000016d5a1800 +Event: 2.562 Thread 0x0000000153008200 DEOPT UNPACKING pc=0x0000000114d8b01c sp=0x000000016d5a1730 mode 2 + +Classes loaded (20 events): +Event: 2.568 Loading class jdk/internal/classfile/impl/BufferedCodeBuilder +Event: 2.568 Loading class jdk/internal/classfile/impl/BufferedCodeBuilder done +Event: 2.568 Loading class jdk/internal/classfile/impl/TransformingCodeBuilder +Event: 2.568 Loading class jdk/internal/classfile/impl/TransformingCodeBuilder done +Event: 2.569 Loading class java/lang/classfile/instruction/ThrowInstruction +Event: 2.569 Loading class java/lang/classfile/instruction/ThrowInstruction done +Event: 2.569 Loading class jdk/internal/classfile/impl/AbstractInstruction$UnboundThrowInstruction +Event: 2.569 Loading class jdk/internal/classfile/impl/AbstractInstruction$UnboundThrowInstruction done +Event: 2.569 Loading class java/lang/classfile/instruction/ExceptionCatch +Event: 2.569 Loading class java/lang/classfile/instruction/ExceptionCatch done +Event: 2.569 Loading class jdk/internal/classfile/impl/AbstractPseudoInstruction$ExceptionCatchImpl +Event: 2.569 Loading class jdk/internal/classfile/impl/AbstractPseudoInstruction +Event: 2.569 Loading class jdk/internal/classfile/impl/AbstractPseudoInstruction done +Event: 2.569 Loading class jdk/internal/classfile/impl/AbstractPseudoInstruction$ExceptionCatchImpl done +Event: 2.569 Loading class jdk/internal/classfile/impl/StackMapGenerator$RawExceptionCatch +Event: 2.569 Loading class jdk/internal/classfile/impl/StackMapGenerator$RawExceptionCatch done +Event: 2.569 Loading class jdk/internal/classfile/impl/SplitConstantPool$1 +Event: 2.569 Loading class jdk/internal/classfile/impl/SplitConstantPool$1 done +Event: 2.570 Loading class java/lang/invoke/ConstantBootstraps +Event: 2.570 Loading class java/lang/invoke/ConstantBootstraps done + +Classes unloaded (0 events): +No events + +Classes redefined (0 events): +No events + +Internal exceptions (20 events): +Event: 2.544 Thread 0x0000000153008200 Exception (0x000000070e87d458) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 2.545 Thread 0x0000000153008200 Exception (0x000000070e8a0820) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 2.546 Thread 0x0000000153008200 Exception (0x000000070e8a4e70) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 2.546 Thread 0x0000000153008200 Exception (0x000000070e8a8a28) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 2.546 Thread 0x0000000153008200 Exception (0x000000070e8b0578) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 2.546 Thread 0x0000000153008200 Exception (0x000000070e8b7550) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 2.546 Thread 0x0000000153008200 Exception (0x000000070e8be520) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 2.546 Thread 0x0000000153008200 Exception (0x000000070e8c2fd8) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 2.547 Thread 0x0000000153008200 Exception (0x000000070e8e12b0) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 2.551 Thread 0x0000000153008200 Exception (0x000000070e92fd70) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 841] +Event: 2.552 Thread 0x0000000153008200 Exception (0x000000070e9468c8) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 2.555 Thread 0x0000000153008200 Exception (0x000000070e9b1518) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 2.556 Thread 0x0000000153008200 Exception (0x000000070e9bc2b0) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 2.556 Thread 0x0000000153008200 Exception (0x000000070e9cdbf0) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 2.557 Thread 0x0000000153008200 Exception (0x000000070e9ea260) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 2.557 Thread 0x0000000153008200 Exception (0x000000070e9ef730) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 2.563 Thread 0x0000000153008200 Exception (0x000000070fe72398) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 2.567 Thread 0x0000000153008200 Exception (0x000000070feb20c0) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 2.570 Thread 0x0000000153008200 Exception (0x000000070ff0e030) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 2.570 Thread 0x0000000153008200 Exception (0x000000070ff22090) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] + +ZGC Phase Switch (0 events): +No events + +VM Operations (20 events): +Event: 0.258 Executing VM operation: ICBufferFull +Event: 0.258 Executing VM operation: ICBufferFull done +Event: 0.262 Executing VM operation: HandshakeAllThreads (Deoptimize) +Event: 0.262 Executing VM operation: HandshakeAllThreads (Deoptimize) done +Event: 0.267 Executing VM operation: get/set locals +Event: 0.267 Executing VM operation: get/set locals done +Event: 0.268 Executing VM operation: get/set locals +Event: 0.268 Executing VM operation: get/set locals done +Event: 2.064 Executing VM operation: get/set locals +Event: 2.064 Executing VM operation: get/set locals done +Event: 2.064 Executing VM operation: get/set locals +Event: 2.064 Executing VM operation: get/set locals done +Event: 2.067 Executing VM operation: get/set locals +Event: 2.067 Executing VM operation: get/set locals done +Event: 2.492 Executing VM operation: ChangeBreakpoints +Event: 2.493 Executing VM operation: ChangeBreakpoints done +Event: 2.493 Executing VM operation: ChangeBreakpoints +Event: 2.493 Executing VM operation: ChangeBreakpoints done +Event: 2.557 Executing VM operation: G1CollectForAllocation (G1 Evacuation Pause) +Event: 2.561 Executing VM operation: G1CollectForAllocation (G1 Evacuation Pause) done + +Events (20 events): +Event: 0.023 Thread 0x000000015201a200 Thread added: 0x000000015201a200 +Event: 0.023 Protecting memory [0x000000016e934000,0x000000016e940000] with protection modes 0 +Event: 0.024 Thread 0x000000015180f200 Thread added: 0x000000015180f200 +Event: 0.024 Protecting memory [0x000000016eb40000,0x000000016eb4c000] with protection modes 0 +Event: 0.024 Thread 0x000000015180e400 Thread added: 0x000000015180e400 +Event: 0.024 Protecting memory [0x000000016ed4c000,0x000000016ed58000] with protection modes 0 +Event: 0.024 Thread 0x0000000151809a00 Thread added: 0x0000000151809a00 +Event: 0.024 Protecting memory [0x000000016ef58000,0x000000016ef64000] with protection modes 0 +Event: 0.024 Thread 0x000000015180a200 Thread added: 0x000000015180a200 +Event: 0.024 Protecting memory [0x000000016f164000,0x000000016f170000] with protection modes 0 +Event: 0.044 Thread 0x0000000131008200 Thread added: 0x0000000131008200 +Event: 0.044 Protecting memory [0x000000016f370000,0x000000016f37c000] with protection modes 0 +Event: 0.059 Thread 0x00000001518c8200 Thread added: 0x00000001518c8200 +Event: 0.059 Protecting memory [0x000000016f57c000,0x000000016f588000] with protection modes 0 +Event: 0.059 Thread 0x00000001518c8a00 Thread added: 0x00000001518c8a00 +Event: 0.059 Protecting memory [0x000000016f788000,0x000000016f794000] with protection modes 0 +Event: 0.059 Thread 0x00000001518c9200 Thread added: 0x00000001518c9200 +Event: 0.059 Protecting memory [0x000000016f994000,0x000000016f9a0000] with protection modes 0 +Event: 0.075 Thread 0x000000013102fa00 Thread added: 0x000000013102fa00 +Event: 0.075 Protecting memory [0x000000016fba0000,0x000000016fbac000] with protection modes 0 + + +Dynamic libraries: +0x0000000102f70000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjli.dylib +0x00000001a96bb000 /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa +0x0000000192c62000 /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit +0x0000000195cce000 /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData +0x0000000190515000 /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation +0x000000019bfdc000 /usr/lib/libSystem.B.dylib +0x0000000193f9f000 /System/Library/PrivateFrameworks/UIFoundation.framework/Versions/A/UIFoundation +0x000000022ab7f000 /System/Library/PrivateFrameworks/CollectionViewCore.framework/Versions/A/CollectionViewCore +0x00000001a3255000 /System/Library/PrivateFrameworks/RemoteViewServices.framework/Versions/A/RemoteViewServices +0x0000000199e89000 /System/Library/PrivateFrameworks/XCTTargetBootstrap.framework/Versions/A/XCTTargetBootstrap +0x000000019e618000 /System/Library/PrivateFrameworks/InternationalSupport.framework/Versions/A/InternationalSupport +0x000000019e66c000 /System/Library/PrivateFrameworks/UserActivity.framework/Versions/A/UserActivity +0x000000024efd6000 /System/Library/PrivateFrameworks/WindowManagement.framework/Versions/A/WindowManagement +0x0000000190195000 /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration +0x000000019da86000 /usr/lib/libspindump.dylib +0x0000000194154000 /System/Library/Frameworks/UniformTypeIdentifiers.framework/Versions/A/UniformTypeIdentifiers +0x0000000197d00000 /usr/lib/libapp_launch_measurement.dylib +0x0000000197126000 /System/Library/PrivateFrameworks/CoreAnalytics.framework/Versions/A/CoreAnalytics +0x0000000197d07000 /System/Library/PrivateFrameworks/CoreAutoLayout.framework/Versions/A/CoreAutoLayout +0x00000001996a9000 /System/Library/Frameworks/Metal.framework/Versions/A/Metal +0x000000019a631000 /usr/lib/liblangid.dylib +0x0000000199e8f000 /System/Library/PrivateFrameworks/CoreSVG.framework/Versions/A/CoreSVG +0x0000000194b19000 /System/Library/PrivateFrameworks/SkyLight.framework/Versions/A/SkyLight +0x0000000194fba000 /System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics +0x00000001a392f000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate +0x000000019d8e0000 /System/Library/PrivateFrameworks/IconServices.framework/Versions/A/IconServices +0x0000000199687000 /System/Library/Frameworks/IOSurface.framework/Versions/A/IOSurface +0x0000000197155000 /usr/lib/libDiagnosticMessagesClient.dylib +0x000000019bf1e000 /usr/lib/libz.1.dylib +0x00000001a70d4000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices +0x0000000199e71000 /System/Library/PrivateFrameworks/DFRFoundation.framework/Versions/A/DFRFoundation +0x00000001924bc000 /usr/lib/libicucore.A.dylib +0x000000019f676000 /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox +0x000000019e627000 /System/Library/PrivateFrameworks/DataDetectorsCore.framework/Versions/A/DataDetectorsCore +0x00000001b809a000 /System/Library/PrivateFrameworks/TextInput.framework/Versions/A/TextInput +0x0000000194a6a000 /usr/lib/libMobileGestalt.dylib +0x0000000199bad000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox +0x000000019762c000 /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore +0x00000001920e9000 /System/Library/Frameworks/Security.framework/Versions/A/Security +0x00000001a3295000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SpeechRecognition.framework/Versions/A/SpeechRecognition +0x0000000197a2e000 /System/Library/PrivateFrameworks/CoreUI.framework/Versions/A/CoreUI +0x00000001919e2000 /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio +0x0000000197239000 /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration +0x000000019dee2000 /System/Library/PrivateFrameworks/MultitouchSupport.framework/Versions/A/MultitouchSupport +0x0000000194a68000 /usr/lib/libenergytrace.dylib +0x00000001ad793000 /System/Library/PrivateFrameworks/RenderBox.framework/Versions/A/RenderBox +0x0000000192b16000 /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit +0x00000001a366a000 /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices +0x0000000197c8c000 /System/Library/PrivateFrameworks/PerformanceAnalysis.framework/Versions/A/PerformanceAnalysis +0x00000001e603f000 /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL +0x0000000197d51000 /usr/lib/libxml2.2.dylib +0x000000019b360000 /System/Library/PrivateFrameworks/MobileKeyBag.framework/Versions/A/MobileKeyBag +0x000000018ef80000 /usr/lib/libobjc.A.dylib +0x000000018f274000 /usr/lib/libc++.1.dylib +0x00000001a35e7000 /System/Library/Frameworks/Accessibility.framework/Versions/A/Accessibility +0x000000019569a000 /System/Library/Frameworks/ColorSync.framework/Versions/A/ColorSync +0x000000018f3c0000 /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation +0x000000019a1ec000 /System/Library/Frameworks/CoreImage.framework/Versions/A/CoreImage +0x00000001917ed000 /System/Library/Frameworks/CoreText.framework/Versions/A/CoreText +0x00000001ea89e000 /System/Library/Frameworks/CoreTransferable.framework/Versions/A/CoreTransferable +0x00000001ead63000 /System/Library/Frameworks/DeveloperToolsSupport.framework/Versions/A/DeveloperToolsSupport +0x0000000199eca000 /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO +0x0000000224d1f000 /System/Library/Frameworks/Symbols.framework/Versions/A/Symbols +0x000000019bfe2000 /System/Library/PrivateFrameworks/SoftLinking.framework/Versions/A/SoftLinking +0x000000019f028000 /usr/lib/swift/libswiftCore.dylib +0x00000001b4d27000 /usr/lib/swift/libswiftCoreFoundation.dylib +0x00000001b2790000 /usr/lib/swift/libswiftCoreGraphics.dylib +0x00000001b4d71000 /usr/lib/swift/libswiftCoreImage.dylib +0x00000001b2797000 /usr/lib/swift/libswiftDarwin.dylib +0x00000001a4cda000 /usr/lib/swift/libswiftDispatch.dylib +0x00000001b4d72000 /usr/lib/swift/libswiftIOKit.dylib +0x00000001c07cc000 /usr/lib/swift/libswiftMetal.dylib +0x00000001cde91000 /usr/lib/swift/libswiftOSLog.dylib +0x00000001a754f000 /usr/lib/swift/libswiftObjectiveC.dylib +0x00000001c4f00000 /usr/lib/swift/libswiftQuartzCore.dylib +0x00000001c9005000 /usr/lib/swift/libswiftUniformTypeIdentifiers.dylib +0x00000001b4d39000 /usr/lib/swift/libswiftXPC.dylib +0x000000025747d000 /usr/lib/swift/libswift_Concurrency.dylib +0x00000001a7553000 /usr/lib/swift/libswiftos.dylib +0x00000001b7ffe000 /usr/lib/swift/libswiftsimd.dylib +0x000000019c191000 /usr/lib/libcompression.dylib +0x000000019e572000 /System/Library/PrivateFrameworks/TextureIO.framework/Versions/A/TextureIO +0x000000019d58c000 /usr/lib/libate.dylib +0x000000019bfd6000 /usr/lib/system/libcache.dylib +0x000000019bf90000 /usr/lib/system/libcommonCrypto.dylib +0x000000019bfbc000 /usr/lib/system/libcompiler_rt.dylib +0x000000019bfb2000 /usr/lib/system/libcopyfile.dylib +0x000000018f0c4000 /usr/lib/system/libcorecrypto.dylib +0x000000018f1aa000 /usr/lib/system/libdispatch.dylib +0x000000018f365000 /usr/lib/system/libdyld.dylib +0x000000019bfcc000 /usr/lib/system/libkeymgr.dylib +0x000000019bf68000 /usr/lib/system/libmacho.dylib +0x000000019b448000 /usr/lib/system/libquarantine.dylib +0x000000019bfc9000 /usr/lib/system/libremovefile.dylib +0x0000000194ae0000 /usr/lib/system/libsystem_asl.dylib +0x000000018f059000 /usr/lib/system/libsystem_blocks.dylib +0x000000018f1f5000 /usr/lib/system/libsystem_c.dylib +0x000000019bfc0000 /usr/lib/system/libsystem_collections.dylib +0x000000019a620000 /usr/lib/system/libsystem_configuration.dylib +0x000000019965c000 /usr/lib/system/libsystem_containermanager.dylib +0x000000019bbff000 /usr/lib/system/libsystem_coreservices.dylib +0x0000000192783000 /usr/lib/system/libsystem_darwin.dylib +0x00000002577ca000 /usr/lib/system/libsystem_darwindirectory.dylib +0x000000019bfcd000 /usr/lib/system/libsystem_dnssd.dylib +0x00000002577ce000 /usr/lib/system/libsystem_eligibility.dylib +0x000000018f1f2000 /usr/lib/system/libsystem_featureflags.dylib +0x000000018f393000 /usr/lib/system/libsystem_info.dylib +0x000000019bf2d000 /usr/lib/system/libsystem_m.dylib +0x000000018f16d000 /usr/lib/system/libsystem_malloc.dylib +0x0000000194a4d000 /usr/lib/system/libsystem_networkextension.dylib +0x0000000192bf9000 /usr/lib/system/libsystem_notify.dylib +0x000000019a625000 /usr/lib/system/libsystem_sandbox.dylib +0x00000002577d2000 /usr/lib/system/libsystem_sanitizers.dylib +0x000000019bfc5000 /usr/lib/system/libsystem_secinit.dylib +0x000000018f31d000 /usr/lib/system/libsystem_kernel.dylib +0x000000018f38b000 /usr/lib/system/libsystem_platform.dylib +0x000000018f358000 /usr/lib/system/libsystem_pthread.dylib +0x00000001964d0000 /usr/lib/system/libsystem_symptoms.dylib +0x000000018f0a9000 /usr/lib/system/libsystem_trace.dylib +0x000000019bf9e000 /usr/lib/system/libunwind.dylib +0x000000018f05e000 /usr/lib/system/libxpc.dylib +0x000000018f301000 /usr/lib/libc++abi.dylib +0x000000019bfaa000 /usr/lib/liboah.dylib +0x000000019d438000 /usr/lib/liblzma.5.dylib +0x000000019bfde000 /usr/lib/libfakelink.dylib +0x0000000194679000 /System/Library/Frameworks/CFNetwork.framework/Versions/A/CFNetwork +0x000000019c032000 /usr/lib/libarchive.2.dylib +0x00000001a1568000 /System/Library/Frameworks/Combine.framework/Versions/A/Combine +0x000000022ab93000 /System/Library/PrivateFrameworks/CollectionsInternal.framework/Versions/A/CollectionsInternal +0x0000000241543000 /System/Library/PrivateFrameworks/ReflectionInternal.framework/Versions/A/ReflectionInternal +0x0000000241ad5000 /System/Library/PrivateFrameworks/RuntimeInternal.framework/Versions/A/RuntimeInternal +0x00000002575d1000 /usr/lib/swift/libswift_StringProcessing.dylib +0x0000000192a94000 /System/Library/PrivateFrameworks/CoreServicesInternal.framework/Versions/A/CoreServicesInternal +0x000000019b46f000 /usr/lib/libbsm.0.dylib +0x000000019bf70000 /usr/lib/system/libkxld.dylib +0x0000000197cc8000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/FSEvents.framework/Versions/A/FSEvents +0x000000019278e000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore +0x000000019719e000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata +0x000000019bc05000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices +0x000000019c0bb000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit +0x0000000196451000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE +0x000000018f899000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices +0x000000019d3e1000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/DictionaryServices.framework/Versions/A/DictionaryServices +0x0000000197cd5000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SharedFileList.framework/Versions/A/SharedFileList +0x000000019c15b000 /usr/lib/libapple_nghttp2.dylib +0x00000001960c5000 /usr/lib/libsqlite3.dylib +0x00000001964d9000 /System/Library/Frameworks/Network.framework/Versions/A/Network +0x0000000255e8e000 /usr/lib/libCoreEntitlements.dylib +0x000000023c44d000 /System/Library/PrivateFrameworks/MessageSecurity.framework/Versions/A/MessageSecurity +0x00000001960ab000 /System/Library/PrivateFrameworks/ProtocolBuffer.framework/Versions/A/ProtocolBuffer +0x000000019bb2e000 /System/Library/PrivateFrameworks/AppleFSCompression.framework/Versions/A/AppleFSCompression +0x000000019b457000 /usr/lib/libcoretls.dylib +0x000000019d457000 /usr/lib/libcoretls_cfhelpers.dylib +0x000000019c18b000 /usr/lib/libpam.2.dylib +0x000000019d4c9000 /usr/lib/libxar.1.dylib +0x000000019d8b7000 /usr/lib/libheimdal-asn1.dylib +0x0000000194678000 /usr/lib/libnetwork.dylib +0x000000019bfe3000 /usr/lib/libpcap.A.dylib +0x00000001964c5000 /usr/lib/libdns_services.dylib +0x000000019a62d000 /System/Library/PrivateFrameworks/AppleSystemInfo.framework/Versions/A/AppleSystemInfo +0x000000019b155000 /System/Library/PrivateFrameworks/IOMobileFramebuffer.framework/Versions/A/IOMobileFramebuffer +0x0000000257528000 /usr/lib/swift/libswift_RegexParser.dylib +0x000000019bbf2000 /usr/lib/libbz2.1.0.dylib +0x000000019b44b000 /usr/lib/libCheckFix.dylib +0x0000000194af8000 /System/Library/PrivateFrameworks/TCC.framework/Versions/A/TCC +0x000000019a633000 /System/Library/PrivateFrameworks/CoreNLP.framework/Versions/A/CoreNLP +0x0000000197157000 /System/Library/PrivateFrameworks/MetadataUtilities.framework/Versions/A/MetadataUtilities +0x000000019b481000 /usr/lib/libmecab.dylib +0x0000000190229000 /usr/lib/libCRFSuite.dylib +0x000000019b4dd000 /usr/lib/libgermantok.dylib +0x000000019c132000 /usr/lib/libThaiTokenizer.dylib +0x0000000197242000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.framework/Versions/A/vImage +0x00000001a3641000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/vecLib +0x000000019d510000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvMisc.dylib +0x000000019b030000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvDSP.dylib +0x000000018fca0000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib +0x000000019c266000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib +0x000000019b4e0000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLinearAlgebra.dylib +0x000000019c176000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparseBLAS.dylib +0x000000019c261000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libQuadrature.dylib +0x000000019a75c000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBNNS.dylib +0x000000019012e000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparse.dylib +0x000000023ab9c000 /System/Library/PrivateFrameworks/MIL.framework/Versions/A/MIL +0x000000019c019000 /usr/lib/libiconv.2.dylib +0x000000019bf64000 /usr/lib/libcharset.1.dylib +0x0000000197ca8000 /System/Library/Frameworks/OpenDirectory.framework/Versions/A/Frameworks/CFOpenDirectory.framework/Versions/A/CFOpenDirectory +0x0000000197c98000 /System/Library/Frameworks/OpenDirectory.framework/Versions/A/OpenDirectory +0x000000019d459000 /System/Library/PrivateFrameworks/APFS.framework/Versions/A/APFS +0x000000019b387000 /System/Library/Frameworks/SecurityFoundation.framework/Versions/A/SecurityFoundation +0x000000019d4d8000 /usr/lib/libutil.dylib +0x0000000238cfd000 /System/Library/PrivateFrameworks/InstalledContentLibrary.framework/Versions/A/InstalledContentLibrary +0x0000000192ad5000 /System/Library/PrivateFrameworks/CoreServicesStore.framework/Versions/A/CoreServicesStore +0x0000000228340000 /System/Library/PrivateFrameworks/AppleMobileFileIntegrity.framework/Versions/A/AppleMobileFileIntegrity +0x00000001b4cf5000 /usr/lib/libmis.dylib +0x00000001c53e7000 /System/Library/PrivateFrameworks/MobileSystemServices.framework/Versions/A/MobileSystemServices +0x00000001e3449000 /System/Library/PrivateFrameworks/ConfigProfileHelper.framework/Versions/A/ConfigProfileHelper +0x000000019c134000 /System/Library/PrivateFrameworks/AppleSauce.framework/Versions/A/AppleSauce +0x0000000191173000 /System/Library/PrivateFrameworks/LanguageModeling.framework/Versions/A/LanguageModeling +0x000000019d4dc000 /usr/lib/libxslt.1.dylib +0x000000019c020000 /usr/lib/libcmph.dylib +0x000000019b121000 /System/Library/PrivateFrameworks/CoreEmoji.framework/Versions/A/CoreEmoji +0x000000019a756000 /System/Library/PrivateFrameworks/LinguisticData.framework/Versions/A/LinguisticData +0x000000019003c000 /System/Library/PrivateFrameworks/Lexicon.framework/Versions/A/Lexicon +0x000000019b415000 /System/Library/PrivateFrameworks/BackgroundTaskManagement.framework/Versions/A/BackgroundTaskManagement +0x0000000256078000 /usr/lib/libTLE.dylib +0x000000019dda8000 /System/Library/PrivateFrameworks/AppleJPEG.framework/Versions/A/AppleJPEG +0x000000019d89c000 /usr/lib/libexpat.1.dylib +0x000000019e3d0000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libPng.dylib +0x000000019e3fb000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib +0x000000019e4e6000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libGIF.dylib +0x000000019ddee000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJP2.dylib +0x000000019e48b000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib +0x000000019e482000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libRadiance.dylib +0x0000000199a48000 /System/Library/PrivateFrameworks/FontServices.framework/libFontParser.dylib +0x00000001963ea000 /System/Library/PrivateFrameworks/RunningBoardServices.framework/Versions/A/RunningBoardServices +0x00000001a9f95000 /System/Library/PrivateFrameworks/IOSurfaceAccelerator.framework/Versions/A/IOSurfaceAccelerator +0x000000019dede000 /System/Library/PrivateFrameworks/WatchdogClient.framework/Versions/A/WatchdogClient +0x0000000191359000 /System/Library/Frameworks/CoreDisplay.framework/Versions/A/CoreDisplay +0x00000001998ff000 /System/Library/Frameworks/CoreMedia.framework/Versions/A/CoreMedia +0x000000019969f000 /System/Library/PrivateFrameworks/IOAccelerator.framework/Versions/A/IOAccelerator +0x0000000197e3b000 /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo +0x000000019c189000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/MetalPerformanceShaders +0x000000019df21000 /System/Library/Frameworks/VideoToolbox.framework/Versions/A/VideoToolbox +0x0000000197ed7000 /System/Library/PrivateFrameworks/UserManagement.framework/Versions/A/UserManagement +0x0000000196311000 /System/Library/PrivateFrameworks/BaseBoard.framework/Versions/A/BaseBoard +0x000000019a62b000 /System/Library/PrivateFrameworks/AggregateDictionary.framework/Versions/A/AggregateDictionary +0x000000022817a000 /System/Library/PrivateFrameworks/AppleKeyStore.framework/Versions/A/AppleKeyStore +0x000000019e47d000 /System/Library/PrivateFrameworks/GPUWrangler.framework/Versions/A/GPUWrangler +0x000000019e45d000 /System/Library/PrivateFrameworks/IOPresentment.framework/Versions/A/IOPresentment +0x000000019e485000 /System/Library/PrivateFrameworks/DSExternalDisplay.framework/Versions/A/DSExternalDisplay +0x0000000234d8a000 /System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/32023/Libraries/libllvm-flatbuffers.dylib +0x00000001e6032000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCoreFSCache.dylib +0x00000002319ee000 /System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/32023/Libraries/libGPUCompilerUtils.dylib +0x000000019e4ec000 /System/Library/PrivateFrameworks/CMCaptureCore.framework/Versions/A/CMCaptureCore +0x00000001eae86000 /System/Library/Frameworks/ExtensionFoundation.framework/Versions/A/ExtensionFoundation +0x00000001a5543000 /System/Library/PrivateFrameworks/CoreTime.framework/Versions/A/CoreTime +0x000000019da70000 /System/Library/PrivateFrameworks/AppServerSupport.framework/Versions/A/AppServerSupport +0x00000001a0004000 /System/Library/PrivateFrameworks/perfdata.framework/Versions/A/perfdata +0x000000019147d000 /System/Library/PrivateFrameworks/AudioToolboxCore.framework/Versions/A/AudioToolboxCore +0x00000001998d5000 /System/Library/PrivateFrameworks/caulk.framework/Versions/A/caulk +0x000000019f872000 /usr/lib/libAudioStatistics.dylib +0x00000001b402e000 /System/Library/PrivateFrameworks/SystemPolicy.framework/Versions/A/SystemPolicy +0x000000019fb4b000 /usr/lib/libSMC.dylib +0x00000001a953d000 /System/Library/Frameworks/CoreMIDI.framework/Versions/A/CoreMIDI +0x000000019e397000 /usr/lib/libAudioToolboxUtility.dylib +0x00000001af42f000 /System/Library/PrivateFrameworks/OSAServicesClient.framework/Versions/A/OSAServicesClient +0x00000001a0012000 /usr/lib/libperfcheck.dylib +0x00000001a4ffa000 /System/Library/PrivateFrameworks/BoardServices.framework/Versions/A/BoardServices +0x000000019d784000 /System/Library/PrivateFrameworks/PlugInKit.framework/Versions/A/PlugInKit +0x000000019b379000 /System/Library/PrivateFrameworks/AssertionServices.framework/Versions/A/AssertionServices +0x00000001a864e000 /System/Library/PrivateFrameworks/ASEProcessing.framework/Versions/A/ASEProcessing +0x00000001d1318000 /System/Library/PrivateFrameworks/Symbolication.framework/Versions/A/Symbolication +0x0000000240330000 /System/Library/PrivateFrameworks/PhotosensitivityProcessing.framework/Versions/A/PhotosensitivityProcessing +0x000000019da21000 /System/Library/PrivateFrameworks/GraphVisualizer.framework/Versions/A/GraphVisualizer +0x00000001e6094000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib +0x00000001e6053000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGFXShared.dylib +0x00000001e622c000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib +0x00000001e605c000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLImage.dylib +0x00000001e6050000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCVMSPluginSupport.dylib +0x0000000256030000 /usr/lib/libRosetta.dylib +0x00000001e6039000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCoreVMClient.dylib +0x000000022fbf4000 /System/Library/PrivateFrameworks/FontServices.framework/Versions/A/FontServices +0x000000019da2d000 /System/Library/PrivateFrameworks/OTSVG.framework/Versions/A/OTSVG +0x00000001979dc000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/Resources/libFontRegistry.dylib +0x000000019da7b000 /System/Library/PrivateFrameworks/FontServices.framework/libhvf.dylib +0x000000022fbf5000 /System/Library/PrivateFrameworks/FontServices.framework/libXTFontStaticRegistryData.dylib +0x000000019a572000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSCore.framework/Versions/A/MPSCore +0x000000019ba9c000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSImage.framework/Versions/A/MPSImage +0x000000019b4f5000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSNeuralNetwork.framework/Versions/A/MPSNeuralNetwork +0x000000019b940000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSMatrix.framework/Versions/A/MPSMatrix +0x000000019b74b000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSRayIntersector.framework/Versions/A/MPSRayIntersector +0x000000019b972000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSNDArray.framework/Versions/A/MPSNDArray +0x00000001ec760000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSFunctions.framework/Versions/A/MPSFunctions +0x00000001ec745000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSBenchmarkLoop.framework/Versions/A/MPSBenchmarkLoop +0x000000018fb54000 /System/Library/PrivateFrameworks/MetalTools.framework/Versions/A/MetalTools +0x00000001b91d7000 /System/Library/PrivateFrameworks/IOAccelMemoryInfo.framework/Versions/A/IOAccelMemoryInfo +0x00000001c52e0000 /System/Library/PrivateFrameworks/kperf.framework/Versions/A/kperf +0x00000001b4d1a000 /System/Library/PrivateFrameworks/GPURawCounter.framework/Versions/A/GPURawCounter +0x00000001a5415000 /System/Library/PrivateFrameworks/CoreSymbolication.framework/Versions/A/CoreSymbolication +0x00000001b4cc6000 /System/Library/PrivateFrameworks/MallocStackLogging.framework/Versions/A/MallocStackLogging +0x000000019d626000 /System/Library/PrivateFrameworks/CrashReporterSupport.framework/Versions/A/CrashReporterSupport +0x00000001a53d0000 /System/Library/PrivateFrameworks/DebugSymbols.framework/Versions/A/DebugSymbols +0x00000001c3c47000 /System/Library/PrivateFrameworks/OSAnalytics.framework/Versions/A/OSAnalytics +0x000000024d229000 /System/Library/PrivateFrameworks/VideoToolboxParavirtualizationSupport.framework/Versions/A/VideoToolboxParavirtualizationSupport +0x000000019d850000 /System/Library/PrivateFrameworks/AppleVA.framework/Versions/A/AppleVA +0x000000019f8ba000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS +0x0000000195849000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices +0x000000019e4fa000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/PrintCore +0x000000019fca4000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/QD.framework/Versions/A/QD +0x000000019fc98000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSyncLegacy.framework/Versions/A/ColorSyncLegacy +0x000000019f88a000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis +0x000000019e4b6000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATSUI.framework/Versions/A/ATSUI +0x000000019fc2b000 /usr/lib/libcups.2.dylib +0x00000001a0020000 /System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos +0x00000001a0031000 /System/Library/Frameworks/GSS.framework/Versions/A/GSS +0x000000019f939000 /usr/lib/libresolv.9.dylib +0x000000019da8c000 /System/Library/PrivateFrameworks/Heimdal.framework/Versions/A/Heimdal +0x00000001a74bc000 /System/Library/Frameworks/Kerberos.framework/Versions/A/Libraries/libHeimdalProxy.dylib +0x00000001a008b000 /System/Library/PrivateFrameworks/CommonAuth.framework/Versions/A/CommonAuth +0x00000001e9c6c000 /System/Library/Frameworks/AVFAudio.framework/Versions/A/AVFAudio +0x00000001af47e000 /System/Library/PrivateFrameworks/AXCoreUtilities.framework/Versions/A/AXCoreUtilities +0x000000023a274000 /System/Library/PrivateFrameworks/IsolatedCoreAudioClient.framework/Versions/A/IsolatedCoreAudioClient +0x000000019f7f6000 /System/Library/PrivateFrameworks/AudioSession.framework/Versions/A/AudioSession +0x00000001a1307000 /System/Library/Frameworks/IOBluetooth.framework/Versions/A/IOBluetooth +0x000000019d95b000 /System/Library/PrivateFrameworks/MediaExperience.framework/Versions/A/MediaExperience +0x000000019f635000 /System/Library/PrivateFrameworks/AudioSession.framework/libSessionUtility.dylib +0x000000019fcb0000 /System/Library/PrivateFrameworks/AudioResourceArbitration.framework/Versions/A/AudioResourceArbitration +0x00000001a4388000 /System/Library/PrivateFrameworks/PowerLog.framework/Versions/A/PowerLog +0x00000001a42a6000 /System/Library/Frameworks/CoreBluetooth.framework/Versions/A/CoreBluetooth +0x00000001a74bd000 /System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit +0x000000019b1e2000 /System/Library/PrivateFrameworks/CoreUtils.framework/Versions/A/CoreUtils +0x000000022de3f000 /System/Library/PrivateFrameworks/CoreUtilsExtras.framework/Versions/A/CoreUtilsExtras +0x0000000238b8a000 /System/Library/PrivateFrameworks/IO80211.framework/Versions/A/IO80211 +0x00000001a4f3e000 /System/Library/PrivateFrameworks/FrontBoardServices.framework/Versions/A/FrontBoardServices +0x00000001a6a85000 /System/Library/PrivateFrameworks/BackBoardServices.framework/Versions/A/BackBoardServices +0x000000019d8c2000 /System/Library/PrivateFrameworks/IconFoundation.framework/Versions/A/IconFoundation +0x00000001a3281000 /System/Library/PrivateFrameworks/SpeechRecognitionCore.framework/Versions/A/SpeechRecognitionCore +0x00000001af49d000 /usr/lib/libAccessibility.dylib +0x00000001a397b000 /System/Library/Frameworks/MediaAccessibility.framework/Versions/A/MediaAccessibility +0x00000001d49cc000 /System/Library/Frameworks/OSLog.framework/Versions/A/OSLog +0x00000001b4c54000 /System/Library/PrivateFrameworks/LoggingSupport.framework/Versions/A/LoggingSupport +0x000000010417c000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/server/libjvm.dylib +0x0000000102b10000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjimage.dylib +0x0000000102b70000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjdwp.dylib +0x0000000102bbc000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjava.dylib +0x0000000102b3c000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libinstrument.dylib +0x0000000102c14000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libzip.dylib +0x0000000255d1b000 /usr/lib/i18n/libiconv_std.dylib +0x0000000255d03000 /usr/lib/i18n/libUTF8.dylib +0x0000000255d23000 /usr/lib/i18n/libmapper_none.dylib +0x0000000102bec000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libdt_socket.dylib +0x0000000102e9c000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libnio.dylib +0x0000000102e7c000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libnet.dylib +0x000000010407c000 /Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/libsomelib.dylib +0x0000000102b64000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libsyslookup.dylib + + +VM Arguments: +jvm_args: -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:60574,suspend=y,server=n -ea -Didea.test.cyclic.buffer.size=1048576 -javaagent:/Users/cristina/Library/Caches/JetBrains/IdeaIC2024.1/captureAgent/debugger-agent.jar -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 +java_command: com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit5 dev.diplomattest.somelib.Float64VecTest,testFloat64Vec +java_class_path (initial): /Users/cristina/.m2/repository/org/junit/platform/junit-platform-launcher/1.10.3/junit-platform-launcher-1.10.3.jar:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/lib/idea_rt.jar:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/plugins/junit/lib/junit5-rt.jar:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/plugins/junit/lib/junit-rt.jar:/Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/target/test-classes:/Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/target/classes:/Users/cristina/.m2/repository/net/java/dev/jna/jna/5.14.0/jna-5.14.0.jar:/Users/cristina/.m2/repository/org/junit/jupiter/junit-jupiter/5.10.3/junit-jupiter-5.10.3.jar:/Users/cristina/.m2/repository/org/junit/jupiter/junit-jupiter-api/5.10.3/junit-jupiter-api-5.10.3.jar:/Users/cristina/.m2/repository/org/opentest4j/opentest4j/1.3.0/opentest4j-1.3.0.jar:/Users/cristina/.m2/repository/org/junit/platform/junit-platform-commons/1.10.3/junit-platform-commons-1.10.3.jar:/Users/cristina/.m2/repository/org/apiguardian/apiguardian-api/1.1.2/apiguardian-api-1.1.2.jar:/Users/cristina/.m2/repository/org/junit/jupiter/junit-jupiter-params/5.10.3/junit-jupiter-params-5.10.3.jar:/Users/cristina/.m2/repository/org/junit/jupiter/junit-jupiter-engine/5.10.3/junit-jupiter-engine-5.10.3.jar:/Users/cristina/.m2/repository/org/junit/platform/junit-platform-engine/1.10.3/junit-platform-engine-1.10.3.jar:/Users/cristina/.m2/repository/org/openjdk/jmh/jmh-core/1.37/jmh-core-1.37.jar:/Users/cristina/.m2/repository/net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4.jar:/Users/cristina/.m2/repository/org/apache/commons/commons-math3/3.6.1/commons-math3-3.6.1.jar:/Users/cristina/.m2/repository/org/openjdk/jmh/jmh-generator-annprocess/1.37/jmh-generator-annprocess-1.37.jar +Launcher Type: SUN_STANDARD + +[Global flags] + intx CICompilerCount = 4 {product} {ergonomic} + uint ConcGCThreads = 2 {product} {ergonomic} + uint G1ConcRefinementThreads = 8 {product} {ergonomic} + size_t G1HeapRegionSize = 2097152 {product} {ergonomic} + size_t InitialHeapSize = 268435456 {product} {ergonomic} + size_t MarkStackSize = 4194304 {product} {ergonomic} + size_t MaxHeapSize = 4294967296 {product} {ergonomic} + size_t MaxNewSize = 2575302656 {product} {ergonomic} + size_t MinHeapDeltaBytes = 2097152 {product} {ergonomic} + size_t MinHeapSize = 8388608 {product} {ergonomic} + uintx NonNMethodCodeHeapSize = 5839564 {pd product} {ergonomic} + uintx NonProfiledCodeHeapSize = 122909338 {pd product} {ergonomic} + uintx ProfiledCodeHeapSize = 122909338 {pd product} {ergonomic} + uintx ReservedCodeCacheSize = 251658240 {pd product} {ergonomic} + bool SegmentedCodeCache = true {product} {ergonomic} + size_t SoftMaxHeapSize = 4294967296 {manageable} {ergonomic} + bool UseCompressedOops = true {product lp64_product} {ergonomic} + bool UseG1GC = true {product} {ergonomic} + bool UseNUMA = false {product} {ergonomic} + bool UseNUMAInterleaving = false {product} {ergonomic} + +Logging: +Log output configuration: + #0: stdout all=warning uptime,level,tags foldmultilines=false + #1: stderr all=off uptime,level,tags foldmultilines=false + +Environment Variables: +JAVA_HOME=/Users/cristina/Library/Java/JavaVirtualMachines/corretto-19.0.1/Contents/Home/ +PATH=/Users/cristina/bin/jextract-22/bin:/bin:/Users/cristina/.modular/pkg/packages.modular.com_mojo/bin:/Users/cristina/Downloads/dart-sdk/bin:/opt/homebrew/Cellar/llvm/15.0.6/bin:/opt/homebrew/opt/openjdk/bin:/Users/cristina/.elan/bin:/Users/cristina/bin:/Users/cristina/Library/Application Support/Coursier/bin:/Users/cristina/Library/Python/3.8/bin:/Users/cristina/.local/bin:/Users/cristina/.cargo/bin:/Users/cristina/.cargo:/opt/homebrew/bin:/Users/cristina/.fzf/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/X11/bin:/Library/Apple/usr/bin:/usr/local/go/bin:/Library/TeX/texbin:/Users/cristina/.krew/bin +SHELL=/opt/homebrew/bin/fish +LC_CTYPE=en_US.UTF-8 +TMPDIR=/var/folders/x_/9qhndrhs79j640bxvmbkddfw0000gn/T/ + +Active Locale: +LC_ALL=C/en_US.UTF-8/C/C/C/C +LC_COLLATE=C +LC_CTYPE=en_US.UTF-8 +LC_MESSAGES=C +LC_MONETARY=C +LC_NUMERIC=C +LC_TIME=C + +Signal Handlers: + SIGSEGV: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_ONSTACK|SA_RESTART|SA_SIGINFO, unblocked + SIGBUS: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, unblocked + SIGFPE: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, unblocked + SIGPIPE: javaSignalHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked + SIGXFSZ: javaSignalHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked + SIGILL: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, unblocked + SIGUSR2: SR_handler in libjvm.dylib, mask=00100000000000000000000000000000, flags=SA_RESTART|SA_SIGINFO, blocked + SIGHUP: UserHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked + SIGINT: UserHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked + SIGTERM: UserHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked + SIGQUIT: UserHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked + SIGTRAP: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, unblocked + + +Periodic native trim disabled + +--------------- S Y S T E M --------------- + +OS: +uname: Darwin 23.5.0 Darwin Kernel Version 23.5.0: Wed May 1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000 arm64 +OS uptime: 45 days 10:05 hours +rlimit (soft/hard): STACK 8176k/65520k , CORE 0k/infinity , NPROC 2666/4000 , NOFILE 10240/infinity , AS infinity/infinity , CPU infinity/infinity , DATA infinity/infinity , FSIZE infinity/infinity , MEMLOCK infinity/infinity , RSS infinity/infinity +load average: 3.74 4.24 4.42 + +CPU: total 8 (initial active 8) 0x61:0x0:0x1b588bb3:0, fp, asimd, aes, pmull, sha1, sha256, crc32, lse, sha3, sha512 +machdep.cpu.brand_string:Apple M1 Pro +hw.cachelinesize:128 +hw.l1icachesize:131072 +hw.l1dcachesize:65536 +hw.l2cachesize:4194304 + +Memory: 16k page, physical 16777216k(65072k free), swap 3145728k(1371968k free) + +vm_info: OpenJDK 64-Bit Server VM (22.0.1+8) for bsd-aarch64 JRE (22.0.1+8), built on 2024-04-16T00:00:00Z by "admin" with clang Apple LLVM 15.0.0 (clang-1500.1.0.2.5) + +END. diff --git a/feature_tests/java/somelib/hs_err_pid98821.log b/feature_tests/java/somelib/hs_err_pid98821.log new file mode 100644 index 000000000..f00be4315 --- /dev/null +++ b/feature_tests/java/somelib/hs_err_pid98821.log @@ -0,0 +1,1245 @@ +# +# A fatal error has been detected by the Java Runtime Environment: +# +# SIGSEGV (0xb) at pc=0x0000000105bcdaec, pid=98821, tid=10243 +# +# JRE version: OpenJDK Runtime Environment Temurin-22.0.1+8 (22.0.1+8) (build 22.0.1+8) +# Java VM: OpenJDK 64-Bit Server VM Temurin-22.0.1+8 (22.0.1+8, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-aarch64) +# Problematic frame: +# C [libsomelib.dylib+0x5aec] Float64Vec_new_isize+0xb4 +# +# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again +# +# If you would like to submit a bug report, please visit: +# https://github.com/adoptium/adoptium-support/issues +# The crash happened outside the Java Virtual Machine in native code. +# See problematic frame for where to report the bug. +# + +--------------- S U M M A R Y ------------ + +Command Line: -ea -Didea.test.cyclic.buffer.size=1048576 -javaagent:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/lib/idea_rt.jar=60586:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/bin -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit5 dev.diplomattest.somelib.Float64VecTest,testFloat64Vec + +Host: "MacBookPro18,3" arm64, 8 cores, 16G, Darwin 23.5.0, macOS 14.5 (23F79) +Time: Wed Aug 14 21:07:19 2024 CEST elapsed time: 0.277129 seconds (0d 0h 0m 0s) + +--------------- T H R E A D --------------- + +Current thread (0x0000000124008c00): JavaThread "main" [_thread_in_native, id=10243, stack(0x000000016b8d8000,0x000000016badb000) (2060K)] + +Stack: [0x000000016b8d8000,0x000000016badb000], sp=0x000000016bad7870, free space=2046k +Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) +C [libsomelib.dylib+0x5aec] Float64Vec_new_isize+0xb4 +v ~RuntimeStub::nep_invoker_blob 0x00000001376700bc +j java.lang.invoke.LambdaForm$MH+0x00001fff001d0400.invoke(Ljava/lang/Object;JJJ)J+12 java.base@22.0.1 +j java.lang.invoke.LambdaForm$MH+0x00001fff001d3000.invokeExact_MT(Ljava/lang/Object;JJJLjava/lang/Object;)J+23 java.base@22.0.1 +j jdk.internal.foreign.abi.DowncallStub+0x00001fff001d1000.invoke(Ljava/lang/foreign/SegmentAllocator;Ljava/lang/foreign/MemorySegment;Ljava/lang/foreign/MemorySegment;)Ljava/lang/foreign/MemorySegment;+69 java.base@22.0.1 +j java.lang.invoke.LambdaForm$DMH+0x00001fff001d1400.invokeStaticInit(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+14 java.base@22.0.1 +j java.lang.invoke.LambdaForm$MH+0x00001fff001d2400.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+44 java.base@22.0.1 +j java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+19 java.base@22.0.1 +j dev.diplomattest.somelib.ntv.somelib_h.Float64Vec_new_isize(Ljava/lang/foreign/MemorySegment;)Ljava/lang/foreign/MemorySegment;+26 +j dev.diplomattest.somelib.Float64Vec.newIsize([J)Ldev/diplomattest/somelib/Float64Vec;+38 +j dev.diplomattest.somelib.Float64VecTest.testFloat64Vec()V+53 +j java.lang.invoke.LambdaForm$DMH+0x00001fff0014c000.invokeVirtual(Ljava/lang/Object;Ljava/lang/Object;)V+10 java.base@22.0.1 +j java.lang.invoke.LambdaForm$MH+0x00001fff0014c800.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+31 java.base@22.0.1 +j java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+19 java.base@22.0.1 +j jdk.internal.reflect.DirectMethodHandleAccessor.invokeImpl(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+41 java.base@22.0.1 +j jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+23 java.base@22.0.1 +j java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+102 java.base@22.0.1 +j org.junit.platform.commons.util.ReflectionUtils.invokeMethod(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+42 +j org.junit.jupiter.engine.execution.MethodInvocation.proceed()Ljava/lang/Object;+16 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed()Ljava/lang/Object;+8 +j org.junit.jupiter.engine.extension.TimeoutExtension.intercept(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/TimeoutDuration;Lorg/junit/jupiter/engine/extension/TimeoutExtension$TimeoutProvider;)Ljava/lang/Object;+28 +j org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/TimeoutExtension$TimeoutProvider;)Ljava/lang/Object;+31 +j org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)V+9 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda+0x00001fff00117940.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)V+5 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall$VoidMethodInterceptorCall;Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)Ljava/lang/Void;+6 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall$$Lambda+0x00001fff00117d50.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)Ljava/lang/Object;+9 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+6 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$$Lambda+0x00001fff00146488.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+14 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed()Ljava/lang/Object;+12 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+1 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/engine/execution/InvocationInterceptorChain$InterceptorCall;Ljava/util/List;)Ljava/lang/Object;+24 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InvocationInterceptorChain$InterceptorCall;)Ljava/lang/Object;+31 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;)Ljava/lang/Object;+15 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(Ljava/lang/reflect/Method;Ljava/lang/Object;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;)Ljava/lang/Object;+55 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;)V+28 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda+0x00001fff00145aa8.execute()V+12 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)V+21 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;+44 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;+6 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+79 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00001fff00135220.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00001fff00135000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 +j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00001fff001379d8.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService$$Lambda+0x00001fff00135d10.accept(Ljava/lang/Object;)V+4 +j java.util.ArrayList.forEach(Ljava/util/function/Consumer;)V+46 java.base@22.0.1 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(Ljava/util/List;)V+6 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+116 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00001fff00135220.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00001fff00135000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 +j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00001fff001379d8.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService$$Lambda+0x00001fff00135d10.accept(Ljava/lang/Object;)V+4 +j java.util.ArrayList.forEach(Ljava/util/function/Consumer;)V+46 java.base@22.0.1 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(Ljava/util/List;)V+6 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+116 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00001fff00135220.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00001fff00135000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 +j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00001fff001379d8.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(Lorg/junit/platform/engine/support/hierarchical/HierarchicalTestExecutorService$TestTask;)Ljava/util/concurrent/Future;+1 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute()Ljava/util/concurrent/Future;+74 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(Lorg/junit/platform/engine/ExecutionRequest;)V+31 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/engine/TestDescriptor;Lorg/junit/platform/engine/EngineExecutionListener;Lorg/junit/platform/engine/ConfigurationParameters;Lorg/junit/platform/engine/TestEngine;)V+24 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/LauncherDiscoveryResult;Lorg/junit/platform/engine/EngineExecutionListener;)V+115 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;Lorg/junit/platform/engine/EngineExecutionListener;Lorg/junit/platform/launcher/TestExecutionListener;)V+55 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(Lorg/junit/platform/launcher/core/InternalTestPlan;Lorg/junit/platform/launcher/TestExecutionListener;)V+6 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator$$Lambda+0x00001fff00121e90.accept(Ljava/lang/Object;)V+12 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(Lorg/junit/platform/engine/ConfigurationParameters;Lorg/junit/platform/launcher/core/ListenerRegistry;Ljava/util/function/Consumer;)V+51 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;[Lorg/junit/platform/launcher/TestExecutionListener;)V+23 +j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;[Lorg/junit/platform/launcher/TestExecutionListener;)V+6 +j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+34 +j org.junit.platform.launcher.core.DelegatingLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+6 +j org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+13 +j com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs([Ljava/lang/String;Ljava/lang/String;IZ)I+203 +j com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(Z)I+17 +j com.intellij.rt.execution.junit.TestsRepeater.repeat(IZLcom/intellij/rt/execution/junit/TestsRepeater$TestRun;)I+7 +j com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(Lcom/intellij/rt/junit/IdeaTestRunner;[Ljava/lang/String;Ljava/util/ArrayList;Ljava/lang/String;IZ)I+25 +j com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart([Ljava/lang/String;Ljava/lang/String;Ljava/util/ArrayList;Ljava/lang/String;)I+117 +j com.intellij.rt.junit.JUnitStarter.main([Ljava/lang/String;)V+97 +v ~StubRoutines::call_stub 0x0000000137534154 +...... +Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) +v ~RuntimeStub::nep_invoker_blob 0x000000013767008c +j java.lang.invoke.LambdaForm$MH+0x00001fff001d0400.invoke(Ljava/lang/Object;JJJ)J+12 java.base@22.0.1 +j java.lang.invoke.LambdaForm$MH+0x00001fff001d3000.invokeExact_MT(Ljava/lang/Object;JJJLjava/lang/Object;)J+23 java.base@22.0.1 +j jdk.internal.foreign.abi.DowncallStub+0x00001fff001d1000.invoke(Ljava/lang/foreign/SegmentAllocator;Ljava/lang/foreign/MemorySegment;Ljava/lang/foreign/MemorySegment;)Ljava/lang/foreign/MemorySegment;+69 java.base@22.0.1 +j java.lang.invoke.LambdaForm$DMH+0x00001fff001d1400.invokeStaticInit(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+14 java.base@22.0.1 +j java.lang.invoke.LambdaForm$MH+0x00001fff001d2400.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+44 java.base@22.0.1 +j java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+19 java.base@22.0.1 +j dev.diplomattest.somelib.ntv.somelib_h.Float64Vec_new_isize(Ljava/lang/foreign/MemorySegment;)Ljava/lang/foreign/MemorySegment;+26 +j dev.diplomattest.somelib.Float64Vec.newIsize([J)Ldev/diplomattest/somelib/Float64Vec;+38 +j dev.diplomattest.somelib.Float64VecTest.testFloat64Vec()V+53 +j java.lang.invoke.LambdaForm$DMH+0x00001fff0014c000.invokeVirtual(Ljava/lang/Object;Ljava/lang/Object;)V+10 java.base@22.0.1 +j java.lang.invoke.LambdaForm$MH+0x00001fff0014c800.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+31 java.base@22.0.1 +j java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+19 java.base@22.0.1 +j jdk.internal.reflect.DirectMethodHandleAccessor.invokeImpl(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+41 java.base@22.0.1 +j jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+23 java.base@22.0.1 +j java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+102 java.base@22.0.1 +j org.junit.platform.commons.util.ReflectionUtils.invokeMethod(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+42 +j org.junit.jupiter.engine.execution.MethodInvocation.proceed()Ljava/lang/Object;+16 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed()Ljava/lang/Object;+8 +j org.junit.jupiter.engine.extension.TimeoutExtension.intercept(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/TimeoutDuration;Lorg/junit/jupiter/engine/extension/TimeoutExtension$TimeoutProvider;)Ljava/lang/Object;+28 +j org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/TimeoutExtension$TimeoutProvider;)Ljava/lang/Object;+31 +j org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)V+9 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda+0x00001fff00117940.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)V+5 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall$VoidMethodInterceptorCall;Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)Ljava/lang/Void;+6 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall$$Lambda+0x00001fff00117d50.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)Ljava/lang/Object;+9 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+6 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$$Lambda+0x00001fff00146488.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+14 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed()Ljava/lang/Object;+12 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+1 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/engine/execution/InvocationInterceptorChain$InterceptorCall;Ljava/util/List;)Ljava/lang/Object;+24 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InvocationInterceptorChain$InterceptorCall;)Ljava/lang/Object;+31 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;)Ljava/lang/Object;+15 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(Ljava/lang/reflect/Method;Ljava/lang/Object;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;)Ljava/lang/Object;+55 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;)V+28 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda+0x00001fff00145aa8.execute()V+12 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)V+21 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;+44 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;+6 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+79 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00001fff00135220.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00001fff00135000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 +j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00001fff001379d8.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService$$Lambda+0x00001fff00135d10.accept(Ljava/lang/Object;)V+4 +j java.util.ArrayList.forEach(Ljava/util/function/Consumer;)V+46 java.base@22.0.1 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(Ljava/util/List;)V+6 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+116 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00001fff00135220.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00001fff00135000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 +j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00001fff001379d8.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService$$Lambda+0x00001fff00135d10.accept(Ljava/lang/Object;)V+4 +j java.util.ArrayList.forEach(Ljava/util/function/Consumer;)V+46 java.base@22.0.1 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(Ljava/util/List;)V+6 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+116 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00001fff00135220.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00001fff00135000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 +j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00001fff001379d8.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(Lorg/junit/platform/engine/support/hierarchical/HierarchicalTestExecutorService$TestTask;)Ljava/util/concurrent/Future;+1 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute()Ljava/util/concurrent/Future;+74 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(Lorg/junit/platform/engine/ExecutionRequest;)V+31 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/engine/TestDescriptor;Lorg/junit/platform/engine/EngineExecutionListener;Lorg/junit/platform/engine/ConfigurationParameters;Lorg/junit/platform/engine/TestEngine;)V+24 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/LauncherDiscoveryResult;Lorg/junit/platform/engine/EngineExecutionListener;)V+115 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;Lorg/junit/platform/engine/EngineExecutionListener;Lorg/junit/platform/launcher/TestExecutionListener;)V+55 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(Lorg/junit/platform/launcher/core/InternalTestPlan;Lorg/junit/platform/launcher/TestExecutionListener;)V+6 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator$$Lambda+0x00001fff00121e90.accept(Ljava/lang/Object;)V+12 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(Lorg/junit/platform/engine/ConfigurationParameters;Lorg/junit/platform/launcher/core/ListenerRegistry;Ljava/util/function/Consumer;)V+51 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;[Lorg/junit/platform/launcher/TestExecutionListener;)V+23 +j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;[Lorg/junit/platform/launcher/TestExecutionListener;)V+6 +j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+34 +j org.junit.platform.launcher.core.DelegatingLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+6 +j org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+13 +j com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs([Ljava/lang/String;Ljava/lang/String;IZ)I+203 +j com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(Z)I+17 +j com.intellij.rt.execution.junit.TestsRepeater.repeat(IZLcom/intellij/rt/execution/junit/TestsRepeater$TestRun;)I+7 +j com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(Lcom/intellij/rt/junit/IdeaTestRunner;[Ljava/lang/String;Ljava/util/ArrayList;Ljava/lang/String;IZ)I+25 +j com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart([Ljava/lang/String;Ljava/lang/String;Ljava/util/ArrayList;Ljava/lang/String;)I+117 +j com.intellij.rt.junit.JUnitStarter.main([Ljava/lang/String;)V+97 +v ~StubRoutines::call_stub 0x0000000137534154 + +siginfo: si_signo: 11 (SIGSEGV), si_code: 2 (SEGV_ACCERR), si_addr: 0x0000000000000001 + +Registers: + x0=0x00006000008d4a90 x1=0x00000000a0fab7fb x2=0x0000000000000010 x3=0x0000000000000000 + x4=0x0000000000000004 x5=0x0000000021000000 x6=0x00006000008d4a90 x7=0x0000000000000eb0 + x8=0x0000000000000000 x9=0x0000000000000000 x10=0x0000000000000a90 x11=0x0000000000000010 +x12=0x0000000000000001 x13=0x00000000fffffca9 x14=0x00000000000007fb x15=0x00000000a0fab7fb +x16=0x00000000000000a9 x17=0x0000000000000356 x18=0x0000000000000000 x19=0x0000000000000010 +x20=0x0000000000000002 x21=0x00006000008d4a90 x22=0x0000000105c18141 x23=0x0000000000000001 +x24=0x000000016bad79b8 x25=0x0000000101bc8000 x26=0x000000014cc21bf8 x27=0x0000000000000000 +x28=0x0000000124008c00 fp=0x000000016bad78a0 lr=0x0000000105bcda7c sp=0x000000016bad7870 +pc=0x0000000105bcdaec cpsr=0x0000000080001000 + +Register to memory mapping: + +x0 =0x00006000008d4a90 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00 +x1 =0x00000000a0fab7fb is an unknown value +x2 =0x0000000000000010 is an unknown value +x3 =0x0 is null +x4 =0x0000000000000004 is an unknown value +x5 =0x0000000021000000 is an unknown value +x6 =0x00006000008d4a90 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00 +x7 =0x0000000000000eb0 is an unknown value +x8 =0x0 is null +x9 =0x0 is null +x10=0x0000000000000a90 is an unknown value +x11=0x0000000000000010 is an unknown value +x12=0x0000000000000001 is an unknown value +x13=0x00000000fffffca9 is an unknown value +x14=0x00000000000007fb is an unknown value +x15=0x00000000a0fab7fb is an unknown value +x16=0x00000000000000a9 is an unknown value +x17=0x0000000000000356 is an unknown value +x18=0x0 is null +x19=0x0000000000000010 is an unknown value +x20=0x0000000000000002 is an unknown value +x21=0x00006000008d4a90 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00 +x22=0x0000000105c18141: __rust_no_alloc_shim_is_unstable+0 in /Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/libsomelib.dylib at 0x0000000105bc8000 +x23=0x0000000000000001 is an unknown value +x24=0x000000016bad79b8 is pointing into the stack for thread: 0x0000000124008c00 +x25=0x0000000101bc8000 is an unknown value +x26=0x000000014cc21bf8 is pointing into metadata +x27=0x0 is null +x28=0x0000000124008c00 is a thread + fp=0x000000016bad78a0 is pointing into the stack for thread: 0x0000000124008c00 + lr=0x0000000105bcda7c: Float64Vec_new_isize+0x44 in /Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/libsomelib.dylib at 0x0000000105bc8000 + sp=0x000000016bad7870 is pointing into the stack for thread: 0x0000000124008c00 + +Top of Stack: (sp=0x000000016bad7870) +0x000000016bad7870: 000000016bad79b8 0000000101bc8000 +0x000000016bad7880: 000000014cc21a54 000000010699d2b0 +0x000000016bad7890: 000000016bad78e8 000000016bad78d0 +0x000000016bad78a0: 000000016bad78c0 00000001376700bc +0x000000016bad78b0: 000000016bad7970 8743000137547504 +0x000000016bad78c0: 000000016bad7970 00000001375391b0 +0x000000016bad78d0: 000000070ee4f370 fffffffffffffff2 +0x000000016bad78e0: 0000000000000000 000000070ec68228 +0x000000016bad78f0: 0000000000000002 0000000000000000 +0x000000016bad7900: 0000000000000001 0000000000000000 +0x000000016bad7910: 0000000105bcda38 0000000000000000 +0x000000016bad7920: fffffffffffffff6 000000014cc21a54 +0x000000016bad7930: 0000000000000009 000000014cc21bf8 +0x000000016bad7940: 000000070ec753d8 ffffffffffffffec +0x000000016bad7950: 0000000000000000 000000014cc21a60 +0x000000016bad7960: ffffffffffffffef 000000016bad7970 +0x000000016bad7970: 000000016bad7a10 00000001375391b0 +0x000000016bad7980: 000000070ec68228 0000000000000002 +0x000000016bad7990: 0000000000000000 0000000000000001 +0x000000016bad79a0: 0000000000000000 0000000105bcda38 +0x000000016bad79b0: 0000000000000000 000000070ec754f0 +0x000000016bad79c0: fffffffffffffff6 000000014cc2729f +0x000000016bad79d0: 0000000000000009 000000014cc27460 +0x000000016bad79e0: 000000070ece0ae8 ffffffffffffffec +0x000000016bad79f0: 0000000000000000 000000014cc272b0 +0x000000016bad7a00: ffffffffffffffef 000000016bad7a10 +0x000000016bad7a10: 000000016bad7ab0 00000001375391b0 +0x000000016bad7a20: 000000070efd3000 0000000000000002 +0x000000016bad7a30: 0000000000000000 0000000000000001 +0x000000016bad7a40: 0000000000000000 0000000105bcda38 +0x000000016bad7a50: 0000000000000000 000000070ec754f0 +0x000000016bad7a60: fffffffffffffff6 000000014cc23465 + +Instructions: (pc=0x0000000105bcdaec) +0x0000000105bcd9ec: f6 57 41 a9 f8 5f c4 a8 c0 03 5f d6 00 01 80 52 +0x0000000105bcd9fc: 01 03 80 52 c7 d9 00 94 20 00 20 d4 16 00 80 d2 +0x0000000105bcda0c: e0 03 16 aa e1 03 15 aa bd d9 00 94 f5 03 00 aa +0x0000000105bcda1c: b3 00 00 b4 61 f2 7d d3 e0 03 14 aa 02 01 80 52 +0x0000000105bcda2c: 3a 03 00 94 e0 03 15 aa 54 db 00 94 f8 5f bc a9 +0x0000000105bcda3c: f6 57 01 a9 f4 4f 02 a9 fd 7b 03 a9 fd c3 00 91 +0x0000000105bcda4c: f4 03 01 aa 15 01 80 52 3f 00 00 f1 b7 02 80 9a +0x0000000105bcda5c: 33 f0 7d d3 56 02 00 f0 d6 06 05 91 e1 04 00 b4 +0x0000000105bcda6c: df 02 40 39 e0 03 13 aa 01 01 80 52 26 03 00 94 +0x0000000105bcda7c: 40 06 00 b4 f5 03 00 aa 08 00 80 d2 9f 22 00 f1 +0x0000000105bcda8c: e3 02 00 54 a9 02 17 cb 3f 01 01 f1 83 02 00 54 +0x0000000105bcda9c: 09 00 80 d2 88 f2 7d 92 ea 82 00 91 eb 03 08 aa +0x0000000105bcdaac: 4c 01 09 8b 80 05 7f ad 82 0d 40 ad 00 d8 61 4e +0x0000000105bcdabc: 21 d8 61 4e 42 d8 61 4e 63 d8 61 4e ac 02 09 8b +0x0000000105bcdacc: 80 05 00 ad 82 0d 01 ad 29 01 01 91 6b 21 00 f1 +0x0000000105bcdadc: 81 fe ff 54 1f 01 14 eb 00 01 00 54 09 f1 7d d3 +0x0000000105bcdaec: e0 6a 69 fc 00 d8 61 5e a0 6a 29 fc 08 05 00 91 +0x0000000105bcdafc: 9f 02 08 eb 41 ff ff 54 df 02 40 39 00 03 80 52 +0x0000000105bcdb0c: 01 01 80 52 00 03 00 94 00 01 00 b4 14 54 00 a9 +0x0000000105bcdb1c: 14 08 00 f9 fd 7b 43 a9 f4 4f 42 a9 f6 57 41 a9 +0x0000000105bcdb2c: f8 5f c4 a8 c0 03 5f d6 00 01 80 52 01 03 80 52 +0x0000000105bcdb3c: 78 d9 00 94 20 00 20 d4 00 01 80 52 e1 03 13 aa +0x0000000105bcdb4c: 6f d9 00 94 f6 03 00 aa b4 00 00 b4 e0 03 15 aa +0x0000000105bcdb5c: e1 03 13 aa 02 01 80 52 ec 02 00 94 e0 03 16 aa +0x0000000105bcdb6c: 06 db 00 94 f8 5f bc a9 f6 57 01 a9 f4 4f 02 a9 +0x0000000105bcdb7c: fd 7b 03 a9 fd c3 00 91 f4 03 01 aa 15 01 80 52 +0x0000000105bcdb8c: 3f 00 00 f1 b7 02 80 9a 33 f0 7d d3 56 02 00 f0 +0x0000000105bcdb9c: d6 06 05 91 e1 04 00 b4 df 02 40 39 e0 03 13 aa +0x0000000105bcdbac: 01 01 80 52 d8 02 00 94 40 06 00 b4 f5 03 00 aa +0x0000000105bcdbbc: 08 00 80 d2 9f 22 00 f1 e3 02 00 54 a9 02 17 cb +0x0000000105bcdbcc: 3f 01 01 f1 83 02 00 54 09 00 80 d2 88 f2 7d 92 +0x0000000105bcdbdc: ea 82 00 91 eb 03 08 aa 4c 01 09 8b 80 05 7f ad + + +Stack slot to memory mapping: + +stack at sp + 0 slots: 0x000000016bad79b8 is pointing into the stack for thread: 0x0000000124008c00 +stack at sp + 1 slots: 0x0000000101bc8000 is an unknown value +stack at sp + 2 slots: 0x000000014cc21a54 is pointing into metadata +stack at sp + 3 slots: 0x000000010699d2b0: _ZN19TemplateInterpreter13_active_tableE+0 in /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/server/libjvm.dylib at 0x0000000105c48000 +stack at sp + 4 slots: 0x000000016bad78e8 is pointing into the stack for thread: 0x0000000124008c00 +stack at sp + 5 slots: 0x000000016bad78d0 is pointing into the stack for thread: 0x0000000124008c00 +stack at sp + 6 slots: 0x000000016bad78c0 is pointing into the stack for thread: 0x0000000124008c00 +stack at sp + 7 slots: 0x00000001376700bc is at code_begin+60 in +[CodeBlob (0x0000000137670010)] +Framesize: 4 +Runtime Stub (0x0000000137670010): nep_invoker_blob +-------------------------------------------------------------------------------- +Decoding CodeBlob, name: nep_invoker_blob, at [0x0000000137670080, 0x0000000137670150] 208 bytes +[MachCode] + 0x0000000137670080: fd7b bfa9 | fd03 0091 | bf43 00d1 | 0900 0010 | 89d7 01f9 | e903 0091 | 89d3 01f9 | 9ddb 01f9 + 0x00000001376700a0: e903 7eb2 | 8a53 1191 | 49fd 9f88 | e903 01aa | e103 03aa | e003 02aa | 2001 3fd6 | a900 80d2 + 0x00000001376700c0: 8957 04b9 | bf3b 03d5 | 8963 1191 | 29fd dfc8 | bf03 09eb | e801 0054 | 8953 44b9 | a901 0035 + 0x00000001376700e0: e903 7db2 | 8a53 1191 | 49fd 9f88 | 8943 5339 | 3f09 0071 | e001 0054 | 9fd3 01f9 | 9fdb 01f9 + 0x0000000137670100: 9fd7 01f9 | bf03 0091 | fd7b c1a8 | c003 5fd6 | e003 00f9 | e003 1caa | 897d 9cd2 | 09c2 a0f2 + 0x0000000137670120: 2900 c0f2 | 2001 3fd6 | e003 40f9 | edff ff17 | e003 00f9 | 0919 95d2 | 29ca a0f2 | 2900 c0f2 + 0x0000000137670140: 2001 3fd6 | e003 40f9 | ecff ff17 | 0000 0000 +[/MachCode] +-------------------------------------------------------------------------------- + +-------------------------------------------------------------------------------- +Decoding CodeBlob, name: nep_invoker_blob, at [0x0000000137670080, 0x0000000137670150] 208 bytes +[MachCode] + 0x0000000137670080: fd7b bfa9 | fd03 0091 | bf43 00d1 | 0900 0010 | 89d7 01f9 | e903 0091 | 89d3 01f9 | 9ddb 01f9 + 0x00000001376700a0: e903 7eb2 | 8a53 1191 | 49fd 9f88 | e903 01aa | e103 03aa | e003 02aa | 2001 3fd6 | a900 80d2 + 0x00000001376700c0: 8957 04b9 | bf3b 03d5 | 8963 1191 | 29fd dfc8 | bf03 09eb | e801 0054 | 8953 44b9 | a901 0035 + 0x00000001376700e0: e903 7db2 | 8a53 1191 | 49fd 9f88 | 8943 5339 | 3f09 0071 | e001 0054 | 9fd3 01f9 | 9fdb 01f9 + 0x0000000137670100: 9fd7 01f9 | bf03 0091 | fd7b c1a8 | c003 5fd6 | e003 00f9 | e003 1caa | 897d 9cd2 | 09c2 a0f2 + 0x0000000137670120: 2900 c0f2 | 2001 3fd6 | e003 40f9 | edff ff17 | e003 00f9 | 0919 95d2 | 29ca a0f2 | 2900 c0f2 + 0x0000000137670140: 2001 3fd6 | e003 40f9 | ecff ff17 | 0000 0000 +[/MachCode] +-------------------------------------------------------------------------------- + + +--------------- P R O C E S S --------------- + +Threads class SMR info: +_java_thread_list=0x0000600000ad9160, length=11, elements={ +0x0000000124008c00, 0x0000000123010a00, 0x0000000122008200, 0x000000012508f400, +0x000000012508fc00, 0x000000012509b200, 0x0000000123025200, 0x0000000123025a00, +0x000000010f8b2a00, 0x0000000124041200, 0x0000000124041a00 +} + +Java Threads: ( => current thread ) +=>0x0000000124008c00 JavaThread "main" [_thread_in_native, id=10243, stack(0x000000016b8d8000,0x000000016badb000) (2060K)] + 0x0000000123010a00 JavaThread "Reference Handler" daemon [_thread_blocked, id=24323, stack(0x000000016ca50000,0x000000016cc53000) (2060K)] + 0x0000000122008200 JavaThread "Finalizer" daemon [_thread_blocked, id=28931, stack(0x000000016cc5c000,0x000000016ce5f000) (2060K)] + 0x000000012508f400 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=28675, stack(0x000000016ce68000,0x000000016d06b000) (2060K)] + 0x000000012508fc00 JavaThread "Service Thread" daemon [_thread_blocked, id=25091, stack(0x000000016d074000,0x000000016d277000) (2060K)] + 0x000000012509b200 JavaThread "Monitor Deflation Thread" daemon [_thread_blocked, id=28419, stack(0x000000016d280000,0x000000016d483000) (2060K)] + 0x0000000123025200 JavaThread "C2 CompilerThread0" daemon [_thread_in_vm, id=25603, stack(0x000000016d48c000,0x000000016d68f000) (2060K)] + 0x0000000123025a00 JavaThread "C1 CompilerThread0" daemon [_thread_in_vm, id=26115, stack(0x000000016d698000,0x000000016d89b000) (2060K)] + 0x000000010f8b2a00 JavaThread "Common-Cleaner" daemon [_thread_blocked, id=26371, stack(0x000000016d8a4000,0x000000016daa7000) (2060K)] + 0x0000000124041200 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=26883, stack(0x000000016dab0000,0x000000016dcb3000) (2060K)] + 0x0000000124041a00 JavaThread "Notification Thread" daemon [_thread_blocked, id=27139, stack(0x000000016dcbc000,0x000000016debf000) (2060K)] +Total: 11 + +Other Threads: + 0x0000000122e06fd0 VMThread "VM Thread" [id=18691, stack(0x000000016c72c000,0x000000016c92f000) (2060K)] + 0x0000000104705520 WatcherThread "VM Periodic Task Thread" [id=20739, stack(0x000000016c520000,0x000000016c723000) (2060K)] + 0x0000000123806830 WorkerThread "GC Thread#0" [id=14083, stack(0x000000016bae4000,0x000000016bce7000) (2060K)] + 0x0000000123806fd0 ConcurrentGCThread "G1 Main Marker" [id=12803, stack(0x000000016bcf0000,0x000000016bef3000) (2060K)] + 0x000000010f304080 WorkerThread "G1 Conc#0" [id=13059, stack(0x000000016befc000,0x000000016c0ff000) (2060K)] + 0x000000010f858200 ConcurrentGCThread "G1 Refine#0" [id=21507, stack(0x000000016c108000,0x000000016c30b000) (2060K)] + 0x0000000104704190 ConcurrentGCThread "G1 Service" [id=16899, stack(0x000000016c314000,0x000000016c517000) (2060K)] +Total: 7 + +Threads with active compile tasks: +C2 CompilerThread0 282 1191 4 jdk.internal.org.objectweb.asm.SymbolTable::addConstantUtf8Reference (101 bytes) +C1 CompilerThread0 282 1208 3 jdk.internal.classfile.impl.StackMapGenerator::processBlock (2767 bytes) +Total: 2 + +VM state: not at safepoint (normal execution) + +VM Mutex/Monitor currently owned by a thread: ([mutex/lock_event]) +[0x0000000106a067d8] MethodCompileQueue_lock - owner thread: 0x0000000123025a00 +[0x0000000106a07198] CodeCache_lock - owner thread: 0x0000000123025a00 +[0x0000000106a07258] Compile_lock - owner thread: 0x0000000123025a00 + +Heap address: 0x0000000700000000, size: 4096 MB, Compressed Oops mode: Zero based, Oop shift amount: 3 + +CDS archive(s) not mapped +Compressed class space mapped at: 0x00001fff00000000-0x00001fff40000000, reserved size: 1073741824 +Narrow klass base: 0x00001fff00000000, Narrow klass shift: 0, Narrow klass range: 0x40000000 + +GC Precious Log: + CardTable entry size: 512 + Card Set container configuration: InlinePtr #cards 4 size 8 Array Of Cards #cards 16 size 48 Howl #buckets 8 coarsen threshold 3686 Howl Bitmap #cards 512 size 80 coarsen threshold 460 Card regions per heap region 1 cards per card region 4096 + CPUs: 8 total, 8 available + Memory: 16384M + Large Page Support: Disabled + NUMA Support: Disabled + Compressed Oops: Enabled (Zero based) + Heap Region Size: 2M + Heap Min Capacity: 8M + Heap Initial Capacity: 256M + Heap Max Capacity: 4G + Pre-touch: Disabled + Parallel Workers: 8 + Concurrent Workers: 2 + Concurrent Refinement Workers: 8 + Periodic GC: Disabled + +Heap: + garbage-first heap total reserved 4194304K, committed 262144K, used 18432K [0x0000000700000000, 0x0000000800000000) + region size 2048K, 10 young (20480K), 0 survivors (0K) + Metaspace used 15401K, committed 15808K, reserved 1114112K + class space used 1717K, committed 1920K, reserved 1048576K + +Heap Regions: E=young(eden), S=young(survivor), O=old, HS=humongous(starts), HC=humongous(continues), CS=collection set, F=free, TAMS=top-at-mark-start, PB=parsable bottom +| 0|0x0000000700000000, 0x0000000700000000, 0x0000000700200000| 0%| F| |TAMS 0x0000000700000000| PB 0x0000000700000000| Untracked | 0 +| 1|0x0000000700200000, 0x0000000700200000, 0x0000000700400000| 0%| F| |TAMS 0x0000000700200000| PB 0x0000000700200000| Untracked | 0 +| 2|0x0000000700400000, 0x0000000700400000, 0x0000000700600000| 0%| F| |TAMS 0x0000000700400000| PB 0x0000000700400000| Untracked | 0 +| 3|0x0000000700600000, 0x0000000700600000, 0x0000000700800000| 0%| F| |TAMS 0x0000000700600000| PB 0x0000000700600000| Untracked | 0 +| 4|0x0000000700800000, 0x0000000700800000, 0x0000000700a00000| 0%| F| |TAMS 0x0000000700800000| PB 0x0000000700800000| Untracked | 0 +| 5|0x0000000700a00000, 0x0000000700a00000, 0x0000000700c00000| 0%| F| |TAMS 0x0000000700a00000| PB 0x0000000700a00000| Untracked | 0 +| 6|0x0000000700c00000, 0x0000000700c00000, 0x0000000700e00000| 0%| F| |TAMS 0x0000000700c00000| PB 0x0000000700c00000| Untracked | 0 +| 7|0x0000000700e00000, 0x0000000700e00000, 0x0000000701000000| 0%| F| |TAMS 0x0000000700e00000| PB 0x0000000700e00000| Untracked | 0 +| 8|0x0000000701000000, 0x0000000701000000, 0x0000000701200000| 0%| F| |TAMS 0x0000000701000000| PB 0x0000000701000000| Untracked | 0 +| 9|0x0000000701200000, 0x0000000701200000, 0x0000000701400000| 0%| F| |TAMS 0x0000000701200000| PB 0x0000000701200000| Untracked | 0 +| 10|0x0000000701400000, 0x0000000701400000, 0x0000000701600000| 0%| F| |TAMS 0x0000000701400000| PB 0x0000000701400000| Untracked | 0 +| 11|0x0000000701600000, 0x0000000701600000, 0x0000000701800000| 0%| F| |TAMS 0x0000000701600000| PB 0x0000000701600000| Untracked | 0 +| 12|0x0000000701800000, 0x0000000701800000, 0x0000000701a00000| 0%| F| |TAMS 0x0000000701800000| PB 0x0000000701800000| Untracked | 0 +| 13|0x0000000701a00000, 0x0000000701a00000, 0x0000000701c00000| 0%| F| |TAMS 0x0000000701a00000| PB 0x0000000701a00000| Untracked | 0 +| 14|0x0000000701c00000, 0x0000000701c00000, 0x0000000701e00000| 0%| F| |TAMS 0x0000000701c00000| PB 0x0000000701c00000| Untracked | 0 +| 15|0x0000000701e00000, 0x0000000701e00000, 0x0000000702000000| 0%| F| |TAMS 0x0000000701e00000| PB 0x0000000701e00000| Untracked | 0 +| 16|0x0000000702000000, 0x0000000702000000, 0x0000000702200000| 0%| F| |TAMS 0x0000000702000000| PB 0x0000000702000000| Untracked | 0 +| 17|0x0000000702200000, 0x0000000702200000, 0x0000000702400000| 0%| F| |TAMS 0x0000000702200000| PB 0x0000000702200000| Untracked | 0 +| 18|0x0000000702400000, 0x0000000702400000, 0x0000000702600000| 0%| F| |TAMS 0x0000000702400000| PB 0x0000000702400000| Untracked | 0 +| 19|0x0000000702600000, 0x0000000702600000, 0x0000000702800000| 0%| F| |TAMS 0x0000000702600000| PB 0x0000000702600000| Untracked | 0 +| 20|0x0000000702800000, 0x0000000702800000, 0x0000000702a00000| 0%| F| |TAMS 0x0000000702800000| PB 0x0000000702800000| Untracked | 0 +| 21|0x0000000702a00000, 0x0000000702a00000, 0x0000000702c00000| 0%| F| |TAMS 0x0000000702a00000| PB 0x0000000702a00000| Untracked | 0 +| 22|0x0000000702c00000, 0x0000000702c00000, 0x0000000702e00000| 0%| F| |TAMS 0x0000000702c00000| PB 0x0000000702c00000| Untracked | 0 +| 23|0x0000000702e00000, 0x0000000702e00000, 0x0000000703000000| 0%| F| |TAMS 0x0000000702e00000| PB 0x0000000702e00000| Untracked | 0 +| 24|0x0000000703000000, 0x0000000703000000, 0x0000000703200000| 0%| F| |TAMS 0x0000000703000000| PB 0x0000000703000000| Untracked | 0 +| 25|0x0000000703200000, 0x0000000703200000, 0x0000000703400000| 0%| F| |TAMS 0x0000000703200000| PB 0x0000000703200000| Untracked | 0 +| 26|0x0000000703400000, 0x0000000703400000, 0x0000000703600000| 0%| F| |TAMS 0x0000000703400000| PB 0x0000000703400000| Untracked | 0 +| 27|0x0000000703600000, 0x0000000703600000, 0x0000000703800000| 0%| F| |TAMS 0x0000000703600000| PB 0x0000000703600000| Untracked | 0 +| 28|0x0000000703800000, 0x0000000703800000, 0x0000000703a00000| 0%| F| |TAMS 0x0000000703800000| PB 0x0000000703800000| Untracked | 0 +| 29|0x0000000703a00000, 0x0000000703a00000, 0x0000000703c00000| 0%| F| |TAMS 0x0000000703a00000| PB 0x0000000703a00000| Untracked | 0 +| 30|0x0000000703c00000, 0x0000000703c00000, 0x0000000703e00000| 0%| F| |TAMS 0x0000000703c00000| PB 0x0000000703c00000| Untracked | 0 +| 31|0x0000000703e00000, 0x0000000703e00000, 0x0000000704000000| 0%| F| |TAMS 0x0000000703e00000| PB 0x0000000703e00000| Untracked | 0 +| 32|0x0000000704000000, 0x0000000704000000, 0x0000000704200000| 0%| F| |TAMS 0x0000000704000000| PB 0x0000000704000000| Untracked | 0 +| 33|0x0000000704200000, 0x0000000704200000, 0x0000000704400000| 0%| F| |TAMS 0x0000000704200000| PB 0x0000000704200000| Untracked | 0 +| 34|0x0000000704400000, 0x0000000704400000, 0x0000000704600000| 0%| F| |TAMS 0x0000000704400000| PB 0x0000000704400000| Untracked | 0 +| 35|0x0000000704600000, 0x0000000704600000, 0x0000000704800000| 0%| F| |TAMS 0x0000000704600000| PB 0x0000000704600000| Untracked | 0 +| 36|0x0000000704800000, 0x0000000704800000, 0x0000000704a00000| 0%| F| |TAMS 0x0000000704800000| PB 0x0000000704800000| Untracked | 0 +| 37|0x0000000704a00000, 0x0000000704a00000, 0x0000000704c00000| 0%| F| |TAMS 0x0000000704a00000| PB 0x0000000704a00000| Untracked | 0 +| 38|0x0000000704c00000, 0x0000000704c00000, 0x0000000704e00000| 0%| F| |TAMS 0x0000000704c00000| PB 0x0000000704c00000| Untracked | 0 +| 39|0x0000000704e00000, 0x0000000704e00000, 0x0000000705000000| 0%| F| |TAMS 0x0000000704e00000| PB 0x0000000704e00000| Untracked | 0 +| 40|0x0000000705000000, 0x0000000705000000, 0x0000000705200000| 0%| F| |TAMS 0x0000000705000000| PB 0x0000000705000000| Untracked | 0 +| 41|0x0000000705200000, 0x0000000705200000, 0x0000000705400000| 0%| F| |TAMS 0x0000000705200000| PB 0x0000000705200000| Untracked | 0 +| 42|0x0000000705400000, 0x0000000705400000, 0x0000000705600000| 0%| F| |TAMS 0x0000000705400000| PB 0x0000000705400000| Untracked | 0 +| 43|0x0000000705600000, 0x0000000705600000, 0x0000000705800000| 0%| F| |TAMS 0x0000000705600000| PB 0x0000000705600000| Untracked | 0 +| 44|0x0000000705800000, 0x0000000705800000, 0x0000000705a00000| 0%| F| |TAMS 0x0000000705800000| PB 0x0000000705800000| Untracked | 0 +| 45|0x0000000705a00000, 0x0000000705a00000, 0x0000000705c00000| 0%| F| |TAMS 0x0000000705a00000| PB 0x0000000705a00000| Untracked | 0 +| 46|0x0000000705c00000, 0x0000000705c00000, 0x0000000705e00000| 0%| F| |TAMS 0x0000000705c00000| PB 0x0000000705c00000| Untracked | 0 +| 47|0x0000000705e00000, 0x0000000705e00000, 0x0000000706000000| 0%| F| |TAMS 0x0000000705e00000| PB 0x0000000705e00000| Untracked | 0 +| 48|0x0000000706000000, 0x0000000706000000, 0x0000000706200000| 0%| F| |TAMS 0x0000000706000000| PB 0x0000000706000000| Untracked | 0 +| 49|0x0000000706200000, 0x0000000706200000, 0x0000000706400000| 0%| F| |TAMS 0x0000000706200000| PB 0x0000000706200000| Untracked | 0 +| 50|0x0000000706400000, 0x0000000706400000, 0x0000000706600000| 0%| F| |TAMS 0x0000000706400000| PB 0x0000000706400000| Untracked | 0 +| 51|0x0000000706600000, 0x0000000706600000, 0x0000000706800000| 0%| F| |TAMS 0x0000000706600000| PB 0x0000000706600000| Untracked | 0 +| 52|0x0000000706800000, 0x0000000706800000, 0x0000000706a00000| 0%| F| |TAMS 0x0000000706800000| PB 0x0000000706800000| Untracked | 0 +| 53|0x0000000706a00000, 0x0000000706a00000, 0x0000000706c00000| 0%| F| |TAMS 0x0000000706a00000| PB 0x0000000706a00000| Untracked | 0 +| 54|0x0000000706c00000, 0x0000000706c00000, 0x0000000706e00000| 0%| F| |TAMS 0x0000000706c00000| PB 0x0000000706c00000| Untracked | 0 +| 55|0x0000000706e00000, 0x0000000706e00000, 0x0000000707000000| 0%| F| |TAMS 0x0000000706e00000| PB 0x0000000706e00000| Untracked | 0 +| 56|0x0000000707000000, 0x0000000707000000, 0x0000000707200000| 0%| F| |TAMS 0x0000000707000000| PB 0x0000000707000000| Untracked | 0 +| 57|0x0000000707200000, 0x0000000707200000, 0x0000000707400000| 0%| F| |TAMS 0x0000000707200000| PB 0x0000000707200000| Untracked | 0 +| 58|0x0000000707400000, 0x0000000707400000, 0x0000000707600000| 0%| F| |TAMS 0x0000000707400000| PB 0x0000000707400000| Untracked | 0 +| 59|0x0000000707600000, 0x0000000707600000, 0x0000000707800000| 0%| F| |TAMS 0x0000000707600000| PB 0x0000000707600000| Untracked | 0 +| 60|0x0000000707800000, 0x0000000707800000, 0x0000000707a00000| 0%| F| |TAMS 0x0000000707800000| PB 0x0000000707800000| Untracked | 0 +| 61|0x0000000707a00000, 0x0000000707a00000, 0x0000000707c00000| 0%| F| |TAMS 0x0000000707a00000| PB 0x0000000707a00000| Untracked | 0 +| 62|0x0000000707c00000, 0x0000000707c00000, 0x0000000707e00000| 0%| F| |TAMS 0x0000000707c00000| PB 0x0000000707c00000| Untracked | 0 +| 63|0x0000000707e00000, 0x0000000707e00000, 0x0000000708000000| 0%| F| |TAMS 0x0000000707e00000| PB 0x0000000707e00000| Untracked | 0 +| 64|0x0000000708000000, 0x0000000708000000, 0x0000000708200000| 0%| F| |TAMS 0x0000000708000000| PB 0x0000000708000000| Untracked | 0 +| 65|0x0000000708200000, 0x0000000708200000, 0x0000000708400000| 0%| F| |TAMS 0x0000000708200000| PB 0x0000000708200000| Untracked | 0 +| 66|0x0000000708400000, 0x0000000708400000, 0x0000000708600000| 0%| F| |TAMS 0x0000000708400000| PB 0x0000000708400000| Untracked | 0 +| 67|0x0000000708600000, 0x0000000708600000, 0x0000000708800000| 0%| F| |TAMS 0x0000000708600000| PB 0x0000000708600000| Untracked | 0 +| 68|0x0000000708800000, 0x0000000708800000, 0x0000000708a00000| 0%| F| |TAMS 0x0000000708800000| PB 0x0000000708800000| Untracked | 0 +| 69|0x0000000708a00000, 0x0000000708a00000, 0x0000000708c00000| 0%| F| |TAMS 0x0000000708a00000| PB 0x0000000708a00000| Untracked | 0 +| 70|0x0000000708c00000, 0x0000000708c00000, 0x0000000708e00000| 0%| F| |TAMS 0x0000000708c00000| PB 0x0000000708c00000| Untracked | 0 +| 71|0x0000000708e00000, 0x0000000708e00000, 0x0000000709000000| 0%| F| |TAMS 0x0000000708e00000| PB 0x0000000708e00000| Untracked | 0 +| 72|0x0000000709000000, 0x0000000709000000, 0x0000000709200000| 0%| F| |TAMS 0x0000000709000000| PB 0x0000000709000000| Untracked | 0 +| 73|0x0000000709200000, 0x0000000709200000, 0x0000000709400000| 0%| F| |TAMS 0x0000000709200000| PB 0x0000000709200000| Untracked | 0 +| 74|0x0000000709400000, 0x0000000709400000, 0x0000000709600000| 0%| F| |TAMS 0x0000000709400000| PB 0x0000000709400000| Untracked | 0 +| 75|0x0000000709600000, 0x0000000709600000, 0x0000000709800000| 0%| F| |TAMS 0x0000000709600000| PB 0x0000000709600000| Untracked | 0 +| 76|0x0000000709800000, 0x0000000709800000, 0x0000000709a00000| 0%| F| |TAMS 0x0000000709800000| PB 0x0000000709800000| Untracked | 0 +| 77|0x0000000709a00000, 0x0000000709a00000, 0x0000000709c00000| 0%| F| |TAMS 0x0000000709a00000| PB 0x0000000709a00000| Untracked | 0 +| 78|0x0000000709c00000, 0x0000000709c00000, 0x0000000709e00000| 0%| F| |TAMS 0x0000000709c00000| PB 0x0000000709c00000| Untracked | 0 +| 79|0x0000000709e00000, 0x0000000709e00000, 0x000000070a000000| 0%| F| |TAMS 0x0000000709e00000| PB 0x0000000709e00000| Untracked | 0 +| 80|0x000000070a000000, 0x000000070a000000, 0x000000070a200000| 0%| F| |TAMS 0x000000070a000000| PB 0x000000070a000000| Untracked | 0 +| 81|0x000000070a200000, 0x000000070a200000, 0x000000070a400000| 0%| F| |TAMS 0x000000070a200000| PB 0x000000070a200000| Untracked | 0 +| 82|0x000000070a400000, 0x000000070a400000, 0x000000070a600000| 0%| F| |TAMS 0x000000070a400000| PB 0x000000070a400000| Untracked | 0 +| 83|0x000000070a600000, 0x000000070a600000, 0x000000070a800000| 0%| F| |TAMS 0x000000070a600000| PB 0x000000070a600000| Untracked | 0 +| 84|0x000000070a800000, 0x000000070a800000, 0x000000070aa00000| 0%| F| |TAMS 0x000000070a800000| PB 0x000000070a800000| Untracked | 0 +| 85|0x000000070aa00000, 0x000000070aa00000, 0x000000070ac00000| 0%| F| |TAMS 0x000000070aa00000| PB 0x000000070aa00000| Untracked | 0 +| 86|0x000000070ac00000, 0x000000070ac00000, 0x000000070ae00000| 0%| F| |TAMS 0x000000070ac00000| PB 0x000000070ac00000| Untracked | 0 +| 87|0x000000070ae00000, 0x000000070ae00000, 0x000000070b000000| 0%| F| |TAMS 0x000000070ae00000| PB 0x000000070ae00000| Untracked | 0 +| 88|0x000000070b000000, 0x000000070b000000, 0x000000070b200000| 0%| F| |TAMS 0x000000070b000000| PB 0x000000070b000000| Untracked | 0 +| 89|0x000000070b200000, 0x000000070b200000, 0x000000070b400000| 0%| F| |TAMS 0x000000070b200000| PB 0x000000070b200000| Untracked | 0 +| 90|0x000000070b400000, 0x000000070b400000, 0x000000070b600000| 0%| F| |TAMS 0x000000070b400000| PB 0x000000070b400000| Untracked | 0 +| 91|0x000000070b600000, 0x000000070b600000, 0x000000070b800000| 0%| F| |TAMS 0x000000070b600000| PB 0x000000070b600000| Untracked | 0 +| 92|0x000000070b800000, 0x000000070b800000, 0x000000070ba00000| 0%| F| |TAMS 0x000000070b800000| PB 0x000000070b800000| Untracked | 0 +| 93|0x000000070ba00000, 0x000000070ba00000, 0x000000070bc00000| 0%| F| |TAMS 0x000000070ba00000| PB 0x000000070ba00000| Untracked | 0 +| 94|0x000000070bc00000, 0x000000070bc00000, 0x000000070be00000| 0%| F| |TAMS 0x000000070bc00000| PB 0x000000070bc00000| Untracked | 0 +| 95|0x000000070be00000, 0x000000070be00000, 0x000000070c000000| 0%| F| |TAMS 0x000000070be00000| PB 0x000000070be00000| Untracked | 0 +| 96|0x000000070c000000, 0x000000070c000000, 0x000000070c200000| 0%| F| |TAMS 0x000000070c000000| PB 0x000000070c000000| Untracked | 0 +| 97|0x000000070c200000, 0x000000070c200000, 0x000000070c400000| 0%| F| |TAMS 0x000000070c200000| PB 0x000000070c200000| Untracked | 0 +| 98|0x000000070c400000, 0x000000070c400000, 0x000000070c600000| 0%| F| |TAMS 0x000000070c400000| PB 0x000000070c400000| Untracked | 0 +| 99|0x000000070c600000, 0x000000070c600000, 0x000000070c800000| 0%| F| |TAMS 0x000000070c600000| PB 0x000000070c600000| Untracked | 0 +| 100|0x000000070c800000, 0x000000070c800000, 0x000000070ca00000| 0%| F| |TAMS 0x000000070c800000| PB 0x000000070c800000| Untracked | 0 +| 101|0x000000070ca00000, 0x000000070ca00000, 0x000000070cc00000| 0%| F| |TAMS 0x000000070ca00000| PB 0x000000070ca00000| Untracked | 0 +| 102|0x000000070cc00000, 0x000000070cc00000, 0x000000070ce00000| 0%| F| |TAMS 0x000000070cc00000| PB 0x000000070cc00000| Untracked | 0 +| 103|0x000000070ce00000, 0x000000070ce00000, 0x000000070d000000| 0%| F| |TAMS 0x000000070ce00000| PB 0x000000070ce00000| Untracked | 0 +| 104|0x000000070d000000, 0x000000070d000000, 0x000000070d200000| 0%| F| |TAMS 0x000000070d000000| PB 0x000000070d000000| Untracked | 0 +| 105|0x000000070d200000, 0x000000070d200000, 0x000000070d400000| 0%| F| |TAMS 0x000000070d200000| PB 0x000000070d200000| Untracked | 0 +| 106|0x000000070d400000, 0x000000070d400000, 0x000000070d600000| 0%| F| |TAMS 0x000000070d400000| PB 0x000000070d400000| Untracked | 0 +| 107|0x000000070d600000, 0x000000070d600000, 0x000000070d800000| 0%| F| |TAMS 0x000000070d600000| PB 0x000000070d600000| Untracked | 0 +| 108|0x000000070d800000, 0x000000070d800000, 0x000000070da00000| 0%| F| |TAMS 0x000000070d800000| PB 0x000000070d800000| Untracked | 0 +| 109|0x000000070da00000, 0x000000070da00000, 0x000000070dc00000| 0%| F| |TAMS 0x000000070da00000| PB 0x000000070da00000| Untracked | 0 +| 110|0x000000070dc00000, 0x000000070dc00000, 0x000000070de00000| 0%| F| |TAMS 0x000000070dc00000| PB 0x000000070dc00000| Untracked | 0 +| 111|0x000000070de00000, 0x000000070de00000, 0x000000070e000000| 0%| F| |TAMS 0x000000070de00000| PB 0x000000070de00000| Untracked | 0 +| 112|0x000000070e000000, 0x000000070e000000, 0x000000070e200000| 0%| F| |TAMS 0x000000070e000000| PB 0x000000070e000000| Untracked | 0 +| 113|0x000000070e200000, 0x000000070e200000, 0x000000070e400000| 0%| F| |TAMS 0x000000070e200000| PB 0x000000070e200000| Untracked | 0 +| 114|0x000000070e400000, 0x000000070e400000, 0x000000070e600000| 0%| F| |TAMS 0x000000070e400000| PB 0x000000070e400000| Untracked | 0 +| 115|0x000000070e600000, 0x000000070e600000, 0x000000070e800000| 0%| F| |TAMS 0x000000070e600000| PB 0x000000070e600000| Untracked | 0 +| 116|0x000000070e800000, 0x000000070e800000, 0x000000070ea00000| 0%| F| |TAMS 0x000000070e800000| PB 0x000000070e800000| Untracked | 0 +| 117|0x000000070ea00000, 0x000000070ea00000, 0x000000070ec00000| 0%| F| |TAMS 0x000000070ea00000| PB 0x000000070ea00000| Untracked | 0 +| 118|0x000000070ec00000, 0x000000070ecf5c70, 0x000000070ee00000| 48%| E| |TAMS 0x000000070ec00000| PB 0x000000070ec00000| Complete | 0 +| 119|0x000000070ee00000, 0x000000070f000000, 0x000000070f000000|100%| E|CS|TAMS 0x000000070ee00000| PB 0x000000070ee00000| Complete | 0 +| 120|0x000000070f000000, 0x000000070f200000, 0x000000070f200000|100%| E|CS|TAMS 0x000000070f000000| PB 0x000000070f000000| Complete | 0 +| 121|0x000000070f200000, 0x000000070f400000, 0x000000070f400000|100%| E|CS|TAMS 0x000000070f200000| PB 0x000000070f200000| Complete | 0 +| 122|0x000000070f400000, 0x000000070f600000, 0x000000070f600000|100%| E|CS|TAMS 0x000000070f400000| PB 0x000000070f400000| Complete | 0 +| 123|0x000000070f600000, 0x000000070f800000, 0x000000070f800000|100%| E|CS|TAMS 0x000000070f600000| PB 0x000000070f600000| Complete | 0 +| 124|0x000000070f800000, 0x000000070fa00000, 0x000000070fa00000|100%| E|CS|TAMS 0x000000070f800000| PB 0x000000070f800000| Complete | 0 +| 125|0x000000070fa00000, 0x000000070fc00000, 0x000000070fc00000|100%| E|CS|TAMS 0x000000070fa00000| PB 0x000000070fa00000| Complete | 0 +| 126|0x000000070fc00000, 0x000000070fe00000, 0x000000070fe00000|100%| E|CS|TAMS 0x000000070fc00000| PB 0x000000070fc00000| Complete | 0 +| 127|0x000000070fe00000, 0x0000000710000000, 0x0000000710000000|100%| E|CS|TAMS 0x000000070fe00000| PB 0x000000070fe00000| Complete | 0 + +Card table byte_map: [0x00000001053c8000,0x0000000105bc8000] _byte_map_base: 0x0000000101bc8000 + +Marking Bits: (CMBitMap*) 0x0000000124030410 + Bits: [0x0000000148000000, 0x000000014c000000) + +Polling page: 0x00000001045c8000 + +Metaspace: + +Usage: + Non-class: 13.36 MB used. + Class: 1.68 MB used. + Both: 15.04 MB used. + +Virtual space: + Non-class space: 64.00 MB reserved, 13.56 MB ( 21%) committed, 1 nodes. + Class space: 1.00 GB reserved, 1.88 MB ( <1%) committed, 1 nodes. + Both: 1.06 GB reserved, 15.44 MB ( 1%) committed. + +Chunk freelists: + Non-Class: 2.35 MB + Class: 14.17 MB + Both: 16.52 MB + +MaxMetaspaceSize: unlimited +CompressedClassSpaceSize: 1.00 GB +Initial GC threshold: 21.00 MB +Current GC threshold: 21.00 MB +CDS: off + - commit_granule_bytes: 65536. + - commit_granule_words: 8192. + - virtual_space_node_default_size: 8388608. + - enlarge_chunks_in_place: 1. + - use_allocation_guard: 0. + + +Internal statistics: + +num_allocs_failed_limit: 0. +num_arena_births: 342. +num_arena_deaths: 0. +num_vsnodes_births: 2. +num_vsnodes_deaths: 0. +num_space_committed: 247. +num_space_uncommitted: 0. +num_chunks_returned_to_freelist: 0. +num_chunks_taken_from_freelist: 560. +num_chunk_merges: 0. +num_chunk_splits: 332. +num_chunks_enlarged: 190. +num_inconsistent_stats: 0. + +CodeHeap 'non-profiled nmethods': size=120032Kb used=365Kb max_used=365Kb free=119666Kb + bounds [0x0000000137ac8000, 0x0000000137d38000, 0x000000013f000000] +CodeHeap 'profiled nmethods': size=120016Kb used=2231Kb max_used=2231Kb free=117784Kb + bounds [0x0000000130000000, 0x0000000130270000, 0x0000000137534000] +CodeHeap 'non-nmethods': size=5712Kb used=1326Kb max_used=1338Kb free=4385Kb + bounds [0x0000000137534000, 0x00000001377a4000, 0x0000000137ac8000] + total_blobs=1688 nmethods=1204 adapters=391 + compilation: enabled + stopped_count=0, restarted_count=0 + full_count=0 + +Compilation events (20 events): +Event: 0.271 Thread 0x0000000123025a00 nmethod 1198 0x0000000130210c10 code [0x0000000130210dc0, 0x0000000130210f30] +Event: 0.271 Thread 0x0000000123025a00 1196 3 jdk.internal.classfile.impl.DirectCodeBuilder::with (30 bytes) +Event: 0.271 Thread 0x0000000123025a00 nmethod 1196 0x0000000130211010 code [0x0000000130211240, 0x00000001302119a0] +Event: 0.271 Thread 0x0000000123025a00 1199 3 jdk.internal.classfile.impl.AbstractPoolEntry::width (23 bytes) +Event: 0.271 Thread 0x0000000123025a00 nmethod 1199 0x0000000130211b90 code [0x0000000130211d40, 0x0000000130211ef8] +Event: 0.271 Thread 0x0000000123025a00 1197 3 jdk.internal.classfile.impl.AbstractInstruction$UnboundInstruction:: (10 bytes) +Event: 0.271 Thread 0x0000000123025a00 nmethod 1197 0x0000000130211f90 code [0x0000000130212140, 0x00000001302123f0] +Event: 0.271 Thread 0x0000000123025a00 1201 3 jdk.internal.classfile.impl.AbstractPoolEntry::phiMix (12 bytes) +Event: 0.271 Thread 0x0000000123025a00 nmethod 1201 0x0000000130212590 code [0x0000000130212700, 0x00000001302127e8] +Event: 0.271 Thread 0x0000000123025a00 1200 3 jdk.internal.classfile.impl.Util::checkKind (41 bytes) +Event: 0.271 Thread 0x0000000123025a00 nmethod 1200 0x0000000130212890 code [0x0000000130212b80, 0x0000000130213950] +Event: 0.271 Thread 0x0000000123025a00 1202 3 jdk.internal.classfile.impl.BufWriterImpl::writeU2 (8 bytes) +Event: 0.271 Thread 0x0000000123025a00 nmethod 1202 0x0000000130213e10 code [0x0000000130213fc0, 0x0000000130214138] +Event: 0.272 Thread 0x0000000123025a00 1203 3 jdk.internal.classfile.impl.SplitConstantPool::map (145 bytes) +Event: 0.272 Thread 0x0000000123025a00 nmethod 1203 0x0000000130214210 code [0x0000000130214500, 0x0000000130215280] +Event: 0.272 Thread 0x0000000123025a00 1204 3 java.util.stream.Sink$ChainedReference::cancellationRequested (10 bytes) +Event: 0.272 Thread 0x0000000123025a00 nmethod 1204 0x0000000130215690 code [0x0000000130215840, 0x0000000130215a58] +Event: 0.273 Thread 0x0000000123025a00 1206 3 java.util.ArrayList::isEmpty (13 bytes) +Event: 0.273 Thread 0x0000000123025a00 nmethod 1206 0x0000000130215b10 code [0x0000000130215cc0, 0x0000000130215e30] +Event: 0.273 Thread 0x0000000123025a00 1208 3 jdk.internal.classfile.impl.StackMapGenerator::processBlock (2767 bytes) + +GC Heap History (0 events): +No events + +Dll operation events (10 events): +Event: 0.005 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjava.dylib +Event: 0.056 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libzip.dylib +Event: 0.057 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libinstrument.dylib +Event: 0.060 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libnio.dylib +Event: 0.064 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libzip.dylib +Event: 0.072 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libnet.dylib +Event: 0.076 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libextnet.dylib +Event: 0.100 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjimage.dylib +Event: 0.229 Loaded shared library libsomelib.dylib +Event: 0.231 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libsyslookup.dylib + +Deoptimization events (20 events): +Event: 0.217 Thread 0x0000000124008c00 DEOPT PACKING pc=0x0000000137acf064 sp=0x000000016bad7330 +Event: 0.217 Thread 0x0000000124008c00 DEOPT UNPACKING pc=0x000000013757701c sp=0x000000016bad72d0 mode 2 +Event: 0.217 Thread 0x0000000124008c00 Uncommon trap: trap_request=0xffffff45 fr.pc=0x0000000137b083e0 relative=0x0000000000000060 +Event: 0.217 Thread 0x0000000124008c00 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000137b083e0 method=java.lang.CharacterData.of(I)Ljava/lang/CharacterData; @ 4 c2 +Event: 0.217 Thread 0x0000000124008c00 DEOPT PACKING pc=0x0000000137b083e0 sp=0x000000016bad6b60 +Event: 0.217 Thread 0x0000000124008c00 DEOPT UNPACKING pc=0x000000013757701c sp=0x000000016bad6b00 mode 2 +Event: 0.218 Thread 0x0000000124008c00 Uncommon trap: trap_request=0xffffff45 fr.pc=0x0000000137ad1af0 relative=0x00000000000000b0 +Event: 0.218 Thread 0x0000000124008c00 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000137ad1af0 method=java.lang.String.isLatin1()Z @ 10 c2 +Event: 0.218 Thread 0x0000000124008c00 DEOPT PACKING pc=0x0000000137ad1af0 sp=0x000000016bad74a0 +Event: 0.218 Thread 0x0000000124008c00 DEOPT UNPACKING pc=0x000000013757701c sp=0x000000016bad73d0 mode 2 +Event: 0.218 Thread 0x0000000124008c00 Uncommon trap: trap_request=0xffffff45 fr.pc=0x0000000137ae5350 relative=0x0000000000000190 +Event: 0.218 Thread 0x0000000124008c00 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000137ae5350 method=jdk.internal.util.ArraysSupport.vectorizedHashCode(Ljava/lang/Object;IIII)I @ 2 c2 +Event: 0.218 Thread 0x0000000124008c00 DEOPT PACKING pc=0x0000000137ae5350 sp=0x000000016bad7370 +Event: 0.218 Thread 0x0000000124008c00 DEOPT UNPACKING pc=0x000000013757701c sp=0x000000016bad7310 mode 2 +Event: 0.222 Thread 0x0000000124008c00 Uncommon trap: trap_request=0xffffff45 fr.pc=0x0000000137b0c7a0 relative=0x00000000000000e0 +Event: 0.222 Thread 0x0000000124008c00 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000137b0c7a0 method=sun.net.www.ParseUtil.firstEncodeIndex(Ljava/lang/String;)I @ 51 c2 +Event: 0.222 Thread 0x0000000124008c00 DEOPT PACKING pc=0x0000000137b0c7a0 sp=0x000000016bad67a0 +Event: 0.222 Thread 0x0000000124008c00 DEOPT UNPACKING pc=0x000000013757701c sp=0x000000016bad6720 mode 2 +Event: 0.255 Thread 0x0000000124008c00 DEOPT PACKING pc=0x00000001301c77e0 sp=0x000000016bad66e0 +Event: 0.255 Thread 0x0000000124008c00 DEOPT UNPACKING pc=0x0000000137576e7c sp=0x000000016bad6450 mode 3 + +Classes loaded (20 events): +Event: 0.273 Loading class jdk/internal/classfile/impl/BufferedCodeBuilder +Event: 0.273 Loading class jdk/internal/classfile/impl/BufferedCodeBuilder done +Event: 0.273 Loading class jdk/internal/classfile/impl/TransformingCodeBuilder +Event: 0.273 Loading class jdk/internal/classfile/impl/TransformingCodeBuilder done +Event: 0.274 Loading class java/lang/classfile/instruction/ThrowInstruction +Event: 0.274 Loading class java/lang/classfile/instruction/ThrowInstruction done +Event: 0.274 Loading class jdk/internal/classfile/impl/AbstractInstruction$UnboundThrowInstruction +Event: 0.274 Loading class jdk/internal/classfile/impl/AbstractInstruction$UnboundThrowInstruction done +Event: 0.274 Loading class java/lang/classfile/instruction/ExceptionCatch +Event: 0.274 Loading class java/lang/classfile/instruction/ExceptionCatch done +Event: 0.274 Loading class jdk/internal/classfile/impl/AbstractPseudoInstruction$ExceptionCatchImpl +Event: 0.274 Loading class jdk/internal/classfile/impl/AbstractPseudoInstruction +Event: 0.274 Loading class jdk/internal/classfile/impl/AbstractPseudoInstruction done +Event: 0.274 Loading class jdk/internal/classfile/impl/AbstractPseudoInstruction$ExceptionCatchImpl done +Event: 0.274 Loading class jdk/internal/classfile/impl/StackMapGenerator$RawExceptionCatch +Event: 0.274 Loading class jdk/internal/classfile/impl/StackMapGenerator$RawExceptionCatch done +Event: 0.274 Loading class jdk/internal/classfile/impl/SplitConstantPool$1 +Event: 0.275 Loading class jdk/internal/classfile/impl/SplitConstantPool$1 done +Event: 0.275 Loading class java/lang/invoke/ConstantBootstraps +Event: 0.275 Loading class java/lang/invoke/ConstantBootstraps done + +Classes unloaded (0 events): +No events + +Classes redefined (0 events): +No events + +Internal exceptions (20 events): +Event: 0.255 Thread 0x0000000124008c00 Exception (0x000000070ef3af28) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 0.256 Thread 0x0000000124008c00 Exception (0x000000070ef5a200) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 0.256 Thread 0x0000000124008c00 Exception (0x000000070ef5e850) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 0.256 Thread 0x0000000124008c00 Exception (0x000000070ef62408) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 0.257 Thread 0x0000000124008c00 Exception (0x000000070ef69f58) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 0.257 Thread 0x0000000124008c00 Exception (0x000000070ef71358) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 0.257 Thread 0x0000000124008c00 Exception (0x000000070ef78328) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 0.257 Thread 0x0000000124008c00 Exception (0x000000070ef7cde0) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 0.258 Thread 0x0000000124008c00 Exception (0x000000070ef9b0b8) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 0.261 Thread 0x0000000124008c00 Exception (0x000000070efc1bc0) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 841] +Event: 0.262 Thread 0x0000000124008c00 Exception (0x000000070efd3ce8) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 0.266 Thread 0x0000000124008c00 Exception (0x000000070ec30680) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 0.266 Thread 0x0000000124008c00 Exception (0x000000070ec3ac78) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 0.267 Thread 0x0000000124008c00 Exception (0x000000070ec4c5b8) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 0.268 Thread 0x0000000124008c00 Exception (0x000000070ec68c28) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 0.268 Thread 0x0000000124008c00 Exception (0x000000070ec6e0f8) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 0.269 Thread 0x0000000124008c00 Exception (0x000000070ec78050) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 0.272 Thread 0x0000000124008c00 Exception (0x000000070eca3ff8) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 0.275 Thread 0x0000000124008c00 Exception (0x000000070ecc5148) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 0.276 Thread 0x0000000124008c00 Exception (0x000000070ecd6920) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] + +ZGC Phase Switch (0 events): +No events + +VM Operations (10 events): +Event: 0.050 Executing VM operation: HandshakeAllThreads (Deoptimize) +Event: 0.050 Executing VM operation: HandshakeAllThreads (Deoptimize) done +Event: 0.121 Executing VM operation: HandshakeAllThreads (Deoptimize) +Event: 0.121 Executing VM operation: HandshakeAllThreads (Deoptimize) done +Event: 0.185 Executing VM operation: ICBufferFull +Event: 0.185 Executing VM operation: ICBufferFull done +Event: 0.213 Executing VM operation: HandshakeAllThreads (Deoptimize) +Event: 0.213 Executing VM operation: HandshakeAllThreads (Deoptimize) done +Event: 0.217 Executing VM operation: HandshakeAllThreads (Deoptimize) +Event: 0.217 Executing VM operation: HandshakeAllThreads (Deoptimize) done + +Events (20 events): +Event: 0.023 Thread 0x0000000123010a00 Thread added: 0x0000000123010a00 +Event: 0.023 Protecting memory [0x000000016ca50000,0x000000016ca5c000] with protection modes 0 +Event: 0.023 Thread 0x0000000122008200 Thread added: 0x0000000122008200 +Event: 0.023 Protecting memory [0x000000016cc5c000,0x000000016cc68000] with protection modes 0 +Event: 0.024 Thread 0x000000012508f400 Thread added: 0x000000012508f400 +Event: 0.024 Protecting memory [0x000000016ce68000,0x000000016ce74000] with protection modes 0 +Event: 0.024 Thread 0x000000012508fc00 Thread added: 0x000000012508fc00 +Event: 0.024 Protecting memory [0x000000016d074000,0x000000016d080000] with protection modes 0 +Event: 0.024 Thread 0x000000012509b200 Thread added: 0x000000012509b200 +Event: 0.024 Protecting memory [0x000000016d280000,0x000000016d28c000] with protection modes 0 +Event: 0.024 Thread 0x0000000123025200 Thread added: 0x0000000123025200 +Event: 0.024 Protecting memory [0x000000016d48c000,0x000000016d498000] with protection modes 0 +Event: 0.024 Thread 0x0000000123025a00 Thread added: 0x0000000123025a00 +Event: 0.024 Protecting memory [0x000000016d698000,0x000000016d6a4000] with protection modes 0 +Event: 0.044 Thread 0x000000010f8b2a00 Thread added: 0x000000010f8b2a00 +Event: 0.044 Protecting memory [0x000000016d8a4000,0x000000016d8b0000] with protection modes 0 +Event: 0.071 Thread 0x0000000124041200 Thread added: 0x0000000124041200 +Event: 0.071 Protecting memory [0x000000016dab0000,0x000000016dabc000] with protection modes 0 +Event: 0.071 Thread 0x0000000124041a00 Thread added: 0x0000000124041a00 +Event: 0.071 Protecting memory [0x000000016dcbc000,0x000000016dcc8000] with protection modes 0 + + +Dynamic libraries: +0x0000000104a3c000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjli.dylib +0x00000001a96bb000 /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa +0x0000000192c62000 /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit +0x0000000195cce000 /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData +0x0000000190515000 /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation +0x000000019bfdc000 /usr/lib/libSystem.B.dylib +0x0000000193f9f000 /System/Library/PrivateFrameworks/UIFoundation.framework/Versions/A/UIFoundation +0x000000022ab7f000 /System/Library/PrivateFrameworks/CollectionViewCore.framework/Versions/A/CollectionViewCore +0x00000001a3255000 /System/Library/PrivateFrameworks/RemoteViewServices.framework/Versions/A/RemoteViewServices +0x0000000199e89000 /System/Library/PrivateFrameworks/XCTTargetBootstrap.framework/Versions/A/XCTTargetBootstrap +0x000000019e618000 /System/Library/PrivateFrameworks/InternationalSupport.framework/Versions/A/InternationalSupport +0x000000019e66c000 /System/Library/PrivateFrameworks/UserActivity.framework/Versions/A/UserActivity +0x000000024efd6000 /System/Library/PrivateFrameworks/WindowManagement.framework/Versions/A/WindowManagement +0x0000000190195000 /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration +0x000000019da86000 /usr/lib/libspindump.dylib +0x0000000194154000 /System/Library/Frameworks/UniformTypeIdentifiers.framework/Versions/A/UniformTypeIdentifiers +0x0000000197d00000 /usr/lib/libapp_launch_measurement.dylib +0x0000000197126000 /System/Library/PrivateFrameworks/CoreAnalytics.framework/Versions/A/CoreAnalytics +0x0000000197d07000 /System/Library/PrivateFrameworks/CoreAutoLayout.framework/Versions/A/CoreAutoLayout +0x00000001996a9000 /System/Library/Frameworks/Metal.framework/Versions/A/Metal +0x000000019a631000 /usr/lib/liblangid.dylib +0x0000000199e8f000 /System/Library/PrivateFrameworks/CoreSVG.framework/Versions/A/CoreSVG +0x0000000194b19000 /System/Library/PrivateFrameworks/SkyLight.framework/Versions/A/SkyLight +0x0000000194fba000 /System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics +0x00000001a392f000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate +0x000000019d8e0000 /System/Library/PrivateFrameworks/IconServices.framework/Versions/A/IconServices +0x0000000199687000 /System/Library/Frameworks/IOSurface.framework/Versions/A/IOSurface +0x0000000197155000 /usr/lib/libDiagnosticMessagesClient.dylib +0x000000019bf1e000 /usr/lib/libz.1.dylib +0x00000001a70d4000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices +0x0000000199e71000 /System/Library/PrivateFrameworks/DFRFoundation.framework/Versions/A/DFRFoundation +0x00000001924bc000 /usr/lib/libicucore.A.dylib +0x000000019f676000 /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox +0x000000019e627000 /System/Library/PrivateFrameworks/DataDetectorsCore.framework/Versions/A/DataDetectorsCore +0x00000001b809a000 /System/Library/PrivateFrameworks/TextInput.framework/Versions/A/TextInput +0x0000000194a6a000 /usr/lib/libMobileGestalt.dylib +0x0000000199bad000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox +0x000000019762c000 /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore +0x00000001920e9000 /System/Library/Frameworks/Security.framework/Versions/A/Security +0x00000001a3295000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SpeechRecognition.framework/Versions/A/SpeechRecognition +0x0000000197a2e000 /System/Library/PrivateFrameworks/CoreUI.framework/Versions/A/CoreUI +0x00000001919e2000 /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio +0x0000000197239000 /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration +0x000000019dee2000 /System/Library/PrivateFrameworks/MultitouchSupport.framework/Versions/A/MultitouchSupport +0x0000000194a68000 /usr/lib/libenergytrace.dylib +0x00000001ad793000 /System/Library/PrivateFrameworks/RenderBox.framework/Versions/A/RenderBox +0x0000000192b16000 /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit +0x00000001a366a000 /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices +0x0000000197c8c000 /System/Library/PrivateFrameworks/PerformanceAnalysis.framework/Versions/A/PerformanceAnalysis +0x00000001e603f000 /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL +0x0000000197d51000 /usr/lib/libxml2.2.dylib +0x000000019b360000 /System/Library/PrivateFrameworks/MobileKeyBag.framework/Versions/A/MobileKeyBag +0x000000018ef80000 /usr/lib/libobjc.A.dylib +0x000000018f274000 /usr/lib/libc++.1.dylib +0x00000001a35e7000 /System/Library/Frameworks/Accessibility.framework/Versions/A/Accessibility +0x000000019569a000 /System/Library/Frameworks/ColorSync.framework/Versions/A/ColorSync +0x000000018f3c0000 /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation +0x000000019a1ec000 /System/Library/Frameworks/CoreImage.framework/Versions/A/CoreImage +0x00000001917ed000 /System/Library/Frameworks/CoreText.framework/Versions/A/CoreText +0x00000001ea89e000 /System/Library/Frameworks/CoreTransferable.framework/Versions/A/CoreTransferable +0x00000001ead63000 /System/Library/Frameworks/DeveloperToolsSupport.framework/Versions/A/DeveloperToolsSupport +0x0000000199eca000 /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO +0x0000000224d1f000 /System/Library/Frameworks/Symbols.framework/Versions/A/Symbols +0x000000019bfe2000 /System/Library/PrivateFrameworks/SoftLinking.framework/Versions/A/SoftLinking +0x000000019f028000 /usr/lib/swift/libswiftCore.dylib +0x00000001b4d27000 /usr/lib/swift/libswiftCoreFoundation.dylib +0x00000001b2790000 /usr/lib/swift/libswiftCoreGraphics.dylib +0x00000001b4d71000 /usr/lib/swift/libswiftCoreImage.dylib +0x00000001b2797000 /usr/lib/swift/libswiftDarwin.dylib +0x00000001a4cda000 /usr/lib/swift/libswiftDispatch.dylib +0x00000001b4d72000 /usr/lib/swift/libswiftIOKit.dylib +0x00000001c07cc000 /usr/lib/swift/libswiftMetal.dylib +0x00000001cde91000 /usr/lib/swift/libswiftOSLog.dylib +0x00000001a754f000 /usr/lib/swift/libswiftObjectiveC.dylib +0x00000001c4f00000 /usr/lib/swift/libswiftQuartzCore.dylib +0x00000001c9005000 /usr/lib/swift/libswiftUniformTypeIdentifiers.dylib +0x00000001b4d39000 /usr/lib/swift/libswiftXPC.dylib +0x000000025747d000 /usr/lib/swift/libswift_Concurrency.dylib +0x00000001a7553000 /usr/lib/swift/libswiftos.dylib +0x00000001b7ffe000 /usr/lib/swift/libswiftsimd.dylib +0x000000019c191000 /usr/lib/libcompression.dylib +0x000000019e572000 /System/Library/PrivateFrameworks/TextureIO.framework/Versions/A/TextureIO +0x000000019d58c000 /usr/lib/libate.dylib +0x000000019bfd6000 /usr/lib/system/libcache.dylib +0x000000019bf90000 /usr/lib/system/libcommonCrypto.dylib +0x000000019bfbc000 /usr/lib/system/libcompiler_rt.dylib +0x000000019bfb2000 /usr/lib/system/libcopyfile.dylib +0x000000018f0c4000 /usr/lib/system/libcorecrypto.dylib +0x000000018f1aa000 /usr/lib/system/libdispatch.dylib +0x000000018f365000 /usr/lib/system/libdyld.dylib +0x000000019bfcc000 /usr/lib/system/libkeymgr.dylib +0x000000019bf68000 /usr/lib/system/libmacho.dylib +0x000000019b448000 /usr/lib/system/libquarantine.dylib +0x000000019bfc9000 /usr/lib/system/libremovefile.dylib +0x0000000194ae0000 /usr/lib/system/libsystem_asl.dylib +0x000000018f059000 /usr/lib/system/libsystem_blocks.dylib +0x000000018f1f5000 /usr/lib/system/libsystem_c.dylib +0x000000019bfc0000 /usr/lib/system/libsystem_collections.dylib +0x000000019a620000 /usr/lib/system/libsystem_configuration.dylib +0x000000019965c000 /usr/lib/system/libsystem_containermanager.dylib +0x000000019bbff000 /usr/lib/system/libsystem_coreservices.dylib +0x0000000192783000 /usr/lib/system/libsystem_darwin.dylib +0x00000002577ca000 /usr/lib/system/libsystem_darwindirectory.dylib +0x000000019bfcd000 /usr/lib/system/libsystem_dnssd.dylib +0x00000002577ce000 /usr/lib/system/libsystem_eligibility.dylib +0x000000018f1f2000 /usr/lib/system/libsystem_featureflags.dylib +0x000000018f393000 /usr/lib/system/libsystem_info.dylib +0x000000019bf2d000 /usr/lib/system/libsystem_m.dylib +0x000000018f16d000 /usr/lib/system/libsystem_malloc.dylib +0x0000000194a4d000 /usr/lib/system/libsystem_networkextension.dylib +0x0000000192bf9000 /usr/lib/system/libsystem_notify.dylib +0x000000019a625000 /usr/lib/system/libsystem_sandbox.dylib +0x00000002577d2000 /usr/lib/system/libsystem_sanitizers.dylib +0x000000019bfc5000 /usr/lib/system/libsystem_secinit.dylib +0x000000018f31d000 /usr/lib/system/libsystem_kernel.dylib +0x000000018f38b000 /usr/lib/system/libsystem_platform.dylib +0x000000018f358000 /usr/lib/system/libsystem_pthread.dylib +0x00000001964d0000 /usr/lib/system/libsystem_symptoms.dylib +0x000000018f0a9000 /usr/lib/system/libsystem_trace.dylib +0x000000019bf9e000 /usr/lib/system/libunwind.dylib +0x000000018f05e000 /usr/lib/system/libxpc.dylib +0x000000018f301000 /usr/lib/libc++abi.dylib +0x000000019bfaa000 /usr/lib/liboah.dylib +0x000000019d438000 /usr/lib/liblzma.5.dylib +0x000000019bfde000 /usr/lib/libfakelink.dylib +0x0000000194679000 /System/Library/Frameworks/CFNetwork.framework/Versions/A/CFNetwork +0x000000019c032000 /usr/lib/libarchive.2.dylib +0x00000001a1568000 /System/Library/Frameworks/Combine.framework/Versions/A/Combine +0x000000022ab93000 /System/Library/PrivateFrameworks/CollectionsInternal.framework/Versions/A/CollectionsInternal +0x0000000241543000 /System/Library/PrivateFrameworks/ReflectionInternal.framework/Versions/A/ReflectionInternal +0x0000000241ad5000 /System/Library/PrivateFrameworks/RuntimeInternal.framework/Versions/A/RuntimeInternal +0x00000002575d1000 /usr/lib/swift/libswift_StringProcessing.dylib +0x0000000192a94000 /System/Library/PrivateFrameworks/CoreServicesInternal.framework/Versions/A/CoreServicesInternal +0x000000019b46f000 /usr/lib/libbsm.0.dylib +0x000000019bf70000 /usr/lib/system/libkxld.dylib +0x0000000197cc8000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/FSEvents.framework/Versions/A/FSEvents +0x000000019278e000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore +0x000000019719e000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata +0x000000019bc05000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices +0x000000019c0bb000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit +0x0000000196451000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE +0x000000018f899000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices +0x000000019d3e1000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/DictionaryServices.framework/Versions/A/DictionaryServices +0x0000000197cd5000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SharedFileList.framework/Versions/A/SharedFileList +0x000000019c15b000 /usr/lib/libapple_nghttp2.dylib +0x00000001960c5000 /usr/lib/libsqlite3.dylib +0x00000001964d9000 /System/Library/Frameworks/Network.framework/Versions/A/Network +0x0000000255e8e000 /usr/lib/libCoreEntitlements.dylib +0x000000023c44d000 /System/Library/PrivateFrameworks/MessageSecurity.framework/Versions/A/MessageSecurity +0x00000001960ab000 /System/Library/PrivateFrameworks/ProtocolBuffer.framework/Versions/A/ProtocolBuffer +0x000000019bb2e000 /System/Library/PrivateFrameworks/AppleFSCompression.framework/Versions/A/AppleFSCompression +0x000000019b457000 /usr/lib/libcoretls.dylib +0x000000019d457000 /usr/lib/libcoretls_cfhelpers.dylib +0x000000019c18b000 /usr/lib/libpam.2.dylib +0x000000019d4c9000 /usr/lib/libxar.1.dylib +0x000000019d8b7000 /usr/lib/libheimdal-asn1.dylib +0x0000000194678000 /usr/lib/libnetwork.dylib +0x000000019bfe3000 /usr/lib/libpcap.A.dylib +0x00000001964c5000 /usr/lib/libdns_services.dylib +0x000000019a62d000 /System/Library/PrivateFrameworks/AppleSystemInfo.framework/Versions/A/AppleSystemInfo +0x000000019b155000 /System/Library/PrivateFrameworks/IOMobileFramebuffer.framework/Versions/A/IOMobileFramebuffer +0x0000000257528000 /usr/lib/swift/libswift_RegexParser.dylib +0x000000019bbf2000 /usr/lib/libbz2.1.0.dylib +0x000000019b44b000 /usr/lib/libCheckFix.dylib +0x0000000194af8000 /System/Library/PrivateFrameworks/TCC.framework/Versions/A/TCC +0x000000019a633000 /System/Library/PrivateFrameworks/CoreNLP.framework/Versions/A/CoreNLP +0x0000000197157000 /System/Library/PrivateFrameworks/MetadataUtilities.framework/Versions/A/MetadataUtilities +0x000000019b481000 /usr/lib/libmecab.dylib +0x0000000190229000 /usr/lib/libCRFSuite.dylib +0x000000019b4dd000 /usr/lib/libgermantok.dylib +0x000000019c132000 /usr/lib/libThaiTokenizer.dylib +0x0000000197242000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.framework/Versions/A/vImage +0x00000001a3641000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/vecLib +0x000000019d510000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvMisc.dylib +0x000000019b030000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvDSP.dylib +0x000000018fca0000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib +0x000000019c266000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib +0x000000019b4e0000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLinearAlgebra.dylib +0x000000019c176000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparseBLAS.dylib +0x000000019c261000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libQuadrature.dylib +0x000000019a75c000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBNNS.dylib +0x000000019012e000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparse.dylib +0x000000023ab9c000 /System/Library/PrivateFrameworks/MIL.framework/Versions/A/MIL +0x000000019c019000 /usr/lib/libiconv.2.dylib +0x000000019bf64000 /usr/lib/libcharset.1.dylib +0x0000000197ca8000 /System/Library/Frameworks/OpenDirectory.framework/Versions/A/Frameworks/CFOpenDirectory.framework/Versions/A/CFOpenDirectory +0x0000000197c98000 /System/Library/Frameworks/OpenDirectory.framework/Versions/A/OpenDirectory +0x000000019d459000 /System/Library/PrivateFrameworks/APFS.framework/Versions/A/APFS +0x000000019b387000 /System/Library/Frameworks/SecurityFoundation.framework/Versions/A/SecurityFoundation +0x000000019d4d8000 /usr/lib/libutil.dylib +0x0000000238cfd000 /System/Library/PrivateFrameworks/InstalledContentLibrary.framework/Versions/A/InstalledContentLibrary +0x0000000192ad5000 /System/Library/PrivateFrameworks/CoreServicesStore.framework/Versions/A/CoreServicesStore +0x0000000228340000 /System/Library/PrivateFrameworks/AppleMobileFileIntegrity.framework/Versions/A/AppleMobileFileIntegrity +0x00000001b4cf5000 /usr/lib/libmis.dylib +0x00000001c53e7000 /System/Library/PrivateFrameworks/MobileSystemServices.framework/Versions/A/MobileSystemServices +0x00000001e3449000 /System/Library/PrivateFrameworks/ConfigProfileHelper.framework/Versions/A/ConfigProfileHelper +0x000000019c134000 /System/Library/PrivateFrameworks/AppleSauce.framework/Versions/A/AppleSauce +0x0000000191173000 /System/Library/PrivateFrameworks/LanguageModeling.framework/Versions/A/LanguageModeling +0x000000019d4dc000 /usr/lib/libxslt.1.dylib +0x000000019c020000 /usr/lib/libcmph.dylib +0x000000019b121000 /System/Library/PrivateFrameworks/CoreEmoji.framework/Versions/A/CoreEmoji +0x000000019a756000 /System/Library/PrivateFrameworks/LinguisticData.framework/Versions/A/LinguisticData +0x000000019003c000 /System/Library/PrivateFrameworks/Lexicon.framework/Versions/A/Lexicon +0x000000019b415000 /System/Library/PrivateFrameworks/BackgroundTaskManagement.framework/Versions/A/BackgroundTaskManagement +0x0000000256078000 /usr/lib/libTLE.dylib +0x000000019dda8000 /System/Library/PrivateFrameworks/AppleJPEG.framework/Versions/A/AppleJPEG +0x000000019d89c000 /usr/lib/libexpat.1.dylib +0x000000019e3d0000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libPng.dylib +0x000000019e3fb000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib +0x000000019e4e6000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libGIF.dylib +0x000000019ddee000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJP2.dylib +0x000000019e48b000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib +0x000000019e482000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libRadiance.dylib +0x0000000199a48000 /System/Library/PrivateFrameworks/FontServices.framework/libFontParser.dylib +0x00000001963ea000 /System/Library/PrivateFrameworks/RunningBoardServices.framework/Versions/A/RunningBoardServices +0x00000001a9f95000 /System/Library/PrivateFrameworks/IOSurfaceAccelerator.framework/Versions/A/IOSurfaceAccelerator +0x000000019dede000 /System/Library/PrivateFrameworks/WatchdogClient.framework/Versions/A/WatchdogClient +0x0000000191359000 /System/Library/Frameworks/CoreDisplay.framework/Versions/A/CoreDisplay +0x00000001998ff000 /System/Library/Frameworks/CoreMedia.framework/Versions/A/CoreMedia +0x000000019969f000 /System/Library/PrivateFrameworks/IOAccelerator.framework/Versions/A/IOAccelerator +0x0000000197e3b000 /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo +0x000000019c189000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/MetalPerformanceShaders +0x000000019df21000 /System/Library/Frameworks/VideoToolbox.framework/Versions/A/VideoToolbox +0x0000000197ed7000 /System/Library/PrivateFrameworks/UserManagement.framework/Versions/A/UserManagement +0x0000000196311000 /System/Library/PrivateFrameworks/BaseBoard.framework/Versions/A/BaseBoard +0x000000019a62b000 /System/Library/PrivateFrameworks/AggregateDictionary.framework/Versions/A/AggregateDictionary +0x000000022817a000 /System/Library/PrivateFrameworks/AppleKeyStore.framework/Versions/A/AppleKeyStore +0x000000019e47d000 /System/Library/PrivateFrameworks/GPUWrangler.framework/Versions/A/GPUWrangler +0x000000019e45d000 /System/Library/PrivateFrameworks/IOPresentment.framework/Versions/A/IOPresentment +0x000000019e485000 /System/Library/PrivateFrameworks/DSExternalDisplay.framework/Versions/A/DSExternalDisplay +0x0000000234d8a000 /System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/32023/Libraries/libllvm-flatbuffers.dylib +0x00000001e6032000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCoreFSCache.dylib +0x00000002319ee000 /System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/32023/Libraries/libGPUCompilerUtils.dylib +0x000000019e4ec000 /System/Library/PrivateFrameworks/CMCaptureCore.framework/Versions/A/CMCaptureCore +0x00000001eae86000 /System/Library/Frameworks/ExtensionFoundation.framework/Versions/A/ExtensionFoundation +0x00000001a5543000 /System/Library/PrivateFrameworks/CoreTime.framework/Versions/A/CoreTime +0x000000019da70000 /System/Library/PrivateFrameworks/AppServerSupport.framework/Versions/A/AppServerSupport +0x00000001a0004000 /System/Library/PrivateFrameworks/perfdata.framework/Versions/A/perfdata +0x000000019147d000 /System/Library/PrivateFrameworks/AudioToolboxCore.framework/Versions/A/AudioToolboxCore +0x00000001998d5000 /System/Library/PrivateFrameworks/caulk.framework/Versions/A/caulk +0x000000019f872000 /usr/lib/libAudioStatistics.dylib +0x00000001b402e000 /System/Library/PrivateFrameworks/SystemPolicy.framework/Versions/A/SystemPolicy +0x000000019fb4b000 /usr/lib/libSMC.dylib +0x00000001a953d000 /System/Library/Frameworks/CoreMIDI.framework/Versions/A/CoreMIDI +0x000000019e397000 /usr/lib/libAudioToolboxUtility.dylib +0x00000001af42f000 /System/Library/PrivateFrameworks/OSAServicesClient.framework/Versions/A/OSAServicesClient +0x00000001a0012000 /usr/lib/libperfcheck.dylib +0x00000001a4ffa000 /System/Library/PrivateFrameworks/BoardServices.framework/Versions/A/BoardServices +0x000000019d784000 /System/Library/PrivateFrameworks/PlugInKit.framework/Versions/A/PlugInKit +0x000000019b379000 /System/Library/PrivateFrameworks/AssertionServices.framework/Versions/A/AssertionServices +0x00000001a864e000 /System/Library/PrivateFrameworks/ASEProcessing.framework/Versions/A/ASEProcessing +0x00000001d1318000 /System/Library/PrivateFrameworks/Symbolication.framework/Versions/A/Symbolication +0x0000000240330000 /System/Library/PrivateFrameworks/PhotosensitivityProcessing.framework/Versions/A/PhotosensitivityProcessing +0x000000019da21000 /System/Library/PrivateFrameworks/GraphVisualizer.framework/Versions/A/GraphVisualizer +0x00000001e6094000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib +0x00000001e6053000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGFXShared.dylib +0x00000001e622c000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib +0x00000001e605c000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLImage.dylib +0x00000001e6050000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCVMSPluginSupport.dylib +0x0000000256030000 /usr/lib/libRosetta.dylib +0x00000001e6039000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCoreVMClient.dylib +0x000000022fbf4000 /System/Library/PrivateFrameworks/FontServices.framework/Versions/A/FontServices +0x000000019da2d000 /System/Library/PrivateFrameworks/OTSVG.framework/Versions/A/OTSVG +0x00000001979dc000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/Resources/libFontRegistry.dylib +0x000000019da7b000 /System/Library/PrivateFrameworks/FontServices.framework/libhvf.dylib +0x000000022fbf5000 /System/Library/PrivateFrameworks/FontServices.framework/libXTFontStaticRegistryData.dylib +0x000000019a572000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSCore.framework/Versions/A/MPSCore +0x000000019ba9c000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSImage.framework/Versions/A/MPSImage +0x000000019b4f5000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSNeuralNetwork.framework/Versions/A/MPSNeuralNetwork +0x000000019b940000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSMatrix.framework/Versions/A/MPSMatrix +0x000000019b74b000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSRayIntersector.framework/Versions/A/MPSRayIntersector +0x000000019b972000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSNDArray.framework/Versions/A/MPSNDArray +0x00000001ec760000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSFunctions.framework/Versions/A/MPSFunctions +0x00000001ec745000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSBenchmarkLoop.framework/Versions/A/MPSBenchmarkLoop +0x000000018fb54000 /System/Library/PrivateFrameworks/MetalTools.framework/Versions/A/MetalTools +0x00000001b91d7000 /System/Library/PrivateFrameworks/IOAccelMemoryInfo.framework/Versions/A/IOAccelMemoryInfo +0x00000001c52e0000 /System/Library/PrivateFrameworks/kperf.framework/Versions/A/kperf +0x00000001b4d1a000 /System/Library/PrivateFrameworks/GPURawCounter.framework/Versions/A/GPURawCounter +0x00000001a5415000 /System/Library/PrivateFrameworks/CoreSymbolication.framework/Versions/A/CoreSymbolication +0x00000001b4cc6000 /System/Library/PrivateFrameworks/MallocStackLogging.framework/Versions/A/MallocStackLogging +0x000000019d626000 /System/Library/PrivateFrameworks/CrashReporterSupport.framework/Versions/A/CrashReporterSupport +0x00000001a53d0000 /System/Library/PrivateFrameworks/DebugSymbols.framework/Versions/A/DebugSymbols +0x00000001c3c47000 /System/Library/PrivateFrameworks/OSAnalytics.framework/Versions/A/OSAnalytics +0x000000024d229000 /System/Library/PrivateFrameworks/VideoToolboxParavirtualizationSupport.framework/Versions/A/VideoToolboxParavirtualizationSupport +0x000000019d850000 /System/Library/PrivateFrameworks/AppleVA.framework/Versions/A/AppleVA +0x000000019f8ba000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS +0x0000000195849000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices +0x000000019e4fa000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/PrintCore +0x000000019fca4000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/QD.framework/Versions/A/QD +0x000000019fc98000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSyncLegacy.framework/Versions/A/ColorSyncLegacy +0x000000019f88a000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis +0x000000019e4b6000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATSUI.framework/Versions/A/ATSUI +0x000000019fc2b000 /usr/lib/libcups.2.dylib +0x00000001a0020000 /System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos +0x00000001a0031000 /System/Library/Frameworks/GSS.framework/Versions/A/GSS +0x000000019f939000 /usr/lib/libresolv.9.dylib +0x000000019da8c000 /System/Library/PrivateFrameworks/Heimdal.framework/Versions/A/Heimdal +0x00000001a74bc000 /System/Library/Frameworks/Kerberos.framework/Versions/A/Libraries/libHeimdalProxy.dylib +0x00000001a008b000 /System/Library/PrivateFrameworks/CommonAuth.framework/Versions/A/CommonAuth +0x00000001e9c6c000 /System/Library/Frameworks/AVFAudio.framework/Versions/A/AVFAudio +0x00000001af47e000 /System/Library/PrivateFrameworks/AXCoreUtilities.framework/Versions/A/AXCoreUtilities +0x000000023a274000 /System/Library/PrivateFrameworks/IsolatedCoreAudioClient.framework/Versions/A/IsolatedCoreAudioClient +0x000000019f7f6000 /System/Library/PrivateFrameworks/AudioSession.framework/Versions/A/AudioSession +0x00000001a1307000 /System/Library/Frameworks/IOBluetooth.framework/Versions/A/IOBluetooth +0x000000019d95b000 /System/Library/PrivateFrameworks/MediaExperience.framework/Versions/A/MediaExperience +0x000000019f635000 /System/Library/PrivateFrameworks/AudioSession.framework/libSessionUtility.dylib +0x000000019fcb0000 /System/Library/PrivateFrameworks/AudioResourceArbitration.framework/Versions/A/AudioResourceArbitration +0x00000001a4388000 /System/Library/PrivateFrameworks/PowerLog.framework/Versions/A/PowerLog +0x00000001a42a6000 /System/Library/Frameworks/CoreBluetooth.framework/Versions/A/CoreBluetooth +0x00000001a74bd000 /System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit +0x000000019b1e2000 /System/Library/PrivateFrameworks/CoreUtils.framework/Versions/A/CoreUtils +0x000000022de3f000 /System/Library/PrivateFrameworks/CoreUtilsExtras.framework/Versions/A/CoreUtilsExtras +0x0000000238b8a000 /System/Library/PrivateFrameworks/IO80211.framework/Versions/A/IO80211 +0x00000001a4f3e000 /System/Library/PrivateFrameworks/FrontBoardServices.framework/Versions/A/FrontBoardServices +0x00000001a6a85000 /System/Library/PrivateFrameworks/BackBoardServices.framework/Versions/A/BackBoardServices +0x000000019d8c2000 /System/Library/PrivateFrameworks/IconFoundation.framework/Versions/A/IconFoundation +0x00000001a3281000 /System/Library/PrivateFrameworks/SpeechRecognitionCore.framework/Versions/A/SpeechRecognitionCore +0x00000001af49d000 /usr/lib/libAccessibility.dylib +0x00000001a397b000 /System/Library/Frameworks/MediaAccessibility.framework/Versions/A/MediaAccessibility +0x00000001d49cc000 /System/Library/Frameworks/OSLog.framework/Versions/A/OSLog +0x00000001b4c54000 /System/Library/PrivateFrameworks/LoggingSupport.framework/Versions/A/LoggingSupport +0x0000000105c48000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/server/libjvm.dylib +0x00000001045dc000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjimage.dylib +0x0000000104608000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libinstrument.dylib +0x0000000104650000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjava.dylib +0x00000001048ec000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libzip.dylib +0x0000000104914000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libnio.dylib +0x0000000104638000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libnet.dylib +0x00000001046e8000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libextnet.dylib +0x0000000105bc8000 /Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/libsomelib.dylib +0x000000010462c000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libsyslookup.dylib + + +VM Arguments: +jvm_args: -ea -Didea.test.cyclic.buffer.size=1048576 -javaagent:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/lib/idea_rt.jar=60586:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/bin -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 +java_command: com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit5 dev.diplomattest.somelib.Float64VecTest,testFloat64Vec +java_class_path (initial): /Users/cristina/.m2/repository/org/junit/platform/junit-platform-launcher/1.10.3/junit-platform-launcher-1.10.3.jar:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/lib/idea_rt.jar:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/plugins/junit/lib/junit5-rt.jar:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/plugins/junit/lib/junit-rt.jar:/Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/target/test-classes:/Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/target/classes:/Users/cristina/.m2/repository/net/java/dev/jna/jna/5.14.0/jna-5.14.0.jar:/Users/cristina/.m2/repository/org/junit/jupiter/junit-jupiter/5.10.3/junit-jupiter-5.10.3.jar:/Users/cristina/.m2/repository/org/junit/jupiter/junit-jupiter-api/5.10.3/junit-jupiter-api-5.10.3.jar:/Users/cristina/.m2/repository/org/opentest4j/opentest4j/1.3.0/opentest4j-1.3.0.jar:/Users/cristina/.m2/repository/org/junit/platform/junit-platform-commons/1.10.3/junit-platform-commons-1.10.3.jar:/Users/cristina/.m2/repository/org/apiguardian/apiguardian-api/1.1.2/apiguardian-api-1.1.2.jar:/Users/cristina/.m2/repository/org/junit/jupiter/junit-jupiter-params/5.10.3/junit-jupiter-params-5.10.3.jar:/Users/cristina/.m2/repository/org/junit/jupiter/junit-jupiter-engine/5.10.3/junit-jupiter-engine-5.10.3.jar:/Users/cristina/.m2/repository/org/junit/platform/junit-platform-engine/1.10.3/junit-platform-engine-1.10.3.jar:/Users/cristina/.m2/repository/org/openjdk/jmh/jmh-core/1.37/jmh-core-1.37.jar:/Users/cristina/.m2/repository/net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4.jar:/Users/cristina/.m2/repository/org/apache/commons/commons-math3/3.6.1/commons-math3-3.6.1.jar:/Users/cristina/.m2/repository/org/openjdk/jmh/jmh-generator-annprocess/1.37/jmh-generator-annprocess-1.37.jar +Launcher Type: SUN_STANDARD + +[Global flags] + intx CICompilerCount = 4 {product} {ergonomic} + uint ConcGCThreads = 2 {product} {ergonomic} + uint G1ConcRefinementThreads = 8 {product} {ergonomic} + size_t G1HeapRegionSize = 2097152 {product} {ergonomic} + size_t InitialHeapSize = 268435456 {product} {ergonomic} + size_t MarkStackSize = 4194304 {product} {ergonomic} + size_t MaxHeapSize = 4294967296 {product} {ergonomic} + size_t MaxNewSize = 2575302656 {product} {ergonomic} + size_t MinHeapDeltaBytes = 2097152 {product} {ergonomic} + size_t MinHeapSize = 8388608 {product} {ergonomic} + uintx NonNMethodCodeHeapSize = 5839564 {pd product} {ergonomic} + uintx NonProfiledCodeHeapSize = 122909338 {pd product} {ergonomic} + uintx ProfiledCodeHeapSize = 122909338 {pd product} {ergonomic} + uintx ReservedCodeCacheSize = 251658240 {pd product} {ergonomic} + bool SegmentedCodeCache = true {product} {ergonomic} + size_t SoftMaxHeapSize = 4294967296 {manageable} {ergonomic} + bool UseCompressedOops = true {product lp64_product} {ergonomic} + bool UseG1GC = true {product} {ergonomic} + bool UseNUMA = false {product} {ergonomic} + bool UseNUMAInterleaving = false {product} {ergonomic} + +Logging: +Log output configuration: + #0: stdout all=warning uptime,level,tags foldmultilines=false + #1: stderr all=off uptime,level,tags foldmultilines=false + +Environment Variables: +JAVA_HOME=/Users/cristina/Library/Java/JavaVirtualMachines/corretto-19.0.1/Contents/Home/ +PATH=/Users/cristina/bin/jextract-22/bin:/bin:/Users/cristina/.modular/pkg/packages.modular.com_mojo/bin:/Users/cristina/Downloads/dart-sdk/bin:/opt/homebrew/Cellar/llvm/15.0.6/bin:/opt/homebrew/opt/openjdk/bin:/Users/cristina/.elan/bin:/Users/cristina/bin:/Users/cristina/Library/Application Support/Coursier/bin:/Users/cristina/Library/Python/3.8/bin:/Users/cristina/.local/bin:/Users/cristina/.cargo/bin:/Users/cristina/.cargo:/opt/homebrew/bin:/Users/cristina/.fzf/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/X11/bin:/Library/Apple/usr/bin:/usr/local/go/bin:/Library/TeX/texbin:/Users/cristina/.krew/bin +SHELL=/opt/homebrew/bin/fish +LC_CTYPE=en_US.UTF-8 +TMPDIR=/var/folders/x_/9qhndrhs79j640bxvmbkddfw0000gn/T/ + +Active Locale: +LC_ALL=C/en_US.UTF-8/C/C/C/C +LC_COLLATE=C +LC_CTYPE=en_US.UTF-8 +LC_MESSAGES=C +LC_MONETARY=C +LC_NUMERIC=C +LC_TIME=C + +Signal Handlers: + SIGSEGV: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_ONSTACK|SA_RESTART|SA_SIGINFO, unblocked + SIGBUS: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, unblocked + SIGFPE: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, unblocked + SIGPIPE: javaSignalHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked + SIGXFSZ: javaSignalHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked + SIGILL: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, unblocked + SIGUSR2: SR_handler in libjvm.dylib, mask=00100000000000000000000000000000, flags=SA_RESTART|SA_SIGINFO, blocked + SIGHUP: UserHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked + SIGINT: UserHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked + SIGTERM: UserHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked + SIGQUIT: UserHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked + SIGTRAP: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, unblocked + + +Periodic native trim disabled + +--------------- S Y S T E M --------------- + +OS: +uname: Darwin 23.5.0 Darwin Kernel Version 23.5.0: Wed May 1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000 arm64 +OS uptime: 45 days 10:06 hours +rlimit (soft/hard): STACK 8176k/65520k , CORE 0k/infinity , NPROC 2666/4000 , NOFILE 10240/infinity , AS infinity/infinity , CPU infinity/infinity , DATA infinity/infinity , FSIZE infinity/infinity , MEMLOCK infinity/infinity , RSS infinity/infinity +load average: 5.72 4.67 4.57 + +CPU: total 8 (initial active 8) 0x61:0x0:0x1b588bb3:0, fp, asimd, aes, pmull, sha1, sha256, crc32, lse, sha3, sha512 +machdep.cpu.brand_string:Apple M1 Pro +hw.cachelinesize:128 +hw.l1icachesize:131072 +hw.l1dcachesize:65536 +hw.l2cachesize:4194304 + +Memory: 16k page, physical 16777216k(111072k free), swap 3145728k(1371968k free) + +vm_info: OpenJDK 64-Bit Server VM (22.0.1+8) for bsd-aarch64 JRE (22.0.1+8), built on 2024-04-16T00:00:00Z by "admin" with clang Apple LLVM 15.0.0 (clang-1500.1.0.2.5) + +END. diff --git a/feature_tests/java/somelib/hs_err_pid98829.log b/feature_tests/java/somelib/hs_err_pid98829.log new file mode 100644 index 000000000..df207147e --- /dev/null +++ b/feature_tests/java/somelib/hs_err_pid98829.log @@ -0,0 +1,1291 @@ +# +# A fatal error has been detected by the Java Runtime Environment: +# +# SIGSEGV (0xb) at pc=0x000000010188daec, pid=98829, tid=10243 +# +# JRE version: OpenJDK Runtime Environment Temurin-22.0.1+8 (22.0.1+8) (build 22.0.1+8) +# Java VM: OpenJDK 64-Bit Server VM Temurin-22.0.1+8 (22.0.1+8, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-aarch64) +# Problematic frame: +# C [libsomelib.dylib+0x5aec] Float64Vec_new_isize+0xb4 +# +# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again +# +# If you would like to submit a bug report, please visit: +# https://github.com/adoptium/adoptium-support/issues +# The crash happened outside the Java Virtual Machine in native code. +# See problematic frame for where to report the bug. +# + +--------------- S U M M A R Y ------------ + +Command Line: -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:60588,suspend=y,server=n -ea -Didea.test.cyclic.buffer.size=1048576 -javaagent:/Users/cristina/Library/Caches/JetBrains/IdeaIC2024.1/captureAgent/debugger-agent.jar -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit5 dev.diplomattest.somelib.Float64VecTest,testFloat64Vec + +Host: "MacBookPro18,3" arm64, 8 cores, 16G, Darwin 23.5.0, macOS 14.5 (23F79) +Time: Wed Aug 14 21:07:28 2024 CEST elapsed time: 7.932889 seconds (0d 0h 0m 7s) + +--------------- T H R E A D --------------- + +Current thread (0x000000015580d200): JavaThread "main" [_thread_in_native, id=10243, stack(0x000000016fb98000,0x000000016fd9b000) (2060K)] + +Stack: [0x000000016fb98000,0x000000016fd9b000], sp=0x000000016fd97870, free space=2046k +Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) +C [libsomelib.dylib+0x5aec] Float64Vec_new_isize+0xb4 +v ~RuntimeStub::nep_invoker_blob 0x000000011267ecbc +j java.lang.invoke.LambdaForm$MH+0x00007e00001d0400.invoke(Ljava/lang/Object;JJJ)J+12 java.base@22.0.1 +j java.lang.invoke.LambdaForm$MH+0x00007e00001d3000.invokeExact_MT(Ljava/lang/Object;JJJLjava/lang/Object;)J+23 java.base@22.0.1 +j jdk.internal.foreign.abi.DowncallStub+0x00007e00001d1000.invoke(Ljava/lang/foreign/SegmentAllocator;Ljava/lang/foreign/MemorySegment;Ljava/lang/foreign/MemorySegment;)Ljava/lang/foreign/MemorySegment;+69 java.base@22.0.1 +j java.lang.invoke.LambdaForm$DMH+0x00007e00001d1400.invokeStaticInit(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+14 java.base@22.0.1 +j java.lang.invoke.LambdaForm$MH+0x00007e00001d2400.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+44 java.base@22.0.1 +j java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+19 java.base@22.0.1 +j dev.diplomattest.somelib.ntv.somelib_h.Float64Vec_new_isize(Ljava/lang/foreign/MemorySegment;)Ljava/lang/foreign/MemorySegment;+26 +j dev.diplomattest.somelib.Float64Vec.newIsize([J)Ldev/diplomattest/somelib/Float64Vec;+38 +j dev.diplomattest.somelib.Float64VecTest.testFloat64Vec()V+53 +j java.lang.invoke.LambdaForm$DMH+0x00007e0000140c00.invokeVirtual(Ljava/lang/Object;Ljava/lang/Object;)V+10 java.base@22.0.1 +j java.lang.invoke.LambdaForm$MH+0x00007e0000148400.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+31 java.base@22.0.1 +j java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+19 java.base@22.0.1 +j jdk.internal.reflect.DirectMethodHandleAccessor.invokeImpl(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+41 java.base@22.0.1 +j jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+23 java.base@22.0.1 +j java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+102 java.base@22.0.1 +j org.junit.platform.commons.util.ReflectionUtils.invokeMethod(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+42 +j org.junit.jupiter.engine.execution.MethodInvocation.proceed()Ljava/lang/Object;+16 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed()Ljava/lang/Object;+8 +j org.junit.jupiter.engine.extension.TimeoutExtension.intercept(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/TimeoutDuration;Lorg/junit/jupiter/engine/extension/TimeoutExtension$TimeoutProvider;)Ljava/lang/Object;+28 +j org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/TimeoutExtension$TimeoutProvider;)Ljava/lang/Object;+31 +j org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)V+9 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda+0x00007e0000117998.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)V+5 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall$VoidMethodInterceptorCall;Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)Ljava/lang/Void;+6 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall$$Lambda+0x00007e0000117da8.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)Ljava/lang/Object;+9 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+6 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$$Lambda+0x00007e00001465f0.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+14 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed()Ljava/lang/Object;+12 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+1 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/engine/execution/InvocationInterceptorChain$InterceptorCall;Ljava/util/List;)Ljava/lang/Object;+24 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InvocationInterceptorChain$InterceptorCall;)Ljava/lang/Object;+31 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;)Ljava/lang/Object;+15 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(Ljava/lang/reflect/Method;Ljava/lang/Object;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;)Ljava/lang/Object;+55 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;)V+28 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda+0x00007e0000142aa8.execute()V+12 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)V+21 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;+44 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;+6 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+79 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00007e0000136220.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00007e0000136000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 +j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00007e0000133bc0.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService$$Lambda+0x00007e0000136d10.accept(Ljava/lang/Object;)V+4 +j java.util.ArrayList.forEach(Ljava/util/function/Consumer;)V+46 java.base@22.0.1 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(Ljava/util/List;)V+6 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+116 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00007e0000136220.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00007e0000136000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 +j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00007e0000133bc0.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService$$Lambda+0x00007e0000136d10.accept(Ljava/lang/Object;)V+4 +j java.util.ArrayList.forEach(Ljava/util/function/Consumer;)V+46 java.base@22.0.1 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(Ljava/util/List;)V+6 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+116 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00007e0000136220.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00007e0000136000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 +j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00007e0000133bc0.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(Lorg/junit/platform/engine/support/hierarchical/HierarchicalTestExecutorService$TestTask;)Ljava/util/concurrent/Future;+1 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute()Ljava/util/concurrent/Future;+74 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(Lorg/junit/platform/engine/ExecutionRequest;)V+31 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/engine/TestDescriptor;Lorg/junit/platform/engine/EngineExecutionListener;Lorg/junit/platform/engine/ConfigurationParameters;Lorg/junit/platform/engine/TestEngine;)V+24 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/LauncherDiscoveryResult;Lorg/junit/platform/engine/EngineExecutionListener;)V+115 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;Lorg/junit/platform/engine/EngineExecutionListener;Lorg/junit/platform/launcher/TestExecutionListener;)V+55 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(Lorg/junit/platform/launcher/core/InternalTestPlan;Lorg/junit/platform/launcher/TestExecutionListener;)V+6 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator$$Lambda+0x00007e0000120000.accept(Ljava/lang/Object;)V+12 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(Lorg/junit/platform/engine/ConfigurationParameters;Lorg/junit/platform/launcher/core/ListenerRegistry;Ljava/util/function/Consumer;)V+51 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;[Lorg/junit/platform/launcher/TestExecutionListener;)V+23 +j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;[Lorg/junit/platform/launcher/TestExecutionListener;)V+6 +j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+34 +j org.junit.platform.launcher.core.DelegatingLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+6 +j org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+13 +j com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs([Ljava/lang/String;Ljava/lang/String;IZ)I+203 +j com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(Z)I+17 +j com.intellij.rt.execution.junit.TestsRepeater.repeat(IZLcom/intellij/rt/execution/junit/TestsRepeater$TestRun;)I+7 +j com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(Lcom/intellij/rt/junit/IdeaTestRunner;[Ljava/lang/String;Ljava/util/ArrayList;Ljava/lang/String;IZ)I+25 +j com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart([Ljava/lang/String;Ljava/lang/String;Ljava/util/ArrayList;Ljava/lang/String;)I+117 +j com.intellij.rt.junit.JUnitStarter.main([Ljava/lang/String;)V+97 +v ~StubRoutines::call_stub 0x0000000112554154 +...... +Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) +v ~RuntimeStub::nep_invoker_blob 0x000000011267ec8c +j java.lang.invoke.LambdaForm$MH+0x00007e00001d0400.invoke(Ljava/lang/Object;JJJ)J+12 java.base@22.0.1 +j java.lang.invoke.LambdaForm$MH+0x00007e00001d3000.invokeExact_MT(Ljava/lang/Object;JJJLjava/lang/Object;)J+23 java.base@22.0.1 +j jdk.internal.foreign.abi.DowncallStub+0x00007e00001d1000.invoke(Ljava/lang/foreign/SegmentAllocator;Ljava/lang/foreign/MemorySegment;Ljava/lang/foreign/MemorySegment;)Ljava/lang/foreign/MemorySegment;+69 java.base@22.0.1 +j java.lang.invoke.LambdaForm$DMH+0x00007e00001d1400.invokeStaticInit(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+14 java.base@22.0.1 +j java.lang.invoke.LambdaForm$MH+0x00007e00001d2400.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+44 java.base@22.0.1 +j java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+19 java.base@22.0.1 +j dev.diplomattest.somelib.ntv.somelib_h.Float64Vec_new_isize(Ljava/lang/foreign/MemorySegment;)Ljava/lang/foreign/MemorySegment;+26 +j dev.diplomattest.somelib.Float64Vec.newIsize([J)Ldev/diplomattest/somelib/Float64Vec;+38 +j dev.diplomattest.somelib.Float64VecTest.testFloat64Vec()V+53 +j java.lang.invoke.LambdaForm$DMH+0x00007e0000140c00.invokeVirtual(Ljava/lang/Object;Ljava/lang/Object;)V+10 java.base@22.0.1 +j java.lang.invoke.LambdaForm$MH+0x00007e0000148400.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+31 java.base@22.0.1 +j java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+19 java.base@22.0.1 +j jdk.internal.reflect.DirectMethodHandleAccessor.invokeImpl(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+41 java.base@22.0.1 +j jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+23 java.base@22.0.1 +j java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+102 java.base@22.0.1 +j org.junit.platform.commons.util.ReflectionUtils.invokeMethod(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+42 +j org.junit.jupiter.engine.execution.MethodInvocation.proceed()Ljava/lang/Object;+16 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed()Ljava/lang/Object;+8 +j org.junit.jupiter.engine.extension.TimeoutExtension.intercept(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/TimeoutDuration;Lorg/junit/jupiter/engine/extension/TimeoutExtension$TimeoutProvider;)Ljava/lang/Object;+28 +j org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/TimeoutExtension$TimeoutProvider;)Ljava/lang/Object;+31 +j org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)V+9 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda+0x00007e0000117998.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)V+5 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall$VoidMethodInterceptorCall;Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)Ljava/lang/Void;+6 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall$$Lambda+0x00007e0000117da8.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)Ljava/lang/Object;+9 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+6 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$$Lambda+0x00007e00001465f0.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+14 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed()Ljava/lang/Object;+12 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+1 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/engine/execution/InvocationInterceptorChain$InterceptorCall;Ljava/util/List;)Ljava/lang/Object;+24 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InvocationInterceptorChain$InterceptorCall;)Ljava/lang/Object;+31 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;)Ljava/lang/Object;+15 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(Ljava/lang/reflect/Method;Ljava/lang/Object;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;)Ljava/lang/Object;+55 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;)V+28 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda+0x00007e0000142aa8.execute()V+12 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)V+21 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;+44 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;+6 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+79 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00007e0000136220.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00007e0000136000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 +j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00007e0000133bc0.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService$$Lambda+0x00007e0000136d10.accept(Ljava/lang/Object;)V+4 +j java.util.ArrayList.forEach(Ljava/util/function/Consumer;)V+46 java.base@22.0.1 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(Ljava/util/List;)V+6 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+116 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00007e0000136220.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00007e0000136000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 +j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00007e0000133bc0.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService$$Lambda+0x00007e0000136d10.accept(Ljava/lang/Object;)V+4 +j java.util.ArrayList.forEach(Ljava/util/function/Consumer;)V+46 java.base@22.0.1 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(Ljava/util/List;)V+6 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+116 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00007e0000136220.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00007e0000136000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 +j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00007e0000133bc0.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(Lorg/junit/platform/engine/support/hierarchical/HierarchicalTestExecutorService$TestTask;)Ljava/util/concurrent/Future;+1 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute()Ljava/util/concurrent/Future;+74 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(Lorg/junit/platform/engine/ExecutionRequest;)V+31 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/engine/TestDescriptor;Lorg/junit/platform/engine/EngineExecutionListener;Lorg/junit/platform/engine/ConfigurationParameters;Lorg/junit/platform/engine/TestEngine;)V+24 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/LauncherDiscoveryResult;Lorg/junit/platform/engine/EngineExecutionListener;)V+115 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;Lorg/junit/platform/engine/EngineExecutionListener;Lorg/junit/platform/launcher/TestExecutionListener;)V+55 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(Lorg/junit/platform/launcher/core/InternalTestPlan;Lorg/junit/platform/launcher/TestExecutionListener;)V+6 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator$$Lambda+0x00007e0000120000.accept(Ljava/lang/Object;)V+12 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(Lorg/junit/platform/engine/ConfigurationParameters;Lorg/junit/platform/launcher/core/ListenerRegistry;Ljava/util/function/Consumer;)V+51 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;[Lorg/junit/platform/launcher/TestExecutionListener;)V+23 +j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;[Lorg/junit/platform/launcher/TestExecutionListener;)V+6 +j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+34 +j org.junit.platform.launcher.core.DelegatingLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+6 +j org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+13 +j com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs([Ljava/lang/String;Ljava/lang/String;IZ)I+203 +j com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(Z)I+17 +j com.intellij.rt.execution.junit.TestsRepeater.repeat(IZLcom/intellij/rt/execution/junit/TestsRepeater$TestRun;)I+7 +j com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(Lcom/intellij/rt/junit/IdeaTestRunner;[Ljava/lang/String;Ljava/util/ArrayList;Ljava/lang/String;IZ)I+25 +j com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart([Ljava/lang/String;Ljava/lang/String;Ljava/util/ArrayList;Ljava/lang/String;)I+117 +j com.intellij.rt.junit.JUnitStarter.main([Ljava/lang/String;)V+97 +v ~StubRoutines::call_stub 0x0000000112554154 + +siginfo: si_signo: 11 (SIGSEGV), si_code: 2 (SEGV_ACCERR), si_addr: 0x0000000000000001 + +Registers: + x0=0x0000600002f88a70 x1=0x0000000089c748a8 x2=0x0000000000000010 x3=0x0000000000000000 + x4=0x0000000000000003 x5=0x0000000000000a70 x6=0x0000600002f88a70 x7=0x0000000000000eb0 + x8=0x0000000000000000 x9=0x0000000000000000 x10=0x0000767e198f0000 x11=0x0000000000000010 +x12=0x0000600002fb22bc x13=0x00000000001ff800 x14=0x00000000000007fb x15=0x0000000089c748a8 +x16=0x00000000000000a7 x17=0x0000000089e74098 x18=0x0000000000000000 x19=0x0000000000000010 +x20=0x0000000000000002 x21=0x0000600002f88a70 x22=0x00000001018d8141 x23=0x0000000000000001 +x24=0x000000016fd979b8 x25=0x00000000fd81c000 x26=0x0000000121d20c08 x27=0x0000000000000000 +x28=0x000000015580d200 fp=0x000000016fd978a0 lr=0x000000010188da7c sp=0x000000016fd97870 +pc=0x000000010188daec cpsr=0x0000000080001000 + +Register to memory mapping: + +x0 =0x0000600002f88a70 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00 +x1 =0x0000000089c748a8 is an unknown value +x2 =0x0000000000000010 is an unknown value +x3 =0x0 is null +x4 =0x0000000000000003 is an unknown value +x5 =0x0000000000000a70 is an unknown value +x6 =0x0000600002f88a70 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00 +x7 =0x0000000000000eb0 is an unknown value +x8 =0x0 is null +x9 =0x0 is null +x10=0x0000767e198f0000 is an unknown value +x11=0x0000000000000010 is an unknown value +x12=0x0000600002fb22bc points into unknown readable memory: 98 3a 47 8a +x13=0x00000000001ff800 is an unknown value +x14=0x00000000000007fb is an unknown value +x15=0x0000000089c748a8 is an unknown value +x16=0x00000000000000a7 is an unknown value +x17=0x0000000089e74098 is an unknown value +x18=0x0 is null +x19=0x0000000000000010 is an unknown value +x20=0x0000000000000002 is an unknown value +x21=0x0000600002f88a70 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00 +x22=0x00000001018d8141: __rust_no_alloc_shim_is_unstable+0 in /Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/libsomelib.dylib at 0x0000000101888000 +x23=0x0000000000000001 is an unknown value +x24=0x000000016fd979b8 is pointing into the stack for thread: 0x000000015580d200 +x25=0x00000000fd81c000 is an unknown value +x26=0x0000000121d20c08 is pointing into metadata +x27=0x0 is null +x28=0x000000015580d200 is a thread + fp=0x000000016fd978a0 is pointing into the stack for thread: 0x000000015580d200 + lr=0x000000010188da7c: Float64Vec_new_isize+0x44 in /Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/libsomelib.dylib at 0x0000000101888000 + sp=0x000000016fd97870 is pointing into the stack for thread: 0x000000015580d200 + +Top of Stack: (sp=0x000000016fd97870) +0x000000016fd97870: 000000016fd979b8 000000070eb0b500 +0x000000016fd97880: 0000000121d20a54 00000001026dd2b0 +0x000000016fd97890: 000000016fd978e8 000000016fd978d0 +0x000000016fd978a0: 000000016fd978c0 000000011267ecbc +0x000000016fd978b0: 000000016fd97970 2c6380011256d844 +0x000000016fd978c0: 000000016fd97970 00000001125597a8 +0x000000016fd978d0: 000000070e6f01f8 fffffffffffffff2 +0x000000016fd978e0: 0000000000000000 000000070e600220 +0x000000016fd978f0: 0000000000000002 0000000000000000 +0x000000016fd97900: 0000000000000001 0000000000000000 +0x000000016fd97910: 000000010188da38 0000000000000000 +0x000000016fd97920: fffffffffffffff6 0000000121d20a54 +0x000000016fd97930: 0000000000000009 0000000121d20c08 +0x000000016fd97940: 000000070e62aaa0 ffffffffffffffec +0x000000016fd97950: 0000000000000000 0000000121d20a60 +0x000000016fd97960: ffffffffffffffef 000000016fd97970 +0x000000016fd97970: 000000016fd97a10 00000001125597a8 +0x000000016fd97980: 000000070e600220 0000000000000002 +0x000000016fd97990: 0000000000000000 0000000000000001 +0x000000016fd979a0: 0000000000000000 000000010188da38 +0x000000016fd979b0: 0000000000000000 000000070e600110 +0x000000016fd979c0: fffffffffffffff6 0000000121d2629f +0x000000016fd979d0: 0000000000000009 0000000121d26470 +0x000000016fd979e0: 000000070ff2c2c8 ffffffffffffffec +0x000000016fd979f0: 0000000000000000 0000000121d262b0 +0x000000016fd97a00: ffffffffffffffef 000000016fd97a10 +0x000000016fd97a10: 000000016fd97ab0 00000001125597a8 +0x000000016fd97a20: 000000070e6001f8 0000000000000002 +0x000000016fd97a30: 0000000000000000 0000000000000001 +0x000000016fd97a40: 0000000000000000 000000010188da38 +0x000000016fd97a50: 0000000000000000 000000070e600110 +0x000000016fd97a60: fffffffffffffff6 0000000121d22465 + +Instructions: (pc=0x000000010188daec) +0x000000010188d9ec: f6 57 41 a9 f8 5f c4 a8 c0 03 5f d6 00 01 80 52 +0x000000010188d9fc: 01 03 80 52 c7 d9 00 94 20 00 20 d4 16 00 80 d2 +0x000000010188da0c: e0 03 16 aa e1 03 15 aa bd d9 00 94 f5 03 00 aa +0x000000010188da1c: b3 00 00 b4 61 f2 7d d3 e0 03 14 aa 02 01 80 52 +0x000000010188da2c: 3a 03 00 94 e0 03 15 aa 54 db 00 94 f8 5f bc a9 +0x000000010188da3c: f6 57 01 a9 f4 4f 02 a9 fd 7b 03 a9 fd c3 00 91 +0x000000010188da4c: f4 03 01 aa 15 01 80 52 3f 00 00 f1 b7 02 80 9a +0x000000010188da5c: 33 f0 7d d3 56 02 00 f0 d6 06 05 91 e1 04 00 b4 +0x000000010188da6c: df 02 40 39 e0 03 13 aa 01 01 80 52 26 03 00 94 +0x000000010188da7c: 40 06 00 b4 f5 03 00 aa 08 00 80 d2 9f 22 00 f1 +0x000000010188da8c: e3 02 00 54 a9 02 17 cb 3f 01 01 f1 83 02 00 54 +0x000000010188da9c: 09 00 80 d2 88 f2 7d 92 ea 82 00 91 eb 03 08 aa +0x000000010188daac: 4c 01 09 8b 80 05 7f ad 82 0d 40 ad 00 d8 61 4e +0x000000010188dabc: 21 d8 61 4e 42 d8 61 4e 63 d8 61 4e ac 02 09 8b +0x000000010188dacc: 80 05 00 ad 82 0d 01 ad 29 01 01 91 6b 21 00 f1 +0x000000010188dadc: 81 fe ff 54 1f 01 14 eb 00 01 00 54 09 f1 7d d3 +0x000000010188daec: e0 6a 69 fc 00 d8 61 5e a0 6a 29 fc 08 05 00 91 +0x000000010188dafc: 9f 02 08 eb 41 ff ff 54 df 02 40 39 00 03 80 52 +0x000000010188db0c: 01 01 80 52 00 03 00 94 00 01 00 b4 14 54 00 a9 +0x000000010188db1c: 14 08 00 f9 fd 7b 43 a9 f4 4f 42 a9 f6 57 41 a9 +0x000000010188db2c: f8 5f c4 a8 c0 03 5f d6 00 01 80 52 01 03 80 52 +0x000000010188db3c: 78 d9 00 94 20 00 20 d4 00 01 80 52 e1 03 13 aa +0x000000010188db4c: 6f d9 00 94 f6 03 00 aa b4 00 00 b4 e0 03 15 aa +0x000000010188db5c: e1 03 13 aa 02 01 80 52 ec 02 00 94 e0 03 16 aa +0x000000010188db6c: 06 db 00 94 f8 5f bc a9 f6 57 01 a9 f4 4f 02 a9 +0x000000010188db7c: fd 7b 03 a9 fd c3 00 91 f4 03 01 aa 15 01 80 52 +0x000000010188db8c: 3f 00 00 f1 b7 02 80 9a 33 f0 7d d3 56 02 00 f0 +0x000000010188db9c: d6 06 05 91 e1 04 00 b4 df 02 40 39 e0 03 13 aa +0x000000010188dbac: 01 01 80 52 d8 02 00 94 40 06 00 b4 f5 03 00 aa +0x000000010188dbbc: 08 00 80 d2 9f 22 00 f1 e3 02 00 54 a9 02 17 cb +0x000000010188dbcc: 3f 01 01 f1 83 02 00 54 09 00 80 d2 88 f2 7d 92 +0x000000010188dbdc: ea 82 00 91 eb 03 08 aa 4c 01 09 8b 80 05 7f ad + + +Stack slot to memory mapping: + +stack at sp + 0 slots: 0x000000016fd979b8 is pointing into the stack for thread: 0x000000015580d200 +stack at sp + 1 slots: 0x000000070eb0b500 is an oop: jdk.internal.org.objectweb.asm.SymbolTable$Entry +{0x000000070eb0b500} - klass: 'jdk/internal/org/objectweb/asm/SymbolTable$Entry' + - ---- fields (total size 7 words): + - final 'index' 'I' @12 45 (0x0000002d) + - final 'data' 'J' @16 0 (0x0000000000000000) + - final 'tag' 'I' @24 1 (0x00000001) + - 'info' 'I' @28 0 (0x00000000) + - final 'owner' 'Ljava/lang/String;' @32 null (0x00000000) + - final 'name' 'Ljava/lang/String;' @36 null (0x00000000) + - final 'value' 'Ljava/lang/String;' @40 a 'java/util/ArrayList$Itr'{0x000000070fe74df0} (0xe1fce9be) + - final 'hashCode' 'I' @44 881600600 (0x348c2858) + - 'next' 'Ljdk/internal/org/objectweb/asm/SymbolTable$Entry;' @48 null (0x00000000) +stack at sp + 2 slots: 0x0000000121d20a54 is pointing into metadata +stack at sp + 3 slots: 0x00000001026dd2b0: _ZN19TemplateInterpreter13_active_tableE+0 in /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/server/libjvm.dylib at 0x0000000101988000 +stack at sp + 4 slots: 0x000000016fd978e8 is pointing into the stack for thread: 0x000000015580d200 +stack at sp + 5 slots: 0x000000016fd978d0 is pointing into the stack for thread: 0x000000015580d200 +stack at sp + 6 slots: 0x000000016fd978c0 is pointing into the stack for thread: 0x000000015580d200 +stack at sp + 7 slots: 0x000000011267ecbc is at code_begin+60 in +[CodeBlob (0x000000011267ec10)] +Framesize: 4 +Runtime Stub (0x000000011267ec10): nep_invoker_blob +-------------------------------------------------------------------------------- +Decoding CodeBlob, name: nep_invoker_blob, at [0x000000011267ec80, 0x000000011267ed50] 208 bytes +[MachCode] + 0x000000011267ec80: fd7b bfa9 | fd03 0091 | bf43 00d1 | 0900 0010 | 89d7 01f9 | e903 0091 | 89d3 01f9 | 9ddb 01f9 + 0x000000011267eca0: e903 7eb2 | 8a53 1191 | 49fd 9f88 | e903 01aa | e103 03aa | e003 02aa | 2001 3fd6 | a900 80d2 + 0x000000011267ecc0: 8957 04b9 | bf3b 03d5 | 8963 1191 | 29fd dfc8 | bf03 09eb | e801 0054 | 8953 44b9 | a901 0035 + 0x000000011267ece0: e903 7db2 | 8a53 1191 | 49fd 9f88 | 8943 5339 | 3f09 0071 | e001 0054 | 9fd3 01f9 | 9fdb 01f9 + 0x000000011267ed00: 9fd7 01f9 | bf03 0091 | fd7b c1a8 | c003 5fd6 | e003 00f9 | e003 1caa | 897d 9cd2 | 893c a0f2 + 0x000000011267ed20: 2900 c0f2 | 2001 3fd6 | e003 40f9 | edff ff17 | e003 00f9 | 0919 95d2 | a944 a0f2 | 2900 c0f2 + 0x000000011267ed40: 2001 3fd6 | e003 40f9 | ecff ff17 | 0000 0000 +[/MachCode] +-------------------------------------------------------------------------------- + +-------------------------------------------------------------------------------- +Decoding CodeBlob, name: nep_invoker_blob, at [0x000000011267ec80, 0x000000011267ed50] 208 bytes +[MachCode] + 0x000000011267ec80: fd7b bfa9 | fd03 0091 | bf43 00d1 | 0900 0010 | 89d7 01f9 | e903 0091 | 89d3 01f9 | 9ddb 01f9 + 0x000000011267eca0: e903 7eb2 | 8a53 1191 | 49fd 9f88 | e903 01aa | e103 03aa | e003 02aa | 2001 3fd6 | a900 80d2 + 0x000000011267ecc0: 8957 04b9 | bf3b 03d5 | 8963 1191 | 29fd dfc8 | bf03 09eb | e801 0054 | 8953 44b9 | a901 0035 + 0x000000011267ece0: e903 7db2 | 8a53 1191 | 49fd 9f88 | 8943 5339 | 3f09 0071 | e001 0054 | 9fd3 01f9 | 9fdb 01f9 + 0x000000011267ed00: 9fd7 01f9 | bf03 0091 | fd7b c1a8 | c003 5fd6 | e003 00f9 | e003 1caa | 897d 9cd2 | 893c a0f2 + 0x000000011267ed20: 2900 c0f2 | 2001 3fd6 | e003 40f9 | edff ff17 | e003 00f9 | 0919 95d2 | a944 a0f2 | 2900 c0f2 + 0x000000011267ed40: 2001 3fd6 | e003 40f9 | ecff ff17 | 0000 0000 +[/MachCode] +-------------------------------------------------------------------------------- + + +--------------- P R O C E S S --------------- + +Threads class SMR info: +_java_thread_list=0x0000600002df8300, length=13, elements={ +0x000000015580d200, 0x00000001570f0000, 0x00000001570ef000, 0x000000015580ea00, +0x000000015580f200, 0x000000015580da00, 0x000000015580e200, 0x0000000155814000, +0x00000001570ef800, 0x0000000126808200, 0x0000000120819e00, 0x0000000155814800, +0x000000015690ca00 +} + +Java Threads: ( => current thread ) +=>0x000000015580d200 JavaThread "main" [_thread_in_native, id=10243, stack(0x000000016fb98000,0x000000016fd9b000) (2060K)] + 0x00000001570f0000 JavaThread "Reference Handler" daemon [_thread_blocked, id=29187, stack(0x0000000170d10000,0x0000000170f13000) (2060K)] + 0x00000001570ef000 JavaThread "Finalizer" daemon [_thread_blocked, id=28675, stack(0x0000000170f1c000,0x000000017111f000) (2060K)] + 0x000000015580ea00 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=24579, stack(0x0000000171128000,0x000000017132b000) (2060K)] + 0x000000015580f200 JavaThread "Service Thread" daemon [_thread_blocked, id=24835, stack(0x0000000171334000,0x0000000171537000) (2060K)] + 0x000000015580da00 JavaThread "Monitor Deflation Thread" daemon [_thread_blocked, id=25091, stack(0x0000000171540000,0x0000000171743000) (2060K)] + 0x000000015580e200 JavaThread "C2 CompilerThread0" daemon [_thread_in_vm, id=27651, stack(0x000000017174c000,0x000000017194f000) (2060K)] + 0x0000000155814000 JavaThread "C1 CompilerThread0" daemon [_thread_in_vm, id=27395, stack(0x0000000171958000,0x0000000171b5b000) (2060K)] + 0x00000001570ef800 JavaThread "Common-Cleaner" daemon [_thread_blocked, id=26883, stack(0x0000000171b64000,0x0000000171d67000) (2060K)] + 0x0000000126808200 JavaThread "JDWP Transport Listener: dt_socket" daemon [_thread_blocked, id=26627, stack(0x0000000171d70000,0x0000000171f73000) (2060K)] + 0x0000000120819e00 JavaThread "JDWP Event Helper Thread" daemon [_thread_blocked, id=25859, stack(0x0000000171f7c000,0x000000017217f000) (2060K)] + 0x0000000155814800 JavaThread "JDWP Command Reader" daemon [_thread_in_native, id=32771, stack(0x0000000172188000,0x000000017238b000) (2060K)] + 0x000000015690ca00 JavaThread "Notification Thread" daemon [_thread_blocked, id=43267, stack(0x0000000172394000,0x0000000172597000) (2060K)] +Total: 13 + +Other Threads: + 0x000000015610a330 VMThread "VM Thread" [id=17923, stack(0x00000001709ec000,0x0000000170bef000) (2060K)] + 0x00000001561073b0 WatcherThread "VM Periodic Task Thread" [id=19971, stack(0x00000001707e0000,0x00000001709e3000) (2060K)] + 0x00000001560064d0 WorkerThread "GC Thread#0" [id=13315, stack(0x000000016fda4000,0x000000016ffa7000) (2060K)] + 0x000000012020f8d0 WorkerThread "GC Thread#1" [id=23815, stack(0x00000001725a0000,0x00000001727a3000) (2060K)] + 0x000000012020fe40 WorkerThread "GC Thread#2" [id=42755, stack(0x00000001727ac000,0x00000001729af000) (2060K)] + 0x000000015562e790 WorkerThread "GC Thread#3" [id=42499, stack(0x00000001729b8000,0x0000000172bbb000) (2060K)] + 0x0000000145620b80 WorkerThread "GC Thread#4" [id=41987, stack(0x0000000172bc4000,0x0000000172dc7000) (2060K)] + 0x0000000120130d50 WorkerThread "GC Thread#5" [id=41475, stack(0x0000000172dd0000,0x0000000172fd3000) (2060K)] + 0x0000000145621760 WorkerThread "GC Thread#6" [id=41219, stack(0x0000000172fdc000,0x00000001731df000) (2060K)] + 0x00000001456220c0 WorkerThread "GC Thread#7" [id=34051, stack(0x00000001731e8000,0x00000001733eb000) (2060K)] + 0x00000001256042b0 ConcurrentGCThread "G1 Main Marker" [id=14595, stack(0x000000016ffb0000,0x00000001701b3000) (2060K)] + 0x0000000145604900 WorkerThread "G1 Conc#0" [id=13827, stack(0x00000001701bc000,0x00000001703bf000) (2060K)] + 0x000000015705f400 ConcurrentGCThread "G1 Refine#0" [id=21507, stack(0x00000001703c8000,0x00000001705cb000) (2060K)] + 0x0000000155704100 ConcurrentGCThread "G1 Service" [id=20995, stack(0x00000001705d4000,0x00000001707d7000) (2060K)] +Total: 14 + +Threads with active compile tasks: +C2 CompilerThread0 7938 1237 4 jdk.internal.org.objectweb.asm.SymbolTable::addConstantUtf8Reference (101 bytes) +C1 CompilerThread0 7938 1248 3 jdk.internal.classfile.impl.StackMapGenerator::processBlock (2767 bytes) +Total: 2 + +VM state: not at safepoint (normal execution) + +VM Mutex/Monitor currently owned by a thread: ([mutex/lock_event]) +[0x00000001027467d8] MethodCompileQueue_lock - owner thread: 0x0000000155814000 +[0x0000000102747198] CodeCache_lock - owner thread: 0x0000000155814000 +[0x0000000102747258] Compile_lock - owner thread: 0x0000000155814000 + +Heap address: 0x0000000700000000, size: 4096 MB, Compressed Oops mode: Zero based, Oop shift amount: 3 + +CDS archive(s) not mapped +Compressed class space mapped at: 0x00007e0000000000-0x00007e0040000000, reserved size: 1073741824 +Narrow klass base: 0x00007e0000000000, Narrow klass shift: 0, Narrow klass range: 0x40000000 + +GC Precious Log: + CardTable entry size: 512 + Card Set container configuration: InlinePtr #cards 4 size 8 Array Of Cards #cards 16 size 48 Howl #buckets 8 coarsen threshold 3686 Howl Bitmap #cards 512 size 80 coarsen threshold 460 Card regions per heap region 1 cards per card region 4096 + CPUs: 8 total, 8 available + Memory: 16384M + Large Page Support: Disabled + NUMA Support: Disabled + Compressed Oops: Enabled (Zero based) + Heap Region Size: 2M + Heap Min Capacity: 8M + Heap Initial Capacity: 256M + Heap Max Capacity: 4G + Pre-touch: Disabled + Parallel Workers: 8 + Concurrent Workers: 2 + Concurrent Refinement Workers: 8 + Periodic GC: Disabled + +Heap: + garbage-first heap total reserved 4194304K, committed 262144K, used 2773K [0x0000000700000000, 0x0000000800000000) + region size 2048K, 3 young (6144K), 2 survivors (4096K) + Metaspace used 15165K, committed 15552K, reserved 1114112K + class space used 1680K, committed 1856K, reserved 1048576K + +Heap Regions: E=young(eden), S=young(survivor), O=old, HS=humongous(starts), HC=humongous(continues), CS=collection set, F=free, TAMS=top-at-mark-start, PB=parsable bottom +| 0|0x0000000700000000, 0x0000000700000000, 0x0000000700200000| 0%| F| |TAMS 0x0000000700000000| PB 0x0000000700000000| Untracked | 0 +| 1|0x0000000700200000, 0x0000000700200000, 0x0000000700400000| 0%| F| |TAMS 0x0000000700200000| PB 0x0000000700200000| Untracked | 0 +| 2|0x0000000700400000, 0x0000000700400000, 0x0000000700600000| 0%| F| |TAMS 0x0000000700400000| PB 0x0000000700400000| Untracked | 0 +| 3|0x0000000700600000, 0x0000000700600000, 0x0000000700800000| 0%| F| |TAMS 0x0000000700600000| PB 0x0000000700600000| Untracked | 0 +| 4|0x0000000700800000, 0x0000000700800000, 0x0000000700a00000| 0%| F| |TAMS 0x0000000700800000| PB 0x0000000700800000| Untracked | 0 +| 5|0x0000000700a00000, 0x0000000700a00000, 0x0000000700c00000| 0%| F| |TAMS 0x0000000700a00000| PB 0x0000000700a00000| Untracked | 0 +| 6|0x0000000700c00000, 0x0000000700c00000, 0x0000000700e00000| 0%| F| |TAMS 0x0000000700c00000| PB 0x0000000700c00000| Untracked | 0 +| 7|0x0000000700e00000, 0x0000000700e00000, 0x0000000701000000| 0%| F| |TAMS 0x0000000700e00000| PB 0x0000000700e00000| Untracked | 0 +| 8|0x0000000701000000, 0x0000000701000000, 0x0000000701200000| 0%| F| |TAMS 0x0000000701000000| PB 0x0000000701000000| Untracked | 0 +| 9|0x0000000701200000, 0x0000000701200000, 0x0000000701400000| 0%| F| |TAMS 0x0000000701200000| PB 0x0000000701200000| Untracked | 0 +| 10|0x0000000701400000, 0x0000000701400000, 0x0000000701600000| 0%| F| |TAMS 0x0000000701400000| PB 0x0000000701400000| Untracked | 0 +| 11|0x0000000701600000, 0x0000000701600000, 0x0000000701800000| 0%| F| |TAMS 0x0000000701600000| PB 0x0000000701600000| Untracked | 0 +| 12|0x0000000701800000, 0x0000000701800000, 0x0000000701a00000| 0%| F| |TAMS 0x0000000701800000| PB 0x0000000701800000| Untracked | 0 +| 13|0x0000000701a00000, 0x0000000701a00000, 0x0000000701c00000| 0%| F| |TAMS 0x0000000701a00000| PB 0x0000000701a00000| Untracked | 0 +| 14|0x0000000701c00000, 0x0000000701c00000, 0x0000000701e00000| 0%| F| |TAMS 0x0000000701c00000| PB 0x0000000701c00000| Untracked | 0 +| 15|0x0000000701e00000, 0x0000000701e00000, 0x0000000702000000| 0%| F| |TAMS 0x0000000701e00000| PB 0x0000000701e00000| Untracked | 0 +| 16|0x0000000702000000, 0x0000000702000000, 0x0000000702200000| 0%| F| |TAMS 0x0000000702000000| PB 0x0000000702000000| Untracked | 0 +| 17|0x0000000702200000, 0x0000000702200000, 0x0000000702400000| 0%| F| |TAMS 0x0000000702200000| PB 0x0000000702200000| Untracked | 0 +| 18|0x0000000702400000, 0x0000000702400000, 0x0000000702600000| 0%| F| |TAMS 0x0000000702400000| PB 0x0000000702400000| Untracked | 0 +| 19|0x0000000702600000, 0x0000000702600000, 0x0000000702800000| 0%| F| |TAMS 0x0000000702600000| PB 0x0000000702600000| Untracked | 0 +| 20|0x0000000702800000, 0x0000000702800000, 0x0000000702a00000| 0%| F| |TAMS 0x0000000702800000| PB 0x0000000702800000| Untracked | 0 +| 21|0x0000000702a00000, 0x0000000702a00000, 0x0000000702c00000| 0%| F| |TAMS 0x0000000702a00000| PB 0x0000000702a00000| Untracked | 0 +| 22|0x0000000702c00000, 0x0000000702c00000, 0x0000000702e00000| 0%| F| |TAMS 0x0000000702c00000| PB 0x0000000702c00000| Untracked | 0 +| 23|0x0000000702e00000, 0x0000000702e00000, 0x0000000703000000| 0%| F| |TAMS 0x0000000702e00000| PB 0x0000000702e00000| Untracked | 0 +| 24|0x0000000703000000, 0x0000000703000000, 0x0000000703200000| 0%| F| |TAMS 0x0000000703000000| PB 0x0000000703000000| Untracked | 0 +| 25|0x0000000703200000, 0x0000000703200000, 0x0000000703400000| 0%| F| |TAMS 0x0000000703200000| PB 0x0000000703200000| Untracked | 0 +| 26|0x0000000703400000, 0x0000000703400000, 0x0000000703600000| 0%| F| |TAMS 0x0000000703400000| PB 0x0000000703400000| Untracked | 0 +| 27|0x0000000703600000, 0x0000000703600000, 0x0000000703800000| 0%| F| |TAMS 0x0000000703600000| PB 0x0000000703600000| Untracked | 0 +| 28|0x0000000703800000, 0x0000000703800000, 0x0000000703a00000| 0%| F| |TAMS 0x0000000703800000| PB 0x0000000703800000| Untracked | 0 +| 29|0x0000000703a00000, 0x0000000703a00000, 0x0000000703c00000| 0%| F| |TAMS 0x0000000703a00000| PB 0x0000000703a00000| Untracked | 0 +| 30|0x0000000703c00000, 0x0000000703c00000, 0x0000000703e00000| 0%| F| |TAMS 0x0000000703c00000| PB 0x0000000703c00000| Untracked | 0 +| 31|0x0000000703e00000, 0x0000000703e00000, 0x0000000704000000| 0%| F| |TAMS 0x0000000703e00000| PB 0x0000000703e00000| Untracked | 0 +| 32|0x0000000704000000, 0x0000000704000000, 0x0000000704200000| 0%| F| |TAMS 0x0000000704000000| PB 0x0000000704000000| Untracked | 0 +| 33|0x0000000704200000, 0x0000000704200000, 0x0000000704400000| 0%| F| |TAMS 0x0000000704200000| PB 0x0000000704200000| Untracked | 0 +| 34|0x0000000704400000, 0x0000000704400000, 0x0000000704600000| 0%| F| |TAMS 0x0000000704400000| PB 0x0000000704400000| Untracked | 0 +| 35|0x0000000704600000, 0x0000000704600000, 0x0000000704800000| 0%| F| |TAMS 0x0000000704600000| PB 0x0000000704600000| Untracked | 0 +| 36|0x0000000704800000, 0x0000000704800000, 0x0000000704a00000| 0%| F| |TAMS 0x0000000704800000| PB 0x0000000704800000| Untracked | 0 +| 37|0x0000000704a00000, 0x0000000704a00000, 0x0000000704c00000| 0%| F| |TAMS 0x0000000704a00000| PB 0x0000000704a00000| Untracked | 0 +| 38|0x0000000704c00000, 0x0000000704c00000, 0x0000000704e00000| 0%| F| |TAMS 0x0000000704c00000| PB 0x0000000704c00000| Untracked | 0 +| 39|0x0000000704e00000, 0x0000000704e00000, 0x0000000705000000| 0%| F| |TAMS 0x0000000704e00000| PB 0x0000000704e00000| Untracked | 0 +| 40|0x0000000705000000, 0x0000000705000000, 0x0000000705200000| 0%| F| |TAMS 0x0000000705000000| PB 0x0000000705000000| Untracked | 0 +| 41|0x0000000705200000, 0x0000000705200000, 0x0000000705400000| 0%| F| |TAMS 0x0000000705200000| PB 0x0000000705200000| Untracked | 0 +| 42|0x0000000705400000, 0x0000000705400000, 0x0000000705600000| 0%| F| |TAMS 0x0000000705400000| PB 0x0000000705400000| Untracked | 0 +| 43|0x0000000705600000, 0x0000000705600000, 0x0000000705800000| 0%| F| |TAMS 0x0000000705600000| PB 0x0000000705600000| Untracked | 0 +| 44|0x0000000705800000, 0x0000000705800000, 0x0000000705a00000| 0%| F| |TAMS 0x0000000705800000| PB 0x0000000705800000| Untracked | 0 +| 45|0x0000000705a00000, 0x0000000705a00000, 0x0000000705c00000| 0%| F| |TAMS 0x0000000705a00000| PB 0x0000000705a00000| Untracked | 0 +| 46|0x0000000705c00000, 0x0000000705c00000, 0x0000000705e00000| 0%| F| |TAMS 0x0000000705c00000| PB 0x0000000705c00000| Untracked | 0 +| 47|0x0000000705e00000, 0x0000000705e00000, 0x0000000706000000| 0%| F| |TAMS 0x0000000705e00000| PB 0x0000000705e00000| Untracked | 0 +| 48|0x0000000706000000, 0x0000000706000000, 0x0000000706200000| 0%| F| |TAMS 0x0000000706000000| PB 0x0000000706000000| Untracked | 0 +| 49|0x0000000706200000, 0x0000000706200000, 0x0000000706400000| 0%| F| |TAMS 0x0000000706200000| PB 0x0000000706200000| Untracked | 0 +| 50|0x0000000706400000, 0x0000000706400000, 0x0000000706600000| 0%| F| |TAMS 0x0000000706400000| PB 0x0000000706400000| Untracked | 0 +| 51|0x0000000706600000, 0x0000000706600000, 0x0000000706800000| 0%| F| |TAMS 0x0000000706600000| PB 0x0000000706600000| Untracked | 0 +| 52|0x0000000706800000, 0x0000000706800000, 0x0000000706a00000| 0%| F| |TAMS 0x0000000706800000| PB 0x0000000706800000| Untracked | 0 +| 53|0x0000000706a00000, 0x0000000706a00000, 0x0000000706c00000| 0%| F| |TAMS 0x0000000706a00000| PB 0x0000000706a00000| Untracked | 0 +| 54|0x0000000706c00000, 0x0000000706c00000, 0x0000000706e00000| 0%| F| |TAMS 0x0000000706c00000| PB 0x0000000706c00000| Untracked | 0 +| 55|0x0000000706e00000, 0x0000000706e00000, 0x0000000707000000| 0%| F| |TAMS 0x0000000706e00000| PB 0x0000000706e00000| Untracked | 0 +| 56|0x0000000707000000, 0x0000000707000000, 0x0000000707200000| 0%| F| |TAMS 0x0000000707000000| PB 0x0000000707000000| Untracked | 0 +| 57|0x0000000707200000, 0x0000000707200000, 0x0000000707400000| 0%| F| |TAMS 0x0000000707200000| PB 0x0000000707200000| Untracked | 0 +| 58|0x0000000707400000, 0x0000000707400000, 0x0000000707600000| 0%| F| |TAMS 0x0000000707400000| PB 0x0000000707400000| Untracked | 0 +| 59|0x0000000707600000, 0x0000000707600000, 0x0000000707800000| 0%| F| |TAMS 0x0000000707600000| PB 0x0000000707600000| Untracked | 0 +| 60|0x0000000707800000, 0x0000000707800000, 0x0000000707a00000| 0%| F| |TAMS 0x0000000707800000| PB 0x0000000707800000| Untracked | 0 +| 61|0x0000000707a00000, 0x0000000707a00000, 0x0000000707c00000| 0%| F| |TAMS 0x0000000707a00000| PB 0x0000000707a00000| Untracked | 0 +| 62|0x0000000707c00000, 0x0000000707c00000, 0x0000000707e00000| 0%| F| |TAMS 0x0000000707c00000| PB 0x0000000707c00000| Untracked | 0 +| 63|0x0000000707e00000, 0x0000000707e00000, 0x0000000708000000| 0%| F| |TAMS 0x0000000707e00000| PB 0x0000000707e00000| Untracked | 0 +| 64|0x0000000708000000, 0x0000000708000000, 0x0000000708200000| 0%| F| |TAMS 0x0000000708000000| PB 0x0000000708000000| Untracked | 0 +| 65|0x0000000708200000, 0x0000000708200000, 0x0000000708400000| 0%| F| |TAMS 0x0000000708200000| PB 0x0000000708200000| Untracked | 0 +| 66|0x0000000708400000, 0x0000000708400000, 0x0000000708600000| 0%| F| |TAMS 0x0000000708400000| PB 0x0000000708400000| Untracked | 0 +| 67|0x0000000708600000, 0x0000000708600000, 0x0000000708800000| 0%| F| |TAMS 0x0000000708600000| PB 0x0000000708600000| Untracked | 0 +| 68|0x0000000708800000, 0x0000000708800000, 0x0000000708a00000| 0%| F| |TAMS 0x0000000708800000| PB 0x0000000708800000| Untracked | 0 +| 69|0x0000000708a00000, 0x0000000708a00000, 0x0000000708c00000| 0%| F| |TAMS 0x0000000708a00000| PB 0x0000000708a00000| Untracked | 0 +| 70|0x0000000708c00000, 0x0000000708c00000, 0x0000000708e00000| 0%| F| |TAMS 0x0000000708c00000| PB 0x0000000708c00000| Untracked | 0 +| 71|0x0000000708e00000, 0x0000000708e00000, 0x0000000709000000| 0%| F| |TAMS 0x0000000708e00000| PB 0x0000000708e00000| Untracked | 0 +| 72|0x0000000709000000, 0x0000000709000000, 0x0000000709200000| 0%| F| |TAMS 0x0000000709000000| PB 0x0000000709000000| Untracked | 0 +| 73|0x0000000709200000, 0x0000000709200000, 0x0000000709400000| 0%| F| |TAMS 0x0000000709200000| PB 0x0000000709200000| Untracked | 0 +| 74|0x0000000709400000, 0x0000000709400000, 0x0000000709600000| 0%| F| |TAMS 0x0000000709400000| PB 0x0000000709400000| Untracked | 0 +| 75|0x0000000709600000, 0x0000000709600000, 0x0000000709800000| 0%| F| |TAMS 0x0000000709600000| PB 0x0000000709600000| Untracked | 0 +| 76|0x0000000709800000, 0x0000000709800000, 0x0000000709a00000| 0%| F| |TAMS 0x0000000709800000| PB 0x0000000709800000| Untracked | 0 +| 77|0x0000000709a00000, 0x0000000709a00000, 0x0000000709c00000| 0%| F| |TAMS 0x0000000709a00000| PB 0x0000000709a00000| Untracked | 0 +| 78|0x0000000709c00000, 0x0000000709c00000, 0x0000000709e00000| 0%| F| |TAMS 0x0000000709c00000| PB 0x0000000709c00000| Untracked | 0 +| 79|0x0000000709e00000, 0x0000000709e00000, 0x000000070a000000| 0%| F| |TAMS 0x0000000709e00000| PB 0x0000000709e00000| Untracked | 0 +| 80|0x000000070a000000, 0x000000070a000000, 0x000000070a200000| 0%| F| |TAMS 0x000000070a000000| PB 0x000000070a000000| Untracked | 0 +| 81|0x000000070a200000, 0x000000070a200000, 0x000000070a400000| 0%| F| |TAMS 0x000000070a200000| PB 0x000000070a200000| Untracked | 0 +| 82|0x000000070a400000, 0x000000070a400000, 0x000000070a600000| 0%| F| |TAMS 0x000000070a400000| PB 0x000000070a400000| Untracked | 0 +| 83|0x000000070a600000, 0x000000070a600000, 0x000000070a800000| 0%| F| |TAMS 0x000000070a600000| PB 0x000000070a600000| Untracked | 0 +| 84|0x000000070a800000, 0x000000070a800000, 0x000000070aa00000| 0%| F| |TAMS 0x000000070a800000| PB 0x000000070a800000| Untracked | 0 +| 85|0x000000070aa00000, 0x000000070aa00000, 0x000000070ac00000| 0%| F| |TAMS 0x000000070aa00000| PB 0x000000070aa00000| Untracked | 0 +| 86|0x000000070ac00000, 0x000000070ac00000, 0x000000070ae00000| 0%| F| |TAMS 0x000000070ac00000| PB 0x000000070ac00000| Untracked | 0 +| 87|0x000000070ae00000, 0x000000070ae00000, 0x000000070b000000| 0%| F| |TAMS 0x000000070ae00000| PB 0x000000070ae00000| Untracked | 0 +| 88|0x000000070b000000, 0x000000070b000000, 0x000000070b200000| 0%| F| |TAMS 0x000000070b000000| PB 0x000000070b000000| Untracked | 0 +| 89|0x000000070b200000, 0x000000070b200000, 0x000000070b400000| 0%| F| |TAMS 0x000000070b200000| PB 0x000000070b200000| Untracked | 0 +| 90|0x000000070b400000, 0x000000070b400000, 0x000000070b600000| 0%| F| |TAMS 0x000000070b400000| PB 0x000000070b400000| Untracked | 0 +| 91|0x000000070b600000, 0x000000070b600000, 0x000000070b800000| 0%| F| |TAMS 0x000000070b600000| PB 0x000000070b600000| Untracked | 0 +| 92|0x000000070b800000, 0x000000070b800000, 0x000000070ba00000| 0%| F| |TAMS 0x000000070b800000| PB 0x000000070b800000| Untracked | 0 +| 93|0x000000070ba00000, 0x000000070ba00000, 0x000000070bc00000| 0%| F| |TAMS 0x000000070ba00000| PB 0x000000070ba00000| Untracked | 0 +| 94|0x000000070bc00000, 0x000000070bc00000, 0x000000070be00000| 0%| F| |TAMS 0x000000070bc00000| PB 0x000000070bc00000| Untracked | 0 +| 95|0x000000070be00000, 0x000000070be00000, 0x000000070c000000| 0%| F| |TAMS 0x000000070be00000| PB 0x000000070be00000| Untracked | 0 +| 96|0x000000070c000000, 0x000000070c000000, 0x000000070c200000| 0%| F| |TAMS 0x000000070c000000| PB 0x000000070c000000| Untracked | 0 +| 97|0x000000070c200000, 0x000000070c200000, 0x000000070c400000| 0%| F| |TAMS 0x000000070c200000| PB 0x000000070c200000| Untracked | 0 +| 98|0x000000070c400000, 0x000000070c400000, 0x000000070c600000| 0%| F| |TAMS 0x000000070c400000| PB 0x000000070c400000| Untracked | 0 +| 99|0x000000070c600000, 0x000000070c600000, 0x000000070c800000| 0%| F| |TAMS 0x000000070c600000| PB 0x000000070c600000| Untracked | 0 +| 100|0x000000070c800000, 0x000000070c800000, 0x000000070ca00000| 0%| F| |TAMS 0x000000070c800000| PB 0x000000070c800000| Untracked | 0 +| 101|0x000000070ca00000, 0x000000070ca00000, 0x000000070cc00000| 0%| F| |TAMS 0x000000070ca00000| PB 0x000000070ca00000| Untracked | 0 +| 102|0x000000070cc00000, 0x000000070cc00000, 0x000000070ce00000| 0%| F| |TAMS 0x000000070cc00000| PB 0x000000070cc00000| Untracked | 0 +| 103|0x000000070ce00000, 0x000000070ce00000, 0x000000070d000000| 0%| F| |TAMS 0x000000070ce00000| PB 0x000000070ce00000| Untracked | 0 +| 104|0x000000070d000000, 0x000000070d000000, 0x000000070d200000| 0%| F| |TAMS 0x000000070d000000| PB 0x000000070d000000| Untracked | 0 +| 105|0x000000070d200000, 0x000000070d200000, 0x000000070d400000| 0%| F| |TAMS 0x000000070d200000| PB 0x000000070d200000| Untracked | 0 +| 106|0x000000070d400000, 0x000000070d400000, 0x000000070d600000| 0%| F| |TAMS 0x000000070d400000| PB 0x000000070d400000| Untracked | 0 +| 107|0x000000070d600000, 0x000000070d600000, 0x000000070d800000| 0%| F| |TAMS 0x000000070d600000| PB 0x000000070d600000| Untracked | 0 +| 108|0x000000070d800000, 0x000000070d800000, 0x000000070da00000| 0%| F| |TAMS 0x000000070d800000| PB 0x000000070d800000| Untracked | 0 +| 109|0x000000070da00000, 0x000000070da00000, 0x000000070dc00000| 0%| F| |TAMS 0x000000070da00000| PB 0x000000070da00000| Untracked | 0 +| 110|0x000000070dc00000, 0x000000070dc00000, 0x000000070de00000| 0%| F| |TAMS 0x000000070dc00000| PB 0x000000070dc00000| Untracked | 0 +| 111|0x000000070de00000, 0x000000070de00000, 0x000000070e000000| 0%| F| |TAMS 0x000000070de00000| PB 0x000000070de00000| Untracked | 0 +| 112|0x000000070e000000, 0x000000070e000000, 0x000000070e200000| 0%| F| |TAMS 0x000000070e000000| PB 0x000000070e000000| Untracked | 0 +| 113|0x000000070e200000, 0x000000070e200000, 0x000000070e400000| 0%| F| |TAMS 0x000000070e200000| PB 0x000000070e200000| Untracked | 0 +| 114|0x000000070e400000, 0x000000070e4b5528, 0x000000070e600000| 35%| S|CS|TAMS 0x000000070e400000| PB 0x000000070e400000| Complete | 0 +| 115|0x000000070e600000, 0x000000070e800000, 0x000000070e800000|100%| S|CS|TAMS 0x000000070e600000| PB 0x000000070e600000| Complete | 0 +| 116|0x000000070e800000, 0x000000070e800000, 0x000000070ea00000| 0%| F| |TAMS 0x000000070e800000| PB 0x000000070e800000| Untracked | 0 +| 117|0x000000070ea00000, 0x000000070ea00000, 0x000000070ec00000| 0%| F| |TAMS 0x000000070ea00000| PB 0x000000070ea00000| Untracked | 0 +| 118|0x000000070ec00000, 0x000000070ec00000, 0x000000070ee00000| 0%| F| |TAMS 0x000000070ec00000| PB 0x000000070ec00000| Untracked | 0 +| 119|0x000000070ee00000, 0x000000070ee00000, 0x000000070f000000| 0%| F| |TAMS 0x000000070ee00000| PB 0x000000070ee00000| Untracked | 0 +| 120|0x000000070f000000, 0x000000070f000000, 0x000000070f200000| 0%| F| |TAMS 0x000000070f000000| PB 0x000000070f000000| Untracked | 0 +| 121|0x000000070f200000, 0x000000070f200000, 0x000000070f400000| 0%| F| |TAMS 0x000000070f200000| PB 0x000000070f200000| Untracked | 0 +| 122|0x000000070f400000, 0x000000070f400000, 0x000000070f600000| 0%| F| |TAMS 0x000000070f400000| PB 0x000000070f400000| Untracked | 0 +| 123|0x000000070f600000, 0x000000070f600000, 0x000000070f800000| 0%| F| |TAMS 0x000000070f600000| PB 0x000000070f600000| Untracked | 0 +| 124|0x000000070f800000, 0x000000070f800000, 0x000000070fa00000| 0%| F| |TAMS 0x000000070f800000| PB 0x000000070f800000| Untracked | 0 +| 125|0x000000070fa00000, 0x000000070fa00000, 0x000000070fc00000| 0%| F| |TAMS 0x000000070fa00000| PB 0x000000070fa00000| Untracked | 0 +| 126|0x000000070fc00000, 0x000000070fc00000, 0x000000070fe00000| 0%| F| |TAMS 0x000000070fc00000| PB 0x000000070fc00000| Untracked | 0 +| 127|0x000000070fe00000, 0x000000070ff64b80, 0x0000000710000000| 69%| E| |TAMS 0x000000070fe00000| PB 0x000000070fe00000| Complete | 0 + +Card table byte_map: [0x000000010101c000,0x000000010181c000] _byte_map_base: 0x00000000fd81c000 + +Marking Bits: (CMBitMap*) 0x0000000125808210 + Bits: [0x000000011a020000, 0x000000011e020000) + +Polling page: 0x0000000100308000 + +Metaspace: + +Usage: + Non-class: 13.17 MB used. + Class: 1.64 MB used. + Both: 14.81 MB used. + +Virtual space: + Non-class space: 64.00 MB reserved, 13.38 MB ( 21%) committed, 1 nodes. + Class space: 1.00 GB reserved, 1.81 MB ( <1%) committed, 1 nodes. + Both: 1.06 GB reserved, 15.19 MB ( 1%) committed. + +Chunk freelists: + Non-Class: 2.35 MB + Class: 14.17 MB + Both: 16.52 MB + +MaxMetaspaceSize: unlimited +CompressedClassSpaceSize: 1.00 GB +Initial GC threshold: 21.00 MB +Current GC threshold: 21.00 MB +CDS: off + - commit_granule_bytes: 65536. + - commit_granule_words: 8192. + - virtual_space_node_default_size: 8388608. + - enlarge_chunks_in_place: 1. + - use_allocation_guard: 0. + + +Internal statistics: + +num_allocs_failed_limit: 0. +num_arena_births: 342. +num_arena_deaths: 0. +num_vsnodes_births: 2. +num_vsnodes_deaths: 0. +num_space_committed: 243. +num_space_uncommitted: 0. +num_chunks_returned_to_freelist: 0. +num_chunks_taken_from_freelist: 561. +num_chunk_merges: 0. +num_chunk_splits: 335. +num_chunks_enlarged: 197. +num_inconsistent_stats: 0. + +CodeHeap 'non-profiled nmethods': size=120032Kb used=383Kb max_used=383Kb free=119649Kb + bounds [0x0000000112ae8000, 0x0000000112d58000, 0x000000011a020000] +CodeHeap 'profiled nmethods': size=120016Kb used=2374Kb max_used=2374Kb free=117641Kb + bounds [0x000000010b020000, 0x000000010b290000, 0x0000000112554000] +CodeHeap 'non-nmethods': size=5712Kb used=1356Kb max_used=1371Kb free=4355Kb + bounds [0x0000000112554000, 0x00000001127c4000, 0x0000000112ae8000] + total_blobs=1719 nmethods=1243 adapters=383 + compilation: enabled + stopped_count=0, restarted_count=0 + full_count=0 + +Compilation events (20 events): +Event: 7.925 Thread 0x0000000155814000 nmethod 1224 0x000000010b250d90 code [0x000000010b250f40, 0x000000010b251208] +Event: 7.925 Thread 0x0000000155814000 1217 3 java.lang.invoke.LambdaForm::create (95 bytes) +Event: 7.925 Thread 0x0000000155814000 nmethod 1217 0x000000010b251310 code [0x000000010b251540, 0x000000010b251b58] +Event: 7.925 Thread 0x0000000155814000 1218 3 java.lang.invoke.LambdaForm::fixResult (31 bytes) +Event: 7.925 Thread 0x0000000155814000 nmethod 1218 0x000000010b251e10 code [0x000000010b251fc0, 0x000000010b252188] +Event: 7.926 Thread 0x0000000155814000 1238 3 jdk.internal.classfile.impl.AbstractElement:: (5 bytes) +Event: 7.926 Thread 0x0000000155814000 nmethod 1238 0x000000010b252290 code [0x000000010b252440, 0x000000010b2525b8] +Event: 7.926 Thread 0x0000000155814000 1239 3 java.lang.constant.ConstantUtils::skipOverFieldSignature (296 bytes) +Event: 7.927 Thread 0x0000000155814000 nmethod 1239 0x000000010b252690 code [0x000000010b252b80, 0x000000010b254838] +Event: 7.927 Thread 0x0000000155814000 1242 3 java.util.Arrays::fill (28 bytes) +Event: 7.927 Thread 0x0000000155814000 nmethod 1242 0x000000010b255310 code [0x000000010b2554c0, 0x000000010b255840] +Event: 7.927 Thread 0x0000000155814000 1240 3 jdk.internal.classfile.impl.DirectCodeBuilder::with (9 bytes) +Event: 7.927 Thread 0x0000000155814000 nmethod 1240 0x000000010b255990 code [0x000000010b255bc0, 0x000000010b256490] +Event: 7.927 Thread 0x0000000155814000 1241 3 jdk.internal.classfile.impl.DirectCodeBuilder::with (30 bytes) +Event: 7.927 Thread 0x0000000155814000 nmethod 1241 0x000000010b256710 code [0x000000010b256940, 0x000000010b2570b0] +Event: 7.928 Thread 0x0000000155814000 1244 3 jdk.internal.classfile.impl.SplitConstantPool::map (145 bytes) +Event: 7.928 Thread 0x0000000155814000 nmethod 1244 0x000000010b257310 code [0x000000010b257600, 0x000000010b258390] +Event: 7.929 Thread 0x0000000155814000 1246 3 java.util.ArrayList::isEmpty (13 bytes) +Event: 7.929 Thread 0x0000000155814000 nmethod 1246 0x000000010b258810 code [0x000000010b2589c0, 0x000000010b258b30] +Event: 7.929 Thread 0x0000000155814000 1248 3 jdk.internal.classfile.impl.StackMapGenerator::processBlock (2767 bytes) + +GC Heap History (2 events): +Event: 7.920 GC heap before +{Heap before GC invocations=0 (full 0): + garbage-first heap total reserved 4194304K, committed 262144K, used 22528K [0x0000000700000000, 0x0000000800000000) + region size 2048K, 12 young (24576K), 0 survivors (0K) + Metaspace used 14790K, committed 15168K, reserved 1114112K + class space used 1618K, committed 1792K, reserved 1048576K +} +Event: 7.922 GC heap after +{Heap after GC invocations=1 (full 0): + garbage-first heap total reserved 4194304K, committed 262144K, used 2773K [0x0000000700000000, 0x0000000800000000) + region size 2048K, 2 young (4096K), 2 survivors (4096K) + Metaspace used 14790K, committed 15168K, reserved 1114112K + class space used 1618K, committed 1792K, reserved 1048576K +} + +Dll operation events (8 events): +Event: 0.006 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjava.dylib +Event: 0.006 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libzip.dylib +Event: 0.079 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libinstrument.dylib +Event: 0.092 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libnio.dylib +Event: 0.096 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libzip.dylib +Event: 0.134 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjimage.dylib +Event: 7.870 Loaded shared library libsomelib.dylib +Event: 7.876 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libsyslookup.dylib + +Deoptimization events (20 events): +Event: 0.272 Thread 0x000000015580d200 DEOPT PACKING pc=0x0000000112b05b60 sp=0x000000016fd97350 +Event: 0.272 Thread 0x000000015580d200 DEOPT UNPACKING pc=0x000000011259701c sp=0x000000016fd97310 mode 2 +Event: 7.839 Thread 0x000000015580d200 Uncommon trap: trap_request=0xffffff45 fr.pc=0x0000000112b2f7a0 relative=0x00000000000000e0 +Event: 7.839 Thread 0x000000015580d200 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000112b2f7a0 method=sun.net.www.ParseUtil.firstEncodeIndex(Ljava/lang/String;)I @ 51 c2 +Event: 7.839 Thread 0x000000015580d200 DEOPT PACKING pc=0x0000000112b2f7a0 sp=0x000000016fd96770 +Event: 7.839 Thread 0x000000015580d200 DEOPT UNPACKING pc=0x000000011259701c sp=0x000000016fd966f0 mode 2 +Event: 7.906 Thread 0x000000015580d200 DEOPT PACKING pc=0x000000010b1f8fc8 sp=0x000000016fd96500 +Event: 7.906 Thread 0x000000015580d200 DEOPT UNPACKING pc=0x0000000112596e7c sp=0x000000016fd96300 mode 3 +Event: 7.923 Thread 0x000000015580d200 Uncommon trap: trap_request=0xffffff45 fr.pc=0x0000000112b2679c relative=0x000000000000025c +Event: 7.923 Thread 0x000000015580d200 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000112b2679c method=java.util.concurrent.ConcurrentHashMap.get(Ljava/lang/Object;)Ljava/lang/Object; @ 76 c2 +Event: 7.923 Thread 0x000000015580d200 DEOPT PACKING pc=0x0000000112b2679c sp=0x000000016fd95840 +Event: 7.923 Thread 0x000000015580d200 DEOPT UNPACKING pc=0x000000011259701c sp=0x000000016fd957c0 mode 2 +Event: 7.923 Thread 0x000000015580d200 Uncommon trap: trap_request=0xffffff45 fr.pc=0x0000000112b33a68 relative=0x00000000000000a8 +Event: 7.923 Thread 0x000000015580d200 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000112b33a68 method=java.lang.ref.ReferenceQueue.headIsNull()Z @ 4 c2 +Event: 7.923 Thread 0x000000015580d200 DEOPT PACKING pc=0x0000000112b33a68 sp=0x000000016fd960a0 +Event: 7.923 Thread 0x000000015580d200 DEOPT UNPACKING pc=0x000000011259701c sp=0x000000016fd95f60 mode 2 +Event: 7.923 Thread 0x000000015580d200 Uncommon trap: trap_request=0xffffff45 fr.pc=0x0000000112b274ec relative=0x000000000000006c +Event: 7.923 Thread 0x000000015580d200 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000112b274ec method=java.lang.ref.ReferenceQueue.headIsNull()Z @ 4 c2 +Event: 7.923 Thread 0x000000015580d200 DEOPT PACKING pc=0x0000000112b274ec sp=0x000000016fd96010 +Event: 7.923 Thread 0x000000015580d200 DEOPT UNPACKING pc=0x000000011259701c sp=0x000000016fd95f40 mode 2 + +Classes loaded (20 events): +Event: 7.929 Loading class jdk/internal/classfile/impl/BufferedCodeBuilder +Event: 7.929 Loading class jdk/internal/classfile/impl/BufferedCodeBuilder done +Event: 7.929 Loading class jdk/internal/classfile/impl/TransformingCodeBuilder +Event: 7.929 Loading class jdk/internal/classfile/impl/TransformingCodeBuilder done +Event: 7.930 Loading class java/lang/classfile/instruction/ThrowInstruction +Event: 7.930 Loading class java/lang/classfile/instruction/ThrowInstruction done +Event: 7.930 Loading class jdk/internal/classfile/impl/AbstractInstruction$UnboundThrowInstruction +Event: 7.930 Loading class jdk/internal/classfile/impl/AbstractInstruction$UnboundThrowInstruction done +Event: 7.930 Loading class java/lang/classfile/instruction/ExceptionCatch +Event: 7.930 Loading class java/lang/classfile/instruction/ExceptionCatch done +Event: 7.930 Loading class jdk/internal/classfile/impl/AbstractPseudoInstruction$ExceptionCatchImpl +Event: 7.930 Loading class jdk/internal/classfile/impl/AbstractPseudoInstruction +Event: 7.930 Loading class jdk/internal/classfile/impl/AbstractPseudoInstruction done +Event: 7.930 Loading class jdk/internal/classfile/impl/AbstractPseudoInstruction$ExceptionCatchImpl done +Event: 7.930 Loading class jdk/internal/classfile/impl/StackMapGenerator$RawExceptionCatch +Event: 7.930 Loading class jdk/internal/classfile/impl/StackMapGenerator$RawExceptionCatch done +Event: 7.931 Loading class jdk/internal/classfile/impl/SplitConstantPool$1 +Event: 7.931 Loading class jdk/internal/classfile/impl/SplitConstantPool$1 done +Event: 7.931 Loading class java/lang/invoke/ConstantBootstraps +Event: 7.931 Loading class java/lang/invoke/ConstantBootstraps done + +Classes unloaded (0 events): +No events + +Classes redefined (0 events): +No events + +Internal exceptions (20 events): +Event: 7.906 Thread 0x000000015580d200 Exception (0x000000070e87d458) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 7.908 Thread 0x000000015580d200 Exception (0x000000070e8a0820) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 7.908 Thread 0x000000015580d200 Exception (0x000000070e8a4e70) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 7.908 Thread 0x000000015580d200 Exception (0x000000070e8a8a28) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 7.908 Thread 0x000000015580d200 Exception (0x000000070e8b0578) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 7.908 Thread 0x000000015580d200 Exception (0x000000070e8b7550) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 7.909 Thread 0x000000015580d200 Exception (0x000000070e8be520) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 7.909 Thread 0x000000015580d200 Exception (0x000000070e8c2fd8) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 7.910 Thread 0x000000015580d200 Exception (0x000000070e8e12b0) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 7.913 Thread 0x000000015580d200 Exception (0x000000070e92fd70) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 841] +Event: 7.914 Thread 0x000000015580d200 Exception (0x000000070e9468c8) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 7.918 Thread 0x000000015580d200 Exception (0x000000070e9b1470) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 7.918 Thread 0x000000015580d200 Exception (0x000000070e9bc208) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 7.918 Thread 0x000000015580d200 Exception (0x000000070e9cdb48) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 7.919 Thread 0x000000015580d200 Exception (0x000000070e9ea1b8) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 7.919 Thread 0x000000015580d200 Exception (0x000000070e9ef688) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 7.923 Thread 0x000000015580d200 Exception (0x000000070fe72398) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 7.928 Thread 0x000000015580d200 Exception (0x000000070feb20c0) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 7.931 Thread 0x000000015580d200 Exception (0x000000070ff0dfe8) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 7.931 Thread 0x000000015580d200 Exception (0x000000070ff22048) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] + +ZGC Phase Switch (0 events): +No events + +VM Operations (20 events): +Event: 0.287 Executing VM operation: get/set locals +Event: 0.287 Executing VM operation: get/set locals done +Event: 0.288 Executing VM operation: get/set locals +Event: 0.288 Executing VM operation: get/set locals done +Event: 5.227 Executing VM operation: get/set locals +Event: 5.227 Executing VM operation: get/set locals done +Event: 5.227 Executing VM operation: get/set locals +Event: 5.227 Executing VM operation: get/set locals done +Event: 5.229 Executing VM operation: get/set locals +Event: 5.229 Executing VM operation: get/set locals done +Event: 7.826 Executing VM operation: ChangeBreakpoints +Event: 7.827 Executing VM operation: ChangeBreakpoints done +Event: 7.827 Executing VM operation: ChangeBreakpoints +Event: 7.827 Executing VM operation: ChangeBreakpoints done +Event: 7.828 Executing VM operation: ChangeBreakpoints +Event: 7.828 Executing VM operation: ChangeBreakpoints done +Event: 7.867 Executing VM operation: ChangeBreakpoints +Event: 7.867 Executing VM operation: ChangeBreakpoints done +Event: 7.920 Executing VM operation: G1CollectForAllocation (G1 Evacuation Pause) +Event: 7.922 Executing VM operation: G1CollectForAllocation (G1 Evacuation Pause) done + +Events (20 events): +Event: 0.027 Thread 0x000000015580ea00 Thread added: 0x000000015580ea00 +Event: 0.027 Protecting memory [0x0000000171128000,0x0000000171134000] with protection modes 0 +Event: 0.027 Thread 0x000000015580f200 Thread added: 0x000000015580f200 +Event: 0.027 Protecting memory [0x0000000171334000,0x0000000171340000] with protection modes 0 +Event: 0.027 Thread 0x000000015580da00 Thread added: 0x000000015580da00 +Event: 0.027 Protecting memory [0x0000000171540000,0x000000017154c000] with protection modes 0 +Event: 0.027 Thread 0x000000015580e200 Thread added: 0x000000015580e200 +Event: 0.027 Protecting memory [0x000000017174c000,0x0000000171758000] with protection modes 0 +Event: 0.027 Thread 0x0000000155814000 Thread added: 0x0000000155814000 +Event: 0.027 Protecting memory [0x0000000171958000,0x0000000171964000] with protection modes 0 +Event: 0.049 Thread 0x00000001570ef800 Thread added: 0x00000001570ef800 +Event: 0.050 Protecting memory [0x0000000171b64000,0x0000000171b70000] with protection modes 0 +Event: 0.065 Thread 0x0000000126808200 Thread added: 0x0000000126808200 +Event: 0.065 Protecting memory [0x0000000171d70000,0x0000000171d7c000] with protection modes 0 +Event: 0.066 Thread 0x0000000120819e00 Thread added: 0x0000000120819e00 +Event: 0.066 Protecting memory [0x0000000171f7c000,0x0000000171f88000] with protection modes 0 +Event: 0.066 Thread 0x0000000155814800 Thread added: 0x0000000155814800 +Event: 0.066 Protecting memory [0x0000000172188000,0x0000000172194000] with protection modes 0 +Event: 0.087 Thread 0x000000015690ca00 Thread added: 0x000000015690ca00 +Event: 0.088 Protecting memory [0x0000000172394000,0x00000001723a0000] with protection modes 0 + + +Dynamic libraries: +0x000000010077c000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjli.dylib +0x00000001a96bb000 /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa +0x0000000192c62000 /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit +0x0000000195cce000 /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData +0x0000000190515000 /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation +0x000000019bfdc000 /usr/lib/libSystem.B.dylib +0x0000000193f9f000 /System/Library/PrivateFrameworks/UIFoundation.framework/Versions/A/UIFoundation +0x000000022ab7f000 /System/Library/PrivateFrameworks/CollectionViewCore.framework/Versions/A/CollectionViewCore +0x00000001a3255000 /System/Library/PrivateFrameworks/RemoteViewServices.framework/Versions/A/RemoteViewServices +0x0000000199e89000 /System/Library/PrivateFrameworks/XCTTargetBootstrap.framework/Versions/A/XCTTargetBootstrap +0x000000019e618000 /System/Library/PrivateFrameworks/InternationalSupport.framework/Versions/A/InternationalSupport +0x000000019e66c000 /System/Library/PrivateFrameworks/UserActivity.framework/Versions/A/UserActivity +0x000000024efd6000 /System/Library/PrivateFrameworks/WindowManagement.framework/Versions/A/WindowManagement +0x0000000190195000 /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration +0x000000019da86000 /usr/lib/libspindump.dylib +0x0000000194154000 /System/Library/Frameworks/UniformTypeIdentifiers.framework/Versions/A/UniformTypeIdentifiers +0x0000000197d00000 /usr/lib/libapp_launch_measurement.dylib +0x0000000197126000 /System/Library/PrivateFrameworks/CoreAnalytics.framework/Versions/A/CoreAnalytics +0x0000000197d07000 /System/Library/PrivateFrameworks/CoreAutoLayout.framework/Versions/A/CoreAutoLayout +0x00000001996a9000 /System/Library/Frameworks/Metal.framework/Versions/A/Metal +0x000000019a631000 /usr/lib/liblangid.dylib +0x0000000199e8f000 /System/Library/PrivateFrameworks/CoreSVG.framework/Versions/A/CoreSVG +0x0000000194b19000 /System/Library/PrivateFrameworks/SkyLight.framework/Versions/A/SkyLight +0x0000000194fba000 /System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics +0x00000001a392f000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate +0x000000019d8e0000 /System/Library/PrivateFrameworks/IconServices.framework/Versions/A/IconServices +0x0000000199687000 /System/Library/Frameworks/IOSurface.framework/Versions/A/IOSurface +0x0000000197155000 /usr/lib/libDiagnosticMessagesClient.dylib +0x000000019bf1e000 /usr/lib/libz.1.dylib +0x00000001a70d4000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices +0x0000000199e71000 /System/Library/PrivateFrameworks/DFRFoundation.framework/Versions/A/DFRFoundation +0x00000001924bc000 /usr/lib/libicucore.A.dylib +0x000000019f676000 /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox +0x000000019e627000 /System/Library/PrivateFrameworks/DataDetectorsCore.framework/Versions/A/DataDetectorsCore +0x00000001b809a000 /System/Library/PrivateFrameworks/TextInput.framework/Versions/A/TextInput +0x0000000194a6a000 /usr/lib/libMobileGestalt.dylib +0x0000000199bad000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox +0x000000019762c000 /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore +0x00000001920e9000 /System/Library/Frameworks/Security.framework/Versions/A/Security +0x00000001a3295000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SpeechRecognition.framework/Versions/A/SpeechRecognition +0x0000000197a2e000 /System/Library/PrivateFrameworks/CoreUI.framework/Versions/A/CoreUI +0x00000001919e2000 /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio +0x0000000197239000 /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration +0x000000019dee2000 /System/Library/PrivateFrameworks/MultitouchSupport.framework/Versions/A/MultitouchSupport +0x0000000194a68000 /usr/lib/libenergytrace.dylib +0x00000001ad793000 /System/Library/PrivateFrameworks/RenderBox.framework/Versions/A/RenderBox +0x0000000192b16000 /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit +0x00000001a366a000 /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices +0x0000000197c8c000 /System/Library/PrivateFrameworks/PerformanceAnalysis.framework/Versions/A/PerformanceAnalysis +0x00000001e603f000 /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL +0x0000000197d51000 /usr/lib/libxml2.2.dylib +0x000000019b360000 /System/Library/PrivateFrameworks/MobileKeyBag.framework/Versions/A/MobileKeyBag +0x000000018ef80000 /usr/lib/libobjc.A.dylib +0x000000018f274000 /usr/lib/libc++.1.dylib +0x00000001a35e7000 /System/Library/Frameworks/Accessibility.framework/Versions/A/Accessibility +0x000000019569a000 /System/Library/Frameworks/ColorSync.framework/Versions/A/ColorSync +0x000000018f3c0000 /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation +0x000000019a1ec000 /System/Library/Frameworks/CoreImage.framework/Versions/A/CoreImage +0x00000001917ed000 /System/Library/Frameworks/CoreText.framework/Versions/A/CoreText +0x00000001ea89e000 /System/Library/Frameworks/CoreTransferable.framework/Versions/A/CoreTransferable +0x00000001ead63000 /System/Library/Frameworks/DeveloperToolsSupport.framework/Versions/A/DeveloperToolsSupport +0x0000000199eca000 /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO +0x0000000224d1f000 /System/Library/Frameworks/Symbols.framework/Versions/A/Symbols +0x000000019bfe2000 /System/Library/PrivateFrameworks/SoftLinking.framework/Versions/A/SoftLinking +0x000000019f028000 /usr/lib/swift/libswiftCore.dylib +0x00000001b4d27000 /usr/lib/swift/libswiftCoreFoundation.dylib +0x00000001b2790000 /usr/lib/swift/libswiftCoreGraphics.dylib +0x00000001b4d71000 /usr/lib/swift/libswiftCoreImage.dylib +0x00000001b2797000 /usr/lib/swift/libswiftDarwin.dylib +0x00000001a4cda000 /usr/lib/swift/libswiftDispatch.dylib +0x00000001b4d72000 /usr/lib/swift/libswiftIOKit.dylib +0x00000001c07cc000 /usr/lib/swift/libswiftMetal.dylib +0x00000001cde91000 /usr/lib/swift/libswiftOSLog.dylib +0x00000001a754f000 /usr/lib/swift/libswiftObjectiveC.dylib +0x00000001c4f00000 /usr/lib/swift/libswiftQuartzCore.dylib +0x00000001c9005000 /usr/lib/swift/libswiftUniformTypeIdentifiers.dylib +0x00000001b4d39000 /usr/lib/swift/libswiftXPC.dylib +0x000000025747d000 /usr/lib/swift/libswift_Concurrency.dylib +0x00000001a7553000 /usr/lib/swift/libswiftos.dylib +0x00000001b7ffe000 /usr/lib/swift/libswiftsimd.dylib +0x000000019c191000 /usr/lib/libcompression.dylib +0x000000019e572000 /System/Library/PrivateFrameworks/TextureIO.framework/Versions/A/TextureIO +0x000000019d58c000 /usr/lib/libate.dylib +0x000000019bfd6000 /usr/lib/system/libcache.dylib +0x000000019bf90000 /usr/lib/system/libcommonCrypto.dylib +0x000000019bfbc000 /usr/lib/system/libcompiler_rt.dylib +0x000000019bfb2000 /usr/lib/system/libcopyfile.dylib +0x000000018f0c4000 /usr/lib/system/libcorecrypto.dylib +0x000000018f1aa000 /usr/lib/system/libdispatch.dylib +0x000000018f365000 /usr/lib/system/libdyld.dylib +0x000000019bfcc000 /usr/lib/system/libkeymgr.dylib +0x000000019bf68000 /usr/lib/system/libmacho.dylib +0x000000019b448000 /usr/lib/system/libquarantine.dylib +0x000000019bfc9000 /usr/lib/system/libremovefile.dylib +0x0000000194ae0000 /usr/lib/system/libsystem_asl.dylib +0x000000018f059000 /usr/lib/system/libsystem_blocks.dylib +0x000000018f1f5000 /usr/lib/system/libsystem_c.dylib +0x000000019bfc0000 /usr/lib/system/libsystem_collections.dylib +0x000000019a620000 /usr/lib/system/libsystem_configuration.dylib +0x000000019965c000 /usr/lib/system/libsystem_containermanager.dylib +0x000000019bbff000 /usr/lib/system/libsystem_coreservices.dylib +0x0000000192783000 /usr/lib/system/libsystem_darwin.dylib +0x00000002577ca000 /usr/lib/system/libsystem_darwindirectory.dylib +0x000000019bfcd000 /usr/lib/system/libsystem_dnssd.dylib +0x00000002577ce000 /usr/lib/system/libsystem_eligibility.dylib +0x000000018f1f2000 /usr/lib/system/libsystem_featureflags.dylib +0x000000018f393000 /usr/lib/system/libsystem_info.dylib +0x000000019bf2d000 /usr/lib/system/libsystem_m.dylib +0x000000018f16d000 /usr/lib/system/libsystem_malloc.dylib +0x0000000194a4d000 /usr/lib/system/libsystem_networkextension.dylib +0x0000000192bf9000 /usr/lib/system/libsystem_notify.dylib +0x000000019a625000 /usr/lib/system/libsystem_sandbox.dylib +0x00000002577d2000 /usr/lib/system/libsystem_sanitizers.dylib +0x000000019bfc5000 /usr/lib/system/libsystem_secinit.dylib +0x000000018f31d000 /usr/lib/system/libsystem_kernel.dylib +0x000000018f38b000 /usr/lib/system/libsystem_platform.dylib +0x000000018f358000 /usr/lib/system/libsystem_pthread.dylib +0x00000001964d0000 /usr/lib/system/libsystem_symptoms.dylib +0x000000018f0a9000 /usr/lib/system/libsystem_trace.dylib +0x000000019bf9e000 /usr/lib/system/libunwind.dylib +0x000000018f05e000 /usr/lib/system/libxpc.dylib +0x000000018f301000 /usr/lib/libc++abi.dylib +0x000000019bfaa000 /usr/lib/liboah.dylib +0x000000019d438000 /usr/lib/liblzma.5.dylib +0x000000019bfde000 /usr/lib/libfakelink.dylib +0x0000000194679000 /System/Library/Frameworks/CFNetwork.framework/Versions/A/CFNetwork +0x000000019c032000 /usr/lib/libarchive.2.dylib +0x00000001a1568000 /System/Library/Frameworks/Combine.framework/Versions/A/Combine +0x000000022ab93000 /System/Library/PrivateFrameworks/CollectionsInternal.framework/Versions/A/CollectionsInternal +0x0000000241543000 /System/Library/PrivateFrameworks/ReflectionInternal.framework/Versions/A/ReflectionInternal +0x0000000241ad5000 /System/Library/PrivateFrameworks/RuntimeInternal.framework/Versions/A/RuntimeInternal +0x00000002575d1000 /usr/lib/swift/libswift_StringProcessing.dylib +0x0000000192a94000 /System/Library/PrivateFrameworks/CoreServicesInternal.framework/Versions/A/CoreServicesInternal +0x000000019b46f000 /usr/lib/libbsm.0.dylib +0x000000019bf70000 /usr/lib/system/libkxld.dylib +0x0000000197cc8000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/FSEvents.framework/Versions/A/FSEvents +0x000000019278e000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore +0x000000019719e000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata +0x000000019bc05000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices +0x000000019c0bb000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit +0x0000000196451000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE +0x000000018f899000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices +0x000000019d3e1000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/DictionaryServices.framework/Versions/A/DictionaryServices +0x0000000197cd5000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SharedFileList.framework/Versions/A/SharedFileList +0x000000019c15b000 /usr/lib/libapple_nghttp2.dylib +0x00000001960c5000 /usr/lib/libsqlite3.dylib +0x00000001964d9000 /System/Library/Frameworks/Network.framework/Versions/A/Network +0x0000000255e8e000 /usr/lib/libCoreEntitlements.dylib +0x000000023c44d000 /System/Library/PrivateFrameworks/MessageSecurity.framework/Versions/A/MessageSecurity +0x00000001960ab000 /System/Library/PrivateFrameworks/ProtocolBuffer.framework/Versions/A/ProtocolBuffer +0x000000019bb2e000 /System/Library/PrivateFrameworks/AppleFSCompression.framework/Versions/A/AppleFSCompression +0x000000019b457000 /usr/lib/libcoretls.dylib +0x000000019d457000 /usr/lib/libcoretls_cfhelpers.dylib +0x000000019c18b000 /usr/lib/libpam.2.dylib +0x000000019d4c9000 /usr/lib/libxar.1.dylib +0x000000019d8b7000 /usr/lib/libheimdal-asn1.dylib +0x0000000194678000 /usr/lib/libnetwork.dylib +0x000000019bfe3000 /usr/lib/libpcap.A.dylib +0x00000001964c5000 /usr/lib/libdns_services.dylib +0x000000019a62d000 /System/Library/PrivateFrameworks/AppleSystemInfo.framework/Versions/A/AppleSystemInfo +0x000000019b155000 /System/Library/PrivateFrameworks/IOMobileFramebuffer.framework/Versions/A/IOMobileFramebuffer +0x0000000257528000 /usr/lib/swift/libswift_RegexParser.dylib +0x000000019bbf2000 /usr/lib/libbz2.1.0.dylib +0x000000019b44b000 /usr/lib/libCheckFix.dylib +0x0000000194af8000 /System/Library/PrivateFrameworks/TCC.framework/Versions/A/TCC +0x000000019a633000 /System/Library/PrivateFrameworks/CoreNLP.framework/Versions/A/CoreNLP +0x0000000197157000 /System/Library/PrivateFrameworks/MetadataUtilities.framework/Versions/A/MetadataUtilities +0x000000019b481000 /usr/lib/libmecab.dylib +0x0000000190229000 /usr/lib/libCRFSuite.dylib +0x000000019b4dd000 /usr/lib/libgermantok.dylib +0x000000019c132000 /usr/lib/libThaiTokenizer.dylib +0x0000000197242000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.framework/Versions/A/vImage +0x00000001a3641000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/vecLib +0x000000019d510000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvMisc.dylib +0x000000019b030000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvDSP.dylib +0x000000018fca0000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib +0x000000019c266000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib +0x000000019b4e0000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLinearAlgebra.dylib +0x000000019c176000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparseBLAS.dylib +0x000000019c261000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libQuadrature.dylib +0x000000019a75c000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBNNS.dylib +0x000000019012e000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparse.dylib +0x000000023ab9c000 /System/Library/PrivateFrameworks/MIL.framework/Versions/A/MIL +0x000000019c019000 /usr/lib/libiconv.2.dylib +0x000000019bf64000 /usr/lib/libcharset.1.dylib +0x0000000197ca8000 /System/Library/Frameworks/OpenDirectory.framework/Versions/A/Frameworks/CFOpenDirectory.framework/Versions/A/CFOpenDirectory +0x0000000197c98000 /System/Library/Frameworks/OpenDirectory.framework/Versions/A/OpenDirectory +0x000000019d459000 /System/Library/PrivateFrameworks/APFS.framework/Versions/A/APFS +0x000000019b387000 /System/Library/Frameworks/SecurityFoundation.framework/Versions/A/SecurityFoundation +0x000000019d4d8000 /usr/lib/libutil.dylib +0x0000000238cfd000 /System/Library/PrivateFrameworks/InstalledContentLibrary.framework/Versions/A/InstalledContentLibrary +0x0000000192ad5000 /System/Library/PrivateFrameworks/CoreServicesStore.framework/Versions/A/CoreServicesStore +0x0000000228340000 /System/Library/PrivateFrameworks/AppleMobileFileIntegrity.framework/Versions/A/AppleMobileFileIntegrity +0x00000001b4cf5000 /usr/lib/libmis.dylib +0x00000001c53e7000 /System/Library/PrivateFrameworks/MobileSystemServices.framework/Versions/A/MobileSystemServices +0x00000001e3449000 /System/Library/PrivateFrameworks/ConfigProfileHelper.framework/Versions/A/ConfigProfileHelper +0x000000019c134000 /System/Library/PrivateFrameworks/AppleSauce.framework/Versions/A/AppleSauce +0x0000000191173000 /System/Library/PrivateFrameworks/LanguageModeling.framework/Versions/A/LanguageModeling +0x000000019d4dc000 /usr/lib/libxslt.1.dylib +0x000000019c020000 /usr/lib/libcmph.dylib +0x000000019b121000 /System/Library/PrivateFrameworks/CoreEmoji.framework/Versions/A/CoreEmoji +0x000000019a756000 /System/Library/PrivateFrameworks/LinguisticData.framework/Versions/A/LinguisticData +0x000000019003c000 /System/Library/PrivateFrameworks/Lexicon.framework/Versions/A/Lexicon +0x000000019b415000 /System/Library/PrivateFrameworks/BackgroundTaskManagement.framework/Versions/A/BackgroundTaskManagement +0x0000000256078000 /usr/lib/libTLE.dylib +0x000000019dda8000 /System/Library/PrivateFrameworks/AppleJPEG.framework/Versions/A/AppleJPEG +0x000000019d89c000 /usr/lib/libexpat.1.dylib +0x000000019e3d0000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libPng.dylib +0x000000019e3fb000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib +0x000000019e4e6000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libGIF.dylib +0x000000019ddee000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJP2.dylib +0x000000019e48b000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib +0x000000019e482000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libRadiance.dylib +0x0000000199a48000 /System/Library/PrivateFrameworks/FontServices.framework/libFontParser.dylib +0x00000001963ea000 /System/Library/PrivateFrameworks/RunningBoardServices.framework/Versions/A/RunningBoardServices +0x00000001a9f95000 /System/Library/PrivateFrameworks/IOSurfaceAccelerator.framework/Versions/A/IOSurfaceAccelerator +0x000000019dede000 /System/Library/PrivateFrameworks/WatchdogClient.framework/Versions/A/WatchdogClient +0x0000000191359000 /System/Library/Frameworks/CoreDisplay.framework/Versions/A/CoreDisplay +0x00000001998ff000 /System/Library/Frameworks/CoreMedia.framework/Versions/A/CoreMedia +0x000000019969f000 /System/Library/PrivateFrameworks/IOAccelerator.framework/Versions/A/IOAccelerator +0x0000000197e3b000 /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo +0x000000019c189000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/MetalPerformanceShaders +0x000000019df21000 /System/Library/Frameworks/VideoToolbox.framework/Versions/A/VideoToolbox +0x0000000197ed7000 /System/Library/PrivateFrameworks/UserManagement.framework/Versions/A/UserManagement +0x0000000196311000 /System/Library/PrivateFrameworks/BaseBoard.framework/Versions/A/BaseBoard +0x000000019a62b000 /System/Library/PrivateFrameworks/AggregateDictionary.framework/Versions/A/AggregateDictionary +0x000000022817a000 /System/Library/PrivateFrameworks/AppleKeyStore.framework/Versions/A/AppleKeyStore +0x000000019e47d000 /System/Library/PrivateFrameworks/GPUWrangler.framework/Versions/A/GPUWrangler +0x000000019e45d000 /System/Library/PrivateFrameworks/IOPresentment.framework/Versions/A/IOPresentment +0x000000019e485000 /System/Library/PrivateFrameworks/DSExternalDisplay.framework/Versions/A/DSExternalDisplay +0x0000000234d8a000 /System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/32023/Libraries/libllvm-flatbuffers.dylib +0x00000001e6032000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCoreFSCache.dylib +0x00000002319ee000 /System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/32023/Libraries/libGPUCompilerUtils.dylib +0x000000019e4ec000 /System/Library/PrivateFrameworks/CMCaptureCore.framework/Versions/A/CMCaptureCore +0x00000001eae86000 /System/Library/Frameworks/ExtensionFoundation.framework/Versions/A/ExtensionFoundation +0x00000001a5543000 /System/Library/PrivateFrameworks/CoreTime.framework/Versions/A/CoreTime +0x000000019da70000 /System/Library/PrivateFrameworks/AppServerSupport.framework/Versions/A/AppServerSupport +0x00000001a0004000 /System/Library/PrivateFrameworks/perfdata.framework/Versions/A/perfdata +0x000000019147d000 /System/Library/PrivateFrameworks/AudioToolboxCore.framework/Versions/A/AudioToolboxCore +0x00000001998d5000 /System/Library/PrivateFrameworks/caulk.framework/Versions/A/caulk +0x000000019f872000 /usr/lib/libAudioStatistics.dylib +0x00000001b402e000 /System/Library/PrivateFrameworks/SystemPolicy.framework/Versions/A/SystemPolicy +0x000000019fb4b000 /usr/lib/libSMC.dylib +0x00000001a953d000 /System/Library/Frameworks/CoreMIDI.framework/Versions/A/CoreMIDI +0x000000019e397000 /usr/lib/libAudioToolboxUtility.dylib +0x00000001af42f000 /System/Library/PrivateFrameworks/OSAServicesClient.framework/Versions/A/OSAServicesClient +0x00000001a0012000 /usr/lib/libperfcheck.dylib +0x00000001a4ffa000 /System/Library/PrivateFrameworks/BoardServices.framework/Versions/A/BoardServices +0x000000019d784000 /System/Library/PrivateFrameworks/PlugInKit.framework/Versions/A/PlugInKit +0x000000019b379000 /System/Library/PrivateFrameworks/AssertionServices.framework/Versions/A/AssertionServices +0x00000001a864e000 /System/Library/PrivateFrameworks/ASEProcessing.framework/Versions/A/ASEProcessing +0x00000001d1318000 /System/Library/PrivateFrameworks/Symbolication.framework/Versions/A/Symbolication +0x0000000240330000 /System/Library/PrivateFrameworks/PhotosensitivityProcessing.framework/Versions/A/PhotosensitivityProcessing +0x000000019da21000 /System/Library/PrivateFrameworks/GraphVisualizer.framework/Versions/A/GraphVisualizer +0x00000001e6094000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib +0x00000001e6053000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGFXShared.dylib +0x00000001e622c000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib +0x00000001e605c000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLImage.dylib +0x00000001e6050000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCVMSPluginSupport.dylib +0x0000000256030000 /usr/lib/libRosetta.dylib +0x00000001e6039000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCoreVMClient.dylib +0x000000022fbf4000 /System/Library/PrivateFrameworks/FontServices.framework/Versions/A/FontServices +0x000000019da2d000 /System/Library/PrivateFrameworks/OTSVG.framework/Versions/A/OTSVG +0x00000001979dc000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/Resources/libFontRegistry.dylib +0x000000019da7b000 /System/Library/PrivateFrameworks/FontServices.framework/libhvf.dylib +0x000000022fbf5000 /System/Library/PrivateFrameworks/FontServices.framework/libXTFontStaticRegistryData.dylib +0x000000019a572000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSCore.framework/Versions/A/MPSCore +0x000000019ba9c000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSImage.framework/Versions/A/MPSImage +0x000000019b4f5000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSNeuralNetwork.framework/Versions/A/MPSNeuralNetwork +0x000000019b940000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSMatrix.framework/Versions/A/MPSMatrix +0x000000019b74b000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSRayIntersector.framework/Versions/A/MPSRayIntersector +0x000000019b972000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSNDArray.framework/Versions/A/MPSNDArray +0x00000001ec760000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSFunctions.framework/Versions/A/MPSFunctions +0x00000001ec745000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSBenchmarkLoop.framework/Versions/A/MPSBenchmarkLoop +0x000000018fb54000 /System/Library/PrivateFrameworks/MetalTools.framework/Versions/A/MetalTools +0x00000001b91d7000 /System/Library/PrivateFrameworks/IOAccelMemoryInfo.framework/Versions/A/IOAccelMemoryInfo +0x00000001c52e0000 /System/Library/PrivateFrameworks/kperf.framework/Versions/A/kperf +0x00000001b4d1a000 /System/Library/PrivateFrameworks/GPURawCounter.framework/Versions/A/GPURawCounter +0x00000001a5415000 /System/Library/PrivateFrameworks/CoreSymbolication.framework/Versions/A/CoreSymbolication +0x00000001b4cc6000 /System/Library/PrivateFrameworks/MallocStackLogging.framework/Versions/A/MallocStackLogging +0x000000019d626000 /System/Library/PrivateFrameworks/CrashReporterSupport.framework/Versions/A/CrashReporterSupport +0x00000001a53d0000 /System/Library/PrivateFrameworks/DebugSymbols.framework/Versions/A/DebugSymbols +0x00000001c3c47000 /System/Library/PrivateFrameworks/OSAnalytics.framework/Versions/A/OSAnalytics +0x000000024d229000 /System/Library/PrivateFrameworks/VideoToolboxParavirtualizationSupport.framework/Versions/A/VideoToolboxParavirtualizationSupport +0x000000019d850000 /System/Library/PrivateFrameworks/AppleVA.framework/Versions/A/AppleVA +0x000000019f8ba000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS +0x0000000195849000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices +0x000000019e4fa000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/PrintCore +0x000000019fca4000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/QD.framework/Versions/A/QD +0x000000019fc98000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSyncLegacy.framework/Versions/A/ColorSyncLegacy +0x000000019f88a000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis +0x000000019e4b6000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATSUI.framework/Versions/A/ATSUI +0x000000019fc2b000 /usr/lib/libcups.2.dylib +0x00000001a0020000 /System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos +0x00000001a0031000 /System/Library/Frameworks/GSS.framework/Versions/A/GSS +0x000000019f939000 /usr/lib/libresolv.9.dylib +0x000000019da8c000 /System/Library/PrivateFrameworks/Heimdal.framework/Versions/A/Heimdal +0x00000001a74bc000 /System/Library/Frameworks/Kerberos.framework/Versions/A/Libraries/libHeimdalProxy.dylib +0x00000001a008b000 /System/Library/PrivateFrameworks/CommonAuth.framework/Versions/A/CommonAuth +0x00000001e9c6c000 /System/Library/Frameworks/AVFAudio.framework/Versions/A/AVFAudio +0x00000001af47e000 /System/Library/PrivateFrameworks/AXCoreUtilities.framework/Versions/A/AXCoreUtilities +0x000000023a274000 /System/Library/PrivateFrameworks/IsolatedCoreAudioClient.framework/Versions/A/IsolatedCoreAudioClient +0x000000019f7f6000 /System/Library/PrivateFrameworks/AudioSession.framework/Versions/A/AudioSession +0x00000001a1307000 /System/Library/Frameworks/IOBluetooth.framework/Versions/A/IOBluetooth +0x000000019d95b000 /System/Library/PrivateFrameworks/MediaExperience.framework/Versions/A/MediaExperience +0x000000019f635000 /System/Library/PrivateFrameworks/AudioSession.framework/libSessionUtility.dylib +0x000000019fcb0000 /System/Library/PrivateFrameworks/AudioResourceArbitration.framework/Versions/A/AudioResourceArbitration +0x00000001a4388000 /System/Library/PrivateFrameworks/PowerLog.framework/Versions/A/PowerLog +0x00000001a42a6000 /System/Library/Frameworks/CoreBluetooth.framework/Versions/A/CoreBluetooth +0x00000001a74bd000 /System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit +0x000000019b1e2000 /System/Library/PrivateFrameworks/CoreUtils.framework/Versions/A/CoreUtils +0x000000022de3f000 /System/Library/PrivateFrameworks/CoreUtilsExtras.framework/Versions/A/CoreUtilsExtras +0x0000000238b8a000 /System/Library/PrivateFrameworks/IO80211.framework/Versions/A/IO80211 +0x00000001a4f3e000 /System/Library/PrivateFrameworks/FrontBoardServices.framework/Versions/A/FrontBoardServices +0x00000001a6a85000 /System/Library/PrivateFrameworks/BackBoardServices.framework/Versions/A/BackBoardServices +0x000000019d8c2000 /System/Library/PrivateFrameworks/IconFoundation.framework/Versions/A/IconFoundation +0x00000001a3281000 /System/Library/PrivateFrameworks/SpeechRecognitionCore.framework/Versions/A/SpeechRecognitionCore +0x00000001af49d000 /usr/lib/libAccessibility.dylib +0x00000001a397b000 /System/Library/Frameworks/MediaAccessibility.framework/Versions/A/MediaAccessibility +0x00000001d49cc000 /System/Library/Frameworks/OSLog.framework/Versions/A/OSLog +0x00000001b4c54000 /System/Library/PrivateFrameworks/LoggingSupport.framework/Versions/A/LoggingSupport +0x0000000101988000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/server/libjvm.dylib +0x000000010031c000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjimage.dylib +0x000000010037c000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjdwp.dylib +0x00000001003c8000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjava.dylib +0x0000000100348000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libinstrument.dylib +0x0000000100420000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libzip.dylib +0x0000000255d1b000 /usr/lib/i18n/libiconv_std.dylib +0x0000000255d03000 /usr/lib/i18n/libUTF8.dylib +0x0000000255d23000 /usr/lib/i18n/libmapper_none.dylib +0x00000001003f8000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libdt_socket.dylib +0x00000001006a8000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libnio.dylib +0x0000000100688000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libnet.dylib +0x0000000101888000 /Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/libsomelib.dylib +0x0000000100370000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libsyslookup.dylib + + +VM Arguments: +jvm_args: -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:60588,suspend=y,server=n -ea -Didea.test.cyclic.buffer.size=1048576 -javaagent:/Users/cristina/Library/Caches/JetBrains/IdeaIC2024.1/captureAgent/debugger-agent.jar -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 +java_command: com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit5 dev.diplomattest.somelib.Float64VecTest,testFloat64Vec +java_class_path (initial): /Users/cristina/.m2/repository/org/junit/platform/junit-platform-launcher/1.10.3/junit-platform-launcher-1.10.3.jar:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/lib/idea_rt.jar:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/plugins/junit/lib/junit5-rt.jar:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/plugins/junit/lib/junit-rt.jar:/Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/target/test-classes:/Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/target/classes:/Users/cristina/.m2/repository/net/java/dev/jna/jna/5.14.0/jna-5.14.0.jar:/Users/cristina/.m2/repository/org/junit/jupiter/junit-jupiter/5.10.3/junit-jupiter-5.10.3.jar:/Users/cristina/.m2/repository/org/junit/jupiter/junit-jupiter-api/5.10.3/junit-jupiter-api-5.10.3.jar:/Users/cristina/.m2/repository/org/opentest4j/opentest4j/1.3.0/opentest4j-1.3.0.jar:/Users/cristina/.m2/repository/org/junit/platform/junit-platform-commons/1.10.3/junit-platform-commons-1.10.3.jar:/Users/cristina/.m2/repository/org/apiguardian/apiguardian-api/1.1.2/apiguardian-api-1.1.2.jar:/Users/cristina/.m2/repository/org/junit/jupiter/junit-jupiter-params/5.10.3/junit-jupiter-params-5.10.3.jar:/Users/cristina/.m2/repository/org/junit/jupiter/junit-jupiter-engine/5.10.3/junit-jupiter-engine-5.10.3.jar:/Users/cristina/.m2/repository/org/junit/platform/junit-platform-engine/1.10.3/junit-platform-engine-1.10.3.jar:/Users/cristina/.m2/repository/org/openjdk/jmh/jmh-core/1.37/jmh-core-1.37.jar:/Users/cristina/.m2/repository/net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4.jar:/Users/cristina/.m2/repository/org/apache/commons/commons-math3/3.6.1/commons-math3-3.6.1.jar:/Users/cristina/.m2/repository/org/openjdk/jmh/jmh-generator-annprocess/1.37/jmh-generator-annprocess-1.37.jar +Launcher Type: SUN_STANDARD + +[Global flags] + intx CICompilerCount = 4 {product} {ergonomic} + uint ConcGCThreads = 2 {product} {ergonomic} + uint G1ConcRefinementThreads = 8 {product} {ergonomic} + size_t G1HeapRegionSize = 2097152 {product} {ergonomic} + size_t InitialHeapSize = 268435456 {product} {ergonomic} + size_t MarkStackSize = 4194304 {product} {ergonomic} + size_t MaxHeapSize = 4294967296 {product} {ergonomic} + size_t MaxNewSize = 2575302656 {product} {ergonomic} + size_t MinHeapDeltaBytes = 2097152 {product} {ergonomic} + size_t MinHeapSize = 8388608 {product} {ergonomic} + uintx NonNMethodCodeHeapSize = 5839564 {pd product} {ergonomic} + uintx NonProfiledCodeHeapSize = 122909338 {pd product} {ergonomic} + uintx ProfiledCodeHeapSize = 122909338 {pd product} {ergonomic} + uintx ReservedCodeCacheSize = 251658240 {pd product} {ergonomic} + bool SegmentedCodeCache = true {product} {ergonomic} + size_t SoftMaxHeapSize = 4294967296 {manageable} {ergonomic} + bool UseCompressedOops = true {product lp64_product} {ergonomic} + bool UseG1GC = true {product} {ergonomic} + bool UseNUMA = false {product} {ergonomic} + bool UseNUMAInterleaving = false {product} {ergonomic} + +Logging: +Log output configuration: + #0: stdout all=warning uptime,level,tags foldmultilines=false + #1: stderr all=off uptime,level,tags foldmultilines=false + +Environment Variables: +JAVA_HOME=/Users/cristina/Library/Java/JavaVirtualMachines/corretto-19.0.1/Contents/Home/ +PATH=/Users/cristina/bin/jextract-22/bin:/bin:/Users/cristina/.modular/pkg/packages.modular.com_mojo/bin:/Users/cristina/Downloads/dart-sdk/bin:/opt/homebrew/Cellar/llvm/15.0.6/bin:/opt/homebrew/opt/openjdk/bin:/Users/cristina/.elan/bin:/Users/cristina/bin:/Users/cristina/Library/Application Support/Coursier/bin:/Users/cristina/Library/Python/3.8/bin:/Users/cristina/.local/bin:/Users/cristina/.cargo/bin:/Users/cristina/.cargo:/opt/homebrew/bin:/Users/cristina/.fzf/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/X11/bin:/Library/Apple/usr/bin:/usr/local/go/bin:/Library/TeX/texbin:/Users/cristina/.krew/bin +SHELL=/opt/homebrew/bin/fish +LC_CTYPE=en_US.UTF-8 +TMPDIR=/var/folders/x_/9qhndrhs79j640bxvmbkddfw0000gn/T/ + +Active Locale: +LC_ALL=C/en_US.UTF-8/C/C/C/C +LC_COLLATE=C +LC_CTYPE=en_US.UTF-8 +LC_MESSAGES=C +LC_MONETARY=C +LC_NUMERIC=C +LC_TIME=C + +Signal Handlers: + SIGSEGV: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_ONSTACK|SA_RESTART|SA_SIGINFO, unblocked + SIGBUS: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, unblocked + SIGFPE: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, unblocked + SIGPIPE: javaSignalHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked + SIGXFSZ: javaSignalHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked + SIGILL: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, unblocked + SIGUSR2: SR_handler in libjvm.dylib, mask=00100000000000000000000000000000, flags=SA_RESTART|SA_SIGINFO, blocked + SIGHUP: UserHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked + SIGINT: UserHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked + SIGTERM: UserHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked + SIGQUIT: UserHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked + SIGTRAP: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, unblocked + + +Periodic native trim disabled + +--------------- S Y S T E M --------------- + +OS: +uname: Darwin 23.5.0 Darwin Kernel Version 23.5.0: Wed May 1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000 arm64 +OS uptime: 45 days 10:06 hours +rlimit (soft/hard): STACK 8176k/65520k , CORE 0k/infinity , NPROC 2666/4000 , NOFILE 10240/infinity , AS infinity/infinity , CPU infinity/infinity , DATA infinity/infinity , FSIZE infinity/infinity , MEMLOCK infinity/infinity , RSS infinity/infinity +load average: 5.58 4.66 4.56 + +CPU: total 8 (initial active 8) 0x61:0x0:0x1b588bb3:0, fp, asimd, aes, pmull, sha1, sha256, crc32, lse, sha3, sha512 +machdep.cpu.brand_string:Apple M1 Pro +hw.cachelinesize:128 +hw.l1icachesize:131072 +hw.l1dcachesize:65536 +hw.l2cachesize:4194304 + +Memory: 16k page, physical 16777216k(21552k free), swap 3145728k(1371968k free) + +vm_info: OpenJDK 64-Bit Server VM (22.0.1+8) for bsd-aarch64 JRE (22.0.1+8), built on 2024-04-16T00:00:00Z by "admin" with clang Apple LLVM 15.0.0 (clang-1500.1.0.2.5) + +END. diff --git a/feature_tests/java/somelib/hs_err_pid98866.log b/feature_tests/java/somelib/hs_err_pid98866.log new file mode 100644 index 000000000..f832aeed6 --- /dev/null +++ b/feature_tests/java/somelib/hs_err_pid98866.log @@ -0,0 +1,1291 @@ +# +# A fatal error has been detected by the Java Runtime Environment: +# +# SIGSEGV (0xb) at pc=0x0000000101791aec, pid=98866, tid=8707 +# +# JRE version: OpenJDK Runtime Environment Temurin-22.0.1+8 (22.0.1+8) (build 22.0.1+8) +# Java VM: OpenJDK 64-Bit Server VM Temurin-22.0.1+8 (22.0.1+8, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-aarch64) +# Problematic frame: +# C [libsomelib.dylib+0x5aec] Float64Vec_new_isize+0xb4 +# +# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again +# +# If you would like to submit a bug report, please visit: +# https://github.com/adoptium/adoptium-support/issues +# The crash happened outside the Java Virtual Machine in native code. +# See problematic frame for where to report the bug. +# + +--------------- S U M M A R Y ------------ + +Command Line: -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:60599,suspend=y,server=n -ea -Didea.test.cyclic.buffer.size=1048576 -javaagent:/Users/cristina/Library/Caches/JetBrains/IdeaIC2024.1/captureAgent/debugger-agent.jar -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit5 dev.diplomattest.somelib.Float64VecTest,testFloat64Vec + +Host: "MacBookPro18,3" arm64, 8 cores, 16G, Darwin 23.5.0, macOS 14.5 (23F79) +Time: Wed Aug 14 21:08:10 2024 CEST elapsed time: 18.374079 seconds (0d 0h 0m 18s) + +--------------- T H R E A D --------------- + +Current thread (0x0000000114818200): JavaThread "main" [_thread_in_native, id=8707, stack(0x000000016fc94000,0x000000016fe97000) (2060K)] + +Stack: [0x000000016fc94000,0x000000016fe97000], sp=0x000000016fe93870, free space=2046k +Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) +C [libsomelib.dylib+0x5aec] Float64Vec_new_isize+0xb4 +v ~RuntimeStub::nep_invoker_blob 0x000000014765bdbc +j java.lang.invoke.LambdaForm$MH+0x00007800001d0400.invoke(Ljava/lang/Object;JJJ)J+12 java.base@22.0.1 +j java.lang.invoke.LambdaForm$MH+0x00007800001d3000.invokeExact_MT(Ljava/lang/Object;JJJLjava/lang/Object;)J+23 java.base@22.0.1 +j jdk.internal.foreign.abi.DowncallStub+0x00007800001d1000.invoke(Ljava/lang/foreign/SegmentAllocator;Ljava/lang/foreign/MemorySegment;Ljava/lang/foreign/MemorySegment;)Ljava/lang/foreign/MemorySegment;+69 java.base@22.0.1 +j java.lang.invoke.LambdaForm$DMH+0x00007800001d1400.invokeStaticInit(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+14 java.base@22.0.1 +j java.lang.invoke.LambdaForm$MH+0x00007800001d2400.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+44 java.base@22.0.1 +j java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+19 java.base@22.0.1 +j dev.diplomattest.somelib.ntv.somelib_h.Float64Vec_new_isize(Ljava/lang/foreign/MemorySegment;)Ljava/lang/foreign/MemorySegment;+26 +j dev.diplomattest.somelib.Float64Vec.newIsize([J)Ldev/diplomattest/somelib/Float64Vec;+38 +j dev.diplomattest.somelib.Float64VecTest.testFloat64Vec()V+53 +j java.lang.invoke.LambdaForm$DMH+0x0000780000140c00.invokeVirtual(Ljava/lang/Object;Ljava/lang/Object;)V+10 java.base@22.0.1 +j java.lang.invoke.LambdaForm$MH+0x0000780000148400.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+31 java.base@22.0.1 +j java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+19 java.base@22.0.1 +j jdk.internal.reflect.DirectMethodHandleAccessor.invokeImpl(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+41 java.base@22.0.1 +j jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+23 java.base@22.0.1 +j java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+102 java.base@22.0.1 +j org.junit.platform.commons.util.ReflectionUtils.invokeMethod(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+42 +j org.junit.jupiter.engine.execution.MethodInvocation.proceed()Ljava/lang/Object;+16 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed()Ljava/lang/Object;+8 +j org.junit.jupiter.engine.extension.TimeoutExtension.intercept(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/TimeoutDuration;Lorg/junit/jupiter/engine/extension/TimeoutExtension$TimeoutProvider;)Ljava/lang/Object;+28 +j org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/TimeoutExtension$TimeoutProvider;)Ljava/lang/Object;+31 +j org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)V+9 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda+0x0000780000117998.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)V+5 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall$VoidMethodInterceptorCall;Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)Ljava/lang/Void;+6 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall$$Lambda+0x0000780000117da8.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)Ljava/lang/Object;+9 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+6 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$$Lambda+0x00007800001465f0.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+14 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed()Ljava/lang/Object;+12 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+1 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/engine/execution/InvocationInterceptorChain$InterceptorCall;Ljava/util/List;)Ljava/lang/Object;+24 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InvocationInterceptorChain$InterceptorCall;)Ljava/lang/Object;+31 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;)Ljava/lang/Object;+15 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(Ljava/lang/reflect/Method;Ljava/lang/Object;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;)Ljava/lang/Object;+55 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;)V+28 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda+0x0000780000142aa8.execute()V+12 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)V+21 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;+44 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;+6 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+79 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x0000780000136220.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x0000780000136000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 +j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x0000780000133bc0.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService$$Lambda+0x0000780000136d10.accept(Ljava/lang/Object;)V+4 +j java.util.ArrayList.forEach(Ljava/util/function/Consumer;)V+46 java.base@22.0.1 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(Ljava/util/List;)V+6 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+116 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x0000780000136220.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x0000780000136000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 +j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x0000780000133bc0.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService$$Lambda+0x0000780000136d10.accept(Ljava/lang/Object;)V+4 +j java.util.ArrayList.forEach(Ljava/util/function/Consumer;)V+46 java.base@22.0.1 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(Ljava/util/List;)V+6 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+116 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x0000780000136220.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x0000780000136000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 +j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x0000780000133bc0.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(Lorg/junit/platform/engine/support/hierarchical/HierarchicalTestExecutorService$TestTask;)Ljava/util/concurrent/Future;+1 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute()Ljava/util/concurrent/Future;+74 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(Lorg/junit/platform/engine/ExecutionRequest;)V+31 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/engine/TestDescriptor;Lorg/junit/platform/engine/EngineExecutionListener;Lorg/junit/platform/engine/ConfigurationParameters;Lorg/junit/platform/engine/TestEngine;)V+24 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/LauncherDiscoveryResult;Lorg/junit/platform/engine/EngineExecutionListener;)V+115 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;Lorg/junit/platform/engine/EngineExecutionListener;Lorg/junit/platform/launcher/TestExecutionListener;)V+55 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(Lorg/junit/platform/launcher/core/InternalTestPlan;Lorg/junit/platform/launcher/TestExecutionListener;)V+6 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator$$Lambda+0x0000780000120000.accept(Ljava/lang/Object;)V+12 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(Lorg/junit/platform/engine/ConfigurationParameters;Lorg/junit/platform/launcher/core/ListenerRegistry;Ljava/util/function/Consumer;)V+51 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;[Lorg/junit/platform/launcher/TestExecutionListener;)V+23 +j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;[Lorg/junit/platform/launcher/TestExecutionListener;)V+6 +j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+34 +j org.junit.platform.launcher.core.DelegatingLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+6 +j org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+13 +j com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs([Ljava/lang/String;Ljava/lang/String;IZ)I+203 +j com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(Z)I+17 +j com.intellij.rt.execution.junit.TestsRepeater.repeat(IZLcom/intellij/rt/execution/junit/TestsRepeater$TestRun;)I+7 +j com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(Lcom/intellij/rt/junit/IdeaTestRunner;[Ljava/lang/String;Ljava/util/ArrayList;Ljava/lang/String;IZ)I+25 +j com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart([Ljava/lang/String;Ljava/lang/String;Ljava/util/ArrayList;Ljava/lang/String;)I+117 +j com.intellij.rt.junit.JUnitStarter.main([Ljava/lang/String;)V+97 +v ~StubRoutines::call_stub 0x0000000147534154 +...... +Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) +v ~RuntimeStub::nep_invoker_blob 0x000000014765bd8c +j java.lang.invoke.LambdaForm$MH+0x00007800001d0400.invoke(Ljava/lang/Object;JJJ)J+12 java.base@22.0.1 +j java.lang.invoke.LambdaForm$MH+0x00007800001d3000.invokeExact_MT(Ljava/lang/Object;JJJLjava/lang/Object;)J+23 java.base@22.0.1 +j jdk.internal.foreign.abi.DowncallStub+0x00007800001d1000.invoke(Ljava/lang/foreign/SegmentAllocator;Ljava/lang/foreign/MemorySegment;Ljava/lang/foreign/MemorySegment;)Ljava/lang/foreign/MemorySegment;+69 java.base@22.0.1 +j java.lang.invoke.LambdaForm$DMH+0x00007800001d1400.invokeStaticInit(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+14 java.base@22.0.1 +j java.lang.invoke.LambdaForm$MH+0x00007800001d2400.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+44 java.base@22.0.1 +j java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+19 java.base@22.0.1 +j dev.diplomattest.somelib.ntv.somelib_h.Float64Vec_new_isize(Ljava/lang/foreign/MemorySegment;)Ljava/lang/foreign/MemorySegment;+26 +j dev.diplomattest.somelib.Float64Vec.newIsize([J)Ldev/diplomattest/somelib/Float64Vec;+38 +j dev.diplomattest.somelib.Float64VecTest.testFloat64Vec()V+53 +j java.lang.invoke.LambdaForm$DMH+0x0000780000140c00.invokeVirtual(Ljava/lang/Object;Ljava/lang/Object;)V+10 java.base@22.0.1 +j java.lang.invoke.LambdaForm$MH+0x0000780000148400.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+31 java.base@22.0.1 +j java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+19 java.base@22.0.1 +j jdk.internal.reflect.DirectMethodHandleAccessor.invokeImpl(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+41 java.base@22.0.1 +j jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+23 java.base@22.0.1 +j java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+102 java.base@22.0.1 +j org.junit.platform.commons.util.ReflectionUtils.invokeMethod(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+42 +j org.junit.jupiter.engine.execution.MethodInvocation.proceed()Ljava/lang/Object;+16 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed()Ljava/lang/Object;+8 +j org.junit.jupiter.engine.extension.TimeoutExtension.intercept(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/TimeoutDuration;Lorg/junit/jupiter/engine/extension/TimeoutExtension$TimeoutProvider;)Ljava/lang/Object;+28 +j org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/TimeoutExtension$TimeoutProvider;)Ljava/lang/Object;+31 +j org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)V+9 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda+0x0000780000117998.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)V+5 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall$VoidMethodInterceptorCall;Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)Ljava/lang/Void;+6 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall$$Lambda+0x0000780000117da8.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)Ljava/lang/Object;+9 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+6 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$$Lambda+0x00007800001465f0.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+14 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed()Ljava/lang/Object;+12 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+1 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/engine/execution/InvocationInterceptorChain$InterceptorCall;Ljava/util/List;)Ljava/lang/Object;+24 +j org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InvocationInterceptorChain$InterceptorCall;)Ljava/lang/Object;+31 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;)Ljava/lang/Object;+15 +j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(Ljava/lang/reflect/Method;Ljava/lang/Object;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;)Ljava/lang/Object;+55 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;)V+28 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda+0x0000780000142aa8.execute()V+12 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)V+21 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;+44 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;+6 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+79 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x0000780000136220.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x0000780000136000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 +j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x0000780000133bc0.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService$$Lambda+0x0000780000136d10.accept(Ljava/lang/Object;)V+4 +j java.util.ArrayList.forEach(Ljava/util/function/Consumer;)V+46 java.base@22.0.1 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(Ljava/util/List;)V+6 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+116 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x0000780000136220.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x0000780000136000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 +j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x0000780000133bc0.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService$$Lambda+0x0000780000136d10.accept(Ljava/lang/Object;)V+4 +j java.util.ArrayList.forEach(Ljava/util/function/Consumer;)V+46 java.base@22.0.1 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(Ljava/util/List;)V+6 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+116 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x0000780000136220.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x0000780000136000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 +j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 +j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x0000780000133bc0.execute()V+4 +j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 +j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 +j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(Lorg/junit/platform/engine/support/hierarchical/HierarchicalTestExecutorService$TestTask;)Ljava/util/concurrent/Future;+1 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute()Ljava/util/concurrent/Future;+74 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(Lorg/junit/platform/engine/ExecutionRequest;)V+31 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/engine/TestDescriptor;Lorg/junit/platform/engine/EngineExecutionListener;Lorg/junit/platform/engine/ConfigurationParameters;Lorg/junit/platform/engine/TestEngine;)V+24 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/LauncherDiscoveryResult;Lorg/junit/platform/engine/EngineExecutionListener;)V+115 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;Lorg/junit/platform/engine/EngineExecutionListener;Lorg/junit/platform/launcher/TestExecutionListener;)V+55 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(Lorg/junit/platform/launcher/core/InternalTestPlan;Lorg/junit/platform/launcher/TestExecutionListener;)V+6 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator$$Lambda+0x0000780000120000.accept(Ljava/lang/Object;)V+12 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(Lorg/junit/platform/engine/ConfigurationParameters;Lorg/junit/platform/launcher/core/ListenerRegistry;Ljava/util/function/Consumer;)V+51 +j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;[Lorg/junit/platform/launcher/TestExecutionListener;)V+23 +j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;[Lorg/junit/platform/launcher/TestExecutionListener;)V+6 +j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+34 +j org.junit.platform.launcher.core.DelegatingLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+6 +j org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+13 +j com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs([Ljava/lang/String;Ljava/lang/String;IZ)I+203 +j com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(Z)I+17 +j com.intellij.rt.execution.junit.TestsRepeater.repeat(IZLcom/intellij/rt/execution/junit/TestsRepeater$TestRun;)I+7 +j com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(Lcom/intellij/rt/junit/IdeaTestRunner;[Ljava/lang/String;Ljava/util/ArrayList;Ljava/lang/String;IZ)I+25 +j com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart([Ljava/lang/String;Ljava/lang/String;Ljava/util/ArrayList;Ljava/lang/String;)I+117 +j com.intellij.rt.junit.JUnitStarter.main([Ljava/lang/String;)V+97 +v ~StubRoutines::call_stub 0x0000000147534154 + +siginfo: si_signo: 11 (SIGSEGV), si_code: 2 (SEGV_ACCERR), si_addr: 0x0000000000000001 + +Registers: + x0=0x0000600000dac050 x1=0x00000000e0e03806 x2=0x0000000000000010 x3=0x0000000000000000 + x4=0x0000000000000002 x5=0x0000000000000050 x6=0x0000600000dac050 x7=0x0000000000000eb0 + x8=0x0000000000000000 x9=0x0000000000000000 x10=0x00006b3e118f0000 x11=0x0000000000000010 +x12=0x0000600000d82b34 x13=0x00000000001ff800 x14=0x00000000000007fb x15=0x00000000e0e03806 +x16=0x0000000000000005 x17=0x00000000e100319d x18=0x0000000000000000 x19=0x0000000000000010 +x20=0x0000000000000002 x21=0x0000600000dac050 x22=0x00000001017dc141 x23=0x0000000000000001 +x24=0x000000016fe939b8 x25=0x00000000fd720000 x26=0x0000000120d20c08 x27=0x0000000000000000 +x28=0x0000000114818200 fp=0x000000016fe938a0 lr=0x0000000101791a7c sp=0x000000016fe93870 +pc=0x0000000101791aec cpsr=0x0000000080001000 + +Register to memory mapping: + +x0 =0x0000600000dac050 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00 +x1 =0x00000000e0e03806 is an unknown value +x2 =0x0000000000000010 is an unknown value +x3 =0x0 is null +x4 =0x0000000000000002 is an unknown value +x5 =0x0000000000000050 is an unknown value +x6 =0x0000600000dac050 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00 +x7 =0x0000000000000eb0 is an unknown value +x8 =0x0 is null +x9 =0x0 is null +x10=0x00006b3e118f0000 is an unknown value +x11=0x0000000000000010 is an unknown value +x12=0x0000600000d82b34 points into unknown readable memory: f5 29 60 e1 +x13=0x00000000001ff800 is an unknown value +x14=0x00000000000007fb is an unknown value +x15=0x00000000e0e03806 is an unknown value +x16=0x0000000000000005 is an unknown value +x17=0x00000000e100319d is an unknown value +x18=0x0 is null +x19=0x0000000000000010 is an unknown value +x20=0x0000000000000002 is an unknown value +x21=0x0000600000dac050 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00 +x22=0x00000001017dc141: __rust_no_alloc_shim_is_unstable+0 in /Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/libsomelib.dylib at 0x000000010178c000 +x23=0x0000000000000001 is an unknown value +x24=0x000000016fe939b8 is pointing into the stack for thread: 0x0000000114818200 +x25=0x00000000fd720000 is an unknown value +x26=0x0000000120d20c08 is pointing into metadata +x27=0x0 is null +x28=0x0000000114818200 is a thread + fp=0x000000016fe938a0 is pointing into the stack for thread: 0x0000000114818200 + lr=0x0000000101791a7c: Float64Vec_new_isize+0x44 in /Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/libsomelib.dylib at 0x000000010178c000 + sp=0x000000016fe93870 is pointing into the stack for thread: 0x0000000114818200 + +Top of Stack: (sp=0x000000016fe93870) +0x000000016fe93870: 000000016fe939b8 000000070eb2bef0 +0x000000016fe93880: 0000000120d20a54 00000001025e12b0 +0x000000016fe93890: 000000016fe938e8 000000016fe938d0 +0x000000016fe938a0: 000000016fe938c0 000000014765bdbc +0x000000016fe938b0: 000000016fe93970 530d80014754d844 +0x000000016fe938c0: 000000016fe93970 00000001475397a8 +0x000000016fe938d0: 000000070e4231a0 fffffffffffffff2 +0x000000016fe938e0: 0000000000000000 000000070fe03058 +0x000000016fe938f0: 0000000000000002 0000000000000000 +0x000000016fe93900: 0000000000000001 0000000000000000 +0x000000016fe93910: 0000000101791a38 0000000000000000 +0x000000016fe93920: fffffffffffffff6 0000000120d20a54 +0x000000016fe93930: 0000000000000009 0000000120d20c08 +0x000000016fe93940: 000000070fe109c8 ffffffffffffffec +0x000000016fe93950: 0000000000000000 0000000120d20a60 +0x000000016fe93960: ffffffffffffffef 000000016fe93970 +0x000000016fe93970: 000000016fe93a10 00000001475397a8 +0x000000016fe93980: 000000070fe03058 0000000000000002 +0x000000016fe93990: 0000000000000000 0000000000000001 +0x000000016fe939a0: 0000000000000000 0000000101791a38 +0x000000016fe939b0: 0000000000000000 000000070fe10ae0 +0x000000016fe939c0: fffffffffffffff6 0000000120d2629f +0x000000016fe939d0: 0000000000000009 0000000120d26470 +0x000000016fe939e0: 000000070ff3ce20 ffffffffffffffec +0x000000016fe939f0: 0000000000000000 0000000120d262b0 +0x000000016fe93a00: ffffffffffffffef 000000016fe93a10 +0x000000016fe93a10: 000000016fe93ab0 00000001475397a8 +0x000000016fe93a20: 000000070e6e1808 0000000000000002 +0x000000016fe93a30: 0000000000000000 0000000000000001 +0x000000016fe93a40: 0000000000000000 0000000101791a38 +0x000000016fe93a50: 0000000000000000 000000070fe10ae0 +0x000000016fe93a60: fffffffffffffff6 0000000120d22465 + +Instructions: (pc=0x0000000101791aec) +0x00000001017919ec: f6 57 41 a9 f8 5f c4 a8 c0 03 5f d6 00 01 80 52 +0x00000001017919fc: 01 03 80 52 c7 d9 00 94 20 00 20 d4 16 00 80 d2 +0x0000000101791a0c: e0 03 16 aa e1 03 15 aa bd d9 00 94 f5 03 00 aa +0x0000000101791a1c: b3 00 00 b4 61 f2 7d d3 e0 03 14 aa 02 01 80 52 +0x0000000101791a2c: 3a 03 00 94 e0 03 15 aa 54 db 00 94 f8 5f bc a9 +0x0000000101791a3c: f6 57 01 a9 f4 4f 02 a9 fd 7b 03 a9 fd c3 00 91 +0x0000000101791a4c: f4 03 01 aa 15 01 80 52 3f 00 00 f1 b7 02 80 9a +0x0000000101791a5c: 33 f0 7d d3 56 02 00 f0 d6 06 05 91 e1 04 00 b4 +0x0000000101791a6c: df 02 40 39 e0 03 13 aa 01 01 80 52 26 03 00 94 +0x0000000101791a7c: 40 06 00 b4 f5 03 00 aa 08 00 80 d2 9f 22 00 f1 +0x0000000101791a8c: e3 02 00 54 a9 02 17 cb 3f 01 01 f1 83 02 00 54 +0x0000000101791a9c: 09 00 80 d2 88 f2 7d 92 ea 82 00 91 eb 03 08 aa +0x0000000101791aac: 4c 01 09 8b 80 05 7f ad 82 0d 40 ad 00 d8 61 4e +0x0000000101791abc: 21 d8 61 4e 42 d8 61 4e 63 d8 61 4e ac 02 09 8b +0x0000000101791acc: 80 05 00 ad 82 0d 01 ad 29 01 01 91 6b 21 00 f1 +0x0000000101791adc: 81 fe ff 54 1f 01 14 eb 00 01 00 54 09 f1 7d d3 +0x0000000101791aec: e0 6a 69 fc 00 d8 61 5e a0 6a 29 fc 08 05 00 91 +0x0000000101791afc: 9f 02 08 eb 41 ff ff 54 df 02 40 39 00 03 80 52 +0x0000000101791b0c: 01 01 80 52 00 03 00 94 00 01 00 b4 14 54 00 a9 +0x0000000101791b1c: 14 08 00 f9 fd 7b 43 a9 f4 4f 42 a9 f6 57 41 a9 +0x0000000101791b2c: f8 5f c4 a8 c0 03 5f d6 00 01 80 52 01 03 80 52 +0x0000000101791b3c: 78 d9 00 94 20 00 20 d4 00 01 80 52 e1 03 13 aa +0x0000000101791b4c: 6f d9 00 94 f6 03 00 aa b4 00 00 b4 e0 03 15 aa +0x0000000101791b5c: e1 03 13 aa 02 01 80 52 ec 02 00 94 e0 03 16 aa +0x0000000101791b6c: 06 db 00 94 f8 5f bc a9 f6 57 01 a9 f4 4f 02 a9 +0x0000000101791b7c: fd 7b 03 a9 fd c3 00 91 f4 03 01 aa 15 01 80 52 +0x0000000101791b8c: 3f 00 00 f1 b7 02 80 9a 33 f0 7d d3 56 02 00 f0 +0x0000000101791b9c: d6 06 05 91 e1 04 00 b4 df 02 40 39 e0 03 13 aa +0x0000000101791bac: 01 01 80 52 d8 02 00 94 40 06 00 b4 f5 03 00 aa +0x0000000101791bbc: 08 00 80 d2 9f 22 00 f1 e3 02 00 54 a9 02 17 cb +0x0000000101791bcc: 3f 01 01 f1 83 02 00 54 09 00 80 d2 88 f2 7d 92 +0x0000000101791bdc: ea 82 00 91 eb 03 08 aa 4c 01 09 8b 80 05 7f ad + + +Stack slot to memory mapping: + +stack at sp + 0 slots: 0x000000016fe939b8 is pointing into the stack for thread: 0x0000000114818200 +stack at sp + 1 slots: 0x000000070eb2bef0 is an oop: jdk.internal.org.objectweb.asm.SymbolTable$Entry +{0x000000070eb2bef0} - klass: 'jdk/internal/org/objectweb/asm/SymbolTable$Entry' + - ---- fields (total size 7 words): + - final 'index' 'I' @12 45 (0x0000002d) + - final 'data' 'J' @16 0 (0x0000000000000000) + - final 'tag' 'I' @24 1 (0x00000001) + - 'info' 'I' @28 0 (0x00000000) + - final 'owner' 'Ljava/lang/String;' @32 null (0x00000000) + - final 'name' 'Ljava/lang/String;' @36 null (0x00000000) + - final 'value' 'Ljava/lang/String;' @40 a 'java/lang/runtime/SwitchBootstraps$1Element'{0x000000070fe74df0} (0xe1fce9be) + - final 'hashCode' 'I' @44 881600600 (0x348c2858) + - 'next' 'Ljdk/internal/org/objectweb/asm/SymbolTable$Entry;' @48 null (0x00000000) +stack at sp + 2 slots: 0x0000000120d20a54 is pointing into metadata +stack at sp + 3 slots: 0x00000001025e12b0: _ZN19TemplateInterpreter13_active_tableE+0 in /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/server/libjvm.dylib at 0x000000010188c000 +stack at sp + 4 slots: 0x000000016fe938e8 is pointing into the stack for thread: 0x0000000114818200 +stack at sp + 5 slots: 0x000000016fe938d0 is pointing into the stack for thread: 0x0000000114818200 +stack at sp + 6 slots: 0x000000016fe938c0 is pointing into the stack for thread: 0x0000000114818200 +stack at sp + 7 slots: 0x000000014765bdbc is at code_begin+60 in +[CodeBlob (0x000000014765bd10)] +Framesize: 4 +Runtime Stub (0x000000014765bd10): nep_invoker_blob +-------------------------------------------------------------------------------- +Decoding CodeBlob, name: nep_invoker_blob, at [0x000000014765bd80, 0x000000014765be50] 208 bytes +[MachCode] + 0x000000014765bd80: fd7b bfa9 | fd03 0091 | bf43 00d1 | 0900 0010 | 89d7 01f9 | e903 0091 | 89d3 01f9 | 9ddb 01f9 + 0x000000014765bda0: e903 7eb2 | 8a53 1191 | 49fd 9f88 | e903 01aa | e103 03aa | e003 02aa | 2001 3fd6 | a900 80d2 + 0x000000014765bdc0: 8957 04b9 | bf3b 03d5 | 8963 1191 | 29fd dfc8 | bf03 09eb | e801 0054 | 8953 44b9 | a901 0035 + 0x000000014765bde0: e903 7db2 | 8a53 1191 | 49fd 9f88 | 8943 5339 | 3f09 0071 | e001 0054 | 9fd3 01f9 | 9fdb 01f9 + 0x000000014765be00: 9fd7 01f9 | bf03 0091 | fd7b c1a8 | c003 5fd6 | e003 00f9 | e003 1caa | 897d 84d2 | a93a a0f2 + 0x000000014765be20: 2900 c0f2 | 2001 3fd6 | e003 40f9 | edff ff17 | e003 00f9 | 0919 9dd2 | a942 a0f2 | 2900 c0f2 + 0x000000014765be40: 2001 3fd6 | e003 40f9 | ecff ff17 | 0000 0000 +[/MachCode] +-------------------------------------------------------------------------------- + +-------------------------------------------------------------------------------- +Decoding CodeBlob, name: nep_invoker_blob, at [0x000000014765bd80, 0x000000014765be50] 208 bytes +[MachCode] + 0x000000014765bd80: fd7b bfa9 | fd03 0091 | bf43 00d1 | 0900 0010 | 89d7 01f9 | e903 0091 | 89d3 01f9 | 9ddb 01f9 + 0x000000014765bda0: e903 7eb2 | 8a53 1191 | 49fd 9f88 | e903 01aa | e103 03aa | e003 02aa | 2001 3fd6 | a900 80d2 + 0x000000014765bdc0: 8957 04b9 | bf3b 03d5 | 8963 1191 | 29fd dfc8 | bf03 09eb | e801 0054 | 8953 44b9 | a901 0035 + 0x000000014765bde0: e903 7db2 | 8a53 1191 | 49fd 9f88 | 8943 5339 | 3f09 0071 | e001 0054 | 9fd3 01f9 | 9fdb 01f9 + 0x000000014765be00: 9fd7 01f9 | bf03 0091 | fd7b c1a8 | c003 5fd6 | e003 00f9 | e003 1caa | 897d 84d2 | a93a a0f2 + 0x000000014765be20: 2900 c0f2 | 2001 3fd6 | e003 40f9 | edff ff17 | e003 00f9 | 0919 9dd2 | a942 a0f2 | 2900 c0f2 + 0x000000014765be40: 2001 3fd6 | e003 40f9 | ecff ff17 | 0000 0000 +[/MachCode] +-------------------------------------------------------------------------------- + + +--------------- P R O C E S S --------------- + +Threads class SMR info: +_java_thread_list=0x0000600000fb94e0, length=13, elements={ +0x0000000114818200, 0x000000011485b000, 0x0000000114815c00, 0x000000013480d800, +0x0000000134811400, 0x000000013480ec00, 0x0000000115008200, 0x0000000114816400, +0x000000013500b200, 0x00000001248e8600, 0x000000013503d200, 0x000000013483be00, +0x0000000135808200 +} + +Java Threads: ( => current thread ) +=>0x0000000114818200 JavaThread "main" [_thread_in_native, id=8707, stack(0x000000016fc94000,0x000000016fe97000) (2060K)] + 0x000000011485b000 JavaThread "Reference Handler" daemon [_thread_blocked, id=24323, stack(0x0000000170e0c000,0x000000017100f000) (2060K)] + 0x0000000114815c00 JavaThread "Finalizer" daemon [_thread_blocked, id=24579, stack(0x0000000171018000,0x000000017121b000) (2060K)] + 0x000000013480d800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=24835, stack(0x0000000171224000,0x0000000171427000) (2060K)] + 0x0000000134811400 JavaThread "Service Thread" daemon [_thread_blocked, id=25091, stack(0x0000000171430000,0x0000000171633000) (2060K)] + 0x000000013480ec00 JavaThread "Monitor Deflation Thread" daemon [_thread_blocked, id=25603, stack(0x000000017163c000,0x000000017183f000) (2060K)] + 0x0000000115008200 JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=28419, stack(0x0000000171848000,0x0000000171a4b000) (2060K)] + 0x0000000114816400 JavaThread "C1 CompilerThread0" daemon [_thread_in_vm, id=28163, stack(0x0000000171a54000,0x0000000171c57000) (2060K)] + 0x000000013500b200 JavaThread "Common-Cleaner" daemon [_thread_blocked, id=27907, stack(0x0000000171c60000,0x0000000171e63000) (2060K)] + 0x00000001248e8600 JavaThread "JDWP Transport Listener: dt_socket" daemon [_thread_blocked, id=27395, stack(0x0000000171e6c000,0x000000017206f000) (2060K)] + 0x000000013503d200 JavaThread "JDWP Event Helper Thread" daemon [_thread_blocked, id=26883, stack(0x0000000172078000,0x000000017227b000) (2060K)] + 0x000000013483be00 JavaThread "JDWP Command Reader" daemon [_thread_in_native, id=32771, stack(0x0000000172284000,0x0000000172487000) (2060K)] + 0x0000000135808200 JavaThread "Notification Thread" daemon [_thread_blocked, id=43011, stack(0x0000000172490000,0x0000000172693000) (2060K)] +Total: 13 + +Other Threads: + 0x0000000134704f50 VMThread "VM Thread" [id=17923, stack(0x0000000170ae8000,0x0000000170ceb000) (2060K)] + 0x0000000114707930 WatcherThread "VM Periodic Task Thread" [id=17411, stack(0x00000001708dc000,0x0000000170adf000) (2060K)] + 0x0000000124606dd0 WorkerThread "GC Thread#0" [id=12291, stack(0x000000016fea0000,0x00000001700a3000) (2060K)] + 0x00000001146157c0 WorkerThread "GC Thread#1" [id=23303, stack(0x000000017269c000,0x000000017289f000) (2060K)] + 0x0000000114615d30 WorkerThread "GC Thread#2" [id=33027, stack(0x00000001728a8000,0x0000000172aab000) (2060K)] + 0x0000000134733c70 WorkerThread "GC Thread#3" [id=33539, stack(0x0000000172ab4000,0x0000000172cb7000) (2060K)] + 0x00000001347341e0 WorkerThread "GC Thread#4" [id=33795, stack(0x0000000172cc0000,0x0000000172ec3000) (2060K)] + 0x0000000134734750 WorkerThread "GC Thread#5" [id=41731, stack(0x0000000172ecc000,0x00000001730cf000) (2060K)] + 0x0000000134735140 WorkerThread "GC Thread#6" [id=41475, stack(0x00000001730d8000,0x00000001732db000) (2060K)] + 0x00000001347354e0 WorkerThread "GC Thread#7" [id=41219, stack(0x00000001732e4000,0x00000001734e7000) (2060K)] + 0x0000000124607570 ConcurrentGCThread "G1 Main Marker" [id=13571, stack(0x00000001700ac000,0x00000001702af000) (2060K)] + 0x0000000114704080 WorkerThread "G1 Conc#0" [id=12803, stack(0x00000001702b8000,0x00000001704bb000) (2060K)] + 0x0000000124858a00 ConcurrentGCThread "G1 Refine#0" [id=21507, stack(0x00000001704c4000,0x00000001706c7000) (2060K)] + 0x00000001147065a0 ConcurrentGCThread "G1 Service" [id=16643, stack(0x00000001706d0000,0x00000001708d3000) (2060K)] +Total: 14 + +Threads with active compile tasks: +C2 CompilerThread0 18380 1238 4 jdk.internal.org.objectweb.asm.SymbolTable::addConstantUtf8Reference (101 bytes) +C1 CompilerThread0 18380 1254 3 jdk.internal.classfile.impl.StackMapGenerator::processBlock (2767 bytes) +Total: 2 + +VM state: not at safepoint (normal execution) + +VM Mutex/Monitor currently owned by a thread: ([mutex/lock_event]) +[0x000000010264a7d8] MethodCompileQueue_lock - owner thread: 0x0000000114816400 +[0x000000010264b198] CodeCache_lock - owner thread: 0x0000000114816400 +[0x000000010264b258] Compile_lock - owner thread: 0x0000000114816400 + +Heap address: 0x0000000700000000, size: 4096 MB, Compressed Oops mode: Zero based, Oop shift amount: 3 + +CDS archive(s) not mapped +Compressed class space mapped at: 0x0000780000000000-0x0000780040000000, reserved size: 1073741824 +Narrow klass base: 0x0000780000000000, Narrow klass shift: 0, Narrow klass range: 0x40000000 + +GC Precious Log: + CardTable entry size: 512 + Card Set container configuration: InlinePtr #cards 4 size 8 Array Of Cards #cards 16 size 48 Howl #buckets 8 coarsen threshold 3686 Howl Bitmap #cards 512 size 80 coarsen threshold 460 Card regions per heap region 1 cards per card region 4096 + CPUs: 8 total, 8 available + Memory: 16384M + Large Page Support: Disabled + NUMA Support: Disabled + Compressed Oops: Enabled (Zero based) + Heap Region Size: 2M + Heap Min Capacity: 8M + Heap Initial Capacity: 256M + Heap Max Capacity: 4G + Pre-touch: Disabled + Parallel Workers: 8 + Concurrent Workers: 2 + Concurrent Refinement Workers: 8 + Periodic GC: Disabled + +Heap: + garbage-first heap total reserved 4194304K, committed 262144K, used 2858K [0x0000000700000000, 0x0000000800000000) + region size 2048K, 3 young (6144K), 2 survivors (4096K) + Metaspace used 15291K, committed 15680K, reserved 1114112K + class space used 1690K, committed 1856K, reserved 1048576K + +Heap Regions: E=young(eden), S=young(survivor), O=old, HS=humongous(starts), HC=humongous(continues), CS=collection set, F=free, TAMS=top-at-mark-start, PB=parsable bottom +| 0|0x0000000700000000, 0x0000000700000000, 0x0000000700200000| 0%| F| |TAMS 0x0000000700000000| PB 0x0000000700000000| Untracked | 0 +| 1|0x0000000700200000, 0x0000000700200000, 0x0000000700400000| 0%| F| |TAMS 0x0000000700200000| PB 0x0000000700200000| Untracked | 0 +| 2|0x0000000700400000, 0x0000000700400000, 0x0000000700600000| 0%| F| |TAMS 0x0000000700400000| PB 0x0000000700400000| Untracked | 0 +| 3|0x0000000700600000, 0x0000000700600000, 0x0000000700800000| 0%| F| |TAMS 0x0000000700600000| PB 0x0000000700600000| Untracked | 0 +| 4|0x0000000700800000, 0x0000000700800000, 0x0000000700a00000| 0%| F| |TAMS 0x0000000700800000| PB 0x0000000700800000| Untracked | 0 +| 5|0x0000000700a00000, 0x0000000700a00000, 0x0000000700c00000| 0%| F| |TAMS 0x0000000700a00000| PB 0x0000000700a00000| Untracked | 0 +| 6|0x0000000700c00000, 0x0000000700c00000, 0x0000000700e00000| 0%| F| |TAMS 0x0000000700c00000| PB 0x0000000700c00000| Untracked | 0 +| 7|0x0000000700e00000, 0x0000000700e00000, 0x0000000701000000| 0%| F| |TAMS 0x0000000700e00000| PB 0x0000000700e00000| Untracked | 0 +| 8|0x0000000701000000, 0x0000000701000000, 0x0000000701200000| 0%| F| |TAMS 0x0000000701000000| PB 0x0000000701000000| Untracked | 0 +| 9|0x0000000701200000, 0x0000000701200000, 0x0000000701400000| 0%| F| |TAMS 0x0000000701200000| PB 0x0000000701200000| Untracked | 0 +| 10|0x0000000701400000, 0x0000000701400000, 0x0000000701600000| 0%| F| |TAMS 0x0000000701400000| PB 0x0000000701400000| Untracked | 0 +| 11|0x0000000701600000, 0x0000000701600000, 0x0000000701800000| 0%| F| |TAMS 0x0000000701600000| PB 0x0000000701600000| Untracked | 0 +| 12|0x0000000701800000, 0x0000000701800000, 0x0000000701a00000| 0%| F| |TAMS 0x0000000701800000| PB 0x0000000701800000| Untracked | 0 +| 13|0x0000000701a00000, 0x0000000701a00000, 0x0000000701c00000| 0%| F| |TAMS 0x0000000701a00000| PB 0x0000000701a00000| Untracked | 0 +| 14|0x0000000701c00000, 0x0000000701c00000, 0x0000000701e00000| 0%| F| |TAMS 0x0000000701c00000| PB 0x0000000701c00000| Untracked | 0 +| 15|0x0000000701e00000, 0x0000000701e00000, 0x0000000702000000| 0%| F| |TAMS 0x0000000701e00000| PB 0x0000000701e00000| Untracked | 0 +| 16|0x0000000702000000, 0x0000000702000000, 0x0000000702200000| 0%| F| |TAMS 0x0000000702000000| PB 0x0000000702000000| Untracked | 0 +| 17|0x0000000702200000, 0x0000000702200000, 0x0000000702400000| 0%| F| |TAMS 0x0000000702200000| PB 0x0000000702200000| Untracked | 0 +| 18|0x0000000702400000, 0x0000000702400000, 0x0000000702600000| 0%| F| |TAMS 0x0000000702400000| PB 0x0000000702400000| Untracked | 0 +| 19|0x0000000702600000, 0x0000000702600000, 0x0000000702800000| 0%| F| |TAMS 0x0000000702600000| PB 0x0000000702600000| Untracked | 0 +| 20|0x0000000702800000, 0x0000000702800000, 0x0000000702a00000| 0%| F| |TAMS 0x0000000702800000| PB 0x0000000702800000| Untracked | 0 +| 21|0x0000000702a00000, 0x0000000702a00000, 0x0000000702c00000| 0%| F| |TAMS 0x0000000702a00000| PB 0x0000000702a00000| Untracked | 0 +| 22|0x0000000702c00000, 0x0000000702c00000, 0x0000000702e00000| 0%| F| |TAMS 0x0000000702c00000| PB 0x0000000702c00000| Untracked | 0 +| 23|0x0000000702e00000, 0x0000000702e00000, 0x0000000703000000| 0%| F| |TAMS 0x0000000702e00000| PB 0x0000000702e00000| Untracked | 0 +| 24|0x0000000703000000, 0x0000000703000000, 0x0000000703200000| 0%| F| |TAMS 0x0000000703000000| PB 0x0000000703000000| Untracked | 0 +| 25|0x0000000703200000, 0x0000000703200000, 0x0000000703400000| 0%| F| |TAMS 0x0000000703200000| PB 0x0000000703200000| Untracked | 0 +| 26|0x0000000703400000, 0x0000000703400000, 0x0000000703600000| 0%| F| |TAMS 0x0000000703400000| PB 0x0000000703400000| Untracked | 0 +| 27|0x0000000703600000, 0x0000000703600000, 0x0000000703800000| 0%| F| |TAMS 0x0000000703600000| PB 0x0000000703600000| Untracked | 0 +| 28|0x0000000703800000, 0x0000000703800000, 0x0000000703a00000| 0%| F| |TAMS 0x0000000703800000| PB 0x0000000703800000| Untracked | 0 +| 29|0x0000000703a00000, 0x0000000703a00000, 0x0000000703c00000| 0%| F| |TAMS 0x0000000703a00000| PB 0x0000000703a00000| Untracked | 0 +| 30|0x0000000703c00000, 0x0000000703c00000, 0x0000000703e00000| 0%| F| |TAMS 0x0000000703c00000| PB 0x0000000703c00000| Untracked | 0 +| 31|0x0000000703e00000, 0x0000000703e00000, 0x0000000704000000| 0%| F| |TAMS 0x0000000703e00000| PB 0x0000000703e00000| Untracked | 0 +| 32|0x0000000704000000, 0x0000000704000000, 0x0000000704200000| 0%| F| |TAMS 0x0000000704000000| PB 0x0000000704000000| Untracked | 0 +| 33|0x0000000704200000, 0x0000000704200000, 0x0000000704400000| 0%| F| |TAMS 0x0000000704200000| PB 0x0000000704200000| Untracked | 0 +| 34|0x0000000704400000, 0x0000000704400000, 0x0000000704600000| 0%| F| |TAMS 0x0000000704400000| PB 0x0000000704400000| Untracked | 0 +| 35|0x0000000704600000, 0x0000000704600000, 0x0000000704800000| 0%| F| |TAMS 0x0000000704600000| PB 0x0000000704600000| Untracked | 0 +| 36|0x0000000704800000, 0x0000000704800000, 0x0000000704a00000| 0%| F| |TAMS 0x0000000704800000| PB 0x0000000704800000| Untracked | 0 +| 37|0x0000000704a00000, 0x0000000704a00000, 0x0000000704c00000| 0%| F| |TAMS 0x0000000704a00000| PB 0x0000000704a00000| Untracked | 0 +| 38|0x0000000704c00000, 0x0000000704c00000, 0x0000000704e00000| 0%| F| |TAMS 0x0000000704c00000| PB 0x0000000704c00000| Untracked | 0 +| 39|0x0000000704e00000, 0x0000000704e00000, 0x0000000705000000| 0%| F| |TAMS 0x0000000704e00000| PB 0x0000000704e00000| Untracked | 0 +| 40|0x0000000705000000, 0x0000000705000000, 0x0000000705200000| 0%| F| |TAMS 0x0000000705000000| PB 0x0000000705000000| Untracked | 0 +| 41|0x0000000705200000, 0x0000000705200000, 0x0000000705400000| 0%| F| |TAMS 0x0000000705200000| PB 0x0000000705200000| Untracked | 0 +| 42|0x0000000705400000, 0x0000000705400000, 0x0000000705600000| 0%| F| |TAMS 0x0000000705400000| PB 0x0000000705400000| Untracked | 0 +| 43|0x0000000705600000, 0x0000000705600000, 0x0000000705800000| 0%| F| |TAMS 0x0000000705600000| PB 0x0000000705600000| Untracked | 0 +| 44|0x0000000705800000, 0x0000000705800000, 0x0000000705a00000| 0%| F| |TAMS 0x0000000705800000| PB 0x0000000705800000| Untracked | 0 +| 45|0x0000000705a00000, 0x0000000705a00000, 0x0000000705c00000| 0%| F| |TAMS 0x0000000705a00000| PB 0x0000000705a00000| Untracked | 0 +| 46|0x0000000705c00000, 0x0000000705c00000, 0x0000000705e00000| 0%| F| |TAMS 0x0000000705c00000| PB 0x0000000705c00000| Untracked | 0 +| 47|0x0000000705e00000, 0x0000000705e00000, 0x0000000706000000| 0%| F| |TAMS 0x0000000705e00000| PB 0x0000000705e00000| Untracked | 0 +| 48|0x0000000706000000, 0x0000000706000000, 0x0000000706200000| 0%| F| |TAMS 0x0000000706000000| PB 0x0000000706000000| Untracked | 0 +| 49|0x0000000706200000, 0x0000000706200000, 0x0000000706400000| 0%| F| |TAMS 0x0000000706200000| PB 0x0000000706200000| Untracked | 0 +| 50|0x0000000706400000, 0x0000000706400000, 0x0000000706600000| 0%| F| |TAMS 0x0000000706400000| PB 0x0000000706400000| Untracked | 0 +| 51|0x0000000706600000, 0x0000000706600000, 0x0000000706800000| 0%| F| |TAMS 0x0000000706600000| PB 0x0000000706600000| Untracked | 0 +| 52|0x0000000706800000, 0x0000000706800000, 0x0000000706a00000| 0%| F| |TAMS 0x0000000706800000| PB 0x0000000706800000| Untracked | 0 +| 53|0x0000000706a00000, 0x0000000706a00000, 0x0000000706c00000| 0%| F| |TAMS 0x0000000706a00000| PB 0x0000000706a00000| Untracked | 0 +| 54|0x0000000706c00000, 0x0000000706c00000, 0x0000000706e00000| 0%| F| |TAMS 0x0000000706c00000| PB 0x0000000706c00000| Untracked | 0 +| 55|0x0000000706e00000, 0x0000000706e00000, 0x0000000707000000| 0%| F| |TAMS 0x0000000706e00000| PB 0x0000000706e00000| Untracked | 0 +| 56|0x0000000707000000, 0x0000000707000000, 0x0000000707200000| 0%| F| |TAMS 0x0000000707000000| PB 0x0000000707000000| Untracked | 0 +| 57|0x0000000707200000, 0x0000000707200000, 0x0000000707400000| 0%| F| |TAMS 0x0000000707200000| PB 0x0000000707200000| Untracked | 0 +| 58|0x0000000707400000, 0x0000000707400000, 0x0000000707600000| 0%| F| |TAMS 0x0000000707400000| PB 0x0000000707400000| Untracked | 0 +| 59|0x0000000707600000, 0x0000000707600000, 0x0000000707800000| 0%| F| |TAMS 0x0000000707600000| PB 0x0000000707600000| Untracked | 0 +| 60|0x0000000707800000, 0x0000000707800000, 0x0000000707a00000| 0%| F| |TAMS 0x0000000707800000| PB 0x0000000707800000| Untracked | 0 +| 61|0x0000000707a00000, 0x0000000707a00000, 0x0000000707c00000| 0%| F| |TAMS 0x0000000707a00000| PB 0x0000000707a00000| Untracked | 0 +| 62|0x0000000707c00000, 0x0000000707c00000, 0x0000000707e00000| 0%| F| |TAMS 0x0000000707c00000| PB 0x0000000707c00000| Untracked | 0 +| 63|0x0000000707e00000, 0x0000000707e00000, 0x0000000708000000| 0%| F| |TAMS 0x0000000707e00000| PB 0x0000000707e00000| Untracked | 0 +| 64|0x0000000708000000, 0x0000000708000000, 0x0000000708200000| 0%| F| |TAMS 0x0000000708000000| PB 0x0000000708000000| Untracked | 0 +| 65|0x0000000708200000, 0x0000000708200000, 0x0000000708400000| 0%| F| |TAMS 0x0000000708200000| PB 0x0000000708200000| Untracked | 0 +| 66|0x0000000708400000, 0x0000000708400000, 0x0000000708600000| 0%| F| |TAMS 0x0000000708400000| PB 0x0000000708400000| Untracked | 0 +| 67|0x0000000708600000, 0x0000000708600000, 0x0000000708800000| 0%| F| |TAMS 0x0000000708600000| PB 0x0000000708600000| Untracked | 0 +| 68|0x0000000708800000, 0x0000000708800000, 0x0000000708a00000| 0%| F| |TAMS 0x0000000708800000| PB 0x0000000708800000| Untracked | 0 +| 69|0x0000000708a00000, 0x0000000708a00000, 0x0000000708c00000| 0%| F| |TAMS 0x0000000708a00000| PB 0x0000000708a00000| Untracked | 0 +| 70|0x0000000708c00000, 0x0000000708c00000, 0x0000000708e00000| 0%| F| |TAMS 0x0000000708c00000| PB 0x0000000708c00000| Untracked | 0 +| 71|0x0000000708e00000, 0x0000000708e00000, 0x0000000709000000| 0%| F| |TAMS 0x0000000708e00000| PB 0x0000000708e00000| Untracked | 0 +| 72|0x0000000709000000, 0x0000000709000000, 0x0000000709200000| 0%| F| |TAMS 0x0000000709000000| PB 0x0000000709000000| Untracked | 0 +| 73|0x0000000709200000, 0x0000000709200000, 0x0000000709400000| 0%| F| |TAMS 0x0000000709200000| PB 0x0000000709200000| Untracked | 0 +| 74|0x0000000709400000, 0x0000000709400000, 0x0000000709600000| 0%| F| |TAMS 0x0000000709400000| PB 0x0000000709400000| Untracked | 0 +| 75|0x0000000709600000, 0x0000000709600000, 0x0000000709800000| 0%| F| |TAMS 0x0000000709600000| PB 0x0000000709600000| Untracked | 0 +| 76|0x0000000709800000, 0x0000000709800000, 0x0000000709a00000| 0%| F| |TAMS 0x0000000709800000| PB 0x0000000709800000| Untracked | 0 +| 77|0x0000000709a00000, 0x0000000709a00000, 0x0000000709c00000| 0%| F| |TAMS 0x0000000709a00000| PB 0x0000000709a00000| Untracked | 0 +| 78|0x0000000709c00000, 0x0000000709c00000, 0x0000000709e00000| 0%| F| |TAMS 0x0000000709c00000| PB 0x0000000709c00000| Untracked | 0 +| 79|0x0000000709e00000, 0x0000000709e00000, 0x000000070a000000| 0%| F| |TAMS 0x0000000709e00000| PB 0x0000000709e00000| Untracked | 0 +| 80|0x000000070a000000, 0x000000070a000000, 0x000000070a200000| 0%| F| |TAMS 0x000000070a000000| PB 0x000000070a000000| Untracked | 0 +| 81|0x000000070a200000, 0x000000070a200000, 0x000000070a400000| 0%| F| |TAMS 0x000000070a200000| PB 0x000000070a200000| Untracked | 0 +| 82|0x000000070a400000, 0x000000070a400000, 0x000000070a600000| 0%| F| |TAMS 0x000000070a400000| PB 0x000000070a400000| Untracked | 0 +| 83|0x000000070a600000, 0x000000070a600000, 0x000000070a800000| 0%| F| |TAMS 0x000000070a600000| PB 0x000000070a600000| Untracked | 0 +| 84|0x000000070a800000, 0x000000070a800000, 0x000000070aa00000| 0%| F| |TAMS 0x000000070a800000| PB 0x000000070a800000| Untracked | 0 +| 85|0x000000070aa00000, 0x000000070aa00000, 0x000000070ac00000| 0%| F| |TAMS 0x000000070aa00000| PB 0x000000070aa00000| Untracked | 0 +| 86|0x000000070ac00000, 0x000000070ac00000, 0x000000070ae00000| 0%| F| |TAMS 0x000000070ac00000| PB 0x000000070ac00000| Untracked | 0 +| 87|0x000000070ae00000, 0x000000070ae00000, 0x000000070b000000| 0%| F| |TAMS 0x000000070ae00000| PB 0x000000070ae00000| Untracked | 0 +| 88|0x000000070b000000, 0x000000070b000000, 0x000000070b200000| 0%| F| |TAMS 0x000000070b000000| PB 0x000000070b000000| Untracked | 0 +| 89|0x000000070b200000, 0x000000070b200000, 0x000000070b400000| 0%| F| |TAMS 0x000000070b200000| PB 0x000000070b200000| Untracked | 0 +| 90|0x000000070b400000, 0x000000070b400000, 0x000000070b600000| 0%| F| |TAMS 0x000000070b400000| PB 0x000000070b400000| Untracked | 0 +| 91|0x000000070b600000, 0x000000070b600000, 0x000000070b800000| 0%| F| |TAMS 0x000000070b600000| PB 0x000000070b600000| Untracked | 0 +| 92|0x000000070b800000, 0x000000070b800000, 0x000000070ba00000| 0%| F| |TAMS 0x000000070b800000| PB 0x000000070b800000| Untracked | 0 +| 93|0x000000070ba00000, 0x000000070ba00000, 0x000000070bc00000| 0%| F| |TAMS 0x000000070ba00000| PB 0x000000070ba00000| Untracked | 0 +| 94|0x000000070bc00000, 0x000000070bc00000, 0x000000070be00000| 0%| F| |TAMS 0x000000070bc00000| PB 0x000000070bc00000| Untracked | 0 +| 95|0x000000070be00000, 0x000000070be00000, 0x000000070c000000| 0%| F| |TAMS 0x000000070be00000| PB 0x000000070be00000| Untracked | 0 +| 96|0x000000070c000000, 0x000000070c000000, 0x000000070c200000| 0%| F| |TAMS 0x000000070c000000| PB 0x000000070c000000| Untracked | 0 +| 97|0x000000070c200000, 0x000000070c200000, 0x000000070c400000| 0%| F| |TAMS 0x000000070c200000| PB 0x000000070c200000| Untracked | 0 +| 98|0x000000070c400000, 0x000000070c400000, 0x000000070c600000| 0%| F| |TAMS 0x000000070c400000| PB 0x000000070c400000| Untracked | 0 +| 99|0x000000070c600000, 0x000000070c600000, 0x000000070c800000| 0%| F| |TAMS 0x000000070c600000| PB 0x000000070c600000| Untracked | 0 +| 100|0x000000070c800000, 0x000000070c800000, 0x000000070ca00000| 0%| F| |TAMS 0x000000070c800000| PB 0x000000070c800000| Untracked | 0 +| 101|0x000000070ca00000, 0x000000070ca00000, 0x000000070cc00000| 0%| F| |TAMS 0x000000070ca00000| PB 0x000000070ca00000| Untracked | 0 +| 102|0x000000070cc00000, 0x000000070cc00000, 0x000000070ce00000| 0%| F| |TAMS 0x000000070cc00000| PB 0x000000070cc00000| Untracked | 0 +| 103|0x000000070ce00000, 0x000000070ce00000, 0x000000070d000000| 0%| F| |TAMS 0x000000070ce00000| PB 0x000000070ce00000| Untracked | 0 +| 104|0x000000070d000000, 0x000000070d000000, 0x000000070d200000| 0%| F| |TAMS 0x000000070d000000| PB 0x000000070d000000| Untracked | 0 +| 105|0x000000070d200000, 0x000000070d200000, 0x000000070d400000| 0%| F| |TAMS 0x000000070d200000| PB 0x000000070d200000| Untracked | 0 +| 106|0x000000070d400000, 0x000000070d400000, 0x000000070d600000| 0%| F| |TAMS 0x000000070d400000| PB 0x000000070d400000| Untracked | 0 +| 107|0x000000070d600000, 0x000000070d600000, 0x000000070d800000| 0%| F| |TAMS 0x000000070d600000| PB 0x000000070d600000| Untracked | 0 +| 108|0x000000070d800000, 0x000000070d800000, 0x000000070da00000| 0%| F| |TAMS 0x000000070d800000| PB 0x000000070d800000| Untracked | 0 +| 109|0x000000070da00000, 0x000000070da00000, 0x000000070dc00000| 0%| F| |TAMS 0x000000070da00000| PB 0x000000070da00000| Untracked | 0 +| 110|0x000000070dc00000, 0x000000070dc00000, 0x000000070de00000| 0%| F| |TAMS 0x000000070dc00000| PB 0x000000070dc00000| Untracked | 0 +| 111|0x000000070de00000, 0x000000070de00000, 0x000000070e000000| 0%| F| |TAMS 0x000000070de00000| PB 0x000000070de00000| Untracked | 0 +| 112|0x000000070e000000, 0x000000070e000000, 0x000000070e200000| 0%| F| |TAMS 0x000000070e000000| PB 0x000000070e000000| Untracked | 0 +| 113|0x000000070e200000, 0x000000070e200000, 0x000000070e400000| 0%| F| |TAMS 0x000000070e200000| PB 0x000000070e200000| Untracked | 0 +| 114|0x000000070e400000, 0x000000070e4caa78, 0x000000070e600000| 39%| S|CS|TAMS 0x000000070e400000| PB 0x000000070e400000| Complete | 0 +| 115|0x000000070e600000, 0x000000070e800000, 0x000000070e800000|100%| S|CS|TAMS 0x000000070e600000| PB 0x000000070e600000| Complete | 0 +| 116|0x000000070e800000, 0x000000070e800000, 0x000000070ea00000| 0%| F| |TAMS 0x000000070e800000| PB 0x000000070e800000| Untracked | 0 +| 117|0x000000070ea00000, 0x000000070ea00000, 0x000000070ec00000| 0%| F| |TAMS 0x000000070ea00000| PB 0x000000070ea00000| Untracked | 0 +| 118|0x000000070ec00000, 0x000000070ec00000, 0x000000070ee00000| 0%| F| |TAMS 0x000000070ec00000| PB 0x000000070ec00000| Untracked | 0 +| 119|0x000000070ee00000, 0x000000070ee00000, 0x000000070f000000| 0%| F| |TAMS 0x000000070ee00000| PB 0x000000070ee00000| Untracked | 0 +| 120|0x000000070f000000, 0x000000070f000000, 0x000000070f200000| 0%| F| |TAMS 0x000000070f000000| PB 0x000000070f000000| Untracked | 0 +| 121|0x000000070f200000, 0x000000070f200000, 0x000000070f400000| 0%| F| |TAMS 0x000000070f200000| PB 0x000000070f200000| Untracked | 0 +| 122|0x000000070f400000, 0x000000070f400000, 0x000000070f600000| 0%| F| |TAMS 0x000000070f400000| PB 0x000000070f400000| Untracked | 0 +| 123|0x000000070f600000, 0x000000070f600000, 0x000000070f800000| 0%| F| |TAMS 0x000000070f600000| PB 0x000000070f600000| Untracked | 0 +| 124|0x000000070f800000, 0x000000070f800000, 0x000000070fa00000| 0%| F| |TAMS 0x000000070f800000| PB 0x000000070f800000| Untracked | 0 +| 125|0x000000070fa00000, 0x000000070fa00000, 0x000000070fc00000| 0%| F| |TAMS 0x000000070fa00000| PB 0x000000070fa00000| Untracked | 0 +| 126|0x000000070fc00000, 0x000000070fc00000, 0x000000070fe00000| 0%| F| |TAMS 0x000000070fc00000| PB 0x000000070fc00000| Untracked | 0 +| 127|0x000000070fe00000, 0x000000070ff75a28, 0x0000000710000000| 72%| E| |TAMS 0x000000070fe00000| PB 0x000000070fe00000| Complete | 0 + +Card table byte_map: [0x0000000100f20000,0x0000000101720000] _byte_map_base: 0x00000000fd720000 + +Marking Bits: (CMBitMap*) 0x0000000114840610 + Bits: [0x000000010af24000, 0x000000010ef24000) + +Polling page: 0x000000010020c000 + +Metaspace: + +Usage: + Non-class: 13.28 MB used. + Class: 1.65 MB used. + Both: 14.93 MB used. + +Virtual space: + Non-class space: 64.00 MB reserved, 13.50 MB ( 21%) committed, 1 nodes. + Class space: 1.00 GB reserved, 1.81 MB ( <1%) committed, 1 nodes. + Both: 1.06 GB reserved, 15.31 MB ( 1%) committed. + +Chunk freelists: + Non-Class: 2.35 MB + Class: 14.17 MB + Both: 16.52 MB + +MaxMetaspaceSize: unlimited +CompressedClassSpaceSize: 1.00 GB +Initial GC threshold: 21.00 MB +Current GC threshold: 21.00 MB +CDS: off + - commit_granule_bytes: 65536. + - commit_granule_words: 8192. + - virtual_space_node_default_size: 8388608. + - enlarge_chunks_in_place: 1. + - use_allocation_guard: 0. + + +Internal statistics: + +num_allocs_failed_limit: 0. +num_arena_births: 342. +num_arena_deaths: 0. +num_vsnodes_births: 2. +num_vsnodes_deaths: 0. +num_space_committed: 245. +num_space_uncommitted: 0. +num_chunks_returned_to_freelist: 0. +num_chunks_taken_from_freelist: 562. +num_chunk_merges: 0. +num_chunk_splits: 334. +num_chunks_enlarged: 195. +num_inconsistent_stats: 0. + +CodeHeap 'non-profiled nmethods': size=120032Kb used=384Kb max_used=384Kb free=119647Kb + bounds [0x0000000147ac8000, 0x0000000147d38000, 0x000000014f000000] +CodeHeap 'profiled nmethods': size=120016Kb used=2432Kb max_used=2432Kb free=117583Kb + bounds [0x0000000140000000, 0x0000000140270000, 0x0000000147534000] +CodeHeap 'non-nmethods': size=5712Kb used=1359Kb max_used=1372Kb free=4352Kb + bounds [0x0000000147534000, 0x00000001477a4000, 0x0000000147ac8000] + total_blobs=1729 nmethods=1250 adapters=386 + compilation: enabled + stopped_count=0, restarted_count=0 + full_count=0 + +Compilation events (20 events): +Event: 18.367 Thread 0x0000000114816400 nmethod 1240 0x000000014023d010 code [0x000000014023d300, 0x000000014023e190] +Event: 18.367 Thread 0x0000000114816400 1243 3 jdk.internal.classfile.impl.AbstractElement:: (5 bytes) +Event: 18.367 Thread 0x0000000114816400 nmethod 1243 0x000000014023e710 code [0x000000014023e8c0, 0x000000014023ea38] +Event: 18.367 Thread 0x0000000114816400 1244 3 java.lang.constant.ConstantUtils::skipOverFieldSignature (296 bytes) +Event: 18.368 Thread 0x0000000114816400 nmethod 1244 0x000000014023eb10 code [0x000000014023f000, 0x0000000140240cb8] +Event: 18.368 Thread 0x0000000114816400 1247 3 java.util.Arrays::fill (28 bytes) +Event: 18.368 Thread 0x0000000114816400 nmethod 1247 0x0000000140241790 code [0x0000000140241940, 0x0000000140241cc0] +Event: 18.368 Thread 0x0000000114816400 1245 3 jdk.internal.classfile.impl.DirectCodeBuilder::with (9 bytes) +Event: 18.368 Thread 0x0000000114816400 nmethod 1245 0x0000000140241e10 code [0x0000000140242040, 0x0000000140242910] +Event: 18.368 Thread 0x0000000114816400 1246 3 jdk.internal.classfile.impl.DirectCodeBuilder::with (30 bytes) +Event: 18.368 Thread 0x0000000114816400 nmethod 1246 0x0000000140242b90 code [0x0000000140242dc0, 0x0000000140243530] +Event: 18.369 Thread 0x0000000114816400 1248 3 jdk.internal.classfile.impl.SplitConstantPool::map (145 bytes) +Event: 18.369 Thread 0x0000000114816400 nmethod 1248 0x0000000140243790 code [0x0000000140243a80, 0x0000000140244810] +Event: 18.369 Thread 0x0000000114816400 1249 3 java.util.stream.Sink$ChainedReference::cancellationRequested (10 bytes) +Event: 18.369 Thread 0x0000000114816400 nmethod 1249 0x0000000140244c90 code [0x0000000140244e40, 0x0000000140245060] +Event: 18.369 Thread 0x0000000114816400 1251 ! 3 java.lang.invoke.MethodHandles$Lookup::canBeCached (150 bytes) +Event: 18.370 Thread 0x0000000114816400 nmethod 1251 0x0000000140245110 code [0x0000000140245540, 0x0000000140246928] +Event: 18.370 Thread 0x0000000114816400 1252 3 java.util.ArrayList::isEmpty (13 bytes) +Event: 18.370 Thread 0x0000000114816400 nmethod 1252 0x0000000140247090 code [0x0000000140247240, 0x00000001402473b0] +Event: 18.370 Thread 0x0000000114816400 1254 3 jdk.internal.classfile.impl.StackMapGenerator::processBlock (2767 bytes) + +GC Heap History (2 events): +Event: 18.360 GC heap before +{Heap before GC invocations=0 (full 0): + garbage-first heap total reserved 4194304K, committed 262144K, used 22528K [0x0000000700000000, 0x0000000800000000) + region size 2048K, 12 young (24576K), 0 survivors (0K) + Metaspace used 14901K, committed 15168K, reserved 1114112K + class space used 1624K, committed 1728K, reserved 1048576K +} +Event: 18.363 GC heap after +{Heap after GC invocations=1 (full 0): + garbage-first heap total reserved 4194304K, committed 262144K, used 2858K [0x0000000700000000, 0x0000000800000000) + region size 2048K, 2 young (4096K), 2 survivors (4096K) + Metaspace used 14901K, committed 15168K, reserved 1114112K + class space used 1624K, committed 1728K, reserved 1048576K +} + +Dll operation events (8 events): +Event: 0.005 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjava.dylib +Event: 0.006 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libzip.dylib +Event: 0.073 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libinstrument.dylib +Event: 0.084 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libnio.dylib +Event: 0.089 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libzip.dylib +Event: 0.129 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjimage.dylib +Event: 7.529 Loaded shared library libsomelib.dylib +Event: 7.533 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libsyslookup.dylib + +Deoptimization events (20 events): +Event: 0.267 Thread 0x0000000114818200 DEOPT PACKING pc=0x0000000147ad17f0 sp=0x000000016fe934a0 +Event: 0.267 Thread 0x0000000114818200 DEOPT UNPACKING pc=0x000000014757701c sp=0x000000016fe933d0 mode 2 +Event: 0.267 Thread 0x0000000114818200 Uncommon trap: trap_request=0xffffff45 fr.pc=0x0000000147ae5160 relative=0x00000000000001a0 +Event: 0.267 Thread 0x0000000114818200 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000147ae5160 method=jdk.internal.util.ArraysSupport.vectorizedHashCode(Ljava/lang/Object;IIII)I @ 2 c2 +Event: 0.267 Thread 0x0000000114818200 DEOPT PACKING pc=0x0000000147ae5160 sp=0x000000016fe93350 +Event: 0.267 Thread 0x0000000114818200 DEOPT UNPACKING pc=0x000000014757701c sp=0x000000016fe93310 mode 2 +Event: 7.496 Thread 0x0000000114818200 Uncommon trap: trap_request=0xffffff45 fr.pc=0x0000000147b0e620 relative=0x00000000000000e0 +Event: 7.496 Thread 0x0000000114818200 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000147b0e620 method=sun.net.www.ParseUtil.firstEncodeIndex(Ljava/lang/String;)I @ 51 c2 +Event: 7.496 Thread 0x0000000114818200 DEOPT PACKING pc=0x0000000147b0e620 sp=0x000000016fe92770 +Event: 7.496 Thread 0x0000000114818200 DEOPT UNPACKING pc=0x000000014757701c sp=0x000000016fe926f0 mode 2 +Event: 18.344 Thread 0x0000000114818200 DEOPT PACKING pc=0x00000001401e21c8 sp=0x000000016fe92500 +Event: 18.344 Thread 0x0000000114818200 DEOPT UNPACKING pc=0x0000000147576e7c sp=0x000000016fe92300 mode 3 +Event: 18.364 Thread 0x0000000114818200 Uncommon trap: trap_request=0xffffff45 fr.pc=0x0000000147b0dee8 relative=0x00000000000000a8 +Event: 18.364 Thread 0x0000000114818200 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000147b0dee8 method=java.lang.ref.ReferenceQueue.headIsNull()Z @ 4 c2 +Event: 18.364 Thread 0x0000000114818200 DEOPT PACKING pc=0x0000000147b0dee8 sp=0x000000016fe92a20 +Event: 18.364 Thread 0x0000000114818200 DEOPT UNPACKING pc=0x000000014757701c sp=0x000000016fe928e0 mode 2 +Event: 18.364 Thread 0x0000000114818200 Uncommon trap: trap_request=0xffffff45 fr.pc=0x0000000147b0846c relative=0x000000000000006c +Event: 18.364 Thread 0x0000000114818200 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000147b0846c method=java.lang.ref.ReferenceQueue.headIsNull()Z @ 4 c2 +Event: 18.364 Thread 0x0000000114818200 DEOPT PACKING pc=0x0000000147b0846c sp=0x000000016fe92990 +Event: 18.364 Thread 0x0000000114818200 DEOPT UNPACKING pc=0x000000014757701c sp=0x000000016fe928c0 mode 2 + +Classes loaded (20 events): +Event: 18.370 Loading class jdk/internal/classfile/impl/BufferedCodeBuilder +Event: 18.370 Loading class jdk/internal/classfile/impl/BufferedCodeBuilder done +Event: 18.370 Loading class jdk/internal/classfile/impl/TransformingCodeBuilder +Event: 18.371 Loading class jdk/internal/classfile/impl/TransformingCodeBuilder done +Event: 18.371 Loading class java/lang/classfile/instruction/ThrowInstruction +Event: 18.371 Loading class java/lang/classfile/instruction/ThrowInstruction done +Event: 18.371 Loading class jdk/internal/classfile/impl/AbstractInstruction$UnboundThrowInstruction +Event: 18.371 Loading class jdk/internal/classfile/impl/AbstractInstruction$UnboundThrowInstruction done +Event: 18.371 Loading class java/lang/classfile/instruction/ExceptionCatch +Event: 18.371 Loading class java/lang/classfile/instruction/ExceptionCatch done +Event: 18.371 Loading class jdk/internal/classfile/impl/AbstractPseudoInstruction$ExceptionCatchImpl +Event: 18.371 Loading class jdk/internal/classfile/impl/AbstractPseudoInstruction +Event: 18.371 Loading class jdk/internal/classfile/impl/AbstractPseudoInstruction done +Event: 18.371 Loading class jdk/internal/classfile/impl/AbstractPseudoInstruction$ExceptionCatchImpl done +Event: 18.371 Loading class jdk/internal/classfile/impl/StackMapGenerator$RawExceptionCatch +Event: 18.371 Loading class jdk/internal/classfile/impl/StackMapGenerator$RawExceptionCatch done +Event: 18.372 Loading class jdk/internal/classfile/impl/SplitConstantPool$1 +Event: 18.372 Loading class jdk/internal/classfile/impl/SplitConstantPool$1 done +Event: 18.372 Loading class java/lang/invoke/ConstantBootstraps +Event: 18.372 Loading class java/lang/invoke/ConstantBootstraps done + +Classes unloaded (0 events): +No events + +Classes redefined (0 events): +No events + +Internal exceptions (20 events): +Event: 18.344 Thread 0x0000000114818200 Exception (0x000000070e898618) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 18.346 Thread 0x0000000114818200 Exception (0x000000070e8bb1c8) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 18.347 Thread 0x0000000114818200 Exception (0x000000070e8bf818) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 18.347 Thread 0x0000000114818200 Exception (0x000000070e8c33d0) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 18.347 Thread 0x0000000114818200 Exception (0x000000070e8caf20) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 18.347 Thread 0x0000000114818200 Exception (0x000000070e8d1ef8) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 18.347 Thread 0x0000000114818200 Exception (0x000000070e8d8ec8) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 18.348 Thread 0x0000000114818200 Exception (0x000000070e8dd980) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 18.349 Thread 0x0000000114818200 Exception (0x000000070e8fc058) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 18.354 Thread 0x0000000114818200 Exception (0x000000070e948d90) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 841] +Event: 18.355 Thread 0x0000000114818200 Exception (0x000000070e95f8e8) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 18.358 Thread 0x0000000114818200 Exception (0x000000070e9ca4f0) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 18.359 Thread 0x0000000114818200 Exception (0x000000070e9d5288) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 18.360 Thread 0x0000000114818200 Exception (0x000000070e9e6bc8) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 18.363 Thread 0x0000000114818200 Exception (0x000000070fe03a58) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 18.364 Thread 0x0000000114818200 Exception (0x000000070fe08f28) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 18.365 Thread 0x0000000114818200 Exception (0x000000070fe1c800) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 18.369 Thread 0x0000000114818200 Exception (0x000000070fe5c528) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 18.372 Thread 0x0000000114818200 Exception (0x000000070ff1ebf8) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] +Event: 18.372 Thread 0x0000000114818200 Exception (0x000000070ff32c58) +thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] + +ZGC Phase Switch (0 events): +No events + +VM Operations (20 events): +Event: 12.760 Executing VM operation: get/set locals +Event: 12.760 Executing VM operation: get/set locals done +Event: 12.760 Executing VM operation: get/set locals +Event: 12.761 Executing VM operation: get/set locals done +Event: 12.761 Executing VM operation: get/set locals +Event: 12.761 Executing VM operation: get/set locals done +Event: 12.761 Executing VM operation: get/set locals +Event: 12.761 Executing VM operation: get/set locals done +Event: 14.616 Executing VM operation: get/set locals +Event: 14.616 Executing VM operation: get/set locals done +Event: 14.617 Executing VM operation: get/set locals +Event: 14.617 Executing VM operation: get/set locals done +Event: 14.617 Executing VM operation: get/set locals +Event: 14.617 Executing VM operation: get/set locals done +Event: 14.617 Executing VM operation: get/set locals +Event: 14.617 Executing VM operation: get/set locals done +Event: 14.617 Executing VM operation: get/set locals +Event: 14.617 Executing VM operation: get/set locals done +Event: 18.360 Executing VM operation: G1CollectForAllocation (G1 Evacuation Pause) +Event: 18.363 Executing VM operation: G1CollectForAllocation (G1 Evacuation Pause) done + +Events (20 events): +Event: 0.024 Thread 0x000000013480d800 Thread added: 0x000000013480d800 +Event: 0.024 Protecting memory [0x0000000171224000,0x0000000171230000] with protection modes 0 +Event: 0.024 Thread 0x0000000134811400 Thread added: 0x0000000134811400 +Event: 0.024 Protecting memory [0x0000000171430000,0x000000017143c000] with protection modes 0 +Event: 0.024 Thread 0x000000013480ec00 Thread added: 0x000000013480ec00 +Event: 0.024 Protecting memory [0x000000017163c000,0x0000000171648000] with protection modes 0 +Event: 0.024 Thread 0x0000000115008200 Thread added: 0x0000000115008200 +Event: 0.024 Protecting memory [0x0000000171848000,0x0000000171854000] with protection modes 0 +Event: 0.024 Thread 0x0000000114816400 Thread added: 0x0000000114816400 +Event: 0.024 Protecting memory [0x0000000171a54000,0x0000000171a60000] with protection modes 0 +Event: 0.044 Thread 0x000000013500b200 Thread added: 0x000000013500b200 +Event: 0.044 Protecting memory [0x0000000171c60000,0x0000000171c6c000] with protection modes 0 +Event: 0.060 Thread 0x00000001248e8600 Thread added: 0x00000001248e8600 +Event: 0.060 Protecting memory [0x0000000171e6c000,0x0000000171e78000] with protection modes 0 +Event: 0.060 Thread 0x000000013503d200 Thread added: 0x000000013503d200 +Event: 0.060 Protecting memory [0x0000000172078000,0x0000000172084000] with protection modes 0 +Event: 0.060 Thread 0x000000013483be00 Thread added: 0x000000013483be00 +Event: 0.060 Protecting memory [0x0000000172284000,0x0000000172290000] with protection modes 0 +Event: 0.080 Thread 0x0000000135808200 Thread added: 0x0000000135808200 +Event: 0.080 Protecting memory [0x0000000172490000,0x000000017249c000] with protection modes 0 + + +Dynamic libraries: +0x0000000100680000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjli.dylib +0x00000001a96bb000 /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa +0x0000000192c62000 /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit +0x0000000195cce000 /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData +0x0000000190515000 /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation +0x000000019bfdc000 /usr/lib/libSystem.B.dylib +0x0000000193f9f000 /System/Library/PrivateFrameworks/UIFoundation.framework/Versions/A/UIFoundation +0x000000022ab7f000 /System/Library/PrivateFrameworks/CollectionViewCore.framework/Versions/A/CollectionViewCore +0x00000001a3255000 /System/Library/PrivateFrameworks/RemoteViewServices.framework/Versions/A/RemoteViewServices +0x0000000199e89000 /System/Library/PrivateFrameworks/XCTTargetBootstrap.framework/Versions/A/XCTTargetBootstrap +0x000000019e618000 /System/Library/PrivateFrameworks/InternationalSupport.framework/Versions/A/InternationalSupport +0x000000019e66c000 /System/Library/PrivateFrameworks/UserActivity.framework/Versions/A/UserActivity +0x000000024efd6000 /System/Library/PrivateFrameworks/WindowManagement.framework/Versions/A/WindowManagement +0x0000000190195000 /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration +0x000000019da86000 /usr/lib/libspindump.dylib +0x0000000194154000 /System/Library/Frameworks/UniformTypeIdentifiers.framework/Versions/A/UniformTypeIdentifiers +0x0000000197d00000 /usr/lib/libapp_launch_measurement.dylib +0x0000000197126000 /System/Library/PrivateFrameworks/CoreAnalytics.framework/Versions/A/CoreAnalytics +0x0000000197d07000 /System/Library/PrivateFrameworks/CoreAutoLayout.framework/Versions/A/CoreAutoLayout +0x00000001996a9000 /System/Library/Frameworks/Metal.framework/Versions/A/Metal +0x000000019a631000 /usr/lib/liblangid.dylib +0x0000000199e8f000 /System/Library/PrivateFrameworks/CoreSVG.framework/Versions/A/CoreSVG +0x0000000194b19000 /System/Library/PrivateFrameworks/SkyLight.framework/Versions/A/SkyLight +0x0000000194fba000 /System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics +0x00000001a392f000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate +0x000000019d8e0000 /System/Library/PrivateFrameworks/IconServices.framework/Versions/A/IconServices +0x0000000199687000 /System/Library/Frameworks/IOSurface.framework/Versions/A/IOSurface +0x0000000197155000 /usr/lib/libDiagnosticMessagesClient.dylib +0x000000019bf1e000 /usr/lib/libz.1.dylib +0x00000001a70d4000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices +0x0000000199e71000 /System/Library/PrivateFrameworks/DFRFoundation.framework/Versions/A/DFRFoundation +0x00000001924bc000 /usr/lib/libicucore.A.dylib +0x000000019f676000 /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox +0x000000019e627000 /System/Library/PrivateFrameworks/DataDetectorsCore.framework/Versions/A/DataDetectorsCore +0x00000001b809a000 /System/Library/PrivateFrameworks/TextInput.framework/Versions/A/TextInput +0x0000000194a6a000 /usr/lib/libMobileGestalt.dylib +0x0000000199bad000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox +0x000000019762c000 /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore +0x00000001920e9000 /System/Library/Frameworks/Security.framework/Versions/A/Security +0x00000001a3295000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SpeechRecognition.framework/Versions/A/SpeechRecognition +0x0000000197a2e000 /System/Library/PrivateFrameworks/CoreUI.framework/Versions/A/CoreUI +0x00000001919e2000 /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio +0x0000000197239000 /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration +0x000000019dee2000 /System/Library/PrivateFrameworks/MultitouchSupport.framework/Versions/A/MultitouchSupport +0x0000000194a68000 /usr/lib/libenergytrace.dylib +0x00000001ad793000 /System/Library/PrivateFrameworks/RenderBox.framework/Versions/A/RenderBox +0x0000000192b16000 /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit +0x00000001a366a000 /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices +0x0000000197c8c000 /System/Library/PrivateFrameworks/PerformanceAnalysis.framework/Versions/A/PerformanceAnalysis +0x00000001e603f000 /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL +0x0000000197d51000 /usr/lib/libxml2.2.dylib +0x000000019b360000 /System/Library/PrivateFrameworks/MobileKeyBag.framework/Versions/A/MobileKeyBag +0x000000018ef80000 /usr/lib/libobjc.A.dylib +0x000000018f274000 /usr/lib/libc++.1.dylib +0x00000001a35e7000 /System/Library/Frameworks/Accessibility.framework/Versions/A/Accessibility +0x000000019569a000 /System/Library/Frameworks/ColorSync.framework/Versions/A/ColorSync +0x000000018f3c0000 /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation +0x000000019a1ec000 /System/Library/Frameworks/CoreImage.framework/Versions/A/CoreImage +0x00000001917ed000 /System/Library/Frameworks/CoreText.framework/Versions/A/CoreText +0x00000001ea89e000 /System/Library/Frameworks/CoreTransferable.framework/Versions/A/CoreTransferable +0x00000001ead63000 /System/Library/Frameworks/DeveloperToolsSupport.framework/Versions/A/DeveloperToolsSupport +0x0000000199eca000 /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO +0x0000000224d1f000 /System/Library/Frameworks/Symbols.framework/Versions/A/Symbols +0x000000019bfe2000 /System/Library/PrivateFrameworks/SoftLinking.framework/Versions/A/SoftLinking +0x000000019f028000 /usr/lib/swift/libswiftCore.dylib +0x00000001b4d27000 /usr/lib/swift/libswiftCoreFoundation.dylib +0x00000001b2790000 /usr/lib/swift/libswiftCoreGraphics.dylib +0x00000001b4d71000 /usr/lib/swift/libswiftCoreImage.dylib +0x00000001b2797000 /usr/lib/swift/libswiftDarwin.dylib +0x00000001a4cda000 /usr/lib/swift/libswiftDispatch.dylib +0x00000001b4d72000 /usr/lib/swift/libswiftIOKit.dylib +0x00000001c07cc000 /usr/lib/swift/libswiftMetal.dylib +0x00000001cde91000 /usr/lib/swift/libswiftOSLog.dylib +0x00000001a754f000 /usr/lib/swift/libswiftObjectiveC.dylib +0x00000001c4f00000 /usr/lib/swift/libswiftQuartzCore.dylib +0x00000001c9005000 /usr/lib/swift/libswiftUniformTypeIdentifiers.dylib +0x00000001b4d39000 /usr/lib/swift/libswiftXPC.dylib +0x000000025747d000 /usr/lib/swift/libswift_Concurrency.dylib +0x00000001a7553000 /usr/lib/swift/libswiftos.dylib +0x00000001b7ffe000 /usr/lib/swift/libswiftsimd.dylib +0x000000019c191000 /usr/lib/libcompression.dylib +0x000000019e572000 /System/Library/PrivateFrameworks/TextureIO.framework/Versions/A/TextureIO +0x000000019d58c000 /usr/lib/libate.dylib +0x000000019bfd6000 /usr/lib/system/libcache.dylib +0x000000019bf90000 /usr/lib/system/libcommonCrypto.dylib +0x000000019bfbc000 /usr/lib/system/libcompiler_rt.dylib +0x000000019bfb2000 /usr/lib/system/libcopyfile.dylib +0x000000018f0c4000 /usr/lib/system/libcorecrypto.dylib +0x000000018f1aa000 /usr/lib/system/libdispatch.dylib +0x000000018f365000 /usr/lib/system/libdyld.dylib +0x000000019bfcc000 /usr/lib/system/libkeymgr.dylib +0x000000019bf68000 /usr/lib/system/libmacho.dylib +0x000000019b448000 /usr/lib/system/libquarantine.dylib +0x000000019bfc9000 /usr/lib/system/libremovefile.dylib +0x0000000194ae0000 /usr/lib/system/libsystem_asl.dylib +0x000000018f059000 /usr/lib/system/libsystem_blocks.dylib +0x000000018f1f5000 /usr/lib/system/libsystem_c.dylib +0x000000019bfc0000 /usr/lib/system/libsystem_collections.dylib +0x000000019a620000 /usr/lib/system/libsystem_configuration.dylib +0x000000019965c000 /usr/lib/system/libsystem_containermanager.dylib +0x000000019bbff000 /usr/lib/system/libsystem_coreservices.dylib +0x0000000192783000 /usr/lib/system/libsystem_darwin.dylib +0x00000002577ca000 /usr/lib/system/libsystem_darwindirectory.dylib +0x000000019bfcd000 /usr/lib/system/libsystem_dnssd.dylib +0x00000002577ce000 /usr/lib/system/libsystem_eligibility.dylib +0x000000018f1f2000 /usr/lib/system/libsystem_featureflags.dylib +0x000000018f393000 /usr/lib/system/libsystem_info.dylib +0x000000019bf2d000 /usr/lib/system/libsystem_m.dylib +0x000000018f16d000 /usr/lib/system/libsystem_malloc.dylib +0x0000000194a4d000 /usr/lib/system/libsystem_networkextension.dylib +0x0000000192bf9000 /usr/lib/system/libsystem_notify.dylib +0x000000019a625000 /usr/lib/system/libsystem_sandbox.dylib +0x00000002577d2000 /usr/lib/system/libsystem_sanitizers.dylib +0x000000019bfc5000 /usr/lib/system/libsystem_secinit.dylib +0x000000018f31d000 /usr/lib/system/libsystem_kernel.dylib +0x000000018f38b000 /usr/lib/system/libsystem_platform.dylib +0x000000018f358000 /usr/lib/system/libsystem_pthread.dylib +0x00000001964d0000 /usr/lib/system/libsystem_symptoms.dylib +0x000000018f0a9000 /usr/lib/system/libsystem_trace.dylib +0x000000019bf9e000 /usr/lib/system/libunwind.dylib +0x000000018f05e000 /usr/lib/system/libxpc.dylib +0x000000018f301000 /usr/lib/libc++abi.dylib +0x000000019bfaa000 /usr/lib/liboah.dylib +0x000000019d438000 /usr/lib/liblzma.5.dylib +0x000000019bfde000 /usr/lib/libfakelink.dylib +0x0000000194679000 /System/Library/Frameworks/CFNetwork.framework/Versions/A/CFNetwork +0x000000019c032000 /usr/lib/libarchive.2.dylib +0x00000001a1568000 /System/Library/Frameworks/Combine.framework/Versions/A/Combine +0x000000022ab93000 /System/Library/PrivateFrameworks/CollectionsInternal.framework/Versions/A/CollectionsInternal +0x0000000241543000 /System/Library/PrivateFrameworks/ReflectionInternal.framework/Versions/A/ReflectionInternal +0x0000000241ad5000 /System/Library/PrivateFrameworks/RuntimeInternal.framework/Versions/A/RuntimeInternal +0x00000002575d1000 /usr/lib/swift/libswift_StringProcessing.dylib +0x0000000192a94000 /System/Library/PrivateFrameworks/CoreServicesInternal.framework/Versions/A/CoreServicesInternal +0x000000019b46f000 /usr/lib/libbsm.0.dylib +0x000000019bf70000 /usr/lib/system/libkxld.dylib +0x0000000197cc8000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/FSEvents.framework/Versions/A/FSEvents +0x000000019278e000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore +0x000000019719e000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata +0x000000019bc05000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices +0x000000019c0bb000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit +0x0000000196451000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE +0x000000018f899000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices +0x000000019d3e1000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/DictionaryServices.framework/Versions/A/DictionaryServices +0x0000000197cd5000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SharedFileList.framework/Versions/A/SharedFileList +0x000000019c15b000 /usr/lib/libapple_nghttp2.dylib +0x00000001960c5000 /usr/lib/libsqlite3.dylib +0x00000001964d9000 /System/Library/Frameworks/Network.framework/Versions/A/Network +0x0000000255e8e000 /usr/lib/libCoreEntitlements.dylib +0x000000023c44d000 /System/Library/PrivateFrameworks/MessageSecurity.framework/Versions/A/MessageSecurity +0x00000001960ab000 /System/Library/PrivateFrameworks/ProtocolBuffer.framework/Versions/A/ProtocolBuffer +0x000000019bb2e000 /System/Library/PrivateFrameworks/AppleFSCompression.framework/Versions/A/AppleFSCompression +0x000000019b457000 /usr/lib/libcoretls.dylib +0x000000019d457000 /usr/lib/libcoretls_cfhelpers.dylib +0x000000019c18b000 /usr/lib/libpam.2.dylib +0x000000019d4c9000 /usr/lib/libxar.1.dylib +0x000000019d8b7000 /usr/lib/libheimdal-asn1.dylib +0x0000000194678000 /usr/lib/libnetwork.dylib +0x000000019bfe3000 /usr/lib/libpcap.A.dylib +0x00000001964c5000 /usr/lib/libdns_services.dylib +0x000000019a62d000 /System/Library/PrivateFrameworks/AppleSystemInfo.framework/Versions/A/AppleSystemInfo +0x000000019b155000 /System/Library/PrivateFrameworks/IOMobileFramebuffer.framework/Versions/A/IOMobileFramebuffer +0x0000000257528000 /usr/lib/swift/libswift_RegexParser.dylib +0x000000019bbf2000 /usr/lib/libbz2.1.0.dylib +0x000000019b44b000 /usr/lib/libCheckFix.dylib +0x0000000194af8000 /System/Library/PrivateFrameworks/TCC.framework/Versions/A/TCC +0x000000019a633000 /System/Library/PrivateFrameworks/CoreNLP.framework/Versions/A/CoreNLP +0x0000000197157000 /System/Library/PrivateFrameworks/MetadataUtilities.framework/Versions/A/MetadataUtilities +0x000000019b481000 /usr/lib/libmecab.dylib +0x0000000190229000 /usr/lib/libCRFSuite.dylib +0x000000019b4dd000 /usr/lib/libgermantok.dylib +0x000000019c132000 /usr/lib/libThaiTokenizer.dylib +0x0000000197242000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.framework/Versions/A/vImage +0x00000001a3641000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/vecLib +0x000000019d510000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvMisc.dylib +0x000000019b030000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvDSP.dylib +0x000000018fca0000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib +0x000000019c266000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib +0x000000019b4e0000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLinearAlgebra.dylib +0x000000019c176000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparseBLAS.dylib +0x000000019c261000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libQuadrature.dylib +0x000000019a75c000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBNNS.dylib +0x000000019012e000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparse.dylib +0x000000023ab9c000 /System/Library/PrivateFrameworks/MIL.framework/Versions/A/MIL +0x000000019c019000 /usr/lib/libiconv.2.dylib +0x000000019bf64000 /usr/lib/libcharset.1.dylib +0x0000000197ca8000 /System/Library/Frameworks/OpenDirectory.framework/Versions/A/Frameworks/CFOpenDirectory.framework/Versions/A/CFOpenDirectory +0x0000000197c98000 /System/Library/Frameworks/OpenDirectory.framework/Versions/A/OpenDirectory +0x000000019d459000 /System/Library/PrivateFrameworks/APFS.framework/Versions/A/APFS +0x000000019b387000 /System/Library/Frameworks/SecurityFoundation.framework/Versions/A/SecurityFoundation +0x000000019d4d8000 /usr/lib/libutil.dylib +0x0000000238cfd000 /System/Library/PrivateFrameworks/InstalledContentLibrary.framework/Versions/A/InstalledContentLibrary +0x0000000192ad5000 /System/Library/PrivateFrameworks/CoreServicesStore.framework/Versions/A/CoreServicesStore +0x0000000228340000 /System/Library/PrivateFrameworks/AppleMobileFileIntegrity.framework/Versions/A/AppleMobileFileIntegrity +0x00000001b4cf5000 /usr/lib/libmis.dylib +0x00000001c53e7000 /System/Library/PrivateFrameworks/MobileSystemServices.framework/Versions/A/MobileSystemServices +0x00000001e3449000 /System/Library/PrivateFrameworks/ConfigProfileHelper.framework/Versions/A/ConfigProfileHelper +0x000000019c134000 /System/Library/PrivateFrameworks/AppleSauce.framework/Versions/A/AppleSauce +0x0000000191173000 /System/Library/PrivateFrameworks/LanguageModeling.framework/Versions/A/LanguageModeling +0x000000019d4dc000 /usr/lib/libxslt.1.dylib +0x000000019c020000 /usr/lib/libcmph.dylib +0x000000019b121000 /System/Library/PrivateFrameworks/CoreEmoji.framework/Versions/A/CoreEmoji +0x000000019a756000 /System/Library/PrivateFrameworks/LinguisticData.framework/Versions/A/LinguisticData +0x000000019003c000 /System/Library/PrivateFrameworks/Lexicon.framework/Versions/A/Lexicon +0x000000019b415000 /System/Library/PrivateFrameworks/BackgroundTaskManagement.framework/Versions/A/BackgroundTaskManagement +0x0000000256078000 /usr/lib/libTLE.dylib +0x000000019dda8000 /System/Library/PrivateFrameworks/AppleJPEG.framework/Versions/A/AppleJPEG +0x000000019d89c000 /usr/lib/libexpat.1.dylib +0x000000019e3d0000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libPng.dylib +0x000000019e3fb000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib +0x000000019e4e6000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libGIF.dylib +0x000000019ddee000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJP2.dylib +0x000000019e48b000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib +0x000000019e482000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libRadiance.dylib +0x0000000199a48000 /System/Library/PrivateFrameworks/FontServices.framework/libFontParser.dylib +0x00000001963ea000 /System/Library/PrivateFrameworks/RunningBoardServices.framework/Versions/A/RunningBoardServices +0x00000001a9f95000 /System/Library/PrivateFrameworks/IOSurfaceAccelerator.framework/Versions/A/IOSurfaceAccelerator +0x000000019dede000 /System/Library/PrivateFrameworks/WatchdogClient.framework/Versions/A/WatchdogClient +0x0000000191359000 /System/Library/Frameworks/CoreDisplay.framework/Versions/A/CoreDisplay +0x00000001998ff000 /System/Library/Frameworks/CoreMedia.framework/Versions/A/CoreMedia +0x000000019969f000 /System/Library/PrivateFrameworks/IOAccelerator.framework/Versions/A/IOAccelerator +0x0000000197e3b000 /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo +0x000000019c189000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/MetalPerformanceShaders +0x000000019df21000 /System/Library/Frameworks/VideoToolbox.framework/Versions/A/VideoToolbox +0x0000000197ed7000 /System/Library/PrivateFrameworks/UserManagement.framework/Versions/A/UserManagement +0x0000000196311000 /System/Library/PrivateFrameworks/BaseBoard.framework/Versions/A/BaseBoard +0x000000019a62b000 /System/Library/PrivateFrameworks/AggregateDictionary.framework/Versions/A/AggregateDictionary +0x000000022817a000 /System/Library/PrivateFrameworks/AppleKeyStore.framework/Versions/A/AppleKeyStore +0x000000019e47d000 /System/Library/PrivateFrameworks/GPUWrangler.framework/Versions/A/GPUWrangler +0x000000019e45d000 /System/Library/PrivateFrameworks/IOPresentment.framework/Versions/A/IOPresentment +0x000000019e485000 /System/Library/PrivateFrameworks/DSExternalDisplay.framework/Versions/A/DSExternalDisplay +0x0000000234d8a000 /System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/32023/Libraries/libllvm-flatbuffers.dylib +0x00000001e6032000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCoreFSCache.dylib +0x00000002319ee000 /System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/32023/Libraries/libGPUCompilerUtils.dylib +0x000000019e4ec000 /System/Library/PrivateFrameworks/CMCaptureCore.framework/Versions/A/CMCaptureCore +0x00000001eae86000 /System/Library/Frameworks/ExtensionFoundation.framework/Versions/A/ExtensionFoundation +0x00000001a5543000 /System/Library/PrivateFrameworks/CoreTime.framework/Versions/A/CoreTime +0x000000019da70000 /System/Library/PrivateFrameworks/AppServerSupport.framework/Versions/A/AppServerSupport +0x00000001a0004000 /System/Library/PrivateFrameworks/perfdata.framework/Versions/A/perfdata +0x000000019147d000 /System/Library/PrivateFrameworks/AudioToolboxCore.framework/Versions/A/AudioToolboxCore +0x00000001998d5000 /System/Library/PrivateFrameworks/caulk.framework/Versions/A/caulk +0x000000019f872000 /usr/lib/libAudioStatistics.dylib +0x00000001b402e000 /System/Library/PrivateFrameworks/SystemPolicy.framework/Versions/A/SystemPolicy +0x000000019fb4b000 /usr/lib/libSMC.dylib +0x00000001a953d000 /System/Library/Frameworks/CoreMIDI.framework/Versions/A/CoreMIDI +0x000000019e397000 /usr/lib/libAudioToolboxUtility.dylib +0x00000001af42f000 /System/Library/PrivateFrameworks/OSAServicesClient.framework/Versions/A/OSAServicesClient +0x00000001a0012000 /usr/lib/libperfcheck.dylib +0x00000001a4ffa000 /System/Library/PrivateFrameworks/BoardServices.framework/Versions/A/BoardServices +0x000000019d784000 /System/Library/PrivateFrameworks/PlugInKit.framework/Versions/A/PlugInKit +0x000000019b379000 /System/Library/PrivateFrameworks/AssertionServices.framework/Versions/A/AssertionServices +0x00000001a864e000 /System/Library/PrivateFrameworks/ASEProcessing.framework/Versions/A/ASEProcessing +0x00000001d1318000 /System/Library/PrivateFrameworks/Symbolication.framework/Versions/A/Symbolication +0x0000000240330000 /System/Library/PrivateFrameworks/PhotosensitivityProcessing.framework/Versions/A/PhotosensitivityProcessing +0x000000019da21000 /System/Library/PrivateFrameworks/GraphVisualizer.framework/Versions/A/GraphVisualizer +0x00000001e6094000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib +0x00000001e6053000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGFXShared.dylib +0x00000001e622c000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib +0x00000001e605c000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLImage.dylib +0x00000001e6050000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCVMSPluginSupport.dylib +0x0000000256030000 /usr/lib/libRosetta.dylib +0x00000001e6039000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCoreVMClient.dylib +0x000000022fbf4000 /System/Library/PrivateFrameworks/FontServices.framework/Versions/A/FontServices +0x000000019da2d000 /System/Library/PrivateFrameworks/OTSVG.framework/Versions/A/OTSVG +0x00000001979dc000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/Resources/libFontRegistry.dylib +0x000000019da7b000 /System/Library/PrivateFrameworks/FontServices.framework/libhvf.dylib +0x000000022fbf5000 /System/Library/PrivateFrameworks/FontServices.framework/libXTFontStaticRegistryData.dylib +0x000000019a572000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSCore.framework/Versions/A/MPSCore +0x000000019ba9c000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSImage.framework/Versions/A/MPSImage +0x000000019b4f5000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSNeuralNetwork.framework/Versions/A/MPSNeuralNetwork +0x000000019b940000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSMatrix.framework/Versions/A/MPSMatrix +0x000000019b74b000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSRayIntersector.framework/Versions/A/MPSRayIntersector +0x000000019b972000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSNDArray.framework/Versions/A/MPSNDArray +0x00000001ec760000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSFunctions.framework/Versions/A/MPSFunctions +0x00000001ec745000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSBenchmarkLoop.framework/Versions/A/MPSBenchmarkLoop +0x000000018fb54000 /System/Library/PrivateFrameworks/MetalTools.framework/Versions/A/MetalTools +0x00000001b91d7000 /System/Library/PrivateFrameworks/IOAccelMemoryInfo.framework/Versions/A/IOAccelMemoryInfo +0x00000001c52e0000 /System/Library/PrivateFrameworks/kperf.framework/Versions/A/kperf +0x00000001b4d1a000 /System/Library/PrivateFrameworks/GPURawCounter.framework/Versions/A/GPURawCounter +0x00000001a5415000 /System/Library/PrivateFrameworks/CoreSymbolication.framework/Versions/A/CoreSymbolication +0x00000001b4cc6000 /System/Library/PrivateFrameworks/MallocStackLogging.framework/Versions/A/MallocStackLogging +0x000000019d626000 /System/Library/PrivateFrameworks/CrashReporterSupport.framework/Versions/A/CrashReporterSupport +0x00000001a53d0000 /System/Library/PrivateFrameworks/DebugSymbols.framework/Versions/A/DebugSymbols +0x00000001c3c47000 /System/Library/PrivateFrameworks/OSAnalytics.framework/Versions/A/OSAnalytics +0x000000024d229000 /System/Library/PrivateFrameworks/VideoToolboxParavirtualizationSupport.framework/Versions/A/VideoToolboxParavirtualizationSupport +0x000000019d850000 /System/Library/PrivateFrameworks/AppleVA.framework/Versions/A/AppleVA +0x000000019f8ba000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS +0x0000000195849000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices +0x000000019e4fa000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/PrintCore +0x000000019fca4000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/QD.framework/Versions/A/QD +0x000000019fc98000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSyncLegacy.framework/Versions/A/ColorSyncLegacy +0x000000019f88a000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis +0x000000019e4b6000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATSUI.framework/Versions/A/ATSUI +0x000000019fc2b000 /usr/lib/libcups.2.dylib +0x00000001a0020000 /System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos +0x00000001a0031000 /System/Library/Frameworks/GSS.framework/Versions/A/GSS +0x000000019f939000 /usr/lib/libresolv.9.dylib +0x000000019da8c000 /System/Library/PrivateFrameworks/Heimdal.framework/Versions/A/Heimdal +0x00000001a74bc000 /System/Library/Frameworks/Kerberos.framework/Versions/A/Libraries/libHeimdalProxy.dylib +0x00000001a008b000 /System/Library/PrivateFrameworks/CommonAuth.framework/Versions/A/CommonAuth +0x00000001e9c6c000 /System/Library/Frameworks/AVFAudio.framework/Versions/A/AVFAudio +0x00000001af47e000 /System/Library/PrivateFrameworks/AXCoreUtilities.framework/Versions/A/AXCoreUtilities +0x000000023a274000 /System/Library/PrivateFrameworks/IsolatedCoreAudioClient.framework/Versions/A/IsolatedCoreAudioClient +0x000000019f7f6000 /System/Library/PrivateFrameworks/AudioSession.framework/Versions/A/AudioSession +0x00000001a1307000 /System/Library/Frameworks/IOBluetooth.framework/Versions/A/IOBluetooth +0x000000019d95b000 /System/Library/PrivateFrameworks/MediaExperience.framework/Versions/A/MediaExperience +0x000000019f635000 /System/Library/PrivateFrameworks/AudioSession.framework/libSessionUtility.dylib +0x000000019fcb0000 /System/Library/PrivateFrameworks/AudioResourceArbitration.framework/Versions/A/AudioResourceArbitration +0x00000001a4388000 /System/Library/PrivateFrameworks/PowerLog.framework/Versions/A/PowerLog +0x00000001a42a6000 /System/Library/Frameworks/CoreBluetooth.framework/Versions/A/CoreBluetooth +0x00000001a74bd000 /System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit +0x000000019b1e2000 /System/Library/PrivateFrameworks/CoreUtils.framework/Versions/A/CoreUtils +0x000000022de3f000 /System/Library/PrivateFrameworks/CoreUtilsExtras.framework/Versions/A/CoreUtilsExtras +0x0000000238b8a000 /System/Library/PrivateFrameworks/IO80211.framework/Versions/A/IO80211 +0x00000001a4f3e000 /System/Library/PrivateFrameworks/FrontBoardServices.framework/Versions/A/FrontBoardServices +0x00000001a6a85000 /System/Library/PrivateFrameworks/BackBoardServices.framework/Versions/A/BackBoardServices +0x000000019d8c2000 /System/Library/PrivateFrameworks/IconFoundation.framework/Versions/A/IconFoundation +0x00000001a3281000 /System/Library/PrivateFrameworks/SpeechRecognitionCore.framework/Versions/A/SpeechRecognitionCore +0x00000001af49d000 /usr/lib/libAccessibility.dylib +0x00000001a397b000 /System/Library/Frameworks/MediaAccessibility.framework/Versions/A/MediaAccessibility +0x00000001d49cc000 /System/Library/Frameworks/OSLog.framework/Versions/A/OSLog +0x00000001b4c54000 /System/Library/PrivateFrameworks/LoggingSupport.framework/Versions/A/LoggingSupport +0x000000010188c000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/server/libjvm.dylib +0x0000000100220000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjimage.dylib +0x0000000100280000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjdwp.dylib +0x00000001002cc000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjava.dylib +0x000000010024c000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libinstrument.dylib +0x0000000100324000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libzip.dylib +0x0000000255d1b000 /usr/lib/i18n/libiconv_std.dylib +0x0000000255d03000 /usr/lib/i18n/libUTF8.dylib +0x0000000255d23000 /usr/lib/i18n/libmapper_none.dylib +0x00000001002fc000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libdt_socket.dylib +0x00000001005ac000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libnio.dylib +0x000000010058c000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libnet.dylib +0x000000010178c000 /Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/libsomelib.dylib +0x0000000100274000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libsyslookup.dylib + + +VM Arguments: +jvm_args: -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:60599,suspend=y,server=n -ea -Didea.test.cyclic.buffer.size=1048576 -javaagent:/Users/cristina/Library/Caches/JetBrains/IdeaIC2024.1/captureAgent/debugger-agent.jar -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 +java_command: com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit5 dev.diplomattest.somelib.Float64VecTest,testFloat64Vec +java_class_path (initial): /Users/cristina/.m2/repository/org/junit/platform/junit-platform-launcher/1.10.3/junit-platform-launcher-1.10.3.jar:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/lib/idea_rt.jar:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/plugins/junit/lib/junit5-rt.jar:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/plugins/junit/lib/junit-rt.jar:/Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/target/test-classes:/Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/target/classes:/Users/cristina/.m2/repository/net/java/dev/jna/jna/5.14.0/jna-5.14.0.jar:/Users/cristina/.m2/repository/org/junit/jupiter/junit-jupiter/5.10.3/junit-jupiter-5.10.3.jar:/Users/cristina/.m2/repository/org/junit/jupiter/junit-jupiter-api/5.10.3/junit-jupiter-api-5.10.3.jar:/Users/cristina/.m2/repository/org/opentest4j/opentest4j/1.3.0/opentest4j-1.3.0.jar:/Users/cristina/.m2/repository/org/junit/platform/junit-platform-commons/1.10.3/junit-platform-commons-1.10.3.jar:/Users/cristina/.m2/repository/org/apiguardian/apiguardian-api/1.1.2/apiguardian-api-1.1.2.jar:/Users/cristina/.m2/repository/org/junit/jupiter/junit-jupiter-params/5.10.3/junit-jupiter-params-5.10.3.jar:/Users/cristina/.m2/repository/org/junit/jupiter/junit-jupiter-engine/5.10.3/junit-jupiter-engine-5.10.3.jar:/Users/cristina/.m2/repository/org/junit/platform/junit-platform-engine/1.10.3/junit-platform-engine-1.10.3.jar:/Users/cristina/.m2/repository/org/openjdk/jmh/jmh-core/1.37/jmh-core-1.37.jar:/Users/cristina/.m2/repository/net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4.jar:/Users/cristina/.m2/repository/org/apache/commons/commons-math3/3.6.1/commons-math3-3.6.1.jar:/Users/cristina/.m2/repository/org/openjdk/jmh/jmh-generator-annprocess/1.37/jmh-generator-annprocess-1.37.jar +Launcher Type: SUN_STANDARD + +[Global flags] + intx CICompilerCount = 4 {product} {ergonomic} + uint ConcGCThreads = 2 {product} {ergonomic} + uint G1ConcRefinementThreads = 8 {product} {ergonomic} + size_t G1HeapRegionSize = 2097152 {product} {ergonomic} + size_t InitialHeapSize = 268435456 {product} {ergonomic} + size_t MarkStackSize = 4194304 {product} {ergonomic} + size_t MaxHeapSize = 4294967296 {product} {ergonomic} + size_t MaxNewSize = 2575302656 {product} {ergonomic} + size_t MinHeapDeltaBytes = 2097152 {product} {ergonomic} + size_t MinHeapSize = 8388608 {product} {ergonomic} + uintx NonNMethodCodeHeapSize = 5839564 {pd product} {ergonomic} + uintx NonProfiledCodeHeapSize = 122909338 {pd product} {ergonomic} + uintx ProfiledCodeHeapSize = 122909338 {pd product} {ergonomic} + uintx ReservedCodeCacheSize = 251658240 {pd product} {ergonomic} + bool SegmentedCodeCache = true {product} {ergonomic} + size_t SoftMaxHeapSize = 4294967296 {manageable} {ergonomic} + bool UseCompressedOops = true {product lp64_product} {ergonomic} + bool UseG1GC = true {product} {ergonomic} + bool UseNUMA = false {product} {ergonomic} + bool UseNUMAInterleaving = false {product} {ergonomic} + +Logging: +Log output configuration: + #0: stdout all=warning uptime,level,tags foldmultilines=false + #1: stderr all=off uptime,level,tags foldmultilines=false + +Environment Variables: +JAVA_HOME=/Users/cristina/Library/Java/JavaVirtualMachines/corretto-19.0.1/Contents/Home/ +PATH=/Users/cristina/bin/jextract-22/bin:/bin:/Users/cristina/.modular/pkg/packages.modular.com_mojo/bin:/Users/cristina/Downloads/dart-sdk/bin:/opt/homebrew/Cellar/llvm/15.0.6/bin:/opt/homebrew/opt/openjdk/bin:/Users/cristina/.elan/bin:/Users/cristina/bin:/Users/cristina/Library/Application Support/Coursier/bin:/Users/cristina/Library/Python/3.8/bin:/Users/cristina/.local/bin:/Users/cristina/.cargo/bin:/Users/cristina/.cargo:/opt/homebrew/bin:/Users/cristina/.fzf/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/X11/bin:/Library/Apple/usr/bin:/usr/local/go/bin:/Library/TeX/texbin:/Users/cristina/.krew/bin +SHELL=/opt/homebrew/bin/fish +LC_CTYPE=en_US.UTF-8 +TMPDIR=/var/folders/x_/9qhndrhs79j640bxvmbkddfw0000gn/T/ + +Active Locale: +LC_ALL=C/en_US.UTF-8/C/C/C/C +LC_COLLATE=C +LC_CTYPE=en_US.UTF-8 +LC_MESSAGES=C +LC_MONETARY=C +LC_NUMERIC=C +LC_TIME=C + +Signal Handlers: + SIGSEGV: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_ONSTACK|SA_RESTART|SA_SIGINFO, unblocked + SIGBUS: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, unblocked + SIGFPE: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, unblocked + SIGPIPE: javaSignalHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked + SIGXFSZ: javaSignalHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked + SIGILL: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, unblocked + SIGUSR2: SR_handler in libjvm.dylib, mask=00100000000000000000000000000000, flags=SA_RESTART|SA_SIGINFO, blocked + SIGHUP: UserHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked + SIGINT: UserHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked + SIGTERM: UserHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked + SIGQUIT: UserHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked + SIGTRAP: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, unblocked + + +Periodic native trim disabled + +--------------- S Y S T E M --------------- + +OS: +uname: Darwin 23.5.0 Darwin Kernel Version 23.5.0: Wed May 1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000 arm64 +OS uptime: 45 days 10:07 hours +rlimit (soft/hard): STACK 8176k/65520k , CORE 0k/infinity , NPROC 2666/4000 , NOFILE 10240/infinity , AS infinity/infinity , CPU infinity/infinity , DATA infinity/infinity , FSIZE infinity/infinity , MEMLOCK infinity/infinity , RSS infinity/infinity +load average: 4.26 4.45 4.49 + +CPU: total 8 (initial active 8) 0x61:0x0:0x1b588bb3:0, fp, asimd, aes, pmull, sha1, sha256, crc32, lse, sha3, sha512 +machdep.cpu.brand_string:Apple M1 Pro +hw.cachelinesize:128 +hw.l1icachesize:131072 +hw.l1dcachesize:65536 +hw.l2cachesize:4194304 + +Memory: 16k page, physical 16777216k(40864k free), swap 3145728k(1371968k free) + +vm_info: OpenJDK 64-Bit Server VM (22.0.1+8) for bsd-aarch64 JRE (22.0.1+8), built on 2024-04-16T00:00:00Z by "admin" with clang Apple LLVM 15.0.0 (clang-1500.1.0.2.5) + +END. diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/BorrowedFields.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/BorrowedFields.java index 36538a355..533d6a40b 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/BorrowedFields.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/BorrowedFields.java @@ -1,6 +1,6 @@ package dev.diplomattest.somelib; -import dev.diplomattest.somelib.ntv.somelib_h; +import dev.diplomattest.somelib.ntv.*; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; @@ -45,11 +45,17 @@ public static BorrowedFields fromBarAndStrings(Bar bar,String dstr16,String utf8 try (var arena = Arena.ofConfined()) { var returnArena = (SegmentAllocator) Arena.ofAuto(); var barNative = bar.internal; - var dstr16MemSeg = arena.allocateFrom(dstr16, StandardCharsets.UTF_16); - var dstr16Len = dstr16MemSeg.byteSize(); - var utf8StrMemSeg = arena.allocateFrom(utf8Str, StandardCharsets.UTF_8); - var utf8StrLen = utf8StrMemSeg.byteSize(); - var nativeVal = somelib_h.BorrowedFields_from_bar_and_strings(returnArena, barNative, dstr16MemSeg, dstr16Len - 1, utf8StrMemSeg, utf8StrLen - 1); + var dstr16Data= arena.allocateFrom(dstr16, StandardCharsets.UTF_16); + var dstr16Len = dstr16Data.byteSize() - 1; // allocated strings are null terminated + var dstr16View = DiplomatString16View.allocate(arena); + DiplomatString16View.len(dstr16View, dstr16Len); + DiplomatString16View.data(dstr16View, dstr16Data); + var utf8StrData= arena.allocateFrom(utf8Str, StandardCharsets.UTF_8); + var utf8StrLen = utf8StrData.byteSize() - 1; + var utf8StrView = DiplomatStringView.allocate(arena); + DiplomatStringView.len(utf8StrView, utf8StrLen); + DiplomatStringView.data(utf8StrView, utf8StrData); + var nativeVal = somelib_h.BorrowedFields_from_bar_and_strings(returnArena, barNative, dstr16View, utf8StrView); List xEdges = List.of(bar, dstr16, utf8Str); diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/BorrowedFieldsReturning.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/BorrowedFieldsReturning.java index 9bd6f6a75..e450e9f50 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/BorrowedFieldsReturning.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/BorrowedFieldsReturning.java @@ -1,6 +1,6 @@ package dev.diplomattest.somelib; -import dev.diplomattest.somelib.ntv.somelib_h; +import dev.diplomattest.somelib.ntv.*; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/BorrowedFieldsWithBounds.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/BorrowedFieldsWithBounds.java index 6e75cc85c..f2452911f 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/BorrowedFieldsWithBounds.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/BorrowedFieldsWithBounds.java @@ -1,6 +1,6 @@ package dev.diplomattest.somelib; -import dev.diplomattest.somelib.ntv.somelib_h; +import dev.diplomattest.somelib.ntv.*; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; @@ -49,11 +49,17 @@ public static BorrowedFieldsWithBounds fromFooAndStrings(Foo foo,String dstr16X, try (var arena = Arena.ofConfined()) { var returnArena = (SegmentAllocator) Arena.ofAuto(); var fooNative = foo.internal; - var dstr16XMemSeg = arena.allocateFrom(dstr16X, StandardCharsets.UTF_16); - var dstr16XLen = dstr16XMemSeg.byteSize(); - var utf8StrZMemSeg = arena.allocateFrom(utf8StrZ, StandardCharsets.UTF_8); - var utf8StrZLen = utf8StrZMemSeg.byteSize(); - var nativeVal = somelib_h.BorrowedFieldsWithBounds_from_foo_and_strings(returnArena, fooNative, dstr16XMemSeg, dstr16XLen - 1, utf8StrZMemSeg, utf8StrZLen - 1); + var dstr16XData= arena.allocateFrom(dstr16X, StandardCharsets.UTF_16); + var dstr16XLen = dstr16XData.byteSize() - 1; // allocated strings are null terminated + var dstr16XView = DiplomatString16View.allocate(arena); + DiplomatString16View.len(dstr16XView, dstr16XLen); + DiplomatString16View.data(dstr16XView, dstr16XData); + var utf8StrZData= arena.allocateFrom(utf8StrZ, StandardCharsets.UTF_8); + var utf8StrZLen = utf8StrZData.byteSize() - 1; + var utf8StrZView = DiplomatStringView.allocate(arena); + DiplomatStringView.len(utf8StrZView, utf8StrZLen); + DiplomatStringView.data(utf8StrZView, utf8StrZData); + var nativeVal = somelib_h.BorrowedFieldsWithBounds_from_foo_and_strings(returnArena, fooNative, dstr16XView, utf8StrZView); List xEdges = List.of(foo, dstr16X, utf8StrZ); List yEdges = List.of(foo, utf8StrZ); diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/CyclicStructA.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/CyclicStructA.java index bc3d54f56..27c1534c4 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/CyclicStructA.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/CyclicStructA.java @@ -1,6 +1,6 @@ package dev.diplomattest.somelib; -import dev.diplomattest.somelib.ntv.somelib_h; +import dev.diplomattest.somelib.ntv.*; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/CyclicStructB.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/CyclicStructB.java index 34feb60e8..5cb1da065 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/CyclicStructB.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/CyclicStructB.java @@ -1,6 +1,6 @@ package dev.diplomattest.somelib; -import dev.diplomattest.somelib.ntv.somelib_h; +import dev.diplomattest.somelib.ntv.*; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ErrorStruct.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ErrorStruct.java index 9f258be51..1996f9052 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ErrorStruct.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ErrorStruct.java @@ -1,6 +1,6 @@ package dev.diplomattest.somelib; -import dev.diplomattest.somelib.ntv.somelib_h; +import dev.diplomattest.somelib.ntv.*; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Float64Vec.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Float64Vec.java index 18f5d1f83..407d1cbc9 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Float64Vec.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Float64Vec.java @@ -48,8 +48,12 @@ public static Float64Vec newBool(boolean[] v) { for (int i = 0; i < vLen; i++) { vByteArray[i] = (byte) (v[i] ? 1 : 0); } - var vMemSeg = arena.allocateFrom(JAVA_BYTE, vByteArray); - var nativeVal = somelib_h.Float64Vec_new_bool(vMemSeg, vLen); + var vData = arena.allocateFrom(JAVA_BYTE, vByteArray); + var vView = DiplomatBoolView.allocate(arena); + DiplomatBoolView.len(vView, vLen); + DiplomatBoolView.data(vView, vData); + + var nativeVal = somelib_h.Float64Vec_new_bool(vView); List selfEdges = List.of(); @@ -65,8 +69,12 @@ public static Float64Vec newI16(short[] v) { try (var arena = Arena.ofConfined()) { var vLen = v.length; - var vMemSeg = arena.allocateFrom(JAVA_SHORT, v); - var nativeVal = somelib_h.Float64Vec_new_i16(vMemSeg, vLen); + var vData= arena.allocateFrom(JAVA_SHORT, v); + var vView = DiplomatI16View.allocate(arena); + DiplomatI16View.len(vView, vLen); + DiplomatI16View.data(vView, vData); + + var nativeVal = somelib_h.Float64Vec_new_i16(vView); List selfEdges = List.of(); @@ -82,8 +90,12 @@ public static Float64Vec newU16(short[] v) { try (var arena = Arena.ofConfined()) { var vLen = v.length; - var vMemSeg = arena.allocateFrom(JAVA_SHORT, v); - var nativeVal = somelib_h.Float64Vec_new_u16(vMemSeg, vLen); + var vData= arena.allocateFrom(JAVA_SHORT, v); + var vView = DiplomatU16View.allocate(arena); + DiplomatU16View.len(vView, vLen); + DiplomatU16View.data(vView, vData); + + var nativeVal = somelib_h.Float64Vec_new_u16(vView); List selfEdges = List.of(); @@ -99,8 +111,12 @@ public static Float64Vec newIsize(long[] v) { try (var arena = Arena.ofConfined()) { var vLen = v.length; - var vMemSeg = arena.allocateFrom(JAVA_LONG, v); - var nativeVal = somelib_h.Float64Vec_new_isize(vMemSeg, vLen); + var vData= arena.allocateFrom(JAVA_LONG, v); + var vView = DiplomatIsizeView.allocate(arena); + DiplomatIsizeView.len(vView, vLen); + DiplomatIsizeView.data(vView, vData); + + var nativeVal = somelib_h.Float64Vec_new_isize(vView); List selfEdges = List.of(); @@ -116,8 +132,12 @@ public static Float64Vec newUsize(long[] v) { try (var arena = Arena.ofConfined()) { var vLen = v.length; - var vMemSeg = arena.allocateFrom(JAVA_LONG, v); - var nativeVal = somelib_h.Float64Vec_new_usize(vMemSeg, vLen); + var vData= arena.allocateFrom(JAVA_LONG, v); + var vView = DiplomatUsizeView.allocate(arena); + DiplomatUsizeView.len(vView, vLen); + DiplomatUsizeView.data(vView, vData); + + var nativeVal = somelib_h.Float64Vec_new_usize(vView); List selfEdges = List.of(); @@ -133,8 +153,12 @@ public static Float64Vec newF64BeBytes(byte[] v) { try (var arena = Arena.ofConfined()) { var vLen = v.length; - var vMemSeg = arena.allocateFrom(JAVA_BYTE, v); - var nativeVal = somelib_h.Float64Vec_new_f64_be_bytes(vMemSeg, vLen); + var vData= arena.allocateFrom(JAVA_BYTE, v); + var vView = DiplomatU8View.allocate(arena); + DiplomatU8View.len(vView, vLen); + DiplomatU8View.data(vView, vData); + + var nativeVal = somelib_h.Float64Vec_new_f64_be_bytes(vView); List selfEdges = List.of(); @@ -149,8 +173,12 @@ public static Float64Vec newF64BeBytes(byte[] v) { public static Float64Vec newFromOwned(double[] v) { var vLen = v.length; - var vMemSeg = Arena.global().allocateFrom(JAVA_DOUBLE, v); - var nativeVal = somelib_h.Float64Vec_new_from_owned(vMemSeg, vLen); + var vData= Arena.global().allocateFrom(JAVA_DOUBLE, v); + var vView = DiplomatF64View.allocate(Arena.global()); + DiplomatF64View.len(vView, vLen); + DiplomatF64View.data(vView, vData); + + var nativeVal = somelib_h.Float64Vec_new_from_owned(vView); List selfEdges = List.of(); @@ -179,8 +207,12 @@ public void fillSlice(double[] v) { try (var arena = Arena.ofConfined()) { var vLen = v.length; - var vMemSeg = arena.allocateFrom(JAVA_DOUBLE, v); - somelib_h.Float64Vec_fill_slice(internal, vMemSeg, vLen); + var vData= arena.allocateFrom(JAVA_DOUBLE, v); + var vView = DiplomatF64View.allocate(arena); + DiplomatF64View.len(vView, vLen); + DiplomatF64View.data(vView, vData); + + somelib_h.Float64Vec_fill_slice(internal, vView); } } @@ -190,8 +222,12 @@ public void setValue(double[] newSlice) { try (var arena = Arena.ofConfined()) { var newSliceLen = newSlice.length; - var newSliceMemSeg = arena.allocateFrom(JAVA_DOUBLE, newSlice); - somelib_h.Float64Vec_set_value(internal, newSliceMemSeg, newSliceLen); + var newSliceData= arena.allocateFrom(JAVA_DOUBLE, newSlice); + var newSliceView = DiplomatF64View.allocate(arena); + DiplomatF64View.len(newSliceView, newSliceLen); + DiplomatF64View.data(newSliceView, newSliceData); + + somelib_h.Float64Vec_set_value(internal, newSliceView); } } diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Foo.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Foo.java index d50fab57b..0bd943b4c 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Foo.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Foo.java @@ -45,9 +45,12 @@ public void run() { public static Foo new_(String x) { try (var arena = Arena.ofConfined()) { - var xMemSeg = arena.allocateFrom(x, StandardCharsets.UTF_8); - var xLen = xMemSeg.byteSize(); - var nativeVal = somelib_h.Foo_new(xMemSeg, xLen - 1); + var xData= arena.allocateFrom(x, StandardCharsets.UTF_8); + var xLen = xData.byteSize() - 1; + var xView = DiplomatStringView.allocate(arena); + DiplomatStringView.len(xView, xLen); + DiplomatStringView.data(xView, xData); + var nativeVal = somelib_h.Foo_new(xView); List selfEdges = List.of(); @@ -63,9 +66,12 @@ public static Foo new_(String x) { public static Foo newStatic(String x) { try (var arena = Arena.ofConfined()) { - var xMemSeg = arena.allocateFrom(x, StandardCharsets.UTF_8); - var xLen = xMemSeg.byteSize(); - var nativeVal = somelib_h.Foo_new_static(xMemSeg, xLen - 1); + var xData= arena.allocateFrom(x, StandardCharsets.UTF_8); + var xLen = xData.byteSize() - 1; + var xView = DiplomatStringView.allocate(arena); + DiplomatStringView.len(xView, xLen); + DiplomatStringView.data(xView, xData); + var nativeVal = somelib_h.Foo_new_static(xView); List selfEdges = List.of(); @@ -97,9 +103,12 @@ public static Foo extractFromBounds(BorrowedFieldsWithBounds bounds,String anoth try (var arena = Arena.ofConfined()) { var boundsNative = bounds.internal; - var anotherStringMemSeg = arena.allocateFrom(anotherString, StandardCharsets.UTF_8); - var anotherStringLen = anotherStringMemSeg.byteSize(); - var nativeVal = somelib_h.Foo_extract_from_bounds(boundsNative, anotherStringMemSeg, anotherStringLen - 1); + var anotherStringData= arena.allocateFrom(anotherString, StandardCharsets.UTF_8); + var anotherStringLen = anotherStringData.byteSize() - 1; + var anotherStringView = DiplomatStringView.allocate(arena); + DiplomatStringView.len(anotherStringView, anotherStringLen); + DiplomatStringView.data(anotherStringView, anotherStringData); + var nativeVal = somelib_h.Foo_extract_from_bounds(boundsNative, anotherStringView); List selfEdges = List.of(); diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ImportedStruct.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ImportedStruct.java index 094a0e531..031748b33 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ImportedStruct.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ImportedStruct.java @@ -1,6 +1,6 @@ package dev.diplomattest.somelib; -import dev.diplomattest.somelib.ntv.somelib_h; +import dev.diplomattest.somelib.ntv.*; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Lib.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Lib.java index 0349daaeb..e7ec440cf 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Lib.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Lib.java @@ -162,8 +162,7 @@ static String readUtf16(MemorySegment segment) { var string = new String(bytes, StandardCharsets.UTF_16); return string; } - - // for parameter conversion + // for parameter conversion static MemorySegment strs16(SegmentAllocator arena, String [] strings) { var diplomatStrsData = DiplomatStringView.allocateArray(strings.length, arena); var layout = DiplomatStringView.layout(); @@ -179,7 +178,10 @@ public void accept(MemorySegment memorySegment) { i++; } }); - return diplomatStrsData; + var diplomatStrsView = DiplomatStrings16View.allocate(arena); + DiplomatStrings16View.len(diplomatStrsView, strings.length); + DiplomatStrings16View.data(diplomatStrsView, diplomatStrsData); + return diplomatStrsView; } static MemorySegment strs8(SegmentAllocator arena, String [] strings) { @@ -197,7 +199,11 @@ public void accept(MemorySegment memorySegment) { i++; } }); - return diplomatStrsData; + + var diplomatStrsView = DiplomatStringsView.allocate(arena); + DiplomatStringsView.len(diplomatStrsView, strings.length); + DiplomatStringsView.data(diplomatStrsView, diplomatStrsData); + return diplomatStrsView; } static String readUtf8FromWriteable(MemorySegment writeable) { diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyString.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyString.java index 761e8470c..2bf39cd3d 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyString.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyString.java @@ -43,9 +43,12 @@ public void run() { public static MyString new_(String v) { try (var arena = Arena.ofConfined()) { - var vMemSeg = arena.allocateFrom(v, StandardCharsets.UTF_8); - var vLen = vMemSeg.byteSize(); - var nativeVal = somelib_h.MyString_new(vMemSeg, vLen - 1); + var vData= arena.allocateFrom(v, StandardCharsets.UTF_8); + var vLen = vData.byteSize() - 1; + var vView = DiplomatStringView.allocate(arena); + DiplomatStringView.len(vView, vLen); + DiplomatStringView.data(vView, vData); + var nativeVal = somelib_h.MyString_new(vView); List selfEdges = List.of(); @@ -60,9 +63,12 @@ public static MyString new_(String v) { public static MyString newUnsafe(String v) { try (var arena = Arena.ofConfined()) { - var vMemSeg = arena.allocateFrom(v, StandardCharsets.UTF_8); - var vLen = vMemSeg.byteSize(); - var nativeVal = somelib_h.MyString_new_unsafe(vMemSeg, vLen - 1); + var vData= arena.allocateFrom(v, StandardCharsets.UTF_8); + var vLen = vData.byteSize() - 1; + var vView = DiplomatStringView.allocate(arena); + DiplomatStringView.len(vView, vLen); + DiplomatStringView.data(vView, vData); + var nativeVal = somelib_h.MyString_new_unsafe(vView); List selfEdges = List.of(); @@ -76,9 +82,12 @@ public static MyString newUnsafe(String v) { public static MyString newOwned(String v) { - var vMemSeg = Arena.global().allocateFrom(v, StandardCharsets.UTF_8); - var vLen = vMemSeg.byteSize(); - var nativeVal = somelib_h.MyString_new_owned(vMemSeg, vLen - 1); + var vData= Arena.global().allocateFrom(v, StandardCharsets.UTF_8); + var vLen = vData.byteSize() - 1; + var vView = DiplomatStringView.allocate(Arena.global()); + DiplomatStringView.len(vView, vLen); + DiplomatStringView.data(vView, vData); + var nativeVal = somelib_h.MyString_new_owned(vView); List selfEdges = List.of(); @@ -92,9 +101,9 @@ public static MyString newOwned(String v) { public static MyString newFromFirst(String [] v) { try (var arena = Arena.ofConfined()) { - var vData = SliceUtils.strs8(arena, v); + var vView = SliceUtils.strs8(arena, v); var vLen = v.length; - var nativeVal = somelib_h.MyString_new_from_first(vData, vLen); + var nativeVal = somelib_h.MyString_new_from_first(vView); List selfEdges = List.of(); @@ -109,10 +118,13 @@ public static MyString newFromFirst(String [] v) { public static String stringTransform(String foo) { try (var arena = Arena.ofConfined()) { - var fooMemSeg = arena.allocateFrom(foo, StandardCharsets.UTF_8); - var fooLen = fooMemSeg.byteSize(); + var fooData= arena.allocateFrom(foo, StandardCharsets.UTF_8); + var fooLen = fooData.byteSize() - 1; + var fooView = DiplomatStringView.allocate(arena); + DiplomatStringView.len(fooView, fooLen); + DiplomatStringView.data(fooView, fooData); var writeable = somelib_h.diplomat_buffer_write_create(0); - somelib_h.MyString_string_transform(fooMemSeg, fooLen - 1, writeable); + somelib_h.MyString_string_transform(fooView, writeable); var string = SliceUtils. readUtf8FromWriteable(writeable); somelib_h.diplomat_buffer_write_destroy(writeable); return string; @@ -124,9 +136,12 @@ public void setStr(String newStr) { try (var arena = Arena.ofConfined()) { - var newStrMemSeg = arena.allocateFrom(newStr, StandardCharsets.UTF_8); - var newStrLen = newStrMemSeg.byteSize(); - somelib_h.MyString_set_str(internal, newStrMemSeg, newStrLen - 1); + var newStrData= arena.allocateFrom(newStr, StandardCharsets.UTF_8); + var newStrLen = newStrData.byteSize() - 1; + var newStrView = DiplomatStringView.allocate(arena); + DiplomatStringView.len(newStrView, newStrLen); + DiplomatStringView.data(newStrView, newStrData); + somelib_h.MyString_set_str(internal, newStrView); } } diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyStruct.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyStruct.java index c853c264c..0bb5edeeb 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyStruct.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyStruct.java @@ -1,6 +1,6 @@ package dev.diplomattest.somelib; -import dev.diplomattest.somelib.ntv.somelib_h; +import dev.diplomattest.somelib.ntv.*; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyZst.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyZst.java index e3892baae..43354bca5 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyZst.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyZst.java @@ -1,6 +1,6 @@ package dev.diplomattest.somelib; -import dev.diplomattest.somelib.ntv.somelib_h; +import dev.diplomattest.somelib.ntv.*; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/NestedBorrowedFields.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/NestedBorrowedFields.java index adb0c4f93..e52ab798b 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/NestedBorrowedFields.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/NestedBorrowedFields.java @@ -1,6 +1,6 @@ package dev.diplomattest.somelib; -import dev.diplomattest.somelib.ntv.somelib_h; +import dev.diplomattest.somelib.ntv.*; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; @@ -50,15 +50,27 @@ public static NestedBorrowedFields fromBarAndFooAndStrings(Bar bar,Foo foo,Strin var returnArena = (SegmentAllocator) Arena.ofAuto(); var barNative = bar.internal; var fooNative = foo.internal; - var dstr16XMemSeg = arena.allocateFrom(dstr16X, StandardCharsets.UTF_16); - var dstr16XLen = dstr16XMemSeg.byteSize(); - var dstr16ZMemSeg = arena.allocateFrom(dstr16Z, StandardCharsets.UTF_16); - var dstr16ZLen = dstr16ZMemSeg.byteSize(); - var utf8StrYMemSeg = arena.allocateFrom(utf8StrY, StandardCharsets.UTF_8); - var utf8StrYLen = utf8StrYMemSeg.byteSize(); - var utf8StrZMemSeg = arena.allocateFrom(utf8StrZ, StandardCharsets.UTF_8); - var utf8StrZLen = utf8StrZMemSeg.byteSize(); - var nativeVal = somelib_h.NestedBorrowedFields_from_bar_and_foo_and_strings(returnArena, barNative, fooNative, dstr16XMemSeg, dstr16XLen - 1, dstr16ZMemSeg, dstr16ZLen - 1, utf8StrYMemSeg, utf8StrYLen - 1, utf8StrZMemSeg, utf8StrZLen - 1); + var dstr16XData= arena.allocateFrom(dstr16X, StandardCharsets.UTF_16); + var dstr16XLen = dstr16XData.byteSize() - 1; // allocated strings are null terminated + var dstr16XView = DiplomatString16View.allocate(arena); + DiplomatString16View.len(dstr16XView, dstr16XLen); + DiplomatString16View.data(dstr16XView, dstr16XData); + var dstr16ZData= arena.allocateFrom(dstr16Z, StandardCharsets.UTF_16); + var dstr16ZLen = dstr16ZData.byteSize() - 1; // allocated strings are null terminated + var dstr16ZView = DiplomatString16View.allocate(arena); + DiplomatString16View.len(dstr16ZView, dstr16ZLen); + DiplomatString16View.data(dstr16ZView, dstr16ZData); + var utf8StrYData= arena.allocateFrom(utf8StrY, StandardCharsets.UTF_8); + var utf8StrYLen = utf8StrYData.byteSize() - 1; + var utf8StrYView = DiplomatStringView.allocate(arena); + DiplomatStringView.len(utf8StrYView, utf8StrYLen); + DiplomatStringView.data(utf8StrYView, utf8StrYData); + var utf8StrZData= arena.allocateFrom(utf8StrZ, StandardCharsets.UTF_8); + var utf8StrZLen = utf8StrZData.byteSize() - 1; + var utf8StrZView = DiplomatStringView.allocate(arena); + DiplomatStringView.len(utf8StrZView, utf8StrZLen); + DiplomatStringView.data(utf8StrZView, utf8StrZData); + var nativeVal = somelib_h.NestedBorrowedFields_from_bar_and_foo_and_strings(returnArena, barNative, fooNative, dstr16XView, dstr16ZView, utf8StrYView, utf8StrZView); List xEdges = List.of(bar, dstr16X, utf8StrY); List yEdges = List.of(bar, utf8StrY); diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Opaque.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Opaque.java index e11fd4f5a..2e492379b 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Opaque.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Opaque.java @@ -56,9 +56,12 @@ public static Opaque new_() { public static Opaque fromStr(String input) { try (var arena = Arena.ofConfined()) { - var inputMemSeg = arena.allocateFrom(input, StandardCharsets.UTF_8); - var inputLen = inputMemSeg.byteSize(); - var nativeVal = somelib_h.Opaque_from_str(inputMemSeg, inputLen - 1); + var inputData= arena.allocateFrom(input, StandardCharsets.UTF_8); + var inputLen = inputData.byteSize() - 1; + var inputView = DiplomatStringView.allocate(arena); + DiplomatStringView.len(inputView, inputLen); + DiplomatStringView.data(inputView, inputData); + var nativeVal = somelib_h.Opaque_from_str(inputView); List selfEdges = List.of(); diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Utf16Wrap.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Utf16Wrap.java index e50150891..04ae8cdeb 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Utf16Wrap.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Utf16Wrap.java @@ -43,9 +43,12 @@ public void run() { public static Utf16Wrap fromUtf16(String input) { try (var arena = Arena.ofConfined()) { - var inputMemSeg = arena.allocateFrom(input, StandardCharsets.UTF_16); - var inputLen = inputMemSeg.byteSize(); - var nativeVal = somelib_h.Utf16Wrap_from_utf16(inputMemSeg, inputLen - 1); + var inputData= arena.allocateFrom(input, StandardCharsets.UTF_16); + var inputLen = inputData.byteSize() - 1; // allocated strings are null terminated + var inputView = DiplomatString16View.allocate(arena); + DiplomatString16View.len(inputView, inputLen); + DiplomatString16View.data(inputView, inputData); + var nativeVal = somelib_h.Utf16Wrap_from_utf16(inputView); List selfEdges = List.of(); diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java index 1ca5246c6..e75401985 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java @@ -213,6 +213,168 @@ public static int _DARWIN_FEATURE_UNIX_CONFORMANCE() { public static int __has_ptrcheck() { return __has_ptrcheck; } + private static final int true_ = (int)1L; + /** + * {@snippet lang=c : + * #define true 1 + * } + */ + public static int true_() { + return true_; + } + private static final int false_ = (int)0L; + /** + * {@snippet lang=c : + * #define false 0 + * } + */ + public static int false_() { + return false_; + } + private static final int __bool_true_false_are_defined = (int)1L; + /** + * {@snippet lang=c : + * #define __bool_true_false_are_defined 1 + * } + */ + public static int __bool_true_false_are_defined() { + return __bool_true_false_are_defined; + } + private static final int __WORDSIZE = (int)64L; + /** + * {@snippet lang=c : + * #define __WORDSIZE 64 + * } + */ + public static int __WORDSIZE() { + return __WORDSIZE; + } + private static final int __PTHREAD_SIZE__ = (int)8176L; + /** + * {@snippet lang=c : + * #define __PTHREAD_SIZE__ 8176 + * } + */ + public static int __PTHREAD_SIZE__() { + return __PTHREAD_SIZE__; + } + private static final int __PTHREAD_ATTR_SIZE__ = (int)56L; + /** + * {@snippet lang=c : + * #define __PTHREAD_ATTR_SIZE__ 56 + * } + */ + public static int __PTHREAD_ATTR_SIZE__() { + return __PTHREAD_ATTR_SIZE__; + } + private static final int __PTHREAD_MUTEXATTR_SIZE__ = (int)8L; + /** + * {@snippet lang=c : + * #define __PTHREAD_MUTEXATTR_SIZE__ 8 + * } + */ + public static int __PTHREAD_MUTEXATTR_SIZE__() { + return __PTHREAD_MUTEXATTR_SIZE__; + } + private static final int __PTHREAD_MUTEX_SIZE__ = (int)56L; + /** + * {@snippet lang=c : + * #define __PTHREAD_MUTEX_SIZE__ 56 + * } + */ + public static int __PTHREAD_MUTEX_SIZE__() { + return __PTHREAD_MUTEX_SIZE__; + } + private static final int __PTHREAD_CONDATTR_SIZE__ = (int)8L; + /** + * {@snippet lang=c : + * #define __PTHREAD_CONDATTR_SIZE__ 8 + * } + */ + public static int __PTHREAD_CONDATTR_SIZE__() { + return __PTHREAD_CONDATTR_SIZE__; + } + private static final int __PTHREAD_COND_SIZE__ = (int)40L; + /** + * {@snippet lang=c : + * #define __PTHREAD_COND_SIZE__ 40 + * } + */ + public static int __PTHREAD_COND_SIZE__() { + return __PTHREAD_COND_SIZE__; + } + private static final int __PTHREAD_ONCE_SIZE__ = (int)8L; + /** + * {@snippet lang=c : + * #define __PTHREAD_ONCE_SIZE__ 8 + * } + */ + public static int __PTHREAD_ONCE_SIZE__() { + return __PTHREAD_ONCE_SIZE__; + } + private static final int __PTHREAD_RWLOCK_SIZE__ = (int)192L; + /** + * {@snippet lang=c : + * #define __PTHREAD_RWLOCK_SIZE__ 192 + * } + */ + public static int __PTHREAD_RWLOCK_SIZE__() { + return __PTHREAD_RWLOCK_SIZE__; + } + private static final int __PTHREAD_RWLOCKATTR_SIZE__ = (int)16L; + /** + * {@snippet lang=c : + * #define __PTHREAD_RWLOCKATTR_SIZE__ 16 + * } + */ + public static int __PTHREAD_RWLOCKATTR_SIZE__() { + return __PTHREAD_RWLOCKATTR_SIZE__; + } + private static final int INT8_MAX = (int)127L; + /** + * {@snippet lang=c : + * #define INT8_MAX 127 + * } + */ + public static int INT8_MAX() { + return INT8_MAX; + } + private static final int INT16_MAX = (int)32767L; + /** + * {@snippet lang=c : + * #define INT16_MAX 32767 + * } + */ + public static int INT16_MAX() { + return INT16_MAX; + } + private static final int INT32_MAX = (int)2147483647L; + /** + * {@snippet lang=c : + * #define INT32_MAX 2147483647 + * } + */ + public static int INT32_MAX() { + return INT32_MAX; + } + private static final int UINT8_MAX = (int)255L; + /** + * {@snippet lang=c : + * #define UINT8_MAX 255 + * } + */ + public static int UINT8_MAX() { + return UINT8_MAX; + } + private static final int UINT16_MAX = (int)65535L; + /** + * {@snippet lang=c : + * #define UINT16_MAX 65535 + * } + */ + public static int UINT16_MAX() { + return UINT16_MAX; + } private static final int __API_TO_BE_DEPRECATED = (int)100000L; /** * {@snippet lang=c : @@ -2787,87 +2949,6 @@ public static int __VISIONOS_1_2() { public static int __ENABLE_LEGACY_MAC_AVAILABILITY() { return __ENABLE_LEGACY_MAC_AVAILABILITY; } - private static final int __PTHREAD_SIZE__ = (int)8176L; - /** - * {@snippet lang=c : - * #define __PTHREAD_SIZE__ 8176 - * } - */ - public static int __PTHREAD_SIZE__() { - return __PTHREAD_SIZE__; - } - private static final int __PTHREAD_ATTR_SIZE__ = (int)56L; - /** - * {@snippet lang=c : - * #define __PTHREAD_ATTR_SIZE__ 56 - * } - */ - public static int __PTHREAD_ATTR_SIZE__() { - return __PTHREAD_ATTR_SIZE__; - } - private static final int __PTHREAD_MUTEXATTR_SIZE__ = (int)8L; - /** - * {@snippet lang=c : - * #define __PTHREAD_MUTEXATTR_SIZE__ 8 - * } - */ - public static int __PTHREAD_MUTEXATTR_SIZE__() { - return __PTHREAD_MUTEXATTR_SIZE__; - } - private static final int __PTHREAD_MUTEX_SIZE__ = (int)56L; - /** - * {@snippet lang=c : - * #define __PTHREAD_MUTEX_SIZE__ 56 - * } - */ - public static int __PTHREAD_MUTEX_SIZE__() { - return __PTHREAD_MUTEX_SIZE__; - } - private static final int __PTHREAD_CONDATTR_SIZE__ = (int)8L; - /** - * {@snippet lang=c : - * #define __PTHREAD_CONDATTR_SIZE__ 8 - * } - */ - public static int __PTHREAD_CONDATTR_SIZE__() { - return __PTHREAD_CONDATTR_SIZE__; - } - private static final int __PTHREAD_COND_SIZE__ = (int)40L; - /** - * {@snippet lang=c : - * #define __PTHREAD_COND_SIZE__ 40 - * } - */ - public static int __PTHREAD_COND_SIZE__() { - return __PTHREAD_COND_SIZE__; - } - private static final int __PTHREAD_ONCE_SIZE__ = (int)8L; - /** - * {@snippet lang=c : - * #define __PTHREAD_ONCE_SIZE__ 8 - * } - */ - public static int __PTHREAD_ONCE_SIZE__() { - return __PTHREAD_ONCE_SIZE__; - } - private static final int __PTHREAD_RWLOCK_SIZE__ = (int)192L; - /** - * {@snippet lang=c : - * #define __PTHREAD_RWLOCK_SIZE__ 192 - * } - */ - public static int __PTHREAD_RWLOCK_SIZE__() { - return __PTHREAD_RWLOCK_SIZE__; - } - private static final int __PTHREAD_RWLOCKATTR_SIZE__ = (int)16L; - /** - * {@snippet lang=c : - * #define __PTHREAD_RWLOCKATTR_SIZE__ 16 - * } - */ - public static int __PTHREAD_RWLOCKATTR_SIZE__() { - return __PTHREAD_RWLOCKATTR_SIZE__; - } private static final int _FORTIFY_SOURCE = (int)2L; /** * {@snippet lang=c : @@ -3201,87 +3282,234 @@ public static int L_ctermid() { public static int _USE_FORTIFY_LEVEL() { return _USE_FORTIFY_LEVEL; } - private static final int __WORDSIZE = (int)64L; - /** - * {@snippet lang=c : - * #define __WORDSIZE 64 - * } - */ - public static int __WORDSIZE() { - return __WORDSIZE; - } - private static final int INT8_MAX = (int)127L; - /** - * {@snippet lang=c : - * #define INT8_MAX 127 + + private static class __assert_rtn { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("__assert_rtn"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void __assert_rtn(const char *, const char *, int, const char *) * } */ - public static int INT8_MAX() { - return INT8_MAX; + public static FunctionDescriptor __assert_rtn$descriptor() { + return __assert_rtn.DESC; } - private static final int INT16_MAX = (int)32767L; + /** + * Downcall method handle for: * {@snippet lang=c : - * #define INT16_MAX 32767 + * void __assert_rtn(const char *, const char *, int, const char *) * } */ - public static int INT16_MAX() { - return INT16_MAX; + public static MethodHandle __assert_rtn$handle() { + return __assert_rtn.HANDLE; } - private static final int INT32_MAX = (int)2147483647L; + /** + * Address for: * {@snippet lang=c : - * #define INT32_MAX 2147483647 + * void __assert_rtn(const char *, const char *, int, const char *) * } */ - public static int INT32_MAX() { - return INT32_MAX; + public static MemorySegment __assert_rtn$address() { + return __assert_rtn.ADDR; } - private static final int UINT8_MAX = (int)255L; + /** * {@snippet lang=c : - * #define UINT8_MAX 255 + * void __assert_rtn(const char *, const char *, int, const char *) * } */ - public static int UINT8_MAX() { - return UINT8_MAX; + public static void __assert_rtn(MemorySegment x0, MemorySegment x1, int x2, MemorySegment x3) { + var mh$ = __assert_rtn.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("__assert_rtn", x0, x1, x2, x3); + } + mh$.invokeExact(x0, x1, x2, x3); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } } - private static final int UINT16_MAX = (int)65535L; /** * {@snippet lang=c : - * #define UINT16_MAX 65535 + * typedef long ptrdiff_t * } */ - public static int UINT16_MAX() { - return UINT16_MAX; - } - private static final int true_ = (int)1L; + public static final OfLong ptrdiff_t = somelib_h.C_LONG; /** * {@snippet lang=c : - * #define true 1 + * typedef unsigned long size_t * } */ - public static int true_() { - return true_; - } - private static final int false_ = (int)0L; + public static final OfLong size_t = somelib_h.C_LONG; /** * {@snippet lang=c : - * #define false 0 + * typedef unsigned long rsize_t * } */ - public static int false_() { - return false_; - } - private static final int __bool_true_false_are_defined = (int)1L; + public static final OfLong rsize_t = somelib_h.C_LONG; /** * {@snippet lang=c : - * #define __bool_true_false_are_defined 1 + * typedef int wchar_t * } */ - public static int __bool_true_false_are_defined() { - return __bool_true_false_are_defined; - } + public static final OfInt wchar_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef signed char int8_t + * } + */ + public static final OfByte int8_t = somelib_h.C_CHAR; + /** + * {@snippet lang=c : + * typedef short int16_t + * } + */ + public static final OfShort int16_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef int int32_t + * } + */ + public static final OfInt int32_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef long long int64_t + * } + */ + public static final OfLong int64_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef unsigned char uint8_t + * } + */ + public static final OfByte uint8_t = somelib_h.C_CHAR; + /** + * {@snippet lang=c : + * typedef unsigned short uint16_t + * } + */ + public static final OfShort uint16_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef unsigned int uint32_t + * } + */ + public static final OfInt uint32_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef unsigned long long uint64_t + * } + */ + public static final OfLong uint64_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef int8_t int_least8_t + * } + */ + public static final OfByte int_least8_t = somelib_h.C_CHAR; + /** + * {@snippet lang=c : + * typedef int16_t int_least16_t + * } + */ + public static final OfShort int_least16_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef int32_t int_least32_t + * } + */ + public static final OfInt int_least32_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef int64_t int_least64_t + * } + */ + public static final OfLong int_least64_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef uint8_t uint_least8_t + * } + */ + public static final OfByte uint_least8_t = somelib_h.C_CHAR; + /** + * {@snippet lang=c : + * typedef uint16_t uint_least16_t + * } + */ + public static final OfShort uint_least16_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef uint32_t uint_least32_t + * } + */ + public static final OfInt uint_least32_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef uint64_t uint_least64_t + * } + */ + public static final OfLong uint_least64_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef int8_t int_fast8_t + * } + */ + public static final OfByte int_fast8_t = somelib_h.C_CHAR; + /** + * {@snippet lang=c : + * typedef int16_t int_fast16_t + * } + */ + public static final OfShort int_fast16_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef int32_t int_fast32_t + * } + */ + public static final OfInt int_fast32_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef int64_t int_fast64_t + * } + */ + public static final OfLong int_fast64_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef uint8_t uint_fast8_t + * } + */ + public static final OfByte uint_fast8_t = somelib_h.C_CHAR; + /** + * {@snippet lang=c : + * typedef uint16_t uint_fast16_t + * } + */ + public static final OfShort uint_fast16_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef uint32_t uint_fast32_t + * } + */ + public static final OfInt uint_fast32_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef uint64_t uint_fast64_t + * } + */ + public static final OfLong uint_fast64_t = somelib_h.C_LONG_LONG; /** * {@snippet lang=c : * typedef signed char __int8_t @@ -3534,159 +3762,186 @@ public static int __bool_true_false_are_defined() { public static final AddressLayout __darwin_pthread_t = somelib_h.C_POINTER; /** * {@snippet lang=c : - * typedef int __darwin_nl_item + * typedef unsigned char u_int8_t * } */ - public static final OfInt __darwin_nl_item = somelib_h.C_INT; + public static final OfByte u_int8_t = somelib_h.C_CHAR; /** * {@snippet lang=c : - * typedef int __darwin_wctrans_t + * typedef unsigned short u_int16_t * } */ - public static final OfInt __darwin_wctrans_t = somelib_h.C_INT; + public static final OfShort u_int16_t = somelib_h.C_SHORT; /** * {@snippet lang=c : - * typedef __uint32_t __darwin_wctype_t + * typedef unsigned int u_int32_t * } */ - public static final OfInt __darwin_wctype_t = somelib_h.C_INT; + public static final OfInt u_int32_t = somelib_h.C_INT; /** * {@snippet lang=c : - * typedef signed char int8_t + * typedef unsigned long long u_int64_t * } */ - public static final OfByte int8_t = somelib_h.C_CHAR; + public static final OfLong u_int64_t = somelib_h.C_LONG_LONG; /** * {@snippet lang=c : - * typedef short int16_t + * typedef int64_t register_t * } */ - public static final OfShort int16_t = somelib_h.C_SHORT; + public static final OfLong register_t = somelib_h.C_LONG_LONG; /** * {@snippet lang=c : - * typedef int int32_t + * typedef unsigned long uintptr_t * } */ - public static final OfInt int32_t = somelib_h.C_INT; + public static final OfLong uintptr_t = somelib_h.C_LONG; /** * {@snippet lang=c : - * typedef long long int64_t + * typedef u_int64_t user_addr_t * } */ - public static final OfLong int64_t = somelib_h.C_LONG_LONG; + public static final OfLong user_addr_t = somelib_h.C_LONG_LONG; /** * {@snippet lang=c : - * typedef unsigned char u_int8_t - * } - */ - public static final OfByte u_int8_t = somelib_h.C_CHAR; - /** - * {@snippet lang=c : - * typedef unsigned short u_int16_t + * typedef u_int64_t user_size_t * } */ - public static final OfShort u_int16_t = somelib_h.C_SHORT; + public static final OfLong user_size_t = somelib_h.C_LONG_LONG; /** * {@snippet lang=c : - * typedef unsigned int u_int32_t + * typedef int64_t user_ssize_t * } */ - public static final OfInt u_int32_t = somelib_h.C_INT; + public static final OfLong user_ssize_t = somelib_h.C_LONG_LONG; /** * {@snippet lang=c : - * typedef unsigned long long u_int64_t + * typedef int64_t user_long_t * } */ - public static final OfLong u_int64_t = somelib_h.C_LONG_LONG; + public static final OfLong user_long_t = somelib_h.C_LONG_LONG; /** * {@snippet lang=c : - * typedef int64_t register_t + * typedef u_int64_t user_ulong_t * } */ - public static final OfLong register_t = somelib_h.C_LONG_LONG; + public static final OfLong user_ulong_t = somelib_h.C_LONG_LONG; /** * {@snippet lang=c : - * typedef __darwin_intptr_t intptr_t + * typedef int64_t user_time_t * } */ - public static final OfLong intptr_t = somelib_h.C_LONG; + public static final OfLong user_time_t = somelib_h.C_LONG_LONG; /** * {@snippet lang=c : - * typedef unsigned long uintptr_t + * typedef int64_t user_off_t * } */ - public static final OfLong uintptr_t = somelib_h.C_LONG; + public static final OfLong user_off_t = somelib_h.C_LONG_LONG; /** * {@snippet lang=c : - * typedef u_int64_t user_addr_t + * typedef u_int64_t syscall_arg_t * } */ - public static final OfLong user_addr_t = somelib_h.C_LONG_LONG; + public static final OfLong syscall_arg_t = somelib_h.C_LONG_LONG; /** * {@snippet lang=c : - * typedef u_int64_t user_size_t + * typedef __darwin_intptr_t intptr_t * } */ - public static final OfLong user_size_t = somelib_h.C_LONG_LONG; + public static final OfLong intptr_t = somelib_h.C_LONG; /** * {@snippet lang=c : - * typedef int64_t user_ssize_t + * typedef long intmax_t * } */ - public static final OfLong user_ssize_t = somelib_h.C_LONG_LONG; + public static final OfLong intmax_t = somelib_h.C_LONG; /** * {@snippet lang=c : - * typedef int64_t user_long_t + * typedef unsigned long uintmax_t * } */ - public static final OfLong user_long_t = somelib_h.C_LONG_LONG; + public static final OfLong uintmax_t = somelib_h.C_LONG; /** * {@snippet lang=c : - * typedef u_int64_t user_ulong_t + * typedef uint_least16_t char16_t * } */ - public static final OfLong user_ulong_t = somelib_h.C_LONG_LONG; + public static final OfShort char16_t = somelib_h.C_SHORT; /** * {@snippet lang=c : - * typedef int64_t user_time_t + * typedef uint_least32_t char32_t * } */ - public static final OfLong user_time_t = somelib_h.C_LONG_LONG; + public static final OfInt char32_t = somelib_h.C_INT; + + private static class diplomat_is_str { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_BOOL, + somelib_h.C_POINTER, + somelib_h.C_LONG + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_is_str"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + /** + * Function descriptor for: * {@snippet lang=c : - * typedef int64_t user_off_t + * bool diplomat_is_str(const char *buf, size_t len) * } */ - public static final OfLong user_off_t = somelib_h.C_LONG_LONG; + public static FunctionDescriptor diplomat_is_str$descriptor() { + return diplomat_is_str.DESC; + } + /** + * Downcall method handle for: * {@snippet lang=c : - * typedef u_int64_t syscall_arg_t + * bool diplomat_is_str(const char *buf, size_t len) * } */ - public static final OfLong syscall_arg_t = somelib_h.C_LONG_LONG; + public static MethodHandle diplomat_is_str$handle() { + return diplomat_is_str.HANDLE; + } + /** + * Address for: * {@snippet lang=c : - * typedef __darwin_va_list va_list + * bool diplomat_is_str(const char *buf, size_t len) * } */ - public static final AddressLayout va_list = somelib_h.C_POINTER; + public static MemorySegment diplomat_is_str$address() { + return diplomat_is_str.ADDR; + } + /** * {@snippet lang=c : - * typedef __darwin_size_t size_t + * bool diplomat_is_str(const char *buf, size_t len) * } */ - public static final OfLong size_t = somelib_h.C_LONG; + public static boolean diplomat_is_str(MemorySegment buf, long len) { + var mh$ = diplomat_is_str.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("diplomat_is_str", buf, len); + } + return (boolean)mh$.invokeExact(buf, len); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } - private static class renameat { + private static class diplomat_simple_write { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_INT, + DiplomatWrite.layout(), somelib_h.C_POINTER, - somelib_h.C_INT, - somelib_h.C_POINTER + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("renameat"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_simple_write"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -3694,59 +3949,57 @@ private static class renameat { /** * Function descriptor for: * {@snippet lang=c : - * int renameat(int, const char *, int, const char *) + * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) * } */ - public static FunctionDescriptor renameat$descriptor() { - return renameat.DESC; + public static FunctionDescriptor diplomat_simple_write$descriptor() { + return diplomat_simple_write.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int renameat(int, const char *, int, const char *) + * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) * } */ - public static MethodHandle renameat$handle() { - return renameat.HANDLE; + public static MethodHandle diplomat_simple_write$handle() { + return diplomat_simple_write.HANDLE; } /** * Address for: * {@snippet lang=c : - * int renameat(int, const char *, int, const char *) + * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) * } */ - public static MemorySegment renameat$address() { - return renameat.ADDR; + public static MemorySegment diplomat_simple_write$address() { + return diplomat_simple_write.ADDR; } /** * {@snippet lang=c : - * int renameat(int, const char *, int, const char *) + * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) * } */ - public static int renameat(int x0, MemorySegment x1, int x2, MemorySegment x3) { - var mh$ = renameat.HANDLE; + public static MemorySegment diplomat_simple_write(SegmentAllocator allocator, MemorySegment buf, long buf_size) { + var mh$ = diplomat_simple_write.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("renameat", x0, x1, x2, x3); + traceDowncall("diplomat_simple_write", allocator, buf, buf_size); } - return (int)mh$.invokeExact(x0, x1, x2, x3); + return (MemorySegment)mh$.invokeExact(allocator, buf, buf_size); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class renamex_np { + private static class diplomat_buffer_write_create { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_INT + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("renamex_np"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_create"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -3754,61 +4007,57 @@ private static class renamex_np { /** * Function descriptor for: * {@snippet lang=c : - * int renamex_np(const char *, const char *, unsigned int) + * DiplomatWrite *diplomat_buffer_write_create(size_t cap) * } */ - public static FunctionDescriptor renamex_np$descriptor() { - return renamex_np.DESC; + public static FunctionDescriptor diplomat_buffer_write_create$descriptor() { + return diplomat_buffer_write_create.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int renamex_np(const char *, const char *, unsigned int) + * DiplomatWrite *diplomat_buffer_write_create(size_t cap) * } */ - public static MethodHandle renamex_np$handle() { - return renamex_np.HANDLE; + public static MethodHandle diplomat_buffer_write_create$handle() { + return diplomat_buffer_write_create.HANDLE; } /** * Address for: * {@snippet lang=c : - * int renamex_np(const char *, const char *, unsigned int) + * DiplomatWrite *diplomat_buffer_write_create(size_t cap) * } */ - public static MemorySegment renamex_np$address() { - return renamex_np.ADDR; + public static MemorySegment diplomat_buffer_write_create$address() { + return diplomat_buffer_write_create.ADDR; } /** * {@snippet lang=c : - * int renamex_np(const char *, const char *, unsigned int) + * DiplomatWrite *diplomat_buffer_write_create(size_t cap) * } */ - public static int renamex_np(MemorySegment x0, MemorySegment x1, int x2) { - var mh$ = renamex_np.HANDLE; + public static MemorySegment diplomat_buffer_write_create(long cap) { + var mh$ = diplomat_buffer_write_create.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("renamex_np", x0, x1, x2); + traceDowncall("diplomat_buffer_write_create", cap); } - return (int)mh$.invokeExact(x0, x1, x2); + return (MemorySegment)mh$.invokeExact(cap); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class renameatx_np { + private static class diplomat_buffer_write_get_bytes { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_INT, somelib_h.C_POINTER, - somelib_h.C_INT + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("renameatx_np"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_get_bytes"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -3816,197 +4065,199 @@ private static class renameatx_np { /** * Function descriptor for: * {@snippet lang=c : - * int renameatx_np(int, const char *, int, const char *, unsigned int) + * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) * } */ - public static FunctionDescriptor renameatx_np$descriptor() { - return renameatx_np.DESC; + public static FunctionDescriptor diplomat_buffer_write_get_bytes$descriptor() { + return diplomat_buffer_write_get_bytes.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int renameatx_np(int, const char *, int, const char *, unsigned int) + * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) * } */ - public static MethodHandle renameatx_np$handle() { - return renameatx_np.HANDLE; + public static MethodHandle diplomat_buffer_write_get_bytes$handle() { + return diplomat_buffer_write_get_bytes.HANDLE; } /** * Address for: * {@snippet lang=c : - * int renameatx_np(int, const char *, int, const char *, unsigned int) + * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) * } */ - public static MemorySegment renameatx_np$address() { - return renameatx_np.ADDR; + public static MemorySegment diplomat_buffer_write_get_bytes$address() { + return diplomat_buffer_write_get_bytes.ADDR; } /** * {@snippet lang=c : - * int renameatx_np(int, const char *, int, const char *, unsigned int) + * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) * } */ - public static int renameatx_np(int x0, MemorySegment x1, int x2, MemorySegment x3, int x4) { - var mh$ = renameatx_np.HANDLE; + public static MemorySegment diplomat_buffer_write_get_bytes(MemorySegment t) { + var mh$ = diplomat_buffer_write_get_bytes.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("renameatx_np", x0, x1, x2, x3, x4); + traceDowncall("diplomat_buffer_write_get_bytes", t); } - return (int)mh$.invokeExact(x0, x1, x2, x3, x4); + return (MemorySegment)mh$.invokeExact(t); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } + + private static class diplomat_buffer_write_len { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_LONG, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_len"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + /** + * Function descriptor for: * {@snippet lang=c : - * typedef __darwin_off_t fpos_t + * size_t diplomat_buffer_write_len(DiplomatWrite *t) * } */ - public static final OfLong fpos_t = somelib_h.C_LONG_LONG; - - private static class __stdinp$constants { - public static final AddressLayout LAYOUT = somelib_h.C_POINTER; - public static final MemorySegment SEGMENT = somelib_h.findOrThrow("__stdinp").reinterpret(LAYOUT.byteSize()); + public static FunctionDescriptor diplomat_buffer_write_len$descriptor() { + return diplomat_buffer_write_len.DESC; } /** - * Layout for variable: + * Downcall method handle for: * {@snippet lang=c : - * extern FILE *__stdinp + * size_t diplomat_buffer_write_len(DiplomatWrite *t) * } */ - public static AddressLayout __stdinp$layout() { - return __stdinp$constants.LAYOUT; + public static MethodHandle diplomat_buffer_write_len$handle() { + return diplomat_buffer_write_len.HANDLE; } /** - * Segment for variable: + * Address for: * {@snippet lang=c : - * extern FILE *__stdinp + * size_t diplomat_buffer_write_len(DiplomatWrite *t) * } */ - public static MemorySegment __stdinp$segment() { - return __stdinp$constants.SEGMENT; + public static MemorySegment diplomat_buffer_write_len$address() { + return diplomat_buffer_write_len.ADDR; } /** - * Getter for variable: * {@snippet lang=c : - * extern FILE *__stdinp + * size_t diplomat_buffer_write_len(DiplomatWrite *t) * } */ - public static MemorySegment __stdinp() { - return __stdinp$constants.SEGMENT.get(__stdinp$constants.LAYOUT, 0L); + public static long diplomat_buffer_write_len(MemorySegment t) { + var mh$ = diplomat_buffer_write_len.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("diplomat_buffer_write_len", t); + } + return (long)mh$.invokeExact(t); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } } - /** - * Setter for variable: - * {@snippet lang=c : - * extern FILE *__stdinp - * } - */ - public static void __stdinp(MemorySegment varValue) { - __stdinp$constants.SEGMENT.set(__stdinp$constants.LAYOUT, 0L, varValue); - } + private static class diplomat_buffer_write_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); - private static class __stdoutp$constants { - public static final AddressLayout LAYOUT = somelib_h.C_POINTER; - public static final MemorySegment SEGMENT = somelib_h.findOrThrow("__stdoutp").reinterpret(LAYOUT.byteSize()); + public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_destroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } /** - * Layout for variable: + * Function descriptor for: * {@snippet lang=c : - * extern FILE *__stdoutp + * void diplomat_buffer_write_destroy(DiplomatWrite *t) * } */ - public static AddressLayout __stdoutp$layout() { - return __stdoutp$constants.LAYOUT; + public static FunctionDescriptor diplomat_buffer_write_destroy$descriptor() { + return diplomat_buffer_write_destroy.DESC; } /** - * Segment for variable: + * Downcall method handle for: * {@snippet lang=c : - * extern FILE *__stdoutp + * void diplomat_buffer_write_destroy(DiplomatWrite *t) * } */ - public static MemorySegment __stdoutp$segment() { - return __stdoutp$constants.SEGMENT; + public static MethodHandle diplomat_buffer_write_destroy$handle() { + return diplomat_buffer_write_destroy.HANDLE; } /** - * Getter for variable: + * Address for: * {@snippet lang=c : - * extern FILE *__stdoutp + * void diplomat_buffer_write_destroy(DiplomatWrite *t) * } */ - public static MemorySegment __stdoutp() { - return __stdoutp$constants.SEGMENT.get(__stdoutp$constants.LAYOUT, 0L); + public static MemorySegment diplomat_buffer_write_destroy$address() { + return diplomat_buffer_write_destroy.ADDR; } /** - * Setter for variable: * {@snippet lang=c : - * extern FILE *__stdoutp + * void diplomat_buffer_write_destroy(DiplomatWrite *t) * } */ - public static void __stdoutp(MemorySegment varValue) { - __stdoutp$constants.SEGMENT.set(__stdoutp$constants.LAYOUT, 0L, varValue); - } - - private static class __stderrp$constants { - public static final AddressLayout LAYOUT = somelib_h.C_POINTER; - public static final MemorySegment SEGMENT = somelib_h.findOrThrow("__stderrp").reinterpret(LAYOUT.byteSize()); + public static void diplomat_buffer_write_destroy(MemorySegment t) { + var mh$ = diplomat_buffer_write_destroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("diplomat_buffer_write_destroy", t); + } + mh$.invokeExact(t); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } } - /** - * Layout for variable: * {@snippet lang=c : - * extern FILE *__stderrp + * typedef int __darwin_nl_item * } */ - public static AddressLayout __stderrp$layout() { - return __stderrp$constants.LAYOUT; - } - + public static final OfInt __darwin_nl_item = somelib_h.C_INT; /** - * Segment for variable: * {@snippet lang=c : - * extern FILE *__stderrp + * typedef int __darwin_wctrans_t * } */ - public static MemorySegment __stderrp$segment() { - return __stderrp$constants.SEGMENT; - } - + public static final OfInt __darwin_wctrans_t = somelib_h.C_INT; /** - * Getter for variable: * {@snippet lang=c : - * extern FILE *__stderrp + * typedef __uint32_t __darwin_wctype_t * } */ - public static MemorySegment __stderrp() { - return __stderrp$constants.SEGMENT.get(__stderrp$constants.LAYOUT, 0L); - } - + public static final OfInt __darwin_wctype_t = somelib_h.C_INT; /** - * Setter for variable: * {@snippet lang=c : - * extern FILE *__stderrp + * typedef __darwin_va_list va_list * } */ - public static void __stderrp(MemorySegment varValue) { - __stderrp$constants.SEGMENT.set(__stderrp$constants.LAYOUT, 0L, varValue); - } + public static final AddressLayout va_list = somelib_h.C_POINTER; - private static class clearerr { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class renameat { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_INT, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("clearerr"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("renameat"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4014,57 +4265,59 @@ private static class clearerr { /** * Function descriptor for: * {@snippet lang=c : - * void clearerr(FILE *) + * int renameat(int, const char *, int, const char *) * } */ - public static FunctionDescriptor clearerr$descriptor() { - return clearerr.DESC; + public static FunctionDescriptor renameat$descriptor() { + return renameat.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void clearerr(FILE *) + * int renameat(int, const char *, int, const char *) * } */ - public static MethodHandle clearerr$handle() { - return clearerr.HANDLE; + public static MethodHandle renameat$handle() { + return renameat.HANDLE; } /** * Address for: * {@snippet lang=c : - * void clearerr(FILE *) + * int renameat(int, const char *, int, const char *) * } */ - public static MemorySegment clearerr$address() { - return clearerr.ADDR; + public static MemorySegment renameat$address() { + return renameat.ADDR; } /** * {@snippet lang=c : - * void clearerr(FILE *) + * int renameat(int, const char *, int, const char *) * } */ - public static void clearerr(MemorySegment x0) { - var mh$ = clearerr.HANDLE; + public static int renameat(int x0, MemorySegment x1, int x2, MemorySegment x3) { + var mh$ = renameat.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("clearerr", x0); + traceDowncall("renameat", x0, x1, x2, x3); } - mh$.invokeExact(x0); + return (int)mh$.invokeExact(x0, x1, x2, x3); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class fclose { + private static class renamex_np { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_INT, - somelib_h.C_POINTER + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_INT ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("fclose"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("renamex_np"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4072,57 +4325,61 @@ private static class fclose { /** * Function descriptor for: * {@snippet lang=c : - * int fclose(FILE *) + * int renamex_np(const char *, const char *, unsigned int) * } */ - public static FunctionDescriptor fclose$descriptor() { - return fclose.DESC; + public static FunctionDescriptor renamex_np$descriptor() { + return renamex_np.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int fclose(FILE *) + * int renamex_np(const char *, const char *, unsigned int) * } */ - public static MethodHandle fclose$handle() { - return fclose.HANDLE; + public static MethodHandle renamex_np$handle() { + return renamex_np.HANDLE; } /** * Address for: * {@snippet lang=c : - * int fclose(FILE *) + * int renamex_np(const char *, const char *, unsigned int) * } */ - public static MemorySegment fclose$address() { - return fclose.ADDR; + public static MemorySegment renamex_np$address() { + return renamex_np.ADDR; } /** * {@snippet lang=c : - * int fclose(FILE *) + * int renamex_np(const char *, const char *, unsigned int) * } */ - public static int fclose(MemorySegment x0) { - var mh$ = fclose.HANDLE; + public static int renamex_np(MemorySegment x0, MemorySegment x1, int x2) { + var mh$ = renamex_np.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("fclose", x0); + traceDowncall("renamex_np", x0, x1, x2); } - return (int)mh$.invokeExact(x0); + return (int)mh$.invokeExact(x0, x1, x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class feof { + private static class renameatx_np { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_INT, - somelib_h.C_POINTER + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_INT ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("feof"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("renameatx_np"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4130,173 +4387,197 @@ private static class feof { /** * Function descriptor for: * {@snippet lang=c : - * int feof(FILE *) + * int renameatx_np(int, const char *, int, const char *, unsigned int) * } */ - public static FunctionDescriptor feof$descriptor() { - return feof.DESC; + public static FunctionDescriptor renameatx_np$descriptor() { + return renameatx_np.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int feof(FILE *) + * int renameatx_np(int, const char *, int, const char *, unsigned int) * } */ - public static MethodHandle feof$handle() { - return feof.HANDLE; + public static MethodHandle renameatx_np$handle() { + return renameatx_np.HANDLE; } /** * Address for: * {@snippet lang=c : - * int feof(FILE *) + * int renameatx_np(int, const char *, int, const char *, unsigned int) * } */ - public static MemorySegment feof$address() { - return feof.ADDR; + public static MemorySegment renameatx_np$address() { + return renameatx_np.ADDR; } /** * {@snippet lang=c : - * int feof(FILE *) + * int renameatx_np(int, const char *, int, const char *, unsigned int) * } */ - public static int feof(MemorySegment x0) { - var mh$ = feof.HANDLE; + public static int renameatx_np(int x0, MemorySegment x1, int x2, MemorySegment x3, int x4) { + var mh$ = renameatx_np.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("feof", x0); + traceDowncall("renameatx_np", x0, x1, x2, x3, x4); } - return (int)mh$.invokeExact(x0); + return (int)mh$.invokeExact(x0, x1, x2, x3, x4); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } + /** + * {@snippet lang=c : + * typedef __darwin_off_t fpos_t + * } + */ + public static final OfLong fpos_t = somelib_h.C_LONG_LONG; - private static class ferror { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("ferror"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + private static class __stdinp$constants { + public static final AddressLayout LAYOUT = somelib_h.C_POINTER; + public static final MemorySegment SEGMENT = somelib_h.findOrThrow("__stdinp").reinterpret(LAYOUT.byteSize()); } /** - * Function descriptor for: + * Layout for variable: * {@snippet lang=c : - * int ferror(FILE *) + * extern FILE *__stdinp * } */ - public static FunctionDescriptor ferror$descriptor() { - return ferror.DESC; + public static AddressLayout __stdinp$layout() { + return __stdinp$constants.LAYOUT; } /** - * Downcall method handle for: + * Segment for variable: * {@snippet lang=c : - * int ferror(FILE *) + * extern FILE *__stdinp * } */ - public static MethodHandle ferror$handle() { - return ferror.HANDLE; + public static MemorySegment __stdinp$segment() { + return __stdinp$constants.SEGMENT; } /** - * Address for: + * Getter for variable: * {@snippet lang=c : - * int ferror(FILE *) + * extern FILE *__stdinp * } */ - public static MemorySegment ferror$address() { - return ferror.ADDR; + public static MemorySegment __stdinp() { + return __stdinp$constants.SEGMENT.get(__stdinp$constants.LAYOUT, 0L); } /** + * Setter for variable: * {@snippet lang=c : - * int ferror(FILE *) + * extern FILE *__stdinp * } */ - public static int ferror(MemorySegment x0) { - var mh$ = ferror.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("ferror", x0); - } - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } + public static void __stdinp(MemorySegment varValue) { + __stdinp$constants.SEGMENT.set(__stdinp$constants.LAYOUT, 0L, varValue); } - private static class fflush { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER - ); + private static class __stdoutp$constants { + public static final AddressLayout LAYOUT = somelib_h.C_POINTER; + public static final MemorySegment SEGMENT = somelib_h.findOrThrow("__stdoutp").reinterpret(LAYOUT.byteSize()); + } - public static final MemorySegment ADDR = somelib_h.findOrThrow("fflush"); + /** + * Layout for variable: + * {@snippet lang=c : + * extern FILE *__stdoutp + * } + */ + public static AddressLayout __stdoutp$layout() { + return __stdoutp$constants.LAYOUT; + } - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + /** + * Segment for variable: + * {@snippet lang=c : + * extern FILE *__stdoutp + * } + */ + public static MemorySegment __stdoutp$segment() { + return __stdoutp$constants.SEGMENT; } /** - * Function descriptor for: + * Getter for variable: * {@snippet lang=c : - * int fflush(FILE *) + * extern FILE *__stdoutp * } */ - public static FunctionDescriptor fflush$descriptor() { - return fflush.DESC; + public static MemorySegment __stdoutp() { + return __stdoutp$constants.SEGMENT.get(__stdoutp$constants.LAYOUT, 0L); } /** - * Downcall method handle for: + * Setter for variable: * {@snippet lang=c : - * int fflush(FILE *) + * extern FILE *__stdoutp * } */ - public static MethodHandle fflush$handle() { - return fflush.HANDLE; + public static void __stdoutp(MemorySegment varValue) { + __stdoutp$constants.SEGMENT.set(__stdoutp$constants.LAYOUT, 0L, varValue); + } + + private static class __stderrp$constants { + public static final AddressLayout LAYOUT = somelib_h.C_POINTER; + public static final MemorySegment SEGMENT = somelib_h.findOrThrow("__stderrp").reinterpret(LAYOUT.byteSize()); } /** - * Address for: + * Layout for variable: * {@snippet lang=c : - * int fflush(FILE *) + * extern FILE *__stderrp * } */ - public static MemorySegment fflush$address() { - return fflush.ADDR; + public static AddressLayout __stderrp$layout() { + return __stderrp$constants.LAYOUT; } /** + * Segment for variable: * {@snippet lang=c : - * int fflush(FILE *) + * extern FILE *__stderrp * } */ - public static int fflush(MemorySegment x0) { - var mh$ = fflush.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("fflush", x0); - } - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } + public static MemorySegment __stderrp$segment() { + return __stderrp$constants.SEGMENT; } - private static class fgetc { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, + /** + * Getter for variable: + * {@snippet lang=c : + * extern FILE *__stderrp + * } + */ + public static MemorySegment __stderrp() { + return __stderrp$constants.SEGMENT.get(__stderrp$constants.LAYOUT, 0L); + } + + /** + * Setter for variable: + * {@snippet lang=c : + * extern FILE *__stderrp + * } + */ + public static void __stderrp(MemorySegment varValue) { + __stderrp$constants.SEGMENT.set(__stderrp$constants.LAYOUT, 0L, varValue); + } + + private static class clearerr { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("fgetc"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("clearerr"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4304,58 +4585,57 @@ private static class fgetc { /** * Function descriptor for: * {@snippet lang=c : - * int fgetc(FILE *) + * void clearerr(FILE *) * } */ - public static FunctionDescriptor fgetc$descriptor() { - return fgetc.DESC; + public static FunctionDescriptor clearerr$descriptor() { + return clearerr.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int fgetc(FILE *) + * void clearerr(FILE *) * } */ - public static MethodHandle fgetc$handle() { - return fgetc.HANDLE; + public static MethodHandle clearerr$handle() { + return clearerr.HANDLE; } /** * Address for: * {@snippet lang=c : - * int fgetc(FILE *) + * void clearerr(FILE *) * } */ - public static MemorySegment fgetc$address() { - return fgetc.ADDR; + public static MemorySegment clearerr$address() { + return clearerr.ADDR; } /** * {@snippet lang=c : - * int fgetc(FILE *) + * void clearerr(FILE *) * } */ - public static int fgetc(MemorySegment x0) { - var mh$ = fgetc.HANDLE; + public static void clearerr(MemorySegment x0) { + var mh$ = clearerr.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("fgetc", x0); + traceDowncall("clearerr", x0); } - return (int)mh$.invokeExact(x0); + mh$.invokeExact(x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class fgetpos { + private static class fclose { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_INT, - somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("fgetpos"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fclose"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4363,59 +4643,57 @@ private static class fgetpos { /** * Function descriptor for: * {@snippet lang=c : - * int fgetpos(FILE *restrict, fpos_t *) + * int fclose(FILE *) * } */ - public static FunctionDescriptor fgetpos$descriptor() { - return fgetpos.DESC; + public static FunctionDescriptor fclose$descriptor() { + return fclose.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int fgetpos(FILE *restrict, fpos_t *) + * int fclose(FILE *) * } */ - public static MethodHandle fgetpos$handle() { - return fgetpos.HANDLE; + public static MethodHandle fclose$handle() { + return fclose.HANDLE; } /** * Address for: * {@snippet lang=c : - * int fgetpos(FILE *restrict, fpos_t *) + * int fclose(FILE *) * } */ - public static MemorySegment fgetpos$address() { - return fgetpos.ADDR; + public static MemorySegment fclose$address() { + return fclose.ADDR; } /** * {@snippet lang=c : - * int fgetpos(FILE *restrict, fpos_t *) + * int fclose(FILE *) * } */ - public static int fgetpos(MemorySegment x0, MemorySegment x1) { - var mh$ = fgetpos.HANDLE; + public static int fclose(MemorySegment x0) { + var mh$ = fclose.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("fgetpos", x0, x1); + traceDowncall("fclose", x0); } - return (int)mh$.invokeExact(x0, x1); + return (int)mh$.invokeExact(x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class fgets { + private static class feof { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, somelib_h.C_INT, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("fgets"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("feof"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4423,58 +4701,57 @@ private static class fgets { /** * Function descriptor for: * {@snippet lang=c : - * char *fgets(char *restrict, int, FILE *) + * int feof(FILE *) * } */ - public static FunctionDescriptor fgets$descriptor() { - return fgets.DESC; + public static FunctionDescriptor feof$descriptor() { + return feof.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * char *fgets(char *restrict, int, FILE *) + * int feof(FILE *) * } */ - public static MethodHandle fgets$handle() { - return fgets.HANDLE; + public static MethodHandle feof$handle() { + return feof.HANDLE; } /** * Address for: * {@snippet lang=c : - * char *fgets(char *restrict, int, FILE *) + * int feof(FILE *) * } */ - public static MemorySegment fgets$address() { - return fgets.ADDR; + public static MemorySegment feof$address() { + return feof.ADDR; } /** * {@snippet lang=c : - * char *fgets(char *restrict, int, FILE *) + * int feof(FILE *) * } */ - public static MemorySegment fgets(MemorySegment x0, int x1, MemorySegment x2) { - var mh$ = fgets.HANDLE; + public static int feof(MemorySegment x0) { + var mh$ = feof.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("fgets", x0, x1, x2); + traceDowncall("feof", x0); } - return (MemorySegment)mh$.invokeExact(x0, x1, x2); + return (int)mh$.invokeExact(x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class fopen { + private static class ferror { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, + somelib_h.C_INT, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("fopen"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("ferror"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4482,131 +4759,115 @@ private static class fopen { /** * Function descriptor for: * {@snippet lang=c : - * FILE *fopen(const char *restrict __filename, const char *restrict __mode) + * int ferror(FILE *) * } */ - public static FunctionDescriptor fopen$descriptor() { - return fopen.DESC; + public static FunctionDescriptor ferror$descriptor() { + return ferror.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * FILE *fopen(const char *restrict __filename, const char *restrict __mode) + * int ferror(FILE *) * } */ - public static MethodHandle fopen$handle() { - return fopen.HANDLE; + public static MethodHandle ferror$handle() { + return ferror.HANDLE; } /** * Address for: * {@snippet lang=c : - * FILE *fopen(const char *restrict __filename, const char *restrict __mode) + * int ferror(FILE *) * } */ - public static MemorySegment fopen$address() { - return fopen.ADDR; + public static MemorySegment ferror$address() { + return ferror.ADDR; } /** * {@snippet lang=c : - * FILE *fopen(const char *restrict __filename, const char *restrict __mode) + * int ferror(FILE *) * } */ - public static MemorySegment fopen(MemorySegment __filename, MemorySegment __mode) { - var mh$ = fopen.HANDLE; + public static int ferror(MemorySegment x0) { + var mh$ = ferror.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("fopen", __filename, __mode); + traceDowncall("ferror", x0); } - return (MemorySegment)mh$.invokeExact(__filename, __mode); + return (int)mh$.invokeExact(x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - /** - * Variadic invoker class for: - * {@snippet lang=c : - * int fprintf(FILE *restrict, const char *restrict, ...) - * } - */ - public static class fprintf { - private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("fprintf"); - - private final MethodHandle handle; - private final FunctionDescriptor descriptor; - private final MethodHandle spreader; + private static class fflush { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER + ); - private fprintf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { - this.handle = handle; - this.descriptor = descriptor; - this.spreader = spreader; - } + public static final MemorySegment ADDR = somelib_h.findOrThrow("fflush"); - /** - * Variadic invoker factory for: - * {@snippet lang=c : - * int fprintf(FILE *restrict, const char *restrict, ...) - * } - */ - public static fprintf makeInvoker(MemoryLayout... layouts) { - FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); - Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); - var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); - var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new fprintf(mh$, desc$, spreader$); - } + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } - /** - * {@return the address} - */ - public static MemorySegment address() { - return ADDR; - } + /** + * Function descriptor for: + * {@snippet lang=c : + * int fflush(FILE *) + * } + */ + public static FunctionDescriptor fflush$descriptor() { + return fflush.DESC; + } - /** - * {@return the specialized method handle} - */ - public MethodHandle handle() { - return handle; - } + /** + * Downcall method handle for: + * {@snippet lang=c : + * int fflush(FILE *) + * } + */ + public static MethodHandle fflush$handle() { + return fflush.HANDLE; + } - /** - * {@return the specialized descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } + /** + * Address for: + * {@snippet lang=c : + * int fflush(FILE *) + * } + */ + public static MemorySegment fflush$address() { + return fflush.ADDR; + } - public int apply(MemorySegment x0, MemorySegment x1, Object... x2) { - try { - if (TRACE_DOWNCALLS) { - traceDowncall("fprintf", x0, x1, x2); - } - return (int)spreader.invokeExact(x0, x1, x2); - } catch(IllegalArgumentException | ClassCastException ex$) { - throw ex$; // rethrow IAE from passing wrong number/type of args - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); + /** + * {@snippet lang=c : + * int fflush(FILE *) + * } + */ + public static int fflush(MemorySegment x0) { + var mh$ = fflush.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fflush", x0); } + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); } } - private static class fputc { + private static class fgetc { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, somelib_h.C_INT, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("fputc"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fgetc"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4614,58 +4875,58 @@ private static class fputc { /** * Function descriptor for: * {@snippet lang=c : - * int fputc(int, FILE *) + * int fgetc(FILE *) * } */ - public static FunctionDescriptor fputc$descriptor() { - return fputc.DESC; + public static FunctionDescriptor fgetc$descriptor() { + return fgetc.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int fputc(int, FILE *) + * int fgetc(FILE *) * } */ - public static MethodHandle fputc$handle() { - return fputc.HANDLE; + public static MethodHandle fgetc$handle() { + return fgetc.HANDLE; } /** * Address for: * {@snippet lang=c : - * int fputc(int, FILE *) + * int fgetc(FILE *) * } */ - public static MemorySegment fputc$address() { - return fputc.ADDR; + public static MemorySegment fgetc$address() { + return fgetc.ADDR; } /** * {@snippet lang=c : - * int fputc(int, FILE *) + * int fgetc(FILE *) * } */ - public static int fputc(int x0, MemorySegment x1) { - var mh$ = fputc.HANDLE; + public static int fgetc(MemorySegment x0) { + var mh$ = fgetc.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("fputc", x0, x1); + traceDowncall("fgetc", x0); } - return (int)mh$.invokeExact(x0, x1); + return (int)mh$.invokeExact(x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class fputs { + private static class fgetpos { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_INT, somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("fputs"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fgetpos"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4673,43 +4934,43 @@ private static class fputs { /** * Function descriptor for: * {@snippet lang=c : - * int fputs(const char *restrict, FILE *restrict) + * int fgetpos(FILE *restrict, fpos_t *) * } */ - public static FunctionDescriptor fputs$descriptor() { - return fputs.DESC; + public static FunctionDescriptor fgetpos$descriptor() { + return fgetpos.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int fputs(const char *restrict, FILE *restrict) + * int fgetpos(FILE *restrict, fpos_t *) * } */ - public static MethodHandle fputs$handle() { - return fputs.HANDLE; + public static MethodHandle fgetpos$handle() { + return fgetpos.HANDLE; } /** * Address for: * {@snippet lang=c : - * int fputs(const char *restrict, FILE *restrict) + * int fgetpos(FILE *restrict, fpos_t *) * } */ - public static MemorySegment fputs$address() { - return fputs.ADDR; + public static MemorySegment fgetpos$address() { + return fgetpos.ADDR; } /** * {@snippet lang=c : - * int fputs(const char *restrict, FILE *restrict) + * int fgetpos(FILE *restrict, fpos_t *) * } */ - public static int fputs(MemorySegment x0, MemorySegment x1) { - var mh$ = fputs.HANDLE; + public static int fgetpos(MemorySegment x0, MemorySegment x1) { + var mh$ = fgetpos.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("fputs", x0, x1); + traceDowncall("fgetpos", x0, x1); } return (int)mh$.invokeExact(x0, x1); } catch (Throwable ex$) { @@ -4717,16 +4978,15 @@ public static int fputs(MemorySegment x0, MemorySegment x1) { } } - private static class fread { + private static class fgets { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_LONG, somelib_h.C_POINTER, - somelib_h.C_LONG, - somelib_h.C_LONG, + somelib_h.C_POINTER, + somelib_h.C_INT, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("fread"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fgets"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4734,59 +4994,58 @@ private static class fread { /** * Function descriptor for: * {@snippet lang=c : - * unsigned long fread(void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) + * char *fgets(char *restrict, int, FILE *) * } */ - public static FunctionDescriptor fread$descriptor() { - return fread.DESC; + public static FunctionDescriptor fgets$descriptor() { + return fgets.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * unsigned long fread(void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) + * char *fgets(char *restrict, int, FILE *) * } */ - public static MethodHandle fread$handle() { - return fread.HANDLE; + public static MethodHandle fgets$handle() { + return fgets.HANDLE; } /** * Address for: * {@snippet lang=c : - * unsigned long fread(void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) + * char *fgets(char *restrict, int, FILE *) * } */ - public static MemorySegment fread$address() { - return fread.ADDR; + public static MemorySegment fgets$address() { + return fgets.ADDR; } /** * {@snippet lang=c : - * unsigned long fread(void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) + * char *fgets(char *restrict, int, FILE *) * } */ - public static long fread(MemorySegment __ptr, long __size, long __nitems, MemorySegment __stream) { - var mh$ = fread.HANDLE; + public static MemorySegment fgets(MemorySegment x0, int x1, MemorySegment x2) { + var mh$ = fgets.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("fread", __ptr, __size, __nitems, __stream); + traceDowncall("fgets", x0, x1, x2); } - return (long)mh$.invokeExact(__ptr, __size, __nitems, __stream); + return (MemorySegment)mh$.invokeExact(x0, x1, x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class freopen { + private static class fopen { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("freopen"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fopen"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4794,45 +5053,45 @@ private static class freopen { /** * Function descriptor for: * {@snippet lang=c : - * FILE *freopen(const char *restrict, const char *restrict, FILE *restrict) + * FILE *fopen(const char *restrict __filename, const char *restrict __mode) * } */ - public static FunctionDescriptor freopen$descriptor() { - return freopen.DESC; + public static FunctionDescriptor fopen$descriptor() { + return fopen.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * FILE *freopen(const char *restrict, const char *restrict, FILE *restrict) + * FILE *fopen(const char *restrict __filename, const char *restrict __mode) * } */ - public static MethodHandle freopen$handle() { - return freopen.HANDLE; + public static MethodHandle fopen$handle() { + return fopen.HANDLE; } /** * Address for: * {@snippet lang=c : - * FILE *freopen(const char *restrict, const char *restrict, FILE *restrict) + * FILE *fopen(const char *restrict __filename, const char *restrict __mode) * } */ - public static MemorySegment freopen$address() { - return freopen.ADDR; + public static MemorySegment fopen$address() { + return fopen.ADDR; } /** * {@snippet lang=c : - * FILE *freopen(const char *restrict, const char *restrict, FILE *restrict) + * FILE *fopen(const char *restrict __filename, const char *restrict __mode) * } */ - public static MemorySegment freopen(MemorySegment x0, MemorySegment x1, MemorySegment x2) { - var mh$ = freopen.HANDLE; + public static MemorySegment fopen(MemorySegment __filename, MemorySegment __mode) { + var mh$ = fopen.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("freopen", x0, x1, x2); + traceDowncall("fopen", __filename, __mode); } - return (MemorySegment)mh$.invokeExact(x0, x1, x2); + return (MemorySegment)mh$.invokeExact(__filename, __mode); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -4841,22 +5100,22 @@ public static MemorySegment freopen(MemorySegment x0, MemorySegment x1, MemorySe /** * Variadic invoker class for: * {@snippet lang=c : - * int fscanf(FILE *restrict, const char *restrict, ...) + * int fprintf(FILE *restrict, const char *restrict, ...) * } */ - public static class fscanf { + public static class fprintf { private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( somelib_h.C_INT, somelib_h.C_POINTER, somelib_h.C_POINTER ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("fscanf"); + private static final MemorySegment ADDR = somelib_h.findOrThrow("fprintf"); private final MethodHandle handle; private final FunctionDescriptor descriptor; private final MethodHandle spreader; - private fscanf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + private fprintf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { this.handle = handle; this.descriptor = descriptor; this.spreader = spreader; @@ -4865,15 +5124,15 @@ private fscanf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle /** * Variadic invoker factory for: * {@snippet lang=c : - * int fscanf(FILE *restrict, const char *restrict, ...) + * int fprintf(FILE *restrict, const char *restrict, ...) * } */ - public static fscanf makeInvoker(MemoryLayout... layouts) { + public static fprintf makeInvoker(MemoryLayout... layouts) { FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new fscanf(mh$, desc$, spreader$); + return new fprintf(mh$, desc$, spreader$); } /** @@ -4900,7 +5159,7 @@ public FunctionDescriptor descriptor() { public int apply(MemorySegment x0, MemorySegment x1, Object... x2) { try { if (TRACE_DOWNCALLS) { - traceDowncall("fscanf", x0, x1, x2); + traceDowncall("fprintf", x0, x1, x2); } return (int)spreader.invokeExact(x0, x1, x2); } catch(IllegalArgumentException | ClassCastException ex$) { @@ -4911,15 +5170,14 @@ public int apply(MemorySegment x0, MemorySegment x1, Object... x2) { } } - private static class fseek { + private static class fputc { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_LONG, - somelib_h.C_INT + somelib_h.C_INT, + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("fseek"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fputc"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4927,58 +5185,58 @@ private static class fseek { /** * Function descriptor for: * {@snippet lang=c : - * int fseek(FILE *, long, int) + * int fputc(int, FILE *) * } */ - public static FunctionDescriptor fseek$descriptor() { - return fseek.DESC; + public static FunctionDescriptor fputc$descriptor() { + return fputc.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int fseek(FILE *, long, int) + * int fputc(int, FILE *) * } */ - public static MethodHandle fseek$handle() { - return fseek.HANDLE; + public static MethodHandle fputc$handle() { + return fputc.HANDLE; } /** * Address for: * {@snippet lang=c : - * int fseek(FILE *, long, int) + * int fputc(int, FILE *) * } */ - public static MemorySegment fseek$address() { - return fseek.ADDR; + public static MemorySegment fputc$address() { + return fputc.ADDR; } /** * {@snippet lang=c : - * int fseek(FILE *, long, int) + * int fputc(int, FILE *) * } */ - public static int fseek(MemorySegment x0, long x1, int x2) { - var mh$ = fseek.HANDLE; + public static int fputc(int x0, MemorySegment x1) { + var mh$ = fputc.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("fseek", x0, x1, x2); + traceDowncall("fputc", x0, x1); } - return (int)mh$.invokeExact(x0, x1, x2); + return (int)mh$.invokeExact(x0, x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class fsetpos { + private static class fputs { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_INT, somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("fsetpos"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fputs"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4986,43 +5244,43 @@ private static class fsetpos { /** * Function descriptor for: * {@snippet lang=c : - * int fsetpos(FILE *, const fpos_t *) + * int fputs(const char *restrict, FILE *restrict) * } */ - public static FunctionDescriptor fsetpos$descriptor() { - return fsetpos.DESC; + public static FunctionDescriptor fputs$descriptor() { + return fputs.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int fsetpos(FILE *, const fpos_t *) + * int fputs(const char *restrict, FILE *restrict) * } */ - public static MethodHandle fsetpos$handle() { - return fsetpos.HANDLE; + public static MethodHandle fputs$handle() { + return fputs.HANDLE; } /** * Address for: * {@snippet lang=c : - * int fsetpos(FILE *, const fpos_t *) + * int fputs(const char *restrict, FILE *restrict) * } */ - public static MemorySegment fsetpos$address() { - return fsetpos.ADDR; + public static MemorySegment fputs$address() { + return fputs.ADDR; } /** * {@snippet lang=c : - * int fsetpos(FILE *, const fpos_t *) + * int fputs(const char *restrict, FILE *restrict) * } */ - public static int fsetpos(MemorySegment x0, MemorySegment x1) { - var mh$ = fsetpos.HANDLE; + public static int fputs(MemorySegment x0, MemorySegment x1) { + var mh$ = fputs.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("fsetpos", x0, x1); + traceDowncall("fputs", x0, x1); } return (int)mh$.invokeExact(x0, x1); } catch (Throwable ex$) { @@ -5030,13 +5288,16 @@ public static int fsetpos(MemorySegment x0, MemorySegment x1) { } } - private static class ftell { + private static class fread { public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_LONG, + somelib_h.C_POINTER, + somelib_h.C_LONG, somelib_h.C_LONG, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("ftell"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fread"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -5044,60 +5305,59 @@ private static class ftell { /** * Function descriptor for: * {@snippet lang=c : - * long ftell(FILE *) + * unsigned long fread(void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) * } */ - public static FunctionDescriptor ftell$descriptor() { - return ftell.DESC; + public static FunctionDescriptor fread$descriptor() { + return fread.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * long ftell(FILE *) + * unsigned long fread(void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) * } */ - public static MethodHandle ftell$handle() { - return ftell.HANDLE; + public static MethodHandle fread$handle() { + return fread.HANDLE; } /** * Address for: * {@snippet lang=c : - * long ftell(FILE *) + * unsigned long fread(void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) * } */ - public static MemorySegment ftell$address() { - return ftell.ADDR; + public static MemorySegment fread$address() { + return fread.ADDR; } /** * {@snippet lang=c : - * long ftell(FILE *) + * unsigned long fread(void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) * } */ - public static long ftell(MemorySegment x0) { - var mh$ = ftell.HANDLE; + public static long fread(MemorySegment __ptr, long __size, long __nitems, MemorySegment __stream) { + var mh$ = fread.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("ftell", x0); + traceDowncall("fread", __ptr, __size, __nitems, __stream); } - return (long)mh$.invokeExact(x0); + return (long)mh$.invokeExact(__ptr, __size, __nitems, __stream); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class fwrite { + private static class freopen { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_LONG, somelib_h.C_POINTER, - somelib_h.C_LONG, - somelib_h.C_LONG, + somelib_h.C_POINTER, + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("fwrite"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("freopen"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -5105,57 +5365,132 @@ private static class fwrite { /** * Function descriptor for: * {@snippet lang=c : - * unsigned long fwrite(const void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) + * FILE *freopen(const char *restrict, const char *restrict, FILE *restrict) * } */ - public static FunctionDescriptor fwrite$descriptor() { - return fwrite.DESC; + public static FunctionDescriptor freopen$descriptor() { + return freopen.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * unsigned long fwrite(const void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) + * FILE *freopen(const char *restrict, const char *restrict, FILE *restrict) * } */ - public static MethodHandle fwrite$handle() { - return fwrite.HANDLE; + public static MethodHandle freopen$handle() { + return freopen.HANDLE; } /** * Address for: * {@snippet lang=c : - * unsigned long fwrite(const void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) + * FILE *freopen(const char *restrict, const char *restrict, FILE *restrict) * } */ - public static MemorySegment fwrite$address() { - return fwrite.ADDR; + public static MemorySegment freopen$address() { + return freopen.ADDR; } /** * {@snippet lang=c : - * unsigned long fwrite(const void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) + * FILE *freopen(const char *restrict, const char *restrict, FILE *restrict) * } */ - public static long fwrite(MemorySegment __ptr, long __size, long __nitems, MemorySegment __stream) { - var mh$ = fwrite.HANDLE; + public static MemorySegment freopen(MemorySegment x0, MemorySegment x1, MemorySegment x2) { + var mh$ = freopen.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("fwrite", __ptr, __size, __nitems, __stream); + traceDowncall("freopen", x0, x1, x2); } - return (long)mh$.invokeExact(__ptr, __size, __nitems, __stream); + return (MemorySegment)mh$.invokeExact(x0, x1, x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class getc { + /** + * Variadic invoker class for: + * {@snippet lang=c : + * int fscanf(FILE *restrict, const char *restrict, ...) + * } + */ + public static class fscanf { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("fscanf"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private fscanf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * int fscanf(FILE *restrict, const char *restrict, ...) + * } + */ + public static fscanf makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new fscanf(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public int apply(MemorySegment x0, MemorySegment x1, Object... x2) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fscanf", x0, x1, x2); + } + return (int)spreader.invokeExact(x0, x1, x2); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static class fseek { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_INT, - somelib_h.C_POINTER + somelib_h.C_POINTER, + somelib_h.C_LONG, + somelib_h.C_INT ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("getc"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fseek"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -5163,55 +5498,58 @@ private static class getc { /** * Function descriptor for: * {@snippet lang=c : - * int getc(FILE *) + * int fseek(FILE *, long, int) * } */ - public static FunctionDescriptor getc$descriptor() { - return getc.DESC; + public static FunctionDescriptor fseek$descriptor() { + return fseek.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int getc(FILE *) + * int fseek(FILE *, long, int) * } */ - public static MethodHandle getc$handle() { - return getc.HANDLE; + public static MethodHandle fseek$handle() { + return fseek.HANDLE; } /** * Address for: * {@snippet lang=c : - * int getc(FILE *) + * int fseek(FILE *, long, int) * } */ - public static MemorySegment getc$address() { - return getc.ADDR; + public static MemorySegment fseek$address() { + return fseek.ADDR; } /** * {@snippet lang=c : - * int getc(FILE *) + * int fseek(FILE *, long, int) * } */ - public static int getc(MemorySegment x0) { - var mh$ = getc.HANDLE; + public static int fseek(MemorySegment x0, long x1, int x2) { + var mh$ = fseek.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("getc", x0); + traceDowncall("fseek", x0, x1, x2); } - return (int)mh$.invokeExact(x0); + return (int)mh$.invokeExact(x0, x1, x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class getchar { + private static class fsetpos { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT ); + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("getchar"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fsetpos"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -5219,7 +5557,240 @@ private static class getchar { /** * Function descriptor for: * {@snippet lang=c : - * int getchar() + * int fsetpos(FILE *, const fpos_t *) + * } + */ + public static FunctionDescriptor fsetpos$descriptor() { + return fsetpos.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int fsetpos(FILE *, const fpos_t *) + * } + */ + public static MethodHandle fsetpos$handle() { + return fsetpos.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int fsetpos(FILE *, const fpos_t *) + * } + */ + public static MemorySegment fsetpos$address() { + return fsetpos.ADDR; + } + + /** + * {@snippet lang=c : + * int fsetpos(FILE *, const fpos_t *) + * } + */ + public static int fsetpos(MemorySegment x0, MemorySegment x1) { + var mh$ = fsetpos.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fsetpos", x0, x1); + } + return (int)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class ftell { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_LONG, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("ftell"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * long ftell(FILE *) + * } + */ + public static FunctionDescriptor ftell$descriptor() { + return ftell.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * long ftell(FILE *) + * } + */ + public static MethodHandle ftell$handle() { + return ftell.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * long ftell(FILE *) + * } + */ + public static MemorySegment ftell$address() { + return ftell.ADDR; + } + + /** + * {@snippet lang=c : + * long ftell(FILE *) + * } + */ + public static long ftell(MemorySegment x0) { + var mh$ = ftell.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("ftell", x0); + } + return (long)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class fwrite { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_LONG, + somelib_h.C_POINTER, + somelib_h.C_LONG, + somelib_h.C_LONG, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("fwrite"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * unsigned long fwrite(const void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) + * } + */ + public static FunctionDescriptor fwrite$descriptor() { + return fwrite.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * unsigned long fwrite(const void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) + * } + */ + public static MethodHandle fwrite$handle() { + return fwrite.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * unsigned long fwrite(const void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) + * } + */ + public static MemorySegment fwrite$address() { + return fwrite.ADDR; + } + + /** + * {@snippet lang=c : + * unsigned long fwrite(const void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) + * } + */ + public static long fwrite(MemorySegment __ptr, long __size, long __nitems, MemorySegment __stream) { + var mh$ = fwrite.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fwrite", __ptr, __size, __nitems, __stream); + } + return (long)mh$.invokeExact(__ptr, __size, __nitems, __stream); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class getc { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("getc"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int getc(FILE *) + * } + */ + public static FunctionDescriptor getc$descriptor() { + return getc.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int getc(FILE *) + * } + */ + public static MethodHandle getc$handle() { + return getc.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int getc(FILE *) + * } + */ + public static MemorySegment getc$address() { + return getc.ADDR; + } + + /** + * {@snippet lang=c : + * int getc(FILE *) + * } + */ + public static int getc(MemorySegment x0) { + var mh$ = getc.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("getc", x0); + } + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class getchar { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("getchar"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int getchar() * } */ public static FunctionDescriptor getchar$descriptor() { @@ -9267,585 +9838,70 @@ public static int __vsnprintf_chk(MemorySegment x0, long x1, int x2, long x3, Me throw new AssertionError("should not reach here", ex$); } } + + private static class CyclicStructA_get_b { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + CyclicStructB.layout() ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("CyclicStructA_get_b"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + /** + * Function descriptor for: * {@snippet lang=c : - * typedef unsigned char uint8_t + * CyclicStructB CyclicStructA_get_b() * } */ - public static final OfByte uint8_t = somelib_h.C_CHAR; + public static FunctionDescriptor CyclicStructA_get_b$descriptor() { + return CyclicStructA_get_b.DESC; + } + /** + * Downcall method handle for: * {@snippet lang=c : - * typedef unsigned short uint16_t + * CyclicStructB CyclicStructA_get_b() * } */ - public static final OfShort uint16_t = somelib_h.C_SHORT; - /** - * {@snippet lang=c : - * typedef unsigned int uint32_t - * } - */ - public static final OfInt uint32_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef unsigned long long uint64_t - * } - */ - public static final OfLong uint64_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef int8_t int_least8_t - * } - */ - public static final OfByte int_least8_t = somelib_h.C_CHAR; - /** - * {@snippet lang=c : - * typedef int16_t int_least16_t - * } - */ - public static final OfShort int_least16_t = somelib_h.C_SHORT; - /** - * {@snippet lang=c : - * typedef int32_t int_least32_t - * } - */ - public static final OfInt int_least32_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef int64_t int_least64_t - * } - */ - public static final OfLong int_least64_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef uint8_t uint_least8_t - * } - */ - public static final OfByte uint_least8_t = somelib_h.C_CHAR; - /** - * {@snippet lang=c : - * typedef uint16_t uint_least16_t - * } - */ - public static final OfShort uint_least16_t = somelib_h.C_SHORT; - /** - * {@snippet lang=c : - * typedef uint32_t uint_least32_t - * } - */ - public static final OfInt uint_least32_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef uint64_t uint_least64_t - * } - */ - public static final OfLong uint_least64_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef int8_t int_fast8_t - * } - */ - public static final OfByte int_fast8_t = somelib_h.C_CHAR; - /** - * {@snippet lang=c : - * typedef int16_t int_fast16_t - * } - */ - public static final OfShort int_fast16_t = somelib_h.C_SHORT; - /** - * {@snippet lang=c : - * typedef int32_t int_fast32_t - * } - */ - public static final OfInt int_fast32_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef int64_t int_fast64_t - * } - */ - public static final OfLong int_fast64_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef uint8_t uint_fast8_t - * } - */ - public static final OfByte uint_fast8_t = somelib_h.C_CHAR; - /** - * {@snippet lang=c : - * typedef uint16_t uint_fast16_t - * } - */ - public static final OfShort uint_fast16_t = somelib_h.C_SHORT; - /** - * {@snippet lang=c : - * typedef uint32_t uint_fast32_t - * } - */ - public static final OfInt uint_fast32_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef uint64_t uint_fast64_t - * } - */ - public static final OfLong uint_fast64_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef long intmax_t - * } - */ - public static final OfLong intmax_t = somelib_h.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned long uintmax_t - * } - */ - public static final OfLong uintmax_t = somelib_h.C_LONG; - /** - * {@snippet lang=c : - * typedef long ptrdiff_t - * } - */ - public static final OfLong ptrdiff_t = somelib_h.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned long rsize_t - * } - */ - public static final OfLong rsize_t = somelib_h.C_LONG; - /** - * {@snippet lang=c : - * typedef int wchar_t - * } - */ - public static final OfInt wchar_t = somelib_h.C_INT; - - private static class __assert_rtn { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("__assert_rtn"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * void __assert_rtn(const char *, const char *, int, const char *) - * } - */ - public static FunctionDescriptor __assert_rtn$descriptor() { - return __assert_rtn.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * void __assert_rtn(const char *, const char *, int, const char *) - * } - */ - public static MethodHandle __assert_rtn$handle() { - return __assert_rtn.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * void __assert_rtn(const char *, const char *, int, const char *) - * } - */ - public static MemorySegment __assert_rtn$address() { - return __assert_rtn.ADDR; - } - - /** - * {@snippet lang=c : - * void __assert_rtn(const char *, const char *, int, const char *) - * } - */ - public static void __assert_rtn(MemorySegment x0, MemorySegment x1, int x2, MemorySegment x3) { - var mh$ = __assert_rtn.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("__assert_rtn", x0, x1, x2, x3); - } - mh$.invokeExact(x0, x1, x2, x3); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - /** - * {@snippet lang=c : - * typedef uint_least16_t char16_t - * } - */ - public static final OfShort char16_t = somelib_h.C_SHORT; - /** - * {@snippet lang=c : - * typedef uint_least32_t char32_t - * } - */ - public static final OfInt char32_t = somelib_h.C_INT; - - private static class diplomat_is_str { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_BOOL, - somelib_h.C_POINTER, - somelib_h.C_LONG - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_is_str"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * bool diplomat_is_str(const char *buf, size_t len) - * } - */ - public static FunctionDescriptor diplomat_is_str$descriptor() { - return diplomat_is_str.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * bool diplomat_is_str(const char *buf, size_t len) - * } - */ - public static MethodHandle diplomat_is_str$handle() { - return diplomat_is_str.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * bool diplomat_is_str(const char *buf, size_t len) - * } - */ - public static MemorySegment diplomat_is_str$address() { - return diplomat_is_str.ADDR; - } - - /** - * {@snippet lang=c : - * bool diplomat_is_str(const char *buf, size_t len) - * } - */ - public static boolean diplomat_is_str(MemorySegment buf, long len) { - var mh$ = diplomat_is_str.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("diplomat_is_str", buf, len); - } - return (boolean)mh$.invokeExact(buf, len); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class diplomat_simple_write { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - DiplomatWrite.layout(), - somelib_h.C_POINTER, - somelib_h.C_LONG - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_simple_write"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) - * } - */ - public static FunctionDescriptor diplomat_simple_write$descriptor() { - return diplomat_simple_write.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) - * } - */ - public static MethodHandle diplomat_simple_write$handle() { - return diplomat_simple_write.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) - * } - */ - public static MemorySegment diplomat_simple_write$address() { - return diplomat_simple_write.ADDR; - } - - /** - * {@snippet lang=c : - * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) - * } - */ - public static MemorySegment diplomat_simple_write(SegmentAllocator allocator, MemorySegment buf, long buf_size) { - var mh$ = diplomat_simple_write.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("diplomat_simple_write", allocator, buf, buf_size); - } - return (MemorySegment)mh$.invokeExact(allocator, buf, buf_size); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class diplomat_buffer_write_create { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_LONG - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_create"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * DiplomatWrite *diplomat_buffer_write_create(size_t cap) - * } - */ - public static FunctionDescriptor diplomat_buffer_write_create$descriptor() { - return diplomat_buffer_write_create.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * DiplomatWrite *diplomat_buffer_write_create(size_t cap) - * } - */ - public static MethodHandle diplomat_buffer_write_create$handle() { - return diplomat_buffer_write_create.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * DiplomatWrite *diplomat_buffer_write_create(size_t cap) - * } - */ - public static MemorySegment diplomat_buffer_write_create$address() { - return diplomat_buffer_write_create.ADDR; - } - - /** - * {@snippet lang=c : - * DiplomatWrite *diplomat_buffer_write_create(size_t cap) - * } - */ - public static MemorySegment diplomat_buffer_write_create(long cap) { - var mh$ = diplomat_buffer_write_create.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("diplomat_buffer_write_create", cap); - } - return (MemorySegment)mh$.invokeExact(cap); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class diplomat_buffer_write_get_bytes { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_get_bytes"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) - * } - */ - public static FunctionDescriptor diplomat_buffer_write_get_bytes$descriptor() { - return diplomat_buffer_write_get_bytes.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) - * } - */ - public static MethodHandle diplomat_buffer_write_get_bytes$handle() { - return diplomat_buffer_write_get_bytes.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) - * } - */ - public static MemorySegment diplomat_buffer_write_get_bytes$address() { - return diplomat_buffer_write_get_bytes.ADDR; - } - - /** - * {@snippet lang=c : - * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) - * } - */ - public static MemorySegment diplomat_buffer_write_get_bytes(MemorySegment t) { - var mh$ = diplomat_buffer_write_get_bytes.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("diplomat_buffer_write_get_bytes", t); - } - return (MemorySegment)mh$.invokeExact(t); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class diplomat_buffer_write_len { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_LONG, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_len"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * size_t diplomat_buffer_write_len(DiplomatWrite *t) - * } - */ - public static FunctionDescriptor diplomat_buffer_write_len$descriptor() { - return diplomat_buffer_write_len.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * size_t diplomat_buffer_write_len(DiplomatWrite *t) - * } - */ - public static MethodHandle diplomat_buffer_write_len$handle() { - return diplomat_buffer_write_len.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * size_t diplomat_buffer_write_len(DiplomatWrite *t) - * } - */ - public static MemorySegment diplomat_buffer_write_len$address() { - return diplomat_buffer_write_len.ADDR; - } - - /** - * {@snippet lang=c : - * size_t diplomat_buffer_write_len(DiplomatWrite *t) - * } - */ - public static long diplomat_buffer_write_len(MemorySegment t) { - var mh$ = diplomat_buffer_write_len.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("diplomat_buffer_write_len", t); - } - return (long)mh$.invokeExact(t); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class diplomat_buffer_write_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_destroy"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * void diplomat_buffer_write_destroy(DiplomatWrite *t) - * } - */ - public static FunctionDescriptor diplomat_buffer_write_destroy$descriptor() { - return diplomat_buffer_write_destroy.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * void diplomat_buffer_write_destroy(DiplomatWrite *t) - * } - */ - public static MethodHandle diplomat_buffer_write_destroy$handle() { - return diplomat_buffer_write_destroy.HANDLE; + public static MethodHandle CyclicStructA_get_b$handle() { + return CyclicStructA_get_b.HANDLE; } /** * Address for: * {@snippet lang=c : - * void diplomat_buffer_write_destroy(DiplomatWrite *t) + * CyclicStructB CyclicStructA_get_b() * } */ - public static MemorySegment diplomat_buffer_write_destroy$address() { - return diplomat_buffer_write_destroy.ADDR; + public static MemorySegment CyclicStructA_get_b$address() { + return CyclicStructA_get_b.ADDR; } /** * {@snippet lang=c : - * void diplomat_buffer_write_destroy(DiplomatWrite *t) + * CyclicStructB CyclicStructA_get_b() * } */ - public static void diplomat_buffer_write_destroy(MemorySegment t) { - var mh$ = diplomat_buffer_write_destroy.HANDLE; + public static MemorySegment CyclicStructA_get_b(SegmentAllocator allocator) { + var mh$ = CyclicStructA_get_b.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("diplomat_buffer_write_destroy", t); + traceDowncall("CyclicStructA_get_b", allocator); } - mh$.invokeExact(t); + return (MemorySegment)mh$.invokeExact(allocator); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Bar_foo { + private static class Utf16Wrap_from_utf16 { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - somelib_h.C_POINTER + DiplomatString16View.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Bar_foo"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_from_utf16"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -9853,56 +9909,57 @@ private static class Bar_foo { /** * Function descriptor for: * {@snippet lang=c : - * const Foo *Bar_foo(const Bar *self) + * Utf16Wrap *Utf16Wrap_from_utf16(DiplomatString16View input) * } */ - public static FunctionDescriptor Bar_foo$descriptor() { - return Bar_foo.DESC; + public static FunctionDescriptor Utf16Wrap_from_utf16$descriptor() { + return Utf16Wrap_from_utf16.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * const Foo *Bar_foo(const Bar *self) + * Utf16Wrap *Utf16Wrap_from_utf16(DiplomatString16View input) * } */ - public static MethodHandle Bar_foo$handle() { - return Bar_foo.HANDLE; + public static MethodHandle Utf16Wrap_from_utf16$handle() { + return Utf16Wrap_from_utf16.HANDLE; } /** * Address for: * {@snippet lang=c : - * const Foo *Bar_foo(const Bar *self) + * Utf16Wrap *Utf16Wrap_from_utf16(DiplomatString16View input) * } */ - public static MemorySegment Bar_foo$address() { - return Bar_foo.ADDR; + public static MemorySegment Utf16Wrap_from_utf16$address() { + return Utf16Wrap_from_utf16.ADDR; } /** * {@snippet lang=c : - * const Foo *Bar_foo(const Bar *self) + * Utf16Wrap *Utf16Wrap_from_utf16(DiplomatString16View input) * } */ - public static MemorySegment Bar_foo(MemorySegment self) { - var mh$ = Bar_foo.HANDLE; + public static MemorySegment Utf16Wrap_from_utf16(MemorySegment input) { + var mh$ = Utf16Wrap_from_utf16.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Bar_foo", self); + traceDowncall("Utf16Wrap_from_utf16", input); } - return (MemorySegment)mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(input); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Bar_destroy { + private static class Utf16Wrap_get_debug_str { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Bar_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_get_debug_str"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -9910,61 +9967,57 @@ private static class Bar_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void Bar_destroy(Bar *self) + * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) * } */ - public static FunctionDescriptor Bar_destroy$descriptor() { - return Bar_destroy.DESC; + public static FunctionDescriptor Utf16Wrap_get_debug_str$descriptor() { + return Utf16Wrap_get_debug_str.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Bar_destroy(Bar *self) + * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) * } */ - public static MethodHandle Bar_destroy$handle() { - return Bar_destroy.HANDLE; + public static MethodHandle Utf16Wrap_get_debug_str$handle() { + return Utf16Wrap_get_debug_str.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Bar_destroy(Bar *self) + * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) * } */ - public static MemorySegment Bar_destroy$address() { - return Bar_destroy.ADDR; + public static MemorySegment Utf16Wrap_get_debug_str$address() { + return Utf16Wrap_get_debug_str.ADDR; } /** * {@snippet lang=c : - * void Bar_destroy(Bar *self) + * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) * } */ - public static void Bar_destroy(MemorySegment self) { - var mh$ = Bar_destroy.HANDLE; + public static void Utf16Wrap_get_debug_str(MemorySegment self, MemorySegment write) { + var mh$ = Utf16Wrap_get_debug_str.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Bar_destroy", self); + traceDowncall("Utf16Wrap_get_debug_str", self, write); } - mh$.invokeExact(self); + mh$.invokeExact(self, write); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class BorrowedFields_from_bar_and_strings { + private static class Utf16Wrap_borrow_cont { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - BorrowedFields.layout(), - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG, - somelib_h.C_POINTER, - somelib_h.C_LONG + DiplomatString16View.layout(), + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("BorrowedFields_from_bar_and_strings"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_borrow_cont"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -9972,55 +10025,56 @@ private static class BorrowedFields_from_bar_and_strings { /** * Function descriptor for: * {@snippet lang=c : - * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, const char16_t *dstr16_data, size_t dstr16_len, const char *utf8_str_data, size_t utf8_str_len) + * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) * } */ - public static FunctionDescriptor BorrowedFields_from_bar_and_strings$descriptor() { - return BorrowedFields_from_bar_and_strings.DESC; + public static FunctionDescriptor Utf16Wrap_borrow_cont$descriptor() { + return Utf16Wrap_borrow_cont.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, const char16_t *dstr16_data, size_t dstr16_len, const char *utf8_str_data, size_t utf8_str_len) + * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) * } */ - public static MethodHandle BorrowedFields_from_bar_and_strings$handle() { - return BorrowedFields_from_bar_and_strings.HANDLE; + public static MethodHandle Utf16Wrap_borrow_cont$handle() { + return Utf16Wrap_borrow_cont.HANDLE; } /** * Address for: * {@snippet lang=c : - * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, const char16_t *dstr16_data, size_t dstr16_len, const char *utf8_str_data, size_t utf8_str_len) + * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) * } */ - public static MemorySegment BorrowedFields_from_bar_and_strings$address() { - return BorrowedFields_from_bar_and_strings.ADDR; + public static MemorySegment Utf16Wrap_borrow_cont$address() { + return Utf16Wrap_borrow_cont.ADDR; } /** * {@snippet lang=c : - * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, const char16_t *dstr16_data, size_t dstr16_len, const char *utf8_str_data, size_t utf8_str_len) + * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) * } */ - public static MemorySegment BorrowedFields_from_bar_and_strings(SegmentAllocator allocator, MemorySegment bar, MemorySegment dstr16_data, long dstr16_len, MemorySegment utf8_str_data, long utf8_str_len) { - var mh$ = BorrowedFields_from_bar_and_strings.HANDLE; + public static MemorySegment Utf16Wrap_borrow_cont(SegmentAllocator allocator, MemorySegment self) { + var mh$ = Utf16Wrap_borrow_cont.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("BorrowedFields_from_bar_and_strings", allocator, bar, dstr16_data, dstr16_len, utf8_str_data, utf8_str_len); + traceDowncall("Utf16Wrap_borrow_cont", allocator, self); } - return (MemorySegment)mh$.invokeExact(allocator, bar, dstr16_data, dstr16_len, utf8_str_data, utf8_str_len); + return (MemorySegment)mh$.invokeExact(allocator, self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class CyclicStructA_get_b { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - CyclicStructB.layout() ); + private static class Utf16Wrap_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("CyclicStructA_get_b"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10028,168 +10082,111 @@ private static class CyclicStructA_get_b { /** * Function descriptor for: * {@snippet lang=c : - * CyclicStructB CyclicStructA_get_b() + * void Utf16Wrap_destroy(Utf16Wrap *self) * } */ - public static FunctionDescriptor CyclicStructA_get_b$descriptor() { - return CyclicStructA_get_b.DESC; + public static FunctionDescriptor Utf16Wrap_destroy$descriptor() { + return Utf16Wrap_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * CyclicStructB CyclicStructA_get_b() + * void Utf16Wrap_destroy(Utf16Wrap *self) * } */ - public static MethodHandle CyclicStructA_get_b$handle() { - return CyclicStructA_get_b.HANDLE; + public static MethodHandle Utf16Wrap_destroy$handle() { + return Utf16Wrap_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * CyclicStructB CyclicStructA_get_b() + * void Utf16Wrap_destroy(Utf16Wrap *self) * } */ - public static MemorySegment CyclicStructA_get_b$address() { - return CyclicStructA_get_b.ADDR; + public static MemorySegment Utf16Wrap_destroy$address() { + return Utf16Wrap_destroy.ADDR; } /** * {@snippet lang=c : - * CyclicStructB CyclicStructA_get_b() + * void Utf16Wrap_destroy(Utf16Wrap *self) * } */ - public static MemorySegment CyclicStructA_get_b(SegmentAllocator allocator) { - var mh$ = CyclicStructA_get_b.HANDLE; + public static void Utf16Wrap_destroy(MemorySegment self) { + var mh$ = Utf16Wrap_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("CyclicStructA_get_b", allocator); + traceDowncall("Utf16Wrap_destroy", self); } - return (MemorySegment)mh$.invokeExact(allocator); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static final int UnimportedEnum_A = (int)0L; - /** - * {@snippet lang=c : - * enum UnimportedEnum.UnimportedEnum_A = 0 - * } - */ - public static int UnimportedEnum_A() { - return UnimportedEnum_A; - } - private static final int UnimportedEnum_B = (int)1L; - /** - * {@snippet lang=c : - * enum UnimportedEnum.UnimportedEnum_B = 1 - * } - */ - public static int UnimportedEnum_B() { - return UnimportedEnum_B; - } - private static final int UnimportedEnum_C = (int)2L; - /** - * {@snippet lang=c : - * enum UnimportedEnum.UnimportedEnum_C = 2 - * } - */ - public static int UnimportedEnum_C() { - return UnimportedEnum_C; - } - - private static class NestedBorrowedFields_from_bar_and_foo_and_strings { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - NestedBorrowedFields.layout(), - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG, - somelib_h.C_POINTER, - somelib_h.C_LONG, - somelib_h.C_POINTER, - somelib_h.C_LONG, - somelib_h.C_POINTER, - somelib_h.C_LONG - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("NestedBorrowedFields_from_bar_and_foo_and_strings"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - + private static final int MyEnum_A = (int)-2L; /** - * Function descriptor for: * {@snippet lang=c : - * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char16_t *dstr16_z_data, size_t dstr16_z_len, const char *utf8_str_y_data, size_t utf8_str_y_len, const char *utf8_str_z_data, size_t utf8_str_z_len) + * enum MyEnum.MyEnum_A = -2 * } */ - public static FunctionDescriptor NestedBorrowedFields_from_bar_and_foo_and_strings$descriptor() { - return NestedBorrowedFields_from_bar_and_foo_and_strings.DESC; + public static int MyEnum_A() { + return MyEnum_A; } - + private static final int MyEnum_B = (int)-1L; /** - * Downcall method handle for: * {@snippet lang=c : - * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char16_t *dstr16_z_data, size_t dstr16_z_len, const char *utf8_str_y_data, size_t utf8_str_y_len, const char *utf8_str_z_data, size_t utf8_str_z_len) + * enum MyEnum.MyEnum_B = -1 * } */ - public static MethodHandle NestedBorrowedFields_from_bar_and_foo_and_strings$handle() { - return NestedBorrowedFields_from_bar_and_foo_and_strings.HANDLE; + public static int MyEnum_B() { + return MyEnum_B; } - + private static final int MyEnum_C = (int)0L; /** - * Address for: * {@snippet lang=c : - * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char16_t *dstr16_z_data, size_t dstr16_z_len, const char *utf8_str_y_data, size_t utf8_str_y_len, const char *utf8_str_z_data, size_t utf8_str_z_len) + * enum MyEnum.MyEnum_C = 0 * } */ - public static MemorySegment NestedBorrowedFields_from_bar_and_foo_and_strings$address() { - return NestedBorrowedFields_from_bar_and_foo_and_strings.ADDR; + public static int MyEnum_C() { + return MyEnum_C; } - + private static final int MyEnum_D = (int)1L; /** * {@snippet lang=c : - * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char16_t *dstr16_z_data, size_t dstr16_z_len, const char *utf8_str_y_data, size_t utf8_str_y_len, const char *utf8_str_z_data, size_t utf8_str_z_len) + * enum MyEnum.MyEnum_D = 1 * } */ - public static MemorySegment NestedBorrowedFields_from_bar_and_foo_and_strings(SegmentAllocator allocator, MemorySegment bar, MemorySegment foo, MemorySegment dstr16_x_data, long dstr16_x_len, MemorySegment dstr16_z_data, long dstr16_z_len, MemorySegment utf8_str_y_data, long utf8_str_y_len, MemorySegment utf8_str_z_data, long utf8_str_z_len) { - var mh$ = NestedBorrowedFields_from_bar_and_foo_and_strings.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("NestedBorrowedFields_from_bar_and_foo_and_strings", allocator, bar, foo, dstr16_x_data, dstr16_x_len, dstr16_z_data, dstr16_z_len, utf8_str_y_data, utf8_str_y_len, utf8_str_z_data, utf8_str_z_len); - } - return (MemorySegment)mh$.invokeExact(allocator, bar, foo, dstr16_x_data, dstr16_x_len, dstr16_z_data, dstr16_z_len, utf8_str_y_data, utf8_str_y_len, utf8_str_z_data, utf8_str_z_len); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } + public static int MyEnum_D() { + return MyEnum_D; } - private static final int ErrorEnum_Foo = (int)0L; + private static final int MyEnum_E = (int)2L; /** * {@snippet lang=c : - * enum ErrorEnum.ErrorEnum_Foo = 0 + * enum MyEnum.MyEnum_E = 2 * } */ - public static int ErrorEnum_Foo() { - return ErrorEnum_Foo; + public static int MyEnum_E() { + return MyEnum_E; } - private static final int ErrorEnum_Bar = (int)1L; + private static final int MyEnum_F = (int)3L; /** * {@snippet lang=c : - * enum ErrorEnum.ErrorEnum_Bar = 1 + * enum MyEnum.MyEnum_F = 3 * } */ - public static int ErrorEnum_Bar() { - return ErrorEnum_Bar; + public static int MyEnum_F() { + return MyEnum_F; } - private static class RefListParameter_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER + private static class MyEnum_into_value { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_CHAR, + somelib_h.C_INT ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("RefListParameter_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyEnum_into_value"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10197,58 +10194,55 @@ private static class RefListParameter_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void RefListParameter_destroy(RefListParameter *self) + * int8_t MyEnum_into_value(MyEnum self) * } */ - public static FunctionDescriptor RefListParameter_destroy$descriptor() { - return RefListParameter_destroy.DESC; + public static FunctionDescriptor MyEnum_into_value$descriptor() { + return MyEnum_into_value.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void RefListParameter_destroy(RefListParameter *self) + * int8_t MyEnum_into_value(MyEnum self) * } */ - public static MethodHandle RefListParameter_destroy$handle() { - return RefListParameter_destroy.HANDLE; + public static MethodHandle MyEnum_into_value$handle() { + return MyEnum_into_value.HANDLE; } /** * Address for: * {@snippet lang=c : - * void RefListParameter_destroy(RefListParameter *self) + * int8_t MyEnum_into_value(MyEnum self) * } */ - public static MemorySegment RefListParameter_destroy$address() { - return RefListParameter_destroy.ADDR; + public static MemorySegment MyEnum_into_value$address() { + return MyEnum_into_value.ADDR; } /** * {@snippet lang=c : - * void RefListParameter_destroy(RefListParameter *self) + * int8_t MyEnum_into_value(MyEnum self) * } */ - public static void RefListParameter_destroy(MemorySegment self) { - var mh$ = RefListParameter_destroy.HANDLE; + public static byte MyEnum_into_value(int self) { + var mh$ = MyEnum_into_value.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("RefListParameter_destroy", self); + traceDowncall("MyEnum_into_value", self); } - mh$.invokeExact(self); + return (byte)mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyString_new { + private static class MyEnum_get_a { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG - ); + somelib_h.C_INT ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyEnum_get_a"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10256,58 +10250,55 @@ private static class MyString_new { /** * Function descriptor for: * {@snippet lang=c : - * MyString *MyString_new(const char *v_data, size_t v_len) + * MyEnum MyEnum_get_a() * } */ - public static FunctionDescriptor MyString_new$descriptor() { - return MyString_new.DESC; + public static FunctionDescriptor MyEnum_get_a$descriptor() { + return MyEnum_get_a.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * MyString *MyString_new(const char *v_data, size_t v_len) + * MyEnum MyEnum_get_a() * } */ - public static MethodHandle MyString_new$handle() { - return MyString_new.HANDLE; + public static MethodHandle MyEnum_get_a$handle() { + return MyEnum_get_a.HANDLE; } /** * Address for: * {@snippet lang=c : - * MyString *MyString_new(const char *v_data, size_t v_len) + * MyEnum MyEnum_get_a() * } */ - public static MemorySegment MyString_new$address() { - return MyString_new.ADDR; + public static MemorySegment MyEnum_get_a$address() { + return MyEnum_get_a.ADDR; } /** * {@snippet lang=c : - * MyString *MyString_new(const char *v_data, size_t v_len) + * MyEnum MyEnum_get_a() * } */ - public static MemorySegment MyString_new(MemorySegment v_data, long v_len) { - var mh$ = MyString_new.HANDLE; + public static int MyEnum_get_a() { + var mh$ = MyEnum_get_a.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyString_new", v_data, v_len); + traceDowncall("MyEnum_get_a"); } - return (MemorySegment)mh$.invokeExact(v_data, v_len); + return (int)mh$.invokeExact(); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyString_new_unsafe { + private static class MyStruct_new { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG - ); + MyStruct.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new_unsafe"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyStruct_new"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10315,58 +10306,57 @@ private static class MyString_new_unsafe { /** * Function descriptor for: * {@snippet lang=c : - * MyString *MyString_new_unsafe(const char *v_data, size_t v_len) + * MyStruct MyStruct_new() * } */ - public static FunctionDescriptor MyString_new_unsafe$descriptor() { - return MyString_new_unsafe.DESC; + public static FunctionDescriptor MyStruct_new$descriptor() { + return MyStruct_new.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * MyString *MyString_new_unsafe(const char *v_data, size_t v_len) + * MyStruct MyStruct_new() * } */ - public static MethodHandle MyString_new_unsafe$handle() { - return MyString_new_unsafe.HANDLE; + public static MethodHandle MyStruct_new$handle() { + return MyStruct_new.HANDLE; } /** * Address for: * {@snippet lang=c : - * MyString *MyString_new_unsafe(const char *v_data, size_t v_len) + * MyStruct MyStruct_new() * } */ - public static MemorySegment MyString_new_unsafe$address() { - return MyString_new_unsafe.ADDR; + public static MemorySegment MyStruct_new$address() { + return MyStruct_new.ADDR; } /** * {@snippet lang=c : - * MyString *MyString_new_unsafe(const char *v_data, size_t v_len) + * MyStruct MyStruct_new() * } */ - public static MemorySegment MyString_new_unsafe(MemorySegment v_data, long v_len) { - var mh$ = MyString_new_unsafe.HANDLE; + public static MemorySegment MyStruct_new(SegmentAllocator allocator) { + var mh$ = MyStruct_new.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyString_new_unsafe", v_data, v_len); + traceDowncall("MyStruct_new", allocator); } - return (MemorySegment)mh$.invokeExact(v_data, v_len); + return (MemorySegment)mh$.invokeExact(allocator); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyString_new_owned { + private static class MyStruct_into_a { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_CHAR, + MyStruct.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new_owned"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyStruct_into_a"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10374,58 +10364,57 @@ private static class MyString_new_owned { /** * Function descriptor for: * {@snippet lang=c : - * MyString *MyString_new_owned(const char *v_data, size_t v_len) + * uint8_t MyStruct_into_a(MyStruct self) * } */ - public static FunctionDescriptor MyString_new_owned$descriptor() { - return MyString_new_owned.DESC; + public static FunctionDescriptor MyStruct_into_a$descriptor() { + return MyStruct_into_a.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * MyString *MyString_new_owned(const char *v_data, size_t v_len) + * uint8_t MyStruct_into_a(MyStruct self) * } */ - public static MethodHandle MyString_new_owned$handle() { - return MyString_new_owned.HANDLE; + public static MethodHandle MyStruct_into_a$handle() { + return MyStruct_into_a.HANDLE; } /** * Address for: * {@snippet lang=c : - * MyString *MyString_new_owned(const char *v_data, size_t v_len) + * uint8_t MyStruct_into_a(MyStruct self) * } */ - public static MemorySegment MyString_new_owned$address() { - return MyString_new_owned.ADDR; + public static MemorySegment MyStruct_into_a$address() { + return MyStruct_into_a.ADDR; } /** * {@snippet lang=c : - * MyString *MyString_new_owned(const char *v_data, size_t v_len) + * uint8_t MyStruct_into_a(MyStruct self) * } */ - public static MemorySegment MyString_new_owned(MemorySegment v_data, long v_len) { - var mh$ = MyString_new_owned.HANDLE; + public static byte MyStruct_into_a(MemorySegment self) { + var mh$ = MyStruct_into_a.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyString_new_owned", v_data, v_len); + traceDowncall("MyStruct_into_a", self); } - return (MemorySegment)mh$.invokeExact(v_data, v_len); + return (byte)mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyString_new_from_first { + private static class Bar_foo { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new_from_first"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Bar_foo"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10433,58 +10422,56 @@ private static class MyString_new_from_first { /** * Function descriptor for: * {@snippet lang=c : - * MyString *MyString_new_from_first(DiplomatStringsView *v_data, size_t v_len) + * const Foo *Bar_foo(const Bar *self) * } */ - public static FunctionDescriptor MyString_new_from_first$descriptor() { - return MyString_new_from_first.DESC; + public static FunctionDescriptor Bar_foo$descriptor() { + return Bar_foo.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * MyString *MyString_new_from_first(DiplomatStringsView *v_data, size_t v_len) + * const Foo *Bar_foo(const Bar *self) * } */ - public static MethodHandle MyString_new_from_first$handle() { - return MyString_new_from_first.HANDLE; + public static MethodHandle Bar_foo$handle() { + return Bar_foo.HANDLE; } /** * Address for: * {@snippet lang=c : - * MyString *MyString_new_from_first(DiplomatStringsView *v_data, size_t v_len) + * const Foo *Bar_foo(const Bar *self) * } */ - public static MemorySegment MyString_new_from_first$address() { - return MyString_new_from_first.ADDR; + public static MemorySegment Bar_foo$address() { + return Bar_foo.ADDR; } /** * {@snippet lang=c : - * MyString *MyString_new_from_first(DiplomatStringsView *v_data, size_t v_len) + * const Foo *Bar_foo(const Bar *self) * } */ - public static MemorySegment MyString_new_from_first(MemorySegment v_data, long v_len) { - var mh$ = MyString_new_from_first.HANDLE; + public static MemorySegment Bar_foo(MemorySegment self) { + var mh$ = Bar_foo.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyString_new_from_first", v_data, v_len); + traceDowncall("Bar_foo", self); } - return (MemorySegment)mh$.invokeExact(v_data, v_len); + return (MemorySegment)mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyString_set_str { + private static class Bar_destroy { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_set_str"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Bar_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10492,57 +10479,57 @@ private static class MyString_set_str { /** * Function descriptor for: * {@snippet lang=c : - * void MyString_set_str(MyString *self, const char *new_str_data, size_t new_str_len) + * void Bar_destroy(Bar *self) * } */ - public static FunctionDescriptor MyString_set_str$descriptor() { - return MyString_set_str.DESC; + public static FunctionDescriptor Bar_destroy$descriptor() { + return Bar_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void MyString_set_str(MyString *self, const char *new_str_data, size_t new_str_len) + * void Bar_destroy(Bar *self) * } */ - public static MethodHandle MyString_set_str$handle() { - return MyString_set_str.HANDLE; + public static MethodHandle Bar_destroy$handle() { + return Bar_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * void MyString_set_str(MyString *self, const char *new_str_data, size_t new_str_len) + * void Bar_destroy(Bar *self) * } */ - public static MemorySegment MyString_set_str$address() { - return MyString_set_str.ADDR; + public static MemorySegment Bar_destroy$address() { + return Bar_destroy.ADDR; } /** * {@snippet lang=c : - * void MyString_set_str(MyString *self, const char *new_str_data, size_t new_str_len) + * void Bar_destroy(Bar *self) * } */ - public static void MyString_set_str(MemorySegment self, MemorySegment new_str_data, long new_str_len) { - var mh$ = MyString_set_str.HANDLE; + public static void Bar_destroy(MemorySegment self) { + var mh$ = Bar_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyString_set_str", self, new_str_data, new_str_len); + traceDowncall("Bar_destroy", self); } - mh$.invokeExact(self, new_str_data, new_str_len); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyString_get_str { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class MyString_new { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - somelib_h.C_POINTER + DiplomatStringView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_get_str"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10550,58 +10537,57 @@ private static class MyString_get_str { /** * Function descriptor for: * {@snippet lang=c : - * void MyString_get_str(const MyString *self, DiplomatWrite *write) + * MyString *MyString_new(DiplomatStringView v) * } */ - public static FunctionDescriptor MyString_get_str$descriptor() { - return MyString_get_str.DESC; + public static FunctionDescriptor MyString_new$descriptor() { + return MyString_new.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void MyString_get_str(const MyString *self, DiplomatWrite *write) + * MyString *MyString_new(DiplomatStringView v) * } */ - public static MethodHandle MyString_get_str$handle() { - return MyString_get_str.HANDLE; + public static MethodHandle MyString_new$handle() { + return MyString_new.HANDLE; } /** * Address for: * {@snippet lang=c : - * void MyString_get_str(const MyString *self, DiplomatWrite *write) + * MyString *MyString_new(DiplomatStringView v) * } */ - public static MemorySegment MyString_get_str$address() { - return MyString_get_str.ADDR; + public static MemorySegment MyString_new$address() { + return MyString_new.ADDR; } /** * {@snippet lang=c : - * void MyString_get_str(const MyString *self, DiplomatWrite *write) + * MyString *MyString_new(DiplomatStringView v) * } */ - public static void MyString_get_str(MemorySegment self, MemorySegment write) { - var mh$ = MyString_get_str.HANDLE; + public static MemorySegment MyString_new(MemorySegment v) { + var mh$ = MyString_new.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyString_get_str", self, write); + traceDowncall("MyString_new", v); } - mh$.invokeExact(self, write); + return (MemorySegment)mh$.invokeExact(v); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyString_string_transform { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class MyString_new_unsafe { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - somelib_h.C_LONG, - somelib_h.C_POINTER + DiplomatStringView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_string_transform"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new_unsafe"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10609,56 +10595,57 @@ private static class MyString_string_transform { /** * Function descriptor for: * {@snippet lang=c : - * void MyString_string_transform(const char *foo_data, size_t foo_len, DiplomatWrite *write) + * MyString *MyString_new_unsafe(DiplomatStringView v) * } */ - public static FunctionDescriptor MyString_string_transform$descriptor() { - return MyString_string_transform.DESC; + public static FunctionDescriptor MyString_new_unsafe$descriptor() { + return MyString_new_unsafe.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void MyString_string_transform(const char *foo_data, size_t foo_len, DiplomatWrite *write) + * MyString *MyString_new_unsafe(DiplomatStringView v) * } */ - public static MethodHandle MyString_string_transform$handle() { - return MyString_string_transform.HANDLE; + public static MethodHandle MyString_new_unsafe$handle() { + return MyString_new_unsafe.HANDLE; } /** * Address for: * {@snippet lang=c : - * void MyString_string_transform(const char *foo_data, size_t foo_len, DiplomatWrite *write) + * MyString *MyString_new_unsafe(DiplomatStringView v) * } */ - public static MemorySegment MyString_string_transform$address() { - return MyString_string_transform.ADDR; + public static MemorySegment MyString_new_unsafe$address() { + return MyString_new_unsafe.ADDR; } /** * {@snippet lang=c : - * void MyString_string_transform(const char *foo_data, size_t foo_len, DiplomatWrite *write) + * MyString *MyString_new_unsafe(DiplomatStringView v) * } */ - public static void MyString_string_transform(MemorySegment foo_data, long foo_len, MemorySegment write) { - var mh$ = MyString_string_transform.HANDLE; + public static MemorySegment MyString_new_unsafe(MemorySegment v) { + var mh$ = MyString_new_unsafe.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyString_string_transform", foo_data, foo_len, write); + traceDowncall("MyString_new_unsafe", v); } - mh$.invokeExact(foo_data, foo_len, write); + return (MemorySegment)mh$.invokeExact(v); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyString_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER + private static class MyString_new_owned { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + DiplomatStringView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new_owned"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10666,58 +10653,57 @@ private static class MyString_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void MyString_destroy(MyString *self) + * MyString *MyString_new_owned(DiplomatStringView v) * } */ - public static FunctionDescriptor MyString_destroy$descriptor() { - return MyString_destroy.DESC; + public static FunctionDescriptor MyString_new_owned$descriptor() { + return MyString_new_owned.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void MyString_destroy(MyString *self) + * MyString *MyString_new_owned(DiplomatStringView v) * } */ - public static MethodHandle MyString_destroy$handle() { - return MyString_destroy.HANDLE; + public static MethodHandle MyString_new_owned$handle() { + return MyString_new_owned.HANDLE; } /** * Address for: * {@snippet lang=c : - * void MyString_destroy(MyString *self) + * MyString *MyString_new_owned(DiplomatStringView v) * } */ - public static MemorySegment MyString_destroy$address() { - return MyString_destroy.ADDR; + public static MemorySegment MyString_new_owned$address() { + return MyString_new_owned.ADDR; } /** * {@snippet lang=c : - * void MyString_destroy(MyString *self) + * MyString *MyString_new_owned(DiplomatStringView v) * } */ - public static void MyString_destroy(MemorySegment self) { - var mh$ = MyString_destroy.HANDLE; + public static MemorySegment MyString_new_owned(MemorySegment v) { + var mh$ = MyString_new_owned.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyString_destroy", self); + traceDowncall("MyString_new_owned", v); } - mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(v); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_transitivity { + private static class MyString_new_from_first { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER + DiplomatStringsView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_transitivity"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new_from_first"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10725,58 +10711,57 @@ private static class One_transitivity { /** * Function descriptor for: * {@snippet lang=c : - * One *One_transitivity(const One *hold, const One *nohold) + * MyString *MyString_new_from_first(DiplomatStringsView v) * } */ - public static FunctionDescriptor One_transitivity$descriptor() { - return One_transitivity.DESC; + public static FunctionDescriptor MyString_new_from_first$descriptor() { + return MyString_new_from_first.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_transitivity(const One *hold, const One *nohold) + * MyString *MyString_new_from_first(DiplomatStringsView v) * } */ - public static MethodHandle One_transitivity$handle() { - return One_transitivity.HANDLE; + public static MethodHandle MyString_new_from_first$handle() { + return MyString_new_from_first.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_transitivity(const One *hold, const One *nohold) + * MyString *MyString_new_from_first(DiplomatStringsView v) * } */ - public static MemorySegment One_transitivity$address() { - return One_transitivity.ADDR; + public static MemorySegment MyString_new_from_first$address() { + return MyString_new_from_first.ADDR; } /** * {@snippet lang=c : - * One *One_transitivity(const One *hold, const One *nohold) + * MyString *MyString_new_from_first(DiplomatStringsView v) * } */ - public static MemorySegment One_transitivity(MemorySegment hold, MemorySegment nohold) { - var mh$ = One_transitivity.HANDLE; + public static MemorySegment MyString_new_from_first(MemorySegment v) { + var mh$ = MyString_new_from_first.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_transitivity", hold, nohold); + traceDowncall("MyString_new_from_first", v); } - return (MemorySegment)mh$.invokeExact(hold, nohold); + return (MemorySegment)mh$.invokeExact(v); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_cycle { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, + private static class MyString_set_str { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER, - somelib_h.C_POINTER + DiplomatStringView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_cycle"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_set_str"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10784,61 +10769,57 @@ private static class One_cycle { /** * Function descriptor for: * {@snippet lang=c : - * One *One_cycle(const Two *hold, const One *nohold) + * void MyString_set_str(MyString *self, DiplomatStringView new_str) * } */ - public static FunctionDescriptor One_cycle$descriptor() { - return One_cycle.DESC; + public static FunctionDescriptor MyString_set_str$descriptor() { + return MyString_set_str.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_cycle(const Two *hold, const One *nohold) + * void MyString_set_str(MyString *self, DiplomatStringView new_str) * } */ - public static MethodHandle One_cycle$handle() { - return One_cycle.HANDLE; + public static MethodHandle MyString_set_str$handle() { + return MyString_set_str.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_cycle(const Two *hold, const One *nohold) + * void MyString_set_str(MyString *self, DiplomatStringView new_str) * } */ - public static MemorySegment One_cycle$address() { - return One_cycle.ADDR; + public static MemorySegment MyString_set_str$address() { + return MyString_set_str.ADDR; } /** * {@snippet lang=c : - * One *One_cycle(const Two *hold, const One *nohold) + * void MyString_set_str(MyString *self, DiplomatStringView new_str) * } */ - public static MemorySegment One_cycle(MemorySegment hold, MemorySegment nohold) { - var mh$ = One_cycle.HANDLE; + public static void MyString_set_str(MemorySegment self, MemorySegment new_str) { + var mh$ = MyString_set_str.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_cycle", hold, nohold); + traceDowncall("MyString_set_str", self, new_str); } - return (MemorySegment)mh$.invokeExact(hold, nohold); + mh$.invokeExact(self, new_str); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_many_dependents { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, + private static class MyString_get_str { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_many_dependents"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_get_str"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10846,58 +10827,57 @@ private static class One_many_dependents { /** * Function descriptor for: * {@snippet lang=c : - * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) + * void MyString_get_str(const MyString *self, DiplomatWrite *write) * } */ - public static FunctionDescriptor One_many_dependents$descriptor() { - return One_many_dependents.DESC; + public static FunctionDescriptor MyString_get_str$descriptor() { + return MyString_get_str.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) + * void MyString_get_str(const MyString *self, DiplomatWrite *write) * } */ - public static MethodHandle One_many_dependents$handle() { - return One_many_dependents.HANDLE; + public static MethodHandle MyString_get_str$handle() { + return MyString_get_str.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) + * void MyString_get_str(const MyString *self, DiplomatWrite *write) * } */ - public static MemorySegment One_many_dependents$address() { - return One_many_dependents.ADDR; + public static MemorySegment MyString_get_str$address() { + return MyString_get_str.ADDR; } /** * {@snippet lang=c : - * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) + * void MyString_get_str(const MyString *self, DiplomatWrite *write) * } */ - public static MemorySegment One_many_dependents(MemorySegment a, MemorySegment b, MemorySegment c, MemorySegment d, MemorySegment nohold) { - var mh$ = One_many_dependents.HANDLE; + public static void MyString_get_str(MemorySegment self, MemorySegment write) { + var mh$ = MyString_get_str.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_many_dependents", a, b, c, d, nohold); + traceDowncall("MyString_get_str", self, write); } - return (MemorySegment)mh$.invokeExact(a, b, c, d, nohold); + mh$.invokeExact(self, write); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_return_outlives_param { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, + private static class MyString_string_transform { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + DiplomatStringView.layout(), somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_return_outlives_param"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_string_transform"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10905,60 +10885,56 @@ private static class One_return_outlives_param { /** * Function descriptor for: * {@snippet lang=c : - * One *One_return_outlives_param(const Two *hold, const One *nohold) + * void MyString_string_transform(DiplomatStringView foo, DiplomatWrite *write) * } */ - public static FunctionDescriptor One_return_outlives_param$descriptor() { - return One_return_outlives_param.DESC; + public static FunctionDescriptor MyString_string_transform$descriptor() { + return MyString_string_transform.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_return_outlives_param(const Two *hold, const One *nohold) + * void MyString_string_transform(DiplomatStringView foo, DiplomatWrite *write) * } */ - public static MethodHandle One_return_outlives_param$handle() { - return One_return_outlives_param.HANDLE; + public static MethodHandle MyString_string_transform$handle() { + return MyString_string_transform.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_return_outlives_param(const Two *hold, const One *nohold) + * void MyString_string_transform(DiplomatStringView foo, DiplomatWrite *write) * } */ - public static MemorySegment One_return_outlives_param$address() { - return One_return_outlives_param.ADDR; + public static MemorySegment MyString_string_transform$address() { + return MyString_string_transform.ADDR; } /** * {@snippet lang=c : - * One *One_return_outlives_param(const Two *hold, const One *nohold) + * void MyString_string_transform(DiplomatStringView foo, DiplomatWrite *write) * } */ - public static MemorySegment One_return_outlives_param(MemorySegment hold, MemorySegment nohold) { - var mh$ = One_return_outlives_param.HANDLE; + public static void MyString_string_transform(MemorySegment foo, MemorySegment write) { + var mh$ = MyString_string_transform.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_return_outlives_param", hold, nohold); + traceDowncall("MyString_string_transform", foo, write); } - return (MemorySegment)mh$.invokeExact(hold, nohold); + mh$.invokeExact(foo, write); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_diamond_top { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, + private static class MyString_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_top"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10966,60 +10942,59 @@ private static class One_diamond_top { /** * Function descriptor for: * {@snippet lang=c : - * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) + * void MyString_destroy(MyString *self) * } */ - public static FunctionDescriptor One_diamond_top$descriptor() { - return One_diamond_top.DESC; + public static FunctionDescriptor MyString_destroy$descriptor() { + return MyString_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) + * void MyString_destroy(MyString *self) * } */ - public static MethodHandle One_diamond_top$handle() { - return One_diamond_top.HANDLE; + public static MethodHandle MyString_destroy$handle() { + return MyString_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) + * void MyString_destroy(MyString *self) * } */ - public static MemorySegment One_diamond_top$address() { - return One_diamond_top.ADDR; + public static MemorySegment MyString_destroy$address() { + return MyString_destroy.ADDR; } /** * {@snippet lang=c : - * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) + * void MyString_destroy(MyString *self) * } */ - public static MemorySegment One_diamond_top(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { - var mh$ = One_diamond_top.HANDLE; + public static void MyString_destroy(MemorySegment self) { + var mh$ = MyString_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_diamond_top", top, left, right, bottom); + traceDowncall("MyString_destroy", self); } - return (MemorySegment)mh$.invokeExact(top, left, right, bottom); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_diamond_left { + private static class BorrowedFields_from_bar_and_strings { public static final FunctionDescriptor DESC = FunctionDescriptor.of( + BorrowedFields.layout(), somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER + DiplomatString16View.layout(), + DiplomatStringView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_left"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("BorrowedFields_from_bar_and_strings"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11027,60 +11002,95 @@ private static class One_diamond_left { /** * Function descriptor for: * {@snippet lang=c : - * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) + * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, DiplomatString16View dstr16, DiplomatStringView utf8_str) * } */ - public static FunctionDescriptor One_diamond_left$descriptor() { - return One_diamond_left.DESC; + public static FunctionDescriptor BorrowedFields_from_bar_and_strings$descriptor() { + return BorrowedFields_from_bar_and_strings.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) + * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, DiplomatString16View dstr16, DiplomatStringView utf8_str) * } */ - public static MethodHandle One_diamond_left$handle() { - return One_diamond_left.HANDLE; + public static MethodHandle BorrowedFields_from_bar_and_strings$handle() { + return BorrowedFields_from_bar_and_strings.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) + * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, DiplomatString16View dstr16, DiplomatStringView utf8_str) * } */ - public static MemorySegment One_diamond_left$address() { - return One_diamond_left.ADDR; + public static MemorySegment BorrowedFields_from_bar_and_strings$address() { + return BorrowedFields_from_bar_and_strings.ADDR; } /** * {@snippet lang=c : - * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) + * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, DiplomatString16View dstr16, DiplomatStringView utf8_str) * } */ - public static MemorySegment One_diamond_left(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { - var mh$ = One_diamond_left.HANDLE; + public static MemorySegment BorrowedFields_from_bar_and_strings(SegmentAllocator allocator, MemorySegment bar, MemorySegment dstr16, MemorySegment utf8_str) { + var mh$ = BorrowedFields_from_bar_and_strings.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_diamond_left", top, left, right, bottom); + traceDowncall("BorrowedFields_from_bar_and_strings", allocator, bar, dstr16, utf8_str); } - return (MemorySegment)mh$.invokeExact(top, left, right, bottom); + return (MemorySegment)mh$.invokeExact(allocator, bar, dstr16, utf8_str); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } + private static final int ContiguousEnum_C = (int)0L; + /** + * {@snippet lang=c : + * enum ContiguousEnum.ContiguousEnum_C = 0 + * } + */ + public static int ContiguousEnum_C() { + return ContiguousEnum_C; + } + private static final int ContiguousEnum_D = (int)1L; + /** + * {@snippet lang=c : + * enum ContiguousEnum.ContiguousEnum_D = 1 + * } + */ + public static int ContiguousEnum_D() { + return ContiguousEnum_D; + } + private static final int ContiguousEnum_E = (int)2L; + /** + * {@snippet lang=c : + * enum ContiguousEnum.ContiguousEnum_E = 2 + * } + */ + public static int ContiguousEnum_E() { + return ContiguousEnum_E; + } + private static final int ContiguousEnum_F = (int)3L; + /** + * {@snippet lang=c : + * enum ContiguousEnum.ContiguousEnum_F = 3 + * } + */ + public static int ContiguousEnum_F() { + return ContiguousEnum_F; + } - private static class One_diamond_right { + private static class BorrowedFieldsWithBounds_from_foo_and_strings { public static final FunctionDescriptor DESC = FunctionDescriptor.of( + BorrowedFieldsWithBounds.layout(), somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER + DiplomatString16View.layout(), + DiplomatStringView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_right"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("BorrowedFieldsWithBounds_from_foo_and_strings"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11088,122 +11098,82 @@ private static class One_diamond_right { /** * Function descriptor for: * {@snippet lang=c : - * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) + * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, DiplomatString16View dstr16_x, DiplomatStringView utf8_str_z) * } */ - public static FunctionDescriptor One_diamond_right$descriptor() { - return One_diamond_right.DESC; + public static FunctionDescriptor BorrowedFieldsWithBounds_from_foo_and_strings$descriptor() { + return BorrowedFieldsWithBounds_from_foo_and_strings.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) + * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, DiplomatString16View dstr16_x, DiplomatStringView utf8_str_z) * } */ - public static MethodHandle One_diamond_right$handle() { - return One_diamond_right.HANDLE; + public static MethodHandle BorrowedFieldsWithBounds_from_foo_and_strings$handle() { + return BorrowedFieldsWithBounds_from_foo_and_strings.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) + * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, DiplomatString16View dstr16_x, DiplomatStringView utf8_str_z) * } */ - public static MemorySegment One_diamond_right$address() { - return One_diamond_right.ADDR; + public static MemorySegment BorrowedFieldsWithBounds_from_foo_and_strings$address() { + return BorrowedFieldsWithBounds_from_foo_and_strings.ADDR; } /** * {@snippet lang=c : - * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) + * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, DiplomatString16View dstr16_x, DiplomatStringView utf8_str_z) * } */ - public static MemorySegment One_diamond_right(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { - var mh$ = One_diamond_right.HANDLE; + public static MemorySegment BorrowedFieldsWithBounds_from_foo_and_strings(SegmentAllocator allocator, MemorySegment foo, MemorySegment dstr16_x, MemorySegment utf8_str_z) { + var mh$ = BorrowedFieldsWithBounds_from_foo_and_strings.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_diamond_right", top, left, right, bottom); + traceDowncall("BorrowedFieldsWithBounds_from_foo_and_strings", allocator, foo, dstr16_x, utf8_str_z); } - return (MemorySegment)mh$.invokeExact(top, left, right, bottom); + return (MemorySegment)mh$.invokeExact(allocator, foo, dstr16_x, utf8_str_z); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - - private static class One_diamond_bottom { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_bottom"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) - * } - */ - public static FunctionDescriptor One_diamond_bottom$descriptor() { - return One_diamond_bottom.DESC; - } - + private static final int UnimportedEnum_A = (int)0L; /** - * Downcall method handle for: * {@snippet lang=c : - * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) + * enum UnimportedEnum.UnimportedEnum_A = 0 * } */ - public static MethodHandle One_diamond_bottom$handle() { - return One_diamond_bottom.HANDLE; + public static int UnimportedEnum_A() { + return UnimportedEnum_A; } - + private static final int UnimportedEnum_B = (int)1L; /** - * Address for: * {@snippet lang=c : - * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) + * enum UnimportedEnum.UnimportedEnum_B = 1 * } */ - public static MemorySegment One_diamond_bottom$address() { - return One_diamond_bottom.ADDR; + public static int UnimportedEnum_B() { + return UnimportedEnum_B; } - + private static final int UnimportedEnum_C = (int)2L; /** * {@snippet lang=c : - * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) + * enum UnimportedEnum.UnimportedEnum_C = 2 * } */ - public static MemorySegment One_diamond_bottom(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { - var mh$ = One_diamond_bottom.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("One_diamond_bottom", top, left, right, bottom); - } - return (MemorySegment)mh$.invokeExact(top, left, right, bottom); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } + public static int UnimportedEnum_C() { + return UnimportedEnum_C; } - private static class One_diamond_and_nested_types { + private static class Opaque_new { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_and_nested_types"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_new"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11211,59 +11181,57 @@ private static class One_diamond_and_nested_types { /** * Function descriptor for: * {@snippet lang=c : - * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) + * Opaque *Opaque_new() * } */ - public static FunctionDescriptor One_diamond_and_nested_types$descriptor() { - return One_diamond_and_nested_types.DESC; + public static FunctionDescriptor Opaque_new$descriptor() { + return Opaque_new.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) + * Opaque *Opaque_new() * } */ - public static MethodHandle One_diamond_and_nested_types$handle() { - return One_diamond_and_nested_types.HANDLE; + public static MethodHandle Opaque_new$handle() { + return Opaque_new.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) + * Opaque *Opaque_new() * } */ - public static MemorySegment One_diamond_and_nested_types$address() { - return One_diamond_and_nested_types.ADDR; + public static MemorySegment Opaque_new$address() { + return Opaque_new.ADDR; } /** * {@snippet lang=c : - * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) + * Opaque *Opaque_new() * } */ - public static MemorySegment One_diamond_and_nested_types(MemorySegment a, MemorySegment b, MemorySegment c, MemorySegment d, MemorySegment nohold) { - var mh$ = One_diamond_and_nested_types.HANDLE; + public static MemorySegment Opaque_new() { + var mh$ = Opaque_new.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_diamond_and_nested_types", a, b, c, d, nohold); + traceDowncall("Opaque_new"); } - return (MemorySegment)mh$.invokeExact(a, b, c, d, nohold); + return (MemorySegment)mh$.invokeExact(); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_implicit_bounds { + private static class Opaque_from_str { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER + DiplomatStringView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_implicit_bounds"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_from_str"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11271,60 +11239,57 @@ private static class One_implicit_bounds { /** * Function descriptor for: * {@snippet lang=c : - * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) + * Opaque *Opaque_from_str(DiplomatStringView input) * } */ - public static FunctionDescriptor One_implicit_bounds$descriptor() { - return One_implicit_bounds.DESC; + public static FunctionDescriptor Opaque_from_str$descriptor() { + return Opaque_from_str.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) + * Opaque *Opaque_from_str(DiplomatStringView input) * } */ - public static MethodHandle One_implicit_bounds$handle() { - return One_implicit_bounds.HANDLE; + public static MethodHandle Opaque_from_str$handle() { + return Opaque_from_str.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) + * Opaque *Opaque_from_str(DiplomatStringView input) * } */ - public static MemorySegment One_implicit_bounds$address() { - return One_implicit_bounds.ADDR; + public static MemorySegment Opaque_from_str$address() { + return Opaque_from_str.ADDR; } /** * {@snippet lang=c : - * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) + * Opaque *Opaque_from_str(DiplomatStringView input) * } */ - public static MemorySegment One_implicit_bounds(MemorySegment explicit_hold, MemorySegment implicit_hold, MemorySegment nohold) { - var mh$ = One_implicit_bounds.HANDLE; + public static MemorySegment Opaque_from_str(MemorySegment input) { + var mh$ = Opaque_from_str.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_implicit_bounds", explicit_hold, implicit_hold, nohold); + traceDowncall("Opaque_from_str", input); } - return (MemorySegment)mh$.invokeExact(explicit_hold, implicit_hold, nohold); + return (MemorySegment)mh$.invokeExact(input); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_implicit_bounds_deep { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, + private static class Opaque_get_debug_str { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_implicit_bounds_deep"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_get_debug_str"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11332,56 +11297,57 @@ private static class One_implicit_bounds_deep { /** * Function descriptor for: * {@snippet lang=c : - * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) + * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) * } */ - public static FunctionDescriptor One_implicit_bounds_deep$descriptor() { - return One_implicit_bounds_deep.DESC; + public static FunctionDescriptor Opaque_get_debug_str$descriptor() { + return Opaque_get_debug_str.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) + * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) * } */ - public static MethodHandle One_implicit_bounds_deep$handle() { - return One_implicit_bounds_deep.HANDLE; + public static MethodHandle Opaque_get_debug_str$handle() { + return Opaque_get_debug_str.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) + * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) * } */ - public static MemorySegment One_implicit_bounds_deep$address() { - return One_implicit_bounds_deep.ADDR; + public static MemorySegment Opaque_get_debug_str$address() { + return Opaque_get_debug_str.ADDR; } /** * {@snippet lang=c : - * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) + * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) * } */ - public static MemorySegment One_implicit_bounds_deep(MemorySegment explicit_, MemorySegment implicit_1, MemorySegment implicit_2, MemorySegment nohold) { - var mh$ = One_implicit_bounds_deep.HANDLE; + public static void Opaque_get_debug_str(MemorySegment self, MemorySegment write) { + var mh$ = Opaque_get_debug_str.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_implicit_bounds_deep", explicit_, implicit_1, implicit_2, nohold); + traceDowncall("Opaque_get_debug_str", self, write); } - return (MemorySegment)mh$.invokeExact(explicit_, implicit_1, implicit_2, nohold); + mh$.invokeExact(self, write); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_destroy { + private static class Opaque_assert_struct { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER + somelib_h.C_POINTER, + MyStruct.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_assert_struct"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11389,57 +11355,55 @@ private static class One_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void One_destroy(One *self) + * void Opaque_assert_struct(const Opaque *self, MyStruct s) * } */ - public static FunctionDescriptor One_destroy$descriptor() { - return One_destroy.DESC; + public static FunctionDescriptor Opaque_assert_struct$descriptor() { + return Opaque_assert_struct.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void One_destroy(One *self) + * void Opaque_assert_struct(const Opaque *self, MyStruct s) * } */ - public static MethodHandle One_destroy$handle() { - return One_destroy.HANDLE; + public static MethodHandle Opaque_assert_struct$handle() { + return Opaque_assert_struct.HANDLE; } /** * Address for: * {@snippet lang=c : - * void One_destroy(One *self) + * void Opaque_assert_struct(const Opaque *self, MyStruct s) * } */ - public static MemorySegment One_destroy$address() { - return One_destroy.ADDR; + public static MemorySegment Opaque_assert_struct$address() { + return Opaque_assert_struct.ADDR; } /** * {@snippet lang=c : - * void One_destroy(One *self) + * void Opaque_assert_struct(const Opaque *self, MyStruct s) * } */ - public static void One_destroy(MemorySegment self) { - var mh$ = One_destroy.HANDLE; + public static void Opaque_assert_struct(MemorySegment self, MemorySegment s) { + var mh$ = Opaque_assert_struct.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_destroy", self); + traceDowncall("Opaque_assert_struct", self, s); } - mh$.invokeExact(self); + mh$.invokeExact(self, s); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class RefList_node { + private static class Opaque_returns_usize { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("RefList_node"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_returns_usize"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11447,56 +11411,57 @@ private static class RefList_node { /** * Function descriptor for: * {@snippet lang=c : - * RefList *RefList_node(const RefListParameter *data) + * size_t Opaque_returns_usize() * } */ - public static FunctionDescriptor RefList_node$descriptor() { - return RefList_node.DESC; + public static FunctionDescriptor Opaque_returns_usize$descriptor() { + return Opaque_returns_usize.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * RefList *RefList_node(const RefListParameter *data) + * size_t Opaque_returns_usize() * } */ - public static MethodHandle RefList_node$handle() { - return RefList_node.HANDLE; + public static MethodHandle Opaque_returns_usize$handle() { + return Opaque_returns_usize.HANDLE; } /** * Address for: * {@snippet lang=c : - * RefList *RefList_node(const RefListParameter *data) + * size_t Opaque_returns_usize() * } */ - public static MemorySegment RefList_node$address() { - return RefList_node.ADDR; + public static MemorySegment Opaque_returns_usize$address() { + return Opaque_returns_usize.ADDR; } /** * {@snippet lang=c : - * RefList *RefList_node(const RefListParameter *data) + * size_t Opaque_returns_usize() * } */ - public static MemorySegment RefList_node(MemorySegment data) { - var mh$ = RefList_node.HANDLE; + public static long Opaque_returns_usize() { + var mh$ = Opaque_returns_usize.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("RefList_node", data); + traceDowncall("Opaque_returns_usize"); } - return (MemorySegment)mh$.invokeExact(data); + return (long)mh$.invokeExact(); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class RefList_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class Opaque_internal_len { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_LONG, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("RefList_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_internal_len"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11504,58 +11469,55 @@ private static class RefList_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void RefList_destroy(RefList *self) + * size_t Opaque_internal_len(const Opaque *self) * } */ - public static FunctionDescriptor RefList_destroy$descriptor() { - return RefList_destroy.DESC; + public static FunctionDescriptor Opaque_internal_len$descriptor() { + return Opaque_internal_len.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void RefList_destroy(RefList *self) + * size_t Opaque_internal_len(const Opaque *self) * } */ - public static MethodHandle RefList_destroy$handle() { - return RefList_destroy.HANDLE; + public static MethodHandle Opaque_internal_len$handle() { + return Opaque_internal_len.HANDLE; } /** * Address for: * {@snippet lang=c : - * void RefList_destroy(RefList *self) + * size_t Opaque_internal_len(const Opaque *self) * } */ - public static MemorySegment RefList_destroy$address() { - return RefList_destroy.ADDR; + public static MemorySegment Opaque_internal_len$address() { + return Opaque_internal_len.ADDR; } /** * {@snippet lang=c : - * void RefList_destroy(RefList *self) + * size_t Opaque_internal_len(const Opaque *self) * } */ - public static void RefList_destroy(MemorySegment self) { - var mh$ = RefList_destroy.HANDLE; + public static long Opaque_internal_len(MemorySegment self) { + var mh$ = Opaque_internal_len.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("RefList_destroy", self); + traceDowncall("Opaque_internal_len", self); } - mh$.invokeExact(self); + return (long)mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_new_bool { + private static class Opaque_returns_imported { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG - ); + ImportedStruct.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_bool"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_returns_imported"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11563,58 +11525,55 @@ private static class Float64Vec_new_bool { /** * Function descriptor for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_bool(const bool *v_data, size_t v_len) + * ImportedStruct Opaque_returns_imported() * } */ - public static FunctionDescriptor Float64Vec_new_bool$descriptor() { - return Float64Vec_new_bool.DESC; + public static FunctionDescriptor Opaque_returns_imported$descriptor() { + return Opaque_returns_imported.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_bool(const bool *v_data, size_t v_len) + * ImportedStruct Opaque_returns_imported() * } */ - public static MethodHandle Float64Vec_new_bool$handle() { - return Float64Vec_new_bool.HANDLE; + public static MethodHandle Opaque_returns_imported$handle() { + return Opaque_returns_imported.HANDLE; } /** * Address for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_bool(const bool *v_data, size_t v_len) + * ImportedStruct Opaque_returns_imported() * } */ - public static MemorySegment Float64Vec_new_bool$address() { - return Float64Vec_new_bool.ADDR; + public static MemorySegment Opaque_returns_imported$address() { + return Opaque_returns_imported.ADDR; } /** * {@snippet lang=c : - * Float64Vec *Float64Vec_new_bool(const bool *v_data, size_t v_len) + * ImportedStruct Opaque_returns_imported() * } */ - public static MemorySegment Float64Vec_new_bool(MemorySegment v_data, long v_len) { - var mh$ = Float64Vec_new_bool.HANDLE; + public static MemorySegment Opaque_returns_imported(SegmentAllocator allocator) { + var mh$ = Opaque_returns_imported.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_new_bool", v_data, v_len); + traceDowncall("Opaque_returns_imported", allocator); } - return (MemorySegment)mh$.invokeExact(v_data, v_len); + return (MemorySegment)mh$.invokeExact(allocator); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_new_i16 { + private static class Opaque_cmp { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG - ); + somelib_h.C_CHAR ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_i16"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_cmp"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11622,58 +11581,56 @@ private static class Float64Vec_new_i16 { /** * Function descriptor for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_i16(const int16_t *v_data, size_t v_len) + * int8_t Opaque_cmp() * } */ - public static FunctionDescriptor Float64Vec_new_i16$descriptor() { - return Float64Vec_new_i16.DESC; + public static FunctionDescriptor Opaque_cmp$descriptor() { + return Opaque_cmp.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_i16(const int16_t *v_data, size_t v_len) + * int8_t Opaque_cmp() * } */ - public static MethodHandle Float64Vec_new_i16$handle() { - return Float64Vec_new_i16.HANDLE; + public static MethodHandle Opaque_cmp$handle() { + return Opaque_cmp.HANDLE; } /** * Address for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_i16(const int16_t *v_data, size_t v_len) + * int8_t Opaque_cmp() * } */ - public static MemorySegment Float64Vec_new_i16$address() { - return Float64Vec_new_i16.ADDR; + public static MemorySegment Opaque_cmp$address() { + return Opaque_cmp.ADDR; } /** * {@snippet lang=c : - * Float64Vec *Float64Vec_new_i16(const int16_t *v_data, size_t v_len) + * int8_t Opaque_cmp() * } */ - public static MemorySegment Float64Vec_new_i16(MemorySegment v_data, long v_len) { - var mh$ = Float64Vec_new_i16.HANDLE; + public static byte Opaque_cmp() { + var mh$ = Opaque_cmp.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_new_i16", v_data, v_len); + traceDowncall("Opaque_cmp"); } - return (MemorySegment)mh$.invokeExact(v_data, v_len); + return (byte)mh$.invokeExact(); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_new_u16 { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG + private static class Opaque_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_u16"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11681,58 +11638,58 @@ private static class Float64Vec_new_u16 { /** * Function descriptor for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_u16(const uint16_t *v_data, size_t v_len) + * void Opaque_destroy(Opaque *self) * } */ - public static FunctionDescriptor Float64Vec_new_u16$descriptor() { - return Float64Vec_new_u16.DESC; + public static FunctionDescriptor Opaque_destroy$descriptor() { + return Opaque_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_u16(const uint16_t *v_data, size_t v_len) + * void Opaque_destroy(Opaque *self) * } */ - public static MethodHandle Float64Vec_new_u16$handle() { - return Float64Vec_new_u16.HANDLE; + public static MethodHandle Opaque_destroy$handle() { + return Opaque_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_u16(const uint16_t *v_data, size_t v_len) + * void Opaque_destroy(Opaque *self) * } */ - public static MemorySegment Float64Vec_new_u16$address() { - return Float64Vec_new_u16.ADDR; + public static MemorySegment Opaque_destroy$address() { + return Opaque_destroy.ADDR; } /** * {@snippet lang=c : - * Float64Vec *Float64Vec_new_u16(const uint16_t *v_data, size_t v_len) + * void Opaque_destroy(Opaque *self) * } */ - public static MemorySegment Float64Vec_new_u16(MemorySegment v_data, long v_len) { - var mh$ = Float64Vec_new_u16.HANDLE; + public static void Opaque_destroy(MemorySegment self) { + var mh$ = Opaque_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_new_u16", v_data, v_len); + traceDowncall("Opaque_destroy", self); } - return (MemorySegment)mh$.invokeExact(v_data, v_len); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_new_isize { + private static class One_transitivity { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_isize"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_transitivity"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11740,58 +11697,58 @@ private static class Float64Vec_new_isize { /** * Function descriptor for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_isize(const intptr_t *v_data, size_t v_len) + * One *One_transitivity(const One *hold, const One *nohold) * } */ - public static FunctionDescriptor Float64Vec_new_isize$descriptor() { - return Float64Vec_new_isize.DESC; + public static FunctionDescriptor One_transitivity$descriptor() { + return One_transitivity.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_isize(const intptr_t *v_data, size_t v_len) + * One *One_transitivity(const One *hold, const One *nohold) * } */ - public static MethodHandle Float64Vec_new_isize$handle() { - return Float64Vec_new_isize.HANDLE; + public static MethodHandle One_transitivity$handle() { + return One_transitivity.HANDLE; } /** * Address for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_isize(const intptr_t *v_data, size_t v_len) + * One *One_transitivity(const One *hold, const One *nohold) * } */ - public static MemorySegment Float64Vec_new_isize$address() { - return Float64Vec_new_isize.ADDR; + public static MemorySegment One_transitivity$address() { + return One_transitivity.ADDR; } /** * {@snippet lang=c : - * Float64Vec *Float64Vec_new_isize(const intptr_t *v_data, size_t v_len) + * One *One_transitivity(const One *hold, const One *nohold) * } */ - public static MemorySegment Float64Vec_new_isize(MemorySegment v_data, long v_len) { - var mh$ = Float64Vec_new_isize.HANDLE; + public static MemorySegment One_transitivity(MemorySegment hold, MemorySegment nohold) { + var mh$ = One_transitivity.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_new_isize", v_data, v_len); + traceDowncall("One_transitivity", hold, nohold); } - return (MemorySegment)mh$.invokeExact(v_data, v_len); + return (MemorySegment)mh$.invokeExact(hold, nohold); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_new_usize { + private static class One_cycle { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_usize"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_cycle"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11799,58 +11756,61 @@ private static class Float64Vec_new_usize { /** * Function descriptor for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_usize(const size_t *v_data, size_t v_len) + * One *One_cycle(const Two *hold, const One *nohold) * } */ - public static FunctionDescriptor Float64Vec_new_usize$descriptor() { - return Float64Vec_new_usize.DESC; + public static FunctionDescriptor One_cycle$descriptor() { + return One_cycle.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_usize(const size_t *v_data, size_t v_len) + * One *One_cycle(const Two *hold, const One *nohold) * } */ - public static MethodHandle Float64Vec_new_usize$handle() { - return Float64Vec_new_usize.HANDLE; + public static MethodHandle One_cycle$handle() { + return One_cycle.HANDLE; } /** * Address for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_usize(const size_t *v_data, size_t v_len) + * One *One_cycle(const Two *hold, const One *nohold) * } */ - public static MemorySegment Float64Vec_new_usize$address() { - return Float64Vec_new_usize.ADDR; + public static MemorySegment One_cycle$address() { + return One_cycle.ADDR; } /** * {@snippet lang=c : - * Float64Vec *Float64Vec_new_usize(const size_t *v_data, size_t v_len) + * One *One_cycle(const Two *hold, const One *nohold) * } */ - public static MemorySegment Float64Vec_new_usize(MemorySegment v_data, long v_len) { - var mh$ = Float64Vec_new_usize.HANDLE; + public static MemorySegment One_cycle(MemorySegment hold, MemorySegment nohold) { + var mh$ = One_cycle.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_new_usize", v_data, v_len); + traceDowncall("One_cycle", hold, nohold); } - return (MemorySegment)mh$.invokeExact(v_data, v_len); + return (MemorySegment)mh$.invokeExact(hold, nohold); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_new_f64_be_bytes { + private static class One_many_dependents { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_f64_be_bytes"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_many_dependents"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11858,58 +11818,58 @@ private static class Float64Vec_new_f64_be_bytes { /** * Function descriptor for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_f64_be_bytes(const uint8_t *v_data, size_t v_len) + * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) * } */ - public static FunctionDescriptor Float64Vec_new_f64_be_bytes$descriptor() { - return Float64Vec_new_f64_be_bytes.DESC; + public static FunctionDescriptor One_many_dependents$descriptor() { + return One_many_dependents.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_f64_be_bytes(const uint8_t *v_data, size_t v_len) + * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) * } */ - public static MethodHandle Float64Vec_new_f64_be_bytes$handle() { - return Float64Vec_new_f64_be_bytes.HANDLE; + public static MethodHandle One_many_dependents$handle() { + return One_many_dependents.HANDLE; } /** * Address for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_f64_be_bytes(const uint8_t *v_data, size_t v_len) + * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) * } */ - public static MemorySegment Float64Vec_new_f64_be_bytes$address() { - return Float64Vec_new_f64_be_bytes.ADDR; + public static MemorySegment One_many_dependents$address() { + return One_many_dependents.ADDR; } /** * {@snippet lang=c : - * Float64Vec *Float64Vec_new_f64_be_bytes(const uint8_t *v_data, size_t v_len) + * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) * } */ - public static MemorySegment Float64Vec_new_f64_be_bytes(MemorySegment v_data, long v_len) { - var mh$ = Float64Vec_new_f64_be_bytes.HANDLE; + public static MemorySegment One_many_dependents(MemorySegment a, MemorySegment b, MemorySegment c, MemorySegment d, MemorySegment nohold) { + var mh$ = One_many_dependents.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_new_f64_be_bytes", v_data, v_len); + traceDowncall("One_many_dependents", a, b, c, d, nohold); } - return (MemorySegment)mh$.invokeExact(v_data, v_len); + return (MemorySegment)mh$.invokeExact(a, b, c, d, nohold); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_new_from_owned { + private static class One_return_outlives_param { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_from_owned"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_return_outlives_param"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11917,57 +11877,60 @@ private static class Float64Vec_new_from_owned { /** * Function descriptor for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_from_owned(double *v_data, size_t v_len) + * One *One_return_outlives_param(const Two *hold, const One *nohold) * } */ - public static FunctionDescriptor Float64Vec_new_from_owned$descriptor() { - return Float64Vec_new_from_owned.DESC; + public static FunctionDescriptor One_return_outlives_param$descriptor() { + return One_return_outlives_param.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_from_owned(double *v_data, size_t v_len) + * One *One_return_outlives_param(const Two *hold, const One *nohold) * } */ - public static MethodHandle Float64Vec_new_from_owned$handle() { - return Float64Vec_new_from_owned.HANDLE; + public static MethodHandle One_return_outlives_param$handle() { + return One_return_outlives_param.HANDLE; } /** * Address for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_from_owned(double *v_data, size_t v_len) + * One *One_return_outlives_param(const Two *hold, const One *nohold) * } */ - public static MemorySegment Float64Vec_new_from_owned$address() { - return Float64Vec_new_from_owned.ADDR; + public static MemorySegment One_return_outlives_param$address() { + return One_return_outlives_param.ADDR; } /** * {@snippet lang=c : - * Float64Vec *Float64Vec_new_from_owned(double *v_data, size_t v_len) + * One *One_return_outlives_param(const Two *hold, const One *nohold) * } */ - public static MemorySegment Float64Vec_new_from_owned(MemorySegment v_data, long v_len) { - var mh$ = Float64Vec_new_from_owned.HANDLE; + public static MemorySegment One_return_outlives_param(MemorySegment hold, MemorySegment nohold) { + var mh$ = One_return_outlives_param.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_new_from_owned", v_data, v_len); + traceDowncall("One_return_outlives_param", hold, nohold); } - return (MemorySegment)mh$.invokeExact(v_data, v_len); + return (MemorySegment)mh$.invokeExact(hold, nohold); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_as_slice { + private static class One_diamond_top { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - DiplomatF64View.layout(), + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_as_slice"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_top"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11975,58 +11938,60 @@ private static class Float64Vec_as_slice { /** * Function descriptor for: * {@snippet lang=c : - * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) + * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static FunctionDescriptor Float64Vec_as_slice$descriptor() { - return Float64Vec_as_slice.DESC; + public static FunctionDescriptor One_diamond_top$descriptor() { + return One_diamond_top.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) + * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MethodHandle Float64Vec_as_slice$handle() { - return Float64Vec_as_slice.HANDLE; + public static MethodHandle One_diamond_top$handle() { + return One_diamond_top.HANDLE; } /** * Address for: * {@snippet lang=c : - * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) + * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MemorySegment Float64Vec_as_slice$address() { - return Float64Vec_as_slice.ADDR; + public static MemorySegment One_diamond_top$address() { + return One_diamond_top.ADDR; } /** * {@snippet lang=c : - * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) + * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MemorySegment Float64Vec_as_slice(SegmentAllocator allocator, MemorySegment self) { - var mh$ = Float64Vec_as_slice.HANDLE; + public static MemorySegment One_diamond_top(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { + var mh$ = One_diamond_top.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_as_slice", allocator, self); + traceDowncall("One_diamond_top", top, left, right, bottom); } - return (MemorySegment)mh$.invokeExact(allocator, self); + return (MemorySegment)mh$.invokeExact(top, left, right, bottom); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_fill_slice { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class One_diamond_left { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_fill_slice"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_left"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12034,58 +11999,60 @@ private static class Float64Vec_fill_slice { /** * Function descriptor for: * {@snippet lang=c : - * void Float64Vec_fill_slice(const Float64Vec *self, double *v_data, size_t v_len) + * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static FunctionDescriptor Float64Vec_fill_slice$descriptor() { - return Float64Vec_fill_slice.DESC; + public static FunctionDescriptor One_diamond_left$descriptor() { + return One_diamond_left.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Float64Vec_fill_slice(const Float64Vec *self, double *v_data, size_t v_len) + * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MethodHandle Float64Vec_fill_slice$handle() { - return Float64Vec_fill_slice.HANDLE; + public static MethodHandle One_diamond_left$handle() { + return One_diamond_left.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Float64Vec_fill_slice(const Float64Vec *self, double *v_data, size_t v_len) + * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MemorySegment Float64Vec_fill_slice$address() { - return Float64Vec_fill_slice.ADDR; + public static MemorySegment One_diamond_left$address() { + return One_diamond_left.ADDR; } /** * {@snippet lang=c : - * void Float64Vec_fill_slice(const Float64Vec *self, double *v_data, size_t v_len) + * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static void Float64Vec_fill_slice(MemorySegment self, MemorySegment v_data, long v_len) { - var mh$ = Float64Vec_fill_slice.HANDLE; + public static MemorySegment One_diamond_left(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { + var mh$ = One_diamond_left.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_fill_slice", self, v_data, v_len); + traceDowncall("One_diamond_left", top, left, right, bottom); } - mh$.invokeExact(self, v_data, v_len); + return (MemorySegment)mh$.invokeExact(top, left, right, bottom); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_set_value { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class One_diamond_right { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_set_value"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_right"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12093,57 +12060,60 @@ private static class Float64Vec_set_value { /** * Function descriptor for: * {@snippet lang=c : - * void Float64Vec_set_value(Float64Vec *self, const double *new_slice_data, size_t new_slice_len) + * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static FunctionDescriptor Float64Vec_set_value$descriptor() { - return Float64Vec_set_value.DESC; + public static FunctionDescriptor One_diamond_right$descriptor() { + return One_diamond_right.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Float64Vec_set_value(Float64Vec *self, const double *new_slice_data, size_t new_slice_len) + * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MethodHandle Float64Vec_set_value$handle() { - return Float64Vec_set_value.HANDLE; + public static MethodHandle One_diamond_right$handle() { + return One_diamond_right.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Float64Vec_set_value(Float64Vec *self, const double *new_slice_data, size_t new_slice_len) + * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MemorySegment Float64Vec_set_value$address() { - return Float64Vec_set_value.ADDR; + public static MemorySegment One_diamond_right$address() { + return One_diamond_right.ADDR; } /** * {@snippet lang=c : - * void Float64Vec_set_value(Float64Vec *self, const double *new_slice_data, size_t new_slice_len) + * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static void Float64Vec_set_value(MemorySegment self, MemorySegment new_slice_data, long new_slice_len) { - var mh$ = Float64Vec_set_value.HANDLE; + public static MemorySegment One_diamond_right(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { + var mh$ = One_diamond_right.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_set_value", self, new_slice_data, new_slice_len); + traceDowncall("One_diamond_right", top, left, right, bottom); } - mh$.invokeExact(self, new_slice_data, new_slice_len); + return (MemorySegment)mh$.invokeExact(top, left, right, bottom); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_to_string { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class One_diamond_bottom { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_to_string"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_bottom"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12151,57 +12121,61 @@ private static class Float64Vec_to_string { /** * Function descriptor for: * {@snippet lang=c : - * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) + * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static FunctionDescriptor Float64Vec_to_string$descriptor() { - return Float64Vec_to_string.DESC; + public static FunctionDescriptor One_diamond_bottom$descriptor() { + return One_diamond_bottom.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) + * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MethodHandle Float64Vec_to_string$handle() { - return Float64Vec_to_string.HANDLE; + public static MethodHandle One_diamond_bottom$handle() { + return One_diamond_bottom.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) + * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MemorySegment Float64Vec_to_string$address() { - return Float64Vec_to_string.ADDR; + public static MemorySegment One_diamond_bottom$address() { + return One_diamond_bottom.ADDR; } /** * {@snippet lang=c : - * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) + * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static void Float64Vec_to_string(MemorySegment self, MemorySegment write) { - var mh$ = Float64Vec_to_string.HANDLE; + public static MemorySegment One_diamond_bottom(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { + var mh$ = One_diamond_bottom.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_to_string", self, write); + traceDowncall("One_diamond_bottom", top, left, right, bottom); } - mh$.invokeExact(self, write); + return (MemorySegment)mh$.invokeExact(top, left, right, bottom); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_borrow { + private static class One_diamond_and_nested_types { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - DiplomatF64View.layout(), + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_borrow"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_and_nested_types"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12209,56 +12183,59 @@ private static class Float64Vec_borrow { /** * Function descriptor for: * {@snippet lang=c : - * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) + * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) * } */ - public static FunctionDescriptor Float64Vec_borrow$descriptor() { - return Float64Vec_borrow.DESC; + public static FunctionDescriptor One_diamond_and_nested_types$descriptor() { + return One_diamond_and_nested_types.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) + * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) * } */ - public static MethodHandle Float64Vec_borrow$handle() { - return Float64Vec_borrow.HANDLE; + public static MethodHandle One_diamond_and_nested_types$handle() { + return One_diamond_and_nested_types.HANDLE; } /** * Address for: * {@snippet lang=c : - * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) + * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) * } */ - public static MemorySegment Float64Vec_borrow$address() { - return Float64Vec_borrow.ADDR; + public static MemorySegment One_diamond_and_nested_types$address() { + return One_diamond_and_nested_types.ADDR; } /** * {@snippet lang=c : - * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) + * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) * } */ - public static MemorySegment Float64Vec_borrow(SegmentAllocator allocator, MemorySegment self) { - var mh$ = Float64Vec_borrow.HANDLE; + public static MemorySegment One_diamond_and_nested_types(MemorySegment a, MemorySegment b, MemorySegment c, MemorySegment d, MemorySegment nohold) { + var mh$ = One_diamond_and_nested_types.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_borrow", allocator, self); + traceDowncall("One_diamond_and_nested_types", a, b, c, d, nohold); } - return (MemorySegment)mh$.invokeExact(allocator, self); + return (MemorySegment)mh$.invokeExact(a, b, c, d, nohold); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class One_implicit_bounds { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_implicit_bounds"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12266,111 +12243,60 @@ private static class Float64Vec_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void Float64Vec_destroy(Float64Vec *self) + * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) * } */ - public static FunctionDescriptor Float64Vec_destroy$descriptor() { - return Float64Vec_destroy.DESC; + public static FunctionDescriptor One_implicit_bounds$descriptor() { + return One_implicit_bounds.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Float64Vec_destroy(Float64Vec *self) + * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) * } */ - public static MethodHandle Float64Vec_destroy$handle() { - return Float64Vec_destroy.HANDLE; + public static MethodHandle One_implicit_bounds$handle() { + return One_implicit_bounds.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Float64Vec_destroy(Float64Vec *self) + * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) * } */ - public static MemorySegment Float64Vec_destroy$address() { - return Float64Vec_destroy.ADDR; + public static MemorySegment One_implicit_bounds$address() { + return One_implicit_bounds.ADDR; } /** * {@snippet lang=c : - * void Float64Vec_destroy(Float64Vec *self) + * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) * } */ - public static void Float64Vec_destroy(MemorySegment self) { - var mh$ = Float64Vec_destroy.HANDLE; + public static MemorySegment One_implicit_bounds(MemorySegment explicit_hold, MemorySegment implicit_hold, MemorySegment nohold) { + var mh$ = One_implicit_bounds.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_destroy", self); + traceDowncall("One_implicit_bounds", explicit_hold, implicit_hold, nohold); } - mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(explicit_hold, implicit_hold, nohold); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static final int MyEnum_A = (int)-2L; - /** - * {@snippet lang=c : - * enum MyEnum.MyEnum_A = -2 - * } - */ - public static int MyEnum_A() { - return MyEnum_A; - } - private static final int MyEnum_B = (int)-1L; - /** - * {@snippet lang=c : - * enum MyEnum.MyEnum_B = -1 - * } - */ - public static int MyEnum_B() { - return MyEnum_B; - } - private static final int MyEnum_C = (int)0L; - /** - * {@snippet lang=c : - * enum MyEnum.MyEnum_C = 0 - * } - */ - public static int MyEnum_C() { - return MyEnum_C; - } - private static final int MyEnum_D = (int)1L; - /** - * {@snippet lang=c : - * enum MyEnum.MyEnum_D = 1 - * } - */ - public static int MyEnum_D() { - return MyEnum_D; - } - private static final int MyEnum_E = (int)2L; - /** - * {@snippet lang=c : - * enum MyEnum.MyEnum_E = 2 - * } - */ - public static int MyEnum_E() { - return MyEnum_E; - } - private static final int MyEnum_F = (int)3L; - /** - * {@snippet lang=c : - * enum MyEnum.MyEnum_F = 3 - * } - */ - public static int MyEnum_F() { - return MyEnum_F; - } - private static class MyEnum_into_value { + private static class One_implicit_bounds_deep { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_CHAR, - somelib_h.C_INT + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyEnum_into_value"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_implicit_bounds_deep"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12378,55 +12304,56 @@ private static class MyEnum_into_value { /** * Function descriptor for: * {@snippet lang=c : - * int8_t MyEnum_into_value(MyEnum self) + * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) * } */ - public static FunctionDescriptor MyEnum_into_value$descriptor() { - return MyEnum_into_value.DESC; + public static FunctionDescriptor One_implicit_bounds_deep$descriptor() { + return One_implicit_bounds_deep.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int8_t MyEnum_into_value(MyEnum self) + * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) * } */ - public static MethodHandle MyEnum_into_value$handle() { - return MyEnum_into_value.HANDLE; + public static MethodHandle One_implicit_bounds_deep$handle() { + return One_implicit_bounds_deep.HANDLE; } /** * Address for: * {@snippet lang=c : - * int8_t MyEnum_into_value(MyEnum self) + * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) * } */ - public static MemorySegment MyEnum_into_value$address() { - return MyEnum_into_value.ADDR; + public static MemorySegment One_implicit_bounds_deep$address() { + return One_implicit_bounds_deep.ADDR; } /** * {@snippet lang=c : - * int8_t MyEnum_into_value(MyEnum self) + * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) * } */ - public static byte MyEnum_into_value(int self) { - var mh$ = MyEnum_into_value.HANDLE; + public static MemorySegment One_implicit_bounds_deep(MemorySegment explicit_, MemorySegment implicit_1, MemorySegment implicit_2, MemorySegment nohold) { + var mh$ = One_implicit_bounds_deep.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyEnum_into_value", self); + traceDowncall("One_implicit_bounds_deep", explicit_, implicit_1, implicit_2, nohold); } - return (byte)mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(explicit_, implicit_1, implicit_2, nohold); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyEnum_get_a { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT ); + private static class One_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyEnum_get_a"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12434,49 +12361,67 @@ private static class MyEnum_get_a { /** * Function descriptor for: * {@snippet lang=c : - * MyEnum MyEnum_get_a() + * void One_destroy(One *self) * } */ - public static FunctionDescriptor MyEnum_get_a$descriptor() { - return MyEnum_get_a.DESC; + public static FunctionDescriptor One_destroy$descriptor() { + return One_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * MyEnum MyEnum_get_a() + * void One_destroy(One *self) * } */ - public static MethodHandle MyEnum_get_a$handle() { - return MyEnum_get_a.HANDLE; + public static MethodHandle One_destroy$handle() { + return One_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * MyEnum MyEnum_get_a() + * void One_destroy(One *self) * } */ - public static MemorySegment MyEnum_get_a$address() { - return MyEnum_get_a.ADDR; + public static MemorySegment One_destroy$address() { + return One_destroy.ADDR; } /** * {@snippet lang=c : - * MyEnum MyEnum_get_a() + * void One_destroy(One *self) * } */ - public static int MyEnum_get_a() { - var mh$ = MyEnum_get_a.HANDLE; + public static void One_destroy(MemorySegment self) { + var mh$ = One_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyEnum_get_a"); + traceDowncall("One_destroy", self); } - return (int)mh$.invokeExact(); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } + private static final int ErrorEnum_Foo = (int)0L; + /** + * {@snippet lang=c : + * enum ErrorEnum.ErrorEnum_Foo = 0 + * } + */ + public static int ErrorEnum_Foo() { + return ErrorEnum_Foo; + } + private static final int ErrorEnum_Bar = (int)1L; + /** + * {@snippet lang=c : + * enum ErrorEnum.ErrorEnum_Bar = 1 + * } + */ + public static int ErrorEnum_Bar() { + return ErrorEnum_Bar; + } private static class OpaqueMutexedString_from_usize { public static final FunctionDescriptor DESC = FunctionDescriptor.of( @@ -13001,11 +12946,13 @@ public static void OpaqueMutexedString_destroy(MemorySegment self) { } } - private static class CyclicStructB_get_a { + private static class RefList_node { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - CyclicStructA.layout() ); + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("CyclicStructB_get_a"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("RefList_node"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13013,91 +12960,113 @@ private static class CyclicStructB_get_a { /** * Function descriptor for: * {@snippet lang=c : - * CyclicStructA CyclicStructB_get_a() + * RefList *RefList_node(const RefListParameter *data) * } */ - public static FunctionDescriptor CyclicStructB_get_a$descriptor() { - return CyclicStructB_get_a.DESC; + public static FunctionDescriptor RefList_node$descriptor() { + return RefList_node.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * CyclicStructA CyclicStructB_get_a() + * RefList *RefList_node(const RefListParameter *data) * } */ - public static MethodHandle CyclicStructB_get_a$handle() { - return CyclicStructB_get_a.HANDLE; + public static MethodHandle RefList_node$handle() { + return RefList_node.HANDLE; } /** * Address for: * {@snippet lang=c : - * CyclicStructA CyclicStructB_get_a() + * RefList *RefList_node(const RefListParameter *data) * } */ - public static MemorySegment CyclicStructB_get_a$address() { - return CyclicStructB_get_a.ADDR; + public static MemorySegment RefList_node$address() { + return RefList_node.ADDR; } /** * {@snippet lang=c : - * CyclicStructA CyclicStructB_get_a() + * RefList *RefList_node(const RefListParameter *data) * } */ - public static MemorySegment CyclicStructB_get_a(SegmentAllocator allocator) { - var mh$ = CyclicStructB_get_a.HANDLE; + public static MemorySegment RefList_node(MemorySegment data) { + var mh$ = RefList_node.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("CyclicStructB_get_a", allocator); + traceDowncall("RefList_node", data); } - return (MemorySegment)mh$.invokeExact(allocator); + return (MemorySegment)mh$.invokeExact(data); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static final int ContiguousEnum_C = (int)0L; + + private static class RefList_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("RefList_destroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + /** + * Function descriptor for: * {@snippet lang=c : - * enum ContiguousEnum.ContiguousEnum_C = 0 + * void RefList_destroy(RefList *self) * } */ - public static int ContiguousEnum_C() { - return ContiguousEnum_C; + public static FunctionDescriptor RefList_destroy$descriptor() { + return RefList_destroy.DESC; } - private static final int ContiguousEnum_D = (int)1L; + /** + * Downcall method handle for: * {@snippet lang=c : - * enum ContiguousEnum.ContiguousEnum_D = 1 + * void RefList_destroy(RefList *self) * } */ - public static int ContiguousEnum_D() { - return ContiguousEnum_D; + public static MethodHandle RefList_destroy$handle() { + return RefList_destroy.HANDLE; } - private static final int ContiguousEnum_E = (int)2L; + /** + * Address for: * {@snippet lang=c : - * enum ContiguousEnum.ContiguousEnum_E = 2 + * void RefList_destroy(RefList *self) * } */ - public static int ContiguousEnum_E() { - return ContiguousEnum_E; + public static MemorySegment RefList_destroy$address() { + return RefList_destroy.ADDR; } - private static final int ContiguousEnum_F = (int)3L; + /** * {@snippet lang=c : - * enum ContiguousEnum.ContiguousEnum_F = 3 + * void RefList_destroy(RefList *self) * } */ - public static int ContiguousEnum_F() { - return ContiguousEnum_F; + public static void RefList_destroy(MemorySegment self) { + var mh$ = RefList_destroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("RefList_destroy", self); + } + mh$.invokeExact(self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } } - private static class Opaque_new { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER ); + private static class Two_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_new"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Two_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13105,58 +13074,56 @@ private static class Opaque_new { /** * Function descriptor for: * {@snippet lang=c : - * Opaque *Opaque_new() + * void Two_destroy(Two *self) * } */ - public static FunctionDescriptor Opaque_new$descriptor() { - return Opaque_new.DESC; + public static FunctionDescriptor Two_destroy$descriptor() { + return Two_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Opaque *Opaque_new() + * void Two_destroy(Two *self) * } */ - public static MethodHandle Opaque_new$handle() { - return Opaque_new.HANDLE; + public static MethodHandle Two_destroy$handle() { + return Two_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * Opaque *Opaque_new() + * void Two_destroy(Two *self) * } */ - public static MemorySegment Opaque_new$address() { - return Opaque_new.ADDR; + public static MemorySegment Two_destroy$address() { + return Two_destroy.ADDR; } /** * {@snippet lang=c : - * Opaque *Opaque_new() + * void Two_destroy(Two *self) * } */ - public static MemorySegment Opaque_new() { - var mh$ = Opaque_new.HANDLE; + public static void Two_destroy(MemorySegment self) { + var mh$ = Two_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_new"); + traceDowncall("Two_destroy", self); } - return (MemorySegment)mh$.invokeExact(); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Opaque_from_str { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG + private static class RefListParameter_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_from_str"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("RefListParameter_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13164,57 +13131,55 @@ private static class Opaque_from_str { /** * Function descriptor for: * {@snippet lang=c : - * Opaque *Opaque_from_str(const char *input_data, size_t input_len) + * void RefListParameter_destroy(RefListParameter *self) * } */ - public static FunctionDescriptor Opaque_from_str$descriptor() { - return Opaque_from_str.DESC; + public static FunctionDescriptor RefListParameter_destroy$descriptor() { + return RefListParameter_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Opaque *Opaque_from_str(const char *input_data, size_t input_len) + * void RefListParameter_destroy(RefListParameter *self) * } */ - public static MethodHandle Opaque_from_str$handle() { - return Opaque_from_str.HANDLE; + public static MethodHandle RefListParameter_destroy$handle() { + return RefListParameter_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * Opaque *Opaque_from_str(const char *input_data, size_t input_len) + * void RefListParameter_destroy(RefListParameter *self) * } */ - public static MemorySegment Opaque_from_str$address() { - return Opaque_from_str.ADDR; + public static MemorySegment RefListParameter_destroy$address() { + return RefListParameter_destroy.ADDR; } /** * {@snippet lang=c : - * Opaque *Opaque_from_str(const char *input_data, size_t input_len) + * void RefListParameter_destroy(RefListParameter *self) * } */ - public static MemorySegment Opaque_from_str(MemorySegment input_data, long input_len) { - var mh$ = Opaque_from_str.HANDLE; + public static void RefListParameter_destroy(MemorySegment self) { + var mh$ = RefListParameter_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_from_str", input_data, input_len); + traceDowncall("RefListParameter_destroy", self); } - return (MemorySegment)mh$.invokeExact(input_data, input_len); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Opaque_get_debug_str { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); + private static class CyclicStructB_get_a { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + CyclicStructA.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_get_debug_str"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("CyclicStructB_get_a"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13222,57 +13187,57 @@ private static class Opaque_get_debug_str { /** * Function descriptor for: * {@snippet lang=c : - * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) + * CyclicStructA CyclicStructB_get_a() * } */ - public static FunctionDescriptor Opaque_get_debug_str$descriptor() { - return Opaque_get_debug_str.DESC; + public static FunctionDescriptor CyclicStructB_get_a$descriptor() { + return CyclicStructB_get_a.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) + * CyclicStructA CyclicStructB_get_a() * } */ - public static MethodHandle Opaque_get_debug_str$handle() { - return Opaque_get_debug_str.HANDLE; + public static MethodHandle CyclicStructB_get_a$handle() { + return CyclicStructB_get_a.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) + * CyclicStructA CyclicStructB_get_a() * } */ - public static MemorySegment Opaque_get_debug_str$address() { - return Opaque_get_debug_str.ADDR; + public static MemorySegment CyclicStructB_get_a$address() { + return CyclicStructB_get_a.ADDR; } /** * {@snippet lang=c : - * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) + * CyclicStructA CyclicStructB_get_a() * } */ - public static void Opaque_get_debug_str(MemorySegment self, MemorySegment write) { - var mh$ = Opaque_get_debug_str.HANDLE; + public static MemorySegment CyclicStructB_get_a(SegmentAllocator allocator) { + var mh$ = CyclicStructB_get_a.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_get_debug_str", self, write); + traceDowncall("CyclicStructB_get_a", allocator); } - mh$.invokeExact(self, write); + return (MemorySegment)mh$.invokeExact(allocator); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Opaque_assert_struct { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class Foo_new { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - MyStruct.layout() + DiplomatStringView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_assert_struct"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_new"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13280,55 +13245,57 @@ private static class Opaque_assert_struct { /** * Function descriptor for: * {@snippet lang=c : - * void Opaque_assert_struct(const Opaque *self, MyStruct s) + * Foo *Foo_new(DiplomatStringView x) * } */ - public static FunctionDescriptor Opaque_assert_struct$descriptor() { - return Opaque_assert_struct.DESC; + public static FunctionDescriptor Foo_new$descriptor() { + return Foo_new.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Opaque_assert_struct(const Opaque *self, MyStruct s) + * Foo *Foo_new(DiplomatStringView x) * } */ - public static MethodHandle Opaque_assert_struct$handle() { - return Opaque_assert_struct.HANDLE; + public static MethodHandle Foo_new$handle() { + return Foo_new.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Opaque_assert_struct(const Opaque *self, MyStruct s) + * Foo *Foo_new(DiplomatStringView x) * } */ - public static MemorySegment Opaque_assert_struct$address() { - return Opaque_assert_struct.ADDR; + public static MemorySegment Foo_new$address() { + return Foo_new.ADDR; } /** * {@snippet lang=c : - * void Opaque_assert_struct(const Opaque *self, MyStruct s) + * Foo *Foo_new(DiplomatStringView x) * } - */ - public static void Opaque_assert_struct(MemorySegment self, MemorySegment s) { - var mh$ = Opaque_assert_struct.HANDLE; + */ + public static MemorySegment Foo_new(MemorySegment x) { + var mh$ = Foo_new.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_assert_struct", self, s); + traceDowncall("Foo_new", x); } - mh$.invokeExact(self, s); + return (MemorySegment)mh$.invokeExact(x); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Opaque_returns_usize { + private static class Foo_get_bar { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_LONG ); + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_returns_usize"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_get_bar"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13336,57 +13303,57 @@ private static class Opaque_returns_usize { /** * Function descriptor for: * {@snippet lang=c : - * size_t Opaque_returns_usize() + * Bar *Foo_get_bar(const Foo *self) * } */ - public static FunctionDescriptor Opaque_returns_usize$descriptor() { - return Opaque_returns_usize.DESC; + public static FunctionDescriptor Foo_get_bar$descriptor() { + return Foo_get_bar.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * size_t Opaque_returns_usize() + * Bar *Foo_get_bar(const Foo *self) * } */ - public static MethodHandle Opaque_returns_usize$handle() { - return Opaque_returns_usize.HANDLE; + public static MethodHandle Foo_get_bar$handle() { + return Foo_get_bar.HANDLE; } /** * Address for: * {@snippet lang=c : - * size_t Opaque_returns_usize() + * Bar *Foo_get_bar(const Foo *self) * } */ - public static MemorySegment Opaque_returns_usize$address() { - return Opaque_returns_usize.ADDR; + public static MemorySegment Foo_get_bar$address() { + return Foo_get_bar.ADDR; } /** * {@snippet lang=c : - * size_t Opaque_returns_usize() + * Bar *Foo_get_bar(const Foo *self) * } */ - public static long Opaque_returns_usize() { - var mh$ = Opaque_returns_usize.HANDLE; + public static MemorySegment Foo_get_bar(MemorySegment self) { + var mh$ = Foo_get_bar.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_returns_usize"); + traceDowncall("Foo_get_bar", self); } - return (long)mh$.invokeExact(); + return (MemorySegment)mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Opaque_internal_len { + private static class Foo_new_static { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_LONG, - somelib_h.C_POINTER + somelib_h.C_POINTER, + DiplomatStringView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_internal_len"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_new_static"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13394,55 +13361,57 @@ private static class Opaque_internal_len { /** * Function descriptor for: * {@snippet lang=c : - * size_t Opaque_internal_len(const Opaque *self) + * Foo *Foo_new_static(DiplomatStringView x) * } */ - public static FunctionDescriptor Opaque_internal_len$descriptor() { - return Opaque_internal_len.DESC; + public static FunctionDescriptor Foo_new_static$descriptor() { + return Foo_new_static.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * size_t Opaque_internal_len(const Opaque *self) + * Foo *Foo_new_static(DiplomatStringView x) * } */ - public static MethodHandle Opaque_internal_len$handle() { - return Opaque_internal_len.HANDLE; + public static MethodHandle Foo_new_static$handle() { + return Foo_new_static.HANDLE; } /** * Address for: * {@snippet lang=c : - * size_t Opaque_internal_len(const Opaque *self) + * Foo *Foo_new_static(DiplomatStringView x) * } */ - public static MemorySegment Opaque_internal_len$address() { - return Opaque_internal_len.ADDR; + public static MemorySegment Foo_new_static$address() { + return Foo_new_static.ADDR; } /** * {@snippet lang=c : - * size_t Opaque_internal_len(const Opaque *self) + * Foo *Foo_new_static(DiplomatStringView x) * } */ - public static long Opaque_internal_len(MemorySegment self) { - var mh$ = Opaque_internal_len.HANDLE; + public static MemorySegment Foo_new_static(MemorySegment x) { + var mh$ = Foo_new_static.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_internal_len", self); + traceDowncall("Foo_new_static", x); } - return (long)mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(x); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Opaque_returns_imported { + private static class Foo_as_returning { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - ImportedStruct.layout() ); + BorrowedFieldsReturning.layout(), + somelib_h.C_POINTER + ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_returns_imported"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_as_returning"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13450,55 +13419,57 @@ private static class Opaque_returns_imported { /** * Function descriptor for: * {@snippet lang=c : - * ImportedStruct Opaque_returns_imported() + * BorrowedFieldsReturning Foo_as_returning(const Foo *self) * } */ - public static FunctionDescriptor Opaque_returns_imported$descriptor() { - return Opaque_returns_imported.DESC; + public static FunctionDescriptor Foo_as_returning$descriptor() { + return Foo_as_returning.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * ImportedStruct Opaque_returns_imported() + * BorrowedFieldsReturning Foo_as_returning(const Foo *self) * } */ - public static MethodHandle Opaque_returns_imported$handle() { - return Opaque_returns_imported.HANDLE; + public static MethodHandle Foo_as_returning$handle() { + return Foo_as_returning.HANDLE; } /** * Address for: * {@snippet lang=c : - * ImportedStruct Opaque_returns_imported() + * BorrowedFieldsReturning Foo_as_returning(const Foo *self) * } */ - public static MemorySegment Opaque_returns_imported$address() { - return Opaque_returns_imported.ADDR; + public static MemorySegment Foo_as_returning$address() { + return Foo_as_returning.ADDR; } /** * {@snippet lang=c : - * ImportedStruct Opaque_returns_imported() + * BorrowedFieldsReturning Foo_as_returning(const Foo *self) * } */ - public static MemorySegment Opaque_returns_imported(SegmentAllocator allocator) { - var mh$ = Opaque_returns_imported.HANDLE; + public static MemorySegment Foo_as_returning(SegmentAllocator allocator, MemorySegment self) { + var mh$ = Foo_as_returning.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_returns_imported", allocator); + traceDowncall("Foo_as_returning", allocator, self); } - return (MemorySegment)mh$.invokeExact(allocator); + return (MemorySegment)mh$.invokeExact(allocator, self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Opaque_cmp { + private static class Foo_extract_from_fields { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_CHAR ); + somelib_h.C_POINTER, + BorrowedFields.layout() + ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_cmp"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_extract_from_fields"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13506,56 +13477,58 @@ private static class Opaque_cmp { /** * Function descriptor for: * {@snippet lang=c : - * int8_t Opaque_cmp() + * Foo *Foo_extract_from_fields(BorrowedFields fields) * } */ - public static FunctionDescriptor Opaque_cmp$descriptor() { - return Opaque_cmp.DESC; + public static FunctionDescriptor Foo_extract_from_fields$descriptor() { + return Foo_extract_from_fields.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int8_t Opaque_cmp() + * Foo *Foo_extract_from_fields(BorrowedFields fields) * } */ - public static MethodHandle Opaque_cmp$handle() { - return Opaque_cmp.HANDLE; + public static MethodHandle Foo_extract_from_fields$handle() { + return Foo_extract_from_fields.HANDLE; } /** * Address for: * {@snippet lang=c : - * int8_t Opaque_cmp() + * Foo *Foo_extract_from_fields(BorrowedFields fields) * } */ - public static MemorySegment Opaque_cmp$address() { - return Opaque_cmp.ADDR; + public static MemorySegment Foo_extract_from_fields$address() { + return Foo_extract_from_fields.ADDR; } /** * {@snippet lang=c : - * int8_t Opaque_cmp() + * Foo *Foo_extract_from_fields(BorrowedFields fields) * } */ - public static byte Opaque_cmp() { - var mh$ = Opaque_cmp.HANDLE; + public static MemorySegment Foo_extract_from_fields(MemorySegment fields) { + var mh$ = Foo_extract_from_fields.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_cmp"); + traceDowncall("Foo_extract_from_fields", fields); } - return (byte)mh$.invokeExact(); + return (MemorySegment)mh$.invokeExact(fields); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Opaque_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER + private static class Foo_extract_from_bounds { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + BorrowedFieldsWithBounds.layout(), + DiplomatStringView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_extract_from_bounds"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13563,58 +13536,56 @@ private static class Opaque_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void Opaque_destroy(Opaque *self) + * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, DiplomatStringView another_string) * } */ - public static FunctionDescriptor Opaque_destroy$descriptor() { - return Opaque_destroy.DESC; + public static FunctionDescriptor Foo_extract_from_bounds$descriptor() { + return Foo_extract_from_bounds.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Opaque_destroy(Opaque *self) + * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, DiplomatStringView another_string) * } */ - public static MethodHandle Opaque_destroy$handle() { - return Opaque_destroy.HANDLE; + public static MethodHandle Foo_extract_from_bounds$handle() { + return Foo_extract_from_bounds.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Opaque_destroy(Opaque *self) + * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, DiplomatStringView another_string) * } */ - public static MemorySegment Opaque_destroy$address() { - return Opaque_destroy.ADDR; + public static MemorySegment Foo_extract_from_bounds$address() { + return Foo_extract_from_bounds.ADDR; } /** * {@snippet lang=c : - * void Opaque_destroy(Opaque *self) + * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, DiplomatStringView another_string) * } */ - public static void Opaque_destroy(MemorySegment self) { - var mh$ = Opaque_destroy.HANDLE; + public static MemorySegment Foo_extract_from_bounds(MemorySegment bounds, MemorySegment another_string) { + var mh$ = Foo_extract_from_bounds.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_destroy", self); + traceDowncall("Foo_extract_from_bounds", bounds, another_string); } - mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(bounds, another_string); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Foo_new { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG + private static class Foo_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_new"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13622,57 +13593,62 @@ private static class Foo_new { /** * Function descriptor for: * {@snippet lang=c : - * Foo *Foo_new(const char *x_data, size_t x_len) + * void Foo_destroy(Foo *self) * } */ - public static FunctionDescriptor Foo_new$descriptor() { - return Foo_new.DESC; + public static FunctionDescriptor Foo_destroy$descriptor() { + return Foo_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Foo *Foo_new(const char *x_data, size_t x_len) + * void Foo_destroy(Foo *self) * } */ - public static MethodHandle Foo_new$handle() { - return Foo_new.HANDLE; + public static MethodHandle Foo_destroy$handle() { + return Foo_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * Foo *Foo_new(const char *x_data, size_t x_len) + * void Foo_destroy(Foo *self) * } */ - public static MemorySegment Foo_new$address() { - return Foo_new.ADDR; + public static MemorySegment Foo_destroy$address() { + return Foo_destroy.ADDR; } /** * {@snippet lang=c : - * Foo *Foo_new(const char *x_data, size_t x_len) + * void Foo_destroy(Foo *self) * } */ - public static MemorySegment Foo_new(MemorySegment x_data, long x_len) { - var mh$ = Foo_new.HANDLE; + public static void Foo_destroy(MemorySegment self) { + var mh$ = Foo_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Foo_new", x_data, x_len); + traceDowncall("Foo_destroy", self); } - return (MemorySegment)mh$.invokeExact(x_data, x_len); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Foo_get_bar { + private static class NestedBorrowedFields_from_bar_and_foo_and_strings { public static final FunctionDescriptor DESC = FunctionDescriptor.of( + NestedBorrowedFields.layout(), somelib_h.C_POINTER, - somelib_h.C_POINTER + somelib_h.C_POINTER, + DiplomatString16View.layout(), + DiplomatString16View.layout(), + DiplomatStringView.layout(), + DiplomatStringView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_get_bar"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("NestedBorrowedFields_from_bar_and_foo_and_strings"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13680,58 +13656,57 @@ private static class Foo_get_bar { /** * Function descriptor for: * {@snippet lang=c : - * Bar *Foo_get_bar(const Foo *self) + * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, DiplomatString16View dstr16_x, DiplomatString16View dstr16_z, DiplomatStringView utf8_str_y, DiplomatStringView utf8_str_z) * } */ - public static FunctionDescriptor Foo_get_bar$descriptor() { - return Foo_get_bar.DESC; + public static FunctionDescriptor NestedBorrowedFields_from_bar_and_foo_and_strings$descriptor() { + return NestedBorrowedFields_from_bar_and_foo_and_strings.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Bar *Foo_get_bar(const Foo *self) + * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, DiplomatString16View dstr16_x, DiplomatString16View dstr16_z, DiplomatStringView utf8_str_y, DiplomatStringView utf8_str_z) * } */ - public static MethodHandle Foo_get_bar$handle() { - return Foo_get_bar.HANDLE; + public static MethodHandle NestedBorrowedFields_from_bar_and_foo_and_strings$handle() { + return NestedBorrowedFields_from_bar_and_foo_and_strings.HANDLE; } /** * Address for: * {@snippet lang=c : - * Bar *Foo_get_bar(const Foo *self) + * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, DiplomatString16View dstr16_x, DiplomatString16View dstr16_z, DiplomatStringView utf8_str_y, DiplomatStringView utf8_str_z) * } */ - public static MemorySegment Foo_get_bar$address() { - return Foo_get_bar.ADDR; + public static MemorySegment NestedBorrowedFields_from_bar_and_foo_and_strings$address() { + return NestedBorrowedFields_from_bar_and_foo_and_strings.ADDR; } /** * {@snippet lang=c : - * Bar *Foo_get_bar(const Foo *self) + * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, DiplomatString16View dstr16_x, DiplomatString16View dstr16_z, DiplomatStringView utf8_str_y, DiplomatStringView utf8_str_z) * } */ - public static MemorySegment Foo_get_bar(MemorySegment self) { - var mh$ = Foo_get_bar.HANDLE; + public static MemorySegment NestedBorrowedFields_from_bar_and_foo_and_strings(SegmentAllocator allocator, MemorySegment bar, MemorySegment foo, MemorySegment dstr16_x, MemorySegment dstr16_z, MemorySegment utf8_str_y, MemorySegment utf8_str_z) { + var mh$ = NestedBorrowedFields_from_bar_and_foo_and_strings.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Foo_get_bar", self); + traceDowncall("NestedBorrowedFields_from_bar_and_foo_and_strings", allocator, bar, foo, dstr16_x, dstr16_z, utf8_str_y, utf8_str_z); } - return (MemorySegment)mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(allocator, bar, foo, dstr16_x, dstr16_z, utf8_str_y, utf8_str_z); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Foo_new_static { + private static class Float64Vec_new_bool { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG + DiplomatBoolView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_new_static"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_bool"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13739,57 +13714,57 @@ private static class Foo_new_static { /** * Function descriptor for: * {@snippet lang=c : - * Foo *Foo_new_static(const char *x_data, size_t x_len) + * Float64Vec *Float64Vec_new_bool(DiplomatBoolView v) * } */ - public static FunctionDescriptor Foo_new_static$descriptor() { - return Foo_new_static.DESC; + public static FunctionDescriptor Float64Vec_new_bool$descriptor() { + return Float64Vec_new_bool.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Foo *Foo_new_static(const char *x_data, size_t x_len) + * Float64Vec *Float64Vec_new_bool(DiplomatBoolView v) * } */ - public static MethodHandle Foo_new_static$handle() { - return Foo_new_static.HANDLE; + public static MethodHandle Float64Vec_new_bool$handle() { + return Float64Vec_new_bool.HANDLE; } /** * Address for: * {@snippet lang=c : - * Foo *Foo_new_static(const char *x_data, size_t x_len) + * Float64Vec *Float64Vec_new_bool(DiplomatBoolView v) * } */ - public static MemorySegment Foo_new_static$address() { - return Foo_new_static.ADDR; + public static MemorySegment Float64Vec_new_bool$address() { + return Float64Vec_new_bool.ADDR; } /** * {@snippet lang=c : - * Foo *Foo_new_static(const char *x_data, size_t x_len) + * Float64Vec *Float64Vec_new_bool(DiplomatBoolView v) * } */ - public static MemorySegment Foo_new_static(MemorySegment x_data, long x_len) { - var mh$ = Foo_new_static.HANDLE; + public static MemorySegment Float64Vec_new_bool(MemorySegment v) { + var mh$ = Float64Vec_new_bool.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Foo_new_static", x_data, x_len); + traceDowncall("Float64Vec_new_bool", v); } - return (MemorySegment)mh$.invokeExact(x_data, x_len); + return (MemorySegment)mh$.invokeExact(v); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Foo_as_returning { + private static class Float64Vec_new_i16 { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - BorrowedFieldsReturning.layout(), - somelib_h.C_POINTER + somelib_h.C_POINTER, + DiplomatI16View.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_as_returning"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_i16"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13797,57 +13772,57 @@ private static class Foo_as_returning { /** * Function descriptor for: * {@snippet lang=c : - * BorrowedFieldsReturning Foo_as_returning(const Foo *self) + * Float64Vec *Float64Vec_new_i16(DiplomatI16View v) * } */ - public static FunctionDescriptor Foo_as_returning$descriptor() { - return Foo_as_returning.DESC; + public static FunctionDescriptor Float64Vec_new_i16$descriptor() { + return Float64Vec_new_i16.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * BorrowedFieldsReturning Foo_as_returning(const Foo *self) + * Float64Vec *Float64Vec_new_i16(DiplomatI16View v) * } */ - public static MethodHandle Foo_as_returning$handle() { - return Foo_as_returning.HANDLE; + public static MethodHandle Float64Vec_new_i16$handle() { + return Float64Vec_new_i16.HANDLE; } /** * Address for: * {@snippet lang=c : - * BorrowedFieldsReturning Foo_as_returning(const Foo *self) + * Float64Vec *Float64Vec_new_i16(DiplomatI16View v) * } */ - public static MemorySegment Foo_as_returning$address() { - return Foo_as_returning.ADDR; + public static MemorySegment Float64Vec_new_i16$address() { + return Float64Vec_new_i16.ADDR; } /** * {@snippet lang=c : - * BorrowedFieldsReturning Foo_as_returning(const Foo *self) + * Float64Vec *Float64Vec_new_i16(DiplomatI16View v) * } */ - public static MemorySegment Foo_as_returning(SegmentAllocator allocator, MemorySegment self) { - var mh$ = Foo_as_returning.HANDLE; + public static MemorySegment Float64Vec_new_i16(MemorySegment v) { + var mh$ = Float64Vec_new_i16.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Foo_as_returning", allocator, self); + traceDowncall("Float64Vec_new_i16", v); } - return (MemorySegment)mh$.invokeExact(allocator, self); + return (MemorySegment)mh$.invokeExact(v); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Foo_extract_from_fields { + private static class Float64Vec_new_u16 { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - BorrowedFields.layout() + DiplomatU16View.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_extract_from_fields"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_u16"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13855,59 +13830,57 @@ private static class Foo_extract_from_fields { /** * Function descriptor for: * {@snippet lang=c : - * Foo *Foo_extract_from_fields(BorrowedFields fields) + * Float64Vec *Float64Vec_new_u16(DiplomatU16View v) * } */ - public static FunctionDescriptor Foo_extract_from_fields$descriptor() { - return Foo_extract_from_fields.DESC; + public static FunctionDescriptor Float64Vec_new_u16$descriptor() { + return Float64Vec_new_u16.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Foo *Foo_extract_from_fields(BorrowedFields fields) + * Float64Vec *Float64Vec_new_u16(DiplomatU16View v) * } */ - public static MethodHandle Foo_extract_from_fields$handle() { - return Foo_extract_from_fields.HANDLE; + public static MethodHandle Float64Vec_new_u16$handle() { + return Float64Vec_new_u16.HANDLE; } /** * Address for: * {@snippet lang=c : - * Foo *Foo_extract_from_fields(BorrowedFields fields) + * Float64Vec *Float64Vec_new_u16(DiplomatU16View v) * } */ - public static MemorySegment Foo_extract_from_fields$address() { - return Foo_extract_from_fields.ADDR; + public static MemorySegment Float64Vec_new_u16$address() { + return Float64Vec_new_u16.ADDR; } /** * {@snippet lang=c : - * Foo *Foo_extract_from_fields(BorrowedFields fields) + * Float64Vec *Float64Vec_new_u16(DiplomatU16View v) * } */ - public static MemorySegment Foo_extract_from_fields(MemorySegment fields) { - var mh$ = Foo_extract_from_fields.HANDLE; + public static MemorySegment Float64Vec_new_u16(MemorySegment v) { + var mh$ = Float64Vec_new_u16.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Foo_extract_from_fields", fields); + traceDowncall("Float64Vec_new_u16", v); } - return (MemorySegment)mh$.invokeExact(fields); + return (MemorySegment)mh$.invokeExact(v); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Foo_extract_from_bounds { + private static class Float64Vec_new_isize { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - BorrowedFieldsWithBounds.layout(), - somelib_h.C_POINTER, - somelib_h.C_LONG + DiplomatIsizeView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_extract_from_bounds"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_isize"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13915,56 +13888,57 @@ private static class Foo_extract_from_bounds { /** * Function descriptor for: * {@snippet lang=c : - * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, const char *another_string_data, size_t another_string_len) + * Float64Vec *Float64Vec_new_isize(DiplomatIsizeView v) * } */ - public static FunctionDescriptor Foo_extract_from_bounds$descriptor() { - return Foo_extract_from_bounds.DESC; + public static FunctionDescriptor Float64Vec_new_isize$descriptor() { + return Float64Vec_new_isize.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, const char *another_string_data, size_t another_string_len) + * Float64Vec *Float64Vec_new_isize(DiplomatIsizeView v) * } */ - public static MethodHandle Foo_extract_from_bounds$handle() { - return Foo_extract_from_bounds.HANDLE; + public static MethodHandle Float64Vec_new_isize$handle() { + return Float64Vec_new_isize.HANDLE; } /** * Address for: * {@snippet lang=c : - * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, const char *another_string_data, size_t another_string_len) + * Float64Vec *Float64Vec_new_isize(DiplomatIsizeView v) * } */ - public static MemorySegment Foo_extract_from_bounds$address() { - return Foo_extract_from_bounds.ADDR; + public static MemorySegment Float64Vec_new_isize$address() { + return Float64Vec_new_isize.ADDR; } /** * {@snippet lang=c : - * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, const char *another_string_data, size_t another_string_len) + * Float64Vec *Float64Vec_new_isize(DiplomatIsizeView v) * } */ - public static MemorySegment Foo_extract_from_bounds(MemorySegment bounds, MemorySegment another_string_data, long another_string_len) { - var mh$ = Foo_extract_from_bounds.HANDLE; + public static MemorySegment Float64Vec_new_isize(MemorySegment v) { + var mh$ = Float64Vec_new_isize.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Foo_extract_from_bounds", bounds, another_string_data, another_string_len); + traceDowncall("Float64Vec_new_isize", v); } - return (MemorySegment)mh$.invokeExact(bounds, another_string_data, another_string_len); + return (MemorySegment)mh$.invokeExact(v); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Foo_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER + private static class Float64Vec_new_usize { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + DiplomatUsizeView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_usize"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13972,56 +13946,57 @@ private static class Foo_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void Foo_destroy(Foo *self) + * Float64Vec *Float64Vec_new_usize(DiplomatUsizeView v) * } */ - public static FunctionDescriptor Foo_destroy$descriptor() { - return Foo_destroy.DESC; + public static FunctionDescriptor Float64Vec_new_usize$descriptor() { + return Float64Vec_new_usize.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Foo_destroy(Foo *self) + * Float64Vec *Float64Vec_new_usize(DiplomatUsizeView v) * } */ - public static MethodHandle Foo_destroy$handle() { - return Foo_destroy.HANDLE; + public static MethodHandle Float64Vec_new_usize$handle() { + return Float64Vec_new_usize.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Foo_destroy(Foo *self) + * Float64Vec *Float64Vec_new_usize(DiplomatUsizeView v) * } */ - public static MemorySegment Foo_destroy$address() { - return Foo_destroy.ADDR; + public static MemorySegment Float64Vec_new_usize$address() { + return Float64Vec_new_usize.ADDR; } /** * {@snippet lang=c : - * void Foo_destroy(Foo *self) + * Float64Vec *Float64Vec_new_usize(DiplomatUsizeView v) * } */ - public static void Foo_destroy(MemorySegment self) { - var mh$ = Foo_destroy.HANDLE; + public static MemorySegment Float64Vec_new_usize(MemorySegment v) { + var mh$ = Float64Vec_new_usize.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Foo_destroy", self); + traceDowncall("Float64Vec_new_usize", v); } - mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(v); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Two_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER + private static class Float64Vec_new_f64_be_bytes { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + DiplomatU8View.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Two_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_f64_be_bytes"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14029,61 +14004,57 @@ private static class Two_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void Two_destroy(Two *self) + * Float64Vec *Float64Vec_new_f64_be_bytes(DiplomatU8View v) * } */ - public static FunctionDescriptor Two_destroy$descriptor() { - return Two_destroy.DESC; + public static FunctionDescriptor Float64Vec_new_f64_be_bytes$descriptor() { + return Float64Vec_new_f64_be_bytes.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Two_destroy(Two *self) + * Float64Vec *Float64Vec_new_f64_be_bytes(DiplomatU8View v) * } */ - public static MethodHandle Two_destroy$handle() { - return Two_destroy.HANDLE; + public static MethodHandle Float64Vec_new_f64_be_bytes$handle() { + return Float64Vec_new_f64_be_bytes.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Two_destroy(Two *self) + * Float64Vec *Float64Vec_new_f64_be_bytes(DiplomatU8View v) * } */ - public static MemorySegment Two_destroy$address() { - return Two_destroy.ADDR; + public static MemorySegment Float64Vec_new_f64_be_bytes$address() { + return Float64Vec_new_f64_be_bytes.ADDR; } /** * {@snippet lang=c : - * void Two_destroy(Two *self) + * Float64Vec *Float64Vec_new_f64_be_bytes(DiplomatU8View v) * } */ - public static void Two_destroy(MemorySegment self) { - var mh$ = Two_destroy.HANDLE; + public static MemorySegment Float64Vec_new_f64_be_bytes(MemorySegment v) { + var mh$ = Float64Vec_new_f64_be_bytes.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Two_destroy", self); + traceDowncall("Float64Vec_new_f64_be_bytes", v); } - mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(v); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class BorrowedFieldsWithBounds_from_foo_and_strings { + private static class Float64Vec_new_from_owned { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - BorrowedFieldsWithBounds.layout(), somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG, - somelib_h.C_POINTER, - somelib_h.C_LONG + DiplomatF64ViewMut.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("BorrowedFieldsWithBounds_from_foo_and_strings"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_from_owned"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14091,55 +14062,57 @@ private static class BorrowedFieldsWithBounds_from_foo_and_strings { /** * Function descriptor for: * {@snippet lang=c : - * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char *utf8_str_z_data, size_t utf8_str_z_len) + * Float64Vec *Float64Vec_new_from_owned(DiplomatF64ViewMut v) * } */ - public static FunctionDescriptor BorrowedFieldsWithBounds_from_foo_and_strings$descriptor() { - return BorrowedFieldsWithBounds_from_foo_and_strings.DESC; + public static FunctionDescriptor Float64Vec_new_from_owned$descriptor() { + return Float64Vec_new_from_owned.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char *utf8_str_z_data, size_t utf8_str_z_len) + * Float64Vec *Float64Vec_new_from_owned(DiplomatF64ViewMut v) * } */ - public static MethodHandle BorrowedFieldsWithBounds_from_foo_and_strings$handle() { - return BorrowedFieldsWithBounds_from_foo_and_strings.HANDLE; + public static MethodHandle Float64Vec_new_from_owned$handle() { + return Float64Vec_new_from_owned.HANDLE; } /** * Address for: * {@snippet lang=c : - * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char *utf8_str_z_data, size_t utf8_str_z_len) + * Float64Vec *Float64Vec_new_from_owned(DiplomatF64ViewMut v) * } */ - public static MemorySegment BorrowedFieldsWithBounds_from_foo_and_strings$address() { - return BorrowedFieldsWithBounds_from_foo_and_strings.ADDR; + public static MemorySegment Float64Vec_new_from_owned$address() { + return Float64Vec_new_from_owned.ADDR; } /** * {@snippet lang=c : - * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, const char16_t *dstr16_x_data, size_t dstr16_x_len, const char *utf8_str_z_data, size_t utf8_str_z_len) + * Float64Vec *Float64Vec_new_from_owned(DiplomatF64ViewMut v) * } */ - public static MemorySegment BorrowedFieldsWithBounds_from_foo_and_strings(SegmentAllocator allocator, MemorySegment foo, MemorySegment dstr16_x_data, long dstr16_x_len, MemorySegment utf8_str_z_data, long utf8_str_z_len) { - var mh$ = BorrowedFieldsWithBounds_from_foo_and_strings.HANDLE; + public static MemorySegment Float64Vec_new_from_owned(MemorySegment v) { + var mh$ = Float64Vec_new_from_owned.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("BorrowedFieldsWithBounds_from_foo_and_strings", allocator, foo, dstr16_x_data, dstr16_x_len, utf8_str_z_data, utf8_str_z_len); + traceDowncall("Float64Vec_new_from_owned", v); } - return (MemorySegment)mh$.invokeExact(allocator, foo, dstr16_x_data, dstr16_x_len, utf8_str_z_data, utf8_str_z_len); + return (MemorySegment)mh$.invokeExact(v); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyStruct_new { + private static class Float64Vec_as_slice { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - MyStruct.layout() ); + DiplomatF64View.layout(), + somelib_h.C_POINTER + ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyStruct_new"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_as_slice"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14147,57 +14120,57 @@ private static class MyStruct_new { /** * Function descriptor for: * {@snippet lang=c : - * MyStruct MyStruct_new() + * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) * } */ - public static FunctionDescriptor MyStruct_new$descriptor() { - return MyStruct_new.DESC; + public static FunctionDescriptor Float64Vec_as_slice$descriptor() { + return Float64Vec_as_slice.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * MyStruct MyStruct_new() + * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) * } */ - public static MethodHandle MyStruct_new$handle() { - return MyStruct_new.HANDLE; + public static MethodHandle Float64Vec_as_slice$handle() { + return Float64Vec_as_slice.HANDLE; } /** * Address for: * {@snippet lang=c : - * MyStruct MyStruct_new() + * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) * } */ - public static MemorySegment MyStruct_new$address() { - return MyStruct_new.ADDR; + public static MemorySegment Float64Vec_as_slice$address() { + return Float64Vec_as_slice.ADDR; } /** * {@snippet lang=c : - * MyStruct MyStruct_new() + * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) * } */ - public static MemorySegment MyStruct_new(SegmentAllocator allocator) { - var mh$ = MyStruct_new.HANDLE; + public static MemorySegment Float64Vec_as_slice(SegmentAllocator allocator, MemorySegment self) { + var mh$ = Float64Vec_as_slice.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyStruct_new", allocator); + traceDowncall("Float64Vec_as_slice", allocator, self); } - return (MemorySegment)mh$.invokeExact(allocator); + return (MemorySegment)mh$.invokeExact(allocator, self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyStruct_into_a { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_CHAR, - MyStruct.layout() + private static class Float64Vec_fill_slice { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, + DiplomatF64ViewMut.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyStruct_into_a"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_fill_slice"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14205,58 +14178,57 @@ private static class MyStruct_into_a { /** * Function descriptor for: * {@snippet lang=c : - * uint8_t MyStruct_into_a(MyStruct self) + * void Float64Vec_fill_slice(const Float64Vec *self, DiplomatF64ViewMut v) * } */ - public static FunctionDescriptor MyStruct_into_a$descriptor() { - return MyStruct_into_a.DESC; + public static FunctionDescriptor Float64Vec_fill_slice$descriptor() { + return Float64Vec_fill_slice.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * uint8_t MyStruct_into_a(MyStruct self) + * void Float64Vec_fill_slice(const Float64Vec *self, DiplomatF64ViewMut v) * } */ - public static MethodHandle MyStruct_into_a$handle() { - return MyStruct_into_a.HANDLE; + public static MethodHandle Float64Vec_fill_slice$handle() { + return Float64Vec_fill_slice.HANDLE; } /** * Address for: * {@snippet lang=c : - * uint8_t MyStruct_into_a(MyStruct self) + * void Float64Vec_fill_slice(const Float64Vec *self, DiplomatF64ViewMut v) * } */ - public static MemorySegment MyStruct_into_a$address() { - return MyStruct_into_a.ADDR; + public static MemorySegment Float64Vec_fill_slice$address() { + return Float64Vec_fill_slice.ADDR; } /** * {@snippet lang=c : - * uint8_t MyStruct_into_a(MyStruct self) + * void Float64Vec_fill_slice(const Float64Vec *self, DiplomatF64ViewMut v) * } */ - public static byte MyStruct_into_a(MemorySegment self) { - var mh$ = MyStruct_into_a.HANDLE; + public static void Float64Vec_fill_slice(MemorySegment self, MemorySegment v) { + var mh$ = Float64Vec_fill_slice.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyStruct_into_a", self); + traceDowncall("Float64Vec_fill_slice", self, v); } - return (byte)mh$.invokeExact(self); + mh$.invokeExact(self, v); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Utf16Wrap_from_utf16 { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, + private static class Float64Vec_set_value { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER, - somelib_h.C_LONG + DiplomatF64View.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_from_utf16"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_set_value"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14264,57 +14236,57 @@ private static class Utf16Wrap_from_utf16 { /** * Function descriptor for: * {@snippet lang=c : - * Utf16Wrap *Utf16Wrap_from_utf16(const char16_t *input_data, size_t input_len) + * void Float64Vec_set_value(Float64Vec *self, DiplomatF64View new_slice) * } */ - public static FunctionDescriptor Utf16Wrap_from_utf16$descriptor() { - return Utf16Wrap_from_utf16.DESC; + public static FunctionDescriptor Float64Vec_set_value$descriptor() { + return Float64Vec_set_value.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Utf16Wrap *Utf16Wrap_from_utf16(const char16_t *input_data, size_t input_len) + * void Float64Vec_set_value(Float64Vec *self, DiplomatF64View new_slice) * } */ - public static MethodHandle Utf16Wrap_from_utf16$handle() { - return Utf16Wrap_from_utf16.HANDLE; + public static MethodHandle Float64Vec_set_value$handle() { + return Float64Vec_set_value.HANDLE; } /** * Address for: * {@snippet lang=c : - * Utf16Wrap *Utf16Wrap_from_utf16(const char16_t *input_data, size_t input_len) + * void Float64Vec_set_value(Float64Vec *self, DiplomatF64View new_slice) * } */ - public static MemorySegment Utf16Wrap_from_utf16$address() { - return Utf16Wrap_from_utf16.ADDR; + public static MemorySegment Float64Vec_set_value$address() { + return Float64Vec_set_value.ADDR; } /** * {@snippet lang=c : - * Utf16Wrap *Utf16Wrap_from_utf16(const char16_t *input_data, size_t input_len) + * void Float64Vec_set_value(Float64Vec *self, DiplomatF64View new_slice) * } */ - public static MemorySegment Utf16Wrap_from_utf16(MemorySegment input_data, long input_len) { - var mh$ = Utf16Wrap_from_utf16.HANDLE; + public static void Float64Vec_set_value(MemorySegment self, MemorySegment new_slice) { + var mh$ = Float64Vec_set_value.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Utf16Wrap_from_utf16", input_data, input_len); + traceDowncall("Float64Vec_set_value", self, new_slice); } - return (MemorySegment)mh$.invokeExact(input_data, input_len); + mh$.invokeExact(self, new_slice); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Utf16Wrap_get_debug_str { + private static class Float64Vec_to_string { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_get_debug_str"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_to_string"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14322,43 +14294,43 @@ private static class Utf16Wrap_get_debug_str { /** * Function descriptor for: * {@snippet lang=c : - * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) + * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) * } */ - public static FunctionDescriptor Utf16Wrap_get_debug_str$descriptor() { - return Utf16Wrap_get_debug_str.DESC; + public static FunctionDescriptor Float64Vec_to_string$descriptor() { + return Float64Vec_to_string.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) + * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) * } */ - public static MethodHandle Utf16Wrap_get_debug_str$handle() { - return Utf16Wrap_get_debug_str.HANDLE; + public static MethodHandle Float64Vec_to_string$handle() { + return Float64Vec_to_string.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) + * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) * } */ - public static MemorySegment Utf16Wrap_get_debug_str$address() { - return Utf16Wrap_get_debug_str.ADDR; + public static MemorySegment Float64Vec_to_string$address() { + return Float64Vec_to_string.ADDR; } /** * {@snippet lang=c : - * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) + * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) * } */ - public static void Utf16Wrap_get_debug_str(MemorySegment self, MemorySegment write) { - var mh$ = Utf16Wrap_get_debug_str.HANDLE; + public static void Float64Vec_to_string(MemorySegment self, MemorySegment write) { + var mh$ = Float64Vec_to_string.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Utf16Wrap_get_debug_str", self, write); + traceDowncall("Float64Vec_to_string", self, write); } mh$.invokeExact(self, write); } catch (Throwable ex$) { @@ -14366,13 +14338,13 @@ public static void Utf16Wrap_get_debug_str(MemorySegment self, MemorySegment wri } } - private static class Utf16Wrap_borrow_cont { + private static class Float64Vec_borrow { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - DiplomatString16View.layout(), + DiplomatF64View.layout(), somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_borrow_cont"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_borrow"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14380,43 +14352,43 @@ private static class Utf16Wrap_borrow_cont { /** * Function descriptor for: * {@snippet lang=c : - * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) + * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) * } */ - public static FunctionDescriptor Utf16Wrap_borrow_cont$descriptor() { - return Utf16Wrap_borrow_cont.DESC; + public static FunctionDescriptor Float64Vec_borrow$descriptor() { + return Float64Vec_borrow.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) + * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) * } */ - public static MethodHandle Utf16Wrap_borrow_cont$handle() { - return Utf16Wrap_borrow_cont.HANDLE; + public static MethodHandle Float64Vec_borrow$handle() { + return Float64Vec_borrow.HANDLE; } /** * Address for: * {@snippet lang=c : - * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) + * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) * } */ - public static MemorySegment Utf16Wrap_borrow_cont$address() { - return Utf16Wrap_borrow_cont.ADDR; + public static MemorySegment Float64Vec_borrow$address() { + return Float64Vec_borrow.ADDR; } /** * {@snippet lang=c : - * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) + * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) * } */ - public static MemorySegment Utf16Wrap_borrow_cont(SegmentAllocator allocator, MemorySegment self) { - var mh$ = Utf16Wrap_borrow_cont.HANDLE; + public static MemorySegment Float64Vec_borrow(SegmentAllocator allocator, MemorySegment self) { + var mh$ = Float64Vec_borrow.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Utf16Wrap_borrow_cont", allocator, self); + traceDowncall("Float64Vec_borrow", allocator, self); } return (MemorySegment)mh$.invokeExact(allocator, self); } catch (Throwable ex$) { @@ -14424,12 +14396,12 @@ public static MemorySegment Utf16Wrap_borrow_cont(SegmentAllocator allocator, Me } } - private static class Utf16Wrap_destroy { + private static class Float64Vec_destroy { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14437,43 +14409,43 @@ private static class Utf16Wrap_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void Utf16Wrap_destroy(Utf16Wrap *self) + * void Float64Vec_destroy(Float64Vec *self) * } */ - public static FunctionDescriptor Utf16Wrap_destroy$descriptor() { - return Utf16Wrap_destroy.DESC; + public static FunctionDescriptor Float64Vec_destroy$descriptor() { + return Float64Vec_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Utf16Wrap_destroy(Utf16Wrap *self) + * void Float64Vec_destroy(Float64Vec *self) * } */ - public static MethodHandle Utf16Wrap_destroy$handle() { - return Utf16Wrap_destroy.HANDLE; + public static MethodHandle Float64Vec_destroy$handle() { + return Float64Vec_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Utf16Wrap_destroy(Utf16Wrap *self) + * void Float64Vec_destroy(Float64Vec *self) * } */ - public static MemorySegment Utf16Wrap_destroy$address() { - return Utf16Wrap_destroy.ADDR; + public static MemorySegment Float64Vec_destroy$address() { + return Float64Vec_destroy.ADDR; } /** * {@snippet lang=c : - * void Utf16Wrap_destroy(Utf16Wrap *self) + * void Float64Vec_destroy(Float64Vec *self) * } */ - public static void Utf16Wrap_destroy(MemorySegment self) { - var mh$ = Utf16Wrap_destroy.HANDLE; + public static void Float64Vec_destroy(MemorySegment self) { + var mh$ = Float64Vec_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Utf16Wrap_destroy", self); + traceDowncall("Float64Vec_destroy", self); } mh$.invokeExact(self); } catch (Throwable ex$) { @@ -14519,1073 +14491,1073 @@ public static long __DARWIN_C_FULL() { public static long __DARWIN_C_LEVEL() { return __DARWIN_C_LEVEL; } - private static final int MAC_OS_X_VERSION_10_0 = (int)1000L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_0 1000 + * #define __ASSERT_FILE_NAME "jextract$13440747494818414911.h" * } */ - public static int MAC_OS_X_VERSION_10_0() { - return MAC_OS_X_VERSION_10_0; + public static MemorySegment __ASSERT_FILE_NAME() { + class Holder { + static final MemorySegment __ASSERT_FILE_NAME + = somelib_h.LIBRARY_ARENA.allocateFrom("jextract$13440747494818414911.h"); + } + return Holder.__ASSERT_FILE_NAME; } - private static final int MAC_OS_X_VERSION_10_1 = (int)1010L; + private static final MemorySegment NULL = MemorySegment.ofAddress(0L); /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_1 1010 + * #define NULL (void*) 0 * } */ - public static int MAC_OS_X_VERSION_10_1() { - return MAC_OS_X_VERSION_10_1; + public static MemorySegment NULL() { + return NULL; } - private static final int MAC_OS_X_VERSION_10_2 = (int)1020L; + private static final MemorySegment __DARWIN_NULL = MemorySegment.ofAddress(0L); /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_2 1020 + * #define __DARWIN_NULL (void*) 0 * } */ - public static int MAC_OS_X_VERSION_10_2() { - return MAC_OS_X_VERSION_10_2; + public static MemorySegment __DARWIN_NULL() { + return __DARWIN_NULL; } - private static final int MAC_OS_X_VERSION_10_3 = (int)1030L; + private static final long USER_ADDR_NULL = 0L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_3 1030 + * #define USER_ADDR_NULL 0 * } */ - public static int MAC_OS_X_VERSION_10_3() { - return MAC_OS_X_VERSION_10_3; + public static long USER_ADDR_NULL() { + return USER_ADDR_NULL; } - private static final int MAC_OS_X_VERSION_10_4 = (int)1040L; + private static final long INT64_MAX = 9223372036854775807L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_4 1040 + * #define INT64_MAX 9223372036854775807 * } */ - public static int MAC_OS_X_VERSION_10_4() { - return MAC_OS_X_VERSION_10_4; + public static long INT64_MAX() { + return INT64_MAX; } - private static final int MAC_OS_X_VERSION_10_5 = (int)1050L; + private static final int INT8_MIN = (int)-128L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_5 1050 + * #define INT8_MIN -128 * } */ - public static int MAC_OS_X_VERSION_10_5() { - return MAC_OS_X_VERSION_10_5; + public static int INT8_MIN() { + return INT8_MIN; } - private static final int MAC_OS_X_VERSION_10_6 = (int)1060L; + private static final int INT16_MIN = (int)-32768L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_6 1060 + * #define INT16_MIN -32768 * } */ - public static int MAC_OS_X_VERSION_10_6() { - return MAC_OS_X_VERSION_10_6; + public static int INT16_MIN() { + return INT16_MIN; } - private static final int MAC_OS_X_VERSION_10_7 = (int)1070L; + private static final int INT32_MIN = (int)-2147483648L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_7 1070 + * #define INT32_MIN -2147483648 * } */ - public static int MAC_OS_X_VERSION_10_7() { - return MAC_OS_X_VERSION_10_7; + public static int INT32_MIN() { + return INT32_MIN; } - private static final int MAC_OS_X_VERSION_10_8 = (int)1080L; + private static final long INT64_MIN = -9223372036854775808L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_8 1080 + * #define INT64_MIN -9223372036854775808 * } */ - public static int MAC_OS_X_VERSION_10_8() { - return MAC_OS_X_VERSION_10_8; + public static long INT64_MIN() { + return INT64_MIN; } - private static final int MAC_OS_X_VERSION_10_9 = (int)1090L; + private static final int UINT32_MAX = (int)4294967295L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_9 1090 + * #define UINT32_MAX 4294967295 * } */ - public static int MAC_OS_X_VERSION_10_9() { - return MAC_OS_X_VERSION_10_9; + public static int UINT32_MAX() { + return UINT32_MAX; } - private static final int MAC_OS_X_VERSION_10_10 = (int)101000L; + private static final long UINT64_MAX = -1L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_10 101000 + * #define UINT64_MAX -1 * } */ - public static int MAC_OS_X_VERSION_10_10() { - return MAC_OS_X_VERSION_10_10; + public static long UINT64_MAX() { + return UINT64_MAX; } - private static final int MAC_OS_X_VERSION_10_10_2 = (int)101002L; + private static final int INT_LEAST8_MIN = (int)-128L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_10_2 101002 + * #define INT_LEAST8_MIN -128 * } */ - public static int MAC_OS_X_VERSION_10_10_2() { - return MAC_OS_X_VERSION_10_10_2; + public static int INT_LEAST8_MIN() { + return INT_LEAST8_MIN; } - private static final int MAC_OS_X_VERSION_10_10_3 = (int)101003L; + private static final int INT_LEAST16_MIN = (int)-32768L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_10_3 101003 + * #define INT_LEAST16_MIN -32768 * } */ - public static int MAC_OS_X_VERSION_10_10_3() { - return MAC_OS_X_VERSION_10_10_3; + public static int INT_LEAST16_MIN() { + return INT_LEAST16_MIN; } - private static final int MAC_OS_X_VERSION_10_11 = (int)101100L; + private static final int INT_LEAST32_MIN = (int)-2147483648L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_11 101100 + * #define INT_LEAST32_MIN -2147483648 * } */ - public static int MAC_OS_X_VERSION_10_11() { - return MAC_OS_X_VERSION_10_11; + public static int INT_LEAST32_MIN() { + return INT_LEAST32_MIN; } - private static final int MAC_OS_X_VERSION_10_11_2 = (int)101102L; + private static final long INT_LEAST64_MIN = -9223372036854775808L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_11_2 101102 + * #define INT_LEAST64_MIN -9223372036854775808 * } */ - public static int MAC_OS_X_VERSION_10_11_2() { - return MAC_OS_X_VERSION_10_11_2; + public static long INT_LEAST64_MIN() { + return INT_LEAST64_MIN; } - private static final int MAC_OS_X_VERSION_10_11_3 = (int)101103L; + private static final int INT_LEAST8_MAX = (int)127L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_11_3 101103 + * #define INT_LEAST8_MAX 127 * } */ - public static int MAC_OS_X_VERSION_10_11_3() { - return MAC_OS_X_VERSION_10_11_3; + public static int INT_LEAST8_MAX() { + return INT_LEAST8_MAX; } - private static final int MAC_OS_X_VERSION_10_11_4 = (int)101104L; + private static final int INT_LEAST16_MAX = (int)32767L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_11_4 101104 + * #define INT_LEAST16_MAX 32767 * } */ - public static int MAC_OS_X_VERSION_10_11_4() { - return MAC_OS_X_VERSION_10_11_4; + public static int INT_LEAST16_MAX() { + return INT_LEAST16_MAX; } - private static final int MAC_OS_X_VERSION_10_12 = (int)101200L; + private static final int INT_LEAST32_MAX = (int)2147483647L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_12 101200 + * #define INT_LEAST32_MAX 2147483647 * } */ - public static int MAC_OS_X_VERSION_10_12() { - return MAC_OS_X_VERSION_10_12; + public static int INT_LEAST32_MAX() { + return INT_LEAST32_MAX; } - private static final int MAC_OS_X_VERSION_10_12_1 = (int)101201L; + private static final long INT_LEAST64_MAX = 9223372036854775807L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_12_1 101201 + * #define INT_LEAST64_MAX 9223372036854775807 * } */ - public static int MAC_OS_X_VERSION_10_12_1() { - return MAC_OS_X_VERSION_10_12_1; + public static long INT_LEAST64_MAX() { + return INT_LEAST64_MAX; } - private static final int MAC_OS_X_VERSION_10_12_2 = (int)101202L; + private static final int UINT_LEAST8_MAX = (int)255L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_12_2 101202 + * #define UINT_LEAST8_MAX 255 * } */ - public static int MAC_OS_X_VERSION_10_12_2() { - return MAC_OS_X_VERSION_10_12_2; + public static int UINT_LEAST8_MAX() { + return UINT_LEAST8_MAX; } - private static final int MAC_OS_X_VERSION_10_12_4 = (int)101204L; + private static final int UINT_LEAST16_MAX = (int)65535L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_12_4 101204 + * #define UINT_LEAST16_MAX 65535 * } */ - public static int MAC_OS_X_VERSION_10_12_4() { - return MAC_OS_X_VERSION_10_12_4; + public static int UINT_LEAST16_MAX() { + return UINT_LEAST16_MAX; } - private static final int MAC_OS_X_VERSION_10_13 = (int)101300L; + private static final int UINT_LEAST32_MAX = (int)4294967295L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_13 101300 + * #define UINT_LEAST32_MAX 4294967295 * } */ - public static int MAC_OS_X_VERSION_10_13() { - return MAC_OS_X_VERSION_10_13; + public static int UINT_LEAST32_MAX() { + return UINT_LEAST32_MAX; } - private static final int MAC_OS_X_VERSION_10_13_1 = (int)101301L; + private static final long UINT_LEAST64_MAX = -1L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_13_1 101301 + * #define UINT_LEAST64_MAX -1 * } */ - public static int MAC_OS_X_VERSION_10_13_1() { - return MAC_OS_X_VERSION_10_13_1; + public static long UINT_LEAST64_MAX() { + return UINT_LEAST64_MAX; } - private static final int MAC_OS_X_VERSION_10_13_2 = (int)101302L; + private static final int INT_FAST8_MIN = (int)-128L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_13_2 101302 + * #define INT_FAST8_MIN -128 * } */ - public static int MAC_OS_X_VERSION_10_13_2() { - return MAC_OS_X_VERSION_10_13_2; + public static int INT_FAST8_MIN() { + return INT_FAST8_MIN; } - private static final int MAC_OS_X_VERSION_10_13_4 = (int)101304L; + private static final int INT_FAST16_MIN = (int)-32768L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_13_4 101304 + * #define INT_FAST16_MIN -32768 * } */ - public static int MAC_OS_X_VERSION_10_13_4() { - return MAC_OS_X_VERSION_10_13_4; + public static int INT_FAST16_MIN() { + return INT_FAST16_MIN; } - private static final int MAC_OS_X_VERSION_10_14 = (int)101400L; + private static final int INT_FAST32_MIN = (int)-2147483648L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_14 101400 + * #define INT_FAST32_MIN -2147483648 * } */ - public static int MAC_OS_X_VERSION_10_14() { - return MAC_OS_X_VERSION_10_14; + public static int INT_FAST32_MIN() { + return INT_FAST32_MIN; } - private static final int MAC_OS_X_VERSION_10_14_1 = (int)101401L; + private static final long INT_FAST64_MIN = -9223372036854775808L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_14_1 101401 + * #define INT_FAST64_MIN -9223372036854775808 * } */ - public static int MAC_OS_X_VERSION_10_14_1() { - return MAC_OS_X_VERSION_10_14_1; + public static long INT_FAST64_MIN() { + return INT_FAST64_MIN; } - private static final int MAC_OS_X_VERSION_10_14_4 = (int)101404L; + private static final int INT_FAST8_MAX = (int)127L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_14_4 101404 + * #define INT_FAST8_MAX 127 * } */ - public static int MAC_OS_X_VERSION_10_14_4() { - return MAC_OS_X_VERSION_10_14_4; + public static int INT_FAST8_MAX() { + return INT_FAST8_MAX; } - private static final int MAC_OS_X_VERSION_10_14_5 = (int)101405L; + private static final int INT_FAST16_MAX = (int)32767L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_14_5 101405 + * #define INT_FAST16_MAX 32767 * } */ - public static int MAC_OS_X_VERSION_10_14_5() { - return MAC_OS_X_VERSION_10_14_5; + public static int INT_FAST16_MAX() { + return INT_FAST16_MAX; } - private static final int MAC_OS_X_VERSION_10_14_6 = (int)101406L; + private static final int INT_FAST32_MAX = (int)2147483647L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_14_6 101406 + * #define INT_FAST32_MAX 2147483647 * } */ - public static int MAC_OS_X_VERSION_10_14_6() { - return MAC_OS_X_VERSION_10_14_6; + public static int INT_FAST32_MAX() { + return INT_FAST32_MAX; } - private static final int MAC_OS_X_VERSION_10_15 = (int)101500L; + private static final long INT_FAST64_MAX = 9223372036854775807L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_15 101500 + * #define INT_FAST64_MAX 9223372036854775807 * } */ - public static int MAC_OS_X_VERSION_10_15() { - return MAC_OS_X_VERSION_10_15; + public static long INT_FAST64_MAX() { + return INT_FAST64_MAX; } - private static final int MAC_OS_X_VERSION_10_15_1 = (int)101501L; + private static final int UINT_FAST8_MAX = (int)255L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_15_1 101501 + * #define UINT_FAST8_MAX 255 * } */ - public static int MAC_OS_X_VERSION_10_15_1() { - return MAC_OS_X_VERSION_10_15_1; + public static int UINT_FAST8_MAX() { + return UINT_FAST8_MAX; } - private static final int MAC_OS_X_VERSION_10_15_4 = (int)101504L; + private static final int UINT_FAST16_MAX = (int)65535L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_15_4 101504 + * #define UINT_FAST16_MAX 65535 * } */ - public static int MAC_OS_X_VERSION_10_15_4() { - return MAC_OS_X_VERSION_10_15_4; + public static int UINT_FAST16_MAX() { + return UINT_FAST16_MAX; } - private static final int MAC_OS_X_VERSION_10_16 = (int)101600L; + private static final int UINT_FAST32_MAX = (int)4294967295L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_16 101600 + * #define UINT_FAST32_MAX 4294967295 * } */ - public static int MAC_OS_X_VERSION_10_16() { - return MAC_OS_X_VERSION_10_16; + public static int UINT_FAST32_MAX() { + return UINT_FAST32_MAX; } - private static final int MAC_OS_VERSION_11_0 = (int)110000L; + private static final long UINT_FAST64_MAX = -1L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_11_0 110000 + * #define UINT_FAST64_MAX -1 * } */ - public static int MAC_OS_VERSION_11_0() { - return MAC_OS_VERSION_11_0; + public static long UINT_FAST64_MAX() { + return UINT_FAST64_MAX; } - private static final int MAC_OS_VERSION_11_1 = (int)110100L; + private static final long INTPTR_MAX = 9223372036854775807L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_11_1 110100 + * #define INTPTR_MAX 9223372036854775807 * } */ - public static int MAC_OS_VERSION_11_1() { - return MAC_OS_VERSION_11_1; + public static long INTPTR_MAX() { + return INTPTR_MAX; } - private static final int MAC_OS_VERSION_11_3 = (int)110300L; + private static final long INTPTR_MIN = -9223372036854775808L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_11_3 110300 + * #define INTPTR_MIN -9223372036854775808 * } */ - public static int MAC_OS_VERSION_11_3() { - return MAC_OS_VERSION_11_3; + public static long INTPTR_MIN() { + return INTPTR_MIN; } - private static final int MAC_OS_VERSION_11_4 = (int)110400L; + private static final long UINTPTR_MAX = -1L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_11_4 110400 + * #define UINTPTR_MAX -1 * } */ - public static int MAC_OS_VERSION_11_4() { - return MAC_OS_VERSION_11_4; + public static long UINTPTR_MAX() { + return UINTPTR_MAX; } - private static final int MAC_OS_VERSION_11_5 = (int)110500L; + private static final long INTMAX_MAX = 9223372036854775807L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_11_5 110500 + * #define INTMAX_MAX 9223372036854775807 * } */ - public static int MAC_OS_VERSION_11_5() { - return MAC_OS_VERSION_11_5; + public static long INTMAX_MAX() { + return INTMAX_MAX; } - private static final int MAC_OS_VERSION_11_6 = (int)110600L; + private static final long UINTMAX_MAX = -1L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_11_6 110600 + * #define UINTMAX_MAX -1 * } */ - public static int MAC_OS_VERSION_11_6() { - return MAC_OS_VERSION_11_6; + public static long UINTMAX_MAX() { + return UINTMAX_MAX; } - private static final int MAC_OS_VERSION_12_0 = (int)120000L; + private static final long INTMAX_MIN = -9223372036854775808L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_12_0 120000 + * #define INTMAX_MIN -9223372036854775808 * } */ - public static int MAC_OS_VERSION_12_0() { - return MAC_OS_VERSION_12_0; + public static long INTMAX_MIN() { + return INTMAX_MIN; } - private static final int MAC_OS_VERSION_12_1 = (int)120100L; + private static final long PTRDIFF_MIN = -9223372036854775808L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_12_1 120100 + * #define PTRDIFF_MIN -9223372036854775808 * } */ - public static int MAC_OS_VERSION_12_1() { - return MAC_OS_VERSION_12_1; + public static long PTRDIFF_MIN() { + return PTRDIFF_MIN; } - private static final int MAC_OS_VERSION_12_2 = (int)120200L; + private static final long PTRDIFF_MAX = 9223372036854775807L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_12_2 120200 + * #define PTRDIFF_MAX 9223372036854775807 * } */ - public static int MAC_OS_VERSION_12_2() { - return MAC_OS_VERSION_12_2; + public static long PTRDIFF_MAX() { + return PTRDIFF_MAX; } - private static final int MAC_OS_VERSION_12_3 = (int)120300L; + private static final long SIZE_MAX = -1L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_12_3 120300 + * #define SIZE_MAX -1 * } */ - public static int MAC_OS_VERSION_12_3() { - return MAC_OS_VERSION_12_3; + public static long SIZE_MAX() { + return SIZE_MAX; } - private static final int MAC_OS_VERSION_12_4 = (int)120400L; + private static final long RSIZE_MAX = 9223372036854775807L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_12_4 120400 + * #define RSIZE_MAX 9223372036854775807 * } */ - public static int MAC_OS_VERSION_12_4() { - return MAC_OS_VERSION_12_4; + public static long RSIZE_MAX() { + return RSIZE_MAX; } - private static final int MAC_OS_VERSION_12_5 = (int)120500L; + private static final int WCHAR_MAX = (int)2147483647L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_12_5 120500 + * #define WCHAR_MAX 2147483647 * } */ - public static int MAC_OS_VERSION_12_5() { - return MAC_OS_VERSION_12_5; + public static int WCHAR_MAX() { + return WCHAR_MAX; } - private static final int MAC_OS_VERSION_12_6 = (int)120600L; + private static final int WCHAR_MIN = (int)-2147483648L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_12_6 120600 + * #define WCHAR_MIN -2147483648 * } */ - public static int MAC_OS_VERSION_12_6() { - return MAC_OS_VERSION_12_6; + public static int WCHAR_MIN() { + return WCHAR_MIN; } - private static final int MAC_OS_VERSION_12_7 = (int)120700L; + private static final int WINT_MIN = (int)-2147483648L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_12_7 120700 + * #define WINT_MIN -2147483648 * } */ - public static int MAC_OS_VERSION_12_7() { - return MAC_OS_VERSION_12_7; + public static int WINT_MIN() { + return WINT_MIN; } - private static final int MAC_OS_VERSION_13_0 = (int)130000L; + private static final int WINT_MAX = (int)2147483647L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_13_0 130000 + * #define WINT_MAX 2147483647 * } */ - public static int MAC_OS_VERSION_13_0() { - return MAC_OS_VERSION_13_0; + public static int WINT_MAX() { + return WINT_MAX; } - private static final int MAC_OS_VERSION_13_1 = (int)130100L; + private static final int SIG_ATOMIC_MIN = (int)-2147483648L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_13_1 130100 + * #define SIG_ATOMIC_MIN -2147483648 * } */ - public static int MAC_OS_VERSION_13_1() { - return MAC_OS_VERSION_13_1; + public static int SIG_ATOMIC_MIN() { + return SIG_ATOMIC_MIN; } - private static final int MAC_OS_VERSION_13_2 = (int)130200L; + private static final int SIG_ATOMIC_MAX = (int)2147483647L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_13_2 130200 + * #define SIG_ATOMIC_MAX 2147483647 * } */ - public static int MAC_OS_VERSION_13_2() { - return MAC_OS_VERSION_13_2; + public static int SIG_ATOMIC_MAX() { + return SIG_ATOMIC_MAX; } - private static final int MAC_OS_VERSION_13_3 = (int)130300L; + private static final int MAC_OS_X_VERSION_10_0 = (int)1000L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_13_3 130300 + * #define MAC_OS_X_VERSION_10_0 1000 * } */ - public static int MAC_OS_VERSION_13_3() { - return MAC_OS_VERSION_13_3; + public static int MAC_OS_X_VERSION_10_0() { + return MAC_OS_X_VERSION_10_0; } - private static final int MAC_OS_VERSION_13_4 = (int)130400L; + private static final int MAC_OS_X_VERSION_10_1 = (int)1010L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_13_4 130400 + * #define MAC_OS_X_VERSION_10_1 1010 * } */ - public static int MAC_OS_VERSION_13_4() { - return MAC_OS_VERSION_13_4; + public static int MAC_OS_X_VERSION_10_1() { + return MAC_OS_X_VERSION_10_1; } - private static final int MAC_OS_VERSION_13_5 = (int)130500L; + private static final int MAC_OS_X_VERSION_10_2 = (int)1020L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_13_5 130500 + * #define MAC_OS_X_VERSION_10_2 1020 * } */ - public static int MAC_OS_VERSION_13_5() { - return MAC_OS_VERSION_13_5; + public static int MAC_OS_X_VERSION_10_2() { + return MAC_OS_X_VERSION_10_2; } - private static final int MAC_OS_VERSION_13_6 = (int)130600L; + private static final int MAC_OS_X_VERSION_10_3 = (int)1030L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_13_6 130600 + * #define MAC_OS_X_VERSION_10_3 1030 * } */ - public static int MAC_OS_VERSION_13_6() { - return MAC_OS_VERSION_13_6; + public static int MAC_OS_X_VERSION_10_3() { + return MAC_OS_X_VERSION_10_3; } - private static final int MAC_OS_VERSION_14_0 = (int)140000L; + private static final int MAC_OS_X_VERSION_10_4 = (int)1040L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_14_0 140000 + * #define MAC_OS_X_VERSION_10_4 1040 * } */ - public static int MAC_OS_VERSION_14_0() { - return MAC_OS_VERSION_14_0; + public static int MAC_OS_X_VERSION_10_4() { + return MAC_OS_X_VERSION_10_4; } - private static final int MAC_OS_VERSION_14_1 = (int)140100L; + private static final int MAC_OS_X_VERSION_10_5 = (int)1050L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_14_1 140100 + * #define MAC_OS_X_VERSION_10_5 1050 * } */ - public static int MAC_OS_VERSION_14_1() { - return MAC_OS_VERSION_14_1; + public static int MAC_OS_X_VERSION_10_5() { + return MAC_OS_X_VERSION_10_5; } - private static final int MAC_OS_VERSION_14_2 = (int)140200L; + private static final int MAC_OS_X_VERSION_10_6 = (int)1060L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_14_2 140200 + * #define MAC_OS_X_VERSION_10_6 1060 * } */ - public static int MAC_OS_VERSION_14_2() { - return MAC_OS_VERSION_14_2; + public static int MAC_OS_X_VERSION_10_6() { + return MAC_OS_X_VERSION_10_6; } - private static final int MAC_OS_VERSION_14_3 = (int)140300L; + private static final int MAC_OS_X_VERSION_10_7 = (int)1070L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_14_3 140300 + * #define MAC_OS_X_VERSION_10_7 1070 * } */ - public static int MAC_OS_VERSION_14_3() { - return MAC_OS_VERSION_14_3; + public static int MAC_OS_X_VERSION_10_7() { + return MAC_OS_X_VERSION_10_7; } - private static final int MAC_OS_VERSION_14_4 = (int)140400L; + private static final int MAC_OS_X_VERSION_10_8 = (int)1080L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_14_4 140400 + * #define MAC_OS_X_VERSION_10_8 1080 * } */ - public static int MAC_OS_VERSION_14_4() { - return MAC_OS_VERSION_14_4; + public static int MAC_OS_X_VERSION_10_8() { + return MAC_OS_X_VERSION_10_8; } - private static final int MAC_OS_VERSION_14_5 = (int)140500L; + private static final int MAC_OS_X_VERSION_10_9 = (int)1090L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_14_5 140500 + * #define MAC_OS_X_VERSION_10_9 1090 * } */ - public static int MAC_OS_VERSION_14_5() { - return MAC_OS_VERSION_14_5; + public static int MAC_OS_X_VERSION_10_9() { + return MAC_OS_X_VERSION_10_9; } - private static final int __MAC_OS_X_VERSION_MAX_ALLOWED = (int)140500L; + private static final int MAC_OS_X_VERSION_10_10 = (int)101000L; /** * {@snippet lang=c : - * #define __MAC_OS_X_VERSION_MAX_ALLOWED 140500 + * #define MAC_OS_X_VERSION_10_10 101000 * } */ - public static int __MAC_OS_X_VERSION_MAX_ALLOWED() { - return __MAC_OS_X_VERSION_MAX_ALLOWED; + public static int MAC_OS_X_VERSION_10_10() { + return MAC_OS_X_VERSION_10_10; } - private static final MemorySegment __DARWIN_NULL = MemorySegment.ofAddress(0L); + private static final int MAC_OS_X_VERSION_10_10_2 = (int)101002L; /** * {@snippet lang=c : - * #define __DARWIN_NULL (void*) 0 + * #define MAC_OS_X_VERSION_10_10_2 101002 * } */ - public static MemorySegment __DARWIN_NULL() { - return __DARWIN_NULL; + public static int MAC_OS_X_VERSION_10_10_2() { + return MAC_OS_X_VERSION_10_10_2; } - private static final int __DARWIN_WCHAR_MAX = (int)2147483647L; + private static final int MAC_OS_X_VERSION_10_10_3 = (int)101003L; /** * {@snippet lang=c : - * #define __DARWIN_WCHAR_MAX 2147483647 + * #define MAC_OS_X_VERSION_10_10_3 101003 * } */ - public static int __DARWIN_WCHAR_MAX() { - return __DARWIN_WCHAR_MAX; + public static int MAC_OS_X_VERSION_10_10_3() { + return MAC_OS_X_VERSION_10_10_3; } - private static final int __DARWIN_WCHAR_MIN = (int)-2147483648L; + private static final int MAC_OS_X_VERSION_10_11 = (int)101100L; /** * {@snippet lang=c : - * #define __DARWIN_WCHAR_MIN -2147483648 + * #define MAC_OS_X_VERSION_10_11 101100 * } */ - public static int __DARWIN_WCHAR_MIN() { - return __DARWIN_WCHAR_MIN; + public static int MAC_OS_X_VERSION_10_11() { + return MAC_OS_X_VERSION_10_11; } - private static final int __DARWIN_WEOF = (int)-1L; + private static final int MAC_OS_X_VERSION_10_11_2 = (int)101102L; /** * {@snippet lang=c : - * #define __DARWIN_WEOF -1 + * #define MAC_OS_X_VERSION_10_11_2 101102 * } */ - public static int __DARWIN_WEOF() { - return __DARWIN_WEOF; + public static int MAC_OS_X_VERSION_10_11_2() { + return MAC_OS_X_VERSION_10_11_2; } - private static final long USER_ADDR_NULL = 0L; + private static final int MAC_OS_X_VERSION_10_11_3 = (int)101103L; /** * {@snippet lang=c : - * #define USER_ADDR_NULL 0 + * #define MAC_OS_X_VERSION_10_11_3 101103 * } */ - public static long USER_ADDR_NULL() { - return USER_ADDR_NULL; + public static int MAC_OS_X_VERSION_10_11_3() { + return MAC_OS_X_VERSION_10_11_3; } - private static final MemorySegment NULL = MemorySegment.ofAddress(0L); + private static final int MAC_OS_X_VERSION_10_11_4 = (int)101104L; /** * {@snippet lang=c : - * #define NULL (void*) 0 + * #define MAC_OS_X_VERSION_10_11_4 101104 * } */ - public static MemorySegment NULL() { - return NULL; + public static int MAC_OS_X_VERSION_10_11_4() { + return MAC_OS_X_VERSION_10_11_4; } - private static final int EOF = (int)-1L; + private static final int MAC_OS_X_VERSION_10_12 = (int)101200L; /** * {@snippet lang=c : - * #define EOF -1 + * #define MAC_OS_X_VERSION_10_12 101200 * } */ - public static int EOF() { - return EOF; + public static int MAC_OS_X_VERSION_10_12() { + return MAC_OS_X_VERSION_10_12; } + private static final int MAC_OS_X_VERSION_10_12_1 = (int)101201L; /** * {@snippet lang=c : - * #define P_tmpdir "/var/tmp/" + * #define MAC_OS_X_VERSION_10_12_1 101201 * } */ - public static MemorySegment P_tmpdir() { - class Holder { - static final MemorySegment P_tmpdir - = somelib_h.LIBRARY_ARENA.allocateFrom("/var/tmp/"); - } - return Holder.P_tmpdir; + public static int MAC_OS_X_VERSION_10_12_1() { + return MAC_OS_X_VERSION_10_12_1; } - private static final long INT64_MAX = 9223372036854775807L; + private static final int MAC_OS_X_VERSION_10_12_2 = (int)101202L; /** * {@snippet lang=c : - * #define INT64_MAX 9223372036854775807 + * #define MAC_OS_X_VERSION_10_12_2 101202 * } */ - public static long INT64_MAX() { - return INT64_MAX; + public static int MAC_OS_X_VERSION_10_12_2() { + return MAC_OS_X_VERSION_10_12_2; } - private static final int INT8_MIN = (int)-128L; + private static final int MAC_OS_X_VERSION_10_12_4 = (int)101204L; /** * {@snippet lang=c : - * #define INT8_MIN -128 + * #define MAC_OS_X_VERSION_10_12_4 101204 * } */ - public static int INT8_MIN() { - return INT8_MIN; + public static int MAC_OS_X_VERSION_10_12_4() { + return MAC_OS_X_VERSION_10_12_4; } - private static final int INT16_MIN = (int)-32768L; + private static final int MAC_OS_X_VERSION_10_13 = (int)101300L; /** * {@snippet lang=c : - * #define INT16_MIN -32768 + * #define MAC_OS_X_VERSION_10_13 101300 * } */ - public static int INT16_MIN() { - return INT16_MIN; + public static int MAC_OS_X_VERSION_10_13() { + return MAC_OS_X_VERSION_10_13; } - private static final int INT32_MIN = (int)-2147483648L; + private static final int MAC_OS_X_VERSION_10_13_1 = (int)101301L; /** * {@snippet lang=c : - * #define INT32_MIN -2147483648 + * #define MAC_OS_X_VERSION_10_13_1 101301 * } */ - public static int INT32_MIN() { - return INT32_MIN; + public static int MAC_OS_X_VERSION_10_13_1() { + return MAC_OS_X_VERSION_10_13_1; } - private static final long INT64_MIN = -9223372036854775808L; + private static final int MAC_OS_X_VERSION_10_13_2 = (int)101302L; /** * {@snippet lang=c : - * #define INT64_MIN -9223372036854775808 + * #define MAC_OS_X_VERSION_10_13_2 101302 * } */ - public static long INT64_MIN() { - return INT64_MIN; + public static int MAC_OS_X_VERSION_10_13_2() { + return MAC_OS_X_VERSION_10_13_2; } - private static final int UINT32_MAX = (int)4294967295L; + private static final int MAC_OS_X_VERSION_10_13_4 = (int)101304L; /** * {@snippet lang=c : - * #define UINT32_MAX 4294967295 + * #define MAC_OS_X_VERSION_10_13_4 101304 * } */ - public static int UINT32_MAX() { - return UINT32_MAX; + public static int MAC_OS_X_VERSION_10_13_4() { + return MAC_OS_X_VERSION_10_13_4; } - private static final long UINT64_MAX = -1L; + private static final int MAC_OS_X_VERSION_10_14 = (int)101400L; /** * {@snippet lang=c : - * #define UINT64_MAX -1 + * #define MAC_OS_X_VERSION_10_14 101400 * } */ - public static long UINT64_MAX() { - return UINT64_MAX; + public static int MAC_OS_X_VERSION_10_14() { + return MAC_OS_X_VERSION_10_14; } - private static final int INT_LEAST8_MIN = (int)-128L; + private static final int MAC_OS_X_VERSION_10_14_1 = (int)101401L; /** * {@snippet lang=c : - * #define INT_LEAST8_MIN -128 + * #define MAC_OS_X_VERSION_10_14_1 101401 * } */ - public static int INT_LEAST8_MIN() { - return INT_LEAST8_MIN; + public static int MAC_OS_X_VERSION_10_14_1() { + return MAC_OS_X_VERSION_10_14_1; } - private static final int INT_LEAST16_MIN = (int)-32768L; + private static final int MAC_OS_X_VERSION_10_14_4 = (int)101404L; /** * {@snippet lang=c : - * #define INT_LEAST16_MIN -32768 + * #define MAC_OS_X_VERSION_10_14_4 101404 * } */ - public static int INT_LEAST16_MIN() { - return INT_LEAST16_MIN; + public static int MAC_OS_X_VERSION_10_14_4() { + return MAC_OS_X_VERSION_10_14_4; } - private static final int INT_LEAST32_MIN = (int)-2147483648L; + private static final int MAC_OS_X_VERSION_10_14_5 = (int)101405L; /** * {@snippet lang=c : - * #define INT_LEAST32_MIN -2147483648 + * #define MAC_OS_X_VERSION_10_14_5 101405 * } */ - public static int INT_LEAST32_MIN() { - return INT_LEAST32_MIN; + public static int MAC_OS_X_VERSION_10_14_5() { + return MAC_OS_X_VERSION_10_14_5; } - private static final long INT_LEAST64_MIN = -9223372036854775808L; + private static final int MAC_OS_X_VERSION_10_14_6 = (int)101406L; /** * {@snippet lang=c : - * #define INT_LEAST64_MIN -9223372036854775808 + * #define MAC_OS_X_VERSION_10_14_6 101406 * } */ - public static long INT_LEAST64_MIN() { - return INT_LEAST64_MIN; + public static int MAC_OS_X_VERSION_10_14_6() { + return MAC_OS_X_VERSION_10_14_6; } - private static final int INT_LEAST8_MAX = (int)127L; + private static final int MAC_OS_X_VERSION_10_15 = (int)101500L; /** * {@snippet lang=c : - * #define INT_LEAST8_MAX 127 + * #define MAC_OS_X_VERSION_10_15 101500 * } */ - public static int INT_LEAST8_MAX() { - return INT_LEAST8_MAX; + public static int MAC_OS_X_VERSION_10_15() { + return MAC_OS_X_VERSION_10_15; } - private static final int INT_LEAST16_MAX = (int)32767L; + private static final int MAC_OS_X_VERSION_10_15_1 = (int)101501L; /** * {@snippet lang=c : - * #define INT_LEAST16_MAX 32767 + * #define MAC_OS_X_VERSION_10_15_1 101501 * } */ - public static int INT_LEAST16_MAX() { - return INT_LEAST16_MAX; + public static int MAC_OS_X_VERSION_10_15_1() { + return MAC_OS_X_VERSION_10_15_1; } - private static final int INT_LEAST32_MAX = (int)2147483647L; + private static final int MAC_OS_X_VERSION_10_15_4 = (int)101504L; /** * {@snippet lang=c : - * #define INT_LEAST32_MAX 2147483647 + * #define MAC_OS_X_VERSION_10_15_4 101504 * } */ - public static int INT_LEAST32_MAX() { - return INT_LEAST32_MAX; + public static int MAC_OS_X_VERSION_10_15_4() { + return MAC_OS_X_VERSION_10_15_4; } - private static final long INT_LEAST64_MAX = 9223372036854775807L; + private static final int MAC_OS_X_VERSION_10_16 = (int)101600L; /** * {@snippet lang=c : - * #define INT_LEAST64_MAX 9223372036854775807 + * #define MAC_OS_X_VERSION_10_16 101600 * } */ - public static long INT_LEAST64_MAX() { - return INT_LEAST64_MAX; + public static int MAC_OS_X_VERSION_10_16() { + return MAC_OS_X_VERSION_10_16; } - private static final int UINT_LEAST8_MAX = (int)255L; + private static final int MAC_OS_VERSION_11_0 = (int)110000L; /** * {@snippet lang=c : - * #define UINT_LEAST8_MAX 255 + * #define MAC_OS_VERSION_11_0 110000 * } */ - public static int UINT_LEAST8_MAX() { - return UINT_LEAST8_MAX; + public static int MAC_OS_VERSION_11_0() { + return MAC_OS_VERSION_11_0; } - private static final int UINT_LEAST16_MAX = (int)65535L; + private static final int MAC_OS_VERSION_11_1 = (int)110100L; /** * {@snippet lang=c : - * #define UINT_LEAST16_MAX 65535 + * #define MAC_OS_VERSION_11_1 110100 * } */ - public static int UINT_LEAST16_MAX() { - return UINT_LEAST16_MAX; + public static int MAC_OS_VERSION_11_1() { + return MAC_OS_VERSION_11_1; } - private static final int UINT_LEAST32_MAX = (int)4294967295L; + private static final int MAC_OS_VERSION_11_3 = (int)110300L; /** * {@snippet lang=c : - * #define UINT_LEAST32_MAX 4294967295 + * #define MAC_OS_VERSION_11_3 110300 * } */ - public static int UINT_LEAST32_MAX() { - return UINT_LEAST32_MAX; + public static int MAC_OS_VERSION_11_3() { + return MAC_OS_VERSION_11_3; } - private static final long UINT_LEAST64_MAX = -1L; + private static final int MAC_OS_VERSION_11_4 = (int)110400L; /** * {@snippet lang=c : - * #define UINT_LEAST64_MAX -1 + * #define MAC_OS_VERSION_11_4 110400 * } */ - public static long UINT_LEAST64_MAX() { - return UINT_LEAST64_MAX; + public static int MAC_OS_VERSION_11_4() { + return MAC_OS_VERSION_11_4; } - private static final int INT_FAST8_MIN = (int)-128L; + private static final int MAC_OS_VERSION_11_5 = (int)110500L; /** * {@snippet lang=c : - * #define INT_FAST8_MIN -128 + * #define MAC_OS_VERSION_11_5 110500 * } */ - public static int INT_FAST8_MIN() { - return INT_FAST8_MIN; + public static int MAC_OS_VERSION_11_5() { + return MAC_OS_VERSION_11_5; } - private static final int INT_FAST16_MIN = (int)-32768L; + private static final int MAC_OS_VERSION_11_6 = (int)110600L; /** * {@snippet lang=c : - * #define INT_FAST16_MIN -32768 + * #define MAC_OS_VERSION_11_6 110600 * } */ - public static int INT_FAST16_MIN() { - return INT_FAST16_MIN; + public static int MAC_OS_VERSION_11_6() { + return MAC_OS_VERSION_11_6; } - private static final int INT_FAST32_MIN = (int)-2147483648L; + private static final int MAC_OS_VERSION_12_0 = (int)120000L; /** * {@snippet lang=c : - * #define INT_FAST32_MIN -2147483648 + * #define MAC_OS_VERSION_12_0 120000 * } */ - public static int INT_FAST32_MIN() { - return INT_FAST32_MIN; + public static int MAC_OS_VERSION_12_0() { + return MAC_OS_VERSION_12_0; } - private static final long INT_FAST64_MIN = -9223372036854775808L; + private static final int MAC_OS_VERSION_12_1 = (int)120100L; /** * {@snippet lang=c : - * #define INT_FAST64_MIN -9223372036854775808 + * #define MAC_OS_VERSION_12_1 120100 * } */ - public static long INT_FAST64_MIN() { - return INT_FAST64_MIN; + public static int MAC_OS_VERSION_12_1() { + return MAC_OS_VERSION_12_1; } - private static final int INT_FAST8_MAX = (int)127L; + private static final int MAC_OS_VERSION_12_2 = (int)120200L; /** * {@snippet lang=c : - * #define INT_FAST8_MAX 127 + * #define MAC_OS_VERSION_12_2 120200 * } */ - public static int INT_FAST8_MAX() { - return INT_FAST8_MAX; + public static int MAC_OS_VERSION_12_2() { + return MAC_OS_VERSION_12_2; } - private static final int INT_FAST16_MAX = (int)32767L; + private static final int MAC_OS_VERSION_12_3 = (int)120300L; /** * {@snippet lang=c : - * #define INT_FAST16_MAX 32767 + * #define MAC_OS_VERSION_12_3 120300 * } */ - public static int INT_FAST16_MAX() { - return INT_FAST16_MAX; + public static int MAC_OS_VERSION_12_3() { + return MAC_OS_VERSION_12_3; } - private static final int INT_FAST32_MAX = (int)2147483647L; + private static final int MAC_OS_VERSION_12_4 = (int)120400L; /** * {@snippet lang=c : - * #define INT_FAST32_MAX 2147483647 + * #define MAC_OS_VERSION_12_4 120400 * } */ - public static int INT_FAST32_MAX() { - return INT_FAST32_MAX; + public static int MAC_OS_VERSION_12_4() { + return MAC_OS_VERSION_12_4; } - private static final long INT_FAST64_MAX = 9223372036854775807L; + private static final int MAC_OS_VERSION_12_5 = (int)120500L; /** * {@snippet lang=c : - * #define INT_FAST64_MAX 9223372036854775807 + * #define MAC_OS_VERSION_12_5 120500 * } */ - public static long INT_FAST64_MAX() { - return INT_FAST64_MAX; + public static int MAC_OS_VERSION_12_5() { + return MAC_OS_VERSION_12_5; } - private static final int UINT_FAST8_MAX = (int)255L; + private static final int MAC_OS_VERSION_12_6 = (int)120600L; /** * {@snippet lang=c : - * #define UINT_FAST8_MAX 255 + * #define MAC_OS_VERSION_12_6 120600 * } */ - public static int UINT_FAST8_MAX() { - return UINT_FAST8_MAX; + public static int MAC_OS_VERSION_12_6() { + return MAC_OS_VERSION_12_6; } - private static final int UINT_FAST16_MAX = (int)65535L; + private static final int MAC_OS_VERSION_12_7 = (int)120700L; /** * {@snippet lang=c : - * #define UINT_FAST16_MAX 65535 + * #define MAC_OS_VERSION_12_7 120700 * } */ - public static int UINT_FAST16_MAX() { - return UINT_FAST16_MAX; + public static int MAC_OS_VERSION_12_7() { + return MAC_OS_VERSION_12_7; } - private static final int UINT_FAST32_MAX = (int)4294967295L; + private static final int MAC_OS_VERSION_13_0 = (int)130000L; /** * {@snippet lang=c : - * #define UINT_FAST32_MAX 4294967295 + * #define MAC_OS_VERSION_13_0 130000 * } */ - public static int UINT_FAST32_MAX() { - return UINT_FAST32_MAX; + public static int MAC_OS_VERSION_13_0() { + return MAC_OS_VERSION_13_0; } - private static final long UINT_FAST64_MAX = -1L; + private static final int MAC_OS_VERSION_13_1 = (int)130100L; /** * {@snippet lang=c : - * #define UINT_FAST64_MAX -1 + * #define MAC_OS_VERSION_13_1 130100 * } */ - public static long UINT_FAST64_MAX() { - return UINT_FAST64_MAX; + public static int MAC_OS_VERSION_13_1() { + return MAC_OS_VERSION_13_1; } - private static final long INTPTR_MAX = 9223372036854775807L; + private static final int MAC_OS_VERSION_13_2 = (int)130200L; /** * {@snippet lang=c : - * #define INTPTR_MAX 9223372036854775807 + * #define MAC_OS_VERSION_13_2 130200 * } */ - public static long INTPTR_MAX() { - return INTPTR_MAX; + public static int MAC_OS_VERSION_13_2() { + return MAC_OS_VERSION_13_2; } - private static final long INTPTR_MIN = -9223372036854775808L; + private static final int MAC_OS_VERSION_13_3 = (int)130300L; /** * {@snippet lang=c : - * #define INTPTR_MIN -9223372036854775808 + * #define MAC_OS_VERSION_13_3 130300 * } */ - public static long INTPTR_MIN() { - return INTPTR_MIN; + public static int MAC_OS_VERSION_13_3() { + return MAC_OS_VERSION_13_3; } - private static final long UINTPTR_MAX = -1L; + private static final int MAC_OS_VERSION_13_4 = (int)130400L; /** * {@snippet lang=c : - * #define UINTPTR_MAX -1 + * #define MAC_OS_VERSION_13_4 130400 * } */ - public static long UINTPTR_MAX() { - return UINTPTR_MAX; + public static int MAC_OS_VERSION_13_4() { + return MAC_OS_VERSION_13_4; } - private static final long INTMAX_MAX = 9223372036854775807L; + private static final int MAC_OS_VERSION_13_5 = (int)130500L; /** * {@snippet lang=c : - * #define INTMAX_MAX 9223372036854775807 + * #define MAC_OS_VERSION_13_5 130500 * } */ - public static long INTMAX_MAX() { - return INTMAX_MAX; + public static int MAC_OS_VERSION_13_5() { + return MAC_OS_VERSION_13_5; } - private static final long UINTMAX_MAX = -1L; + private static final int MAC_OS_VERSION_13_6 = (int)130600L; /** * {@snippet lang=c : - * #define UINTMAX_MAX -1 + * #define MAC_OS_VERSION_13_6 130600 * } */ - public static long UINTMAX_MAX() { - return UINTMAX_MAX; + public static int MAC_OS_VERSION_13_6() { + return MAC_OS_VERSION_13_6; } - private static final long INTMAX_MIN = -9223372036854775808L; + private static final int MAC_OS_VERSION_14_0 = (int)140000L; /** * {@snippet lang=c : - * #define INTMAX_MIN -9223372036854775808 + * #define MAC_OS_VERSION_14_0 140000 * } */ - public static long INTMAX_MIN() { - return INTMAX_MIN; + public static int MAC_OS_VERSION_14_0() { + return MAC_OS_VERSION_14_0; } - private static final long PTRDIFF_MIN = -9223372036854775808L; + private static final int MAC_OS_VERSION_14_1 = (int)140100L; /** * {@snippet lang=c : - * #define PTRDIFF_MIN -9223372036854775808 + * #define MAC_OS_VERSION_14_1 140100 * } */ - public static long PTRDIFF_MIN() { - return PTRDIFF_MIN; + public static int MAC_OS_VERSION_14_1() { + return MAC_OS_VERSION_14_1; } - private static final long PTRDIFF_MAX = 9223372036854775807L; + private static final int MAC_OS_VERSION_14_2 = (int)140200L; /** * {@snippet lang=c : - * #define PTRDIFF_MAX 9223372036854775807 + * #define MAC_OS_VERSION_14_2 140200 * } */ - public static long PTRDIFF_MAX() { - return PTRDIFF_MAX; + public static int MAC_OS_VERSION_14_2() { + return MAC_OS_VERSION_14_2; } - private static final long SIZE_MAX = -1L; + private static final int MAC_OS_VERSION_14_3 = (int)140300L; /** * {@snippet lang=c : - * #define SIZE_MAX -1 + * #define MAC_OS_VERSION_14_3 140300 * } */ - public static long SIZE_MAX() { - return SIZE_MAX; + public static int MAC_OS_VERSION_14_3() { + return MAC_OS_VERSION_14_3; } - private static final long RSIZE_MAX = 9223372036854775807L; + private static final int MAC_OS_VERSION_14_4 = (int)140400L; /** * {@snippet lang=c : - * #define RSIZE_MAX 9223372036854775807 + * #define MAC_OS_VERSION_14_4 140400 * } */ - public static long RSIZE_MAX() { - return RSIZE_MAX; + public static int MAC_OS_VERSION_14_4() { + return MAC_OS_VERSION_14_4; } - private static final int WCHAR_MAX = (int)2147483647L; + private static final int MAC_OS_VERSION_14_5 = (int)140500L; /** * {@snippet lang=c : - * #define WCHAR_MAX 2147483647 + * #define MAC_OS_VERSION_14_5 140500 * } */ - public static int WCHAR_MAX() { - return WCHAR_MAX; + public static int MAC_OS_VERSION_14_5() { + return MAC_OS_VERSION_14_5; } - private static final int WCHAR_MIN = (int)-2147483648L; + private static final int __MAC_OS_X_VERSION_MAX_ALLOWED = (int)140500L; /** * {@snippet lang=c : - * #define WCHAR_MIN -2147483648 + * #define __MAC_OS_X_VERSION_MAX_ALLOWED 140500 * } */ - public static int WCHAR_MIN() { - return WCHAR_MIN; + public static int __MAC_OS_X_VERSION_MAX_ALLOWED() { + return __MAC_OS_X_VERSION_MAX_ALLOWED; } - private static final int WINT_MIN = (int)-2147483648L; + private static final int __DARWIN_WCHAR_MAX = (int)2147483647L; /** * {@snippet lang=c : - * #define WINT_MIN -2147483648 + * #define __DARWIN_WCHAR_MAX 2147483647 * } */ - public static int WINT_MIN() { - return WINT_MIN; + public static int __DARWIN_WCHAR_MAX() { + return __DARWIN_WCHAR_MAX; } - private static final int WINT_MAX = (int)2147483647L; + private static final int __DARWIN_WCHAR_MIN = (int)-2147483648L; /** * {@snippet lang=c : - * #define WINT_MAX 2147483647 + * #define __DARWIN_WCHAR_MIN -2147483648 * } */ - public static int WINT_MAX() { - return WINT_MAX; + public static int __DARWIN_WCHAR_MIN() { + return __DARWIN_WCHAR_MIN; } - private static final int SIG_ATOMIC_MIN = (int)-2147483648L; + private static final int __DARWIN_WEOF = (int)-1L; /** * {@snippet lang=c : - * #define SIG_ATOMIC_MIN -2147483648 + * #define __DARWIN_WEOF -1 * } */ - public static int SIG_ATOMIC_MIN() { - return SIG_ATOMIC_MIN; + public static int __DARWIN_WEOF() { + return __DARWIN_WEOF; } - private static final int SIG_ATOMIC_MAX = (int)2147483647L; + private static final int EOF = (int)-1L; /** * {@snippet lang=c : - * #define SIG_ATOMIC_MAX 2147483647 + * #define EOF -1 * } */ - public static int SIG_ATOMIC_MAX() { - return SIG_ATOMIC_MAX; + public static int EOF() { + return EOF; } /** * {@snippet lang=c : - * #define __ASSERT_FILE_NAME "jextract$14286507266664310341.h" + * #define P_tmpdir "/var/tmp/" * } */ - public static MemorySegment __ASSERT_FILE_NAME() { + public static MemorySegment P_tmpdir() { class Holder { - static final MemorySegment __ASSERT_FILE_NAME - = somelib_h.LIBRARY_ARENA.allocateFrom("jextract$14286507266664310341.h"); + static final MemorySegment P_tmpdir + = somelib_h.LIBRARY_ARENA.allocateFrom("/var/tmp/"); } - return Holder.__ASSERT_FILE_NAME; + return Holder.P_tmpdir; } } diff --git a/tool/src/java/mod.rs b/tool/src/java/mod.rs index 704dc47d6..38fdfcec0 100644 --- a/tool/src/java/mod.rs +++ b/tool/src/java/mod.rs @@ -11,6 +11,7 @@ use diplomat_core::hir::{ StringEncoding, StructDef, StructPathLike, SuccessType, TyPosition, TypeContext, TypeDef, }; use formatter::JavaFormatter; +use heck::ToUpperCamelCase; use serde::Deserialize; use crate::{c, ErrorStore, FileMap}; @@ -350,11 +351,15 @@ impl<'a, 'cx> TyGenContext<'a, 'cx> { let arena_name = borrow.map(|_| "arena").unwrap_or("Arena.global()"); ( format!( - r#"var {name}MemSeg = {arena_name}.allocateFrom({name}, StandardCharsets.UTF_16); -var {name}Len = {name}MemSeg.byteSize();"# + r#"var {name}Data= {arena_name}.allocateFrom({name}, StandardCharsets.UTF_16); +var {name}Len = {name}Data.byteSize() - 1; // allocated strings are null terminated +var {name}View = DiplomatString16View.allocate({arena_name}); +DiplomatString16View.len({name}View, {name}Len); +DiplomatString16View.data({name}View, {name}Data);"# + ) .into(), - format!("{name}MemSeg, {name}Len - 1").into(), + format!("{name}View").into(), ) } hir::Type::Slice(Slice::Str( @@ -364,15 +369,22 @@ var {name}Len = {name}MemSeg.byteSize();"# let arena_name = borrow.map(|_| "arena").unwrap_or("Arena.global()"); ( format!( - r#"var {name}MemSeg = {arena_name}.allocateFrom({name}, StandardCharsets.UTF_8); -var {name}Len = {name}MemSeg.byteSize();"# + r#"var {name}Data= {arena_name}.allocateFrom({name}, StandardCharsets.UTF_8); +var {name}Len = {name}Data.byteSize() - 1; +var {name}View = DiplomatStringView.allocate({arena_name}); +DiplomatStringView.len({name}View, {name}Len); +DiplomatStringView.data({name}View, {name}Data);"# ) .into(), - format!("{name}MemSeg, {name}Len - 1").into(), + format!("{name}View").into(), // by default java native creates null terminated strings ) } hir::Type::Slice(Slice::Primitive(borrow, p)) => { + let rust_primitive_type = match p { + hir::PrimitiveType::Byte => "U8".to_string(), + _ => p.as_str().to_upper_camel_case(), + }; let primitive_ty = match p { hir::PrimitiveType::Bool => "JAVA_BYTE", // BYTE is the smallest hir::PrimitiveType::Char => "JAVA_INT", @@ -396,32 +408,40 @@ byte[] {name}ByteArray = new byte[{name}Len]; for (int i = 0; i < {name}Len; i++) {{ {name}ByteArray[i] = (byte) ({name}[i] ? 1 : 0); }} -var {name}MemSeg = {arena_name}.allocateFrom({primitive_ty}, {name}ByteArray);"# +var {name}Data = {arena_name}.allocateFrom({primitive_ty}, {name}ByteArray); +var {name}View = Diplomat{rust_primitive_type}View.allocate({arena_name}); +Diplomat{rust_primitive_type}View.len({name}View, {name}Len); +Diplomat{rust_primitive_type}View.data({name}View, {name}Data); +"# ) .into(), _ => format!( r#"var {name}Len = {name}.length; -var {name}MemSeg = {arena_name}.allocateFrom({primitive_ty}, {name});"# +var {name}Data= {arena_name}.allocateFrom({primitive_ty}, {name}); +var {name}View = Diplomat{rust_primitive_type}View.allocate({arena_name}); +Diplomat{rust_primitive_type}View.len({name}View, {name}Len); +Diplomat{rust_primitive_type}View.data({name}View, {name}Data); +"# ) .into(), }; - (conversion, format!("{name}MemSeg, {name}Len").into()) + (conversion, format!("{name}View").into()) } hir::Type::Slice(Slice::Strs(StringEncoding::UnvalidatedUtf16)) => ( format!( - r#"var {name}Data = SliceUtils.strs16(arena, {name}); + r#"var {name}View = SliceUtils.strs16(arena, {name}); var {name}Len = {name}.length;"# ) .into(), - format!(r#"{name}Data, {name}Len"#).into(), + format!(r#"{name}View"#).into(), ), hir::Type::Slice(Slice::Strs(_)) => ( format!( - r#"var {name}Data = SliceUtils.strs8(arena, {name}); + r#"var {name}View = SliceUtils.strs8(arena, {name}); var {name}Len = {name}.length;"# ) .into(), - format!(r#"{name}Data, {name}Len"#).into(), + format!(r#"{name}View"#).into(), ), x => panic!("Unexpected slice type {x:?}"), }; diff --git a/tool/templates/java/Lib.java.jinja b/tool/templates/java/Lib.java.jinja index da5462b71..ab5eca85e 100644 --- a/tool/templates/java/Lib.java.jinja +++ b/tool/templates/java/Lib.java.jinja @@ -162,8 +162,7 @@ class SliceUtils { var string = new String(bytes, StandardCharsets.UTF_16); return string; } - - // for parameter conversion + // for parameter conversion static MemorySegment strs16(SegmentAllocator arena, String [] strings) { var diplomatStrsData = DiplomatStringView.allocateArray(strings.length, arena); var layout = DiplomatStringView.layout(); @@ -179,7 +178,10 @@ class SliceUtils { i++; } }); - return diplomatStrsData; + var diplomatStrsView = DiplomatStrings16View.allocate(arena); + DiplomatStrings16View.len(diplomatStrsView, strings.length); + DiplomatStrings16View.data(diplomatStrsView, diplomatStrsData); + return diplomatStrsView; } static MemorySegment strs8(SegmentAllocator arena, String [] strings) { @@ -197,7 +199,11 @@ class SliceUtils { i++; } }); - return diplomatStrsData; + + var diplomatStrsView = DiplomatStringsView.allocate(arena); + DiplomatStringsView.len(diplomatStrsView, strings.length); + DiplomatStringsView.data(diplomatStrsView, diplomatStrsData); + return diplomatStrsView; } static String readUtf8FromWriteable(MemorySegment writeable) { diff --git a/tool/templates/java/Struct.java.jinja b/tool/templates/java/Struct.java.jinja index 1e866d1c1..aee0b7642 100644 --- a/tool/templates/java/Struct.java.jinja +++ b/tool/templates/java/Struct.java.jinja @@ -1,6 +1,6 @@ package {{domain}}.{{lib_name}}; -import {{domain}}.{{lib_name}}.ntv.{{lib_name}}_h; +import {{domain}}.{{lib_name}}.ntv.*; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; From 770b99b93e20c6da5e233a8cd33de93ab1a08e2d Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Wed, 14 Aug 2024 21:12:27 +0200 Subject: [PATCH 23/69] panam-backend - update snapshots --- ...mat_tool__java__test__enum_and_struct.snap | 2 +- .../diplomat_tool__java__test__lifetimes.snap | 33 ++++++++----- .../diplomat_tool__java__test__opaque.snap | 9 ++-- .../diplomat_tool__java__test__slice.snap | 48 ++++++++++++------- 4 files changed, 60 insertions(+), 32 deletions(-) diff --git a/tool/src/java/snapshots/diplomat_tool__java__test__enum_and_struct.snap b/tool/src/java/snapshots/diplomat_tool__java__test__enum_and_struct.snap index 376e6c2b2..d0af5942e 100644 --- a/tool/src/java/snapshots/diplomat_tool__java__test__enum_and_struct.snap +++ b/tool/src/java/snapshots/diplomat_tool__java__test__enum_and_struct.snap @@ -4,7 +4,7 @@ expression: res --- package dev.diplomattest.somelib; -import dev.diplomattest.somelib.ntv.somelib_h; +import dev.diplomattest.somelib.ntv.*; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; diff --git a/tool/src/java/snapshots/diplomat_tool__java__test__lifetimes.snap b/tool/src/java/snapshots/diplomat_tool__java__test__lifetimes.snap index 64b95c481..563f145a3 100644 --- a/tool/src/java/snapshots/diplomat_tool__java__test__lifetimes.snap +++ b/tool/src/java/snapshots/diplomat_tool__java__test__lifetimes.snap @@ -4,7 +4,7 @@ expression: res --- package dev.diplomattest.somelib; -import dev.diplomattest.somelib.ntv.somelib_h; +import dev.diplomattest.somelib.ntv.*; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; @@ -50,7 +50,7 @@ public class BorrowedFields { ============================ package dev.diplomattest.somelib; -import dev.diplomattest.somelib.ntv.somelib_h; +import dev.diplomattest.somelib.ntv.*; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; @@ -92,7 +92,7 @@ public class BorrowedFieldsReturning { ============================ package dev.diplomattest.somelib; -import dev.diplomattest.somelib.ntv.somelib_h; +import dev.diplomattest.somelib.ntv.*; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; @@ -236,9 +236,12 @@ public class Foo { public static Foo new_(String x) { try (var arena = Arena.ofConfined()) { - var xMemSeg = arena.allocateFrom(x, StandardCharsets.UTF_8); - var xLen = xMemSeg.byteSize(); - var nativeVal = somelib_h.Foo_new(xMemSeg, xLen - 1); + var xData= arena.allocateFrom(x, StandardCharsets.UTF_8); + var xLen = xData.byteSize() - 1; + var xView = DiplomatStringView.allocate(arena); + DiplomatStringView.len(xView, xLen); + DiplomatStringView.data(xView, xData); + var nativeVal = somelib_h.Foo_new(xView); List selfEdges = List.of(); @@ -254,9 +257,12 @@ public class Foo { public static Foo newStatic(String x) { try (var arena = Arena.ofConfined()) { - var xMemSeg = arena.allocateFrom(x, StandardCharsets.UTF_8); - var xLen = xMemSeg.byteSize(); - var nativeVal = somelib_h.Foo_new_static(xMemSeg, xLen - 1); + var xData= arena.allocateFrom(x, StandardCharsets.UTF_8); + var xLen = xData.byteSize() - 1; + var xView = DiplomatStringView.allocate(arena); + DiplomatStringView.len(xView, xLen); + DiplomatStringView.data(xView, xData); + var nativeVal = somelib_h.Foo_new_static(xView); List selfEdges = List.of(); @@ -288,9 +294,12 @@ public class Foo { try (var arena = Arena.ofConfined()) { var boundsNative = bounds.internal; - var anotherStringMemSeg = arena.allocateFrom(anotherString, StandardCharsets.UTF_8); - var anotherStringLen = anotherStringMemSeg.byteSize(); - var nativeVal = somelib_h.Foo_extract_from_bounds(boundsNative, anotherStringMemSeg, anotherStringLen - 1); + var anotherStringData= arena.allocateFrom(anotherString, StandardCharsets.UTF_8); + var anotherStringLen = anotherStringData.byteSize() - 1; + var anotherStringView = DiplomatStringView.allocate(arena); + DiplomatStringView.len(anotherStringView, anotherStringLen); + DiplomatStringView.data(anotherStringView, anotherStringData); + var nativeVal = somelib_h.Foo_extract_from_bounds(boundsNative, anotherStringView); List selfEdges = List.of(); diff --git a/tool/src/java/snapshots/diplomat_tool__java__test__opaque.snap b/tool/src/java/snapshots/diplomat_tool__java__test__opaque.snap index d1d5e719a..66a79c92f 100644 --- a/tool/src/java/snapshots/diplomat_tool__java__test__opaque.snap +++ b/tool/src/java/snapshots/diplomat_tool__java__test__opaque.snap @@ -60,9 +60,12 @@ public class Opaque { public static Opaque fromStr(String input) { try (var arena = Arena.ofConfined()) { - var inputMemSeg = arena.allocateFrom(input, StandardCharsets.UTF_8); - var inputLen = inputMemSeg.byteSize(); - var nativeVal = somelib_h.Opaque_from_str(inputMemSeg, inputLen - 1); + var inputData= arena.allocateFrom(input, StandardCharsets.UTF_8); + var inputLen = inputData.byteSize() - 1; + var inputView = DiplomatStringView.allocate(arena); + DiplomatStringView.len(inputView, inputLen); + DiplomatStringView.data(inputView, inputData); + var nativeVal = somelib_h.Opaque_from_str(inputView); List selfEdges = List.of(); diff --git a/tool/src/java/snapshots/diplomat_tool__java__test__slice.snap b/tool/src/java/snapshots/diplomat_tool__java__test__slice.snap index 0aec7a1ab..5d6fd4713 100644 --- a/tool/src/java/snapshots/diplomat_tool__java__test__slice.snap +++ b/tool/src/java/snapshots/diplomat_tool__java__test__slice.snap @@ -48,8 +48,12 @@ public class Float64Vec { try (var arena = Arena.ofConfined()) { var vLen = v.length; - var vMemSeg = arena.allocateFrom(JAVA_DOUBLE, v); - var nativeVal = somelib_h.Float64Vec_new(vMemSeg, vLen); + var vData= arena.allocateFrom(JAVA_DOUBLE, v); + var vView = DiplomatF64View.allocate(arena); + DiplomatF64View.len(vView, vLen); + DiplomatF64View.data(vView, vData); + + var nativeVal = somelib_h.Float64Vec_new(vView); List selfEdges = List.of(); @@ -121,9 +125,12 @@ public class MyString { public static MyString new_(String v) { try (var arena = Arena.ofConfined()) { - var vMemSeg = arena.allocateFrom(v, StandardCharsets.UTF_8); - var vLen = vMemSeg.byteSize(); - var nativeVal = somelib_h.MyString_new(vMemSeg, vLen - 1); + var vData= arena.allocateFrom(v, StandardCharsets.UTF_8); + var vLen = vData.byteSize() - 1; + var vView = DiplomatStringView.allocate(arena); + DiplomatStringView.len(vView, vLen); + DiplomatStringView.data(vView, vData); + var nativeVal = somelib_h.MyString_new(vView); List selfEdges = List.of(); @@ -138,9 +145,12 @@ public class MyString { public static MyString newUnsafe(String v) { try (var arena = Arena.ofConfined()) { - var vMemSeg = arena.allocateFrom(v, StandardCharsets.UTF_8); - var vLen = vMemSeg.byteSize(); - var nativeVal = somelib_h.MyString_new_unsafe(vMemSeg, vLen - 1); + var vData= arena.allocateFrom(v, StandardCharsets.UTF_8); + var vLen = vData.byteSize() - 1; + var vView = DiplomatStringView.allocate(arena); + DiplomatStringView.len(vView, vLen); + DiplomatStringView.data(vView, vData); + var nativeVal = somelib_h.MyString_new_unsafe(vView); List selfEdges = List.of(); @@ -154,9 +164,12 @@ public class MyString { public static MyString newOwned(String v) { - var vMemSeg = Arena.global().allocateFrom(v, StandardCharsets.UTF_8); - var vLen = vMemSeg.byteSize(); - var nativeVal = somelib_h.MyString_new_owned(vMemSeg, vLen - 1); + var vData= Arena.global().allocateFrom(v, StandardCharsets.UTF_8); + var vLen = vData.byteSize() - 1; + var vView = DiplomatStringView.allocate(Arena.global()); + DiplomatStringView.len(vView, vLen); + DiplomatStringView.data(vView, vData); + var nativeVal = somelib_h.MyString_new_owned(vView); List selfEdges = List.of(); @@ -170,9 +183,9 @@ public class MyString { public static MyString newFromFirst(String [] v) { try (var arena = Arena.ofConfined()) { - var vData = SliceUtils.strs8(arena, v); + var vView = SliceUtils.strs8(arena, v); var vLen = v.length; - var nativeVal = somelib_h.MyString_new_from_first(vData, vLen); + var nativeVal = somelib_h.MyString_new_from_first(vView); List selfEdges = List.of(); @@ -189,9 +202,12 @@ public class MyString { try (var arena = Arena.ofConfined()) { - var newStrMemSeg = arena.allocateFrom(newStr, StandardCharsets.UTF_8); - var newStrLen = newStrMemSeg.byteSize(); - somelib_h.MyString_set_str(internal, newStrMemSeg, newStrLen - 1); + var newStrData= arena.allocateFrom(newStr, StandardCharsets.UTF_8); + var newStrLen = newStrData.byteSize() - 1; + var newStrView = DiplomatStringView.allocate(arena); + DiplomatStringView.len(newStrView, newStrLen); + DiplomatStringView.data(newStrView, newStrData); + somelib_h.MyString_set_str(internal, newStrView); } } From b442eeaff96d755e0f7a7437e3f6c30eeaf1e722 Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Sun, 1 Sep 2024 10:35:15 +0200 Subject: [PATCH 24/69] panama-backend - add make tas / add ci / disable a feature method --- .github/workflows/ci.yml | 17 + Makefile.toml | 24 + .../java/somelib/hs_err_pid98653.log | 1247 ---- .../java/somelib/hs_err_pid98695.log | 1291 ---- .../java/somelib/hs_err_pid98776.log | 1291 ---- .../java/somelib/hs_err_pid98821.log | 1245 ---- .../java/somelib/hs_err_pid98829.log | 1291 ---- .../java/somelib/hs_err_pid98866.log | 1291 ---- .../java/dev/diplomattest/somelib/Foo.java | 21 - .../ntv/BorrowedFieldsReturning_option.java | 178 + .../ntv/BorrowedFieldsWithBounds_option.java | 178 + .../somelib/ntv/BorrowedFields_option.java | 178 + .../somelib/ntv/ContiguousEnum_option.java | 178 + .../somelib/ntv/CyclicStructA_option.java | 177 + .../somelib/ntv/CyclicStructB_option.java | 177 + .../somelib/ntv/ErrorEnum_option.java | 178 + .../somelib/ntv/ErrorStruct_option.java | 178 + .../somelib/ntv/ImportedStruct_option.java | 178 + .../somelib/ntv/MyEnum_option.java | 178 + .../somelib/ntv/MyStruct_option.java | 178 + .../ntv/NestedBorrowedFields_option.java | 178 + .../diplomattest/somelib/ntv/OptionBool.java | 177 + .../diplomattest/somelib/ntv/OptionChar.java | 178 + .../diplomattest/somelib/ntv/OptionF32.java | 178 + .../diplomattest/somelib/ntv/OptionF64.java | 178 + .../diplomattest/somelib/ntv/OptionI16.java | 178 + .../diplomattest/somelib/ntv/OptionI32.java | 178 + .../diplomattest/somelib/ntv/OptionI64.java | 178 + .../diplomattest/somelib/ntv/OptionI8.java | 177 + .../diplomattest/somelib/ntv/OptionIsize.java | 178 + .../diplomattest/somelib/ntv/OptionU16.java | 178 + .../diplomattest/somelib/ntv/OptionU32.java | 178 + .../diplomattest/somelib/ntv/OptionU64.java | 178 + .../diplomattest/somelib/ntv/OptionU8.java | 177 + .../diplomattest/somelib/ntv/OptionUsize.java | 178 + .../somelib/ntv/UnimportedEnum_option.java | 178 + .../diplomattest/somelib/ntv/somelib_h.java | 6056 ++++++++--------- feature_tests/src/structs.rs | 1 + ...plomat_tool__kotlin__test__opaque_gen.snap | 77 +- 39 files changed, 7918 insertions(+), 10735 deletions(-) delete mode 100644 feature_tests/java/somelib/hs_err_pid98653.log delete mode 100644 feature_tests/java/somelib/hs_err_pid98695.log delete mode 100644 feature_tests/java/somelib/hs_err_pid98776.log delete mode 100644 feature_tests/java/somelib/hs_err_pid98821.log delete mode 100644 feature_tests/java/somelib/hs_err_pid98829.log delete mode 100644 feature_tests/java/somelib/hs_err_pid98866.log create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/BorrowedFieldsReturning_option.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/BorrowedFieldsWithBounds_option.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/BorrowedFields_option.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ContiguousEnum_option.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/CyclicStructA_option.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/CyclicStructB_option.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ErrorEnum_option.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ErrorStruct_option.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ImportedStruct_option.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/MyEnum_option.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/MyStruct_option.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/NestedBorrowedFields_option.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionBool.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionChar.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionF32.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionF64.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionI16.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionI32.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionI64.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionI8.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionIsize.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionU16.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionU32.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionU64.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionU8.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionUsize.java create mode 100644 feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/UnimportedEnum_option.java diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ca0221433..6d066c241 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -178,6 +178,7 @@ jobs: - name: Test Dart run: cargo make test-dart + test-kotlin: runs-on: ubuntu-latest steps: @@ -194,3 +195,19 @@ jobs: uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0 - name: Test Kotlin run: cargo make test-kotlin + + test-java: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install cargo-make + uses: taiki-e/install-action@cargo-make + - name: Set up JDK 22 for x64 + uses: actions/setup-java@v4 + with: + java-version: '22' + distribution: 'temurin' + architecture: x64 + cache: maven + - name: Test Java + run: cargo make test-java diff --git a/Makefile.toml b/Makefile.toml index df975c877..c2d8f77cb 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -68,6 +68,12 @@ dependencies = [ "test-kotlin-feature", ] +[tasks.test-java] +category = "Tests" +dependencies = [ + "test-kotlin-feature", +] + [tasks.test-example] category = "Tests" dependencies = [ @@ -85,6 +91,7 @@ dependencies = [ "test-js-feature", "test-dart-feature", "test-kotlin-feature", + "test-java-feature", ] [tasks.test-cpp-example] @@ -197,6 +204,23 @@ cd feature_tests/kotlin/somelib exec --fail-on-error gradle test --warning-mode all ''' +[tasks.test-java-feature.mac] +env = {"OUT_FILE" = "dylib"} + +[tasks.test-java-feature.linux] +env = {"OUT_FILE" = "so", "LD_LIBRARY_PATH" = "./"} + +[tasks.test-java-feature] +category = "Tests" +script_runner = "@duckscript" +dependencies = ["build-feature"] +script = ''' +exit_on_error true +cp target/debug/libdiplomat_feature_tests.${OUT_FILE} feature_tests/java/somelib/libsomelib.${OUT_FILE} +cd feature_tests/java/somelib +exec --fail-on-error mvn test +''' + [tasks.check-c-example] category = "Tests" script_runner = "@duckscript" diff --git a/feature_tests/java/somelib/hs_err_pid98653.log b/feature_tests/java/somelib/hs_err_pid98653.log deleted file mode 100644 index 430243240..000000000 --- a/feature_tests/java/somelib/hs_err_pid98653.log +++ /dev/null @@ -1,1247 +0,0 @@ -# -# A fatal error has been detected by the Java Runtime Environment: -# -# SIGSEGV (0xb) at pc=0x00000001059e9aec, pid=98653, tid=8707 -# -# JRE version: OpenJDK Runtime Environment Temurin-22.0.1+8 (22.0.1+8) (build 22.0.1+8) -# Java VM: OpenJDK 64-Bit Server VM Temurin-22.0.1+8 (22.0.1+8, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-aarch64) -# Problematic frame: -# C [libsomelib.dylib+0x5aec] Float64Vec_new_isize+0xb4 -# -# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again -# -# If you would like to submit a bug report, please visit: -# https://github.com/adoptium/adoptium-support/issues -# The crash happened outside the Java Virtual Machine in native code. -# See problematic frame for where to report the bug. -# - ---------------- S U M M A R Y ------------ - -Command Line: -ea -Didea.test.cyclic.buffer.size=1048576 -javaagent:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/lib/idea_rt.jar=60545:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/bin -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit5 dev.diplomattest.somelib.Float64VecTest,testFloat64Vec - -Host: "MacBookPro18,3" arm64, 8 cores, 16G, Darwin 23.5.0, macOS 14.5 (23F79) -Time: Wed Aug 14 21:05:02 2024 CEST elapsed time: 0.332978 seconds (0d 0h 0m 0s) - ---------------- T H R E A D --------------- - -Current thread (0x000000013980aa00): JavaThread "main" [_thread_in_native, id=8707, stack(0x000000016ba98000,0x000000016bc9b000) (2060K)] - -Stack: [0x000000016ba98000,0x000000016bc9b000], sp=0x000000016bc97870, free space=2046k -Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) -C [libsomelib.dylib+0x5aec] Float64Vec_new_isize+0xb4 -v ~RuntimeStub::nep_invoker_blob 0x00000001167986bc -j java.lang.invoke.LambdaForm$MH+0x000000ff001d0400.invoke(Ljava/lang/Object;JJJ)J+12 java.base@22.0.1 -j java.lang.invoke.LambdaForm$MH+0x000000ff001d3000.invokeExact_MT(Ljava/lang/Object;JJJLjava/lang/Object;)J+23 java.base@22.0.1 -j jdk.internal.foreign.abi.DowncallStub+0x000000ff001d1000.invoke(Ljava/lang/foreign/SegmentAllocator;Ljava/lang/foreign/MemorySegment;Ljava/lang/foreign/MemorySegment;)Ljava/lang/foreign/MemorySegment;+69 java.base@22.0.1 -j java.lang.invoke.LambdaForm$DMH+0x000000ff001d1400.invokeStaticInit(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+14 java.base@22.0.1 -j java.lang.invoke.LambdaForm$MH+0x000000ff001d2400.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+44 java.base@22.0.1 -j java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+19 java.base@22.0.1 -j dev.diplomattest.somelib.ntv.somelib_h.Float64Vec_new_isize(Ljava/lang/foreign/MemorySegment;)Ljava/lang/foreign/MemorySegment;+26 -j dev.diplomattest.somelib.Float64Vec.newIsize([J)Ldev/diplomattest/somelib/Float64Vec;+38 -j dev.diplomattest.somelib.Float64VecTest.testFloat64Vec()V+53 -j java.lang.invoke.LambdaForm$DMH+0x000000ff0014c000.invokeVirtual(Ljava/lang/Object;Ljava/lang/Object;)V+10 java.base@22.0.1 -j java.lang.invoke.LambdaForm$MH+0x000000ff0014c800.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+31 java.base@22.0.1 -j java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+19 java.base@22.0.1 -j jdk.internal.reflect.DirectMethodHandleAccessor.invokeImpl(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+41 java.base@22.0.1 -j jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+23 java.base@22.0.1 -j java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+102 java.base@22.0.1 -j org.junit.platform.commons.util.ReflectionUtils.invokeMethod(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+42 -j org.junit.jupiter.engine.execution.MethodInvocation.proceed()Ljava/lang/Object;+16 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed()Ljava/lang/Object;+8 -j org.junit.jupiter.engine.extension.TimeoutExtension.intercept(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/TimeoutDuration;Lorg/junit/jupiter/engine/extension/TimeoutExtension$TimeoutProvider;)Ljava/lang/Object;+28 -j org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/TimeoutExtension$TimeoutProvider;)Ljava/lang/Object;+31 -j org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)V+9 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda+0x000000ff00117b80.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)V+5 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall$VoidMethodInterceptorCall;Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)Ljava/lang/Void;+6 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall$$Lambda+0x000000ff00115800.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)Ljava/lang/Object;+9 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+6 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$$Lambda+0x000000ff00146cc8.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+14 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed()Ljava/lang/Object;+12 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+1 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/engine/execution/InvocationInterceptorChain$InterceptorCall;Ljava/util/List;)Ljava/lang/Object;+24 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InvocationInterceptorChain$InterceptorCall;)Ljava/lang/Object;+31 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;)Ljava/lang/Object;+15 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(Ljava/lang/reflect/Method;Ljava/lang/Object;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;)Ljava/lang/Object;+55 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;)V+28 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda+0x000000ff00144c10.execute()V+12 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)V+21 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;+44 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;+6 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+79 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x000000ff00135638.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x000000ff00135418.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 -j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x000000ff00135000.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService$$Lambda+0x000000ff00134a30.accept(Ljava/lang/Object;)V+4 -j java.util.ArrayList.forEach(Ljava/util/function/Consumer;)V+46 java.base@22.0.1 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(Ljava/util/List;)V+6 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+116 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x000000ff00135638.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x000000ff00135418.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 -j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x000000ff00135000.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService$$Lambda+0x000000ff00134a30.accept(Ljava/lang/Object;)V+4 -j java.util.ArrayList.forEach(Ljava/util/function/Consumer;)V+46 java.base@22.0.1 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(Ljava/util/List;)V+6 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+116 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x000000ff00135638.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x000000ff00135418.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 -j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x000000ff00135000.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(Lorg/junit/platform/engine/support/hierarchical/HierarchicalTestExecutorService$TestTask;)Ljava/util/concurrent/Future;+1 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute()Ljava/util/concurrent/Future;+74 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(Lorg/junit/platform/engine/ExecutionRequest;)V+31 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/engine/TestDescriptor;Lorg/junit/platform/engine/EngineExecutionListener;Lorg/junit/platform/engine/ConfigurationParameters;Lorg/junit/platform/engine/TestEngine;)V+24 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/LauncherDiscoveryResult;Lorg/junit/platform/engine/EngineExecutionListener;)V+115 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;Lorg/junit/platform/engine/EngineExecutionListener;Lorg/junit/platform/launcher/TestExecutionListener;)V+55 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(Lorg/junit/platform/launcher/core/InternalTestPlan;Lorg/junit/platform/launcher/TestExecutionListener;)V+6 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator$$Lambda+0x000000ff001220e0.accept(Ljava/lang/Object;)V+12 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(Lorg/junit/platform/engine/ConfigurationParameters;Lorg/junit/platform/launcher/core/ListenerRegistry;Ljava/util/function/Consumer;)V+51 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;[Lorg/junit/platform/launcher/TestExecutionListener;)V+23 -j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;[Lorg/junit/platform/launcher/TestExecutionListener;)V+6 -j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+34 -j org.junit.platform.launcher.core.DelegatingLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+6 -j org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+13 -j com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs([Ljava/lang/String;Ljava/lang/String;IZ)I+203 -j com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(Z)I+17 -j com.intellij.rt.execution.junit.TestsRepeater.repeat(IZLcom/intellij/rt/execution/junit/TestsRepeater$TestRun;)I+7 -j com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(Lcom/intellij/rt/junit/IdeaTestRunner;[Ljava/lang/String;Ljava/util/ArrayList;Ljava/lang/String;IZ)I+25 -j com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart([Ljava/lang/String;Ljava/lang/String;Ljava/util/ArrayList;Ljava/lang/String;)I+117 -j com.intellij.rt.junit.JUnitStarter.main([Ljava/lang/String;)V+97 -v ~StubRoutines::call_stub 0x0000000116654154 -...... -Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) -v ~RuntimeStub::nep_invoker_blob 0x000000011679868c -j java.lang.invoke.LambdaForm$MH+0x000000ff001d0400.invoke(Ljava/lang/Object;JJJ)J+12 java.base@22.0.1 -j java.lang.invoke.LambdaForm$MH+0x000000ff001d3000.invokeExact_MT(Ljava/lang/Object;JJJLjava/lang/Object;)J+23 java.base@22.0.1 -j jdk.internal.foreign.abi.DowncallStub+0x000000ff001d1000.invoke(Ljava/lang/foreign/SegmentAllocator;Ljava/lang/foreign/MemorySegment;Ljava/lang/foreign/MemorySegment;)Ljava/lang/foreign/MemorySegment;+69 java.base@22.0.1 -j java.lang.invoke.LambdaForm$DMH+0x000000ff001d1400.invokeStaticInit(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+14 java.base@22.0.1 -j java.lang.invoke.LambdaForm$MH+0x000000ff001d2400.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+44 java.base@22.0.1 -j java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+19 java.base@22.0.1 -j dev.diplomattest.somelib.ntv.somelib_h.Float64Vec_new_isize(Ljava/lang/foreign/MemorySegment;)Ljava/lang/foreign/MemorySegment;+26 -j dev.diplomattest.somelib.Float64Vec.newIsize([J)Ldev/diplomattest/somelib/Float64Vec;+38 -j dev.diplomattest.somelib.Float64VecTest.testFloat64Vec()V+53 -j java.lang.invoke.LambdaForm$DMH+0x000000ff0014c000.invokeVirtual(Ljava/lang/Object;Ljava/lang/Object;)V+10 java.base@22.0.1 -j java.lang.invoke.LambdaForm$MH+0x000000ff0014c800.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+31 java.base@22.0.1 -j java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+19 java.base@22.0.1 -j jdk.internal.reflect.DirectMethodHandleAccessor.invokeImpl(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+41 java.base@22.0.1 -j jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+23 java.base@22.0.1 -j java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+102 java.base@22.0.1 -j org.junit.platform.commons.util.ReflectionUtils.invokeMethod(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+42 -j org.junit.jupiter.engine.execution.MethodInvocation.proceed()Ljava/lang/Object;+16 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed()Ljava/lang/Object;+8 -j org.junit.jupiter.engine.extension.TimeoutExtension.intercept(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/TimeoutDuration;Lorg/junit/jupiter/engine/extension/TimeoutExtension$TimeoutProvider;)Ljava/lang/Object;+28 -j org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/TimeoutExtension$TimeoutProvider;)Ljava/lang/Object;+31 -j org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)V+9 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda+0x000000ff00117b80.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)V+5 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall$VoidMethodInterceptorCall;Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)Ljava/lang/Void;+6 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall$$Lambda+0x000000ff00115800.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)Ljava/lang/Object;+9 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+6 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$$Lambda+0x000000ff00146cc8.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+14 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed()Ljava/lang/Object;+12 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+1 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/engine/execution/InvocationInterceptorChain$InterceptorCall;Ljava/util/List;)Ljava/lang/Object;+24 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InvocationInterceptorChain$InterceptorCall;)Ljava/lang/Object;+31 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;)Ljava/lang/Object;+15 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(Ljava/lang/reflect/Method;Ljava/lang/Object;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;)Ljava/lang/Object;+55 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;)V+28 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda+0x000000ff00144c10.execute()V+12 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)V+21 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;+44 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;+6 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+79 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x000000ff00135638.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x000000ff00135418.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 -j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x000000ff00135000.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService$$Lambda+0x000000ff00134a30.accept(Ljava/lang/Object;)V+4 -j java.util.ArrayList.forEach(Ljava/util/function/Consumer;)V+46 java.base@22.0.1 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(Ljava/util/List;)V+6 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+116 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x000000ff00135638.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x000000ff00135418.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 -j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x000000ff00135000.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService$$Lambda+0x000000ff00134a30.accept(Ljava/lang/Object;)V+4 -j java.util.ArrayList.forEach(Ljava/util/function/Consumer;)V+46 java.base@22.0.1 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(Ljava/util/List;)V+6 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+116 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x000000ff00135638.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x000000ff00135418.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 -j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x000000ff00135000.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(Lorg/junit/platform/engine/support/hierarchical/HierarchicalTestExecutorService$TestTask;)Ljava/util/concurrent/Future;+1 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute()Ljava/util/concurrent/Future;+74 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(Lorg/junit/platform/engine/ExecutionRequest;)V+31 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/engine/TestDescriptor;Lorg/junit/platform/engine/EngineExecutionListener;Lorg/junit/platform/engine/ConfigurationParameters;Lorg/junit/platform/engine/TestEngine;)V+24 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/LauncherDiscoveryResult;Lorg/junit/platform/engine/EngineExecutionListener;)V+115 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;Lorg/junit/platform/engine/EngineExecutionListener;Lorg/junit/platform/launcher/TestExecutionListener;)V+55 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(Lorg/junit/platform/launcher/core/InternalTestPlan;Lorg/junit/platform/launcher/TestExecutionListener;)V+6 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator$$Lambda+0x000000ff001220e0.accept(Ljava/lang/Object;)V+12 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(Lorg/junit/platform/engine/ConfigurationParameters;Lorg/junit/platform/launcher/core/ListenerRegistry;Ljava/util/function/Consumer;)V+51 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;[Lorg/junit/platform/launcher/TestExecutionListener;)V+23 -j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;[Lorg/junit/platform/launcher/TestExecutionListener;)V+6 -j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+34 -j org.junit.platform.launcher.core.DelegatingLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+6 -j org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+13 -j com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs([Ljava/lang/String;Ljava/lang/String;IZ)I+203 -j com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(Z)I+17 -j com.intellij.rt.execution.junit.TestsRepeater.repeat(IZLcom/intellij/rt/execution/junit/TestsRepeater$TestRun;)I+7 -j com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(Lcom/intellij/rt/junit/IdeaTestRunner;[Ljava/lang/String;Ljava/util/ArrayList;Ljava/lang/String;IZ)I+25 -j com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart([Ljava/lang/String;Ljava/lang/String;Ljava/util/ArrayList;Ljava/lang/String;)I+117 -j com.intellij.rt.junit.JUnitStarter.main([Ljava/lang/String;)V+97 -v ~StubRoutines::call_stub 0x0000000116654154 - -siginfo: si_signo: 11 (SIGSEGV), si_code: 2 (SEGV_ACCERR), si_addr: 0x0000000000000001 - -Registers: - x0=0x000060000115f350 x1=0x00000000f3a657fb x2=0x0000000000000010 x3=0x0000000000000000 - x4=0x0000000000000003 x5=0x0000000073c00000 x6=0x000060000115f350 x7=0x0000000000000eb0 - x8=0x0000000000000000 x9=0x0000000000000000 x10=0x0000000000003350 x11=0x0000000000000010 -x12=0x0000000000000001 x13=0x00000000ffffff35 x14=0x00000000000007fb x15=0x00000000f3a657fb -x16=0x0000000000000335 x17=0x00000000000000ca x18=0x0000000000000000 x19=0x0000000000000010 -x20=0x0000000000000002 x21=0x000060000115f350 x22=0x0000000105a34141 x23=0x0000000000000001 -x24=0x000000016bc979b8 x25=0x000000010191c000 x26=0x0000000125c21bf8 x27=0x0000000000000000 -x28=0x000000013980aa00 fp=0x000000016bc978a0 lr=0x00000001059e9a7c sp=0x000000016bc97870 -pc=0x00000001059e9aec cpsr=0x0000000080001000 - -Register to memory mapping: - -x0 =0x000060000115f350 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00 -x1 =0x00000000f3a657fb is an unknown value -x2 =0x0000000000000010 is an unknown value -x3 =0x0 is null -x4 =0x0000000000000003 is an unknown value -x5 =0x0000000073c00000 is an unknown value -x6 =0x000060000115f350 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00 -x7 =0x0000000000000eb0 is an unknown value -x8 =0x0 is null -x9 =0x0 is null -x10=0x0000000000003350 is an unknown value -x11=0x0000000000000010 is an unknown value -x12=0x0000000000000001 is an unknown value -x13=0x00000000ffffff35 is an unknown value -x14=0x00000000000007fb is an unknown value -x15=0x00000000f3a657fb is an unknown value -x16=0x0000000000000335 is an unknown value -x17=0x00000000000000ca is an unknown value -x18=0x0 is null -x19=0x0000000000000010 is an unknown value -x20=0x0000000000000002 is an unknown value -x21=0x000060000115f350 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00 -x22=0x0000000105a34141: __rust_no_alloc_shim_is_unstable+0 in /Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/libsomelib.dylib at 0x00000001059e4000 -x23=0x0000000000000001 is an unknown value -x24=0x000000016bc979b8 is pointing into the stack for thread: 0x000000013980aa00 -x25=0x000000010191c000 is an unknown value -x26=0x0000000125c21bf8 is pointing into metadata -x27=0x0 is null -x28=0x000000013980aa00 is a thread - fp=0x000000016bc978a0 is pointing into the stack for thread: 0x000000013980aa00 - lr=0x00000001059e9a7c: Float64Vec_new_isize+0x44 in /Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/libsomelib.dylib at 0x00000001059e4000 - sp=0x000000016bc97870 is pointing into the stack for thread: 0x000000013980aa00 - -Top of Stack: (sp=0x000000016bc97870) -0x000000016bc97870: 000000016bc979b8 000000010191c000 -0x000000016bc97880: 0000000125c21a54 00000001067dd2b0 -0x000000016bc97890: 000000016bc978e8 000000016bc978d0 -0x000000016bc978a0: 000000016bc978c0 00000001167986bc -0x000000016bc978b0: 000000016bc97970 b116000116667504 -0x000000016bc978c0: 000000016bc97970 00000001166591b0 -0x000000016bc978d0: 000000070ee4fd68 fffffffffffffff2 -0x000000016bc978e0: 0000000000000000 000000070ec68e08 -0x000000016bc978f0: 0000000000000002 0000000000000000 -0x000000016bc97900: 0000000000000001 0000000000000000 -0x000000016bc97910: 00000001059e9a38 0000000000000000 -0x000000016bc97920: fffffffffffffff6 0000000125c21a54 -0x000000016bc97930: 0000000000000009 0000000125c21bf8 -0x000000016bc97940: 000000070ec75fb8 ffffffffffffffec -0x000000016bc97950: 0000000000000000 0000000125c21a60 -0x000000016bc97960: ffffffffffffffef 000000016bc97970 -0x000000016bc97970: 000000016bc97a10 00000001166591b0 -0x000000016bc97980: 000000070ec68e08 0000000000000002 -0x000000016bc97990: 0000000000000000 0000000000000001 -0x000000016bc979a0: 0000000000000000 00000001059e9a38 -0x000000016bc979b0: 0000000000000000 000000070ec760d0 -0x000000016bc979c0: fffffffffffffff6 0000000125c2729f -0x000000016bc979d0: 0000000000000009 0000000125c27460 -0x000000016bc979e0: 000000070ece16c0 ffffffffffffffec -0x000000016bc979f0: 0000000000000000 0000000125c272b0 -0x000000016bc97a00: ffffffffffffffef 000000016bc97a10 -0x000000016bc97a10: 000000016bc97ab0 00000001166591b0 -0x000000016bc97a20: 000000070efd3c48 0000000000000002 -0x000000016bc97a30: 0000000000000000 0000000000000001 -0x000000016bc97a40: 0000000000000000 00000001059e9a38 -0x000000016bc97a50: 0000000000000000 000000070ec760d0 -0x000000016bc97a60: fffffffffffffff6 0000000125c23465 - -Instructions: (pc=0x00000001059e9aec) -0x00000001059e99ec: f6 57 41 a9 f8 5f c4 a8 c0 03 5f d6 00 01 80 52 -0x00000001059e99fc: 01 03 80 52 c7 d9 00 94 20 00 20 d4 16 00 80 d2 -0x00000001059e9a0c: e0 03 16 aa e1 03 15 aa bd d9 00 94 f5 03 00 aa -0x00000001059e9a1c: b3 00 00 b4 61 f2 7d d3 e0 03 14 aa 02 01 80 52 -0x00000001059e9a2c: 3a 03 00 94 e0 03 15 aa 54 db 00 94 f8 5f bc a9 -0x00000001059e9a3c: f6 57 01 a9 f4 4f 02 a9 fd 7b 03 a9 fd c3 00 91 -0x00000001059e9a4c: f4 03 01 aa 15 01 80 52 3f 00 00 f1 b7 02 80 9a -0x00000001059e9a5c: 33 f0 7d d3 56 02 00 f0 d6 06 05 91 e1 04 00 b4 -0x00000001059e9a6c: df 02 40 39 e0 03 13 aa 01 01 80 52 26 03 00 94 -0x00000001059e9a7c: 40 06 00 b4 f5 03 00 aa 08 00 80 d2 9f 22 00 f1 -0x00000001059e9a8c: e3 02 00 54 a9 02 17 cb 3f 01 01 f1 83 02 00 54 -0x00000001059e9a9c: 09 00 80 d2 88 f2 7d 92 ea 82 00 91 eb 03 08 aa -0x00000001059e9aac: 4c 01 09 8b 80 05 7f ad 82 0d 40 ad 00 d8 61 4e -0x00000001059e9abc: 21 d8 61 4e 42 d8 61 4e 63 d8 61 4e ac 02 09 8b -0x00000001059e9acc: 80 05 00 ad 82 0d 01 ad 29 01 01 91 6b 21 00 f1 -0x00000001059e9adc: 81 fe ff 54 1f 01 14 eb 00 01 00 54 09 f1 7d d3 -0x00000001059e9aec: e0 6a 69 fc 00 d8 61 5e a0 6a 29 fc 08 05 00 91 -0x00000001059e9afc: 9f 02 08 eb 41 ff ff 54 df 02 40 39 00 03 80 52 -0x00000001059e9b0c: 01 01 80 52 00 03 00 94 00 01 00 b4 14 54 00 a9 -0x00000001059e9b1c: 14 08 00 f9 fd 7b 43 a9 f4 4f 42 a9 f6 57 41 a9 -0x00000001059e9b2c: f8 5f c4 a8 c0 03 5f d6 00 01 80 52 01 03 80 52 -0x00000001059e9b3c: 78 d9 00 94 20 00 20 d4 00 01 80 52 e1 03 13 aa -0x00000001059e9b4c: 6f d9 00 94 f6 03 00 aa b4 00 00 b4 e0 03 15 aa -0x00000001059e9b5c: e1 03 13 aa 02 01 80 52 ec 02 00 94 e0 03 16 aa -0x00000001059e9b6c: 06 db 00 94 f8 5f bc a9 f6 57 01 a9 f4 4f 02 a9 -0x00000001059e9b7c: fd 7b 03 a9 fd c3 00 91 f4 03 01 aa 15 01 80 52 -0x00000001059e9b8c: 3f 00 00 f1 b7 02 80 9a 33 f0 7d d3 56 02 00 f0 -0x00000001059e9b9c: d6 06 05 91 e1 04 00 b4 df 02 40 39 e0 03 13 aa -0x00000001059e9bac: 01 01 80 52 d8 02 00 94 40 06 00 b4 f5 03 00 aa -0x00000001059e9bbc: 08 00 80 d2 9f 22 00 f1 e3 02 00 54 a9 02 17 cb -0x00000001059e9bcc: 3f 01 01 f1 83 02 00 54 09 00 80 d2 88 f2 7d 92 -0x00000001059e9bdc: ea 82 00 91 eb 03 08 aa 4c 01 09 8b 80 05 7f ad - - -Stack slot to memory mapping: - -stack at sp + 0 slots: 0x000000016bc979b8 is pointing into the stack for thread: 0x000000013980aa00 -stack at sp + 1 slots: 0x000000010191c000 is an unknown value -stack at sp + 2 slots: 0x0000000125c21a54 is pointing into metadata -stack at sp + 3 slots: 0x00000001067dd2b0: _ZN19TemplateInterpreter13_active_tableE+0 in /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/server/libjvm.dylib at 0x0000000105a88000 -stack at sp + 4 slots: 0x000000016bc978e8 is pointing into the stack for thread: 0x000000013980aa00 -stack at sp + 5 slots: 0x000000016bc978d0 is pointing into the stack for thread: 0x000000013980aa00 -stack at sp + 6 slots: 0x000000016bc978c0 is pointing into the stack for thread: 0x000000013980aa00 -stack at sp + 7 slots: 0x00000001167986bc is at code_begin+60 in -[CodeBlob (0x0000000116798610)] -Framesize: 4 -Runtime Stub (0x0000000116798610): nep_invoker_blob --------------------------------------------------------------------------------- -Decoding CodeBlob, name: nep_invoker_blob, at [0x0000000116798680, 0x0000000116798750] 208 bytes -[MachCode] - 0x0000000116798680: fd7b bfa9 | fd03 0091 | bf43 00d1 | 0900 0010 | 89d7 01f9 | e903 0091 | 89d3 01f9 | 9ddb 01f9 - 0x00000001167986a0: e903 7eb2 | 8a53 1191 | 49fd 9f88 | e903 01aa | e103 03aa | e003 02aa | 2001 3fd6 | a900 80d2 - 0x00000001167986c0: 8957 04b9 | bf3b 03d5 | 8963 1191 | 29fd dfc8 | bf03 09eb | e801 0054 | 8953 44b9 | a901 0035 - 0x00000001167986e0: e903 7db2 | 8a53 1191 | 49fd 9f88 | 8943 5339 | 3f09 0071 | e001 0054 | 9fd3 01f9 | 9fdb 01f9 - 0x0000000116798700: 9fd7 01f9 | bf03 0091 | fd7b c1a8 | c003 5fd6 | e003 00f9 | e003 1caa | 897d 9cd2 | 89be a0f2 - 0x0000000116798720: 2900 c0f2 | 2001 3fd6 | e003 40f9 | edff ff17 | e003 00f9 | 0919 95d2 | a9c6 a0f2 | 2900 c0f2 - 0x0000000116798740: 2001 3fd6 | e003 40f9 | ecff ff17 | 0000 0000 -[/MachCode] --------------------------------------------------------------------------------- - --------------------------------------------------------------------------------- -Decoding CodeBlob, name: nep_invoker_blob, at [0x0000000116798680, 0x0000000116798750] 208 bytes -[MachCode] - 0x0000000116798680: fd7b bfa9 | fd03 0091 | bf43 00d1 | 0900 0010 | 89d7 01f9 | e903 0091 | 89d3 01f9 | 9ddb 01f9 - 0x00000001167986a0: e903 7eb2 | 8a53 1191 | 49fd 9f88 | e903 01aa | e103 03aa | e003 02aa | 2001 3fd6 | a900 80d2 - 0x00000001167986c0: 8957 04b9 | bf3b 03d5 | 8963 1191 | 29fd dfc8 | bf03 09eb | e801 0054 | 8953 44b9 | a901 0035 - 0x00000001167986e0: e903 7db2 | 8a53 1191 | 49fd 9f88 | 8943 5339 | 3f09 0071 | e001 0054 | 9fd3 01f9 | 9fdb 01f9 - 0x0000000116798700: 9fd7 01f9 | bf03 0091 | fd7b c1a8 | c003 5fd6 | e003 00f9 | e003 1caa | 897d 9cd2 | 89be a0f2 - 0x0000000116798720: 2900 c0f2 | 2001 3fd6 | e003 40f9 | edff ff17 | e003 00f9 | 0919 95d2 | a9c6 a0f2 | 2900 c0f2 - 0x0000000116798740: 2001 3fd6 | e003 40f9 | ecff ff17 | 0000 0000 -[/MachCode] --------------------------------------------------------------------------------- - - ---------------- P R O C E S S --------------- - -Threads class SMR info: -_java_thread_list=0x000060000134c300, length=11, elements={ -0x000000013980aa00, 0x000000013b852c00, 0x000000013b853400, 0x000000013b01c800, -0x000000013985f000, 0x0000000129834c00, 0x000000013b01d000, 0x000000013b00c400, -0x000000013b00cc00, 0x000000013b85dc00, 0x000000013b8e0600 -} - -Java Threads: ( => current thread ) -=>0x000000013980aa00 JavaThread "main" [_thread_in_native, id=8707, stack(0x000000016ba98000,0x000000016bc9b000) (2060K)] - 0x000000013b852c00 JavaThread "Reference Handler" daemon [_thread_blocked, id=23555, stack(0x000000016cc10000,0x000000016ce13000) (2060K)] - 0x000000013b853400 JavaThread "Finalizer" daemon [_thread_blocked, id=28163, stack(0x000000016ce1c000,0x000000016d01f000) (2060K)] - 0x000000013b01c800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=23811, stack(0x000000016d028000,0x000000016d22b000) (2060K)] - 0x000000013985f000 JavaThread "Service Thread" daemon [_thread_blocked, id=24067, stack(0x000000016d234000,0x000000016d437000) (2060K)] - 0x0000000129834c00 JavaThread "Monitor Deflation Thread" daemon [_thread_blocked, id=24579, stack(0x000000016d440000,0x000000016d643000) (2060K)] - 0x000000013b01d000 JavaThread "C2 CompilerThread0" daemon [_thread_in_vm, id=27395, stack(0x000000016d64c000,0x000000016d84f000) (2060K)] - 0x000000013b00c400 JavaThread "C1 CompilerThread0" daemon [_thread_in_vm, id=25347, stack(0x000000016d858000,0x000000016da5b000) (2060K)] - 0x000000013b00cc00 JavaThread "Common-Cleaner" daemon [_thread_blocked, id=26883, stack(0x000000016da64000,0x000000016dc67000) (2060K)] - 0x000000013b85dc00 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=25859, stack(0x000000016dc70000,0x000000016de73000) (2060K)] - 0x000000013b8e0600 JavaThread "Notification Thread" daemon [_thread_blocked, id=26115, stack(0x000000016de7c000,0x000000016e07f000) (2060K)] -Total: 11 - -Other Threads: - 0x0000000104704fe0 VMThread "VM Thread" [id=20227, stack(0x000000016c8ec000,0x000000016caef000) (2060K)] - 0x0000000129605af0 WatcherThread "VM Periodic Task Thread" [id=17667, stack(0x000000016c6e0000,0x000000016c8e3000) (2060K)] - 0x0000000139607d70 WorkerThread "GC Thread#0" [id=12291, stack(0x000000016bca4000,0x000000016bea7000) (2060K)] - 0x000000013a9053c0 ConcurrentGCThread "G1 Main Marker" [id=13571, stack(0x000000016beb0000,0x000000016c0b3000) (2060K)] - 0x000000013a905d40 WorkerThread "G1 Conc#0" [id=12803, stack(0x000000016c0bc000,0x000000016c2bf000) (2060K)] - 0x0000000129820600 ConcurrentGCThread "G1 Refine#0" [id=21507, stack(0x000000016c2c8000,0x000000016c4cb000) (2060K)] - 0x0000000129604760 ConcurrentGCThread "G1 Service" [id=16899, stack(0x000000016c4d4000,0x000000016c6d7000) (2060K)] -Total: 7 - -Threads with active compile tasks: -C2 CompilerThread0 340 1206 4 jdk.internal.org.objectweb.asm.SymbolTable::addConstantUtf8Reference (101 bytes) -C1 CompilerThread0 340 1221 3 jdk.internal.classfile.impl.StackMapGenerator::processBlock (2767 bytes) -Total: 2 - -VM state: not at safepoint (normal execution) - -VM Mutex/Monitor currently owned by a thread: ([mutex/lock_event]) -[0x00000001068467d8] MethodCompileQueue_lock - owner thread: 0x000000013b00c400 -[0x0000000106847198] CodeCache_lock - owner thread: 0x000000013b00c400 -[0x0000000106847258] Compile_lock - owner thread: 0x000000013b00c400 - -Heap address: 0x0000000700000000, size: 4096 MB, Compressed Oops mode: Zero based, Oop shift amount: 3 - -CDS archive(s) not mapped -Compressed class space mapped at: 0x000000ff00000000-0x000000ff40000000, reserved size: 1073741824 -Narrow klass base: 0x000000ff00000000, Narrow klass shift: 0, Narrow klass range: 0x40000000 - -GC Precious Log: - CardTable entry size: 512 - Card Set container configuration: InlinePtr #cards 4 size 8 Array Of Cards #cards 16 size 48 Howl #buckets 8 coarsen threshold 3686 Howl Bitmap #cards 512 size 80 coarsen threshold 460 Card regions per heap region 1 cards per card region 4096 - CPUs: 8 total, 8 available - Memory: 16384M - Large Page Support: Disabled - NUMA Support: Disabled - Compressed Oops: Enabled (Zero based) - Heap Region Size: 2M - Heap Min Capacity: 8M - Heap Initial Capacity: 256M - Heap Max Capacity: 4G - Pre-touch: Disabled - Parallel Workers: 8 - Concurrent Workers: 2 - Concurrent Refinement Workers: 8 - Periodic GC: Disabled - -Heap: - garbage-first heap total reserved 4194304K, committed 262144K, used 18432K [0x0000000700000000, 0x0000000800000000) - region size 2048K, 10 young (20480K), 0 survivors (0K) - Metaspace used 15418K, committed 15808K, reserved 1114112K - class space used 1719K, committed 1920K, reserved 1048576K - -Heap Regions: E=young(eden), S=young(survivor), O=old, HS=humongous(starts), HC=humongous(continues), CS=collection set, F=free, TAMS=top-at-mark-start, PB=parsable bottom -| 0|0x0000000700000000, 0x0000000700000000, 0x0000000700200000| 0%| F| |TAMS 0x0000000700000000| PB 0x0000000700000000| Untracked | 0 -| 1|0x0000000700200000, 0x0000000700200000, 0x0000000700400000| 0%| F| |TAMS 0x0000000700200000| PB 0x0000000700200000| Untracked | 0 -| 2|0x0000000700400000, 0x0000000700400000, 0x0000000700600000| 0%| F| |TAMS 0x0000000700400000| PB 0x0000000700400000| Untracked | 0 -| 3|0x0000000700600000, 0x0000000700600000, 0x0000000700800000| 0%| F| |TAMS 0x0000000700600000| PB 0x0000000700600000| Untracked | 0 -| 4|0x0000000700800000, 0x0000000700800000, 0x0000000700a00000| 0%| F| |TAMS 0x0000000700800000| PB 0x0000000700800000| Untracked | 0 -| 5|0x0000000700a00000, 0x0000000700a00000, 0x0000000700c00000| 0%| F| |TAMS 0x0000000700a00000| PB 0x0000000700a00000| Untracked | 0 -| 6|0x0000000700c00000, 0x0000000700c00000, 0x0000000700e00000| 0%| F| |TAMS 0x0000000700c00000| PB 0x0000000700c00000| Untracked | 0 -| 7|0x0000000700e00000, 0x0000000700e00000, 0x0000000701000000| 0%| F| |TAMS 0x0000000700e00000| PB 0x0000000700e00000| Untracked | 0 -| 8|0x0000000701000000, 0x0000000701000000, 0x0000000701200000| 0%| F| |TAMS 0x0000000701000000| PB 0x0000000701000000| Untracked | 0 -| 9|0x0000000701200000, 0x0000000701200000, 0x0000000701400000| 0%| F| |TAMS 0x0000000701200000| PB 0x0000000701200000| Untracked | 0 -| 10|0x0000000701400000, 0x0000000701400000, 0x0000000701600000| 0%| F| |TAMS 0x0000000701400000| PB 0x0000000701400000| Untracked | 0 -| 11|0x0000000701600000, 0x0000000701600000, 0x0000000701800000| 0%| F| |TAMS 0x0000000701600000| PB 0x0000000701600000| Untracked | 0 -| 12|0x0000000701800000, 0x0000000701800000, 0x0000000701a00000| 0%| F| |TAMS 0x0000000701800000| PB 0x0000000701800000| Untracked | 0 -| 13|0x0000000701a00000, 0x0000000701a00000, 0x0000000701c00000| 0%| F| |TAMS 0x0000000701a00000| PB 0x0000000701a00000| Untracked | 0 -| 14|0x0000000701c00000, 0x0000000701c00000, 0x0000000701e00000| 0%| F| |TAMS 0x0000000701c00000| PB 0x0000000701c00000| Untracked | 0 -| 15|0x0000000701e00000, 0x0000000701e00000, 0x0000000702000000| 0%| F| |TAMS 0x0000000701e00000| PB 0x0000000701e00000| Untracked | 0 -| 16|0x0000000702000000, 0x0000000702000000, 0x0000000702200000| 0%| F| |TAMS 0x0000000702000000| PB 0x0000000702000000| Untracked | 0 -| 17|0x0000000702200000, 0x0000000702200000, 0x0000000702400000| 0%| F| |TAMS 0x0000000702200000| PB 0x0000000702200000| Untracked | 0 -| 18|0x0000000702400000, 0x0000000702400000, 0x0000000702600000| 0%| F| |TAMS 0x0000000702400000| PB 0x0000000702400000| Untracked | 0 -| 19|0x0000000702600000, 0x0000000702600000, 0x0000000702800000| 0%| F| |TAMS 0x0000000702600000| PB 0x0000000702600000| Untracked | 0 -| 20|0x0000000702800000, 0x0000000702800000, 0x0000000702a00000| 0%| F| |TAMS 0x0000000702800000| PB 0x0000000702800000| Untracked | 0 -| 21|0x0000000702a00000, 0x0000000702a00000, 0x0000000702c00000| 0%| F| |TAMS 0x0000000702a00000| PB 0x0000000702a00000| Untracked | 0 -| 22|0x0000000702c00000, 0x0000000702c00000, 0x0000000702e00000| 0%| F| |TAMS 0x0000000702c00000| PB 0x0000000702c00000| Untracked | 0 -| 23|0x0000000702e00000, 0x0000000702e00000, 0x0000000703000000| 0%| F| |TAMS 0x0000000702e00000| PB 0x0000000702e00000| Untracked | 0 -| 24|0x0000000703000000, 0x0000000703000000, 0x0000000703200000| 0%| F| |TAMS 0x0000000703000000| PB 0x0000000703000000| Untracked | 0 -| 25|0x0000000703200000, 0x0000000703200000, 0x0000000703400000| 0%| F| |TAMS 0x0000000703200000| PB 0x0000000703200000| Untracked | 0 -| 26|0x0000000703400000, 0x0000000703400000, 0x0000000703600000| 0%| F| |TAMS 0x0000000703400000| PB 0x0000000703400000| Untracked | 0 -| 27|0x0000000703600000, 0x0000000703600000, 0x0000000703800000| 0%| F| |TAMS 0x0000000703600000| PB 0x0000000703600000| Untracked | 0 -| 28|0x0000000703800000, 0x0000000703800000, 0x0000000703a00000| 0%| F| |TAMS 0x0000000703800000| PB 0x0000000703800000| Untracked | 0 -| 29|0x0000000703a00000, 0x0000000703a00000, 0x0000000703c00000| 0%| F| |TAMS 0x0000000703a00000| PB 0x0000000703a00000| Untracked | 0 -| 30|0x0000000703c00000, 0x0000000703c00000, 0x0000000703e00000| 0%| F| |TAMS 0x0000000703c00000| PB 0x0000000703c00000| Untracked | 0 -| 31|0x0000000703e00000, 0x0000000703e00000, 0x0000000704000000| 0%| F| |TAMS 0x0000000703e00000| PB 0x0000000703e00000| Untracked | 0 -| 32|0x0000000704000000, 0x0000000704000000, 0x0000000704200000| 0%| F| |TAMS 0x0000000704000000| PB 0x0000000704000000| Untracked | 0 -| 33|0x0000000704200000, 0x0000000704200000, 0x0000000704400000| 0%| F| |TAMS 0x0000000704200000| PB 0x0000000704200000| Untracked | 0 -| 34|0x0000000704400000, 0x0000000704400000, 0x0000000704600000| 0%| F| |TAMS 0x0000000704400000| PB 0x0000000704400000| Untracked | 0 -| 35|0x0000000704600000, 0x0000000704600000, 0x0000000704800000| 0%| F| |TAMS 0x0000000704600000| PB 0x0000000704600000| Untracked | 0 -| 36|0x0000000704800000, 0x0000000704800000, 0x0000000704a00000| 0%| F| |TAMS 0x0000000704800000| PB 0x0000000704800000| Untracked | 0 -| 37|0x0000000704a00000, 0x0000000704a00000, 0x0000000704c00000| 0%| F| |TAMS 0x0000000704a00000| PB 0x0000000704a00000| Untracked | 0 -| 38|0x0000000704c00000, 0x0000000704c00000, 0x0000000704e00000| 0%| F| |TAMS 0x0000000704c00000| PB 0x0000000704c00000| Untracked | 0 -| 39|0x0000000704e00000, 0x0000000704e00000, 0x0000000705000000| 0%| F| |TAMS 0x0000000704e00000| PB 0x0000000704e00000| Untracked | 0 -| 40|0x0000000705000000, 0x0000000705000000, 0x0000000705200000| 0%| F| |TAMS 0x0000000705000000| PB 0x0000000705000000| Untracked | 0 -| 41|0x0000000705200000, 0x0000000705200000, 0x0000000705400000| 0%| F| |TAMS 0x0000000705200000| PB 0x0000000705200000| Untracked | 0 -| 42|0x0000000705400000, 0x0000000705400000, 0x0000000705600000| 0%| F| |TAMS 0x0000000705400000| PB 0x0000000705400000| Untracked | 0 -| 43|0x0000000705600000, 0x0000000705600000, 0x0000000705800000| 0%| F| |TAMS 0x0000000705600000| PB 0x0000000705600000| Untracked | 0 -| 44|0x0000000705800000, 0x0000000705800000, 0x0000000705a00000| 0%| F| |TAMS 0x0000000705800000| PB 0x0000000705800000| Untracked | 0 -| 45|0x0000000705a00000, 0x0000000705a00000, 0x0000000705c00000| 0%| F| |TAMS 0x0000000705a00000| PB 0x0000000705a00000| Untracked | 0 -| 46|0x0000000705c00000, 0x0000000705c00000, 0x0000000705e00000| 0%| F| |TAMS 0x0000000705c00000| PB 0x0000000705c00000| Untracked | 0 -| 47|0x0000000705e00000, 0x0000000705e00000, 0x0000000706000000| 0%| F| |TAMS 0x0000000705e00000| PB 0x0000000705e00000| Untracked | 0 -| 48|0x0000000706000000, 0x0000000706000000, 0x0000000706200000| 0%| F| |TAMS 0x0000000706000000| PB 0x0000000706000000| Untracked | 0 -| 49|0x0000000706200000, 0x0000000706200000, 0x0000000706400000| 0%| F| |TAMS 0x0000000706200000| PB 0x0000000706200000| Untracked | 0 -| 50|0x0000000706400000, 0x0000000706400000, 0x0000000706600000| 0%| F| |TAMS 0x0000000706400000| PB 0x0000000706400000| Untracked | 0 -| 51|0x0000000706600000, 0x0000000706600000, 0x0000000706800000| 0%| F| |TAMS 0x0000000706600000| PB 0x0000000706600000| Untracked | 0 -| 52|0x0000000706800000, 0x0000000706800000, 0x0000000706a00000| 0%| F| |TAMS 0x0000000706800000| PB 0x0000000706800000| Untracked | 0 -| 53|0x0000000706a00000, 0x0000000706a00000, 0x0000000706c00000| 0%| F| |TAMS 0x0000000706a00000| PB 0x0000000706a00000| Untracked | 0 -| 54|0x0000000706c00000, 0x0000000706c00000, 0x0000000706e00000| 0%| F| |TAMS 0x0000000706c00000| PB 0x0000000706c00000| Untracked | 0 -| 55|0x0000000706e00000, 0x0000000706e00000, 0x0000000707000000| 0%| F| |TAMS 0x0000000706e00000| PB 0x0000000706e00000| Untracked | 0 -| 56|0x0000000707000000, 0x0000000707000000, 0x0000000707200000| 0%| F| |TAMS 0x0000000707000000| PB 0x0000000707000000| Untracked | 0 -| 57|0x0000000707200000, 0x0000000707200000, 0x0000000707400000| 0%| F| |TAMS 0x0000000707200000| PB 0x0000000707200000| Untracked | 0 -| 58|0x0000000707400000, 0x0000000707400000, 0x0000000707600000| 0%| F| |TAMS 0x0000000707400000| PB 0x0000000707400000| Untracked | 0 -| 59|0x0000000707600000, 0x0000000707600000, 0x0000000707800000| 0%| F| |TAMS 0x0000000707600000| PB 0x0000000707600000| Untracked | 0 -| 60|0x0000000707800000, 0x0000000707800000, 0x0000000707a00000| 0%| F| |TAMS 0x0000000707800000| PB 0x0000000707800000| Untracked | 0 -| 61|0x0000000707a00000, 0x0000000707a00000, 0x0000000707c00000| 0%| F| |TAMS 0x0000000707a00000| PB 0x0000000707a00000| Untracked | 0 -| 62|0x0000000707c00000, 0x0000000707c00000, 0x0000000707e00000| 0%| F| |TAMS 0x0000000707c00000| PB 0x0000000707c00000| Untracked | 0 -| 63|0x0000000707e00000, 0x0000000707e00000, 0x0000000708000000| 0%| F| |TAMS 0x0000000707e00000| PB 0x0000000707e00000| Untracked | 0 -| 64|0x0000000708000000, 0x0000000708000000, 0x0000000708200000| 0%| F| |TAMS 0x0000000708000000| PB 0x0000000708000000| Untracked | 0 -| 65|0x0000000708200000, 0x0000000708200000, 0x0000000708400000| 0%| F| |TAMS 0x0000000708200000| PB 0x0000000708200000| Untracked | 0 -| 66|0x0000000708400000, 0x0000000708400000, 0x0000000708600000| 0%| F| |TAMS 0x0000000708400000| PB 0x0000000708400000| Untracked | 0 -| 67|0x0000000708600000, 0x0000000708600000, 0x0000000708800000| 0%| F| |TAMS 0x0000000708600000| PB 0x0000000708600000| Untracked | 0 -| 68|0x0000000708800000, 0x0000000708800000, 0x0000000708a00000| 0%| F| |TAMS 0x0000000708800000| PB 0x0000000708800000| Untracked | 0 -| 69|0x0000000708a00000, 0x0000000708a00000, 0x0000000708c00000| 0%| F| |TAMS 0x0000000708a00000| PB 0x0000000708a00000| Untracked | 0 -| 70|0x0000000708c00000, 0x0000000708c00000, 0x0000000708e00000| 0%| F| |TAMS 0x0000000708c00000| PB 0x0000000708c00000| Untracked | 0 -| 71|0x0000000708e00000, 0x0000000708e00000, 0x0000000709000000| 0%| F| |TAMS 0x0000000708e00000| PB 0x0000000708e00000| Untracked | 0 -| 72|0x0000000709000000, 0x0000000709000000, 0x0000000709200000| 0%| F| |TAMS 0x0000000709000000| PB 0x0000000709000000| Untracked | 0 -| 73|0x0000000709200000, 0x0000000709200000, 0x0000000709400000| 0%| F| |TAMS 0x0000000709200000| PB 0x0000000709200000| Untracked | 0 -| 74|0x0000000709400000, 0x0000000709400000, 0x0000000709600000| 0%| F| |TAMS 0x0000000709400000| PB 0x0000000709400000| Untracked | 0 -| 75|0x0000000709600000, 0x0000000709600000, 0x0000000709800000| 0%| F| |TAMS 0x0000000709600000| PB 0x0000000709600000| Untracked | 0 -| 76|0x0000000709800000, 0x0000000709800000, 0x0000000709a00000| 0%| F| |TAMS 0x0000000709800000| PB 0x0000000709800000| Untracked | 0 -| 77|0x0000000709a00000, 0x0000000709a00000, 0x0000000709c00000| 0%| F| |TAMS 0x0000000709a00000| PB 0x0000000709a00000| Untracked | 0 -| 78|0x0000000709c00000, 0x0000000709c00000, 0x0000000709e00000| 0%| F| |TAMS 0x0000000709c00000| PB 0x0000000709c00000| Untracked | 0 -| 79|0x0000000709e00000, 0x0000000709e00000, 0x000000070a000000| 0%| F| |TAMS 0x0000000709e00000| PB 0x0000000709e00000| Untracked | 0 -| 80|0x000000070a000000, 0x000000070a000000, 0x000000070a200000| 0%| F| |TAMS 0x000000070a000000| PB 0x000000070a000000| Untracked | 0 -| 81|0x000000070a200000, 0x000000070a200000, 0x000000070a400000| 0%| F| |TAMS 0x000000070a200000| PB 0x000000070a200000| Untracked | 0 -| 82|0x000000070a400000, 0x000000070a400000, 0x000000070a600000| 0%| F| |TAMS 0x000000070a400000| PB 0x000000070a400000| Untracked | 0 -| 83|0x000000070a600000, 0x000000070a600000, 0x000000070a800000| 0%| F| |TAMS 0x000000070a600000| PB 0x000000070a600000| Untracked | 0 -| 84|0x000000070a800000, 0x000000070a800000, 0x000000070aa00000| 0%| F| |TAMS 0x000000070a800000| PB 0x000000070a800000| Untracked | 0 -| 85|0x000000070aa00000, 0x000000070aa00000, 0x000000070ac00000| 0%| F| |TAMS 0x000000070aa00000| PB 0x000000070aa00000| Untracked | 0 -| 86|0x000000070ac00000, 0x000000070ac00000, 0x000000070ae00000| 0%| F| |TAMS 0x000000070ac00000| PB 0x000000070ac00000| Untracked | 0 -| 87|0x000000070ae00000, 0x000000070ae00000, 0x000000070b000000| 0%| F| |TAMS 0x000000070ae00000| PB 0x000000070ae00000| Untracked | 0 -| 88|0x000000070b000000, 0x000000070b000000, 0x000000070b200000| 0%| F| |TAMS 0x000000070b000000| PB 0x000000070b000000| Untracked | 0 -| 89|0x000000070b200000, 0x000000070b200000, 0x000000070b400000| 0%| F| |TAMS 0x000000070b200000| PB 0x000000070b200000| Untracked | 0 -| 90|0x000000070b400000, 0x000000070b400000, 0x000000070b600000| 0%| F| |TAMS 0x000000070b400000| PB 0x000000070b400000| Untracked | 0 -| 91|0x000000070b600000, 0x000000070b600000, 0x000000070b800000| 0%| F| |TAMS 0x000000070b600000| PB 0x000000070b600000| Untracked | 0 -| 92|0x000000070b800000, 0x000000070b800000, 0x000000070ba00000| 0%| F| |TAMS 0x000000070b800000| PB 0x000000070b800000| Untracked | 0 -| 93|0x000000070ba00000, 0x000000070ba00000, 0x000000070bc00000| 0%| F| |TAMS 0x000000070ba00000| PB 0x000000070ba00000| Untracked | 0 -| 94|0x000000070bc00000, 0x000000070bc00000, 0x000000070be00000| 0%| F| |TAMS 0x000000070bc00000| PB 0x000000070bc00000| Untracked | 0 -| 95|0x000000070be00000, 0x000000070be00000, 0x000000070c000000| 0%| F| |TAMS 0x000000070be00000| PB 0x000000070be00000| Untracked | 0 -| 96|0x000000070c000000, 0x000000070c000000, 0x000000070c200000| 0%| F| |TAMS 0x000000070c000000| PB 0x000000070c000000| Untracked | 0 -| 97|0x000000070c200000, 0x000000070c200000, 0x000000070c400000| 0%| F| |TAMS 0x000000070c200000| PB 0x000000070c200000| Untracked | 0 -| 98|0x000000070c400000, 0x000000070c400000, 0x000000070c600000| 0%| F| |TAMS 0x000000070c400000| PB 0x000000070c400000| Untracked | 0 -| 99|0x000000070c600000, 0x000000070c600000, 0x000000070c800000| 0%| F| |TAMS 0x000000070c600000| PB 0x000000070c600000| Untracked | 0 -| 100|0x000000070c800000, 0x000000070c800000, 0x000000070ca00000| 0%| F| |TAMS 0x000000070c800000| PB 0x000000070c800000| Untracked | 0 -| 101|0x000000070ca00000, 0x000000070ca00000, 0x000000070cc00000| 0%| F| |TAMS 0x000000070ca00000| PB 0x000000070ca00000| Untracked | 0 -| 102|0x000000070cc00000, 0x000000070cc00000, 0x000000070ce00000| 0%| F| |TAMS 0x000000070cc00000| PB 0x000000070cc00000| Untracked | 0 -| 103|0x000000070ce00000, 0x000000070ce00000, 0x000000070d000000| 0%| F| |TAMS 0x000000070ce00000| PB 0x000000070ce00000| Untracked | 0 -| 104|0x000000070d000000, 0x000000070d000000, 0x000000070d200000| 0%| F| |TAMS 0x000000070d000000| PB 0x000000070d000000| Untracked | 0 -| 105|0x000000070d200000, 0x000000070d200000, 0x000000070d400000| 0%| F| |TAMS 0x000000070d200000| PB 0x000000070d200000| Untracked | 0 -| 106|0x000000070d400000, 0x000000070d400000, 0x000000070d600000| 0%| F| |TAMS 0x000000070d400000| PB 0x000000070d400000| Untracked | 0 -| 107|0x000000070d600000, 0x000000070d600000, 0x000000070d800000| 0%| F| |TAMS 0x000000070d600000| PB 0x000000070d600000| Untracked | 0 -| 108|0x000000070d800000, 0x000000070d800000, 0x000000070da00000| 0%| F| |TAMS 0x000000070d800000| PB 0x000000070d800000| Untracked | 0 -| 109|0x000000070da00000, 0x000000070da00000, 0x000000070dc00000| 0%| F| |TAMS 0x000000070da00000| PB 0x000000070da00000| Untracked | 0 -| 110|0x000000070dc00000, 0x000000070dc00000, 0x000000070de00000| 0%| F| |TAMS 0x000000070dc00000| PB 0x000000070dc00000| Untracked | 0 -| 111|0x000000070de00000, 0x000000070de00000, 0x000000070e000000| 0%| F| |TAMS 0x000000070de00000| PB 0x000000070de00000| Untracked | 0 -| 112|0x000000070e000000, 0x000000070e000000, 0x000000070e200000| 0%| F| |TAMS 0x000000070e000000| PB 0x000000070e000000| Untracked | 0 -| 113|0x000000070e200000, 0x000000070e200000, 0x000000070e400000| 0%| F| |TAMS 0x000000070e200000| PB 0x000000070e200000| Untracked | 0 -| 114|0x000000070e400000, 0x000000070e400000, 0x000000070e600000| 0%| F| |TAMS 0x000000070e400000| PB 0x000000070e400000| Untracked | 0 -| 115|0x000000070e600000, 0x000000070e600000, 0x000000070e800000| 0%| F| |TAMS 0x000000070e600000| PB 0x000000070e600000| Untracked | 0 -| 116|0x000000070e800000, 0x000000070e800000, 0x000000070ea00000| 0%| F| |TAMS 0x000000070e800000| PB 0x000000070e800000| Untracked | 0 -| 117|0x000000070ea00000, 0x000000070ea00000, 0x000000070ec00000| 0%| F| |TAMS 0x000000070ea00000| PB 0x000000070ea00000| Untracked | 0 -| 118|0x000000070ec00000, 0x000000070ecf5cd8, 0x000000070ee00000| 48%| E| |TAMS 0x000000070ec00000| PB 0x000000070ec00000| Complete | 0 -| 119|0x000000070ee00000, 0x000000070f000000, 0x000000070f000000|100%| E|CS|TAMS 0x000000070ee00000| PB 0x000000070ee00000| Complete | 0 -| 120|0x000000070f000000, 0x000000070f200000, 0x000000070f200000|100%| E|CS|TAMS 0x000000070f000000| PB 0x000000070f000000| Complete | 0 -| 121|0x000000070f200000, 0x000000070f400000, 0x000000070f400000|100%| E|CS|TAMS 0x000000070f200000| PB 0x000000070f200000| Complete | 0 -| 122|0x000000070f400000, 0x000000070f600000, 0x000000070f600000|100%| E|CS|TAMS 0x000000070f400000| PB 0x000000070f400000| Complete | 0 -| 123|0x000000070f600000, 0x000000070f800000, 0x000000070f800000|100%| E|CS|TAMS 0x000000070f600000| PB 0x000000070f600000| Complete | 0 -| 124|0x000000070f800000, 0x000000070fa00000, 0x000000070fa00000|100%| E|CS|TAMS 0x000000070f800000| PB 0x000000070f800000| Complete | 0 -| 125|0x000000070fa00000, 0x000000070fc00000, 0x000000070fc00000|100%| E|CS|TAMS 0x000000070fa00000| PB 0x000000070fa00000| Complete | 0 -| 126|0x000000070fc00000, 0x000000070fe00000, 0x000000070fe00000|100%| E|CS|TAMS 0x000000070fc00000| PB 0x000000070fc00000| Complete | 0 -| 127|0x000000070fe00000, 0x0000000710000000, 0x0000000710000000|100%| E|CS|TAMS 0x000000070fe00000| PB 0x000000070fe00000| Complete | 0 - -Card table byte_map: [0x000000010511c000,0x000000010591c000] _byte_map_base: 0x000000010191c000 - -Marking Bits: (CMBitMap*) 0x000000013b809a10 - Bits: [0x000000011e120000, 0x0000000122120000) - -Polling page: 0x0000000104408000 - -Metaspace: - -Usage: - Non-class: 13.38 MB used. - Class: 1.68 MB used. - Both: 15.06 MB used. - -Virtual space: - Non-class space: 64.00 MB reserved, 13.56 MB ( 21%) committed, 1 nodes. - Class space: 1.00 GB reserved, 1.88 MB ( <1%) committed, 1 nodes. - Both: 1.06 GB reserved, 15.44 MB ( 1%) committed. - -Chunk freelists: - Non-Class: 2.35 MB - Class: 14.17 MB - Both: 16.52 MB - -MaxMetaspaceSize: unlimited -CompressedClassSpaceSize: 1.00 GB -Initial GC threshold: 21.00 MB -Current GC threshold: 21.00 MB -CDS: off - - commit_granule_bytes: 65536. - - commit_granule_words: 8192. - - virtual_space_node_default_size: 8388608. - - enlarge_chunks_in_place: 1. - - use_allocation_guard: 0. - - -Internal statistics: - -num_allocs_failed_limit: 0. -num_arena_births: 342. -num_arena_deaths: 0. -num_vsnodes_births: 2. -num_vsnodes_deaths: 0. -num_space_committed: 247. -num_space_uncommitted: 0. -num_chunks_returned_to_freelist: 0. -num_chunks_taken_from_freelist: 562. -num_chunk_merges: 0. -num_chunk_splits: 330. -num_chunks_enlarged: 189. -num_inconsistent_stats: 0. - -CodeHeap 'non-profiled nmethods': size=120032Kb used=371Kb max_used=371Kb free=119660Kb - bounds [0x0000000116be8000, 0x0000000116e58000, 0x000000011e120000] -CodeHeap 'profiled nmethods': size=120016Kb used=2312Kb max_used=2312Kb free=117703Kb - bounds [0x000000010f120000, 0x000000010f390000, 0x0000000116654000] -CodeHeap 'non-nmethods': size=5712Kb used=1327Kb max_used=1341Kb free=4384Kb - bounds [0x0000000116654000, 0x00000001168c4000, 0x0000000116be8000] - total_blobs=1701 nmethods=1217 adapters=391 - compilation: enabled - stopped_count=0, restarted_count=0 - full_count=0 - -Compilation events (20 events): -Event: 0.325 Thread 0x000000013b00c400 nmethod 1209 0x000000010f344710 code [0x000000010f3448c0, 0x000000010f344a38] -Event: 0.325 Thread 0x000000013b00c400 1210 3 jdk.internal.classfile.impl.DirectCodeBuilder::with (9 bytes) -Event: 0.326 Thread 0x000000013b00c400 nmethod 1210 0x000000010f344b10 code [0x000000010f344d40, 0x000000010f345600] -Event: 0.326 Thread 0x000000013b00c400 1213 3 jdk.internal.classfile.impl.RawBytecodeHelper::isLastBytecode (17 bytes) -Event: 0.326 Thread 0x000000013b00c400 nmethod 1213 0x000000010f345890 code [0x000000010f345a40, 0x000000010f345bb0] -Event: 0.326 Thread 0x000000013b00c400 1211 3 jdk.internal.classfile.impl.DirectCodeBuilder::with (30 bytes) -Event: 0.326 Thread 0x000000013b00c400 nmethod 1211 0x000000010f345c90 code [0x000000010f345ec0, 0x000000010f346610] -Event: 0.326 Thread 0x000000013b00c400 1212 3 jdk.internal.classfile.impl.SplitConstantPool::map (145 bytes) -Event: 0.326 Thread 0x000000013b00c400 nmethod 1212 0x000000010f346810 code [0x000000010f346b00, 0x000000010f347880] -Event: 0.326 Thread 0x000000013b00c400 1214 3 jdk.internal.classfile.impl.AbstractPoolEntry::width (23 bytes) -Event: 0.326 Thread 0x000000013b00c400 nmethod 1214 0x000000010f347c90 code [0x000000010f347e40, 0x000000010f347ff8] -Event: 0.326 Thread 0x000000013b00c400 1215 3 jdk.internal.classfile.impl.Util::checkKind (41 bytes) -Event: 0.326 Thread 0x000000013b00c400 nmethod 1215 0x000000010f348090 code [0x000000010f348380, 0x000000010f349150] -Event: 0.326 Thread 0x000000013b00c400 1216 3 jdk.internal.classfile.impl.AbstractPoolEntry::phiMix (12 bytes) -Event: 0.326 Thread 0x000000013b00c400 nmethod 1216 0x000000010f349610 code [0x000000010f349780, 0x000000010f349868] -Event: 0.326 Thread 0x000000013b00c400 1217 3 jdk.internal.classfile.impl.BufWriterImpl::writeU2 (8 bytes) -Event: 0.326 Thread 0x000000013b00c400 nmethod 1217 0x000000010f349910 code [0x000000010f349ac0, 0x000000010f349c38] -Event: 0.328 Thread 0x000000013b00c400 1219 3 java.util.ArrayList::isEmpty (13 bytes) -Event: 0.328 Thread 0x000000013b00c400 nmethod 1219 0x000000010f349d10 code [0x000000010f349ec0, 0x000000010f34a030] -Event: 0.328 Thread 0x000000013b00c400 1221 3 jdk.internal.classfile.impl.StackMapGenerator::processBlock (2767 bytes) - -GC Heap History (0 events): -No events - -Dll operation events (10 events): -Event: 0.005 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjava.dylib -Event: 0.058 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libzip.dylib -Event: 0.060 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libinstrument.dylib -Event: 0.063 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libnio.dylib -Event: 0.068 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libzip.dylib -Event: 0.080 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libnet.dylib -Event: 0.087 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libextnet.dylib -Event: 0.117 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjimage.dylib -Event: 0.265 Loaded shared library libsomelib.dylib -Event: 0.268 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libsyslookup.dylib - -Deoptimization events (20 events): -Event: 0.249 Thread 0x000000013980aa00 DEOPT PACKING pc=0x000000010f1b6fb4 sp=0x000000016bc972d0 -Event: 0.249 Thread 0x000000013980aa00 DEOPT UNPACKING pc=0x0000000116696e7c sp=0x000000016bc96fe0 mode 0 -Event: 0.250 Thread 0x000000013980aa00 Uncommon trap: trap_request=0xffffff45 fr.pc=0x0000000116c28560 relative=0x0000000000000060 -Event: 0.250 Thread 0x000000013980aa00 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000116c28560 method=java.lang.CharacterData.of(I)Ljava/lang/CharacterData; @ 4 c2 -Event: 0.250 Thread 0x000000013980aa00 DEOPT PACKING pc=0x0000000116c28560 sp=0x000000016bc96b60 -Event: 0.250 Thread 0x000000013980aa00 DEOPT UNPACKING pc=0x000000011669701c sp=0x000000016bc96b00 mode 2 -Event: 0.251 Thread 0x000000013980aa00 Uncommon trap: trap_request=0xffffff45 fr.pc=0x0000000116bf17f0 relative=0x00000000000000b0 -Event: 0.251 Thread 0x000000013980aa00 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000116bf17f0 method=java.lang.String.isLatin1()Z @ 10 c2 -Event: 0.251 Thread 0x000000013980aa00 DEOPT PACKING pc=0x0000000116bf17f0 sp=0x000000016bc974a0 -Event: 0.251 Thread 0x000000013980aa00 DEOPT UNPACKING pc=0x000000011669701c sp=0x000000016bc973d0 mode 2 -Event: 0.251 Thread 0x000000013980aa00 Uncommon trap: trap_request=0xffffff45 fr.pc=0x0000000116c05650 relative=0x0000000000000190 -Event: 0.251 Thread 0x000000013980aa00 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000116c05650 method=jdk.internal.util.ArraysSupport.vectorizedHashCode(Ljava/lang/Object;IIII)I @ 2 c2 -Event: 0.251 Thread 0x000000013980aa00 DEOPT PACKING pc=0x0000000116c05650 sp=0x000000016bc97370 -Event: 0.251 Thread 0x000000013980aa00 DEOPT UNPACKING pc=0x000000011669701c sp=0x000000016bc97310 mode 2 -Event: 0.258 Thread 0x000000013980aa00 Uncommon trap: trap_request=0xffffff45 fr.pc=0x0000000116c2d220 relative=0x00000000000000e0 -Event: 0.258 Thread 0x000000013980aa00 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000116c2d220 method=sun.net.www.ParseUtil.firstEncodeIndex(Ljava/lang/String;)I @ 51 c2 -Event: 0.258 Thread 0x000000013980aa00 DEOPT PACKING pc=0x0000000116c2d220 sp=0x000000016bc967c0 -Event: 0.258 Thread 0x000000013980aa00 DEOPT UNPACKING pc=0x000000011669701c sp=0x000000016bc96740 mode 2 -Event: 0.302 Thread 0x000000013980aa00 DEOPT PACKING pc=0x000000010f2f6fe0 sp=0x000000016bc966e0 -Event: 0.302 Thread 0x000000013980aa00 DEOPT UNPACKING pc=0x0000000116696e7c sp=0x000000016bc96450 mode 3 - -Classes loaded (20 events): -Event: 0.329 Loading class jdk/internal/classfile/impl/BufferedCodeBuilder -Event: 0.329 Loading class jdk/internal/classfile/impl/BufferedCodeBuilder done -Event: 0.329 Loading class jdk/internal/classfile/impl/TransformingCodeBuilder -Event: 0.329 Loading class jdk/internal/classfile/impl/TransformingCodeBuilder done -Event: 0.330 Loading class java/lang/classfile/instruction/ThrowInstruction -Event: 0.330 Loading class java/lang/classfile/instruction/ThrowInstruction done -Event: 0.330 Loading class jdk/internal/classfile/impl/AbstractInstruction$UnboundThrowInstruction -Event: 0.330 Loading class jdk/internal/classfile/impl/AbstractInstruction$UnboundThrowInstruction done -Event: 0.330 Loading class java/lang/classfile/instruction/ExceptionCatch -Event: 0.330 Loading class java/lang/classfile/instruction/ExceptionCatch done -Event: 0.330 Loading class jdk/internal/classfile/impl/AbstractPseudoInstruction$ExceptionCatchImpl -Event: 0.330 Loading class jdk/internal/classfile/impl/AbstractPseudoInstruction -Event: 0.330 Loading class jdk/internal/classfile/impl/AbstractPseudoInstruction done -Event: 0.330 Loading class jdk/internal/classfile/impl/AbstractPseudoInstruction$ExceptionCatchImpl done -Event: 0.330 Loading class jdk/internal/classfile/impl/StackMapGenerator$RawExceptionCatch -Event: 0.330 Loading class jdk/internal/classfile/impl/StackMapGenerator$RawExceptionCatch done -Event: 0.331 Loading class jdk/internal/classfile/impl/SplitConstantPool$1 -Event: 0.331 Loading class jdk/internal/classfile/impl/SplitConstantPool$1 done -Event: 0.331 Loading class java/lang/invoke/ConstantBootstraps -Event: 0.332 Loading class java/lang/invoke/ConstantBootstraps done - -Classes unloaded (0 events): -No events - -Classes redefined (0 events): -No events - -Internal exceptions (20 events): -Event: 0.302 Thread 0x000000013980aa00 Exception (0x000000070ef3b8c8) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 0.304 Thread 0x000000013980aa00 Exception (0x000000070ef5aba0) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 0.304 Thread 0x000000013980aa00 Exception (0x000000070ef5f1f0) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 0.304 Thread 0x000000013980aa00 Exception (0x000000070ef62da8) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 0.305 Thread 0x000000013980aa00 Exception (0x000000070ef6a8f8) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 0.305 Thread 0x000000013980aa00 Exception (0x000000070ef71cd8) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 0.305 Thread 0x000000013980aa00 Exception (0x000000070ef78ca8) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 0.305 Thread 0x000000013980aa00 Exception (0x000000070ef7d760) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 0.306 Thread 0x000000013980aa00 Exception (0x000000070ef9ba38) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 0.313 Thread 0x000000013980aa00 Exception (0x000000070efc2808) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 841] -Event: 0.314 Thread 0x000000013980aa00 Exception (0x000000070efd4930) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 0.319 Thread 0x000000013980aa00 Exception (0x000000070ec31260) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 0.319 Thread 0x000000013980aa00 Exception (0x000000070ec3b858) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 0.320 Thread 0x000000013980aa00 Exception (0x000000070ec4d198) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 0.321 Thread 0x000000013980aa00 Exception (0x000000070ec69808) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 0.322 Thread 0x000000013980aa00 Exception (0x000000070ec6ecd8) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 0.323 Thread 0x000000013980aa00 Exception (0x000000070ec78c30) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 0.328 Thread 0x000000013980aa00 Exception (0x000000070eca4bd0) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 0.331 Thread 0x000000013980aa00 Exception (0x000000070ecc5d20) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 0.332 Thread 0x000000013980aa00 Exception (0x000000070ecd74f8) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] - -ZGC Phase Switch (0 events): -No events - -VM Operations (12 events): -Event: 0.052 Executing VM operation: HandshakeAllThreads (Deoptimize) -Event: 0.052 Executing VM operation: HandshakeAllThreads (Deoptimize) done -Event: 0.141 Executing VM operation: HandshakeAllThreads (Deoptimize) -Event: 0.141 Executing VM operation: HandshakeAllThreads (Deoptimize) done -Event: 0.205 Executing VM operation: ICBufferFull -Event: 0.205 Executing VM operation: ICBufferFull done -Event: 0.246 Executing VM operation: HandshakeAllThreads (Deoptimize) -Event: 0.246 Executing VM operation: HandshakeAllThreads (Deoptimize) done -Event: 0.250 Executing VM operation: HandshakeAllThreads (Deoptimize) -Event: 0.250 Executing VM operation: HandshakeAllThreads (Deoptimize) done -Event: 0.326 Executing VM operation: ICBufferFull -Event: 0.326 Executing VM operation: ICBufferFull done - -Events (20 events): -Event: 0.023 Thread 0x000000013b852c00 Thread added: 0x000000013b852c00 -Event: 0.023 Protecting memory [0x000000016cc10000,0x000000016cc1c000] with protection modes 0 -Event: 0.023 Thread 0x000000013b853400 Thread added: 0x000000013b853400 -Event: 0.023 Protecting memory [0x000000016ce1c000,0x000000016ce28000] with protection modes 0 -Event: 0.024 Thread 0x000000013b01c800 Thread added: 0x000000013b01c800 -Event: 0.024 Protecting memory [0x000000016d028000,0x000000016d034000] with protection modes 0 -Event: 0.024 Thread 0x000000013985f000 Thread added: 0x000000013985f000 -Event: 0.024 Protecting memory [0x000000016d234000,0x000000016d240000] with protection modes 0 -Event: 0.024 Thread 0x0000000129834c00 Thread added: 0x0000000129834c00 -Event: 0.024 Protecting memory [0x000000016d440000,0x000000016d44c000] with protection modes 0 -Event: 0.024 Thread 0x000000013b01d000 Thread added: 0x000000013b01d000 -Event: 0.024 Protecting memory [0x000000016d64c000,0x000000016d658000] with protection modes 0 -Event: 0.024 Thread 0x000000013b00c400 Thread added: 0x000000013b00c400 -Event: 0.024 Protecting memory [0x000000016d858000,0x000000016d864000] with protection modes 0 -Event: 0.045 Thread 0x000000013b00cc00 Thread added: 0x000000013b00cc00 -Event: 0.045 Protecting memory [0x000000016da64000,0x000000016da70000] with protection modes 0 -Event: 0.077 Thread 0x000000013b85dc00 Thread added: 0x000000013b85dc00 -Event: 0.077 Protecting memory [0x000000016dc70000,0x000000016dc7c000] with protection modes 0 -Event: 0.077 Thread 0x000000013b8e0600 Thread added: 0x000000013b8e0600 -Event: 0.077 Protecting memory [0x000000016de7c000,0x000000016de88000] with protection modes 0 - - -Dynamic libraries: -0x000000010487c000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjli.dylib -0x00000001a96bb000 /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa -0x0000000192c62000 /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit -0x0000000195cce000 /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData -0x0000000190515000 /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation -0x000000019bfdc000 /usr/lib/libSystem.B.dylib -0x0000000193f9f000 /System/Library/PrivateFrameworks/UIFoundation.framework/Versions/A/UIFoundation -0x000000022ab7f000 /System/Library/PrivateFrameworks/CollectionViewCore.framework/Versions/A/CollectionViewCore -0x00000001a3255000 /System/Library/PrivateFrameworks/RemoteViewServices.framework/Versions/A/RemoteViewServices -0x0000000199e89000 /System/Library/PrivateFrameworks/XCTTargetBootstrap.framework/Versions/A/XCTTargetBootstrap -0x000000019e618000 /System/Library/PrivateFrameworks/InternationalSupport.framework/Versions/A/InternationalSupport -0x000000019e66c000 /System/Library/PrivateFrameworks/UserActivity.framework/Versions/A/UserActivity -0x000000024efd6000 /System/Library/PrivateFrameworks/WindowManagement.framework/Versions/A/WindowManagement -0x0000000190195000 /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration -0x000000019da86000 /usr/lib/libspindump.dylib -0x0000000194154000 /System/Library/Frameworks/UniformTypeIdentifiers.framework/Versions/A/UniformTypeIdentifiers -0x0000000197d00000 /usr/lib/libapp_launch_measurement.dylib -0x0000000197126000 /System/Library/PrivateFrameworks/CoreAnalytics.framework/Versions/A/CoreAnalytics -0x0000000197d07000 /System/Library/PrivateFrameworks/CoreAutoLayout.framework/Versions/A/CoreAutoLayout -0x00000001996a9000 /System/Library/Frameworks/Metal.framework/Versions/A/Metal -0x000000019a631000 /usr/lib/liblangid.dylib -0x0000000199e8f000 /System/Library/PrivateFrameworks/CoreSVG.framework/Versions/A/CoreSVG -0x0000000194b19000 /System/Library/PrivateFrameworks/SkyLight.framework/Versions/A/SkyLight -0x0000000194fba000 /System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics -0x00000001a392f000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate -0x000000019d8e0000 /System/Library/PrivateFrameworks/IconServices.framework/Versions/A/IconServices -0x0000000199687000 /System/Library/Frameworks/IOSurface.framework/Versions/A/IOSurface -0x0000000197155000 /usr/lib/libDiagnosticMessagesClient.dylib -0x000000019bf1e000 /usr/lib/libz.1.dylib -0x00000001a70d4000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices -0x0000000199e71000 /System/Library/PrivateFrameworks/DFRFoundation.framework/Versions/A/DFRFoundation -0x00000001924bc000 /usr/lib/libicucore.A.dylib -0x000000019f676000 /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox -0x000000019e627000 /System/Library/PrivateFrameworks/DataDetectorsCore.framework/Versions/A/DataDetectorsCore -0x00000001b809a000 /System/Library/PrivateFrameworks/TextInput.framework/Versions/A/TextInput -0x0000000194a6a000 /usr/lib/libMobileGestalt.dylib -0x0000000199bad000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox -0x000000019762c000 /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore -0x00000001920e9000 /System/Library/Frameworks/Security.framework/Versions/A/Security -0x00000001a3295000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SpeechRecognition.framework/Versions/A/SpeechRecognition -0x0000000197a2e000 /System/Library/PrivateFrameworks/CoreUI.framework/Versions/A/CoreUI -0x00000001919e2000 /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio -0x0000000197239000 /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration -0x000000019dee2000 /System/Library/PrivateFrameworks/MultitouchSupport.framework/Versions/A/MultitouchSupport -0x0000000194a68000 /usr/lib/libenergytrace.dylib -0x00000001ad793000 /System/Library/PrivateFrameworks/RenderBox.framework/Versions/A/RenderBox -0x0000000192b16000 /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit -0x00000001a366a000 /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices -0x0000000197c8c000 /System/Library/PrivateFrameworks/PerformanceAnalysis.framework/Versions/A/PerformanceAnalysis -0x00000001e603f000 /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL -0x0000000197d51000 /usr/lib/libxml2.2.dylib -0x000000019b360000 /System/Library/PrivateFrameworks/MobileKeyBag.framework/Versions/A/MobileKeyBag -0x000000018ef80000 /usr/lib/libobjc.A.dylib -0x000000018f274000 /usr/lib/libc++.1.dylib -0x00000001a35e7000 /System/Library/Frameworks/Accessibility.framework/Versions/A/Accessibility -0x000000019569a000 /System/Library/Frameworks/ColorSync.framework/Versions/A/ColorSync -0x000000018f3c0000 /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation -0x000000019a1ec000 /System/Library/Frameworks/CoreImage.framework/Versions/A/CoreImage -0x00000001917ed000 /System/Library/Frameworks/CoreText.framework/Versions/A/CoreText -0x00000001ea89e000 /System/Library/Frameworks/CoreTransferable.framework/Versions/A/CoreTransferable -0x00000001ead63000 /System/Library/Frameworks/DeveloperToolsSupport.framework/Versions/A/DeveloperToolsSupport -0x0000000199eca000 /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO -0x0000000224d1f000 /System/Library/Frameworks/Symbols.framework/Versions/A/Symbols -0x000000019bfe2000 /System/Library/PrivateFrameworks/SoftLinking.framework/Versions/A/SoftLinking -0x000000019f028000 /usr/lib/swift/libswiftCore.dylib -0x00000001b4d27000 /usr/lib/swift/libswiftCoreFoundation.dylib -0x00000001b2790000 /usr/lib/swift/libswiftCoreGraphics.dylib -0x00000001b4d71000 /usr/lib/swift/libswiftCoreImage.dylib -0x00000001b2797000 /usr/lib/swift/libswiftDarwin.dylib -0x00000001a4cda000 /usr/lib/swift/libswiftDispatch.dylib -0x00000001b4d72000 /usr/lib/swift/libswiftIOKit.dylib -0x00000001c07cc000 /usr/lib/swift/libswiftMetal.dylib -0x00000001cde91000 /usr/lib/swift/libswiftOSLog.dylib -0x00000001a754f000 /usr/lib/swift/libswiftObjectiveC.dylib -0x00000001c4f00000 /usr/lib/swift/libswiftQuartzCore.dylib -0x00000001c9005000 /usr/lib/swift/libswiftUniformTypeIdentifiers.dylib -0x00000001b4d39000 /usr/lib/swift/libswiftXPC.dylib -0x000000025747d000 /usr/lib/swift/libswift_Concurrency.dylib -0x00000001a7553000 /usr/lib/swift/libswiftos.dylib -0x00000001b7ffe000 /usr/lib/swift/libswiftsimd.dylib -0x000000019c191000 /usr/lib/libcompression.dylib -0x000000019e572000 /System/Library/PrivateFrameworks/TextureIO.framework/Versions/A/TextureIO -0x000000019d58c000 /usr/lib/libate.dylib -0x000000019bfd6000 /usr/lib/system/libcache.dylib -0x000000019bf90000 /usr/lib/system/libcommonCrypto.dylib -0x000000019bfbc000 /usr/lib/system/libcompiler_rt.dylib -0x000000019bfb2000 /usr/lib/system/libcopyfile.dylib -0x000000018f0c4000 /usr/lib/system/libcorecrypto.dylib -0x000000018f1aa000 /usr/lib/system/libdispatch.dylib -0x000000018f365000 /usr/lib/system/libdyld.dylib -0x000000019bfcc000 /usr/lib/system/libkeymgr.dylib -0x000000019bf68000 /usr/lib/system/libmacho.dylib -0x000000019b448000 /usr/lib/system/libquarantine.dylib -0x000000019bfc9000 /usr/lib/system/libremovefile.dylib -0x0000000194ae0000 /usr/lib/system/libsystem_asl.dylib -0x000000018f059000 /usr/lib/system/libsystem_blocks.dylib -0x000000018f1f5000 /usr/lib/system/libsystem_c.dylib -0x000000019bfc0000 /usr/lib/system/libsystem_collections.dylib -0x000000019a620000 /usr/lib/system/libsystem_configuration.dylib -0x000000019965c000 /usr/lib/system/libsystem_containermanager.dylib -0x000000019bbff000 /usr/lib/system/libsystem_coreservices.dylib -0x0000000192783000 /usr/lib/system/libsystem_darwin.dylib -0x00000002577ca000 /usr/lib/system/libsystem_darwindirectory.dylib -0x000000019bfcd000 /usr/lib/system/libsystem_dnssd.dylib -0x00000002577ce000 /usr/lib/system/libsystem_eligibility.dylib -0x000000018f1f2000 /usr/lib/system/libsystem_featureflags.dylib -0x000000018f393000 /usr/lib/system/libsystem_info.dylib -0x000000019bf2d000 /usr/lib/system/libsystem_m.dylib -0x000000018f16d000 /usr/lib/system/libsystem_malloc.dylib -0x0000000194a4d000 /usr/lib/system/libsystem_networkextension.dylib -0x0000000192bf9000 /usr/lib/system/libsystem_notify.dylib -0x000000019a625000 /usr/lib/system/libsystem_sandbox.dylib -0x00000002577d2000 /usr/lib/system/libsystem_sanitizers.dylib -0x000000019bfc5000 /usr/lib/system/libsystem_secinit.dylib -0x000000018f31d000 /usr/lib/system/libsystem_kernel.dylib -0x000000018f38b000 /usr/lib/system/libsystem_platform.dylib -0x000000018f358000 /usr/lib/system/libsystem_pthread.dylib -0x00000001964d0000 /usr/lib/system/libsystem_symptoms.dylib -0x000000018f0a9000 /usr/lib/system/libsystem_trace.dylib -0x000000019bf9e000 /usr/lib/system/libunwind.dylib -0x000000018f05e000 /usr/lib/system/libxpc.dylib -0x000000018f301000 /usr/lib/libc++abi.dylib -0x000000019bfaa000 /usr/lib/liboah.dylib -0x000000019d438000 /usr/lib/liblzma.5.dylib -0x000000019bfde000 /usr/lib/libfakelink.dylib -0x0000000194679000 /System/Library/Frameworks/CFNetwork.framework/Versions/A/CFNetwork -0x000000019c032000 /usr/lib/libarchive.2.dylib -0x00000001a1568000 /System/Library/Frameworks/Combine.framework/Versions/A/Combine -0x000000022ab93000 /System/Library/PrivateFrameworks/CollectionsInternal.framework/Versions/A/CollectionsInternal -0x0000000241543000 /System/Library/PrivateFrameworks/ReflectionInternal.framework/Versions/A/ReflectionInternal -0x0000000241ad5000 /System/Library/PrivateFrameworks/RuntimeInternal.framework/Versions/A/RuntimeInternal -0x00000002575d1000 /usr/lib/swift/libswift_StringProcessing.dylib -0x0000000192a94000 /System/Library/PrivateFrameworks/CoreServicesInternal.framework/Versions/A/CoreServicesInternal -0x000000019b46f000 /usr/lib/libbsm.0.dylib -0x000000019bf70000 /usr/lib/system/libkxld.dylib -0x0000000197cc8000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/FSEvents.framework/Versions/A/FSEvents -0x000000019278e000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore -0x000000019719e000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata -0x000000019bc05000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices -0x000000019c0bb000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit -0x0000000196451000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE -0x000000018f899000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices -0x000000019d3e1000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/DictionaryServices.framework/Versions/A/DictionaryServices -0x0000000197cd5000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SharedFileList.framework/Versions/A/SharedFileList -0x000000019c15b000 /usr/lib/libapple_nghttp2.dylib -0x00000001960c5000 /usr/lib/libsqlite3.dylib -0x00000001964d9000 /System/Library/Frameworks/Network.framework/Versions/A/Network -0x0000000255e8e000 /usr/lib/libCoreEntitlements.dylib -0x000000023c44d000 /System/Library/PrivateFrameworks/MessageSecurity.framework/Versions/A/MessageSecurity -0x00000001960ab000 /System/Library/PrivateFrameworks/ProtocolBuffer.framework/Versions/A/ProtocolBuffer -0x000000019bb2e000 /System/Library/PrivateFrameworks/AppleFSCompression.framework/Versions/A/AppleFSCompression -0x000000019b457000 /usr/lib/libcoretls.dylib -0x000000019d457000 /usr/lib/libcoretls_cfhelpers.dylib -0x000000019c18b000 /usr/lib/libpam.2.dylib -0x000000019d4c9000 /usr/lib/libxar.1.dylib -0x000000019d8b7000 /usr/lib/libheimdal-asn1.dylib -0x0000000194678000 /usr/lib/libnetwork.dylib -0x000000019bfe3000 /usr/lib/libpcap.A.dylib -0x00000001964c5000 /usr/lib/libdns_services.dylib -0x000000019a62d000 /System/Library/PrivateFrameworks/AppleSystemInfo.framework/Versions/A/AppleSystemInfo -0x000000019b155000 /System/Library/PrivateFrameworks/IOMobileFramebuffer.framework/Versions/A/IOMobileFramebuffer -0x0000000257528000 /usr/lib/swift/libswift_RegexParser.dylib -0x000000019bbf2000 /usr/lib/libbz2.1.0.dylib -0x000000019b44b000 /usr/lib/libCheckFix.dylib -0x0000000194af8000 /System/Library/PrivateFrameworks/TCC.framework/Versions/A/TCC -0x000000019a633000 /System/Library/PrivateFrameworks/CoreNLP.framework/Versions/A/CoreNLP -0x0000000197157000 /System/Library/PrivateFrameworks/MetadataUtilities.framework/Versions/A/MetadataUtilities -0x000000019b481000 /usr/lib/libmecab.dylib -0x0000000190229000 /usr/lib/libCRFSuite.dylib -0x000000019b4dd000 /usr/lib/libgermantok.dylib -0x000000019c132000 /usr/lib/libThaiTokenizer.dylib -0x0000000197242000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.framework/Versions/A/vImage -0x00000001a3641000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/vecLib -0x000000019d510000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvMisc.dylib -0x000000019b030000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvDSP.dylib -0x000000018fca0000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib -0x000000019c266000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib -0x000000019b4e0000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLinearAlgebra.dylib -0x000000019c176000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparseBLAS.dylib -0x000000019c261000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libQuadrature.dylib -0x000000019a75c000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBNNS.dylib -0x000000019012e000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparse.dylib -0x000000023ab9c000 /System/Library/PrivateFrameworks/MIL.framework/Versions/A/MIL -0x000000019c019000 /usr/lib/libiconv.2.dylib -0x000000019bf64000 /usr/lib/libcharset.1.dylib -0x0000000197ca8000 /System/Library/Frameworks/OpenDirectory.framework/Versions/A/Frameworks/CFOpenDirectory.framework/Versions/A/CFOpenDirectory -0x0000000197c98000 /System/Library/Frameworks/OpenDirectory.framework/Versions/A/OpenDirectory -0x000000019d459000 /System/Library/PrivateFrameworks/APFS.framework/Versions/A/APFS -0x000000019b387000 /System/Library/Frameworks/SecurityFoundation.framework/Versions/A/SecurityFoundation -0x000000019d4d8000 /usr/lib/libutil.dylib -0x0000000238cfd000 /System/Library/PrivateFrameworks/InstalledContentLibrary.framework/Versions/A/InstalledContentLibrary -0x0000000192ad5000 /System/Library/PrivateFrameworks/CoreServicesStore.framework/Versions/A/CoreServicesStore -0x0000000228340000 /System/Library/PrivateFrameworks/AppleMobileFileIntegrity.framework/Versions/A/AppleMobileFileIntegrity -0x00000001b4cf5000 /usr/lib/libmis.dylib -0x00000001c53e7000 /System/Library/PrivateFrameworks/MobileSystemServices.framework/Versions/A/MobileSystemServices -0x00000001e3449000 /System/Library/PrivateFrameworks/ConfigProfileHelper.framework/Versions/A/ConfigProfileHelper -0x000000019c134000 /System/Library/PrivateFrameworks/AppleSauce.framework/Versions/A/AppleSauce -0x0000000191173000 /System/Library/PrivateFrameworks/LanguageModeling.framework/Versions/A/LanguageModeling -0x000000019d4dc000 /usr/lib/libxslt.1.dylib -0x000000019c020000 /usr/lib/libcmph.dylib -0x000000019b121000 /System/Library/PrivateFrameworks/CoreEmoji.framework/Versions/A/CoreEmoji -0x000000019a756000 /System/Library/PrivateFrameworks/LinguisticData.framework/Versions/A/LinguisticData -0x000000019003c000 /System/Library/PrivateFrameworks/Lexicon.framework/Versions/A/Lexicon -0x000000019b415000 /System/Library/PrivateFrameworks/BackgroundTaskManagement.framework/Versions/A/BackgroundTaskManagement -0x0000000256078000 /usr/lib/libTLE.dylib -0x000000019dda8000 /System/Library/PrivateFrameworks/AppleJPEG.framework/Versions/A/AppleJPEG -0x000000019d89c000 /usr/lib/libexpat.1.dylib -0x000000019e3d0000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libPng.dylib -0x000000019e3fb000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib -0x000000019e4e6000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libGIF.dylib -0x000000019ddee000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJP2.dylib -0x000000019e48b000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib -0x000000019e482000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libRadiance.dylib -0x0000000199a48000 /System/Library/PrivateFrameworks/FontServices.framework/libFontParser.dylib -0x00000001963ea000 /System/Library/PrivateFrameworks/RunningBoardServices.framework/Versions/A/RunningBoardServices -0x00000001a9f95000 /System/Library/PrivateFrameworks/IOSurfaceAccelerator.framework/Versions/A/IOSurfaceAccelerator -0x000000019dede000 /System/Library/PrivateFrameworks/WatchdogClient.framework/Versions/A/WatchdogClient -0x0000000191359000 /System/Library/Frameworks/CoreDisplay.framework/Versions/A/CoreDisplay -0x00000001998ff000 /System/Library/Frameworks/CoreMedia.framework/Versions/A/CoreMedia -0x000000019969f000 /System/Library/PrivateFrameworks/IOAccelerator.framework/Versions/A/IOAccelerator -0x0000000197e3b000 /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo -0x000000019c189000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/MetalPerformanceShaders -0x000000019df21000 /System/Library/Frameworks/VideoToolbox.framework/Versions/A/VideoToolbox -0x0000000197ed7000 /System/Library/PrivateFrameworks/UserManagement.framework/Versions/A/UserManagement -0x0000000196311000 /System/Library/PrivateFrameworks/BaseBoard.framework/Versions/A/BaseBoard -0x000000019a62b000 /System/Library/PrivateFrameworks/AggregateDictionary.framework/Versions/A/AggregateDictionary -0x000000022817a000 /System/Library/PrivateFrameworks/AppleKeyStore.framework/Versions/A/AppleKeyStore -0x000000019e47d000 /System/Library/PrivateFrameworks/GPUWrangler.framework/Versions/A/GPUWrangler -0x000000019e45d000 /System/Library/PrivateFrameworks/IOPresentment.framework/Versions/A/IOPresentment -0x000000019e485000 /System/Library/PrivateFrameworks/DSExternalDisplay.framework/Versions/A/DSExternalDisplay -0x0000000234d8a000 /System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/32023/Libraries/libllvm-flatbuffers.dylib -0x00000001e6032000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCoreFSCache.dylib -0x00000002319ee000 /System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/32023/Libraries/libGPUCompilerUtils.dylib -0x000000019e4ec000 /System/Library/PrivateFrameworks/CMCaptureCore.framework/Versions/A/CMCaptureCore -0x00000001eae86000 /System/Library/Frameworks/ExtensionFoundation.framework/Versions/A/ExtensionFoundation -0x00000001a5543000 /System/Library/PrivateFrameworks/CoreTime.framework/Versions/A/CoreTime -0x000000019da70000 /System/Library/PrivateFrameworks/AppServerSupport.framework/Versions/A/AppServerSupport -0x00000001a0004000 /System/Library/PrivateFrameworks/perfdata.framework/Versions/A/perfdata -0x000000019147d000 /System/Library/PrivateFrameworks/AudioToolboxCore.framework/Versions/A/AudioToolboxCore -0x00000001998d5000 /System/Library/PrivateFrameworks/caulk.framework/Versions/A/caulk -0x000000019f872000 /usr/lib/libAudioStatistics.dylib -0x00000001b402e000 /System/Library/PrivateFrameworks/SystemPolicy.framework/Versions/A/SystemPolicy -0x000000019fb4b000 /usr/lib/libSMC.dylib -0x00000001a953d000 /System/Library/Frameworks/CoreMIDI.framework/Versions/A/CoreMIDI -0x000000019e397000 /usr/lib/libAudioToolboxUtility.dylib -0x00000001af42f000 /System/Library/PrivateFrameworks/OSAServicesClient.framework/Versions/A/OSAServicesClient -0x00000001a0012000 /usr/lib/libperfcheck.dylib -0x00000001a4ffa000 /System/Library/PrivateFrameworks/BoardServices.framework/Versions/A/BoardServices -0x000000019d784000 /System/Library/PrivateFrameworks/PlugInKit.framework/Versions/A/PlugInKit -0x000000019b379000 /System/Library/PrivateFrameworks/AssertionServices.framework/Versions/A/AssertionServices -0x00000001a864e000 /System/Library/PrivateFrameworks/ASEProcessing.framework/Versions/A/ASEProcessing -0x00000001d1318000 /System/Library/PrivateFrameworks/Symbolication.framework/Versions/A/Symbolication -0x0000000240330000 /System/Library/PrivateFrameworks/PhotosensitivityProcessing.framework/Versions/A/PhotosensitivityProcessing -0x000000019da21000 /System/Library/PrivateFrameworks/GraphVisualizer.framework/Versions/A/GraphVisualizer -0x00000001e6094000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib -0x00000001e6053000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGFXShared.dylib -0x00000001e622c000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib -0x00000001e605c000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLImage.dylib -0x00000001e6050000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCVMSPluginSupport.dylib -0x0000000256030000 /usr/lib/libRosetta.dylib -0x00000001e6039000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCoreVMClient.dylib -0x000000022fbf4000 /System/Library/PrivateFrameworks/FontServices.framework/Versions/A/FontServices -0x000000019da2d000 /System/Library/PrivateFrameworks/OTSVG.framework/Versions/A/OTSVG -0x00000001979dc000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/Resources/libFontRegistry.dylib -0x000000019da7b000 /System/Library/PrivateFrameworks/FontServices.framework/libhvf.dylib -0x000000022fbf5000 /System/Library/PrivateFrameworks/FontServices.framework/libXTFontStaticRegistryData.dylib -0x000000019a572000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSCore.framework/Versions/A/MPSCore -0x000000019ba9c000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSImage.framework/Versions/A/MPSImage -0x000000019b4f5000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSNeuralNetwork.framework/Versions/A/MPSNeuralNetwork -0x000000019b940000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSMatrix.framework/Versions/A/MPSMatrix -0x000000019b74b000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSRayIntersector.framework/Versions/A/MPSRayIntersector -0x000000019b972000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSNDArray.framework/Versions/A/MPSNDArray -0x00000001ec760000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSFunctions.framework/Versions/A/MPSFunctions -0x00000001ec745000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSBenchmarkLoop.framework/Versions/A/MPSBenchmarkLoop -0x000000018fb54000 /System/Library/PrivateFrameworks/MetalTools.framework/Versions/A/MetalTools -0x00000001b91d7000 /System/Library/PrivateFrameworks/IOAccelMemoryInfo.framework/Versions/A/IOAccelMemoryInfo -0x00000001c52e0000 /System/Library/PrivateFrameworks/kperf.framework/Versions/A/kperf -0x00000001b4d1a000 /System/Library/PrivateFrameworks/GPURawCounter.framework/Versions/A/GPURawCounter -0x00000001a5415000 /System/Library/PrivateFrameworks/CoreSymbolication.framework/Versions/A/CoreSymbolication -0x00000001b4cc6000 /System/Library/PrivateFrameworks/MallocStackLogging.framework/Versions/A/MallocStackLogging -0x000000019d626000 /System/Library/PrivateFrameworks/CrashReporterSupport.framework/Versions/A/CrashReporterSupport -0x00000001a53d0000 /System/Library/PrivateFrameworks/DebugSymbols.framework/Versions/A/DebugSymbols -0x00000001c3c47000 /System/Library/PrivateFrameworks/OSAnalytics.framework/Versions/A/OSAnalytics -0x000000024d229000 /System/Library/PrivateFrameworks/VideoToolboxParavirtualizationSupport.framework/Versions/A/VideoToolboxParavirtualizationSupport -0x000000019d850000 /System/Library/PrivateFrameworks/AppleVA.framework/Versions/A/AppleVA -0x000000019f8ba000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS -0x0000000195849000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices -0x000000019e4fa000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/PrintCore -0x000000019fca4000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/QD.framework/Versions/A/QD -0x000000019fc98000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSyncLegacy.framework/Versions/A/ColorSyncLegacy -0x000000019f88a000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis -0x000000019e4b6000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATSUI.framework/Versions/A/ATSUI -0x000000019fc2b000 /usr/lib/libcups.2.dylib -0x00000001a0020000 /System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos -0x00000001a0031000 /System/Library/Frameworks/GSS.framework/Versions/A/GSS -0x000000019f939000 /usr/lib/libresolv.9.dylib -0x000000019da8c000 /System/Library/PrivateFrameworks/Heimdal.framework/Versions/A/Heimdal -0x00000001a74bc000 /System/Library/Frameworks/Kerberos.framework/Versions/A/Libraries/libHeimdalProxy.dylib -0x00000001a008b000 /System/Library/PrivateFrameworks/CommonAuth.framework/Versions/A/CommonAuth -0x00000001e9c6c000 /System/Library/Frameworks/AVFAudio.framework/Versions/A/AVFAudio -0x00000001af47e000 /System/Library/PrivateFrameworks/AXCoreUtilities.framework/Versions/A/AXCoreUtilities -0x000000023a274000 /System/Library/PrivateFrameworks/IsolatedCoreAudioClient.framework/Versions/A/IsolatedCoreAudioClient -0x000000019f7f6000 /System/Library/PrivateFrameworks/AudioSession.framework/Versions/A/AudioSession -0x00000001a1307000 /System/Library/Frameworks/IOBluetooth.framework/Versions/A/IOBluetooth -0x000000019d95b000 /System/Library/PrivateFrameworks/MediaExperience.framework/Versions/A/MediaExperience -0x000000019f635000 /System/Library/PrivateFrameworks/AudioSession.framework/libSessionUtility.dylib -0x000000019fcb0000 /System/Library/PrivateFrameworks/AudioResourceArbitration.framework/Versions/A/AudioResourceArbitration -0x00000001a4388000 /System/Library/PrivateFrameworks/PowerLog.framework/Versions/A/PowerLog -0x00000001a42a6000 /System/Library/Frameworks/CoreBluetooth.framework/Versions/A/CoreBluetooth -0x00000001a74bd000 /System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit -0x000000019b1e2000 /System/Library/PrivateFrameworks/CoreUtils.framework/Versions/A/CoreUtils -0x000000022de3f000 /System/Library/PrivateFrameworks/CoreUtilsExtras.framework/Versions/A/CoreUtilsExtras -0x0000000238b8a000 /System/Library/PrivateFrameworks/IO80211.framework/Versions/A/IO80211 -0x00000001a4f3e000 /System/Library/PrivateFrameworks/FrontBoardServices.framework/Versions/A/FrontBoardServices -0x00000001a6a85000 /System/Library/PrivateFrameworks/BackBoardServices.framework/Versions/A/BackBoardServices -0x000000019d8c2000 /System/Library/PrivateFrameworks/IconFoundation.framework/Versions/A/IconFoundation -0x00000001a3281000 /System/Library/PrivateFrameworks/SpeechRecognitionCore.framework/Versions/A/SpeechRecognitionCore -0x00000001af49d000 /usr/lib/libAccessibility.dylib -0x00000001a397b000 /System/Library/Frameworks/MediaAccessibility.framework/Versions/A/MediaAccessibility -0x00000001d49cc000 /System/Library/Frameworks/OSLog.framework/Versions/A/OSLog -0x00000001b4c54000 /System/Library/PrivateFrameworks/LoggingSupport.framework/Versions/A/LoggingSupport -0x0000000105a88000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/server/libjvm.dylib -0x000000010441c000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjimage.dylib -0x0000000104448000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libinstrument.dylib -0x0000000104490000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjava.dylib -0x000000010591c000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libzip.dylib -0x0000000105944000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libnio.dylib -0x0000000104478000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libnet.dylib -0x0000000105964000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libextnet.dylib -0x00000001059e4000 /Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/libsomelib.dylib -0x000000010446c000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libsyslookup.dylib - - -VM Arguments: -jvm_args: -ea -Didea.test.cyclic.buffer.size=1048576 -javaagent:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/lib/idea_rt.jar=60545:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/bin -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 -java_command: com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit5 dev.diplomattest.somelib.Float64VecTest,testFloat64Vec -java_class_path (initial): /Users/cristina/.m2/repository/org/junit/platform/junit-platform-launcher/1.10.3/junit-platform-launcher-1.10.3.jar:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/lib/idea_rt.jar:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/plugins/junit/lib/junit5-rt.jar:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/plugins/junit/lib/junit-rt.jar:/Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/target/test-classes:/Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/target/classes:/Users/cristina/.m2/repository/net/java/dev/jna/jna/5.14.0/jna-5.14.0.jar:/Users/cristina/.m2/repository/org/junit/jupiter/junit-jupiter/5.10.3/junit-jupiter-5.10.3.jar:/Users/cristina/.m2/repository/org/junit/jupiter/junit-jupiter-api/5.10.3/junit-jupiter-api-5.10.3.jar:/Users/cristina/.m2/repository/org/opentest4j/opentest4j/1.3.0/opentest4j-1.3.0.jar:/Users/cristina/.m2/repository/org/junit/platform/junit-platform-commons/1.10.3/junit-platform-commons-1.10.3.jar:/Users/cristina/.m2/repository/org/apiguardian/apiguardian-api/1.1.2/apiguardian-api-1.1.2.jar:/Users/cristina/.m2/repository/org/junit/jupiter/junit-jupiter-params/5.10.3/junit-jupiter-params-5.10.3.jar:/Users/cristina/.m2/repository/org/junit/jupiter/junit-jupiter-engine/5.10.3/junit-jupiter-engine-5.10.3.jar:/Users/cristina/.m2/repository/org/junit/platform/junit-platform-engine/1.10.3/junit-platform-engine-1.10.3.jar:/Users/cristina/.m2/repository/org/openjdk/jmh/jmh-core/1.37/jmh-core-1.37.jar:/Users/cristina/.m2/repository/net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4.jar:/Users/cristina/.m2/repository/org/apache/commons/commons-math3/3.6.1/commons-math3-3.6.1.jar:/Users/cristina/.m2/repository/org/openjdk/jmh/jmh-generator-annprocess/1.37/jmh-generator-annprocess-1.37.jar -Launcher Type: SUN_STANDARD - -[Global flags] - intx CICompilerCount = 4 {product} {ergonomic} - uint ConcGCThreads = 2 {product} {ergonomic} - uint G1ConcRefinementThreads = 8 {product} {ergonomic} - size_t G1HeapRegionSize = 2097152 {product} {ergonomic} - size_t InitialHeapSize = 268435456 {product} {ergonomic} - size_t MarkStackSize = 4194304 {product} {ergonomic} - size_t MaxHeapSize = 4294967296 {product} {ergonomic} - size_t MaxNewSize = 2575302656 {product} {ergonomic} - size_t MinHeapDeltaBytes = 2097152 {product} {ergonomic} - size_t MinHeapSize = 8388608 {product} {ergonomic} - uintx NonNMethodCodeHeapSize = 5839564 {pd product} {ergonomic} - uintx NonProfiledCodeHeapSize = 122909338 {pd product} {ergonomic} - uintx ProfiledCodeHeapSize = 122909338 {pd product} {ergonomic} - uintx ReservedCodeCacheSize = 251658240 {pd product} {ergonomic} - bool SegmentedCodeCache = true {product} {ergonomic} - size_t SoftMaxHeapSize = 4294967296 {manageable} {ergonomic} - bool UseCompressedOops = true {product lp64_product} {ergonomic} - bool UseG1GC = true {product} {ergonomic} - bool UseNUMA = false {product} {ergonomic} - bool UseNUMAInterleaving = false {product} {ergonomic} - -Logging: -Log output configuration: - #0: stdout all=warning uptime,level,tags foldmultilines=false - #1: stderr all=off uptime,level,tags foldmultilines=false - -Environment Variables: -JAVA_HOME=/Users/cristina/Library/Java/JavaVirtualMachines/corretto-19.0.1/Contents/Home/ -PATH=/Users/cristina/bin/jextract-22/bin:/bin:/Users/cristina/.modular/pkg/packages.modular.com_mojo/bin:/Users/cristina/Downloads/dart-sdk/bin:/opt/homebrew/Cellar/llvm/15.0.6/bin:/opt/homebrew/opt/openjdk/bin:/Users/cristina/.elan/bin:/Users/cristina/bin:/Users/cristina/Library/Application Support/Coursier/bin:/Users/cristina/Library/Python/3.8/bin:/Users/cristina/.local/bin:/Users/cristina/.cargo/bin:/Users/cristina/.cargo:/opt/homebrew/bin:/Users/cristina/.fzf/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/X11/bin:/Library/Apple/usr/bin:/usr/local/go/bin:/Library/TeX/texbin:/Users/cristina/.krew/bin -SHELL=/opt/homebrew/bin/fish -LC_CTYPE=en_US.UTF-8 -TMPDIR=/var/folders/x_/9qhndrhs79j640bxvmbkddfw0000gn/T/ - -Active Locale: -LC_ALL=C/en_US.UTF-8/C/C/C/C -LC_COLLATE=C -LC_CTYPE=en_US.UTF-8 -LC_MESSAGES=C -LC_MONETARY=C -LC_NUMERIC=C -LC_TIME=C - -Signal Handlers: - SIGSEGV: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_ONSTACK|SA_RESTART|SA_SIGINFO, unblocked - SIGBUS: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, unblocked - SIGFPE: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, unblocked - SIGPIPE: javaSignalHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked - SIGXFSZ: javaSignalHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked - SIGILL: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, unblocked - SIGUSR2: SR_handler in libjvm.dylib, mask=00100000000000000000000000000000, flags=SA_RESTART|SA_SIGINFO, blocked - SIGHUP: UserHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked - SIGINT: UserHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked - SIGTERM: UserHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked - SIGQUIT: UserHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked - SIGTRAP: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, unblocked - - -Periodic native trim disabled - ---------------- S Y S T E M --------------- - -OS: -uname: Darwin 23.5.0 Darwin Kernel Version 23.5.0: Wed May 1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000 arm64 -OS uptime: 45 days 10:04 hours -rlimit (soft/hard): STACK 8176k/65520k , CORE 0k/infinity , NPROC 2666/4000 , NOFILE 10240/infinity , AS infinity/infinity , CPU infinity/infinity , DATA infinity/infinity , FSIZE infinity/infinity , MEMLOCK infinity/infinity , RSS infinity/infinity -load average: 4.77 4.54 4.54 - -CPU: total 8 (initial active 8) 0x61:0x0:0x1b588bb3:0, fp, asimd, aes, pmull, sha1, sha256, crc32, lse, sha3, sha512 -machdep.cpu.brand_string:Apple M1 Pro -hw.cachelinesize:128 -hw.l1icachesize:131072 -hw.l1dcachesize:65536 -hw.l2cachesize:4194304 - -Memory: 16k page, physical 16777216k(32960k free), swap 3145728k(1371968k free) - -vm_info: OpenJDK 64-Bit Server VM (22.0.1+8) for bsd-aarch64 JRE (22.0.1+8), built on 2024-04-16T00:00:00Z by "admin" with clang Apple LLVM 15.0.0 (clang-1500.1.0.2.5) - -END. diff --git a/feature_tests/java/somelib/hs_err_pid98695.log b/feature_tests/java/somelib/hs_err_pid98695.log deleted file mode 100644 index 8dd0d17f1..000000000 --- a/feature_tests/java/somelib/hs_err_pid98695.log +++ /dev/null @@ -1,1291 +0,0 @@ -# -# A fatal error has been detected by the Java Runtime Environment: -# -# SIGSEGV (0xb) at pc=0x00000001019b9aec, pid=98695, tid=10499 -# -# JRE version: OpenJDK Runtime Environment Temurin-22.0.1+8 (22.0.1+8) (build 22.0.1+8) -# Java VM: OpenJDK 64-Bit Server VM Temurin-22.0.1+8 (22.0.1+8, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-aarch64) -# Problematic frame: -# C [libsomelib.dylib+0x5aec] Float64Vec_new_isize+0xb4 -# -# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again -# -# If you would like to submit a bug report, please visit: -# https://github.com/adoptium/adoptium-support/issues -# The crash happened outside the Java Virtual Machine in native code. -# See problematic frame for where to report the bug. -# - ---------------- S U M M A R Y ------------ - -Command Line: -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:60556,suspend=y,server=n -ea -Didea.test.cyclic.buffer.size=1048576 -javaagent:/Users/cristina/Library/Caches/JetBrains/IdeaIC2024.1/captureAgent/debugger-agent.jar -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit5 dev.diplomattest.somelib.Float64VecTest,testFloat64Vec - -Host: "MacBookPro18,3" arm64, 8 cores, 16G, Darwin 23.5.0, macOS 14.5 (23F79) -Time: Wed Aug 14 21:05:38 2024 CEST elapsed time: 3.057476 seconds (0d 0h 0m 3s) - ---------------- T H R E A D --------------- - -Current thread (0x0000000131818400): JavaThread "main" [_thread_in_native, id=10499, stack(0x000000016fa6c000,0x000000016fc6f000) (2060K)] - -Stack: [0x000000016fa6c000,0x000000016fc6f000], sp=0x000000016fc6b870, free space=2046k -Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) -C [libsomelib.dylib+0x5aec] Float64Vec_new_isize+0xb4 -v ~RuntimeStub::nep_invoker_blob 0x00000001127a653c -j java.lang.invoke.LambdaForm$MH+0x00000ffc001d0400.invoke(Ljava/lang/Object;JJJ)J+12 java.base@22.0.1 -j java.lang.invoke.LambdaForm$MH+0x00000ffc001d3000.invokeExact_MT(Ljava/lang/Object;JJJLjava/lang/Object;)J+23 java.base@22.0.1 -j jdk.internal.foreign.abi.DowncallStub+0x00000ffc001d1000.invoke(Ljava/lang/foreign/SegmentAllocator;Ljava/lang/foreign/MemorySegment;Ljava/lang/foreign/MemorySegment;)Ljava/lang/foreign/MemorySegment;+69 java.base@22.0.1 -j java.lang.invoke.LambdaForm$DMH+0x00000ffc001d1400.invokeStaticInit(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+14 java.base@22.0.1 -j java.lang.invoke.LambdaForm$MH+0x00000ffc001d2400.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+44 java.base@22.0.1 -j java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+19 java.base@22.0.1 -j dev.diplomattest.somelib.ntv.somelib_h.Float64Vec_new_isize(Ljava/lang/foreign/MemorySegment;)Ljava/lang/foreign/MemorySegment;+26 -j dev.diplomattest.somelib.Float64Vec.newIsize([J)Ldev/diplomattest/somelib/Float64Vec;+38 -j dev.diplomattest.somelib.Float64VecTest.testFloat64Vec()V+53 -j java.lang.invoke.LambdaForm$DMH+0x00000ffc00140c00.invokeVirtual(Ljava/lang/Object;Ljava/lang/Object;)V+10 java.base@22.0.1 -j java.lang.invoke.LambdaForm$MH+0x00000ffc00148400.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+31 java.base@22.0.1 -j java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+19 java.base@22.0.1 -j jdk.internal.reflect.DirectMethodHandleAccessor.invokeImpl(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+41 java.base@22.0.1 -j jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+23 java.base@22.0.1 -j java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+102 java.base@22.0.1 -j org.junit.platform.commons.util.ReflectionUtils.invokeMethod(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+42 -j org.junit.jupiter.engine.execution.MethodInvocation.proceed()Ljava/lang/Object;+16 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed()Ljava/lang/Object;+8 -j org.junit.jupiter.engine.extension.TimeoutExtension.intercept(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/TimeoutDuration;Lorg/junit/jupiter/engine/extension/TimeoutExtension$TimeoutProvider;)Ljava/lang/Object;+28 -j org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/TimeoutExtension$TimeoutProvider;)Ljava/lang/Object;+31 -j org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)V+9 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda+0x00000ffc00117998.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)V+5 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall$VoidMethodInterceptorCall;Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)Ljava/lang/Void;+6 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall$$Lambda+0x00000ffc00117da8.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)Ljava/lang/Object;+9 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+6 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$$Lambda+0x00000ffc001465f0.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+14 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed()Ljava/lang/Object;+12 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+1 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/engine/execution/InvocationInterceptorChain$InterceptorCall;Ljava/util/List;)Ljava/lang/Object;+24 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InvocationInterceptorChain$InterceptorCall;)Ljava/lang/Object;+31 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;)Ljava/lang/Object;+15 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(Ljava/lang/reflect/Method;Ljava/lang/Object;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;)Ljava/lang/Object;+55 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;)V+28 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda+0x00000ffc00142aa8.execute()V+12 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)V+21 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;+44 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;+6 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+79 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00000ffc00136220.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00000ffc00136000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 -j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00000ffc00133bc0.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService$$Lambda+0x00000ffc00136d10.accept(Ljava/lang/Object;)V+4 -j java.util.ArrayList.forEach(Ljava/util/function/Consumer;)V+46 java.base@22.0.1 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(Ljava/util/List;)V+6 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+116 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00000ffc00136220.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00000ffc00136000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 -j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00000ffc00133bc0.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService$$Lambda+0x00000ffc00136d10.accept(Ljava/lang/Object;)V+4 -j java.util.ArrayList.forEach(Ljava/util/function/Consumer;)V+46 java.base@22.0.1 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(Ljava/util/List;)V+6 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+116 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00000ffc00136220.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00000ffc00136000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 -j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00000ffc00133bc0.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(Lorg/junit/platform/engine/support/hierarchical/HierarchicalTestExecutorService$TestTask;)Ljava/util/concurrent/Future;+1 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute()Ljava/util/concurrent/Future;+74 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(Lorg/junit/platform/engine/ExecutionRequest;)V+31 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/engine/TestDescriptor;Lorg/junit/platform/engine/EngineExecutionListener;Lorg/junit/platform/engine/ConfigurationParameters;Lorg/junit/platform/engine/TestEngine;)V+24 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/LauncherDiscoveryResult;Lorg/junit/platform/engine/EngineExecutionListener;)V+115 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;Lorg/junit/platform/engine/EngineExecutionListener;Lorg/junit/platform/launcher/TestExecutionListener;)V+55 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(Lorg/junit/platform/launcher/core/InternalTestPlan;Lorg/junit/platform/launcher/TestExecutionListener;)V+6 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator$$Lambda+0x00000ffc00120000.accept(Ljava/lang/Object;)V+12 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(Lorg/junit/platform/engine/ConfigurationParameters;Lorg/junit/platform/launcher/core/ListenerRegistry;Ljava/util/function/Consumer;)V+51 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;[Lorg/junit/platform/launcher/TestExecutionListener;)V+23 -j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;[Lorg/junit/platform/launcher/TestExecutionListener;)V+6 -j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+34 -j org.junit.platform.launcher.core.DelegatingLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+6 -j org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+13 -j com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs([Ljava/lang/String;Ljava/lang/String;IZ)I+203 -j com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(Z)I+17 -j com.intellij.rt.execution.junit.TestsRepeater.repeat(IZLcom/intellij/rt/execution/junit/TestsRepeater$TestRun;)I+7 -j com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(Lcom/intellij/rt/junit/IdeaTestRunner;[Ljava/lang/String;Ljava/util/ArrayList;Ljava/lang/String;IZ)I+25 -j com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart([Ljava/lang/String;Ljava/lang/String;Ljava/util/ArrayList;Ljava/lang/String;)I+117 -j com.intellij.rt.junit.JUnitStarter.main([Ljava/lang/String;)V+97 -v ~StubRoutines::call_stub 0x0000000112680154 -...... -Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) -v ~RuntimeStub::nep_invoker_blob 0x00000001127a650c -j java.lang.invoke.LambdaForm$MH+0x00000ffc001d0400.invoke(Ljava/lang/Object;JJJ)J+12 java.base@22.0.1 -j java.lang.invoke.LambdaForm$MH+0x00000ffc001d3000.invokeExact_MT(Ljava/lang/Object;JJJLjava/lang/Object;)J+23 java.base@22.0.1 -j jdk.internal.foreign.abi.DowncallStub+0x00000ffc001d1000.invoke(Ljava/lang/foreign/SegmentAllocator;Ljava/lang/foreign/MemorySegment;Ljava/lang/foreign/MemorySegment;)Ljava/lang/foreign/MemorySegment;+69 java.base@22.0.1 -j java.lang.invoke.LambdaForm$DMH+0x00000ffc001d1400.invokeStaticInit(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+14 java.base@22.0.1 -j java.lang.invoke.LambdaForm$MH+0x00000ffc001d2400.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+44 java.base@22.0.1 -j java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+19 java.base@22.0.1 -j dev.diplomattest.somelib.ntv.somelib_h.Float64Vec_new_isize(Ljava/lang/foreign/MemorySegment;)Ljava/lang/foreign/MemorySegment;+26 -j dev.diplomattest.somelib.Float64Vec.newIsize([J)Ldev/diplomattest/somelib/Float64Vec;+38 -j dev.diplomattest.somelib.Float64VecTest.testFloat64Vec()V+53 -j java.lang.invoke.LambdaForm$DMH+0x00000ffc00140c00.invokeVirtual(Ljava/lang/Object;Ljava/lang/Object;)V+10 java.base@22.0.1 -j java.lang.invoke.LambdaForm$MH+0x00000ffc00148400.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+31 java.base@22.0.1 -j java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+19 java.base@22.0.1 -j jdk.internal.reflect.DirectMethodHandleAccessor.invokeImpl(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+41 java.base@22.0.1 -j jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+23 java.base@22.0.1 -j java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+102 java.base@22.0.1 -j org.junit.platform.commons.util.ReflectionUtils.invokeMethod(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+42 -j org.junit.jupiter.engine.execution.MethodInvocation.proceed()Ljava/lang/Object;+16 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed()Ljava/lang/Object;+8 -j org.junit.jupiter.engine.extension.TimeoutExtension.intercept(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/TimeoutDuration;Lorg/junit/jupiter/engine/extension/TimeoutExtension$TimeoutProvider;)Ljava/lang/Object;+28 -j org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/TimeoutExtension$TimeoutProvider;)Ljava/lang/Object;+31 -j org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)V+9 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda+0x00000ffc00117998.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)V+5 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall$VoidMethodInterceptorCall;Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)Ljava/lang/Void;+6 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall$$Lambda+0x00000ffc00117da8.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)Ljava/lang/Object;+9 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+6 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$$Lambda+0x00000ffc001465f0.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+14 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed()Ljava/lang/Object;+12 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+1 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/engine/execution/InvocationInterceptorChain$InterceptorCall;Ljava/util/List;)Ljava/lang/Object;+24 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InvocationInterceptorChain$InterceptorCall;)Ljava/lang/Object;+31 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;)Ljava/lang/Object;+15 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(Ljava/lang/reflect/Method;Ljava/lang/Object;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;)Ljava/lang/Object;+55 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;)V+28 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda+0x00000ffc00142aa8.execute()V+12 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)V+21 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;+44 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;+6 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+79 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00000ffc00136220.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00000ffc00136000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 -j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00000ffc00133bc0.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService$$Lambda+0x00000ffc00136d10.accept(Ljava/lang/Object;)V+4 -j java.util.ArrayList.forEach(Ljava/util/function/Consumer;)V+46 java.base@22.0.1 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(Ljava/util/List;)V+6 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+116 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00000ffc00136220.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00000ffc00136000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 -j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00000ffc00133bc0.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService$$Lambda+0x00000ffc00136d10.accept(Ljava/lang/Object;)V+4 -j java.util.ArrayList.forEach(Ljava/util/function/Consumer;)V+46 java.base@22.0.1 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(Ljava/util/List;)V+6 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+116 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00000ffc00136220.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00000ffc00136000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 -j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00000ffc00133bc0.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(Lorg/junit/platform/engine/support/hierarchical/HierarchicalTestExecutorService$TestTask;)Ljava/util/concurrent/Future;+1 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute()Ljava/util/concurrent/Future;+74 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(Lorg/junit/platform/engine/ExecutionRequest;)V+31 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/engine/TestDescriptor;Lorg/junit/platform/engine/EngineExecutionListener;Lorg/junit/platform/engine/ConfigurationParameters;Lorg/junit/platform/engine/TestEngine;)V+24 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/LauncherDiscoveryResult;Lorg/junit/platform/engine/EngineExecutionListener;)V+115 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;Lorg/junit/platform/engine/EngineExecutionListener;Lorg/junit/platform/launcher/TestExecutionListener;)V+55 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(Lorg/junit/platform/launcher/core/InternalTestPlan;Lorg/junit/platform/launcher/TestExecutionListener;)V+6 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator$$Lambda+0x00000ffc00120000.accept(Ljava/lang/Object;)V+12 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(Lorg/junit/platform/engine/ConfigurationParameters;Lorg/junit/platform/launcher/core/ListenerRegistry;Ljava/util/function/Consumer;)V+51 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;[Lorg/junit/platform/launcher/TestExecutionListener;)V+23 -j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;[Lorg/junit/platform/launcher/TestExecutionListener;)V+6 -j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+34 -j org.junit.platform.launcher.core.DelegatingLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+6 -j org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+13 -j com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs([Ljava/lang/String;Ljava/lang/String;IZ)I+203 -j com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(Z)I+17 -j com.intellij.rt.execution.junit.TestsRepeater.repeat(IZLcom/intellij/rt/execution/junit/TestsRepeater$TestRun;)I+7 -j com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(Lcom/intellij/rt/junit/IdeaTestRunner;[Ljava/lang/String;Ljava/util/ArrayList;Ljava/lang/String;IZ)I+25 -j com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart([Ljava/lang/String;Ljava/lang/String;Ljava/util/ArrayList;Ljava/lang/String;)I+117 -j com.intellij.rt.junit.JUnitStarter.main([Ljava/lang/String;)V+97 -v ~StubRoutines::call_stub 0x0000000112680154 - -siginfo: si_signo: 11 (SIGSEGV), si_code: 2 (SEGV_ACCERR), si_addr: 0x0000000000000001 - -Registers: - x0=0x0000600001d51680 x1=0x00000000cf0f8969 x2=0x0000000000000010 x3=0x0000000000000000 - x4=0x0000000000000002 x5=0x0000000000001680 x6=0x0000600001d51680 x7=0x0000000000000eb0 - x8=0x0000000000000000 x9=0x0000000000000000 x10=0x00003cf8d0890000 x11=0x0000000000000010 -x12=0x0000600001d6d474 x13=0x00000000001ff800 x14=0x00000000000007fb x15=0x00000000cf0f8969 -x16=0x0000000000000168 x17=0x00000000cf2f87fb x18=0x0000000000000000 x19=0x0000000000000010 -x20=0x0000000000000002 x21=0x0000600001d51680 x22=0x0000000101a04141 x23=0x0000000000000001 -x24=0x000000016fc6b9b8 x25=0x00000000fd948000 x26=0x0000000122d1fc08 x27=0x0000000000000000 -x28=0x0000000131818400 fp=0x000000016fc6b8a0 lr=0x00000001019b9a7c sp=0x000000016fc6b870 -pc=0x00000001019b9aec cpsr=0x0000000080001000 - -Register to memory mapping: - -x0 =0x0000600001d51680 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00 -x1 =0x00000000cf0f8969 is an unknown value -x2 =0x0000000000000010 is an unknown value -x3 =0x0 is null -x4 =0x0000000000000002 is an unknown value -x5 =0x0000000000001680 is an unknown value -x6 =0x0000600001d51680 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00 -x7 =0x0000000000000eb0 is an unknown value -x8 =0x0 is null -x9 =0x0 is null -x10=0x00003cf8d0890000 is an unknown value -x11=0x0000000000000010 is an unknown value -x12=0x0000600001d6d474 points into unknown readable memory: fb 87 2f cf -x13=0x00000000001ff800 is an unknown value -x14=0x00000000000007fb is an unknown value -x15=0x00000000cf0f8969 is an unknown value -x16=0x0000000000000168 is an unknown value -x17=0x00000000cf2f87fb is an unknown value -x18=0x0 is null -x19=0x0000000000000010 is an unknown value -x20=0x0000000000000002 is an unknown value -x21=0x0000600001d51680 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00 -x22=0x0000000101a04141: __rust_no_alloc_shim_is_unstable+0 in /Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/libsomelib.dylib at 0x00000001019b4000 -x23=0x0000000000000001 is an unknown value -x24=0x000000016fc6b9b8 is pointing into the stack for thread: 0x0000000131818400 -x25=0x00000000fd948000 is an unknown value -x26=0x0000000122d1fc08 is pointing into metadata -x27=0x0 is null -x28=0x0000000131818400 is a thread - fp=0x000000016fc6b8a0 is pointing into the stack for thread: 0x0000000131818400 - lr=0x00000001019b9a7c: Float64Vec_new_isize+0x44 in /Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/libsomelib.dylib at 0x00000001019b4000 - sp=0x000000016fc6b870 is pointing into the stack for thread: 0x0000000131818400 - -Top of Stack: (sp=0x000000016fc6b870) -0x000000016fc6b870: 000000016fc6b9b8 000000070eb0b188 -0x000000016fc6b880: 0000000122d1fa54 00000001028092b0 -0x000000016fc6b890: 000000016fc6b8e8 000000016fc6b8d0 -0x000000016fc6b8a0: 000000016fc6b8c0 00000001127a653c -0x000000016fc6b8b0: 000000016fc6b970 a51d000112699844 -0x000000016fc6b8c0: 000000016fc6b970 00000001126857a8 -0x000000016fc6b8d0: 000000070e6cdad8 fffffffffffffff2 -0x000000016fc6b8e0: 0000000000000000 000000070e600220 -0x000000016fc6b8f0: 0000000000000002 0000000000000000 -0x000000016fc6b900: 0000000000000001 0000000000000000 -0x000000016fc6b910: 00000001019b9a38 0000000000000000 -0x000000016fc6b920: fffffffffffffff6 0000000122d1fa54 -0x000000016fc6b930: 0000000000000009 0000000122d1fc08 -0x000000016fc6b940: 000000070e6200b8 ffffffffffffffec -0x000000016fc6b950: 0000000000000000 0000000122d1fa60 -0x000000016fc6b960: ffffffffffffffef 000000016fc6b970 -0x000000016fc6b970: 000000016fc6ba10 00000001126857a8 -0x000000016fc6b980: 000000070e600220 0000000000000002 -0x000000016fc6b990: 0000000000000000 0000000000000001 -0x000000016fc6b9a0: 0000000000000000 00000001019b9a38 -0x000000016fc6b9b0: 0000000000000000 000000070e600110 -0x000000016fc6b9c0: fffffffffffffff6 0000000122d2529f -0x000000016fc6b9d0: 0000000000000009 0000000122d25470 -0x000000016fc6b9e0: 000000070ff2c2c8 ffffffffffffffec -0x000000016fc6b9f0: 0000000000000000 0000000122d252b0 -0x000000016fc6ba00: ffffffffffffffef 000000016fc6ba10 -0x000000016fc6ba10: 000000016fc6bab0 00000001126857a8 -0x000000016fc6ba20: 000000070e6001f8 0000000000000002 -0x000000016fc6ba30: 0000000000000000 0000000000000001 -0x000000016fc6ba40: 0000000000000000 00000001019b9a38 -0x000000016fc6ba50: 0000000000000000 000000070e600110 -0x000000016fc6ba60: fffffffffffffff6 0000000122d21465 - -Instructions: (pc=0x00000001019b9aec) -0x00000001019b99ec: f6 57 41 a9 f8 5f c4 a8 c0 03 5f d6 00 01 80 52 -0x00000001019b99fc: 01 03 80 52 c7 d9 00 94 20 00 20 d4 16 00 80 d2 -0x00000001019b9a0c: e0 03 16 aa e1 03 15 aa bd d9 00 94 f5 03 00 aa -0x00000001019b9a1c: b3 00 00 b4 61 f2 7d d3 e0 03 14 aa 02 01 80 52 -0x00000001019b9a2c: 3a 03 00 94 e0 03 15 aa 54 db 00 94 f8 5f bc a9 -0x00000001019b9a3c: f6 57 01 a9 f4 4f 02 a9 fd 7b 03 a9 fd c3 00 91 -0x00000001019b9a4c: f4 03 01 aa 15 01 80 52 3f 00 00 f1 b7 02 80 9a -0x00000001019b9a5c: 33 f0 7d d3 56 02 00 f0 d6 06 05 91 e1 04 00 b4 -0x00000001019b9a6c: df 02 40 39 e0 03 13 aa 01 01 80 52 26 03 00 94 -0x00000001019b9a7c: 40 06 00 b4 f5 03 00 aa 08 00 80 d2 9f 22 00 f1 -0x00000001019b9a8c: e3 02 00 54 a9 02 17 cb 3f 01 01 f1 83 02 00 54 -0x00000001019b9a9c: 09 00 80 d2 88 f2 7d 92 ea 82 00 91 eb 03 08 aa -0x00000001019b9aac: 4c 01 09 8b 80 05 7f ad 82 0d 40 ad 00 d8 61 4e -0x00000001019b9abc: 21 d8 61 4e 42 d8 61 4e 63 d8 61 4e ac 02 09 8b -0x00000001019b9acc: 80 05 00 ad 82 0d 01 ad 29 01 01 91 6b 21 00 f1 -0x00000001019b9adc: 81 fe ff 54 1f 01 14 eb 00 01 00 54 09 f1 7d d3 -0x00000001019b9aec: e0 6a 69 fc 00 d8 61 5e a0 6a 29 fc 08 05 00 91 -0x00000001019b9afc: 9f 02 08 eb 41 ff ff 54 df 02 40 39 00 03 80 52 -0x00000001019b9b0c: 01 01 80 52 00 03 00 94 00 01 00 b4 14 54 00 a9 -0x00000001019b9b1c: 14 08 00 f9 fd 7b 43 a9 f4 4f 42 a9 f6 57 41 a9 -0x00000001019b9b2c: f8 5f c4 a8 c0 03 5f d6 00 01 80 52 01 03 80 52 -0x00000001019b9b3c: 78 d9 00 94 20 00 20 d4 00 01 80 52 e1 03 13 aa -0x00000001019b9b4c: 6f d9 00 94 f6 03 00 aa b4 00 00 b4 e0 03 15 aa -0x00000001019b9b5c: e1 03 13 aa 02 01 80 52 ec 02 00 94 e0 03 16 aa -0x00000001019b9b6c: 06 db 00 94 f8 5f bc a9 f6 57 01 a9 f4 4f 02 a9 -0x00000001019b9b7c: fd 7b 03 a9 fd c3 00 91 f4 03 01 aa 15 01 80 52 -0x00000001019b9b8c: 3f 00 00 f1 b7 02 80 9a 33 f0 7d d3 56 02 00 f0 -0x00000001019b9b9c: d6 06 05 91 e1 04 00 b4 df 02 40 39 e0 03 13 aa -0x00000001019b9bac: 01 01 80 52 d8 02 00 94 40 06 00 b4 f5 03 00 aa -0x00000001019b9bbc: 08 00 80 d2 9f 22 00 f1 e3 02 00 54 a9 02 17 cb -0x00000001019b9bcc: 3f 01 01 f1 83 02 00 54 09 00 80 d2 88 f2 7d 92 -0x00000001019b9bdc: ea 82 00 91 eb 03 08 aa 4c 01 09 8b 80 05 7f ad - - -Stack slot to memory mapping: - -stack at sp + 0 slots: 0x000000016fc6b9b8 is pointing into the stack for thread: 0x0000000131818400 -stack at sp + 1 slots: 0x000000070eb0b188 is an oop: jdk.internal.org.objectweb.asm.SymbolTable$Entry -{0x000000070eb0b188} - klass: 'jdk/internal/org/objectweb/asm/SymbolTable$Entry' - - ---- fields (total size 7 words): - - final 'index' 'I' @12 45 (0x0000002d) - - final 'data' 'J' @16 0 (0x0000000000000000) - - final 'tag' 'I' @24 1 (0x00000001) - - 'info' 'I' @28 0 (0x00000000) - - final 'owner' 'Ljava/lang/String;' @32 null (0x00000000) - - final 'name' 'Ljava/lang/String;' @36 null (0x00000000) - - final 'value' 'Ljava/lang/String;' @40 "SourceFile"{0x000000070fe74df0} (0xe1fce9be) - - final 'hashCode' 'I' @44 881600600 (0x348c2858) - - 'next' 'Ljdk/internal/org/objectweb/asm/SymbolTable$Entry;' @48 null (0x00000000) -stack at sp + 2 slots: 0x0000000122d1fa54 is pointing into metadata -stack at sp + 3 slots: 0x00000001028092b0: _ZN19TemplateInterpreter13_active_tableE+0 in /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/server/libjvm.dylib at 0x0000000101ab4000 -stack at sp + 4 slots: 0x000000016fc6b8e8 is pointing into the stack for thread: 0x0000000131818400 -stack at sp + 5 slots: 0x000000016fc6b8d0 is pointing into the stack for thread: 0x0000000131818400 -stack at sp + 6 slots: 0x000000016fc6b8c0 is pointing into the stack for thread: 0x0000000131818400 -stack at sp + 7 slots: 0x00000001127a653c is at code_begin+60 in -[CodeBlob (0x00000001127a6490)] -Framesize: 4 -Runtime Stub (0x00000001127a6490): nep_invoker_blob --------------------------------------------------------------------------------- -Decoding CodeBlob, name: nep_invoker_blob, at [0x00000001127a6500, 0x00000001127a65d0] 208 bytes -[MachCode] - 0x00000001127a6500: fd7b bfa9 | fd03 0091 | bf43 00d1 | 0900 0010 | 89d7 01f9 | e903 0091 | 89d3 01f9 | 9ddb 01f9 - 0x00000001127a6520: e903 7eb2 | 8a53 1191 | 49fd 9f88 | e903 01aa | e103 03aa | e003 02aa | 2001 3fd6 | a900 80d2 - 0x00000001127a6540: 8957 04b9 | bf3b 03d5 | 8963 1191 | 29fd dfc8 | bf03 09eb | e801 0054 | 8953 44b9 | a901 0035 - 0x00000001127a6560: e903 7db2 | 8a53 1191 | 49fd 9f88 | 8943 5339 | 3f09 0071 | e001 0054 | 9fd3 01f9 | 9fdb 01f9 - 0x00000001127a6580: 9fd7 01f9 | bf03 0091 | fd7b c1a8 | c003 5fd6 | e003 00f9 | e003 1caa | 897d 94d2 | e93e a0f2 - 0x00000001127a65a0: 2900 c0f2 | 2001 3fd6 | e003 40f9 | edff ff17 | e003 00f9 | 0919 8dd2 | 0947 a0f2 | 2900 c0f2 - 0x00000001127a65c0: 2001 3fd6 | e003 40f9 | ecff ff17 | 0000 0000 -[/MachCode] --------------------------------------------------------------------------------- - --------------------------------------------------------------------------------- -Decoding CodeBlob, name: nep_invoker_blob, at [0x00000001127a6500, 0x00000001127a65d0] 208 bytes -[MachCode] - 0x00000001127a6500: fd7b bfa9 | fd03 0091 | bf43 00d1 | 0900 0010 | 89d7 01f9 | e903 0091 | 89d3 01f9 | 9ddb 01f9 - 0x00000001127a6520: e903 7eb2 | 8a53 1191 | 49fd 9f88 | e903 01aa | e103 03aa | e003 02aa | 2001 3fd6 | a900 80d2 - 0x00000001127a6540: 8957 04b9 | bf3b 03d5 | 8963 1191 | 29fd dfc8 | bf03 09eb | e801 0054 | 8953 44b9 | a901 0035 - 0x00000001127a6560: e903 7db2 | 8a53 1191 | 49fd 9f88 | 8943 5339 | 3f09 0071 | e001 0054 | 9fd3 01f9 | 9fdb 01f9 - 0x00000001127a6580: 9fd7 01f9 | bf03 0091 | fd7b c1a8 | c003 5fd6 | e003 00f9 | e003 1caa | 897d 94d2 | e93e a0f2 - 0x00000001127a65a0: 2900 c0f2 | 2001 3fd6 | e003 40f9 | edff ff17 | e003 00f9 | 0919 8dd2 | 0947 a0f2 | 2900 c0f2 - 0x00000001127a65c0: 2001 3fd6 | e003 40f9 | ecff ff17 | 0000 0000 -[/MachCode] --------------------------------------------------------------------------------- - - ---------------- P R O C E S S --------------- - -Threads class SMR info: -_java_thread_list=0x0000600001f62400, length=13, elements={ -0x0000000131818400, 0x0000000120810800, 0x0000000120812000, 0x0000000142009a00, -0x000000014200a200, 0x0000000142017000, 0x0000000142017800, 0x0000000142018000, -0x0000000142038800, 0x00000001420b2e00, 0x00000001420b3600, 0x00000001420b3e00, -0x000000014180e600 -} - -Java Threads: ( => current thread ) -=>0x0000000131818400 JavaThread "main" [_thread_in_native, id=10499, stack(0x000000016fa6c000,0x000000016fc6f000) (2060K)] - 0x0000000120810800 JavaThread "Reference Handler" daemon [_thread_blocked, id=28675, stack(0x0000000170be4000,0x0000000170de7000) (2060K)] - 0x0000000120812000 JavaThread "Finalizer" daemon [_thread_blocked, id=28419, stack(0x0000000170df0000,0x0000000170ff3000) (2060K)] - 0x0000000142009a00 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=24067, stack(0x0000000170ffc000,0x00000001711ff000) (2060K)] - 0x000000014200a200 JavaThread "Service Thread" daemon [_thread_blocked, id=24579, stack(0x0000000171208000,0x000000017140b000) (2060K)] - 0x0000000142017000 JavaThread "Monitor Deflation Thread" daemon [_thread_blocked, id=27907, stack(0x0000000171414000,0x0000000171617000) (2060K)] - 0x0000000142017800 JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=25347, stack(0x0000000171620000,0x0000000171823000) (2060K)] - 0x0000000142018000 JavaThread "C1 CompilerThread0" daemon [_thread_in_vm, id=27395, stack(0x000000017182c000,0x0000000171a2f000) (2060K)] - 0x0000000142038800 JavaThread "Common-Cleaner" daemon [_thread_blocked, id=27139, stack(0x0000000171a38000,0x0000000171c3b000) (2060K)] - 0x00000001420b2e00 JavaThread "JDWP Transport Listener: dt_socket" daemon [_thread_blocked, id=25859, stack(0x0000000171c44000,0x0000000171e47000) (2060K)] - 0x00000001420b3600 JavaThread "JDWP Event Helper Thread" daemon [_thread_blocked, id=26371, stack(0x0000000171e50000,0x0000000172053000) (2060K)] - 0x00000001420b3e00 JavaThread "JDWP Command Reader" daemon [_thread_in_native, id=32771, stack(0x000000017205c000,0x000000017225f000) (2060K)] - 0x000000014180e600 JavaThread "Notification Thread" daemon [_thread_blocked, id=33283, stack(0x0000000172268000,0x000000017246b000) (2060K)] -Total: 13 - -Other Threads: - 0x0000000121605040 VMThread "VM Thread" [id=19459, stack(0x00000001708c0000,0x0000000170ac3000) (2060K)] - 0x000000013160b950 WatcherThread "VM Periodic Task Thread" [id=20995, stack(0x00000001706b4000,0x00000001708b7000) (2060K)] - 0x0000000131606f80 WorkerThread "GC Thread#0" [id=14083, stack(0x000000016fc78000,0x000000016fe7b000) (2060K)] - 0x000000014172b590 WorkerThread "GC Thread#1" [id=33539, stack(0x0000000172474000,0x0000000172677000) (2060K)] - 0x000000014172bb00 WorkerThread "GC Thread#2" [id=43011, stack(0x0000000172680000,0x0000000172883000) (2060K)] - 0x000000014172c070 WorkerThread "GC Thread#3" [id=42755, stack(0x000000017288c000,0x0000000172a8f000) (2060K)] - 0x0000000131630bb0 WorkerThread "GC Thread#4" [id=42499, stack(0x0000000172a98000,0x0000000172c9b000) (2060K)] - 0x000000014163a2f0 WorkerThread "GC Thread#5" [id=34819, stack(0x0000000172ca4000,0x0000000172ea7000) (2060K)] - 0x000000014163a690 WorkerThread "GC Thread#6" [id=35075, stack(0x0000000172eb0000,0x00000001730b3000) (2060K)] - 0x000000014163ac00 WorkerThread "GC Thread#7" [id=35587, stack(0x00000001730bc000,0x00000001732bf000) (2060K)] - 0x0000000131607720 ConcurrentGCThread "G1 Main Marker" [id=13571, stack(0x000000016fe84000,0x0000000170087000) (2060K)] - 0x00000001316080a0 WorkerThread "G1 Conc#0" [id=13059, stack(0x0000000170090000,0x0000000170293000) (2060K)] - 0x00000001318a0e00 ConcurrentGCThread "G1 Refine#0" [id=16643, stack(0x000000017029c000,0x000000017049f000) (2060K)] - 0x000000013160a5c0 ConcurrentGCThread "G1 Service" [id=17155, stack(0x00000001704a8000,0x00000001706ab000) (2060K)] -Total: 14 - -Threads with active compile tasks: -C2 CompilerThread0 3063 1240 4 jdk.internal.org.objectweb.asm.SymbolTable::addConstantUtf8Reference (101 bytes) -C1 CompilerThread0 3063 1250 3 jdk.internal.classfile.impl.StackMapGenerator::processBlock (2767 bytes) -Total: 2 - -VM state: not at safepoint (normal execution) - -VM Mutex/Monitor currently owned by a thread: ([mutex/lock_event]) -[0x00000001028727d8] MethodCompileQueue_lock - owner thread: 0x0000000142018000 -[0x0000000102873198] CodeCache_lock - owner thread: 0x0000000142018000 -[0x0000000102873258] Compile_lock - owner thread: 0x0000000142018000 - -Heap address: 0x0000000700000000, size: 4096 MB, Compressed Oops mode: Zero based, Oop shift amount: 3 - -CDS archive(s) not mapped -Compressed class space mapped at: 0x00000ffc00000000-0x00000ffc40000000, reserved size: 1073741824 -Narrow klass base: 0x00000ffc00000000, Narrow klass shift: 0, Narrow klass range: 0x40000000 - -GC Precious Log: - CardTable entry size: 512 - Card Set container configuration: InlinePtr #cards 4 size 8 Array Of Cards #cards 16 size 48 Howl #buckets 8 coarsen threshold 3686 Howl Bitmap #cards 512 size 80 coarsen threshold 460 Card regions per heap region 1 cards per card region 4096 - CPUs: 8 total, 8 available - Memory: 16384M - Large Page Support: Disabled - NUMA Support: Disabled - Compressed Oops: Enabled (Zero based) - Heap Region Size: 2M - Heap Min Capacity: 8M - Heap Initial Capacity: 256M - Heap Max Capacity: 4G - Pre-touch: Disabled - Parallel Workers: 8 - Concurrent Workers: 2 - Concurrent Refinement Workers: 8 - Periodic GC: Disabled - -Heap: - garbage-first heap total reserved 4194304K, committed 262144K, used 2773K [0x0000000700000000, 0x0000000800000000) - region size 2048K, 3 young (6144K), 2 survivors (4096K) - Metaspace used 15174K, committed 15552K, reserved 1114112K - class space used 1680K, committed 1856K, reserved 1048576K - -Heap Regions: E=young(eden), S=young(survivor), O=old, HS=humongous(starts), HC=humongous(continues), CS=collection set, F=free, TAMS=top-at-mark-start, PB=parsable bottom -| 0|0x0000000700000000, 0x0000000700000000, 0x0000000700200000| 0%| F| |TAMS 0x0000000700000000| PB 0x0000000700000000| Untracked | 0 -| 1|0x0000000700200000, 0x0000000700200000, 0x0000000700400000| 0%| F| |TAMS 0x0000000700200000| PB 0x0000000700200000| Untracked | 0 -| 2|0x0000000700400000, 0x0000000700400000, 0x0000000700600000| 0%| F| |TAMS 0x0000000700400000| PB 0x0000000700400000| Untracked | 0 -| 3|0x0000000700600000, 0x0000000700600000, 0x0000000700800000| 0%| F| |TAMS 0x0000000700600000| PB 0x0000000700600000| Untracked | 0 -| 4|0x0000000700800000, 0x0000000700800000, 0x0000000700a00000| 0%| F| |TAMS 0x0000000700800000| PB 0x0000000700800000| Untracked | 0 -| 5|0x0000000700a00000, 0x0000000700a00000, 0x0000000700c00000| 0%| F| |TAMS 0x0000000700a00000| PB 0x0000000700a00000| Untracked | 0 -| 6|0x0000000700c00000, 0x0000000700c00000, 0x0000000700e00000| 0%| F| |TAMS 0x0000000700c00000| PB 0x0000000700c00000| Untracked | 0 -| 7|0x0000000700e00000, 0x0000000700e00000, 0x0000000701000000| 0%| F| |TAMS 0x0000000700e00000| PB 0x0000000700e00000| Untracked | 0 -| 8|0x0000000701000000, 0x0000000701000000, 0x0000000701200000| 0%| F| |TAMS 0x0000000701000000| PB 0x0000000701000000| Untracked | 0 -| 9|0x0000000701200000, 0x0000000701200000, 0x0000000701400000| 0%| F| |TAMS 0x0000000701200000| PB 0x0000000701200000| Untracked | 0 -| 10|0x0000000701400000, 0x0000000701400000, 0x0000000701600000| 0%| F| |TAMS 0x0000000701400000| PB 0x0000000701400000| Untracked | 0 -| 11|0x0000000701600000, 0x0000000701600000, 0x0000000701800000| 0%| F| |TAMS 0x0000000701600000| PB 0x0000000701600000| Untracked | 0 -| 12|0x0000000701800000, 0x0000000701800000, 0x0000000701a00000| 0%| F| |TAMS 0x0000000701800000| PB 0x0000000701800000| Untracked | 0 -| 13|0x0000000701a00000, 0x0000000701a00000, 0x0000000701c00000| 0%| F| |TAMS 0x0000000701a00000| PB 0x0000000701a00000| Untracked | 0 -| 14|0x0000000701c00000, 0x0000000701c00000, 0x0000000701e00000| 0%| F| |TAMS 0x0000000701c00000| PB 0x0000000701c00000| Untracked | 0 -| 15|0x0000000701e00000, 0x0000000701e00000, 0x0000000702000000| 0%| F| |TAMS 0x0000000701e00000| PB 0x0000000701e00000| Untracked | 0 -| 16|0x0000000702000000, 0x0000000702000000, 0x0000000702200000| 0%| F| |TAMS 0x0000000702000000| PB 0x0000000702000000| Untracked | 0 -| 17|0x0000000702200000, 0x0000000702200000, 0x0000000702400000| 0%| F| |TAMS 0x0000000702200000| PB 0x0000000702200000| Untracked | 0 -| 18|0x0000000702400000, 0x0000000702400000, 0x0000000702600000| 0%| F| |TAMS 0x0000000702400000| PB 0x0000000702400000| Untracked | 0 -| 19|0x0000000702600000, 0x0000000702600000, 0x0000000702800000| 0%| F| |TAMS 0x0000000702600000| PB 0x0000000702600000| Untracked | 0 -| 20|0x0000000702800000, 0x0000000702800000, 0x0000000702a00000| 0%| F| |TAMS 0x0000000702800000| PB 0x0000000702800000| Untracked | 0 -| 21|0x0000000702a00000, 0x0000000702a00000, 0x0000000702c00000| 0%| F| |TAMS 0x0000000702a00000| PB 0x0000000702a00000| Untracked | 0 -| 22|0x0000000702c00000, 0x0000000702c00000, 0x0000000702e00000| 0%| F| |TAMS 0x0000000702c00000| PB 0x0000000702c00000| Untracked | 0 -| 23|0x0000000702e00000, 0x0000000702e00000, 0x0000000703000000| 0%| F| |TAMS 0x0000000702e00000| PB 0x0000000702e00000| Untracked | 0 -| 24|0x0000000703000000, 0x0000000703000000, 0x0000000703200000| 0%| F| |TAMS 0x0000000703000000| PB 0x0000000703000000| Untracked | 0 -| 25|0x0000000703200000, 0x0000000703200000, 0x0000000703400000| 0%| F| |TAMS 0x0000000703200000| PB 0x0000000703200000| Untracked | 0 -| 26|0x0000000703400000, 0x0000000703400000, 0x0000000703600000| 0%| F| |TAMS 0x0000000703400000| PB 0x0000000703400000| Untracked | 0 -| 27|0x0000000703600000, 0x0000000703600000, 0x0000000703800000| 0%| F| |TAMS 0x0000000703600000| PB 0x0000000703600000| Untracked | 0 -| 28|0x0000000703800000, 0x0000000703800000, 0x0000000703a00000| 0%| F| |TAMS 0x0000000703800000| PB 0x0000000703800000| Untracked | 0 -| 29|0x0000000703a00000, 0x0000000703a00000, 0x0000000703c00000| 0%| F| |TAMS 0x0000000703a00000| PB 0x0000000703a00000| Untracked | 0 -| 30|0x0000000703c00000, 0x0000000703c00000, 0x0000000703e00000| 0%| F| |TAMS 0x0000000703c00000| PB 0x0000000703c00000| Untracked | 0 -| 31|0x0000000703e00000, 0x0000000703e00000, 0x0000000704000000| 0%| F| |TAMS 0x0000000703e00000| PB 0x0000000703e00000| Untracked | 0 -| 32|0x0000000704000000, 0x0000000704000000, 0x0000000704200000| 0%| F| |TAMS 0x0000000704000000| PB 0x0000000704000000| Untracked | 0 -| 33|0x0000000704200000, 0x0000000704200000, 0x0000000704400000| 0%| F| |TAMS 0x0000000704200000| PB 0x0000000704200000| Untracked | 0 -| 34|0x0000000704400000, 0x0000000704400000, 0x0000000704600000| 0%| F| |TAMS 0x0000000704400000| PB 0x0000000704400000| Untracked | 0 -| 35|0x0000000704600000, 0x0000000704600000, 0x0000000704800000| 0%| F| |TAMS 0x0000000704600000| PB 0x0000000704600000| Untracked | 0 -| 36|0x0000000704800000, 0x0000000704800000, 0x0000000704a00000| 0%| F| |TAMS 0x0000000704800000| PB 0x0000000704800000| Untracked | 0 -| 37|0x0000000704a00000, 0x0000000704a00000, 0x0000000704c00000| 0%| F| |TAMS 0x0000000704a00000| PB 0x0000000704a00000| Untracked | 0 -| 38|0x0000000704c00000, 0x0000000704c00000, 0x0000000704e00000| 0%| F| |TAMS 0x0000000704c00000| PB 0x0000000704c00000| Untracked | 0 -| 39|0x0000000704e00000, 0x0000000704e00000, 0x0000000705000000| 0%| F| |TAMS 0x0000000704e00000| PB 0x0000000704e00000| Untracked | 0 -| 40|0x0000000705000000, 0x0000000705000000, 0x0000000705200000| 0%| F| |TAMS 0x0000000705000000| PB 0x0000000705000000| Untracked | 0 -| 41|0x0000000705200000, 0x0000000705200000, 0x0000000705400000| 0%| F| |TAMS 0x0000000705200000| PB 0x0000000705200000| Untracked | 0 -| 42|0x0000000705400000, 0x0000000705400000, 0x0000000705600000| 0%| F| |TAMS 0x0000000705400000| PB 0x0000000705400000| Untracked | 0 -| 43|0x0000000705600000, 0x0000000705600000, 0x0000000705800000| 0%| F| |TAMS 0x0000000705600000| PB 0x0000000705600000| Untracked | 0 -| 44|0x0000000705800000, 0x0000000705800000, 0x0000000705a00000| 0%| F| |TAMS 0x0000000705800000| PB 0x0000000705800000| Untracked | 0 -| 45|0x0000000705a00000, 0x0000000705a00000, 0x0000000705c00000| 0%| F| |TAMS 0x0000000705a00000| PB 0x0000000705a00000| Untracked | 0 -| 46|0x0000000705c00000, 0x0000000705c00000, 0x0000000705e00000| 0%| F| |TAMS 0x0000000705c00000| PB 0x0000000705c00000| Untracked | 0 -| 47|0x0000000705e00000, 0x0000000705e00000, 0x0000000706000000| 0%| F| |TAMS 0x0000000705e00000| PB 0x0000000705e00000| Untracked | 0 -| 48|0x0000000706000000, 0x0000000706000000, 0x0000000706200000| 0%| F| |TAMS 0x0000000706000000| PB 0x0000000706000000| Untracked | 0 -| 49|0x0000000706200000, 0x0000000706200000, 0x0000000706400000| 0%| F| |TAMS 0x0000000706200000| PB 0x0000000706200000| Untracked | 0 -| 50|0x0000000706400000, 0x0000000706400000, 0x0000000706600000| 0%| F| |TAMS 0x0000000706400000| PB 0x0000000706400000| Untracked | 0 -| 51|0x0000000706600000, 0x0000000706600000, 0x0000000706800000| 0%| F| |TAMS 0x0000000706600000| PB 0x0000000706600000| Untracked | 0 -| 52|0x0000000706800000, 0x0000000706800000, 0x0000000706a00000| 0%| F| |TAMS 0x0000000706800000| PB 0x0000000706800000| Untracked | 0 -| 53|0x0000000706a00000, 0x0000000706a00000, 0x0000000706c00000| 0%| F| |TAMS 0x0000000706a00000| PB 0x0000000706a00000| Untracked | 0 -| 54|0x0000000706c00000, 0x0000000706c00000, 0x0000000706e00000| 0%| F| |TAMS 0x0000000706c00000| PB 0x0000000706c00000| Untracked | 0 -| 55|0x0000000706e00000, 0x0000000706e00000, 0x0000000707000000| 0%| F| |TAMS 0x0000000706e00000| PB 0x0000000706e00000| Untracked | 0 -| 56|0x0000000707000000, 0x0000000707000000, 0x0000000707200000| 0%| F| |TAMS 0x0000000707000000| PB 0x0000000707000000| Untracked | 0 -| 57|0x0000000707200000, 0x0000000707200000, 0x0000000707400000| 0%| F| |TAMS 0x0000000707200000| PB 0x0000000707200000| Untracked | 0 -| 58|0x0000000707400000, 0x0000000707400000, 0x0000000707600000| 0%| F| |TAMS 0x0000000707400000| PB 0x0000000707400000| Untracked | 0 -| 59|0x0000000707600000, 0x0000000707600000, 0x0000000707800000| 0%| F| |TAMS 0x0000000707600000| PB 0x0000000707600000| Untracked | 0 -| 60|0x0000000707800000, 0x0000000707800000, 0x0000000707a00000| 0%| F| |TAMS 0x0000000707800000| PB 0x0000000707800000| Untracked | 0 -| 61|0x0000000707a00000, 0x0000000707a00000, 0x0000000707c00000| 0%| F| |TAMS 0x0000000707a00000| PB 0x0000000707a00000| Untracked | 0 -| 62|0x0000000707c00000, 0x0000000707c00000, 0x0000000707e00000| 0%| F| |TAMS 0x0000000707c00000| PB 0x0000000707c00000| Untracked | 0 -| 63|0x0000000707e00000, 0x0000000707e00000, 0x0000000708000000| 0%| F| |TAMS 0x0000000707e00000| PB 0x0000000707e00000| Untracked | 0 -| 64|0x0000000708000000, 0x0000000708000000, 0x0000000708200000| 0%| F| |TAMS 0x0000000708000000| PB 0x0000000708000000| Untracked | 0 -| 65|0x0000000708200000, 0x0000000708200000, 0x0000000708400000| 0%| F| |TAMS 0x0000000708200000| PB 0x0000000708200000| Untracked | 0 -| 66|0x0000000708400000, 0x0000000708400000, 0x0000000708600000| 0%| F| |TAMS 0x0000000708400000| PB 0x0000000708400000| Untracked | 0 -| 67|0x0000000708600000, 0x0000000708600000, 0x0000000708800000| 0%| F| |TAMS 0x0000000708600000| PB 0x0000000708600000| Untracked | 0 -| 68|0x0000000708800000, 0x0000000708800000, 0x0000000708a00000| 0%| F| |TAMS 0x0000000708800000| PB 0x0000000708800000| Untracked | 0 -| 69|0x0000000708a00000, 0x0000000708a00000, 0x0000000708c00000| 0%| F| |TAMS 0x0000000708a00000| PB 0x0000000708a00000| Untracked | 0 -| 70|0x0000000708c00000, 0x0000000708c00000, 0x0000000708e00000| 0%| F| |TAMS 0x0000000708c00000| PB 0x0000000708c00000| Untracked | 0 -| 71|0x0000000708e00000, 0x0000000708e00000, 0x0000000709000000| 0%| F| |TAMS 0x0000000708e00000| PB 0x0000000708e00000| Untracked | 0 -| 72|0x0000000709000000, 0x0000000709000000, 0x0000000709200000| 0%| F| |TAMS 0x0000000709000000| PB 0x0000000709000000| Untracked | 0 -| 73|0x0000000709200000, 0x0000000709200000, 0x0000000709400000| 0%| F| |TAMS 0x0000000709200000| PB 0x0000000709200000| Untracked | 0 -| 74|0x0000000709400000, 0x0000000709400000, 0x0000000709600000| 0%| F| |TAMS 0x0000000709400000| PB 0x0000000709400000| Untracked | 0 -| 75|0x0000000709600000, 0x0000000709600000, 0x0000000709800000| 0%| F| |TAMS 0x0000000709600000| PB 0x0000000709600000| Untracked | 0 -| 76|0x0000000709800000, 0x0000000709800000, 0x0000000709a00000| 0%| F| |TAMS 0x0000000709800000| PB 0x0000000709800000| Untracked | 0 -| 77|0x0000000709a00000, 0x0000000709a00000, 0x0000000709c00000| 0%| F| |TAMS 0x0000000709a00000| PB 0x0000000709a00000| Untracked | 0 -| 78|0x0000000709c00000, 0x0000000709c00000, 0x0000000709e00000| 0%| F| |TAMS 0x0000000709c00000| PB 0x0000000709c00000| Untracked | 0 -| 79|0x0000000709e00000, 0x0000000709e00000, 0x000000070a000000| 0%| F| |TAMS 0x0000000709e00000| PB 0x0000000709e00000| Untracked | 0 -| 80|0x000000070a000000, 0x000000070a000000, 0x000000070a200000| 0%| F| |TAMS 0x000000070a000000| PB 0x000000070a000000| Untracked | 0 -| 81|0x000000070a200000, 0x000000070a200000, 0x000000070a400000| 0%| F| |TAMS 0x000000070a200000| PB 0x000000070a200000| Untracked | 0 -| 82|0x000000070a400000, 0x000000070a400000, 0x000000070a600000| 0%| F| |TAMS 0x000000070a400000| PB 0x000000070a400000| Untracked | 0 -| 83|0x000000070a600000, 0x000000070a600000, 0x000000070a800000| 0%| F| |TAMS 0x000000070a600000| PB 0x000000070a600000| Untracked | 0 -| 84|0x000000070a800000, 0x000000070a800000, 0x000000070aa00000| 0%| F| |TAMS 0x000000070a800000| PB 0x000000070a800000| Untracked | 0 -| 85|0x000000070aa00000, 0x000000070aa00000, 0x000000070ac00000| 0%| F| |TAMS 0x000000070aa00000| PB 0x000000070aa00000| Untracked | 0 -| 86|0x000000070ac00000, 0x000000070ac00000, 0x000000070ae00000| 0%| F| |TAMS 0x000000070ac00000| PB 0x000000070ac00000| Untracked | 0 -| 87|0x000000070ae00000, 0x000000070ae00000, 0x000000070b000000| 0%| F| |TAMS 0x000000070ae00000| PB 0x000000070ae00000| Untracked | 0 -| 88|0x000000070b000000, 0x000000070b000000, 0x000000070b200000| 0%| F| |TAMS 0x000000070b000000| PB 0x000000070b000000| Untracked | 0 -| 89|0x000000070b200000, 0x000000070b200000, 0x000000070b400000| 0%| F| |TAMS 0x000000070b200000| PB 0x000000070b200000| Untracked | 0 -| 90|0x000000070b400000, 0x000000070b400000, 0x000000070b600000| 0%| F| |TAMS 0x000000070b400000| PB 0x000000070b400000| Untracked | 0 -| 91|0x000000070b600000, 0x000000070b600000, 0x000000070b800000| 0%| F| |TAMS 0x000000070b600000| PB 0x000000070b600000| Untracked | 0 -| 92|0x000000070b800000, 0x000000070b800000, 0x000000070ba00000| 0%| F| |TAMS 0x000000070b800000| PB 0x000000070b800000| Untracked | 0 -| 93|0x000000070ba00000, 0x000000070ba00000, 0x000000070bc00000| 0%| F| |TAMS 0x000000070ba00000| PB 0x000000070ba00000| Untracked | 0 -| 94|0x000000070bc00000, 0x000000070bc00000, 0x000000070be00000| 0%| F| |TAMS 0x000000070bc00000| PB 0x000000070bc00000| Untracked | 0 -| 95|0x000000070be00000, 0x000000070be00000, 0x000000070c000000| 0%| F| |TAMS 0x000000070be00000| PB 0x000000070be00000| Untracked | 0 -| 96|0x000000070c000000, 0x000000070c000000, 0x000000070c200000| 0%| F| |TAMS 0x000000070c000000| PB 0x000000070c000000| Untracked | 0 -| 97|0x000000070c200000, 0x000000070c200000, 0x000000070c400000| 0%| F| |TAMS 0x000000070c200000| PB 0x000000070c200000| Untracked | 0 -| 98|0x000000070c400000, 0x000000070c400000, 0x000000070c600000| 0%| F| |TAMS 0x000000070c400000| PB 0x000000070c400000| Untracked | 0 -| 99|0x000000070c600000, 0x000000070c600000, 0x000000070c800000| 0%| F| |TAMS 0x000000070c600000| PB 0x000000070c600000| Untracked | 0 -| 100|0x000000070c800000, 0x000000070c800000, 0x000000070ca00000| 0%| F| |TAMS 0x000000070c800000| PB 0x000000070c800000| Untracked | 0 -| 101|0x000000070ca00000, 0x000000070ca00000, 0x000000070cc00000| 0%| F| |TAMS 0x000000070ca00000| PB 0x000000070ca00000| Untracked | 0 -| 102|0x000000070cc00000, 0x000000070cc00000, 0x000000070ce00000| 0%| F| |TAMS 0x000000070cc00000| PB 0x000000070cc00000| Untracked | 0 -| 103|0x000000070ce00000, 0x000000070ce00000, 0x000000070d000000| 0%| F| |TAMS 0x000000070ce00000| PB 0x000000070ce00000| Untracked | 0 -| 104|0x000000070d000000, 0x000000070d000000, 0x000000070d200000| 0%| F| |TAMS 0x000000070d000000| PB 0x000000070d000000| Untracked | 0 -| 105|0x000000070d200000, 0x000000070d200000, 0x000000070d400000| 0%| F| |TAMS 0x000000070d200000| PB 0x000000070d200000| Untracked | 0 -| 106|0x000000070d400000, 0x000000070d400000, 0x000000070d600000| 0%| F| |TAMS 0x000000070d400000| PB 0x000000070d400000| Untracked | 0 -| 107|0x000000070d600000, 0x000000070d600000, 0x000000070d800000| 0%| F| |TAMS 0x000000070d600000| PB 0x000000070d600000| Untracked | 0 -| 108|0x000000070d800000, 0x000000070d800000, 0x000000070da00000| 0%| F| |TAMS 0x000000070d800000| PB 0x000000070d800000| Untracked | 0 -| 109|0x000000070da00000, 0x000000070da00000, 0x000000070dc00000| 0%| F| |TAMS 0x000000070da00000| PB 0x000000070da00000| Untracked | 0 -| 110|0x000000070dc00000, 0x000000070dc00000, 0x000000070de00000| 0%| F| |TAMS 0x000000070dc00000| PB 0x000000070dc00000| Untracked | 0 -| 111|0x000000070de00000, 0x000000070de00000, 0x000000070e000000| 0%| F| |TAMS 0x000000070de00000| PB 0x000000070de00000| Untracked | 0 -| 112|0x000000070e000000, 0x000000070e000000, 0x000000070e200000| 0%| F| |TAMS 0x000000070e000000| PB 0x000000070e000000| Untracked | 0 -| 113|0x000000070e200000, 0x000000070e200000, 0x000000070e400000| 0%| F| |TAMS 0x000000070e200000| PB 0x000000070e200000| Untracked | 0 -| 114|0x000000070e400000, 0x000000070e4b5528, 0x000000070e600000| 35%| S|CS|TAMS 0x000000070e400000| PB 0x000000070e400000| Complete | 0 -| 115|0x000000070e600000, 0x000000070e800000, 0x000000070e800000|100%| S|CS|TAMS 0x000000070e600000| PB 0x000000070e600000| Complete | 0 -| 116|0x000000070e800000, 0x000000070e800000, 0x000000070ea00000| 0%| F| |TAMS 0x000000070e800000| PB 0x000000070e800000| Untracked | 0 -| 117|0x000000070ea00000, 0x000000070ea00000, 0x000000070ec00000| 0%| F| |TAMS 0x000000070ea00000| PB 0x000000070ea00000| Untracked | 0 -| 118|0x000000070ec00000, 0x000000070ec00000, 0x000000070ee00000| 0%| F| |TAMS 0x000000070ec00000| PB 0x000000070ec00000| Untracked | 0 -| 119|0x000000070ee00000, 0x000000070ee00000, 0x000000070f000000| 0%| F| |TAMS 0x000000070ee00000| PB 0x000000070ee00000| Untracked | 0 -| 120|0x000000070f000000, 0x000000070f000000, 0x000000070f200000| 0%| F| |TAMS 0x000000070f000000| PB 0x000000070f000000| Untracked | 0 -| 121|0x000000070f200000, 0x000000070f200000, 0x000000070f400000| 0%| F| |TAMS 0x000000070f200000| PB 0x000000070f200000| Untracked | 0 -| 122|0x000000070f400000, 0x000000070f400000, 0x000000070f600000| 0%| F| |TAMS 0x000000070f400000| PB 0x000000070f400000| Untracked | 0 -| 123|0x000000070f600000, 0x000000070f600000, 0x000000070f800000| 0%| F| |TAMS 0x000000070f600000| PB 0x000000070f600000| Untracked | 0 -| 124|0x000000070f800000, 0x000000070f800000, 0x000000070fa00000| 0%| F| |TAMS 0x000000070f800000| PB 0x000000070f800000| Untracked | 0 -| 125|0x000000070fa00000, 0x000000070fa00000, 0x000000070fc00000| 0%| F| |TAMS 0x000000070fa00000| PB 0x000000070fa00000| Untracked | 0 -| 126|0x000000070fc00000, 0x000000070fc00000, 0x000000070fe00000| 0%| F| |TAMS 0x000000070fc00000| PB 0x000000070fc00000| Untracked | 0 -| 127|0x000000070fe00000, 0x000000070ff64b80, 0x0000000710000000| 69%| E| |TAMS 0x000000070fe00000| PB 0x000000070fe00000| Complete | 0 - -Card table byte_map: [0x0000000101148000,0x0000000101948000] _byte_map_base: 0x00000000fd948000 - -Marking Bits: (CMBitMap*) 0x0000000131840810 - Bits: [0x000000011a14c000, 0x000000011e14c000) - -Polling page: 0x0000000100434000 - -Metaspace: - -Usage: - Non-class: 13.18 MB used. - Class: 1.64 MB used. - Both: 14.82 MB used. - -Virtual space: - Non-class space: 64.00 MB reserved, 13.38 MB ( 21%) committed, 1 nodes. - Class space: 1.00 GB reserved, 1.81 MB ( <1%) committed, 1 nodes. - Both: 1.06 GB reserved, 15.19 MB ( 1%) committed. - -Chunk freelists: - Non-Class: 2.35 MB - Class: 14.17 MB - Both: 16.53 MB - -MaxMetaspaceSize: unlimited -CompressedClassSpaceSize: 1.00 GB -Initial GC threshold: 21.00 MB -Current GC threshold: 21.00 MB -CDS: off - - commit_granule_bytes: 65536. - - commit_granule_words: 8192. - - virtual_space_node_default_size: 8388608. - - enlarge_chunks_in_place: 1. - - use_allocation_guard: 0. - - -Internal statistics: - -num_allocs_failed_limit: 0. -num_arena_births: 342. -num_arena_deaths: 0. -num_vsnodes_births: 2. -num_vsnodes_deaths: 0. -num_space_committed: 243. -num_space_uncommitted: 0. -num_chunks_returned_to_freelist: 0. -num_chunks_taken_from_freelist: 560. -num_chunk_merges: 0. -num_chunk_splits: 335. -num_chunks_enlarged: 197. -num_inconsistent_stats: 0. - -CodeHeap 'non-profiled nmethods': size=120032Kb used=381Kb max_used=381Kb free=119650Kb - bounds [0x0000000112c14000, 0x0000000112e84000, 0x000000011a14c000] -CodeHeap 'profiled nmethods': size=120016Kb used=2365Kb max_used=2365Kb free=117650Kb - bounds [0x000000010b14c000, 0x000000010b3bc000, 0x0000000112680000] -CodeHeap 'non-nmethods': size=5712Kb used=1356Kb max_used=1368Kb free=4355Kb - bounds [0x0000000112680000, 0x00000001128f0000, 0x0000000112c14000] - total_blobs=1721 nmethods=1245 adapters=383 - compilation: enabled - stopped_count=0, restarted_count=0 - full_count=0 - -Compilation events (20 events): -Event: 3.051 Thread 0x0000000142018000 nmethod 1231 0x000000010b37bd10 code [0x000000010b37bec0, 0x000000010b37c168] -Event: 3.051 Thread 0x0000000142018000 1232 3 java.lang.ref.NativeReferenceQueue::signal (8 bytes) -Event: 3.051 Thread 0x0000000142018000 nmethod 1232 0x000000010b37c290 code [0x000000010b37c440, 0x000000010b37c5c8] -Event: 3.051 Thread 0x0000000142018000 1241 3 java.lang.constant.ConstantUtils::skipOverFieldSignature (296 bytes) -Event: 3.051 Thread 0x0000000142018000 nmethod 1241 0x000000010b37c690 code [0x000000010b37cb80, 0x000000010b37e838] -Event: 3.051 Thread 0x0000000142018000 1242 3 jdk.internal.classfile.impl.DirectCodeBuilder::with (9 bytes) -Event: 3.052 Thread 0x0000000142018000 nmethod 1242 0x000000010b37f310 code [0x000000010b37f540, 0x000000010b37fe10] -Event: 3.052 Thread 0x0000000142018000 1243 3 jdk.internal.classfile.impl.RawBytecodeHelper::isLastBytecode (17 bytes) -Event: 3.052 Thread 0x0000000142018000 nmethod 1243 0x000000010b380090 code [0x000000010b380240, 0x000000010b3803b0] -Event: 3.052 Thread 0x0000000142018000 1216 3 java.lang.invoke.LambdaForm::fixResult (31 bytes) -Event: 3.052 Thread 0x0000000142018000 nmethod 1216 0x000000010b380490 code [0x000000010b380640, 0x000000010b380808] -Event: 3.052 Thread 0x0000000142018000 1245 3 jdk.internal.classfile.impl.SplitConstantPool::map (145 bytes) -Event: 3.052 Thread 0x0000000142018000 nmethod 1245 0x000000010b380910 code [0x000000010b380c00, 0x000000010b381990] -Event: 3.052 Thread 0x0000000142018000 1246 3 jdk.internal.org.objectweb.asm.MethodVisitor::visitInsn (16 bytes) -Event: 3.052 Thread 0x0000000142018000 nmethod 1246 0x000000010b381e10 code [0x000000010b381fc0, 0x000000010b382218] -Event: 3.053 Thread 0x0000000142018000 1248 3 jdk.internal.classfile.impl.AbstractElement:: (5 bytes) -Event: 3.053 Thread 0x0000000142018000 nmethod 1248 0x000000010b382310 code [0x000000010b3824c0, 0x000000010b382638] -Event: 3.054 Thread 0x0000000142018000 1249 1 java.lang.constant.PrimitiveClassDescImpl::descriptorString (5 bytes) -Event: 3.054 Thread 0x0000000142018000 nmethod 1249 0x0000000112c72890 code [0x0000000112c72a00, 0x0000000112c72aa8] -Event: 3.054 Thread 0x0000000142018000 1250 3 jdk.internal.classfile.impl.StackMapGenerator::processBlock (2767 bytes) - -GC Heap History (2 events): -Event: 3.045 GC heap before -{Heap before GC invocations=0 (full 0): - garbage-first heap total reserved 4194304K, committed 262144K, used 22528K [0x0000000700000000, 0x0000000800000000) - region size 2048K, 12 young (24576K), 0 survivors (0K) - Metaspace used 14795K, committed 15104K, reserved 1114112K - class space used 1618K, committed 1792K, reserved 1048576K -} -Event: 3.048 GC heap after -{Heap after GC invocations=1 (full 0): - garbage-first heap total reserved 4194304K, committed 262144K, used 2773K [0x0000000700000000, 0x0000000800000000) - region size 2048K, 2 young (4096K), 2 survivors (4096K) - Metaspace used 14795K, committed 15104K, reserved 1114112K - class space used 1618K, committed 1792K, reserved 1048576K -} - -Dll operation events (8 events): -Event: 0.005 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjava.dylib -Event: 0.006 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libzip.dylib -Event: 0.071 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libinstrument.dylib -Event: 0.080 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libnio.dylib -Event: 0.085 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libzip.dylib -Event: 0.127 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjimage.dylib -Event: 2.995 Loaded shared library libsomelib.dylib -Event: 3.000 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libsyslookup.dylib - -Deoptimization events (20 events): -Event: 0.272 Thread 0x0000000131818400 DEOPT PACKING pc=0x0000000112c31160 sp=0x000000016fc6b350 -Event: 0.272 Thread 0x0000000131818400 DEOPT UNPACKING pc=0x00000001126c301c sp=0x000000016fc6b310 mode 2 -Event: 2.983 Thread 0x0000000131818400 Uncommon trap: trap_request=0xffffff45 fr.pc=0x0000000112c5b820 relative=0x00000000000000e0 -Event: 2.983 Thread 0x0000000131818400 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000112c5b820 method=sun.net.www.ParseUtil.firstEncodeIndex(Ljava/lang/String;)I @ 51 c2 -Event: 2.983 Thread 0x0000000131818400 DEOPT PACKING pc=0x0000000112c5b820 sp=0x000000016fc6a780 -Event: 2.983 Thread 0x0000000131818400 DEOPT UNPACKING pc=0x00000001126c301c sp=0x000000016fc6a700 mode 2 -Event: 3.032 Thread 0x0000000131818400 DEOPT PACKING pc=0x000000010b3333c8 sp=0x000000016fc6a500 -Event: 3.032 Thread 0x0000000131818400 DEOPT UNPACKING pc=0x00000001126c2e7c sp=0x000000016fc6a300 mode 3 -Event: 3.048 Thread 0x0000000131818400 Uncommon trap: trap_request=0xffffff45 fr.pc=0x0000000112c5299c relative=0x000000000000025c -Event: 3.048 Thread 0x0000000131818400 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000112c5299c method=java.util.concurrent.ConcurrentHashMap.get(Ljava/lang/Object;)Ljava/lang/Object; @ 76 c2 -Event: 3.048 Thread 0x0000000131818400 DEOPT PACKING pc=0x0000000112c5299c sp=0x000000016fc69870 -Event: 3.048 Thread 0x0000000131818400 DEOPT UNPACKING pc=0x00000001126c301c sp=0x000000016fc697f0 mode 2 -Event: 3.049 Thread 0x0000000131818400 Uncommon trap: trap_request=0xffffff45 fr.pc=0x0000000112c52fe8 relative=0x00000000000000a8 -Event: 3.049 Thread 0x0000000131818400 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000112c52fe8 method=java.lang.ref.ReferenceQueue.headIsNull()Z @ 4 c2 -Event: 3.049 Thread 0x0000000131818400 DEOPT PACKING pc=0x0000000112c52fe8 sp=0x000000016fc6a0a0 -Event: 3.049 Thread 0x0000000131818400 DEOPT UNPACKING pc=0x00000001126c301c sp=0x000000016fc69f60 mode 2 -Event: 3.049 Thread 0x0000000131818400 Uncommon trap: trap_request=0xffffff45 fr.pc=0x0000000112c554ec relative=0x000000000000006c -Event: 3.049 Thread 0x0000000131818400 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000112c554ec method=java.lang.ref.ReferenceQueue.headIsNull()Z @ 4 c2 -Event: 3.049 Thread 0x0000000131818400 DEOPT PACKING pc=0x0000000112c554ec sp=0x000000016fc6a010 -Event: 3.049 Thread 0x0000000131818400 DEOPT UNPACKING pc=0x00000001126c301c sp=0x000000016fc69f40 mode 2 - -Classes loaded (20 events): -Event: 3.054 Loading class jdk/internal/classfile/impl/BufferedCodeBuilder -Event: 3.054 Loading class jdk/internal/classfile/impl/BufferedCodeBuilder done -Event: 3.054 Loading class jdk/internal/classfile/impl/TransformingCodeBuilder -Event: 3.054 Loading class jdk/internal/classfile/impl/TransformingCodeBuilder done -Event: 3.054 Loading class java/lang/classfile/instruction/ThrowInstruction -Event: 3.055 Loading class java/lang/classfile/instruction/ThrowInstruction done -Event: 3.055 Loading class jdk/internal/classfile/impl/AbstractInstruction$UnboundThrowInstruction -Event: 3.055 Loading class jdk/internal/classfile/impl/AbstractInstruction$UnboundThrowInstruction done -Event: 3.055 Loading class java/lang/classfile/instruction/ExceptionCatch -Event: 3.055 Loading class java/lang/classfile/instruction/ExceptionCatch done -Event: 3.055 Loading class jdk/internal/classfile/impl/AbstractPseudoInstruction$ExceptionCatchImpl -Event: 3.055 Loading class jdk/internal/classfile/impl/AbstractPseudoInstruction -Event: 3.055 Loading class jdk/internal/classfile/impl/AbstractPseudoInstruction done -Event: 3.055 Loading class jdk/internal/classfile/impl/AbstractPseudoInstruction$ExceptionCatchImpl done -Event: 3.055 Loading class jdk/internal/classfile/impl/StackMapGenerator$RawExceptionCatch -Event: 3.055 Loading class jdk/internal/classfile/impl/StackMapGenerator$RawExceptionCatch done -Event: 3.055 Loading class jdk/internal/classfile/impl/SplitConstantPool$1 -Event: 3.055 Loading class jdk/internal/classfile/impl/SplitConstantPool$1 done -Event: 3.056 Loading class java/lang/invoke/ConstantBootstraps -Event: 3.056 Loading class java/lang/invoke/ConstantBootstraps done - -Classes unloaded (0 events): -No events - -Classes redefined (0 events): -No events - -Internal exceptions (20 events): -Event: 3.032 Thread 0x0000000131818400 Exception (0x000000070e87d458) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 3.034 Thread 0x0000000131818400 Exception (0x000000070e8a0820) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 3.034 Thread 0x0000000131818400 Exception (0x000000070e8a4e70) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 3.034 Thread 0x0000000131818400 Exception (0x000000070e8a8a28) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 3.034 Thread 0x0000000131818400 Exception (0x000000070e8b0578) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 3.034 Thread 0x0000000131818400 Exception (0x000000070e8b7550) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 3.034 Thread 0x0000000131818400 Exception (0x000000070e8be520) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 3.034 Thread 0x0000000131818400 Exception (0x000000070e8c2fd8) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 3.035 Thread 0x0000000131818400 Exception (0x000000070e8e12b0) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 3.039 Thread 0x0000000131818400 Exception (0x000000070e92fd70) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 841] -Event: 3.040 Thread 0x0000000131818400 Exception (0x000000070e9468c8) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 3.043 Thread 0x0000000131818400 Exception (0x000000070e9b1470) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 3.043 Thread 0x0000000131818400 Exception (0x000000070e9bc278) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 3.044 Thread 0x0000000131818400 Exception (0x000000070e9cdbb8) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 3.045 Thread 0x0000000131818400 Exception (0x000000070e9ea228) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 3.045 Thread 0x0000000131818400 Exception (0x000000070e9ef6f8) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 3.048 Thread 0x0000000131818400 Exception (0x000000070fe0bcf8) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 3.053 Thread 0x0000000131818400 Exception (0x000000070fe4ba20) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 3.055 Thread 0x0000000131818400 Exception (0x000000070ff0dfe8) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 3.056 Thread 0x0000000131818400 Exception (0x000000070ff22048) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] - -ZGC Phase Switch (0 events): -No events - -VM Operations (20 events): -Event: 0.269 Executing VM operation: ICBufferFull -Event: 0.269 Executing VM operation: ICBufferFull done -Event: 0.271 Executing VM operation: HandshakeAllThreads (Deoptimize) -Event: 0.271 Executing VM operation: HandshakeAllThreads (Deoptimize) done -Event: 0.277 Executing VM operation: get/set locals -Event: 0.277 Executing VM operation: get/set locals done -Event: 0.278 Executing VM operation: get/set locals -Event: 0.278 Executing VM operation: get/set locals done -Event: 2.495 Executing VM operation: get/set locals -Event: 2.495 Executing VM operation: get/set locals done -Event: 2.495 Executing VM operation: get/set locals -Event: 2.495 Executing VM operation: get/set locals done -Event: 2.497 Executing VM operation: get/set locals -Event: 2.497 Executing VM operation: get/set locals done -Event: 2.972 Executing VM operation: ChangeBreakpoints -Event: 2.972 Executing VM operation: ChangeBreakpoints done -Event: 2.973 Executing VM operation: ChangeBreakpoints -Event: 2.973 Executing VM operation: ChangeBreakpoints done -Event: 3.045 Executing VM operation: G1CollectForAllocation (G1 Evacuation Pause) -Event: 3.048 Executing VM operation: G1CollectForAllocation (G1 Evacuation Pause) done - -Events (20 events): -Event: 0.024 Thread 0x0000000142009a00 Thread added: 0x0000000142009a00 -Event: 0.024 Protecting memory [0x0000000170ffc000,0x0000000171008000] with protection modes 0 -Event: 0.024 Thread 0x000000014200a200 Thread added: 0x000000014200a200 -Event: 0.024 Protecting memory [0x0000000171208000,0x0000000171214000] with protection modes 0 -Event: 0.024 Thread 0x0000000142017000 Thread added: 0x0000000142017000 -Event: 0.024 Protecting memory [0x0000000171414000,0x0000000171420000] with protection modes 0 -Event: 0.024 Thread 0x0000000142017800 Thread added: 0x0000000142017800 -Event: 0.024 Protecting memory [0x0000000171620000,0x000000017162c000] with protection modes 0 -Event: 0.024 Thread 0x0000000142018000 Thread added: 0x0000000142018000 -Event: 0.024 Protecting memory [0x000000017182c000,0x0000000171838000] with protection modes 0 -Event: 0.044 Thread 0x0000000142038800 Thread added: 0x0000000142038800 -Event: 0.044 Protecting memory [0x0000000171a38000,0x0000000171a44000] with protection modes 0 -Event: 0.060 Thread 0x00000001420b2e00 Thread added: 0x00000001420b2e00 -Event: 0.060 Protecting memory [0x0000000171c44000,0x0000000171c50000] with protection modes 0 -Event: 0.060 Thread 0x00000001420b3600 Thread added: 0x00000001420b3600 -Event: 0.060 Protecting memory [0x0000000171e50000,0x0000000171e5c000] with protection modes 0 -Event: 0.060 Thread 0x00000001420b3e00 Thread added: 0x00000001420b3e00 -Event: 0.060 Protecting memory [0x000000017205c000,0x0000000172068000] with protection modes 0 -Event: 0.077 Thread 0x000000014180e600 Thread added: 0x000000014180e600 -Event: 0.077 Protecting memory [0x0000000172268000,0x0000000172274000] with protection modes 0 - - -Dynamic libraries: -0x00000001008a8000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjli.dylib -0x00000001a96bb000 /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa -0x0000000192c62000 /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit -0x0000000195cce000 /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData -0x0000000190515000 /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation -0x000000019bfdc000 /usr/lib/libSystem.B.dylib -0x0000000193f9f000 /System/Library/PrivateFrameworks/UIFoundation.framework/Versions/A/UIFoundation -0x000000022ab7f000 /System/Library/PrivateFrameworks/CollectionViewCore.framework/Versions/A/CollectionViewCore -0x00000001a3255000 /System/Library/PrivateFrameworks/RemoteViewServices.framework/Versions/A/RemoteViewServices -0x0000000199e89000 /System/Library/PrivateFrameworks/XCTTargetBootstrap.framework/Versions/A/XCTTargetBootstrap -0x000000019e618000 /System/Library/PrivateFrameworks/InternationalSupport.framework/Versions/A/InternationalSupport -0x000000019e66c000 /System/Library/PrivateFrameworks/UserActivity.framework/Versions/A/UserActivity -0x000000024efd6000 /System/Library/PrivateFrameworks/WindowManagement.framework/Versions/A/WindowManagement -0x0000000190195000 /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration -0x000000019da86000 /usr/lib/libspindump.dylib -0x0000000194154000 /System/Library/Frameworks/UniformTypeIdentifiers.framework/Versions/A/UniformTypeIdentifiers -0x0000000197d00000 /usr/lib/libapp_launch_measurement.dylib -0x0000000197126000 /System/Library/PrivateFrameworks/CoreAnalytics.framework/Versions/A/CoreAnalytics -0x0000000197d07000 /System/Library/PrivateFrameworks/CoreAutoLayout.framework/Versions/A/CoreAutoLayout -0x00000001996a9000 /System/Library/Frameworks/Metal.framework/Versions/A/Metal -0x000000019a631000 /usr/lib/liblangid.dylib -0x0000000199e8f000 /System/Library/PrivateFrameworks/CoreSVG.framework/Versions/A/CoreSVG -0x0000000194b19000 /System/Library/PrivateFrameworks/SkyLight.framework/Versions/A/SkyLight -0x0000000194fba000 /System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics -0x00000001a392f000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate -0x000000019d8e0000 /System/Library/PrivateFrameworks/IconServices.framework/Versions/A/IconServices -0x0000000199687000 /System/Library/Frameworks/IOSurface.framework/Versions/A/IOSurface -0x0000000197155000 /usr/lib/libDiagnosticMessagesClient.dylib -0x000000019bf1e000 /usr/lib/libz.1.dylib -0x00000001a70d4000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices -0x0000000199e71000 /System/Library/PrivateFrameworks/DFRFoundation.framework/Versions/A/DFRFoundation -0x00000001924bc000 /usr/lib/libicucore.A.dylib -0x000000019f676000 /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox -0x000000019e627000 /System/Library/PrivateFrameworks/DataDetectorsCore.framework/Versions/A/DataDetectorsCore -0x00000001b809a000 /System/Library/PrivateFrameworks/TextInput.framework/Versions/A/TextInput -0x0000000194a6a000 /usr/lib/libMobileGestalt.dylib -0x0000000199bad000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox -0x000000019762c000 /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore -0x00000001920e9000 /System/Library/Frameworks/Security.framework/Versions/A/Security -0x00000001a3295000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SpeechRecognition.framework/Versions/A/SpeechRecognition -0x0000000197a2e000 /System/Library/PrivateFrameworks/CoreUI.framework/Versions/A/CoreUI -0x00000001919e2000 /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio -0x0000000197239000 /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration -0x000000019dee2000 /System/Library/PrivateFrameworks/MultitouchSupport.framework/Versions/A/MultitouchSupport -0x0000000194a68000 /usr/lib/libenergytrace.dylib -0x00000001ad793000 /System/Library/PrivateFrameworks/RenderBox.framework/Versions/A/RenderBox -0x0000000192b16000 /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit -0x00000001a366a000 /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices -0x0000000197c8c000 /System/Library/PrivateFrameworks/PerformanceAnalysis.framework/Versions/A/PerformanceAnalysis -0x00000001e603f000 /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL -0x0000000197d51000 /usr/lib/libxml2.2.dylib -0x000000019b360000 /System/Library/PrivateFrameworks/MobileKeyBag.framework/Versions/A/MobileKeyBag -0x000000018ef80000 /usr/lib/libobjc.A.dylib -0x000000018f274000 /usr/lib/libc++.1.dylib -0x00000001a35e7000 /System/Library/Frameworks/Accessibility.framework/Versions/A/Accessibility -0x000000019569a000 /System/Library/Frameworks/ColorSync.framework/Versions/A/ColorSync -0x000000018f3c0000 /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation -0x000000019a1ec000 /System/Library/Frameworks/CoreImage.framework/Versions/A/CoreImage -0x00000001917ed000 /System/Library/Frameworks/CoreText.framework/Versions/A/CoreText -0x00000001ea89e000 /System/Library/Frameworks/CoreTransferable.framework/Versions/A/CoreTransferable -0x00000001ead63000 /System/Library/Frameworks/DeveloperToolsSupport.framework/Versions/A/DeveloperToolsSupport -0x0000000199eca000 /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO -0x0000000224d1f000 /System/Library/Frameworks/Symbols.framework/Versions/A/Symbols -0x000000019bfe2000 /System/Library/PrivateFrameworks/SoftLinking.framework/Versions/A/SoftLinking -0x000000019f028000 /usr/lib/swift/libswiftCore.dylib -0x00000001b4d27000 /usr/lib/swift/libswiftCoreFoundation.dylib -0x00000001b2790000 /usr/lib/swift/libswiftCoreGraphics.dylib -0x00000001b4d71000 /usr/lib/swift/libswiftCoreImage.dylib -0x00000001b2797000 /usr/lib/swift/libswiftDarwin.dylib -0x00000001a4cda000 /usr/lib/swift/libswiftDispatch.dylib -0x00000001b4d72000 /usr/lib/swift/libswiftIOKit.dylib -0x00000001c07cc000 /usr/lib/swift/libswiftMetal.dylib -0x00000001cde91000 /usr/lib/swift/libswiftOSLog.dylib -0x00000001a754f000 /usr/lib/swift/libswiftObjectiveC.dylib -0x00000001c4f00000 /usr/lib/swift/libswiftQuartzCore.dylib -0x00000001c9005000 /usr/lib/swift/libswiftUniformTypeIdentifiers.dylib -0x00000001b4d39000 /usr/lib/swift/libswiftXPC.dylib -0x000000025747d000 /usr/lib/swift/libswift_Concurrency.dylib -0x00000001a7553000 /usr/lib/swift/libswiftos.dylib -0x00000001b7ffe000 /usr/lib/swift/libswiftsimd.dylib -0x000000019c191000 /usr/lib/libcompression.dylib -0x000000019e572000 /System/Library/PrivateFrameworks/TextureIO.framework/Versions/A/TextureIO -0x000000019d58c000 /usr/lib/libate.dylib -0x000000019bfd6000 /usr/lib/system/libcache.dylib -0x000000019bf90000 /usr/lib/system/libcommonCrypto.dylib -0x000000019bfbc000 /usr/lib/system/libcompiler_rt.dylib -0x000000019bfb2000 /usr/lib/system/libcopyfile.dylib -0x000000018f0c4000 /usr/lib/system/libcorecrypto.dylib -0x000000018f1aa000 /usr/lib/system/libdispatch.dylib -0x000000018f365000 /usr/lib/system/libdyld.dylib -0x000000019bfcc000 /usr/lib/system/libkeymgr.dylib -0x000000019bf68000 /usr/lib/system/libmacho.dylib -0x000000019b448000 /usr/lib/system/libquarantine.dylib -0x000000019bfc9000 /usr/lib/system/libremovefile.dylib -0x0000000194ae0000 /usr/lib/system/libsystem_asl.dylib -0x000000018f059000 /usr/lib/system/libsystem_blocks.dylib -0x000000018f1f5000 /usr/lib/system/libsystem_c.dylib -0x000000019bfc0000 /usr/lib/system/libsystem_collections.dylib -0x000000019a620000 /usr/lib/system/libsystem_configuration.dylib -0x000000019965c000 /usr/lib/system/libsystem_containermanager.dylib -0x000000019bbff000 /usr/lib/system/libsystem_coreservices.dylib -0x0000000192783000 /usr/lib/system/libsystem_darwin.dylib -0x00000002577ca000 /usr/lib/system/libsystem_darwindirectory.dylib -0x000000019bfcd000 /usr/lib/system/libsystem_dnssd.dylib -0x00000002577ce000 /usr/lib/system/libsystem_eligibility.dylib -0x000000018f1f2000 /usr/lib/system/libsystem_featureflags.dylib -0x000000018f393000 /usr/lib/system/libsystem_info.dylib -0x000000019bf2d000 /usr/lib/system/libsystem_m.dylib -0x000000018f16d000 /usr/lib/system/libsystem_malloc.dylib -0x0000000194a4d000 /usr/lib/system/libsystem_networkextension.dylib -0x0000000192bf9000 /usr/lib/system/libsystem_notify.dylib -0x000000019a625000 /usr/lib/system/libsystem_sandbox.dylib -0x00000002577d2000 /usr/lib/system/libsystem_sanitizers.dylib -0x000000019bfc5000 /usr/lib/system/libsystem_secinit.dylib -0x000000018f31d000 /usr/lib/system/libsystem_kernel.dylib -0x000000018f38b000 /usr/lib/system/libsystem_platform.dylib -0x000000018f358000 /usr/lib/system/libsystem_pthread.dylib -0x00000001964d0000 /usr/lib/system/libsystem_symptoms.dylib -0x000000018f0a9000 /usr/lib/system/libsystem_trace.dylib -0x000000019bf9e000 /usr/lib/system/libunwind.dylib -0x000000018f05e000 /usr/lib/system/libxpc.dylib -0x000000018f301000 /usr/lib/libc++abi.dylib -0x000000019bfaa000 /usr/lib/liboah.dylib -0x000000019d438000 /usr/lib/liblzma.5.dylib -0x000000019bfde000 /usr/lib/libfakelink.dylib -0x0000000194679000 /System/Library/Frameworks/CFNetwork.framework/Versions/A/CFNetwork -0x000000019c032000 /usr/lib/libarchive.2.dylib -0x00000001a1568000 /System/Library/Frameworks/Combine.framework/Versions/A/Combine -0x000000022ab93000 /System/Library/PrivateFrameworks/CollectionsInternal.framework/Versions/A/CollectionsInternal -0x0000000241543000 /System/Library/PrivateFrameworks/ReflectionInternal.framework/Versions/A/ReflectionInternal -0x0000000241ad5000 /System/Library/PrivateFrameworks/RuntimeInternal.framework/Versions/A/RuntimeInternal -0x00000002575d1000 /usr/lib/swift/libswift_StringProcessing.dylib -0x0000000192a94000 /System/Library/PrivateFrameworks/CoreServicesInternal.framework/Versions/A/CoreServicesInternal -0x000000019b46f000 /usr/lib/libbsm.0.dylib -0x000000019bf70000 /usr/lib/system/libkxld.dylib -0x0000000197cc8000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/FSEvents.framework/Versions/A/FSEvents -0x000000019278e000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore -0x000000019719e000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata -0x000000019bc05000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices -0x000000019c0bb000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit -0x0000000196451000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE -0x000000018f899000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices -0x000000019d3e1000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/DictionaryServices.framework/Versions/A/DictionaryServices -0x0000000197cd5000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SharedFileList.framework/Versions/A/SharedFileList -0x000000019c15b000 /usr/lib/libapple_nghttp2.dylib -0x00000001960c5000 /usr/lib/libsqlite3.dylib -0x00000001964d9000 /System/Library/Frameworks/Network.framework/Versions/A/Network -0x0000000255e8e000 /usr/lib/libCoreEntitlements.dylib -0x000000023c44d000 /System/Library/PrivateFrameworks/MessageSecurity.framework/Versions/A/MessageSecurity -0x00000001960ab000 /System/Library/PrivateFrameworks/ProtocolBuffer.framework/Versions/A/ProtocolBuffer -0x000000019bb2e000 /System/Library/PrivateFrameworks/AppleFSCompression.framework/Versions/A/AppleFSCompression -0x000000019b457000 /usr/lib/libcoretls.dylib -0x000000019d457000 /usr/lib/libcoretls_cfhelpers.dylib -0x000000019c18b000 /usr/lib/libpam.2.dylib -0x000000019d4c9000 /usr/lib/libxar.1.dylib -0x000000019d8b7000 /usr/lib/libheimdal-asn1.dylib -0x0000000194678000 /usr/lib/libnetwork.dylib -0x000000019bfe3000 /usr/lib/libpcap.A.dylib -0x00000001964c5000 /usr/lib/libdns_services.dylib -0x000000019a62d000 /System/Library/PrivateFrameworks/AppleSystemInfo.framework/Versions/A/AppleSystemInfo -0x000000019b155000 /System/Library/PrivateFrameworks/IOMobileFramebuffer.framework/Versions/A/IOMobileFramebuffer -0x0000000257528000 /usr/lib/swift/libswift_RegexParser.dylib -0x000000019bbf2000 /usr/lib/libbz2.1.0.dylib -0x000000019b44b000 /usr/lib/libCheckFix.dylib -0x0000000194af8000 /System/Library/PrivateFrameworks/TCC.framework/Versions/A/TCC -0x000000019a633000 /System/Library/PrivateFrameworks/CoreNLP.framework/Versions/A/CoreNLP -0x0000000197157000 /System/Library/PrivateFrameworks/MetadataUtilities.framework/Versions/A/MetadataUtilities -0x000000019b481000 /usr/lib/libmecab.dylib -0x0000000190229000 /usr/lib/libCRFSuite.dylib -0x000000019b4dd000 /usr/lib/libgermantok.dylib -0x000000019c132000 /usr/lib/libThaiTokenizer.dylib -0x0000000197242000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.framework/Versions/A/vImage -0x00000001a3641000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/vecLib -0x000000019d510000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvMisc.dylib -0x000000019b030000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvDSP.dylib -0x000000018fca0000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib -0x000000019c266000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib -0x000000019b4e0000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLinearAlgebra.dylib -0x000000019c176000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparseBLAS.dylib -0x000000019c261000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libQuadrature.dylib -0x000000019a75c000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBNNS.dylib -0x000000019012e000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparse.dylib -0x000000023ab9c000 /System/Library/PrivateFrameworks/MIL.framework/Versions/A/MIL -0x000000019c019000 /usr/lib/libiconv.2.dylib -0x000000019bf64000 /usr/lib/libcharset.1.dylib -0x0000000197ca8000 /System/Library/Frameworks/OpenDirectory.framework/Versions/A/Frameworks/CFOpenDirectory.framework/Versions/A/CFOpenDirectory -0x0000000197c98000 /System/Library/Frameworks/OpenDirectory.framework/Versions/A/OpenDirectory -0x000000019d459000 /System/Library/PrivateFrameworks/APFS.framework/Versions/A/APFS -0x000000019b387000 /System/Library/Frameworks/SecurityFoundation.framework/Versions/A/SecurityFoundation -0x000000019d4d8000 /usr/lib/libutil.dylib -0x0000000238cfd000 /System/Library/PrivateFrameworks/InstalledContentLibrary.framework/Versions/A/InstalledContentLibrary -0x0000000192ad5000 /System/Library/PrivateFrameworks/CoreServicesStore.framework/Versions/A/CoreServicesStore -0x0000000228340000 /System/Library/PrivateFrameworks/AppleMobileFileIntegrity.framework/Versions/A/AppleMobileFileIntegrity -0x00000001b4cf5000 /usr/lib/libmis.dylib -0x00000001c53e7000 /System/Library/PrivateFrameworks/MobileSystemServices.framework/Versions/A/MobileSystemServices -0x00000001e3449000 /System/Library/PrivateFrameworks/ConfigProfileHelper.framework/Versions/A/ConfigProfileHelper -0x000000019c134000 /System/Library/PrivateFrameworks/AppleSauce.framework/Versions/A/AppleSauce -0x0000000191173000 /System/Library/PrivateFrameworks/LanguageModeling.framework/Versions/A/LanguageModeling -0x000000019d4dc000 /usr/lib/libxslt.1.dylib -0x000000019c020000 /usr/lib/libcmph.dylib -0x000000019b121000 /System/Library/PrivateFrameworks/CoreEmoji.framework/Versions/A/CoreEmoji -0x000000019a756000 /System/Library/PrivateFrameworks/LinguisticData.framework/Versions/A/LinguisticData -0x000000019003c000 /System/Library/PrivateFrameworks/Lexicon.framework/Versions/A/Lexicon -0x000000019b415000 /System/Library/PrivateFrameworks/BackgroundTaskManagement.framework/Versions/A/BackgroundTaskManagement -0x0000000256078000 /usr/lib/libTLE.dylib -0x000000019dda8000 /System/Library/PrivateFrameworks/AppleJPEG.framework/Versions/A/AppleJPEG -0x000000019d89c000 /usr/lib/libexpat.1.dylib -0x000000019e3d0000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libPng.dylib -0x000000019e3fb000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib -0x000000019e4e6000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libGIF.dylib -0x000000019ddee000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJP2.dylib -0x000000019e48b000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib -0x000000019e482000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libRadiance.dylib -0x0000000199a48000 /System/Library/PrivateFrameworks/FontServices.framework/libFontParser.dylib -0x00000001963ea000 /System/Library/PrivateFrameworks/RunningBoardServices.framework/Versions/A/RunningBoardServices -0x00000001a9f95000 /System/Library/PrivateFrameworks/IOSurfaceAccelerator.framework/Versions/A/IOSurfaceAccelerator -0x000000019dede000 /System/Library/PrivateFrameworks/WatchdogClient.framework/Versions/A/WatchdogClient -0x0000000191359000 /System/Library/Frameworks/CoreDisplay.framework/Versions/A/CoreDisplay -0x00000001998ff000 /System/Library/Frameworks/CoreMedia.framework/Versions/A/CoreMedia -0x000000019969f000 /System/Library/PrivateFrameworks/IOAccelerator.framework/Versions/A/IOAccelerator -0x0000000197e3b000 /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo -0x000000019c189000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/MetalPerformanceShaders -0x000000019df21000 /System/Library/Frameworks/VideoToolbox.framework/Versions/A/VideoToolbox -0x0000000197ed7000 /System/Library/PrivateFrameworks/UserManagement.framework/Versions/A/UserManagement -0x0000000196311000 /System/Library/PrivateFrameworks/BaseBoard.framework/Versions/A/BaseBoard -0x000000019a62b000 /System/Library/PrivateFrameworks/AggregateDictionary.framework/Versions/A/AggregateDictionary -0x000000022817a000 /System/Library/PrivateFrameworks/AppleKeyStore.framework/Versions/A/AppleKeyStore -0x000000019e47d000 /System/Library/PrivateFrameworks/GPUWrangler.framework/Versions/A/GPUWrangler -0x000000019e45d000 /System/Library/PrivateFrameworks/IOPresentment.framework/Versions/A/IOPresentment -0x000000019e485000 /System/Library/PrivateFrameworks/DSExternalDisplay.framework/Versions/A/DSExternalDisplay -0x0000000234d8a000 /System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/32023/Libraries/libllvm-flatbuffers.dylib -0x00000001e6032000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCoreFSCache.dylib -0x00000002319ee000 /System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/32023/Libraries/libGPUCompilerUtils.dylib -0x000000019e4ec000 /System/Library/PrivateFrameworks/CMCaptureCore.framework/Versions/A/CMCaptureCore -0x00000001eae86000 /System/Library/Frameworks/ExtensionFoundation.framework/Versions/A/ExtensionFoundation -0x00000001a5543000 /System/Library/PrivateFrameworks/CoreTime.framework/Versions/A/CoreTime -0x000000019da70000 /System/Library/PrivateFrameworks/AppServerSupport.framework/Versions/A/AppServerSupport -0x00000001a0004000 /System/Library/PrivateFrameworks/perfdata.framework/Versions/A/perfdata -0x000000019147d000 /System/Library/PrivateFrameworks/AudioToolboxCore.framework/Versions/A/AudioToolboxCore -0x00000001998d5000 /System/Library/PrivateFrameworks/caulk.framework/Versions/A/caulk -0x000000019f872000 /usr/lib/libAudioStatistics.dylib -0x00000001b402e000 /System/Library/PrivateFrameworks/SystemPolicy.framework/Versions/A/SystemPolicy -0x000000019fb4b000 /usr/lib/libSMC.dylib -0x00000001a953d000 /System/Library/Frameworks/CoreMIDI.framework/Versions/A/CoreMIDI -0x000000019e397000 /usr/lib/libAudioToolboxUtility.dylib -0x00000001af42f000 /System/Library/PrivateFrameworks/OSAServicesClient.framework/Versions/A/OSAServicesClient -0x00000001a0012000 /usr/lib/libperfcheck.dylib -0x00000001a4ffa000 /System/Library/PrivateFrameworks/BoardServices.framework/Versions/A/BoardServices -0x000000019d784000 /System/Library/PrivateFrameworks/PlugInKit.framework/Versions/A/PlugInKit -0x000000019b379000 /System/Library/PrivateFrameworks/AssertionServices.framework/Versions/A/AssertionServices -0x00000001a864e000 /System/Library/PrivateFrameworks/ASEProcessing.framework/Versions/A/ASEProcessing -0x00000001d1318000 /System/Library/PrivateFrameworks/Symbolication.framework/Versions/A/Symbolication -0x0000000240330000 /System/Library/PrivateFrameworks/PhotosensitivityProcessing.framework/Versions/A/PhotosensitivityProcessing -0x000000019da21000 /System/Library/PrivateFrameworks/GraphVisualizer.framework/Versions/A/GraphVisualizer -0x00000001e6094000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib -0x00000001e6053000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGFXShared.dylib -0x00000001e622c000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib -0x00000001e605c000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLImage.dylib -0x00000001e6050000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCVMSPluginSupport.dylib -0x0000000256030000 /usr/lib/libRosetta.dylib -0x00000001e6039000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCoreVMClient.dylib -0x000000022fbf4000 /System/Library/PrivateFrameworks/FontServices.framework/Versions/A/FontServices -0x000000019da2d000 /System/Library/PrivateFrameworks/OTSVG.framework/Versions/A/OTSVG -0x00000001979dc000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/Resources/libFontRegistry.dylib -0x000000019da7b000 /System/Library/PrivateFrameworks/FontServices.framework/libhvf.dylib -0x000000022fbf5000 /System/Library/PrivateFrameworks/FontServices.framework/libXTFontStaticRegistryData.dylib -0x000000019a572000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSCore.framework/Versions/A/MPSCore -0x000000019ba9c000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSImage.framework/Versions/A/MPSImage -0x000000019b4f5000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSNeuralNetwork.framework/Versions/A/MPSNeuralNetwork -0x000000019b940000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSMatrix.framework/Versions/A/MPSMatrix -0x000000019b74b000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSRayIntersector.framework/Versions/A/MPSRayIntersector -0x000000019b972000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSNDArray.framework/Versions/A/MPSNDArray -0x00000001ec760000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSFunctions.framework/Versions/A/MPSFunctions -0x00000001ec745000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSBenchmarkLoop.framework/Versions/A/MPSBenchmarkLoop -0x000000018fb54000 /System/Library/PrivateFrameworks/MetalTools.framework/Versions/A/MetalTools -0x00000001b91d7000 /System/Library/PrivateFrameworks/IOAccelMemoryInfo.framework/Versions/A/IOAccelMemoryInfo -0x00000001c52e0000 /System/Library/PrivateFrameworks/kperf.framework/Versions/A/kperf -0x00000001b4d1a000 /System/Library/PrivateFrameworks/GPURawCounter.framework/Versions/A/GPURawCounter -0x00000001a5415000 /System/Library/PrivateFrameworks/CoreSymbolication.framework/Versions/A/CoreSymbolication -0x00000001b4cc6000 /System/Library/PrivateFrameworks/MallocStackLogging.framework/Versions/A/MallocStackLogging -0x000000019d626000 /System/Library/PrivateFrameworks/CrashReporterSupport.framework/Versions/A/CrashReporterSupport -0x00000001a53d0000 /System/Library/PrivateFrameworks/DebugSymbols.framework/Versions/A/DebugSymbols -0x00000001c3c47000 /System/Library/PrivateFrameworks/OSAnalytics.framework/Versions/A/OSAnalytics -0x000000024d229000 /System/Library/PrivateFrameworks/VideoToolboxParavirtualizationSupport.framework/Versions/A/VideoToolboxParavirtualizationSupport -0x000000019d850000 /System/Library/PrivateFrameworks/AppleVA.framework/Versions/A/AppleVA -0x000000019f8ba000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS -0x0000000195849000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices -0x000000019e4fa000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/PrintCore -0x000000019fca4000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/QD.framework/Versions/A/QD -0x000000019fc98000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSyncLegacy.framework/Versions/A/ColorSyncLegacy -0x000000019f88a000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis -0x000000019e4b6000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATSUI.framework/Versions/A/ATSUI -0x000000019fc2b000 /usr/lib/libcups.2.dylib -0x00000001a0020000 /System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos -0x00000001a0031000 /System/Library/Frameworks/GSS.framework/Versions/A/GSS -0x000000019f939000 /usr/lib/libresolv.9.dylib -0x000000019da8c000 /System/Library/PrivateFrameworks/Heimdal.framework/Versions/A/Heimdal -0x00000001a74bc000 /System/Library/Frameworks/Kerberos.framework/Versions/A/Libraries/libHeimdalProxy.dylib -0x00000001a008b000 /System/Library/PrivateFrameworks/CommonAuth.framework/Versions/A/CommonAuth -0x00000001e9c6c000 /System/Library/Frameworks/AVFAudio.framework/Versions/A/AVFAudio -0x00000001af47e000 /System/Library/PrivateFrameworks/AXCoreUtilities.framework/Versions/A/AXCoreUtilities -0x000000023a274000 /System/Library/PrivateFrameworks/IsolatedCoreAudioClient.framework/Versions/A/IsolatedCoreAudioClient -0x000000019f7f6000 /System/Library/PrivateFrameworks/AudioSession.framework/Versions/A/AudioSession -0x00000001a1307000 /System/Library/Frameworks/IOBluetooth.framework/Versions/A/IOBluetooth -0x000000019d95b000 /System/Library/PrivateFrameworks/MediaExperience.framework/Versions/A/MediaExperience -0x000000019f635000 /System/Library/PrivateFrameworks/AudioSession.framework/libSessionUtility.dylib -0x000000019fcb0000 /System/Library/PrivateFrameworks/AudioResourceArbitration.framework/Versions/A/AudioResourceArbitration -0x00000001a4388000 /System/Library/PrivateFrameworks/PowerLog.framework/Versions/A/PowerLog -0x00000001a42a6000 /System/Library/Frameworks/CoreBluetooth.framework/Versions/A/CoreBluetooth -0x00000001a74bd000 /System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit -0x000000019b1e2000 /System/Library/PrivateFrameworks/CoreUtils.framework/Versions/A/CoreUtils -0x000000022de3f000 /System/Library/PrivateFrameworks/CoreUtilsExtras.framework/Versions/A/CoreUtilsExtras -0x0000000238b8a000 /System/Library/PrivateFrameworks/IO80211.framework/Versions/A/IO80211 -0x00000001a4f3e000 /System/Library/PrivateFrameworks/FrontBoardServices.framework/Versions/A/FrontBoardServices -0x00000001a6a85000 /System/Library/PrivateFrameworks/BackBoardServices.framework/Versions/A/BackBoardServices -0x000000019d8c2000 /System/Library/PrivateFrameworks/IconFoundation.framework/Versions/A/IconFoundation -0x00000001a3281000 /System/Library/PrivateFrameworks/SpeechRecognitionCore.framework/Versions/A/SpeechRecognitionCore -0x00000001af49d000 /usr/lib/libAccessibility.dylib -0x00000001a397b000 /System/Library/Frameworks/MediaAccessibility.framework/Versions/A/MediaAccessibility -0x00000001d49cc000 /System/Library/Frameworks/OSLog.framework/Versions/A/OSLog -0x00000001b4c54000 /System/Library/PrivateFrameworks/LoggingSupport.framework/Versions/A/LoggingSupport -0x0000000101ab4000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/server/libjvm.dylib -0x0000000100448000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjimage.dylib -0x00000001004a8000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjdwp.dylib -0x00000001004f4000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjava.dylib -0x0000000100474000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libinstrument.dylib -0x000000010054c000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libzip.dylib -0x0000000255d1b000 /usr/lib/i18n/libiconv_std.dylib -0x0000000255d03000 /usr/lib/i18n/libUTF8.dylib -0x0000000255d23000 /usr/lib/i18n/libmapper_none.dylib -0x0000000100524000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libdt_socket.dylib -0x00000001007d4000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libnio.dylib -0x00000001007b4000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libnet.dylib -0x00000001019b4000 /Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/libsomelib.dylib -0x000000010049c000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libsyslookup.dylib - - -VM Arguments: -jvm_args: -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:60556,suspend=y,server=n -ea -Didea.test.cyclic.buffer.size=1048576 -javaagent:/Users/cristina/Library/Caches/JetBrains/IdeaIC2024.1/captureAgent/debugger-agent.jar -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 -java_command: com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit5 dev.diplomattest.somelib.Float64VecTest,testFloat64Vec -java_class_path (initial): /Users/cristina/.m2/repository/org/junit/platform/junit-platform-launcher/1.10.3/junit-platform-launcher-1.10.3.jar:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/lib/idea_rt.jar:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/plugins/junit/lib/junit5-rt.jar:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/plugins/junit/lib/junit-rt.jar:/Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/target/test-classes:/Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/target/classes:/Users/cristina/.m2/repository/net/java/dev/jna/jna/5.14.0/jna-5.14.0.jar:/Users/cristina/.m2/repository/org/junit/jupiter/junit-jupiter/5.10.3/junit-jupiter-5.10.3.jar:/Users/cristina/.m2/repository/org/junit/jupiter/junit-jupiter-api/5.10.3/junit-jupiter-api-5.10.3.jar:/Users/cristina/.m2/repository/org/opentest4j/opentest4j/1.3.0/opentest4j-1.3.0.jar:/Users/cristina/.m2/repository/org/junit/platform/junit-platform-commons/1.10.3/junit-platform-commons-1.10.3.jar:/Users/cristina/.m2/repository/org/apiguardian/apiguardian-api/1.1.2/apiguardian-api-1.1.2.jar:/Users/cristina/.m2/repository/org/junit/jupiter/junit-jupiter-params/5.10.3/junit-jupiter-params-5.10.3.jar:/Users/cristina/.m2/repository/org/junit/jupiter/junit-jupiter-engine/5.10.3/junit-jupiter-engine-5.10.3.jar:/Users/cristina/.m2/repository/org/junit/platform/junit-platform-engine/1.10.3/junit-platform-engine-1.10.3.jar:/Users/cristina/.m2/repository/org/openjdk/jmh/jmh-core/1.37/jmh-core-1.37.jar:/Users/cristina/.m2/repository/net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4.jar:/Users/cristina/.m2/repository/org/apache/commons/commons-math3/3.6.1/commons-math3-3.6.1.jar:/Users/cristina/.m2/repository/org/openjdk/jmh/jmh-generator-annprocess/1.37/jmh-generator-annprocess-1.37.jar -Launcher Type: SUN_STANDARD - -[Global flags] - intx CICompilerCount = 4 {product} {ergonomic} - uint ConcGCThreads = 2 {product} {ergonomic} - uint G1ConcRefinementThreads = 8 {product} {ergonomic} - size_t G1HeapRegionSize = 2097152 {product} {ergonomic} - size_t InitialHeapSize = 268435456 {product} {ergonomic} - size_t MarkStackSize = 4194304 {product} {ergonomic} - size_t MaxHeapSize = 4294967296 {product} {ergonomic} - size_t MaxNewSize = 2575302656 {product} {ergonomic} - size_t MinHeapDeltaBytes = 2097152 {product} {ergonomic} - size_t MinHeapSize = 8388608 {product} {ergonomic} - uintx NonNMethodCodeHeapSize = 5839564 {pd product} {ergonomic} - uintx NonProfiledCodeHeapSize = 122909338 {pd product} {ergonomic} - uintx ProfiledCodeHeapSize = 122909338 {pd product} {ergonomic} - uintx ReservedCodeCacheSize = 251658240 {pd product} {ergonomic} - bool SegmentedCodeCache = true {product} {ergonomic} - size_t SoftMaxHeapSize = 4294967296 {manageable} {ergonomic} - bool UseCompressedOops = true {product lp64_product} {ergonomic} - bool UseG1GC = true {product} {ergonomic} - bool UseNUMA = false {product} {ergonomic} - bool UseNUMAInterleaving = false {product} {ergonomic} - -Logging: -Log output configuration: - #0: stdout all=warning uptime,level,tags foldmultilines=false - #1: stderr all=off uptime,level,tags foldmultilines=false - -Environment Variables: -JAVA_HOME=/Users/cristina/Library/Java/JavaVirtualMachines/corretto-19.0.1/Contents/Home/ -PATH=/Users/cristina/bin/jextract-22/bin:/bin:/Users/cristina/.modular/pkg/packages.modular.com_mojo/bin:/Users/cristina/Downloads/dart-sdk/bin:/opt/homebrew/Cellar/llvm/15.0.6/bin:/opt/homebrew/opt/openjdk/bin:/Users/cristina/.elan/bin:/Users/cristina/bin:/Users/cristina/Library/Application Support/Coursier/bin:/Users/cristina/Library/Python/3.8/bin:/Users/cristina/.local/bin:/Users/cristina/.cargo/bin:/Users/cristina/.cargo:/opt/homebrew/bin:/Users/cristina/.fzf/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/X11/bin:/Library/Apple/usr/bin:/usr/local/go/bin:/Library/TeX/texbin:/Users/cristina/.krew/bin -SHELL=/opt/homebrew/bin/fish -LC_CTYPE=en_US.UTF-8 -TMPDIR=/var/folders/x_/9qhndrhs79j640bxvmbkddfw0000gn/T/ - -Active Locale: -LC_ALL=C/en_US.UTF-8/C/C/C/C -LC_COLLATE=C -LC_CTYPE=en_US.UTF-8 -LC_MESSAGES=C -LC_MONETARY=C -LC_NUMERIC=C -LC_TIME=C - -Signal Handlers: - SIGSEGV: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_ONSTACK|SA_RESTART|SA_SIGINFO, unblocked - SIGBUS: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, unblocked - SIGFPE: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, unblocked - SIGPIPE: javaSignalHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked - SIGXFSZ: javaSignalHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked - SIGILL: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, unblocked - SIGUSR2: SR_handler in libjvm.dylib, mask=00100000000000000000000000000000, flags=SA_RESTART|SA_SIGINFO, blocked - SIGHUP: UserHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked - SIGINT: UserHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked - SIGTERM: UserHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked - SIGQUIT: UserHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked - SIGTRAP: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, unblocked - - -Periodic native trim disabled - ---------------- S Y S T E M --------------- - -OS: -uname: Darwin 23.5.0 Darwin Kernel Version 23.5.0: Wed May 1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000 arm64 -OS uptime: 45 days 10:04 hours -rlimit (soft/hard): STACK 8176k/65520k , CORE 0k/infinity , NPROC 2666/4000 , NOFILE 10240/infinity , AS infinity/infinity , CPU infinity/infinity , DATA infinity/infinity , FSIZE infinity/infinity , MEMLOCK infinity/infinity , RSS infinity/infinity -load average: 4.11 4.43 4.50 - -CPU: total 8 (initial active 8) 0x61:0x0:0x1b588bb3:0, fp, asimd, aes, pmull, sha1, sha256, crc32, lse, sha3, sha512 -machdep.cpu.brand_string:Apple M1 Pro -hw.cachelinesize:128 -hw.l1icachesize:131072 -hw.l1dcachesize:65536 -hw.l2cachesize:4194304 - -Memory: 16k page, physical 16777216k(56976k free), swap 3145728k(1371968k free) - -vm_info: OpenJDK 64-Bit Server VM (22.0.1+8) for bsd-aarch64 JRE (22.0.1+8), built on 2024-04-16T00:00:00Z by "admin" with clang Apple LLVM 15.0.0 (clang-1500.1.0.2.5) - -END. diff --git a/feature_tests/java/somelib/hs_err_pid98776.log b/feature_tests/java/somelib/hs_err_pid98776.log deleted file mode 100644 index d0a99d97d..000000000 --- a/feature_tests/java/somelib/hs_err_pid98776.log +++ /dev/null @@ -1,1291 +0,0 @@ -# -# A fatal error has been detected by the Java Runtime Environment: -# -# SIGSEGV (0xb) at pc=0x0000000104081aec, pid=98776, tid=9987 -# -# JRE version: OpenJDK Runtime Environment Temurin-22.0.1+8 (22.0.1+8) (build 22.0.1+8) -# Java VM: OpenJDK 64-Bit Server VM Temurin-22.0.1+8 (22.0.1+8, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-aarch64) -# Problematic frame: -# C [libsomelib.dylib+0x5aec] Float64Vec_new_isize+0xb4 -# -# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again -# -# If you would like to submit a bug report, please visit: -# https://github.com/adoptium/adoptium-support/issues -# The crash happened outside the Java Virtual Machine in native code. -# See problematic frame for where to report the bug. -# - ---------------- S U M M A R Y ------------ - -Command Line: -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:60574,suspend=y,server=n -ea -Didea.test.cyclic.buffer.size=1048576 -javaagent:/Users/cristina/Library/Caches/JetBrains/IdeaIC2024.1/captureAgent/debugger-agent.jar -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit5 dev.diplomattest.somelib.Float64VecTest,testFloat64Vec - -Host: "MacBookPro18,3" arm64, 8 cores, 16G, Darwin 23.5.0, macOS 14.5 (23F79) -Time: Wed Aug 14 21:06:47 2024 CEST elapsed time: 2.572020 seconds (0d 0h 0m 2s) - ---------------- T H R E A D --------------- - -Current thread (0x0000000153008200): JavaThread "main" [_thread_in_native, id=9987, stack(0x000000016d3a4000,0x000000016d5a7000) (2060K)] - -Stack: [0x000000016d3a4000,0x000000016d5a7000], sp=0x000000016d5a3870, free space=2046k -Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) -C [libsomelib.dylib+0x5aec] Float64Vec_new_isize+0xb4 -v ~RuntimeStub::nep_invoker_blob 0x0000000114e703bc -j java.lang.invoke.LambdaForm$MH+0x00003c00001d0400.invoke(Ljava/lang/Object;JJJ)J+12 java.base@22.0.1 -j java.lang.invoke.LambdaForm$MH+0x00003c00001d3000.invokeExact_MT(Ljava/lang/Object;JJJLjava/lang/Object;)J+23 java.base@22.0.1 -j jdk.internal.foreign.abi.DowncallStub+0x00003c00001d1000.invoke(Ljava/lang/foreign/SegmentAllocator;Ljava/lang/foreign/MemorySegment;Ljava/lang/foreign/MemorySegment;)Ljava/lang/foreign/MemorySegment;+69 java.base@22.0.1 -j java.lang.invoke.LambdaForm$DMH+0x00003c00001d1400.invokeStaticInit(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+14 java.base@22.0.1 -j java.lang.invoke.LambdaForm$MH+0x00003c00001d2400.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+44 java.base@22.0.1 -j java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+19 java.base@22.0.1 -j dev.diplomattest.somelib.ntv.somelib_h.Float64Vec_new_isize(Ljava/lang/foreign/MemorySegment;)Ljava/lang/foreign/MemorySegment;+26 -j dev.diplomattest.somelib.Float64Vec.newIsize([J)Ldev/diplomattest/somelib/Float64Vec;+38 -j dev.diplomattest.somelib.Float64VecTest.testFloat64Vec()V+53 -j java.lang.invoke.LambdaForm$DMH+0x00003c0000140c00.invokeVirtual(Ljava/lang/Object;Ljava/lang/Object;)V+10 java.base@22.0.1 -j java.lang.invoke.LambdaForm$MH+0x00003c0000148400.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+31 java.base@22.0.1 -j java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+19 java.base@22.0.1 -j jdk.internal.reflect.DirectMethodHandleAccessor.invokeImpl(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+41 java.base@22.0.1 -j jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+23 java.base@22.0.1 -j java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+102 java.base@22.0.1 -j org.junit.platform.commons.util.ReflectionUtils.invokeMethod(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+42 -j org.junit.jupiter.engine.execution.MethodInvocation.proceed()Ljava/lang/Object;+16 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed()Ljava/lang/Object;+8 -j org.junit.jupiter.engine.extension.TimeoutExtension.intercept(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/TimeoutDuration;Lorg/junit/jupiter/engine/extension/TimeoutExtension$TimeoutProvider;)Ljava/lang/Object;+28 -j org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/TimeoutExtension$TimeoutProvider;)Ljava/lang/Object;+31 -j org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)V+9 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda+0x00003c0000117998.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)V+5 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall$VoidMethodInterceptorCall;Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)Ljava/lang/Void;+6 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall$$Lambda+0x00003c0000117da8.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)Ljava/lang/Object;+9 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+6 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$$Lambda+0x00003c00001465f0.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+14 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed()Ljava/lang/Object;+12 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+1 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/engine/execution/InvocationInterceptorChain$InterceptorCall;Ljava/util/List;)Ljava/lang/Object;+24 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InvocationInterceptorChain$InterceptorCall;)Ljava/lang/Object;+31 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;)Ljava/lang/Object;+15 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(Ljava/lang/reflect/Method;Ljava/lang/Object;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;)Ljava/lang/Object;+55 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;)V+28 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda+0x00003c0000142aa8.execute()V+12 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)V+21 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;+44 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;+6 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+79 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00003c0000136220.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00003c0000136000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 -j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00003c0000133bc0.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService$$Lambda+0x00003c0000136d10.accept(Ljava/lang/Object;)V+4 -j java.util.ArrayList.forEach(Ljava/util/function/Consumer;)V+46 java.base@22.0.1 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(Ljava/util/List;)V+6 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+116 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00003c0000136220.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00003c0000136000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 -j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00003c0000133bc0.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService$$Lambda+0x00003c0000136d10.accept(Ljava/lang/Object;)V+4 -j java.util.ArrayList.forEach(Ljava/util/function/Consumer;)V+46 java.base@22.0.1 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(Ljava/util/List;)V+6 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+116 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00003c0000136220.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00003c0000136000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 -j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00003c0000133bc0.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(Lorg/junit/platform/engine/support/hierarchical/HierarchicalTestExecutorService$TestTask;)Ljava/util/concurrent/Future;+1 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute()Ljava/util/concurrent/Future;+74 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(Lorg/junit/platform/engine/ExecutionRequest;)V+31 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/engine/TestDescriptor;Lorg/junit/platform/engine/EngineExecutionListener;Lorg/junit/platform/engine/ConfigurationParameters;Lorg/junit/platform/engine/TestEngine;)V+24 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/LauncherDiscoveryResult;Lorg/junit/platform/engine/EngineExecutionListener;)V+115 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;Lorg/junit/platform/engine/EngineExecutionListener;Lorg/junit/platform/launcher/TestExecutionListener;)V+55 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(Lorg/junit/platform/launcher/core/InternalTestPlan;Lorg/junit/platform/launcher/TestExecutionListener;)V+6 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator$$Lambda+0x00003c0000120000.accept(Ljava/lang/Object;)V+12 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(Lorg/junit/platform/engine/ConfigurationParameters;Lorg/junit/platform/launcher/core/ListenerRegistry;Ljava/util/function/Consumer;)V+51 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;[Lorg/junit/platform/launcher/TestExecutionListener;)V+23 -j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;[Lorg/junit/platform/launcher/TestExecutionListener;)V+6 -j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+34 -j org.junit.platform.launcher.core.DelegatingLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+6 -j org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+13 -j com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs([Ljava/lang/String;Ljava/lang/String;IZ)I+203 -j com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(Z)I+17 -j com.intellij.rt.execution.junit.TestsRepeater.repeat(IZLcom/intellij/rt/execution/junit/TestsRepeater$TestRun;)I+7 -j com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(Lcom/intellij/rt/junit/IdeaTestRunner;[Ljava/lang/String;Ljava/util/ArrayList;Ljava/lang/String;IZ)I+25 -j com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart([Ljava/lang/String;Ljava/lang/String;Ljava/util/ArrayList;Ljava/lang/String;)I+117 -j com.intellij.rt.junit.JUnitStarter.main([Ljava/lang/String;)V+97 -v ~StubRoutines::call_stub 0x0000000114d48154 -...... -Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) -v ~RuntimeStub::nep_invoker_blob 0x0000000114e7038c -j java.lang.invoke.LambdaForm$MH+0x00003c00001d0400.invoke(Ljava/lang/Object;JJJ)J+12 java.base@22.0.1 -j java.lang.invoke.LambdaForm$MH+0x00003c00001d3000.invokeExact_MT(Ljava/lang/Object;JJJLjava/lang/Object;)J+23 java.base@22.0.1 -j jdk.internal.foreign.abi.DowncallStub+0x00003c00001d1000.invoke(Ljava/lang/foreign/SegmentAllocator;Ljava/lang/foreign/MemorySegment;Ljava/lang/foreign/MemorySegment;)Ljava/lang/foreign/MemorySegment;+69 java.base@22.0.1 -j java.lang.invoke.LambdaForm$DMH+0x00003c00001d1400.invokeStaticInit(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+14 java.base@22.0.1 -j java.lang.invoke.LambdaForm$MH+0x00003c00001d2400.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+44 java.base@22.0.1 -j java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+19 java.base@22.0.1 -j dev.diplomattest.somelib.ntv.somelib_h.Float64Vec_new_isize(Ljava/lang/foreign/MemorySegment;)Ljava/lang/foreign/MemorySegment;+26 -j dev.diplomattest.somelib.Float64Vec.newIsize([J)Ldev/diplomattest/somelib/Float64Vec;+38 -j dev.diplomattest.somelib.Float64VecTest.testFloat64Vec()V+53 -j java.lang.invoke.LambdaForm$DMH+0x00003c0000140c00.invokeVirtual(Ljava/lang/Object;Ljava/lang/Object;)V+10 java.base@22.0.1 -j java.lang.invoke.LambdaForm$MH+0x00003c0000148400.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+31 java.base@22.0.1 -j java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+19 java.base@22.0.1 -j jdk.internal.reflect.DirectMethodHandleAccessor.invokeImpl(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+41 java.base@22.0.1 -j jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+23 java.base@22.0.1 -j java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+102 java.base@22.0.1 -j org.junit.platform.commons.util.ReflectionUtils.invokeMethod(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+42 -j org.junit.jupiter.engine.execution.MethodInvocation.proceed()Ljava/lang/Object;+16 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed()Ljava/lang/Object;+8 -j org.junit.jupiter.engine.extension.TimeoutExtension.intercept(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/TimeoutDuration;Lorg/junit/jupiter/engine/extension/TimeoutExtension$TimeoutProvider;)Ljava/lang/Object;+28 -j org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/TimeoutExtension$TimeoutProvider;)Ljava/lang/Object;+31 -j org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)V+9 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda+0x00003c0000117998.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)V+5 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall$VoidMethodInterceptorCall;Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)Ljava/lang/Void;+6 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall$$Lambda+0x00003c0000117da8.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)Ljava/lang/Object;+9 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+6 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$$Lambda+0x00003c00001465f0.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+14 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed()Ljava/lang/Object;+12 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+1 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/engine/execution/InvocationInterceptorChain$InterceptorCall;Ljava/util/List;)Ljava/lang/Object;+24 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InvocationInterceptorChain$InterceptorCall;)Ljava/lang/Object;+31 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;)Ljava/lang/Object;+15 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(Ljava/lang/reflect/Method;Ljava/lang/Object;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;)Ljava/lang/Object;+55 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;)V+28 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda+0x00003c0000142aa8.execute()V+12 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)V+21 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;+44 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;+6 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+79 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00003c0000136220.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00003c0000136000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 -j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00003c0000133bc0.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService$$Lambda+0x00003c0000136d10.accept(Ljava/lang/Object;)V+4 -j java.util.ArrayList.forEach(Ljava/util/function/Consumer;)V+46 java.base@22.0.1 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(Ljava/util/List;)V+6 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+116 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00003c0000136220.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00003c0000136000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 -j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00003c0000133bc0.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService$$Lambda+0x00003c0000136d10.accept(Ljava/lang/Object;)V+4 -j java.util.ArrayList.forEach(Ljava/util/function/Consumer;)V+46 java.base@22.0.1 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(Ljava/util/List;)V+6 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+116 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00003c0000136220.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00003c0000136000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 -j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00003c0000133bc0.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(Lorg/junit/platform/engine/support/hierarchical/HierarchicalTestExecutorService$TestTask;)Ljava/util/concurrent/Future;+1 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute()Ljava/util/concurrent/Future;+74 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(Lorg/junit/platform/engine/ExecutionRequest;)V+31 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/engine/TestDescriptor;Lorg/junit/platform/engine/EngineExecutionListener;Lorg/junit/platform/engine/ConfigurationParameters;Lorg/junit/platform/engine/TestEngine;)V+24 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/LauncherDiscoveryResult;Lorg/junit/platform/engine/EngineExecutionListener;)V+115 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;Lorg/junit/platform/engine/EngineExecutionListener;Lorg/junit/platform/launcher/TestExecutionListener;)V+55 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(Lorg/junit/platform/launcher/core/InternalTestPlan;Lorg/junit/platform/launcher/TestExecutionListener;)V+6 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator$$Lambda+0x00003c0000120000.accept(Ljava/lang/Object;)V+12 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(Lorg/junit/platform/engine/ConfigurationParameters;Lorg/junit/platform/launcher/core/ListenerRegistry;Ljava/util/function/Consumer;)V+51 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;[Lorg/junit/platform/launcher/TestExecutionListener;)V+23 -j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;[Lorg/junit/platform/launcher/TestExecutionListener;)V+6 -j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+34 -j org.junit.platform.launcher.core.DelegatingLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+6 -j org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+13 -j com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs([Ljava/lang/String;Ljava/lang/String;IZ)I+203 -j com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(Z)I+17 -j com.intellij.rt.execution.junit.TestsRepeater.repeat(IZLcom/intellij/rt/execution/junit/TestsRepeater$TestRun;)I+7 -j com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(Lcom/intellij/rt/junit/IdeaTestRunner;[Ljava/lang/String;Ljava/util/ArrayList;Ljava/lang/String;IZ)I+25 -j com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart([Ljava/lang/String;Ljava/lang/String;Ljava/util/ArrayList;Ljava/lang/String;)I+117 -j com.intellij.rt.junit.JUnitStarter.main([Ljava/lang/String;)V+97 -v ~StubRoutines::call_stub 0x0000000114d48154 - -siginfo: si_signo: 11 (SIGSEGV), si_code: 2 (SEGV_ACCERR), si_addr: 0x0000000000000001 - -Registers: - x0=0x0000600002a9b350 x1=0x00000000b3e657fb x2=0x0000000000000010 x3=0x0000000000000000 - x4=0x0000000000000003 x5=0x0000000034000000 x6=0x0000600002a9b350 x7=0x0000000000000eb0 - x8=0x0000000000000000 x9=0x0000000000000000 x10=0x0000000000003350 x11=0x0000000000000010 -x12=0x0000000000000001 x13=0x00000000ffffff35 x14=0x00000000000007fb x15=0x00000000b3e657fb -x16=0x0000000000000335 x17=0x00000000000000ca x18=0x0000000000000000 x19=0x0000000000000010 -x20=0x0000000000000002 x21=0x0000600002a9b350 x22=0x00000001040cc141 x23=0x0000000000000001 -x24=0x000000016d5a39b8 x25=0x0000000100010000 x26=0x0000000123d1fc08 x27=0x0000000000000000 -x28=0x0000000153008200 fp=0x000000016d5a38a0 lr=0x0000000104081a7c sp=0x000000016d5a3870 -pc=0x0000000104081aec cpsr=0x0000000080001000 - -Register to memory mapping: - -x0 =0x0000600002a9b350 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00 -x1 =0x00000000b3e657fb is an unknown value -x2 =0x0000000000000010 is an unknown value -x3 =0x0 is null -x4 =0x0000000000000003 is an unknown value -x5 =0x0000000034000000 is an unknown value -x6 =0x0000600002a9b350 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00 -x7 =0x0000000000000eb0 is an unknown value -x8 =0x0 is null -x9 =0x0 is null -x10=0x0000000000003350 is an unknown value -x11=0x0000000000000010 is an unknown value -x12=0x0000000000000001 is an unknown value -x13=0x00000000ffffff35 is an unknown value -x14=0x00000000000007fb is an unknown value -x15=0x00000000b3e657fb is an unknown value -x16=0x0000000000000335 is an unknown value -x17=0x00000000000000ca is an unknown value -x18=0x0 is null -x19=0x0000000000000010 is an unknown value -x20=0x0000000000000002 is an unknown value -x21=0x0000600002a9b350 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00 -x22=0x00000001040cc141: __rust_no_alloc_shim_is_unstable+0 in /Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/libsomelib.dylib at 0x000000010407c000 -x23=0x0000000000000001 is an unknown value -x24=0x000000016d5a39b8 is pointing into the stack for thread: 0x0000000153008200 -x25=0x0000000100010000 is an unknown value -x26=0x0000000123d1fc08 is pointing into metadata -x27=0x0 is null -x28=0x0000000153008200 is a thread - fp=0x000000016d5a38a0 is pointing into the stack for thread: 0x0000000153008200 - lr=0x0000000104081a7c: Float64Vec_new_isize+0x44 in /Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/libsomelib.dylib at 0x000000010407c000 - sp=0x000000016d5a3870 is pointing into the stack for thread: 0x0000000153008200 - -Top of Stack: (sp=0x000000016d5a3870) -0x000000016d5a3870: 000000016d5a39b8 000000070eb0b148 -0x000000016d5a3880: 0000000123d1fa54 0000000104ed12b0 -0x000000016d5a3890: 000000016d5a38e8 000000016d5a38d0 -0x000000016d5a38a0: 000000016d5a38c0 0000000114e703bc -0x000000016d5a38b0: 000000016d5a3970 ec17000114d61844 -0x000000016d5a38c0: 000000016d5a3970 0000000114d4d7a8 -0x000000016d5a38d0: 000000070e783670 fffffffffffffff2 -0x000000016d5a38e0: 0000000000000000 000000070e620218 -0x000000016d5a38f0: 0000000000000002 0000000000000000 -0x000000016d5a3900: 0000000000000001 0000000000000000 -0x000000016d5a3910: 0000000104081a38 0000000000000000 -0x000000016d5a3920: fffffffffffffff6 0000000123d1fa54 -0x000000016d5a3930: 0000000000000009 0000000123d1fc08 -0x000000016d5a3940: 000000070e615748 ffffffffffffffec -0x000000016d5a3950: 0000000000000000 0000000123d1fa60 -0x000000016d5a3960: ffffffffffffffef 000000016d5a3970 -0x000000016d5a3970: 000000016d5a3a10 0000000114d4d7a8 -0x000000016d5a3980: 000000070e620218 0000000000000002 -0x000000016d5a3990: 0000000000000000 0000000000000001 -0x000000016d5a39a0: 0000000000000000 0000000104081a38 -0x000000016d5a39b0: 0000000000000000 000000070e620108 -0x000000016d5a39c0: fffffffffffffff6 0000000123d2529f -0x000000016d5a39d0: 0000000000000009 0000000123d25470 -0x000000016d5a39e0: 000000070ff2c310 ffffffffffffffec -0x000000016d5a39f0: 0000000000000000 0000000123d252b0 -0x000000016d5a3a00: ffffffffffffffef 000000016d5a3a10 -0x000000016d5a3a10: 000000016d5a3ab0 0000000114d4d7a8 -0x000000016d5a3a20: 000000070e6201f0 0000000000000002 -0x000000016d5a3a30: 0000000000000000 0000000000000001 -0x000000016d5a3a40: 0000000000000000 0000000104081a38 -0x000000016d5a3a50: 0000000000000000 000000070e620108 -0x000000016d5a3a60: fffffffffffffff6 0000000123d21465 - -Instructions: (pc=0x0000000104081aec) -0x00000001040819ec: f6 57 41 a9 f8 5f c4 a8 c0 03 5f d6 00 01 80 52 -0x00000001040819fc: 01 03 80 52 c7 d9 00 94 20 00 20 d4 16 00 80 d2 -0x0000000104081a0c: e0 03 16 aa e1 03 15 aa bd d9 00 94 f5 03 00 aa -0x0000000104081a1c: b3 00 00 b4 61 f2 7d d3 e0 03 14 aa 02 01 80 52 -0x0000000104081a2c: 3a 03 00 94 e0 03 15 aa 54 db 00 94 f8 5f bc a9 -0x0000000104081a3c: f6 57 01 a9 f4 4f 02 a9 fd 7b 03 a9 fd c3 00 91 -0x0000000104081a4c: f4 03 01 aa 15 01 80 52 3f 00 00 f1 b7 02 80 9a -0x0000000104081a5c: 33 f0 7d d3 56 02 00 f0 d6 06 05 91 e1 04 00 b4 -0x0000000104081a6c: df 02 40 39 e0 03 13 aa 01 01 80 52 26 03 00 94 -0x0000000104081a7c: 40 06 00 b4 f5 03 00 aa 08 00 80 d2 9f 22 00 f1 -0x0000000104081a8c: e3 02 00 54 a9 02 17 cb 3f 01 01 f1 83 02 00 54 -0x0000000104081a9c: 09 00 80 d2 88 f2 7d 92 ea 82 00 91 eb 03 08 aa -0x0000000104081aac: 4c 01 09 8b 80 05 7f ad 82 0d 40 ad 00 d8 61 4e -0x0000000104081abc: 21 d8 61 4e 42 d8 61 4e 63 d8 61 4e ac 02 09 8b -0x0000000104081acc: 80 05 00 ad 82 0d 01 ad 29 01 01 91 6b 21 00 f1 -0x0000000104081adc: 81 fe ff 54 1f 01 14 eb 00 01 00 54 09 f1 7d d3 -0x0000000104081aec: e0 6a 69 fc 00 d8 61 5e a0 6a 29 fc 08 05 00 91 -0x0000000104081afc: 9f 02 08 eb 41 ff ff 54 df 02 40 39 00 03 80 52 -0x0000000104081b0c: 01 01 80 52 00 03 00 94 00 01 00 b4 14 54 00 a9 -0x0000000104081b1c: 14 08 00 f9 fd 7b 43 a9 f4 4f 42 a9 f6 57 41 a9 -0x0000000104081b2c: f8 5f c4 a8 c0 03 5f d6 00 01 80 52 01 03 80 52 -0x0000000104081b3c: 78 d9 00 94 20 00 20 d4 00 01 80 52 e1 03 13 aa -0x0000000104081b4c: 6f d9 00 94 f6 03 00 aa b4 00 00 b4 e0 03 15 aa -0x0000000104081b5c: e1 03 13 aa 02 01 80 52 ec 02 00 94 e0 03 16 aa -0x0000000104081b6c: 06 db 00 94 f8 5f bc a9 f6 57 01 a9 f4 4f 02 a9 -0x0000000104081b7c: fd 7b 03 a9 fd c3 00 91 f4 03 01 aa 15 01 80 52 -0x0000000104081b8c: 3f 00 00 f1 b7 02 80 9a 33 f0 7d d3 56 02 00 f0 -0x0000000104081b9c: d6 06 05 91 e1 04 00 b4 df 02 40 39 e0 03 13 aa -0x0000000104081bac: 01 01 80 52 d8 02 00 94 40 06 00 b4 f5 03 00 aa -0x0000000104081bbc: 08 00 80 d2 9f 22 00 f1 e3 02 00 54 a9 02 17 cb -0x0000000104081bcc: 3f 01 01 f1 83 02 00 54 09 00 80 d2 88 f2 7d 92 -0x0000000104081bdc: ea 82 00 91 eb 03 08 aa 4c 01 09 8b 80 05 7f ad - - -Stack slot to memory mapping: - -stack at sp + 0 slots: 0x000000016d5a39b8 is pointing into the stack for thread: 0x0000000153008200 -stack at sp + 1 slots: 0x000000070eb0b148 is an oop: jdk.internal.org.objectweb.asm.SymbolTable$Entry -{0x000000070eb0b148} - klass: 'jdk/internal/org/objectweb/asm/SymbolTable$Entry' - - ---- fields (total size 7 words): - - final 'index' 'I' @12 45 (0x0000002d) - - final 'data' 'J' @16 0 (0x0000000000000000) - - final 'tag' 'I' @24 1 (0x00000001) - - 'info' 'I' @28 0 (0x00000000) - - final 'owner' 'Ljava/lang/String;' @32 null (0x00000000) - - final 'name' 'Ljava/lang/String;' @36 null (0x00000000) - - final 'value' 'Ljava/lang/String;' @40 a 'java/util/ArrayList$Itr'{0x000000070fe74df0} (0xe1fce9be) - - final 'hashCode' 'I' @44 881600600 (0x348c2858) - - 'next' 'Ljdk/internal/org/objectweb/asm/SymbolTable$Entry;' @48 null (0x00000000) -stack at sp + 2 slots: 0x0000000123d1fa54 is pointing into metadata -stack at sp + 3 slots: 0x0000000104ed12b0: _ZN19TemplateInterpreter13_active_tableE+0 in /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/server/libjvm.dylib at 0x000000010417c000 -stack at sp + 4 slots: 0x000000016d5a38e8 is pointing into the stack for thread: 0x0000000153008200 -stack at sp + 5 slots: 0x000000016d5a38d0 is pointing into the stack for thread: 0x0000000153008200 -stack at sp + 6 slots: 0x000000016d5a38c0 is pointing into the stack for thread: 0x0000000153008200 -stack at sp + 7 slots: 0x0000000114e703bc is at code_begin+60 in -[CodeBlob (0x0000000114e70310)] -Framesize: 4 -Runtime Stub (0x0000000114e70310): nep_invoker_blob --------------------------------------------------------------------------------- -Decoding CodeBlob, name: nep_invoker_blob, at [0x0000000114e70380, 0x0000000114e70450] 208 bytes -[MachCode] - 0x0000000114e70380: fd7b bfa9 | fd03 0091 | bf43 00d1 | 0900 0010 | 89d7 01f9 | e903 0091 | 89d3 01f9 | 9ddb 01f9 - 0x0000000114e703a0: e903 7eb2 | 8a53 1191 | 49fd 9f88 | e903 01aa | e103 03aa | e003 02aa | 2001 3fd6 | a900 80d2 - 0x0000000114e703c0: 8957 04b9 | bf3b 03d5 | 8963 1191 | 29fd dfc8 | bf03 09eb | e801 0054 | 8953 44b9 | a901 0035 - 0x0000000114e703e0: e903 7db2 | 8a53 1191 | 49fd 9f88 | 8943 5339 | 3f09 0071 | e001 0054 | 9fd3 01f9 | 9fdb 01f9 - 0x0000000114e70400: 9fd7 01f9 | bf03 0091 | fd7b c1a8 | c003 5fd6 | e003 00f9 | e003 1caa | 897d 84d2 | 898c a0f2 - 0x0000000114e70420: 2900 c0f2 | 2001 3fd6 | e003 40f9 | edff ff17 | e003 00f9 | 0919 9dd2 | 8994 a0f2 | 2900 c0f2 - 0x0000000114e70440: 2001 3fd6 | e003 40f9 | ecff ff17 | 0000 0000 -[/MachCode] --------------------------------------------------------------------------------- - --------------------------------------------------------------------------------- -Decoding CodeBlob, name: nep_invoker_blob, at [0x0000000114e70380, 0x0000000114e70450] 208 bytes -[MachCode] - 0x0000000114e70380: fd7b bfa9 | fd03 0091 | bf43 00d1 | 0900 0010 | 89d7 01f9 | e903 0091 | 89d3 01f9 | 9ddb 01f9 - 0x0000000114e703a0: e903 7eb2 | 8a53 1191 | 49fd 9f88 | e903 01aa | e103 03aa | e003 02aa | 2001 3fd6 | a900 80d2 - 0x0000000114e703c0: 8957 04b9 | bf3b 03d5 | 8963 1191 | 29fd dfc8 | bf03 09eb | e801 0054 | 8953 44b9 | a901 0035 - 0x0000000114e703e0: e903 7db2 | 8a53 1191 | 49fd 9f88 | 8943 5339 | 3f09 0071 | e001 0054 | 9fd3 01f9 | 9fdb 01f9 - 0x0000000114e70400: 9fd7 01f9 | bf03 0091 | fd7b c1a8 | c003 5fd6 | e003 00f9 | e003 1caa | 897d 84d2 | 898c a0f2 - 0x0000000114e70420: 2900 c0f2 | 2001 3fd6 | e003 40f9 | edff ff17 | e003 00f9 | 0919 9dd2 | 8994 a0f2 | 2900 c0f2 - 0x0000000114e70440: 2001 3fd6 | e003 40f9 | ecff ff17 | 0000 0000 -[/MachCode] --------------------------------------------------------------------------------- - - ---------------- P R O C E S S --------------- - -Threads class SMR info: -_java_thread_list=0x000060000289ade0, length=13, elements={ -0x0000000153008200, 0x0000000152019a00, 0x0000000152017e00, 0x000000015201a200, -0x000000015180f200, 0x000000015180e400, 0x0000000151809a00, 0x000000015180a200, -0x0000000131008200, 0x00000001518c8200, 0x00000001518c8a00, 0x00000001518c9200, -0x000000013102fa00 -} - -Java Threads: ( => current thread ) -=>0x0000000153008200 JavaThread "main" [_thread_in_native, id=9987, stack(0x000000016d3a4000,0x000000016d5a7000) (2060K)] - 0x0000000152019a00 JavaThread "Reference Handler" daemon [_thread_blocked, id=24323, stack(0x000000016e51c000,0x000000016e71f000) (2060K)] - 0x0000000152017e00 JavaThread "Finalizer" daemon [_thread_blocked, id=28931, stack(0x000000016e728000,0x000000016e92b000) (2060K)] - 0x000000015201a200 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=28675, stack(0x000000016e934000,0x000000016eb37000) (2060K)] - 0x000000015180f200 JavaThread "Service Thread" daemon [_thread_blocked, id=28419, stack(0x000000016eb40000,0x000000016ed43000) (2060K)] - 0x000000015180e400 JavaThread "Monitor Deflation Thread" daemon [_thread_blocked, id=28163, stack(0x000000016ed4c000,0x000000016ef4f000) (2060K)] - 0x0000000151809a00 JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=27907, stack(0x000000016ef58000,0x000000016f15b000) (2060K)] - 0x000000015180a200 JavaThread "C1 CompilerThread0" daemon [_thread_in_vm, id=27395, stack(0x000000016f164000,0x000000016f367000) (2060K)] - 0x0000000131008200 JavaThread "Common-Cleaner" daemon [_thread_blocked, id=26883, stack(0x000000016f370000,0x000000016f573000) (2060K)] - 0x00000001518c8200 JavaThread "JDWP Transport Listener: dt_socket" daemon [_thread_blocked, id=26371, stack(0x000000016f57c000,0x000000016f77f000) (2060K)] - 0x00000001518c8a00 JavaThread "JDWP Event Helper Thread" daemon [_thread_blocked, id=26115, stack(0x000000016f788000,0x000000016f98b000) (2060K)] - 0x00000001518c9200 JavaThread "JDWP Command Reader" daemon [_thread_in_native, id=32771, stack(0x000000016f994000,0x000000016fb97000) (2060K)] - 0x000000013102fa00 JavaThread "Notification Thread" daemon [_thread_blocked, id=33027, stack(0x000000016fba0000,0x000000016fda3000) (2060K)] -Total: 13 - -Other Threads: - 0x0000000140f0c5c0 VMThread "VM Thread" [id=17923, stack(0x000000016e1f8000,0x000000016e3fb000) (2060K)] - 0x0000000140f09640 WatcherThread "VM Periodic Task Thread" [id=20227, stack(0x000000016dfec000,0x000000016e1ef000) (2060K)] - 0x0000000140f06830 WorkerThread "GC Thread#0" [id=11779, stack(0x000000016d5b0000,0x000000016d7b3000) (2060K)] - 0x0000000150f2fe60 WorkerThread "GC Thread#1" [id=33539, stack(0x000000016fdac000,0x000000016ffaf000) (2060K)] - 0x0000000150f303d0 WorkerThread "GC Thread#2" [id=34051, stack(0x0000000300004000,0x0000000300207000) (2060K)] - 0x0000000150e41d70 WorkerThread "GC Thread#3" [id=43011, stack(0x0000000300210000,0x0000000300413000) (2060K)] - 0x0000000152819700 WorkerThread "GC Thread#4" [id=42755, stack(0x000000030041c000,0x000000030061f000) (2060K)] - 0x0000000152819c70 WorkerThread "GC Thread#5" [id=42499, stack(0x0000000300628000,0x000000030082b000) (2060K)] - 0x0000000140f30ac0 WorkerThread "GC Thread#6" [id=41987, stack(0x0000000300834000,0x0000000300a37000) (2060K)] - 0x0000000140f31030 WorkerThread "GC Thread#7" [id=35331, stack(0x0000000300a40000,0x0000000300c43000) (2060K)] - 0x0000000140f06fd0 ConcurrentGCThread "G1 Main Marker" [id=12291, stack(0x000000016d7bc000,0x000000016d9bf000) (2060K)] - 0x0000000140f07950 WorkerThread "G1 Conc#0" [id=12803, stack(0x000000016d9c8000,0x000000016dbcb000) (2060K)] - 0x000000015105ee00 ConcurrentGCThread "G1 Refine#0" [id=16643, stack(0x000000016dbd4000,0x000000016ddd7000) (2060K)] - 0x0000000140f082b0 ConcurrentGCThread "G1 Service" [id=21251, stack(0x000000016dde0000,0x000000016dfe3000) (2060K)] -Total: 14 - -Threads with active compile tasks: -C2 CompilerThread0 2578 1251 4 jdk.internal.org.objectweb.asm.SymbolTable::addConstantUtf8Reference (101 bytes) -C1 CompilerThread0 2578 1262 3 jdk.internal.classfile.impl.StackMapGenerator::processBlock (2767 bytes) -Total: 2 - -VM state: not at safepoint (normal execution) - -VM Mutex/Monitor currently owned by a thread: ([mutex/lock_event]) -[0x0000000104f3a7d8] MethodCompileQueue_lock - owner thread: 0x000000015180a200 -[0x0000000104f3b198] CodeCache_lock - owner thread: 0x000000015180a200 -[0x0000000104f3b258] Compile_lock - owner thread: 0x000000015180a200 - -Heap address: 0x0000000700000000, size: 4096 MB, Compressed Oops mode: Zero based, Oop shift amount: 3 - -CDS archive(s) not mapped -Compressed class space mapped at: 0x00003c0000000000-0x00003c0040000000, reserved size: 1073741824 -Narrow klass base: 0x00003c0000000000, Narrow klass shift: 0, Narrow klass range: 0x40000000 - -GC Precious Log: - CardTable entry size: 512 - Card Set container configuration: InlinePtr #cards 4 size 8 Array Of Cards #cards 16 size 48 Howl #buckets 8 coarsen threshold 3686 Howl Bitmap #cards 512 size 80 coarsen threshold 460 Card regions per heap region 1 cards per card region 4096 - CPUs: 8 total, 8 available - Memory: 16384M - Large Page Support: Disabled - NUMA Support: Disabled - Compressed Oops: Enabled (Zero based) - Heap Region Size: 2M - Heap Min Capacity: 8M - Heap Initial Capacity: 256M - Heap Max Capacity: 4G - Pre-touch: Disabled - Parallel Workers: 8 - Concurrent Workers: 2 - Concurrent Refinement Workers: 8 - Periodic GC: Disabled - -Heap: - garbage-first heap total reserved 4194304K, committed 262144K, used 2742K [0x0000000700000000, 0x0000000800000000) - region size 2048K, 3 young (6144K), 2 survivors (4096K) - Metaspace used 15170K, committed 15552K, reserved 1114112K - class space used 1680K, committed 1856K, reserved 1048576K - -Heap Regions: E=young(eden), S=young(survivor), O=old, HS=humongous(starts), HC=humongous(continues), CS=collection set, F=free, TAMS=top-at-mark-start, PB=parsable bottom -| 0|0x0000000700000000, 0x0000000700000000, 0x0000000700200000| 0%| F| |TAMS 0x0000000700000000| PB 0x0000000700000000| Untracked | 0 -| 1|0x0000000700200000, 0x0000000700200000, 0x0000000700400000| 0%| F| |TAMS 0x0000000700200000| PB 0x0000000700200000| Untracked | 0 -| 2|0x0000000700400000, 0x0000000700400000, 0x0000000700600000| 0%| F| |TAMS 0x0000000700400000| PB 0x0000000700400000| Untracked | 0 -| 3|0x0000000700600000, 0x0000000700600000, 0x0000000700800000| 0%| F| |TAMS 0x0000000700600000| PB 0x0000000700600000| Untracked | 0 -| 4|0x0000000700800000, 0x0000000700800000, 0x0000000700a00000| 0%| F| |TAMS 0x0000000700800000| PB 0x0000000700800000| Untracked | 0 -| 5|0x0000000700a00000, 0x0000000700a00000, 0x0000000700c00000| 0%| F| |TAMS 0x0000000700a00000| PB 0x0000000700a00000| Untracked | 0 -| 6|0x0000000700c00000, 0x0000000700c00000, 0x0000000700e00000| 0%| F| |TAMS 0x0000000700c00000| PB 0x0000000700c00000| Untracked | 0 -| 7|0x0000000700e00000, 0x0000000700e00000, 0x0000000701000000| 0%| F| |TAMS 0x0000000700e00000| PB 0x0000000700e00000| Untracked | 0 -| 8|0x0000000701000000, 0x0000000701000000, 0x0000000701200000| 0%| F| |TAMS 0x0000000701000000| PB 0x0000000701000000| Untracked | 0 -| 9|0x0000000701200000, 0x0000000701200000, 0x0000000701400000| 0%| F| |TAMS 0x0000000701200000| PB 0x0000000701200000| Untracked | 0 -| 10|0x0000000701400000, 0x0000000701400000, 0x0000000701600000| 0%| F| |TAMS 0x0000000701400000| PB 0x0000000701400000| Untracked | 0 -| 11|0x0000000701600000, 0x0000000701600000, 0x0000000701800000| 0%| F| |TAMS 0x0000000701600000| PB 0x0000000701600000| Untracked | 0 -| 12|0x0000000701800000, 0x0000000701800000, 0x0000000701a00000| 0%| F| |TAMS 0x0000000701800000| PB 0x0000000701800000| Untracked | 0 -| 13|0x0000000701a00000, 0x0000000701a00000, 0x0000000701c00000| 0%| F| |TAMS 0x0000000701a00000| PB 0x0000000701a00000| Untracked | 0 -| 14|0x0000000701c00000, 0x0000000701c00000, 0x0000000701e00000| 0%| F| |TAMS 0x0000000701c00000| PB 0x0000000701c00000| Untracked | 0 -| 15|0x0000000701e00000, 0x0000000701e00000, 0x0000000702000000| 0%| F| |TAMS 0x0000000701e00000| PB 0x0000000701e00000| Untracked | 0 -| 16|0x0000000702000000, 0x0000000702000000, 0x0000000702200000| 0%| F| |TAMS 0x0000000702000000| PB 0x0000000702000000| Untracked | 0 -| 17|0x0000000702200000, 0x0000000702200000, 0x0000000702400000| 0%| F| |TAMS 0x0000000702200000| PB 0x0000000702200000| Untracked | 0 -| 18|0x0000000702400000, 0x0000000702400000, 0x0000000702600000| 0%| F| |TAMS 0x0000000702400000| PB 0x0000000702400000| Untracked | 0 -| 19|0x0000000702600000, 0x0000000702600000, 0x0000000702800000| 0%| F| |TAMS 0x0000000702600000| PB 0x0000000702600000| Untracked | 0 -| 20|0x0000000702800000, 0x0000000702800000, 0x0000000702a00000| 0%| F| |TAMS 0x0000000702800000| PB 0x0000000702800000| Untracked | 0 -| 21|0x0000000702a00000, 0x0000000702a00000, 0x0000000702c00000| 0%| F| |TAMS 0x0000000702a00000| PB 0x0000000702a00000| Untracked | 0 -| 22|0x0000000702c00000, 0x0000000702c00000, 0x0000000702e00000| 0%| F| |TAMS 0x0000000702c00000| PB 0x0000000702c00000| Untracked | 0 -| 23|0x0000000702e00000, 0x0000000702e00000, 0x0000000703000000| 0%| F| |TAMS 0x0000000702e00000| PB 0x0000000702e00000| Untracked | 0 -| 24|0x0000000703000000, 0x0000000703000000, 0x0000000703200000| 0%| F| |TAMS 0x0000000703000000| PB 0x0000000703000000| Untracked | 0 -| 25|0x0000000703200000, 0x0000000703200000, 0x0000000703400000| 0%| F| |TAMS 0x0000000703200000| PB 0x0000000703200000| Untracked | 0 -| 26|0x0000000703400000, 0x0000000703400000, 0x0000000703600000| 0%| F| |TAMS 0x0000000703400000| PB 0x0000000703400000| Untracked | 0 -| 27|0x0000000703600000, 0x0000000703600000, 0x0000000703800000| 0%| F| |TAMS 0x0000000703600000| PB 0x0000000703600000| Untracked | 0 -| 28|0x0000000703800000, 0x0000000703800000, 0x0000000703a00000| 0%| F| |TAMS 0x0000000703800000| PB 0x0000000703800000| Untracked | 0 -| 29|0x0000000703a00000, 0x0000000703a00000, 0x0000000703c00000| 0%| F| |TAMS 0x0000000703a00000| PB 0x0000000703a00000| Untracked | 0 -| 30|0x0000000703c00000, 0x0000000703c00000, 0x0000000703e00000| 0%| F| |TAMS 0x0000000703c00000| PB 0x0000000703c00000| Untracked | 0 -| 31|0x0000000703e00000, 0x0000000703e00000, 0x0000000704000000| 0%| F| |TAMS 0x0000000703e00000| PB 0x0000000703e00000| Untracked | 0 -| 32|0x0000000704000000, 0x0000000704000000, 0x0000000704200000| 0%| F| |TAMS 0x0000000704000000| PB 0x0000000704000000| Untracked | 0 -| 33|0x0000000704200000, 0x0000000704200000, 0x0000000704400000| 0%| F| |TAMS 0x0000000704200000| PB 0x0000000704200000| Untracked | 0 -| 34|0x0000000704400000, 0x0000000704400000, 0x0000000704600000| 0%| F| |TAMS 0x0000000704400000| PB 0x0000000704400000| Untracked | 0 -| 35|0x0000000704600000, 0x0000000704600000, 0x0000000704800000| 0%| F| |TAMS 0x0000000704600000| PB 0x0000000704600000| Untracked | 0 -| 36|0x0000000704800000, 0x0000000704800000, 0x0000000704a00000| 0%| F| |TAMS 0x0000000704800000| PB 0x0000000704800000| Untracked | 0 -| 37|0x0000000704a00000, 0x0000000704a00000, 0x0000000704c00000| 0%| F| |TAMS 0x0000000704a00000| PB 0x0000000704a00000| Untracked | 0 -| 38|0x0000000704c00000, 0x0000000704c00000, 0x0000000704e00000| 0%| F| |TAMS 0x0000000704c00000| PB 0x0000000704c00000| Untracked | 0 -| 39|0x0000000704e00000, 0x0000000704e00000, 0x0000000705000000| 0%| F| |TAMS 0x0000000704e00000| PB 0x0000000704e00000| Untracked | 0 -| 40|0x0000000705000000, 0x0000000705000000, 0x0000000705200000| 0%| F| |TAMS 0x0000000705000000| PB 0x0000000705000000| Untracked | 0 -| 41|0x0000000705200000, 0x0000000705200000, 0x0000000705400000| 0%| F| |TAMS 0x0000000705200000| PB 0x0000000705200000| Untracked | 0 -| 42|0x0000000705400000, 0x0000000705400000, 0x0000000705600000| 0%| F| |TAMS 0x0000000705400000| PB 0x0000000705400000| Untracked | 0 -| 43|0x0000000705600000, 0x0000000705600000, 0x0000000705800000| 0%| F| |TAMS 0x0000000705600000| PB 0x0000000705600000| Untracked | 0 -| 44|0x0000000705800000, 0x0000000705800000, 0x0000000705a00000| 0%| F| |TAMS 0x0000000705800000| PB 0x0000000705800000| Untracked | 0 -| 45|0x0000000705a00000, 0x0000000705a00000, 0x0000000705c00000| 0%| F| |TAMS 0x0000000705a00000| PB 0x0000000705a00000| Untracked | 0 -| 46|0x0000000705c00000, 0x0000000705c00000, 0x0000000705e00000| 0%| F| |TAMS 0x0000000705c00000| PB 0x0000000705c00000| Untracked | 0 -| 47|0x0000000705e00000, 0x0000000705e00000, 0x0000000706000000| 0%| F| |TAMS 0x0000000705e00000| PB 0x0000000705e00000| Untracked | 0 -| 48|0x0000000706000000, 0x0000000706000000, 0x0000000706200000| 0%| F| |TAMS 0x0000000706000000| PB 0x0000000706000000| Untracked | 0 -| 49|0x0000000706200000, 0x0000000706200000, 0x0000000706400000| 0%| F| |TAMS 0x0000000706200000| PB 0x0000000706200000| Untracked | 0 -| 50|0x0000000706400000, 0x0000000706400000, 0x0000000706600000| 0%| F| |TAMS 0x0000000706400000| PB 0x0000000706400000| Untracked | 0 -| 51|0x0000000706600000, 0x0000000706600000, 0x0000000706800000| 0%| F| |TAMS 0x0000000706600000| PB 0x0000000706600000| Untracked | 0 -| 52|0x0000000706800000, 0x0000000706800000, 0x0000000706a00000| 0%| F| |TAMS 0x0000000706800000| PB 0x0000000706800000| Untracked | 0 -| 53|0x0000000706a00000, 0x0000000706a00000, 0x0000000706c00000| 0%| F| |TAMS 0x0000000706a00000| PB 0x0000000706a00000| Untracked | 0 -| 54|0x0000000706c00000, 0x0000000706c00000, 0x0000000706e00000| 0%| F| |TAMS 0x0000000706c00000| PB 0x0000000706c00000| Untracked | 0 -| 55|0x0000000706e00000, 0x0000000706e00000, 0x0000000707000000| 0%| F| |TAMS 0x0000000706e00000| PB 0x0000000706e00000| Untracked | 0 -| 56|0x0000000707000000, 0x0000000707000000, 0x0000000707200000| 0%| F| |TAMS 0x0000000707000000| PB 0x0000000707000000| Untracked | 0 -| 57|0x0000000707200000, 0x0000000707200000, 0x0000000707400000| 0%| F| |TAMS 0x0000000707200000| PB 0x0000000707200000| Untracked | 0 -| 58|0x0000000707400000, 0x0000000707400000, 0x0000000707600000| 0%| F| |TAMS 0x0000000707400000| PB 0x0000000707400000| Untracked | 0 -| 59|0x0000000707600000, 0x0000000707600000, 0x0000000707800000| 0%| F| |TAMS 0x0000000707600000| PB 0x0000000707600000| Untracked | 0 -| 60|0x0000000707800000, 0x0000000707800000, 0x0000000707a00000| 0%| F| |TAMS 0x0000000707800000| PB 0x0000000707800000| Untracked | 0 -| 61|0x0000000707a00000, 0x0000000707a00000, 0x0000000707c00000| 0%| F| |TAMS 0x0000000707a00000| PB 0x0000000707a00000| Untracked | 0 -| 62|0x0000000707c00000, 0x0000000707c00000, 0x0000000707e00000| 0%| F| |TAMS 0x0000000707c00000| PB 0x0000000707c00000| Untracked | 0 -| 63|0x0000000707e00000, 0x0000000707e00000, 0x0000000708000000| 0%| F| |TAMS 0x0000000707e00000| PB 0x0000000707e00000| Untracked | 0 -| 64|0x0000000708000000, 0x0000000708000000, 0x0000000708200000| 0%| F| |TAMS 0x0000000708000000| PB 0x0000000708000000| Untracked | 0 -| 65|0x0000000708200000, 0x0000000708200000, 0x0000000708400000| 0%| F| |TAMS 0x0000000708200000| PB 0x0000000708200000| Untracked | 0 -| 66|0x0000000708400000, 0x0000000708400000, 0x0000000708600000| 0%| F| |TAMS 0x0000000708400000| PB 0x0000000708400000| Untracked | 0 -| 67|0x0000000708600000, 0x0000000708600000, 0x0000000708800000| 0%| F| |TAMS 0x0000000708600000| PB 0x0000000708600000| Untracked | 0 -| 68|0x0000000708800000, 0x0000000708800000, 0x0000000708a00000| 0%| F| |TAMS 0x0000000708800000| PB 0x0000000708800000| Untracked | 0 -| 69|0x0000000708a00000, 0x0000000708a00000, 0x0000000708c00000| 0%| F| |TAMS 0x0000000708a00000| PB 0x0000000708a00000| Untracked | 0 -| 70|0x0000000708c00000, 0x0000000708c00000, 0x0000000708e00000| 0%| F| |TAMS 0x0000000708c00000| PB 0x0000000708c00000| Untracked | 0 -| 71|0x0000000708e00000, 0x0000000708e00000, 0x0000000709000000| 0%| F| |TAMS 0x0000000708e00000| PB 0x0000000708e00000| Untracked | 0 -| 72|0x0000000709000000, 0x0000000709000000, 0x0000000709200000| 0%| F| |TAMS 0x0000000709000000| PB 0x0000000709000000| Untracked | 0 -| 73|0x0000000709200000, 0x0000000709200000, 0x0000000709400000| 0%| F| |TAMS 0x0000000709200000| PB 0x0000000709200000| Untracked | 0 -| 74|0x0000000709400000, 0x0000000709400000, 0x0000000709600000| 0%| F| |TAMS 0x0000000709400000| PB 0x0000000709400000| Untracked | 0 -| 75|0x0000000709600000, 0x0000000709600000, 0x0000000709800000| 0%| F| |TAMS 0x0000000709600000| PB 0x0000000709600000| Untracked | 0 -| 76|0x0000000709800000, 0x0000000709800000, 0x0000000709a00000| 0%| F| |TAMS 0x0000000709800000| PB 0x0000000709800000| Untracked | 0 -| 77|0x0000000709a00000, 0x0000000709a00000, 0x0000000709c00000| 0%| F| |TAMS 0x0000000709a00000| PB 0x0000000709a00000| Untracked | 0 -| 78|0x0000000709c00000, 0x0000000709c00000, 0x0000000709e00000| 0%| F| |TAMS 0x0000000709c00000| PB 0x0000000709c00000| Untracked | 0 -| 79|0x0000000709e00000, 0x0000000709e00000, 0x000000070a000000| 0%| F| |TAMS 0x0000000709e00000| PB 0x0000000709e00000| Untracked | 0 -| 80|0x000000070a000000, 0x000000070a000000, 0x000000070a200000| 0%| F| |TAMS 0x000000070a000000| PB 0x000000070a000000| Untracked | 0 -| 81|0x000000070a200000, 0x000000070a200000, 0x000000070a400000| 0%| F| |TAMS 0x000000070a200000| PB 0x000000070a200000| Untracked | 0 -| 82|0x000000070a400000, 0x000000070a400000, 0x000000070a600000| 0%| F| |TAMS 0x000000070a400000| PB 0x000000070a400000| Untracked | 0 -| 83|0x000000070a600000, 0x000000070a600000, 0x000000070a800000| 0%| F| |TAMS 0x000000070a600000| PB 0x000000070a600000| Untracked | 0 -| 84|0x000000070a800000, 0x000000070a800000, 0x000000070aa00000| 0%| F| |TAMS 0x000000070a800000| PB 0x000000070a800000| Untracked | 0 -| 85|0x000000070aa00000, 0x000000070aa00000, 0x000000070ac00000| 0%| F| |TAMS 0x000000070aa00000| PB 0x000000070aa00000| Untracked | 0 -| 86|0x000000070ac00000, 0x000000070ac00000, 0x000000070ae00000| 0%| F| |TAMS 0x000000070ac00000| PB 0x000000070ac00000| Untracked | 0 -| 87|0x000000070ae00000, 0x000000070ae00000, 0x000000070b000000| 0%| F| |TAMS 0x000000070ae00000| PB 0x000000070ae00000| Untracked | 0 -| 88|0x000000070b000000, 0x000000070b000000, 0x000000070b200000| 0%| F| |TAMS 0x000000070b000000| PB 0x000000070b000000| Untracked | 0 -| 89|0x000000070b200000, 0x000000070b200000, 0x000000070b400000| 0%| F| |TAMS 0x000000070b200000| PB 0x000000070b200000| Untracked | 0 -| 90|0x000000070b400000, 0x000000070b400000, 0x000000070b600000| 0%| F| |TAMS 0x000000070b400000| PB 0x000000070b400000| Untracked | 0 -| 91|0x000000070b600000, 0x000000070b600000, 0x000000070b800000| 0%| F| |TAMS 0x000000070b600000| PB 0x000000070b600000| Untracked | 0 -| 92|0x000000070b800000, 0x000000070b800000, 0x000000070ba00000| 0%| F| |TAMS 0x000000070b800000| PB 0x000000070b800000| Untracked | 0 -| 93|0x000000070ba00000, 0x000000070ba00000, 0x000000070bc00000| 0%| F| |TAMS 0x000000070ba00000| PB 0x000000070ba00000| Untracked | 0 -| 94|0x000000070bc00000, 0x000000070bc00000, 0x000000070be00000| 0%| F| |TAMS 0x000000070bc00000| PB 0x000000070bc00000| Untracked | 0 -| 95|0x000000070be00000, 0x000000070be00000, 0x000000070c000000| 0%| F| |TAMS 0x000000070be00000| PB 0x000000070be00000| Untracked | 0 -| 96|0x000000070c000000, 0x000000070c000000, 0x000000070c200000| 0%| F| |TAMS 0x000000070c000000| PB 0x000000070c000000| Untracked | 0 -| 97|0x000000070c200000, 0x000000070c200000, 0x000000070c400000| 0%| F| |TAMS 0x000000070c200000| PB 0x000000070c200000| Untracked | 0 -| 98|0x000000070c400000, 0x000000070c400000, 0x000000070c600000| 0%| F| |TAMS 0x000000070c400000| PB 0x000000070c400000| Untracked | 0 -| 99|0x000000070c600000, 0x000000070c600000, 0x000000070c800000| 0%| F| |TAMS 0x000000070c600000| PB 0x000000070c600000| Untracked | 0 -| 100|0x000000070c800000, 0x000000070c800000, 0x000000070ca00000| 0%| F| |TAMS 0x000000070c800000| PB 0x000000070c800000| Untracked | 0 -| 101|0x000000070ca00000, 0x000000070ca00000, 0x000000070cc00000| 0%| F| |TAMS 0x000000070ca00000| PB 0x000000070ca00000| Untracked | 0 -| 102|0x000000070cc00000, 0x000000070cc00000, 0x000000070ce00000| 0%| F| |TAMS 0x000000070cc00000| PB 0x000000070cc00000| Untracked | 0 -| 103|0x000000070ce00000, 0x000000070ce00000, 0x000000070d000000| 0%| F| |TAMS 0x000000070ce00000| PB 0x000000070ce00000| Untracked | 0 -| 104|0x000000070d000000, 0x000000070d000000, 0x000000070d200000| 0%| F| |TAMS 0x000000070d000000| PB 0x000000070d000000| Untracked | 0 -| 105|0x000000070d200000, 0x000000070d200000, 0x000000070d400000| 0%| F| |TAMS 0x000000070d200000| PB 0x000000070d200000| Untracked | 0 -| 106|0x000000070d400000, 0x000000070d400000, 0x000000070d600000| 0%| F| |TAMS 0x000000070d400000| PB 0x000000070d400000| Untracked | 0 -| 107|0x000000070d600000, 0x000000070d600000, 0x000000070d800000| 0%| F| |TAMS 0x000000070d600000| PB 0x000000070d600000| Untracked | 0 -| 108|0x000000070d800000, 0x000000070d800000, 0x000000070da00000| 0%| F| |TAMS 0x000000070d800000| PB 0x000000070d800000| Untracked | 0 -| 109|0x000000070da00000, 0x000000070da00000, 0x000000070dc00000| 0%| F| |TAMS 0x000000070da00000| PB 0x000000070da00000| Untracked | 0 -| 110|0x000000070dc00000, 0x000000070dc00000, 0x000000070de00000| 0%| F| |TAMS 0x000000070dc00000| PB 0x000000070dc00000| Untracked | 0 -| 111|0x000000070de00000, 0x000000070de00000, 0x000000070e000000| 0%| F| |TAMS 0x000000070de00000| PB 0x000000070de00000| Untracked | 0 -| 112|0x000000070e000000, 0x000000070e000000, 0x000000070e200000| 0%| F| |TAMS 0x000000070e000000| PB 0x000000070e000000| Untracked | 0 -| 113|0x000000070e200000, 0x000000070e200000, 0x000000070e400000| 0%| F| |TAMS 0x000000070e200000| PB 0x000000070e200000| Untracked | 0 -| 114|0x000000070e400000, 0x000000070e4ad9d0, 0x000000070e600000| 33%| S|CS|TAMS 0x000000070e400000| PB 0x000000070e400000| Complete | 0 -| 115|0x000000070e600000, 0x000000070e800000, 0x000000070e800000|100%| S|CS|TAMS 0x000000070e600000| PB 0x000000070e600000| Complete | 0 -| 116|0x000000070e800000, 0x000000070e800000, 0x000000070ea00000| 0%| F| |TAMS 0x000000070e800000| PB 0x000000070e800000| Untracked | 0 -| 117|0x000000070ea00000, 0x000000070ea00000, 0x000000070ec00000| 0%| F| |TAMS 0x000000070ea00000| PB 0x000000070ea00000| Untracked | 0 -| 118|0x000000070ec00000, 0x000000070ec00000, 0x000000070ee00000| 0%| F| |TAMS 0x000000070ec00000| PB 0x000000070ec00000| Untracked | 0 -| 119|0x000000070ee00000, 0x000000070ee00000, 0x000000070f000000| 0%| F| |TAMS 0x000000070ee00000| PB 0x000000070ee00000| Untracked | 0 -| 120|0x000000070f000000, 0x000000070f000000, 0x000000070f200000| 0%| F| |TAMS 0x000000070f000000| PB 0x000000070f000000| Untracked | 0 -| 121|0x000000070f200000, 0x000000070f200000, 0x000000070f400000| 0%| F| |TAMS 0x000000070f200000| PB 0x000000070f200000| Untracked | 0 -| 122|0x000000070f400000, 0x000000070f400000, 0x000000070f600000| 0%| F| |TAMS 0x000000070f400000| PB 0x000000070f400000| Untracked | 0 -| 123|0x000000070f600000, 0x000000070f600000, 0x000000070f800000| 0%| F| |TAMS 0x000000070f600000| PB 0x000000070f600000| Untracked | 0 -| 124|0x000000070f800000, 0x000000070f800000, 0x000000070fa00000| 0%| F| |TAMS 0x000000070f800000| PB 0x000000070f800000| Untracked | 0 -| 125|0x000000070fa00000, 0x000000070fa00000, 0x000000070fc00000| 0%| F| |TAMS 0x000000070fa00000| PB 0x000000070fa00000| Untracked | 0 -| 126|0x000000070fc00000, 0x000000070fc00000, 0x000000070fe00000| 0%| F| |TAMS 0x000000070fc00000| PB 0x000000070fc00000| Untracked | 0 -| 127|0x000000070fe00000, 0x000000070ff64b80, 0x0000000710000000| 69%| E| |TAMS 0x000000070fe00000| PB 0x000000070fe00000| Complete | 0 - -Card table byte_map: [0x0000000103810000,0x0000000104010000] _byte_map_base: 0x0000000100010000 - -Marking Bits: (CMBitMap*) 0x0000000153039810 - Bits: [0x000000011c814000, 0x0000000120814000) - -Polling page: 0x0000000102afc000 - -Metaspace: - -Usage: - Non-class: 13.17 MB used. - Class: 1.64 MB used. - Both: 14.82 MB used. - -Virtual space: - Non-class space: 64.00 MB reserved, 13.38 MB ( 21%) committed, 1 nodes. - Class space: 1.00 GB reserved, 1.81 MB ( <1%) committed, 1 nodes. - Both: 1.06 GB reserved, 15.19 MB ( 1%) committed. - -Chunk freelists: - Non-Class: 2.35 MB - Class: 14.17 MB - Both: 16.53 MB - -MaxMetaspaceSize: unlimited -CompressedClassSpaceSize: 1.00 GB -Initial GC threshold: 21.00 MB -Current GC threshold: 21.00 MB -CDS: off - - commit_granule_bytes: 65536. - - commit_granule_words: 8192. - - virtual_space_node_default_size: 8388608. - - enlarge_chunks_in_place: 1. - - use_allocation_guard: 0. - - -Internal statistics: - -num_allocs_failed_limit: 0. -num_arena_births: 342. -num_arena_deaths: 0. -num_vsnodes_births: 2. -num_vsnodes_deaths: 0. -num_space_committed: 243. -num_space_uncommitted: 0. -num_chunks_returned_to_freelist: 0. -num_chunks_taken_from_freelist: 560. -num_chunk_merges: 0. -num_chunk_splits: 335. -num_chunks_enlarged: 197. -num_inconsistent_stats: 0. - -CodeHeap 'non-profiled nmethods': size=120032Kb used=384Kb max_used=384Kb free=119647Kb - bounds [0x00000001152dc000, 0x000000011554c000, 0x000000011c814000] -CodeHeap 'profiled nmethods': size=120016Kb used=2434Kb max_used=2434Kb free=117581Kb - bounds [0x000000010d814000, 0x000000010da84000, 0x0000000114d48000] -CodeHeap 'non-nmethods': size=5712Kb used=1357Kb max_used=1371Kb free=4355Kb - bounds [0x0000000114d48000, 0x0000000114fb8000, 0x00000001152dc000] - total_blobs=1734 nmethods=1258 adapters=383 - compilation: enabled - stopped_count=0, restarted_count=0 - full_count=0 - -Compilation events (20 events): -Event: 2.564 Thread 0x000000015180a200 nmethod 1250 0x000000010da51990 code [0x000000010da51dc0, 0x000000010da52f58] -Event: 2.564 Thread 0x000000015180a200 1227 3 java.util.Arrays::copyOfRange (90 bytes) -Event: 2.564 Thread 0x000000015180a200 nmethod 1227 0x000000010da53690 code [0x000000010da539c0, 0x000000010da54630] -Event: 2.565 Thread 0x000000015180a200 1252 3 jdk.internal.classfile.impl.AbstractElement:: (5 bytes) -Event: 2.565 Thread 0x000000015180a200 nmethod 1252 0x000000010da54b90 code [0x000000010da54d40, 0x000000010da54eb8] -Event: 2.565 Thread 0x000000015180a200 1253 3 java.lang.constant.ConstantUtils::skipOverFieldSignature (296 bytes) -Event: 2.565 Thread 0x000000015180a200 nmethod 1253 0x000000010da54f90 code [0x000000010da55480, 0x000000010da57138] -Event: 2.565 Thread 0x000000015180a200 1254 3 jdk.internal.classfile.impl.DirectCodeBuilder::with (9 bytes) -Event: 2.566 Thread 0x000000015180a200 nmethod 1254 0x000000010da57c10 code [0x000000010da57e40, 0x000000010da58710] -Event: 2.566 Thread 0x000000015180a200 1255 3 jdk.internal.classfile.impl.DirectCodeBuilder::with (30 bytes) -Event: 2.566 Thread 0x000000015180a200 nmethod 1255 0x000000010da58990 code [0x000000010da58bc0, 0x000000010da59330] -Event: 2.566 Thread 0x000000015180a200 1256 3 jdk.internal.classfile.impl.SplitConstantPool::map (145 bytes) -Event: 2.567 Thread 0x000000015180a200 nmethod 1256 0x000000010da59590 code [0x000000010da59880, 0x000000010da5a610] -Event: 2.567 Thread 0x000000015180a200 1258 3 jdk.internal.util.ReferencedKeyMap::removeStaleReferences (30 bytes) -Event: 2.567 Thread 0x000000015180a200 nmethod 1258 0x000000010da5aa90 code [0x000000010da5ac80, 0x000000010da5b060] -Event: 2.567 Thread 0x000000015180a200 1259 3 java.util.stream.Sink$ChainedReference::cancellationRequested (10 bytes) -Event: 2.567 Thread 0x000000015180a200 nmethod 1259 0x000000010da5b190 code [0x000000010da5b340, 0x000000010da5b560] -Event: 2.567 Thread 0x000000015180a200 1257 3 jdk.internal.org.objectweb.asm.MethodVisitor::visitInsn (16 bytes) -Event: 2.567 Thread 0x000000015180a200 nmethod 1257 0x000000010da5b610 code [0x000000010da5b7c0, 0x000000010da5ba18] -Event: 2.568 Thread 0x000000015180a200 1262 3 jdk.internal.classfile.impl.StackMapGenerator::processBlock (2767 bytes) - -GC Heap History (2 events): -Event: 2.558 GC heap before -{Heap before GC invocations=0 (full 0): - garbage-first heap total reserved 4194304K, committed 262144K, used 22528K [0x0000000700000000, 0x0000000800000000) - region size 2048K, 12 young (24576K), 0 survivors (0K) - Metaspace used 14793K, committed 15104K, reserved 1114112K - class space used 1618K, committed 1792K, reserved 1048576K -} -Event: 2.561 GC heap after -{Heap after GC invocations=1 (full 0): - garbage-first heap total reserved 4194304K, committed 262144K, used 2742K [0x0000000700000000, 0x0000000800000000) - region size 2048K, 2 young (4096K), 2 survivors (4096K) - Metaspace used 14793K, committed 15104K, reserved 1114112K - class space used 1618K, committed 1792K, reserved 1048576K -} - -Dll operation events (8 events): -Event: 0.006 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjava.dylib -Event: 0.006 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libzip.dylib -Event: 0.069 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libinstrument.dylib -Event: 0.079 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libnio.dylib -Event: 0.083 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libzip.dylib -Event: 0.122 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjimage.dylib -Event: 2.507 Loaded shared library libsomelib.dylib -Event: 2.511 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libsyslookup.dylib - -Deoptimization events (20 events): -Event: 2.489 Thread 0x0000000153008200 DEOPT PACKING pc=0x00000001153242bc sp=0x000000016d5a2920 -Event: 2.489 Thread 0x0000000153008200 DEOPT UNPACKING pc=0x0000000114d8b01c sp=0x000000016d5a28b0 mode 2 -Event: 2.489 Thread 0x0000000153008200 Uncommon trap: trap_request=0xffffffde fr.pc=0x00000001153242bc relative=0x00000000000000fc -Event: 2.489 Thread 0x0000000153008200 Uncommon trap: reason=class_check action=maybe_recompile pc=0x00000001153242bc method=jdk.internal.misc.Unsafe.allocateUninitializedArray(Ljava/lang/Class;I)Ljava/lang/Object; @ 51 c2 -Event: 2.489 Thread 0x0000000153008200 DEOPT PACKING pc=0x00000001153242bc sp=0x000000016d5a2920 -Event: 2.489 Thread 0x0000000153008200 DEOPT UNPACKING pc=0x0000000114d8b01c sp=0x000000016d5a28b0 mode 2 -Event: 2.499 Thread 0x0000000153008200 Uncommon trap: trap_request=0xffffff45 fr.pc=0x0000000115323920 relative=0x00000000000000e0 -Event: 2.499 Thread 0x0000000153008200 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000115323920 method=sun.net.www.ParseUtil.firstEncodeIndex(Ljava/lang/String;)I @ 51 c2 -Event: 2.499 Thread 0x0000000153008200 DEOPT PACKING pc=0x0000000115323920 sp=0x000000016d5a2780 -Event: 2.499 Thread 0x0000000153008200 DEOPT UNPACKING pc=0x0000000114d8b01c sp=0x000000016d5a2700 mode 2 -Event: 2.544 Thread 0x0000000153008200 DEOPT PACKING pc=0x000000010d9ef3c8 sp=0x000000016d5a2500 -Event: 2.544 Thread 0x0000000153008200 DEOPT UNPACKING pc=0x0000000114d8ae7c sp=0x000000016d5a2300 mode 3 -Event: 2.562 Thread 0x0000000153008200 Uncommon trap: trap_request=0xffffff45 fr.pc=0x000000011532e4e8 relative=0x00000000000000a8 -Event: 2.562 Thread 0x0000000153008200 Uncommon trap: reason=unstable_if action=reinterpret pc=0x000000011532e4e8 method=java.lang.ref.ReferenceQueue.headIsNull()Z @ 4 c2 -Event: 2.562 Thread 0x0000000153008200 DEOPT PACKING pc=0x000000011532e4e8 sp=0x000000016d5a1890 -Event: 2.562 Thread 0x0000000153008200 DEOPT UNPACKING pc=0x0000000114d8b01c sp=0x000000016d5a1750 mode 2 -Event: 2.562 Thread 0x0000000153008200 Uncommon trap: trap_request=0xffffff45 fr.pc=0x0000000115320dec relative=0x000000000000006c -Event: 2.562 Thread 0x0000000153008200 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000115320dec method=java.lang.ref.ReferenceQueue.headIsNull()Z @ 4 c2 -Event: 2.562 Thread 0x0000000153008200 DEOPT PACKING pc=0x0000000115320dec sp=0x000000016d5a1800 -Event: 2.562 Thread 0x0000000153008200 DEOPT UNPACKING pc=0x0000000114d8b01c sp=0x000000016d5a1730 mode 2 - -Classes loaded (20 events): -Event: 2.568 Loading class jdk/internal/classfile/impl/BufferedCodeBuilder -Event: 2.568 Loading class jdk/internal/classfile/impl/BufferedCodeBuilder done -Event: 2.568 Loading class jdk/internal/classfile/impl/TransformingCodeBuilder -Event: 2.568 Loading class jdk/internal/classfile/impl/TransformingCodeBuilder done -Event: 2.569 Loading class java/lang/classfile/instruction/ThrowInstruction -Event: 2.569 Loading class java/lang/classfile/instruction/ThrowInstruction done -Event: 2.569 Loading class jdk/internal/classfile/impl/AbstractInstruction$UnboundThrowInstruction -Event: 2.569 Loading class jdk/internal/classfile/impl/AbstractInstruction$UnboundThrowInstruction done -Event: 2.569 Loading class java/lang/classfile/instruction/ExceptionCatch -Event: 2.569 Loading class java/lang/classfile/instruction/ExceptionCatch done -Event: 2.569 Loading class jdk/internal/classfile/impl/AbstractPseudoInstruction$ExceptionCatchImpl -Event: 2.569 Loading class jdk/internal/classfile/impl/AbstractPseudoInstruction -Event: 2.569 Loading class jdk/internal/classfile/impl/AbstractPseudoInstruction done -Event: 2.569 Loading class jdk/internal/classfile/impl/AbstractPseudoInstruction$ExceptionCatchImpl done -Event: 2.569 Loading class jdk/internal/classfile/impl/StackMapGenerator$RawExceptionCatch -Event: 2.569 Loading class jdk/internal/classfile/impl/StackMapGenerator$RawExceptionCatch done -Event: 2.569 Loading class jdk/internal/classfile/impl/SplitConstantPool$1 -Event: 2.569 Loading class jdk/internal/classfile/impl/SplitConstantPool$1 done -Event: 2.570 Loading class java/lang/invoke/ConstantBootstraps -Event: 2.570 Loading class java/lang/invoke/ConstantBootstraps done - -Classes unloaded (0 events): -No events - -Classes redefined (0 events): -No events - -Internal exceptions (20 events): -Event: 2.544 Thread 0x0000000153008200 Exception (0x000000070e87d458) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 2.545 Thread 0x0000000153008200 Exception (0x000000070e8a0820) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 2.546 Thread 0x0000000153008200 Exception (0x000000070e8a4e70) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 2.546 Thread 0x0000000153008200 Exception (0x000000070e8a8a28) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 2.546 Thread 0x0000000153008200 Exception (0x000000070e8b0578) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 2.546 Thread 0x0000000153008200 Exception (0x000000070e8b7550) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 2.546 Thread 0x0000000153008200 Exception (0x000000070e8be520) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 2.546 Thread 0x0000000153008200 Exception (0x000000070e8c2fd8) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 2.547 Thread 0x0000000153008200 Exception (0x000000070e8e12b0) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 2.551 Thread 0x0000000153008200 Exception (0x000000070e92fd70) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 841] -Event: 2.552 Thread 0x0000000153008200 Exception (0x000000070e9468c8) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 2.555 Thread 0x0000000153008200 Exception (0x000000070e9b1518) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 2.556 Thread 0x0000000153008200 Exception (0x000000070e9bc2b0) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 2.556 Thread 0x0000000153008200 Exception (0x000000070e9cdbf0) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 2.557 Thread 0x0000000153008200 Exception (0x000000070e9ea260) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 2.557 Thread 0x0000000153008200 Exception (0x000000070e9ef730) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 2.563 Thread 0x0000000153008200 Exception (0x000000070fe72398) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 2.567 Thread 0x0000000153008200 Exception (0x000000070feb20c0) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 2.570 Thread 0x0000000153008200 Exception (0x000000070ff0e030) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 2.570 Thread 0x0000000153008200 Exception (0x000000070ff22090) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] - -ZGC Phase Switch (0 events): -No events - -VM Operations (20 events): -Event: 0.258 Executing VM operation: ICBufferFull -Event: 0.258 Executing VM operation: ICBufferFull done -Event: 0.262 Executing VM operation: HandshakeAllThreads (Deoptimize) -Event: 0.262 Executing VM operation: HandshakeAllThreads (Deoptimize) done -Event: 0.267 Executing VM operation: get/set locals -Event: 0.267 Executing VM operation: get/set locals done -Event: 0.268 Executing VM operation: get/set locals -Event: 0.268 Executing VM operation: get/set locals done -Event: 2.064 Executing VM operation: get/set locals -Event: 2.064 Executing VM operation: get/set locals done -Event: 2.064 Executing VM operation: get/set locals -Event: 2.064 Executing VM operation: get/set locals done -Event: 2.067 Executing VM operation: get/set locals -Event: 2.067 Executing VM operation: get/set locals done -Event: 2.492 Executing VM operation: ChangeBreakpoints -Event: 2.493 Executing VM operation: ChangeBreakpoints done -Event: 2.493 Executing VM operation: ChangeBreakpoints -Event: 2.493 Executing VM operation: ChangeBreakpoints done -Event: 2.557 Executing VM operation: G1CollectForAllocation (G1 Evacuation Pause) -Event: 2.561 Executing VM operation: G1CollectForAllocation (G1 Evacuation Pause) done - -Events (20 events): -Event: 0.023 Thread 0x000000015201a200 Thread added: 0x000000015201a200 -Event: 0.023 Protecting memory [0x000000016e934000,0x000000016e940000] with protection modes 0 -Event: 0.024 Thread 0x000000015180f200 Thread added: 0x000000015180f200 -Event: 0.024 Protecting memory [0x000000016eb40000,0x000000016eb4c000] with protection modes 0 -Event: 0.024 Thread 0x000000015180e400 Thread added: 0x000000015180e400 -Event: 0.024 Protecting memory [0x000000016ed4c000,0x000000016ed58000] with protection modes 0 -Event: 0.024 Thread 0x0000000151809a00 Thread added: 0x0000000151809a00 -Event: 0.024 Protecting memory [0x000000016ef58000,0x000000016ef64000] with protection modes 0 -Event: 0.024 Thread 0x000000015180a200 Thread added: 0x000000015180a200 -Event: 0.024 Protecting memory [0x000000016f164000,0x000000016f170000] with protection modes 0 -Event: 0.044 Thread 0x0000000131008200 Thread added: 0x0000000131008200 -Event: 0.044 Protecting memory [0x000000016f370000,0x000000016f37c000] with protection modes 0 -Event: 0.059 Thread 0x00000001518c8200 Thread added: 0x00000001518c8200 -Event: 0.059 Protecting memory [0x000000016f57c000,0x000000016f588000] with protection modes 0 -Event: 0.059 Thread 0x00000001518c8a00 Thread added: 0x00000001518c8a00 -Event: 0.059 Protecting memory [0x000000016f788000,0x000000016f794000] with protection modes 0 -Event: 0.059 Thread 0x00000001518c9200 Thread added: 0x00000001518c9200 -Event: 0.059 Protecting memory [0x000000016f994000,0x000000016f9a0000] with protection modes 0 -Event: 0.075 Thread 0x000000013102fa00 Thread added: 0x000000013102fa00 -Event: 0.075 Protecting memory [0x000000016fba0000,0x000000016fbac000] with protection modes 0 - - -Dynamic libraries: -0x0000000102f70000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjli.dylib -0x00000001a96bb000 /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa -0x0000000192c62000 /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit -0x0000000195cce000 /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData -0x0000000190515000 /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation -0x000000019bfdc000 /usr/lib/libSystem.B.dylib -0x0000000193f9f000 /System/Library/PrivateFrameworks/UIFoundation.framework/Versions/A/UIFoundation -0x000000022ab7f000 /System/Library/PrivateFrameworks/CollectionViewCore.framework/Versions/A/CollectionViewCore -0x00000001a3255000 /System/Library/PrivateFrameworks/RemoteViewServices.framework/Versions/A/RemoteViewServices -0x0000000199e89000 /System/Library/PrivateFrameworks/XCTTargetBootstrap.framework/Versions/A/XCTTargetBootstrap -0x000000019e618000 /System/Library/PrivateFrameworks/InternationalSupport.framework/Versions/A/InternationalSupport -0x000000019e66c000 /System/Library/PrivateFrameworks/UserActivity.framework/Versions/A/UserActivity -0x000000024efd6000 /System/Library/PrivateFrameworks/WindowManagement.framework/Versions/A/WindowManagement -0x0000000190195000 /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration -0x000000019da86000 /usr/lib/libspindump.dylib -0x0000000194154000 /System/Library/Frameworks/UniformTypeIdentifiers.framework/Versions/A/UniformTypeIdentifiers -0x0000000197d00000 /usr/lib/libapp_launch_measurement.dylib -0x0000000197126000 /System/Library/PrivateFrameworks/CoreAnalytics.framework/Versions/A/CoreAnalytics -0x0000000197d07000 /System/Library/PrivateFrameworks/CoreAutoLayout.framework/Versions/A/CoreAutoLayout -0x00000001996a9000 /System/Library/Frameworks/Metal.framework/Versions/A/Metal -0x000000019a631000 /usr/lib/liblangid.dylib -0x0000000199e8f000 /System/Library/PrivateFrameworks/CoreSVG.framework/Versions/A/CoreSVG -0x0000000194b19000 /System/Library/PrivateFrameworks/SkyLight.framework/Versions/A/SkyLight -0x0000000194fba000 /System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics -0x00000001a392f000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate -0x000000019d8e0000 /System/Library/PrivateFrameworks/IconServices.framework/Versions/A/IconServices -0x0000000199687000 /System/Library/Frameworks/IOSurface.framework/Versions/A/IOSurface -0x0000000197155000 /usr/lib/libDiagnosticMessagesClient.dylib -0x000000019bf1e000 /usr/lib/libz.1.dylib -0x00000001a70d4000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices -0x0000000199e71000 /System/Library/PrivateFrameworks/DFRFoundation.framework/Versions/A/DFRFoundation -0x00000001924bc000 /usr/lib/libicucore.A.dylib -0x000000019f676000 /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox -0x000000019e627000 /System/Library/PrivateFrameworks/DataDetectorsCore.framework/Versions/A/DataDetectorsCore -0x00000001b809a000 /System/Library/PrivateFrameworks/TextInput.framework/Versions/A/TextInput -0x0000000194a6a000 /usr/lib/libMobileGestalt.dylib -0x0000000199bad000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox -0x000000019762c000 /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore -0x00000001920e9000 /System/Library/Frameworks/Security.framework/Versions/A/Security -0x00000001a3295000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SpeechRecognition.framework/Versions/A/SpeechRecognition -0x0000000197a2e000 /System/Library/PrivateFrameworks/CoreUI.framework/Versions/A/CoreUI -0x00000001919e2000 /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio -0x0000000197239000 /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration -0x000000019dee2000 /System/Library/PrivateFrameworks/MultitouchSupport.framework/Versions/A/MultitouchSupport -0x0000000194a68000 /usr/lib/libenergytrace.dylib -0x00000001ad793000 /System/Library/PrivateFrameworks/RenderBox.framework/Versions/A/RenderBox -0x0000000192b16000 /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit -0x00000001a366a000 /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices -0x0000000197c8c000 /System/Library/PrivateFrameworks/PerformanceAnalysis.framework/Versions/A/PerformanceAnalysis -0x00000001e603f000 /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL -0x0000000197d51000 /usr/lib/libxml2.2.dylib -0x000000019b360000 /System/Library/PrivateFrameworks/MobileKeyBag.framework/Versions/A/MobileKeyBag -0x000000018ef80000 /usr/lib/libobjc.A.dylib -0x000000018f274000 /usr/lib/libc++.1.dylib -0x00000001a35e7000 /System/Library/Frameworks/Accessibility.framework/Versions/A/Accessibility -0x000000019569a000 /System/Library/Frameworks/ColorSync.framework/Versions/A/ColorSync -0x000000018f3c0000 /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation -0x000000019a1ec000 /System/Library/Frameworks/CoreImage.framework/Versions/A/CoreImage -0x00000001917ed000 /System/Library/Frameworks/CoreText.framework/Versions/A/CoreText -0x00000001ea89e000 /System/Library/Frameworks/CoreTransferable.framework/Versions/A/CoreTransferable -0x00000001ead63000 /System/Library/Frameworks/DeveloperToolsSupport.framework/Versions/A/DeveloperToolsSupport -0x0000000199eca000 /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO -0x0000000224d1f000 /System/Library/Frameworks/Symbols.framework/Versions/A/Symbols -0x000000019bfe2000 /System/Library/PrivateFrameworks/SoftLinking.framework/Versions/A/SoftLinking -0x000000019f028000 /usr/lib/swift/libswiftCore.dylib -0x00000001b4d27000 /usr/lib/swift/libswiftCoreFoundation.dylib -0x00000001b2790000 /usr/lib/swift/libswiftCoreGraphics.dylib -0x00000001b4d71000 /usr/lib/swift/libswiftCoreImage.dylib -0x00000001b2797000 /usr/lib/swift/libswiftDarwin.dylib -0x00000001a4cda000 /usr/lib/swift/libswiftDispatch.dylib -0x00000001b4d72000 /usr/lib/swift/libswiftIOKit.dylib -0x00000001c07cc000 /usr/lib/swift/libswiftMetal.dylib -0x00000001cde91000 /usr/lib/swift/libswiftOSLog.dylib -0x00000001a754f000 /usr/lib/swift/libswiftObjectiveC.dylib -0x00000001c4f00000 /usr/lib/swift/libswiftQuartzCore.dylib -0x00000001c9005000 /usr/lib/swift/libswiftUniformTypeIdentifiers.dylib -0x00000001b4d39000 /usr/lib/swift/libswiftXPC.dylib -0x000000025747d000 /usr/lib/swift/libswift_Concurrency.dylib -0x00000001a7553000 /usr/lib/swift/libswiftos.dylib -0x00000001b7ffe000 /usr/lib/swift/libswiftsimd.dylib -0x000000019c191000 /usr/lib/libcompression.dylib -0x000000019e572000 /System/Library/PrivateFrameworks/TextureIO.framework/Versions/A/TextureIO -0x000000019d58c000 /usr/lib/libate.dylib -0x000000019bfd6000 /usr/lib/system/libcache.dylib -0x000000019bf90000 /usr/lib/system/libcommonCrypto.dylib -0x000000019bfbc000 /usr/lib/system/libcompiler_rt.dylib -0x000000019bfb2000 /usr/lib/system/libcopyfile.dylib -0x000000018f0c4000 /usr/lib/system/libcorecrypto.dylib -0x000000018f1aa000 /usr/lib/system/libdispatch.dylib -0x000000018f365000 /usr/lib/system/libdyld.dylib -0x000000019bfcc000 /usr/lib/system/libkeymgr.dylib -0x000000019bf68000 /usr/lib/system/libmacho.dylib -0x000000019b448000 /usr/lib/system/libquarantine.dylib -0x000000019bfc9000 /usr/lib/system/libremovefile.dylib -0x0000000194ae0000 /usr/lib/system/libsystem_asl.dylib -0x000000018f059000 /usr/lib/system/libsystem_blocks.dylib -0x000000018f1f5000 /usr/lib/system/libsystem_c.dylib -0x000000019bfc0000 /usr/lib/system/libsystem_collections.dylib -0x000000019a620000 /usr/lib/system/libsystem_configuration.dylib -0x000000019965c000 /usr/lib/system/libsystem_containermanager.dylib -0x000000019bbff000 /usr/lib/system/libsystem_coreservices.dylib -0x0000000192783000 /usr/lib/system/libsystem_darwin.dylib -0x00000002577ca000 /usr/lib/system/libsystem_darwindirectory.dylib -0x000000019bfcd000 /usr/lib/system/libsystem_dnssd.dylib -0x00000002577ce000 /usr/lib/system/libsystem_eligibility.dylib -0x000000018f1f2000 /usr/lib/system/libsystem_featureflags.dylib -0x000000018f393000 /usr/lib/system/libsystem_info.dylib -0x000000019bf2d000 /usr/lib/system/libsystem_m.dylib -0x000000018f16d000 /usr/lib/system/libsystem_malloc.dylib -0x0000000194a4d000 /usr/lib/system/libsystem_networkextension.dylib -0x0000000192bf9000 /usr/lib/system/libsystem_notify.dylib -0x000000019a625000 /usr/lib/system/libsystem_sandbox.dylib -0x00000002577d2000 /usr/lib/system/libsystem_sanitizers.dylib -0x000000019bfc5000 /usr/lib/system/libsystem_secinit.dylib -0x000000018f31d000 /usr/lib/system/libsystem_kernel.dylib -0x000000018f38b000 /usr/lib/system/libsystem_platform.dylib -0x000000018f358000 /usr/lib/system/libsystem_pthread.dylib -0x00000001964d0000 /usr/lib/system/libsystem_symptoms.dylib -0x000000018f0a9000 /usr/lib/system/libsystem_trace.dylib -0x000000019bf9e000 /usr/lib/system/libunwind.dylib -0x000000018f05e000 /usr/lib/system/libxpc.dylib -0x000000018f301000 /usr/lib/libc++abi.dylib -0x000000019bfaa000 /usr/lib/liboah.dylib -0x000000019d438000 /usr/lib/liblzma.5.dylib -0x000000019bfde000 /usr/lib/libfakelink.dylib -0x0000000194679000 /System/Library/Frameworks/CFNetwork.framework/Versions/A/CFNetwork -0x000000019c032000 /usr/lib/libarchive.2.dylib -0x00000001a1568000 /System/Library/Frameworks/Combine.framework/Versions/A/Combine -0x000000022ab93000 /System/Library/PrivateFrameworks/CollectionsInternal.framework/Versions/A/CollectionsInternal -0x0000000241543000 /System/Library/PrivateFrameworks/ReflectionInternal.framework/Versions/A/ReflectionInternal -0x0000000241ad5000 /System/Library/PrivateFrameworks/RuntimeInternal.framework/Versions/A/RuntimeInternal -0x00000002575d1000 /usr/lib/swift/libswift_StringProcessing.dylib -0x0000000192a94000 /System/Library/PrivateFrameworks/CoreServicesInternal.framework/Versions/A/CoreServicesInternal -0x000000019b46f000 /usr/lib/libbsm.0.dylib -0x000000019bf70000 /usr/lib/system/libkxld.dylib -0x0000000197cc8000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/FSEvents.framework/Versions/A/FSEvents -0x000000019278e000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore -0x000000019719e000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata -0x000000019bc05000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices -0x000000019c0bb000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit -0x0000000196451000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE -0x000000018f899000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices -0x000000019d3e1000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/DictionaryServices.framework/Versions/A/DictionaryServices -0x0000000197cd5000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SharedFileList.framework/Versions/A/SharedFileList -0x000000019c15b000 /usr/lib/libapple_nghttp2.dylib -0x00000001960c5000 /usr/lib/libsqlite3.dylib -0x00000001964d9000 /System/Library/Frameworks/Network.framework/Versions/A/Network -0x0000000255e8e000 /usr/lib/libCoreEntitlements.dylib -0x000000023c44d000 /System/Library/PrivateFrameworks/MessageSecurity.framework/Versions/A/MessageSecurity -0x00000001960ab000 /System/Library/PrivateFrameworks/ProtocolBuffer.framework/Versions/A/ProtocolBuffer -0x000000019bb2e000 /System/Library/PrivateFrameworks/AppleFSCompression.framework/Versions/A/AppleFSCompression -0x000000019b457000 /usr/lib/libcoretls.dylib -0x000000019d457000 /usr/lib/libcoretls_cfhelpers.dylib -0x000000019c18b000 /usr/lib/libpam.2.dylib -0x000000019d4c9000 /usr/lib/libxar.1.dylib -0x000000019d8b7000 /usr/lib/libheimdal-asn1.dylib -0x0000000194678000 /usr/lib/libnetwork.dylib -0x000000019bfe3000 /usr/lib/libpcap.A.dylib -0x00000001964c5000 /usr/lib/libdns_services.dylib -0x000000019a62d000 /System/Library/PrivateFrameworks/AppleSystemInfo.framework/Versions/A/AppleSystemInfo -0x000000019b155000 /System/Library/PrivateFrameworks/IOMobileFramebuffer.framework/Versions/A/IOMobileFramebuffer -0x0000000257528000 /usr/lib/swift/libswift_RegexParser.dylib -0x000000019bbf2000 /usr/lib/libbz2.1.0.dylib -0x000000019b44b000 /usr/lib/libCheckFix.dylib -0x0000000194af8000 /System/Library/PrivateFrameworks/TCC.framework/Versions/A/TCC -0x000000019a633000 /System/Library/PrivateFrameworks/CoreNLP.framework/Versions/A/CoreNLP -0x0000000197157000 /System/Library/PrivateFrameworks/MetadataUtilities.framework/Versions/A/MetadataUtilities -0x000000019b481000 /usr/lib/libmecab.dylib -0x0000000190229000 /usr/lib/libCRFSuite.dylib -0x000000019b4dd000 /usr/lib/libgermantok.dylib -0x000000019c132000 /usr/lib/libThaiTokenizer.dylib -0x0000000197242000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.framework/Versions/A/vImage -0x00000001a3641000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/vecLib -0x000000019d510000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvMisc.dylib -0x000000019b030000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvDSP.dylib -0x000000018fca0000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib -0x000000019c266000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib -0x000000019b4e0000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLinearAlgebra.dylib -0x000000019c176000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparseBLAS.dylib -0x000000019c261000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libQuadrature.dylib -0x000000019a75c000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBNNS.dylib -0x000000019012e000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparse.dylib -0x000000023ab9c000 /System/Library/PrivateFrameworks/MIL.framework/Versions/A/MIL -0x000000019c019000 /usr/lib/libiconv.2.dylib -0x000000019bf64000 /usr/lib/libcharset.1.dylib -0x0000000197ca8000 /System/Library/Frameworks/OpenDirectory.framework/Versions/A/Frameworks/CFOpenDirectory.framework/Versions/A/CFOpenDirectory -0x0000000197c98000 /System/Library/Frameworks/OpenDirectory.framework/Versions/A/OpenDirectory -0x000000019d459000 /System/Library/PrivateFrameworks/APFS.framework/Versions/A/APFS -0x000000019b387000 /System/Library/Frameworks/SecurityFoundation.framework/Versions/A/SecurityFoundation -0x000000019d4d8000 /usr/lib/libutil.dylib -0x0000000238cfd000 /System/Library/PrivateFrameworks/InstalledContentLibrary.framework/Versions/A/InstalledContentLibrary -0x0000000192ad5000 /System/Library/PrivateFrameworks/CoreServicesStore.framework/Versions/A/CoreServicesStore -0x0000000228340000 /System/Library/PrivateFrameworks/AppleMobileFileIntegrity.framework/Versions/A/AppleMobileFileIntegrity -0x00000001b4cf5000 /usr/lib/libmis.dylib -0x00000001c53e7000 /System/Library/PrivateFrameworks/MobileSystemServices.framework/Versions/A/MobileSystemServices -0x00000001e3449000 /System/Library/PrivateFrameworks/ConfigProfileHelper.framework/Versions/A/ConfigProfileHelper -0x000000019c134000 /System/Library/PrivateFrameworks/AppleSauce.framework/Versions/A/AppleSauce -0x0000000191173000 /System/Library/PrivateFrameworks/LanguageModeling.framework/Versions/A/LanguageModeling -0x000000019d4dc000 /usr/lib/libxslt.1.dylib -0x000000019c020000 /usr/lib/libcmph.dylib -0x000000019b121000 /System/Library/PrivateFrameworks/CoreEmoji.framework/Versions/A/CoreEmoji -0x000000019a756000 /System/Library/PrivateFrameworks/LinguisticData.framework/Versions/A/LinguisticData -0x000000019003c000 /System/Library/PrivateFrameworks/Lexicon.framework/Versions/A/Lexicon -0x000000019b415000 /System/Library/PrivateFrameworks/BackgroundTaskManagement.framework/Versions/A/BackgroundTaskManagement -0x0000000256078000 /usr/lib/libTLE.dylib -0x000000019dda8000 /System/Library/PrivateFrameworks/AppleJPEG.framework/Versions/A/AppleJPEG -0x000000019d89c000 /usr/lib/libexpat.1.dylib -0x000000019e3d0000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libPng.dylib -0x000000019e3fb000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib -0x000000019e4e6000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libGIF.dylib -0x000000019ddee000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJP2.dylib -0x000000019e48b000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib -0x000000019e482000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libRadiance.dylib -0x0000000199a48000 /System/Library/PrivateFrameworks/FontServices.framework/libFontParser.dylib -0x00000001963ea000 /System/Library/PrivateFrameworks/RunningBoardServices.framework/Versions/A/RunningBoardServices -0x00000001a9f95000 /System/Library/PrivateFrameworks/IOSurfaceAccelerator.framework/Versions/A/IOSurfaceAccelerator -0x000000019dede000 /System/Library/PrivateFrameworks/WatchdogClient.framework/Versions/A/WatchdogClient -0x0000000191359000 /System/Library/Frameworks/CoreDisplay.framework/Versions/A/CoreDisplay -0x00000001998ff000 /System/Library/Frameworks/CoreMedia.framework/Versions/A/CoreMedia -0x000000019969f000 /System/Library/PrivateFrameworks/IOAccelerator.framework/Versions/A/IOAccelerator -0x0000000197e3b000 /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo -0x000000019c189000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/MetalPerformanceShaders -0x000000019df21000 /System/Library/Frameworks/VideoToolbox.framework/Versions/A/VideoToolbox -0x0000000197ed7000 /System/Library/PrivateFrameworks/UserManagement.framework/Versions/A/UserManagement -0x0000000196311000 /System/Library/PrivateFrameworks/BaseBoard.framework/Versions/A/BaseBoard -0x000000019a62b000 /System/Library/PrivateFrameworks/AggregateDictionary.framework/Versions/A/AggregateDictionary -0x000000022817a000 /System/Library/PrivateFrameworks/AppleKeyStore.framework/Versions/A/AppleKeyStore -0x000000019e47d000 /System/Library/PrivateFrameworks/GPUWrangler.framework/Versions/A/GPUWrangler -0x000000019e45d000 /System/Library/PrivateFrameworks/IOPresentment.framework/Versions/A/IOPresentment -0x000000019e485000 /System/Library/PrivateFrameworks/DSExternalDisplay.framework/Versions/A/DSExternalDisplay -0x0000000234d8a000 /System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/32023/Libraries/libllvm-flatbuffers.dylib -0x00000001e6032000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCoreFSCache.dylib -0x00000002319ee000 /System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/32023/Libraries/libGPUCompilerUtils.dylib -0x000000019e4ec000 /System/Library/PrivateFrameworks/CMCaptureCore.framework/Versions/A/CMCaptureCore -0x00000001eae86000 /System/Library/Frameworks/ExtensionFoundation.framework/Versions/A/ExtensionFoundation -0x00000001a5543000 /System/Library/PrivateFrameworks/CoreTime.framework/Versions/A/CoreTime -0x000000019da70000 /System/Library/PrivateFrameworks/AppServerSupport.framework/Versions/A/AppServerSupport -0x00000001a0004000 /System/Library/PrivateFrameworks/perfdata.framework/Versions/A/perfdata -0x000000019147d000 /System/Library/PrivateFrameworks/AudioToolboxCore.framework/Versions/A/AudioToolboxCore -0x00000001998d5000 /System/Library/PrivateFrameworks/caulk.framework/Versions/A/caulk -0x000000019f872000 /usr/lib/libAudioStatistics.dylib -0x00000001b402e000 /System/Library/PrivateFrameworks/SystemPolicy.framework/Versions/A/SystemPolicy -0x000000019fb4b000 /usr/lib/libSMC.dylib -0x00000001a953d000 /System/Library/Frameworks/CoreMIDI.framework/Versions/A/CoreMIDI -0x000000019e397000 /usr/lib/libAudioToolboxUtility.dylib -0x00000001af42f000 /System/Library/PrivateFrameworks/OSAServicesClient.framework/Versions/A/OSAServicesClient -0x00000001a0012000 /usr/lib/libperfcheck.dylib -0x00000001a4ffa000 /System/Library/PrivateFrameworks/BoardServices.framework/Versions/A/BoardServices -0x000000019d784000 /System/Library/PrivateFrameworks/PlugInKit.framework/Versions/A/PlugInKit -0x000000019b379000 /System/Library/PrivateFrameworks/AssertionServices.framework/Versions/A/AssertionServices -0x00000001a864e000 /System/Library/PrivateFrameworks/ASEProcessing.framework/Versions/A/ASEProcessing -0x00000001d1318000 /System/Library/PrivateFrameworks/Symbolication.framework/Versions/A/Symbolication -0x0000000240330000 /System/Library/PrivateFrameworks/PhotosensitivityProcessing.framework/Versions/A/PhotosensitivityProcessing -0x000000019da21000 /System/Library/PrivateFrameworks/GraphVisualizer.framework/Versions/A/GraphVisualizer -0x00000001e6094000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib -0x00000001e6053000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGFXShared.dylib -0x00000001e622c000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib -0x00000001e605c000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLImage.dylib -0x00000001e6050000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCVMSPluginSupport.dylib -0x0000000256030000 /usr/lib/libRosetta.dylib -0x00000001e6039000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCoreVMClient.dylib -0x000000022fbf4000 /System/Library/PrivateFrameworks/FontServices.framework/Versions/A/FontServices -0x000000019da2d000 /System/Library/PrivateFrameworks/OTSVG.framework/Versions/A/OTSVG -0x00000001979dc000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/Resources/libFontRegistry.dylib -0x000000019da7b000 /System/Library/PrivateFrameworks/FontServices.framework/libhvf.dylib -0x000000022fbf5000 /System/Library/PrivateFrameworks/FontServices.framework/libXTFontStaticRegistryData.dylib -0x000000019a572000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSCore.framework/Versions/A/MPSCore -0x000000019ba9c000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSImage.framework/Versions/A/MPSImage -0x000000019b4f5000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSNeuralNetwork.framework/Versions/A/MPSNeuralNetwork -0x000000019b940000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSMatrix.framework/Versions/A/MPSMatrix -0x000000019b74b000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSRayIntersector.framework/Versions/A/MPSRayIntersector -0x000000019b972000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSNDArray.framework/Versions/A/MPSNDArray -0x00000001ec760000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSFunctions.framework/Versions/A/MPSFunctions -0x00000001ec745000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSBenchmarkLoop.framework/Versions/A/MPSBenchmarkLoop -0x000000018fb54000 /System/Library/PrivateFrameworks/MetalTools.framework/Versions/A/MetalTools -0x00000001b91d7000 /System/Library/PrivateFrameworks/IOAccelMemoryInfo.framework/Versions/A/IOAccelMemoryInfo -0x00000001c52e0000 /System/Library/PrivateFrameworks/kperf.framework/Versions/A/kperf -0x00000001b4d1a000 /System/Library/PrivateFrameworks/GPURawCounter.framework/Versions/A/GPURawCounter -0x00000001a5415000 /System/Library/PrivateFrameworks/CoreSymbolication.framework/Versions/A/CoreSymbolication -0x00000001b4cc6000 /System/Library/PrivateFrameworks/MallocStackLogging.framework/Versions/A/MallocStackLogging -0x000000019d626000 /System/Library/PrivateFrameworks/CrashReporterSupport.framework/Versions/A/CrashReporterSupport -0x00000001a53d0000 /System/Library/PrivateFrameworks/DebugSymbols.framework/Versions/A/DebugSymbols -0x00000001c3c47000 /System/Library/PrivateFrameworks/OSAnalytics.framework/Versions/A/OSAnalytics -0x000000024d229000 /System/Library/PrivateFrameworks/VideoToolboxParavirtualizationSupport.framework/Versions/A/VideoToolboxParavirtualizationSupport -0x000000019d850000 /System/Library/PrivateFrameworks/AppleVA.framework/Versions/A/AppleVA -0x000000019f8ba000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS -0x0000000195849000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices -0x000000019e4fa000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/PrintCore -0x000000019fca4000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/QD.framework/Versions/A/QD -0x000000019fc98000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSyncLegacy.framework/Versions/A/ColorSyncLegacy -0x000000019f88a000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis -0x000000019e4b6000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATSUI.framework/Versions/A/ATSUI -0x000000019fc2b000 /usr/lib/libcups.2.dylib -0x00000001a0020000 /System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos -0x00000001a0031000 /System/Library/Frameworks/GSS.framework/Versions/A/GSS -0x000000019f939000 /usr/lib/libresolv.9.dylib -0x000000019da8c000 /System/Library/PrivateFrameworks/Heimdal.framework/Versions/A/Heimdal -0x00000001a74bc000 /System/Library/Frameworks/Kerberos.framework/Versions/A/Libraries/libHeimdalProxy.dylib -0x00000001a008b000 /System/Library/PrivateFrameworks/CommonAuth.framework/Versions/A/CommonAuth -0x00000001e9c6c000 /System/Library/Frameworks/AVFAudio.framework/Versions/A/AVFAudio -0x00000001af47e000 /System/Library/PrivateFrameworks/AXCoreUtilities.framework/Versions/A/AXCoreUtilities -0x000000023a274000 /System/Library/PrivateFrameworks/IsolatedCoreAudioClient.framework/Versions/A/IsolatedCoreAudioClient -0x000000019f7f6000 /System/Library/PrivateFrameworks/AudioSession.framework/Versions/A/AudioSession -0x00000001a1307000 /System/Library/Frameworks/IOBluetooth.framework/Versions/A/IOBluetooth -0x000000019d95b000 /System/Library/PrivateFrameworks/MediaExperience.framework/Versions/A/MediaExperience -0x000000019f635000 /System/Library/PrivateFrameworks/AudioSession.framework/libSessionUtility.dylib -0x000000019fcb0000 /System/Library/PrivateFrameworks/AudioResourceArbitration.framework/Versions/A/AudioResourceArbitration -0x00000001a4388000 /System/Library/PrivateFrameworks/PowerLog.framework/Versions/A/PowerLog -0x00000001a42a6000 /System/Library/Frameworks/CoreBluetooth.framework/Versions/A/CoreBluetooth -0x00000001a74bd000 /System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit -0x000000019b1e2000 /System/Library/PrivateFrameworks/CoreUtils.framework/Versions/A/CoreUtils -0x000000022de3f000 /System/Library/PrivateFrameworks/CoreUtilsExtras.framework/Versions/A/CoreUtilsExtras -0x0000000238b8a000 /System/Library/PrivateFrameworks/IO80211.framework/Versions/A/IO80211 -0x00000001a4f3e000 /System/Library/PrivateFrameworks/FrontBoardServices.framework/Versions/A/FrontBoardServices -0x00000001a6a85000 /System/Library/PrivateFrameworks/BackBoardServices.framework/Versions/A/BackBoardServices -0x000000019d8c2000 /System/Library/PrivateFrameworks/IconFoundation.framework/Versions/A/IconFoundation -0x00000001a3281000 /System/Library/PrivateFrameworks/SpeechRecognitionCore.framework/Versions/A/SpeechRecognitionCore -0x00000001af49d000 /usr/lib/libAccessibility.dylib -0x00000001a397b000 /System/Library/Frameworks/MediaAccessibility.framework/Versions/A/MediaAccessibility -0x00000001d49cc000 /System/Library/Frameworks/OSLog.framework/Versions/A/OSLog -0x00000001b4c54000 /System/Library/PrivateFrameworks/LoggingSupport.framework/Versions/A/LoggingSupport -0x000000010417c000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/server/libjvm.dylib -0x0000000102b10000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjimage.dylib -0x0000000102b70000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjdwp.dylib -0x0000000102bbc000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjava.dylib -0x0000000102b3c000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libinstrument.dylib -0x0000000102c14000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libzip.dylib -0x0000000255d1b000 /usr/lib/i18n/libiconv_std.dylib -0x0000000255d03000 /usr/lib/i18n/libUTF8.dylib -0x0000000255d23000 /usr/lib/i18n/libmapper_none.dylib -0x0000000102bec000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libdt_socket.dylib -0x0000000102e9c000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libnio.dylib -0x0000000102e7c000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libnet.dylib -0x000000010407c000 /Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/libsomelib.dylib -0x0000000102b64000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libsyslookup.dylib - - -VM Arguments: -jvm_args: -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:60574,suspend=y,server=n -ea -Didea.test.cyclic.buffer.size=1048576 -javaagent:/Users/cristina/Library/Caches/JetBrains/IdeaIC2024.1/captureAgent/debugger-agent.jar -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 -java_command: com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit5 dev.diplomattest.somelib.Float64VecTest,testFloat64Vec -java_class_path (initial): /Users/cristina/.m2/repository/org/junit/platform/junit-platform-launcher/1.10.3/junit-platform-launcher-1.10.3.jar:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/lib/idea_rt.jar:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/plugins/junit/lib/junit5-rt.jar:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/plugins/junit/lib/junit-rt.jar:/Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/target/test-classes:/Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/target/classes:/Users/cristina/.m2/repository/net/java/dev/jna/jna/5.14.0/jna-5.14.0.jar:/Users/cristina/.m2/repository/org/junit/jupiter/junit-jupiter/5.10.3/junit-jupiter-5.10.3.jar:/Users/cristina/.m2/repository/org/junit/jupiter/junit-jupiter-api/5.10.3/junit-jupiter-api-5.10.3.jar:/Users/cristina/.m2/repository/org/opentest4j/opentest4j/1.3.0/opentest4j-1.3.0.jar:/Users/cristina/.m2/repository/org/junit/platform/junit-platform-commons/1.10.3/junit-platform-commons-1.10.3.jar:/Users/cristina/.m2/repository/org/apiguardian/apiguardian-api/1.1.2/apiguardian-api-1.1.2.jar:/Users/cristina/.m2/repository/org/junit/jupiter/junit-jupiter-params/5.10.3/junit-jupiter-params-5.10.3.jar:/Users/cristina/.m2/repository/org/junit/jupiter/junit-jupiter-engine/5.10.3/junit-jupiter-engine-5.10.3.jar:/Users/cristina/.m2/repository/org/junit/platform/junit-platform-engine/1.10.3/junit-platform-engine-1.10.3.jar:/Users/cristina/.m2/repository/org/openjdk/jmh/jmh-core/1.37/jmh-core-1.37.jar:/Users/cristina/.m2/repository/net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4.jar:/Users/cristina/.m2/repository/org/apache/commons/commons-math3/3.6.1/commons-math3-3.6.1.jar:/Users/cristina/.m2/repository/org/openjdk/jmh/jmh-generator-annprocess/1.37/jmh-generator-annprocess-1.37.jar -Launcher Type: SUN_STANDARD - -[Global flags] - intx CICompilerCount = 4 {product} {ergonomic} - uint ConcGCThreads = 2 {product} {ergonomic} - uint G1ConcRefinementThreads = 8 {product} {ergonomic} - size_t G1HeapRegionSize = 2097152 {product} {ergonomic} - size_t InitialHeapSize = 268435456 {product} {ergonomic} - size_t MarkStackSize = 4194304 {product} {ergonomic} - size_t MaxHeapSize = 4294967296 {product} {ergonomic} - size_t MaxNewSize = 2575302656 {product} {ergonomic} - size_t MinHeapDeltaBytes = 2097152 {product} {ergonomic} - size_t MinHeapSize = 8388608 {product} {ergonomic} - uintx NonNMethodCodeHeapSize = 5839564 {pd product} {ergonomic} - uintx NonProfiledCodeHeapSize = 122909338 {pd product} {ergonomic} - uintx ProfiledCodeHeapSize = 122909338 {pd product} {ergonomic} - uintx ReservedCodeCacheSize = 251658240 {pd product} {ergonomic} - bool SegmentedCodeCache = true {product} {ergonomic} - size_t SoftMaxHeapSize = 4294967296 {manageable} {ergonomic} - bool UseCompressedOops = true {product lp64_product} {ergonomic} - bool UseG1GC = true {product} {ergonomic} - bool UseNUMA = false {product} {ergonomic} - bool UseNUMAInterleaving = false {product} {ergonomic} - -Logging: -Log output configuration: - #0: stdout all=warning uptime,level,tags foldmultilines=false - #1: stderr all=off uptime,level,tags foldmultilines=false - -Environment Variables: -JAVA_HOME=/Users/cristina/Library/Java/JavaVirtualMachines/corretto-19.0.1/Contents/Home/ -PATH=/Users/cristina/bin/jextract-22/bin:/bin:/Users/cristina/.modular/pkg/packages.modular.com_mojo/bin:/Users/cristina/Downloads/dart-sdk/bin:/opt/homebrew/Cellar/llvm/15.0.6/bin:/opt/homebrew/opt/openjdk/bin:/Users/cristina/.elan/bin:/Users/cristina/bin:/Users/cristina/Library/Application Support/Coursier/bin:/Users/cristina/Library/Python/3.8/bin:/Users/cristina/.local/bin:/Users/cristina/.cargo/bin:/Users/cristina/.cargo:/opt/homebrew/bin:/Users/cristina/.fzf/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/X11/bin:/Library/Apple/usr/bin:/usr/local/go/bin:/Library/TeX/texbin:/Users/cristina/.krew/bin -SHELL=/opt/homebrew/bin/fish -LC_CTYPE=en_US.UTF-8 -TMPDIR=/var/folders/x_/9qhndrhs79j640bxvmbkddfw0000gn/T/ - -Active Locale: -LC_ALL=C/en_US.UTF-8/C/C/C/C -LC_COLLATE=C -LC_CTYPE=en_US.UTF-8 -LC_MESSAGES=C -LC_MONETARY=C -LC_NUMERIC=C -LC_TIME=C - -Signal Handlers: - SIGSEGV: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_ONSTACK|SA_RESTART|SA_SIGINFO, unblocked - SIGBUS: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, unblocked - SIGFPE: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, unblocked - SIGPIPE: javaSignalHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked - SIGXFSZ: javaSignalHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked - SIGILL: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, unblocked - SIGUSR2: SR_handler in libjvm.dylib, mask=00100000000000000000000000000000, flags=SA_RESTART|SA_SIGINFO, blocked - SIGHUP: UserHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked - SIGINT: UserHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked - SIGTERM: UserHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked - SIGQUIT: UserHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked - SIGTRAP: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, unblocked - - -Periodic native trim disabled - ---------------- S Y S T E M --------------- - -OS: -uname: Darwin 23.5.0 Darwin Kernel Version 23.5.0: Wed May 1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000 arm64 -OS uptime: 45 days 10:05 hours -rlimit (soft/hard): STACK 8176k/65520k , CORE 0k/infinity , NPROC 2666/4000 , NOFILE 10240/infinity , AS infinity/infinity , CPU infinity/infinity , DATA infinity/infinity , FSIZE infinity/infinity , MEMLOCK infinity/infinity , RSS infinity/infinity -load average: 3.74 4.24 4.42 - -CPU: total 8 (initial active 8) 0x61:0x0:0x1b588bb3:0, fp, asimd, aes, pmull, sha1, sha256, crc32, lse, sha3, sha512 -machdep.cpu.brand_string:Apple M1 Pro -hw.cachelinesize:128 -hw.l1icachesize:131072 -hw.l1dcachesize:65536 -hw.l2cachesize:4194304 - -Memory: 16k page, physical 16777216k(65072k free), swap 3145728k(1371968k free) - -vm_info: OpenJDK 64-Bit Server VM (22.0.1+8) for bsd-aarch64 JRE (22.0.1+8), built on 2024-04-16T00:00:00Z by "admin" with clang Apple LLVM 15.0.0 (clang-1500.1.0.2.5) - -END. diff --git a/feature_tests/java/somelib/hs_err_pid98821.log b/feature_tests/java/somelib/hs_err_pid98821.log deleted file mode 100644 index f00be4315..000000000 --- a/feature_tests/java/somelib/hs_err_pid98821.log +++ /dev/null @@ -1,1245 +0,0 @@ -# -# A fatal error has been detected by the Java Runtime Environment: -# -# SIGSEGV (0xb) at pc=0x0000000105bcdaec, pid=98821, tid=10243 -# -# JRE version: OpenJDK Runtime Environment Temurin-22.0.1+8 (22.0.1+8) (build 22.0.1+8) -# Java VM: OpenJDK 64-Bit Server VM Temurin-22.0.1+8 (22.0.1+8, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-aarch64) -# Problematic frame: -# C [libsomelib.dylib+0x5aec] Float64Vec_new_isize+0xb4 -# -# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again -# -# If you would like to submit a bug report, please visit: -# https://github.com/adoptium/adoptium-support/issues -# The crash happened outside the Java Virtual Machine in native code. -# See problematic frame for where to report the bug. -# - ---------------- S U M M A R Y ------------ - -Command Line: -ea -Didea.test.cyclic.buffer.size=1048576 -javaagent:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/lib/idea_rt.jar=60586:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/bin -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit5 dev.diplomattest.somelib.Float64VecTest,testFloat64Vec - -Host: "MacBookPro18,3" arm64, 8 cores, 16G, Darwin 23.5.0, macOS 14.5 (23F79) -Time: Wed Aug 14 21:07:19 2024 CEST elapsed time: 0.277129 seconds (0d 0h 0m 0s) - ---------------- T H R E A D --------------- - -Current thread (0x0000000124008c00): JavaThread "main" [_thread_in_native, id=10243, stack(0x000000016b8d8000,0x000000016badb000) (2060K)] - -Stack: [0x000000016b8d8000,0x000000016badb000], sp=0x000000016bad7870, free space=2046k -Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) -C [libsomelib.dylib+0x5aec] Float64Vec_new_isize+0xb4 -v ~RuntimeStub::nep_invoker_blob 0x00000001376700bc -j java.lang.invoke.LambdaForm$MH+0x00001fff001d0400.invoke(Ljava/lang/Object;JJJ)J+12 java.base@22.0.1 -j java.lang.invoke.LambdaForm$MH+0x00001fff001d3000.invokeExact_MT(Ljava/lang/Object;JJJLjava/lang/Object;)J+23 java.base@22.0.1 -j jdk.internal.foreign.abi.DowncallStub+0x00001fff001d1000.invoke(Ljava/lang/foreign/SegmentAllocator;Ljava/lang/foreign/MemorySegment;Ljava/lang/foreign/MemorySegment;)Ljava/lang/foreign/MemorySegment;+69 java.base@22.0.1 -j java.lang.invoke.LambdaForm$DMH+0x00001fff001d1400.invokeStaticInit(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+14 java.base@22.0.1 -j java.lang.invoke.LambdaForm$MH+0x00001fff001d2400.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+44 java.base@22.0.1 -j java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+19 java.base@22.0.1 -j dev.diplomattest.somelib.ntv.somelib_h.Float64Vec_new_isize(Ljava/lang/foreign/MemorySegment;)Ljava/lang/foreign/MemorySegment;+26 -j dev.diplomattest.somelib.Float64Vec.newIsize([J)Ldev/diplomattest/somelib/Float64Vec;+38 -j dev.diplomattest.somelib.Float64VecTest.testFloat64Vec()V+53 -j java.lang.invoke.LambdaForm$DMH+0x00001fff0014c000.invokeVirtual(Ljava/lang/Object;Ljava/lang/Object;)V+10 java.base@22.0.1 -j java.lang.invoke.LambdaForm$MH+0x00001fff0014c800.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+31 java.base@22.0.1 -j java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+19 java.base@22.0.1 -j jdk.internal.reflect.DirectMethodHandleAccessor.invokeImpl(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+41 java.base@22.0.1 -j jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+23 java.base@22.0.1 -j java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+102 java.base@22.0.1 -j org.junit.platform.commons.util.ReflectionUtils.invokeMethod(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+42 -j org.junit.jupiter.engine.execution.MethodInvocation.proceed()Ljava/lang/Object;+16 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed()Ljava/lang/Object;+8 -j org.junit.jupiter.engine.extension.TimeoutExtension.intercept(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/TimeoutDuration;Lorg/junit/jupiter/engine/extension/TimeoutExtension$TimeoutProvider;)Ljava/lang/Object;+28 -j org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/TimeoutExtension$TimeoutProvider;)Ljava/lang/Object;+31 -j org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)V+9 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda+0x00001fff00117940.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)V+5 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall$VoidMethodInterceptorCall;Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)Ljava/lang/Void;+6 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall$$Lambda+0x00001fff00117d50.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)Ljava/lang/Object;+9 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+6 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$$Lambda+0x00001fff00146488.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+14 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed()Ljava/lang/Object;+12 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+1 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/engine/execution/InvocationInterceptorChain$InterceptorCall;Ljava/util/List;)Ljava/lang/Object;+24 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InvocationInterceptorChain$InterceptorCall;)Ljava/lang/Object;+31 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;)Ljava/lang/Object;+15 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(Ljava/lang/reflect/Method;Ljava/lang/Object;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;)Ljava/lang/Object;+55 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;)V+28 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda+0x00001fff00145aa8.execute()V+12 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)V+21 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;+44 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;+6 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+79 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00001fff00135220.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00001fff00135000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 -j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00001fff001379d8.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService$$Lambda+0x00001fff00135d10.accept(Ljava/lang/Object;)V+4 -j java.util.ArrayList.forEach(Ljava/util/function/Consumer;)V+46 java.base@22.0.1 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(Ljava/util/List;)V+6 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+116 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00001fff00135220.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00001fff00135000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 -j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00001fff001379d8.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService$$Lambda+0x00001fff00135d10.accept(Ljava/lang/Object;)V+4 -j java.util.ArrayList.forEach(Ljava/util/function/Consumer;)V+46 java.base@22.0.1 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(Ljava/util/List;)V+6 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+116 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00001fff00135220.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00001fff00135000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 -j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00001fff001379d8.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(Lorg/junit/platform/engine/support/hierarchical/HierarchicalTestExecutorService$TestTask;)Ljava/util/concurrent/Future;+1 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute()Ljava/util/concurrent/Future;+74 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(Lorg/junit/platform/engine/ExecutionRequest;)V+31 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/engine/TestDescriptor;Lorg/junit/platform/engine/EngineExecutionListener;Lorg/junit/platform/engine/ConfigurationParameters;Lorg/junit/platform/engine/TestEngine;)V+24 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/LauncherDiscoveryResult;Lorg/junit/platform/engine/EngineExecutionListener;)V+115 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;Lorg/junit/platform/engine/EngineExecutionListener;Lorg/junit/platform/launcher/TestExecutionListener;)V+55 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(Lorg/junit/platform/launcher/core/InternalTestPlan;Lorg/junit/platform/launcher/TestExecutionListener;)V+6 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator$$Lambda+0x00001fff00121e90.accept(Ljava/lang/Object;)V+12 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(Lorg/junit/platform/engine/ConfigurationParameters;Lorg/junit/platform/launcher/core/ListenerRegistry;Ljava/util/function/Consumer;)V+51 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;[Lorg/junit/platform/launcher/TestExecutionListener;)V+23 -j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;[Lorg/junit/platform/launcher/TestExecutionListener;)V+6 -j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+34 -j org.junit.platform.launcher.core.DelegatingLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+6 -j org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+13 -j com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs([Ljava/lang/String;Ljava/lang/String;IZ)I+203 -j com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(Z)I+17 -j com.intellij.rt.execution.junit.TestsRepeater.repeat(IZLcom/intellij/rt/execution/junit/TestsRepeater$TestRun;)I+7 -j com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(Lcom/intellij/rt/junit/IdeaTestRunner;[Ljava/lang/String;Ljava/util/ArrayList;Ljava/lang/String;IZ)I+25 -j com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart([Ljava/lang/String;Ljava/lang/String;Ljava/util/ArrayList;Ljava/lang/String;)I+117 -j com.intellij.rt.junit.JUnitStarter.main([Ljava/lang/String;)V+97 -v ~StubRoutines::call_stub 0x0000000137534154 -...... -Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) -v ~RuntimeStub::nep_invoker_blob 0x000000013767008c -j java.lang.invoke.LambdaForm$MH+0x00001fff001d0400.invoke(Ljava/lang/Object;JJJ)J+12 java.base@22.0.1 -j java.lang.invoke.LambdaForm$MH+0x00001fff001d3000.invokeExact_MT(Ljava/lang/Object;JJJLjava/lang/Object;)J+23 java.base@22.0.1 -j jdk.internal.foreign.abi.DowncallStub+0x00001fff001d1000.invoke(Ljava/lang/foreign/SegmentAllocator;Ljava/lang/foreign/MemorySegment;Ljava/lang/foreign/MemorySegment;)Ljava/lang/foreign/MemorySegment;+69 java.base@22.0.1 -j java.lang.invoke.LambdaForm$DMH+0x00001fff001d1400.invokeStaticInit(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+14 java.base@22.0.1 -j java.lang.invoke.LambdaForm$MH+0x00001fff001d2400.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+44 java.base@22.0.1 -j java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+19 java.base@22.0.1 -j dev.diplomattest.somelib.ntv.somelib_h.Float64Vec_new_isize(Ljava/lang/foreign/MemorySegment;)Ljava/lang/foreign/MemorySegment;+26 -j dev.diplomattest.somelib.Float64Vec.newIsize([J)Ldev/diplomattest/somelib/Float64Vec;+38 -j dev.diplomattest.somelib.Float64VecTest.testFloat64Vec()V+53 -j java.lang.invoke.LambdaForm$DMH+0x00001fff0014c000.invokeVirtual(Ljava/lang/Object;Ljava/lang/Object;)V+10 java.base@22.0.1 -j java.lang.invoke.LambdaForm$MH+0x00001fff0014c800.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+31 java.base@22.0.1 -j java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+19 java.base@22.0.1 -j jdk.internal.reflect.DirectMethodHandleAccessor.invokeImpl(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+41 java.base@22.0.1 -j jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+23 java.base@22.0.1 -j java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+102 java.base@22.0.1 -j org.junit.platform.commons.util.ReflectionUtils.invokeMethod(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+42 -j org.junit.jupiter.engine.execution.MethodInvocation.proceed()Ljava/lang/Object;+16 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed()Ljava/lang/Object;+8 -j org.junit.jupiter.engine.extension.TimeoutExtension.intercept(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/TimeoutDuration;Lorg/junit/jupiter/engine/extension/TimeoutExtension$TimeoutProvider;)Ljava/lang/Object;+28 -j org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/TimeoutExtension$TimeoutProvider;)Ljava/lang/Object;+31 -j org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)V+9 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda+0x00001fff00117940.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)V+5 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall$VoidMethodInterceptorCall;Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)Ljava/lang/Void;+6 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall$$Lambda+0x00001fff00117d50.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)Ljava/lang/Object;+9 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+6 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$$Lambda+0x00001fff00146488.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+14 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed()Ljava/lang/Object;+12 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+1 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/engine/execution/InvocationInterceptorChain$InterceptorCall;Ljava/util/List;)Ljava/lang/Object;+24 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InvocationInterceptorChain$InterceptorCall;)Ljava/lang/Object;+31 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;)Ljava/lang/Object;+15 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(Ljava/lang/reflect/Method;Ljava/lang/Object;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;)Ljava/lang/Object;+55 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;)V+28 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda+0x00001fff00145aa8.execute()V+12 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)V+21 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;+44 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;+6 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+79 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00001fff00135220.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00001fff00135000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 -j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00001fff001379d8.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService$$Lambda+0x00001fff00135d10.accept(Ljava/lang/Object;)V+4 -j java.util.ArrayList.forEach(Ljava/util/function/Consumer;)V+46 java.base@22.0.1 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(Ljava/util/List;)V+6 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+116 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00001fff00135220.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00001fff00135000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 -j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00001fff001379d8.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService$$Lambda+0x00001fff00135d10.accept(Ljava/lang/Object;)V+4 -j java.util.ArrayList.forEach(Ljava/util/function/Consumer;)V+46 java.base@22.0.1 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(Ljava/util/List;)V+6 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+116 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00001fff00135220.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00001fff00135000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 -j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00001fff001379d8.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(Lorg/junit/platform/engine/support/hierarchical/HierarchicalTestExecutorService$TestTask;)Ljava/util/concurrent/Future;+1 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute()Ljava/util/concurrent/Future;+74 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(Lorg/junit/platform/engine/ExecutionRequest;)V+31 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/engine/TestDescriptor;Lorg/junit/platform/engine/EngineExecutionListener;Lorg/junit/platform/engine/ConfigurationParameters;Lorg/junit/platform/engine/TestEngine;)V+24 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/LauncherDiscoveryResult;Lorg/junit/platform/engine/EngineExecutionListener;)V+115 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;Lorg/junit/platform/engine/EngineExecutionListener;Lorg/junit/platform/launcher/TestExecutionListener;)V+55 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(Lorg/junit/platform/launcher/core/InternalTestPlan;Lorg/junit/platform/launcher/TestExecutionListener;)V+6 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator$$Lambda+0x00001fff00121e90.accept(Ljava/lang/Object;)V+12 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(Lorg/junit/platform/engine/ConfigurationParameters;Lorg/junit/platform/launcher/core/ListenerRegistry;Ljava/util/function/Consumer;)V+51 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;[Lorg/junit/platform/launcher/TestExecutionListener;)V+23 -j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;[Lorg/junit/platform/launcher/TestExecutionListener;)V+6 -j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+34 -j org.junit.platform.launcher.core.DelegatingLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+6 -j org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+13 -j com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs([Ljava/lang/String;Ljava/lang/String;IZ)I+203 -j com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(Z)I+17 -j com.intellij.rt.execution.junit.TestsRepeater.repeat(IZLcom/intellij/rt/execution/junit/TestsRepeater$TestRun;)I+7 -j com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(Lcom/intellij/rt/junit/IdeaTestRunner;[Ljava/lang/String;Ljava/util/ArrayList;Ljava/lang/String;IZ)I+25 -j com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart([Ljava/lang/String;Ljava/lang/String;Ljava/util/ArrayList;Ljava/lang/String;)I+117 -j com.intellij.rt.junit.JUnitStarter.main([Ljava/lang/String;)V+97 -v ~StubRoutines::call_stub 0x0000000137534154 - -siginfo: si_signo: 11 (SIGSEGV), si_code: 2 (SEGV_ACCERR), si_addr: 0x0000000000000001 - -Registers: - x0=0x00006000008d4a90 x1=0x00000000a0fab7fb x2=0x0000000000000010 x3=0x0000000000000000 - x4=0x0000000000000004 x5=0x0000000021000000 x6=0x00006000008d4a90 x7=0x0000000000000eb0 - x8=0x0000000000000000 x9=0x0000000000000000 x10=0x0000000000000a90 x11=0x0000000000000010 -x12=0x0000000000000001 x13=0x00000000fffffca9 x14=0x00000000000007fb x15=0x00000000a0fab7fb -x16=0x00000000000000a9 x17=0x0000000000000356 x18=0x0000000000000000 x19=0x0000000000000010 -x20=0x0000000000000002 x21=0x00006000008d4a90 x22=0x0000000105c18141 x23=0x0000000000000001 -x24=0x000000016bad79b8 x25=0x0000000101bc8000 x26=0x000000014cc21bf8 x27=0x0000000000000000 -x28=0x0000000124008c00 fp=0x000000016bad78a0 lr=0x0000000105bcda7c sp=0x000000016bad7870 -pc=0x0000000105bcdaec cpsr=0x0000000080001000 - -Register to memory mapping: - -x0 =0x00006000008d4a90 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00 -x1 =0x00000000a0fab7fb is an unknown value -x2 =0x0000000000000010 is an unknown value -x3 =0x0 is null -x4 =0x0000000000000004 is an unknown value -x5 =0x0000000021000000 is an unknown value -x6 =0x00006000008d4a90 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00 -x7 =0x0000000000000eb0 is an unknown value -x8 =0x0 is null -x9 =0x0 is null -x10=0x0000000000000a90 is an unknown value -x11=0x0000000000000010 is an unknown value -x12=0x0000000000000001 is an unknown value -x13=0x00000000fffffca9 is an unknown value -x14=0x00000000000007fb is an unknown value -x15=0x00000000a0fab7fb is an unknown value -x16=0x00000000000000a9 is an unknown value -x17=0x0000000000000356 is an unknown value -x18=0x0 is null -x19=0x0000000000000010 is an unknown value -x20=0x0000000000000002 is an unknown value -x21=0x00006000008d4a90 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00 -x22=0x0000000105c18141: __rust_no_alloc_shim_is_unstable+0 in /Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/libsomelib.dylib at 0x0000000105bc8000 -x23=0x0000000000000001 is an unknown value -x24=0x000000016bad79b8 is pointing into the stack for thread: 0x0000000124008c00 -x25=0x0000000101bc8000 is an unknown value -x26=0x000000014cc21bf8 is pointing into metadata -x27=0x0 is null -x28=0x0000000124008c00 is a thread - fp=0x000000016bad78a0 is pointing into the stack for thread: 0x0000000124008c00 - lr=0x0000000105bcda7c: Float64Vec_new_isize+0x44 in /Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/libsomelib.dylib at 0x0000000105bc8000 - sp=0x000000016bad7870 is pointing into the stack for thread: 0x0000000124008c00 - -Top of Stack: (sp=0x000000016bad7870) -0x000000016bad7870: 000000016bad79b8 0000000101bc8000 -0x000000016bad7880: 000000014cc21a54 000000010699d2b0 -0x000000016bad7890: 000000016bad78e8 000000016bad78d0 -0x000000016bad78a0: 000000016bad78c0 00000001376700bc -0x000000016bad78b0: 000000016bad7970 8743000137547504 -0x000000016bad78c0: 000000016bad7970 00000001375391b0 -0x000000016bad78d0: 000000070ee4f370 fffffffffffffff2 -0x000000016bad78e0: 0000000000000000 000000070ec68228 -0x000000016bad78f0: 0000000000000002 0000000000000000 -0x000000016bad7900: 0000000000000001 0000000000000000 -0x000000016bad7910: 0000000105bcda38 0000000000000000 -0x000000016bad7920: fffffffffffffff6 000000014cc21a54 -0x000000016bad7930: 0000000000000009 000000014cc21bf8 -0x000000016bad7940: 000000070ec753d8 ffffffffffffffec -0x000000016bad7950: 0000000000000000 000000014cc21a60 -0x000000016bad7960: ffffffffffffffef 000000016bad7970 -0x000000016bad7970: 000000016bad7a10 00000001375391b0 -0x000000016bad7980: 000000070ec68228 0000000000000002 -0x000000016bad7990: 0000000000000000 0000000000000001 -0x000000016bad79a0: 0000000000000000 0000000105bcda38 -0x000000016bad79b0: 0000000000000000 000000070ec754f0 -0x000000016bad79c0: fffffffffffffff6 000000014cc2729f -0x000000016bad79d0: 0000000000000009 000000014cc27460 -0x000000016bad79e0: 000000070ece0ae8 ffffffffffffffec -0x000000016bad79f0: 0000000000000000 000000014cc272b0 -0x000000016bad7a00: ffffffffffffffef 000000016bad7a10 -0x000000016bad7a10: 000000016bad7ab0 00000001375391b0 -0x000000016bad7a20: 000000070efd3000 0000000000000002 -0x000000016bad7a30: 0000000000000000 0000000000000001 -0x000000016bad7a40: 0000000000000000 0000000105bcda38 -0x000000016bad7a50: 0000000000000000 000000070ec754f0 -0x000000016bad7a60: fffffffffffffff6 000000014cc23465 - -Instructions: (pc=0x0000000105bcdaec) -0x0000000105bcd9ec: f6 57 41 a9 f8 5f c4 a8 c0 03 5f d6 00 01 80 52 -0x0000000105bcd9fc: 01 03 80 52 c7 d9 00 94 20 00 20 d4 16 00 80 d2 -0x0000000105bcda0c: e0 03 16 aa e1 03 15 aa bd d9 00 94 f5 03 00 aa -0x0000000105bcda1c: b3 00 00 b4 61 f2 7d d3 e0 03 14 aa 02 01 80 52 -0x0000000105bcda2c: 3a 03 00 94 e0 03 15 aa 54 db 00 94 f8 5f bc a9 -0x0000000105bcda3c: f6 57 01 a9 f4 4f 02 a9 fd 7b 03 a9 fd c3 00 91 -0x0000000105bcda4c: f4 03 01 aa 15 01 80 52 3f 00 00 f1 b7 02 80 9a -0x0000000105bcda5c: 33 f0 7d d3 56 02 00 f0 d6 06 05 91 e1 04 00 b4 -0x0000000105bcda6c: df 02 40 39 e0 03 13 aa 01 01 80 52 26 03 00 94 -0x0000000105bcda7c: 40 06 00 b4 f5 03 00 aa 08 00 80 d2 9f 22 00 f1 -0x0000000105bcda8c: e3 02 00 54 a9 02 17 cb 3f 01 01 f1 83 02 00 54 -0x0000000105bcda9c: 09 00 80 d2 88 f2 7d 92 ea 82 00 91 eb 03 08 aa -0x0000000105bcdaac: 4c 01 09 8b 80 05 7f ad 82 0d 40 ad 00 d8 61 4e -0x0000000105bcdabc: 21 d8 61 4e 42 d8 61 4e 63 d8 61 4e ac 02 09 8b -0x0000000105bcdacc: 80 05 00 ad 82 0d 01 ad 29 01 01 91 6b 21 00 f1 -0x0000000105bcdadc: 81 fe ff 54 1f 01 14 eb 00 01 00 54 09 f1 7d d3 -0x0000000105bcdaec: e0 6a 69 fc 00 d8 61 5e a0 6a 29 fc 08 05 00 91 -0x0000000105bcdafc: 9f 02 08 eb 41 ff ff 54 df 02 40 39 00 03 80 52 -0x0000000105bcdb0c: 01 01 80 52 00 03 00 94 00 01 00 b4 14 54 00 a9 -0x0000000105bcdb1c: 14 08 00 f9 fd 7b 43 a9 f4 4f 42 a9 f6 57 41 a9 -0x0000000105bcdb2c: f8 5f c4 a8 c0 03 5f d6 00 01 80 52 01 03 80 52 -0x0000000105bcdb3c: 78 d9 00 94 20 00 20 d4 00 01 80 52 e1 03 13 aa -0x0000000105bcdb4c: 6f d9 00 94 f6 03 00 aa b4 00 00 b4 e0 03 15 aa -0x0000000105bcdb5c: e1 03 13 aa 02 01 80 52 ec 02 00 94 e0 03 16 aa -0x0000000105bcdb6c: 06 db 00 94 f8 5f bc a9 f6 57 01 a9 f4 4f 02 a9 -0x0000000105bcdb7c: fd 7b 03 a9 fd c3 00 91 f4 03 01 aa 15 01 80 52 -0x0000000105bcdb8c: 3f 00 00 f1 b7 02 80 9a 33 f0 7d d3 56 02 00 f0 -0x0000000105bcdb9c: d6 06 05 91 e1 04 00 b4 df 02 40 39 e0 03 13 aa -0x0000000105bcdbac: 01 01 80 52 d8 02 00 94 40 06 00 b4 f5 03 00 aa -0x0000000105bcdbbc: 08 00 80 d2 9f 22 00 f1 e3 02 00 54 a9 02 17 cb -0x0000000105bcdbcc: 3f 01 01 f1 83 02 00 54 09 00 80 d2 88 f2 7d 92 -0x0000000105bcdbdc: ea 82 00 91 eb 03 08 aa 4c 01 09 8b 80 05 7f ad - - -Stack slot to memory mapping: - -stack at sp + 0 slots: 0x000000016bad79b8 is pointing into the stack for thread: 0x0000000124008c00 -stack at sp + 1 slots: 0x0000000101bc8000 is an unknown value -stack at sp + 2 slots: 0x000000014cc21a54 is pointing into metadata -stack at sp + 3 slots: 0x000000010699d2b0: _ZN19TemplateInterpreter13_active_tableE+0 in /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/server/libjvm.dylib at 0x0000000105c48000 -stack at sp + 4 slots: 0x000000016bad78e8 is pointing into the stack for thread: 0x0000000124008c00 -stack at sp + 5 slots: 0x000000016bad78d0 is pointing into the stack for thread: 0x0000000124008c00 -stack at sp + 6 slots: 0x000000016bad78c0 is pointing into the stack for thread: 0x0000000124008c00 -stack at sp + 7 slots: 0x00000001376700bc is at code_begin+60 in -[CodeBlob (0x0000000137670010)] -Framesize: 4 -Runtime Stub (0x0000000137670010): nep_invoker_blob --------------------------------------------------------------------------------- -Decoding CodeBlob, name: nep_invoker_blob, at [0x0000000137670080, 0x0000000137670150] 208 bytes -[MachCode] - 0x0000000137670080: fd7b bfa9 | fd03 0091 | bf43 00d1 | 0900 0010 | 89d7 01f9 | e903 0091 | 89d3 01f9 | 9ddb 01f9 - 0x00000001376700a0: e903 7eb2 | 8a53 1191 | 49fd 9f88 | e903 01aa | e103 03aa | e003 02aa | 2001 3fd6 | a900 80d2 - 0x00000001376700c0: 8957 04b9 | bf3b 03d5 | 8963 1191 | 29fd dfc8 | bf03 09eb | e801 0054 | 8953 44b9 | a901 0035 - 0x00000001376700e0: e903 7db2 | 8a53 1191 | 49fd 9f88 | 8943 5339 | 3f09 0071 | e001 0054 | 9fd3 01f9 | 9fdb 01f9 - 0x0000000137670100: 9fd7 01f9 | bf03 0091 | fd7b c1a8 | c003 5fd6 | e003 00f9 | e003 1caa | 897d 9cd2 | 09c2 a0f2 - 0x0000000137670120: 2900 c0f2 | 2001 3fd6 | e003 40f9 | edff ff17 | e003 00f9 | 0919 95d2 | 29ca a0f2 | 2900 c0f2 - 0x0000000137670140: 2001 3fd6 | e003 40f9 | ecff ff17 | 0000 0000 -[/MachCode] --------------------------------------------------------------------------------- - --------------------------------------------------------------------------------- -Decoding CodeBlob, name: nep_invoker_blob, at [0x0000000137670080, 0x0000000137670150] 208 bytes -[MachCode] - 0x0000000137670080: fd7b bfa9 | fd03 0091 | bf43 00d1 | 0900 0010 | 89d7 01f9 | e903 0091 | 89d3 01f9 | 9ddb 01f9 - 0x00000001376700a0: e903 7eb2 | 8a53 1191 | 49fd 9f88 | e903 01aa | e103 03aa | e003 02aa | 2001 3fd6 | a900 80d2 - 0x00000001376700c0: 8957 04b9 | bf3b 03d5 | 8963 1191 | 29fd dfc8 | bf03 09eb | e801 0054 | 8953 44b9 | a901 0035 - 0x00000001376700e0: e903 7db2 | 8a53 1191 | 49fd 9f88 | 8943 5339 | 3f09 0071 | e001 0054 | 9fd3 01f9 | 9fdb 01f9 - 0x0000000137670100: 9fd7 01f9 | bf03 0091 | fd7b c1a8 | c003 5fd6 | e003 00f9 | e003 1caa | 897d 9cd2 | 09c2 a0f2 - 0x0000000137670120: 2900 c0f2 | 2001 3fd6 | e003 40f9 | edff ff17 | e003 00f9 | 0919 95d2 | 29ca a0f2 | 2900 c0f2 - 0x0000000137670140: 2001 3fd6 | e003 40f9 | ecff ff17 | 0000 0000 -[/MachCode] --------------------------------------------------------------------------------- - - ---------------- P R O C E S S --------------- - -Threads class SMR info: -_java_thread_list=0x0000600000ad9160, length=11, elements={ -0x0000000124008c00, 0x0000000123010a00, 0x0000000122008200, 0x000000012508f400, -0x000000012508fc00, 0x000000012509b200, 0x0000000123025200, 0x0000000123025a00, -0x000000010f8b2a00, 0x0000000124041200, 0x0000000124041a00 -} - -Java Threads: ( => current thread ) -=>0x0000000124008c00 JavaThread "main" [_thread_in_native, id=10243, stack(0x000000016b8d8000,0x000000016badb000) (2060K)] - 0x0000000123010a00 JavaThread "Reference Handler" daemon [_thread_blocked, id=24323, stack(0x000000016ca50000,0x000000016cc53000) (2060K)] - 0x0000000122008200 JavaThread "Finalizer" daemon [_thread_blocked, id=28931, stack(0x000000016cc5c000,0x000000016ce5f000) (2060K)] - 0x000000012508f400 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=28675, stack(0x000000016ce68000,0x000000016d06b000) (2060K)] - 0x000000012508fc00 JavaThread "Service Thread" daemon [_thread_blocked, id=25091, stack(0x000000016d074000,0x000000016d277000) (2060K)] - 0x000000012509b200 JavaThread "Monitor Deflation Thread" daemon [_thread_blocked, id=28419, stack(0x000000016d280000,0x000000016d483000) (2060K)] - 0x0000000123025200 JavaThread "C2 CompilerThread0" daemon [_thread_in_vm, id=25603, stack(0x000000016d48c000,0x000000016d68f000) (2060K)] - 0x0000000123025a00 JavaThread "C1 CompilerThread0" daemon [_thread_in_vm, id=26115, stack(0x000000016d698000,0x000000016d89b000) (2060K)] - 0x000000010f8b2a00 JavaThread "Common-Cleaner" daemon [_thread_blocked, id=26371, stack(0x000000016d8a4000,0x000000016daa7000) (2060K)] - 0x0000000124041200 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=26883, stack(0x000000016dab0000,0x000000016dcb3000) (2060K)] - 0x0000000124041a00 JavaThread "Notification Thread" daemon [_thread_blocked, id=27139, stack(0x000000016dcbc000,0x000000016debf000) (2060K)] -Total: 11 - -Other Threads: - 0x0000000122e06fd0 VMThread "VM Thread" [id=18691, stack(0x000000016c72c000,0x000000016c92f000) (2060K)] - 0x0000000104705520 WatcherThread "VM Periodic Task Thread" [id=20739, stack(0x000000016c520000,0x000000016c723000) (2060K)] - 0x0000000123806830 WorkerThread "GC Thread#0" [id=14083, stack(0x000000016bae4000,0x000000016bce7000) (2060K)] - 0x0000000123806fd0 ConcurrentGCThread "G1 Main Marker" [id=12803, stack(0x000000016bcf0000,0x000000016bef3000) (2060K)] - 0x000000010f304080 WorkerThread "G1 Conc#0" [id=13059, stack(0x000000016befc000,0x000000016c0ff000) (2060K)] - 0x000000010f858200 ConcurrentGCThread "G1 Refine#0" [id=21507, stack(0x000000016c108000,0x000000016c30b000) (2060K)] - 0x0000000104704190 ConcurrentGCThread "G1 Service" [id=16899, stack(0x000000016c314000,0x000000016c517000) (2060K)] -Total: 7 - -Threads with active compile tasks: -C2 CompilerThread0 282 1191 4 jdk.internal.org.objectweb.asm.SymbolTable::addConstantUtf8Reference (101 bytes) -C1 CompilerThread0 282 1208 3 jdk.internal.classfile.impl.StackMapGenerator::processBlock (2767 bytes) -Total: 2 - -VM state: not at safepoint (normal execution) - -VM Mutex/Monitor currently owned by a thread: ([mutex/lock_event]) -[0x0000000106a067d8] MethodCompileQueue_lock - owner thread: 0x0000000123025a00 -[0x0000000106a07198] CodeCache_lock - owner thread: 0x0000000123025a00 -[0x0000000106a07258] Compile_lock - owner thread: 0x0000000123025a00 - -Heap address: 0x0000000700000000, size: 4096 MB, Compressed Oops mode: Zero based, Oop shift amount: 3 - -CDS archive(s) not mapped -Compressed class space mapped at: 0x00001fff00000000-0x00001fff40000000, reserved size: 1073741824 -Narrow klass base: 0x00001fff00000000, Narrow klass shift: 0, Narrow klass range: 0x40000000 - -GC Precious Log: - CardTable entry size: 512 - Card Set container configuration: InlinePtr #cards 4 size 8 Array Of Cards #cards 16 size 48 Howl #buckets 8 coarsen threshold 3686 Howl Bitmap #cards 512 size 80 coarsen threshold 460 Card regions per heap region 1 cards per card region 4096 - CPUs: 8 total, 8 available - Memory: 16384M - Large Page Support: Disabled - NUMA Support: Disabled - Compressed Oops: Enabled (Zero based) - Heap Region Size: 2M - Heap Min Capacity: 8M - Heap Initial Capacity: 256M - Heap Max Capacity: 4G - Pre-touch: Disabled - Parallel Workers: 8 - Concurrent Workers: 2 - Concurrent Refinement Workers: 8 - Periodic GC: Disabled - -Heap: - garbage-first heap total reserved 4194304K, committed 262144K, used 18432K [0x0000000700000000, 0x0000000800000000) - region size 2048K, 10 young (20480K), 0 survivors (0K) - Metaspace used 15401K, committed 15808K, reserved 1114112K - class space used 1717K, committed 1920K, reserved 1048576K - -Heap Regions: E=young(eden), S=young(survivor), O=old, HS=humongous(starts), HC=humongous(continues), CS=collection set, F=free, TAMS=top-at-mark-start, PB=parsable bottom -| 0|0x0000000700000000, 0x0000000700000000, 0x0000000700200000| 0%| F| |TAMS 0x0000000700000000| PB 0x0000000700000000| Untracked | 0 -| 1|0x0000000700200000, 0x0000000700200000, 0x0000000700400000| 0%| F| |TAMS 0x0000000700200000| PB 0x0000000700200000| Untracked | 0 -| 2|0x0000000700400000, 0x0000000700400000, 0x0000000700600000| 0%| F| |TAMS 0x0000000700400000| PB 0x0000000700400000| Untracked | 0 -| 3|0x0000000700600000, 0x0000000700600000, 0x0000000700800000| 0%| F| |TAMS 0x0000000700600000| PB 0x0000000700600000| Untracked | 0 -| 4|0x0000000700800000, 0x0000000700800000, 0x0000000700a00000| 0%| F| |TAMS 0x0000000700800000| PB 0x0000000700800000| Untracked | 0 -| 5|0x0000000700a00000, 0x0000000700a00000, 0x0000000700c00000| 0%| F| |TAMS 0x0000000700a00000| PB 0x0000000700a00000| Untracked | 0 -| 6|0x0000000700c00000, 0x0000000700c00000, 0x0000000700e00000| 0%| F| |TAMS 0x0000000700c00000| PB 0x0000000700c00000| Untracked | 0 -| 7|0x0000000700e00000, 0x0000000700e00000, 0x0000000701000000| 0%| F| |TAMS 0x0000000700e00000| PB 0x0000000700e00000| Untracked | 0 -| 8|0x0000000701000000, 0x0000000701000000, 0x0000000701200000| 0%| F| |TAMS 0x0000000701000000| PB 0x0000000701000000| Untracked | 0 -| 9|0x0000000701200000, 0x0000000701200000, 0x0000000701400000| 0%| F| |TAMS 0x0000000701200000| PB 0x0000000701200000| Untracked | 0 -| 10|0x0000000701400000, 0x0000000701400000, 0x0000000701600000| 0%| F| |TAMS 0x0000000701400000| PB 0x0000000701400000| Untracked | 0 -| 11|0x0000000701600000, 0x0000000701600000, 0x0000000701800000| 0%| F| |TAMS 0x0000000701600000| PB 0x0000000701600000| Untracked | 0 -| 12|0x0000000701800000, 0x0000000701800000, 0x0000000701a00000| 0%| F| |TAMS 0x0000000701800000| PB 0x0000000701800000| Untracked | 0 -| 13|0x0000000701a00000, 0x0000000701a00000, 0x0000000701c00000| 0%| F| |TAMS 0x0000000701a00000| PB 0x0000000701a00000| Untracked | 0 -| 14|0x0000000701c00000, 0x0000000701c00000, 0x0000000701e00000| 0%| F| |TAMS 0x0000000701c00000| PB 0x0000000701c00000| Untracked | 0 -| 15|0x0000000701e00000, 0x0000000701e00000, 0x0000000702000000| 0%| F| |TAMS 0x0000000701e00000| PB 0x0000000701e00000| Untracked | 0 -| 16|0x0000000702000000, 0x0000000702000000, 0x0000000702200000| 0%| F| |TAMS 0x0000000702000000| PB 0x0000000702000000| Untracked | 0 -| 17|0x0000000702200000, 0x0000000702200000, 0x0000000702400000| 0%| F| |TAMS 0x0000000702200000| PB 0x0000000702200000| Untracked | 0 -| 18|0x0000000702400000, 0x0000000702400000, 0x0000000702600000| 0%| F| |TAMS 0x0000000702400000| PB 0x0000000702400000| Untracked | 0 -| 19|0x0000000702600000, 0x0000000702600000, 0x0000000702800000| 0%| F| |TAMS 0x0000000702600000| PB 0x0000000702600000| Untracked | 0 -| 20|0x0000000702800000, 0x0000000702800000, 0x0000000702a00000| 0%| F| |TAMS 0x0000000702800000| PB 0x0000000702800000| Untracked | 0 -| 21|0x0000000702a00000, 0x0000000702a00000, 0x0000000702c00000| 0%| F| |TAMS 0x0000000702a00000| PB 0x0000000702a00000| Untracked | 0 -| 22|0x0000000702c00000, 0x0000000702c00000, 0x0000000702e00000| 0%| F| |TAMS 0x0000000702c00000| PB 0x0000000702c00000| Untracked | 0 -| 23|0x0000000702e00000, 0x0000000702e00000, 0x0000000703000000| 0%| F| |TAMS 0x0000000702e00000| PB 0x0000000702e00000| Untracked | 0 -| 24|0x0000000703000000, 0x0000000703000000, 0x0000000703200000| 0%| F| |TAMS 0x0000000703000000| PB 0x0000000703000000| Untracked | 0 -| 25|0x0000000703200000, 0x0000000703200000, 0x0000000703400000| 0%| F| |TAMS 0x0000000703200000| PB 0x0000000703200000| Untracked | 0 -| 26|0x0000000703400000, 0x0000000703400000, 0x0000000703600000| 0%| F| |TAMS 0x0000000703400000| PB 0x0000000703400000| Untracked | 0 -| 27|0x0000000703600000, 0x0000000703600000, 0x0000000703800000| 0%| F| |TAMS 0x0000000703600000| PB 0x0000000703600000| Untracked | 0 -| 28|0x0000000703800000, 0x0000000703800000, 0x0000000703a00000| 0%| F| |TAMS 0x0000000703800000| PB 0x0000000703800000| Untracked | 0 -| 29|0x0000000703a00000, 0x0000000703a00000, 0x0000000703c00000| 0%| F| |TAMS 0x0000000703a00000| PB 0x0000000703a00000| Untracked | 0 -| 30|0x0000000703c00000, 0x0000000703c00000, 0x0000000703e00000| 0%| F| |TAMS 0x0000000703c00000| PB 0x0000000703c00000| Untracked | 0 -| 31|0x0000000703e00000, 0x0000000703e00000, 0x0000000704000000| 0%| F| |TAMS 0x0000000703e00000| PB 0x0000000703e00000| Untracked | 0 -| 32|0x0000000704000000, 0x0000000704000000, 0x0000000704200000| 0%| F| |TAMS 0x0000000704000000| PB 0x0000000704000000| Untracked | 0 -| 33|0x0000000704200000, 0x0000000704200000, 0x0000000704400000| 0%| F| |TAMS 0x0000000704200000| PB 0x0000000704200000| Untracked | 0 -| 34|0x0000000704400000, 0x0000000704400000, 0x0000000704600000| 0%| F| |TAMS 0x0000000704400000| PB 0x0000000704400000| Untracked | 0 -| 35|0x0000000704600000, 0x0000000704600000, 0x0000000704800000| 0%| F| |TAMS 0x0000000704600000| PB 0x0000000704600000| Untracked | 0 -| 36|0x0000000704800000, 0x0000000704800000, 0x0000000704a00000| 0%| F| |TAMS 0x0000000704800000| PB 0x0000000704800000| Untracked | 0 -| 37|0x0000000704a00000, 0x0000000704a00000, 0x0000000704c00000| 0%| F| |TAMS 0x0000000704a00000| PB 0x0000000704a00000| Untracked | 0 -| 38|0x0000000704c00000, 0x0000000704c00000, 0x0000000704e00000| 0%| F| |TAMS 0x0000000704c00000| PB 0x0000000704c00000| Untracked | 0 -| 39|0x0000000704e00000, 0x0000000704e00000, 0x0000000705000000| 0%| F| |TAMS 0x0000000704e00000| PB 0x0000000704e00000| Untracked | 0 -| 40|0x0000000705000000, 0x0000000705000000, 0x0000000705200000| 0%| F| |TAMS 0x0000000705000000| PB 0x0000000705000000| Untracked | 0 -| 41|0x0000000705200000, 0x0000000705200000, 0x0000000705400000| 0%| F| |TAMS 0x0000000705200000| PB 0x0000000705200000| Untracked | 0 -| 42|0x0000000705400000, 0x0000000705400000, 0x0000000705600000| 0%| F| |TAMS 0x0000000705400000| PB 0x0000000705400000| Untracked | 0 -| 43|0x0000000705600000, 0x0000000705600000, 0x0000000705800000| 0%| F| |TAMS 0x0000000705600000| PB 0x0000000705600000| Untracked | 0 -| 44|0x0000000705800000, 0x0000000705800000, 0x0000000705a00000| 0%| F| |TAMS 0x0000000705800000| PB 0x0000000705800000| Untracked | 0 -| 45|0x0000000705a00000, 0x0000000705a00000, 0x0000000705c00000| 0%| F| |TAMS 0x0000000705a00000| PB 0x0000000705a00000| Untracked | 0 -| 46|0x0000000705c00000, 0x0000000705c00000, 0x0000000705e00000| 0%| F| |TAMS 0x0000000705c00000| PB 0x0000000705c00000| Untracked | 0 -| 47|0x0000000705e00000, 0x0000000705e00000, 0x0000000706000000| 0%| F| |TAMS 0x0000000705e00000| PB 0x0000000705e00000| Untracked | 0 -| 48|0x0000000706000000, 0x0000000706000000, 0x0000000706200000| 0%| F| |TAMS 0x0000000706000000| PB 0x0000000706000000| Untracked | 0 -| 49|0x0000000706200000, 0x0000000706200000, 0x0000000706400000| 0%| F| |TAMS 0x0000000706200000| PB 0x0000000706200000| Untracked | 0 -| 50|0x0000000706400000, 0x0000000706400000, 0x0000000706600000| 0%| F| |TAMS 0x0000000706400000| PB 0x0000000706400000| Untracked | 0 -| 51|0x0000000706600000, 0x0000000706600000, 0x0000000706800000| 0%| F| |TAMS 0x0000000706600000| PB 0x0000000706600000| Untracked | 0 -| 52|0x0000000706800000, 0x0000000706800000, 0x0000000706a00000| 0%| F| |TAMS 0x0000000706800000| PB 0x0000000706800000| Untracked | 0 -| 53|0x0000000706a00000, 0x0000000706a00000, 0x0000000706c00000| 0%| F| |TAMS 0x0000000706a00000| PB 0x0000000706a00000| Untracked | 0 -| 54|0x0000000706c00000, 0x0000000706c00000, 0x0000000706e00000| 0%| F| |TAMS 0x0000000706c00000| PB 0x0000000706c00000| Untracked | 0 -| 55|0x0000000706e00000, 0x0000000706e00000, 0x0000000707000000| 0%| F| |TAMS 0x0000000706e00000| PB 0x0000000706e00000| Untracked | 0 -| 56|0x0000000707000000, 0x0000000707000000, 0x0000000707200000| 0%| F| |TAMS 0x0000000707000000| PB 0x0000000707000000| Untracked | 0 -| 57|0x0000000707200000, 0x0000000707200000, 0x0000000707400000| 0%| F| |TAMS 0x0000000707200000| PB 0x0000000707200000| Untracked | 0 -| 58|0x0000000707400000, 0x0000000707400000, 0x0000000707600000| 0%| F| |TAMS 0x0000000707400000| PB 0x0000000707400000| Untracked | 0 -| 59|0x0000000707600000, 0x0000000707600000, 0x0000000707800000| 0%| F| |TAMS 0x0000000707600000| PB 0x0000000707600000| Untracked | 0 -| 60|0x0000000707800000, 0x0000000707800000, 0x0000000707a00000| 0%| F| |TAMS 0x0000000707800000| PB 0x0000000707800000| Untracked | 0 -| 61|0x0000000707a00000, 0x0000000707a00000, 0x0000000707c00000| 0%| F| |TAMS 0x0000000707a00000| PB 0x0000000707a00000| Untracked | 0 -| 62|0x0000000707c00000, 0x0000000707c00000, 0x0000000707e00000| 0%| F| |TAMS 0x0000000707c00000| PB 0x0000000707c00000| Untracked | 0 -| 63|0x0000000707e00000, 0x0000000707e00000, 0x0000000708000000| 0%| F| |TAMS 0x0000000707e00000| PB 0x0000000707e00000| Untracked | 0 -| 64|0x0000000708000000, 0x0000000708000000, 0x0000000708200000| 0%| F| |TAMS 0x0000000708000000| PB 0x0000000708000000| Untracked | 0 -| 65|0x0000000708200000, 0x0000000708200000, 0x0000000708400000| 0%| F| |TAMS 0x0000000708200000| PB 0x0000000708200000| Untracked | 0 -| 66|0x0000000708400000, 0x0000000708400000, 0x0000000708600000| 0%| F| |TAMS 0x0000000708400000| PB 0x0000000708400000| Untracked | 0 -| 67|0x0000000708600000, 0x0000000708600000, 0x0000000708800000| 0%| F| |TAMS 0x0000000708600000| PB 0x0000000708600000| Untracked | 0 -| 68|0x0000000708800000, 0x0000000708800000, 0x0000000708a00000| 0%| F| |TAMS 0x0000000708800000| PB 0x0000000708800000| Untracked | 0 -| 69|0x0000000708a00000, 0x0000000708a00000, 0x0000000708c00000| 0%| F| |TAMS 0x0000000708a00000| PB 0x0000000708a00000| Untracked | 0 -| 70|0x0000000708c00000, 0x0000000708c00000, 0x0000000708e00000| 0%| F| |TAMS 0x0000000708c00000| PB 0x0000000708c00000| Untracked | 0 -| 71|0x0000000708e00000, 0x0000000708e00000, 0x0000000709000000| 0%| F| |TAMS 0x0000000708e00000| PB 0x0000000708e00000| Untracked | 0 -| 72|0x0000000709000000, 0x0000000709000000, 0x0000000709200000| 0%| F| |TAMS 0x0000000709000000| PB 0x0000000709000000| Untracked | 0 -| 73|0x0000000709200000, 0x0000000709200000, 0x0000000709400000| 0%| F| |TAMS 0x0000000709200000| PB 0x0000000709200000| Untracked | 0 -| 74|0x0000000709400000, 0x0000000709400000, 0x0000000709600000| 0%| F| |TAMS 0x0000000709400000| PB 0x0000000709400000| Untracked | 0 -| 75|0x0000000709600000, 0x0000000709600000, 0x0000000709800000| 0%| F| |TAMS 0x0000000709600000| PB 0x0000000709600000| Untracked | 0 -| 76|0x0000000709800000, 0x0000000709800000, 0x0000000709a00000| 0%| F| |TAMS 0x0000000709800000| PB 0x0000000709800000| Untracked | 0 -| 77|0x0000000709a00000, 0x0000000709a00000, 0x0000000709c00000| 0%| F| |TAMS 0x0000000709a00000| PB 0x0000000709a00000| Untracked | 0 -| 78|0x0000000709c00000, 0x0000000709c00000, 0x0000000709e00000| 0%| F| |TAMS 0x0000000709c00000| PB 0x0000000709c00000| Untracked | 0 -| 79|0x0000000709e00000, 0x0000000709e00000, 0x000000070a000000| 0%| F| |TAMS 0x0000000709e00000| PB 0x0000000709e00000| Untracked | 0 -| 80|0x000000070a000000, 0x000000070a000000, 0x000000070a200000| 0%| F| |TAMS 0x000000070a000000| PB 0x000000070a000000| Untracked | 0 -| 81|0x000000070a200000, 0x000000070a200000, 0x000000070a400000| 0%| F| |TAMS 0x000000070a200000| PB 0x000000070a200000| Untracked | 0 -| 82|0x000000070a400000, 0x000000070a400000, 0x000000070a600000| 0%| F| |TAMS 0x000000070a400000| PB 0x000000070a400000| Untracked | 0 -| 83|0x000000070a600000, 0x000000070a600000, 0x000000070a800000| 0%| F| |TAMS 0x000000070a600000| PB 0x000000070a600000| Untracked | 0 -| 84|0x000000070a800000, 0x000000070a800000, 0x000000070aa00000| 0%| F| |TAMS 0x000000070a800000| PB 0x000000070a800000| Untracked | 0 -| 85|0x000000070aa00000, 0x000000070aa00000, 0x000000070ac00000| 0%| F| |TAMS 0x000000070aa00000| PB 0x000000070aa00000| Untracked | 0 -| 86|0x000000070ac00000, 0x000000070ac00000, 0x000000070ae00000| 0%| F| |TAMS 0x000000070ac00000| PB 0x000000070ac00000| Untracked | 0 -| 87|0x000000070ae00000, 0x000000070ae00000, 0x000000070b000000| 0%| F| |TAMS 0x000000070ae00000| PB 0x000000070ae00000| Untracked | 0 -| 88|0x000000070b000000, 0x000000070b000000, 0x000000070b200000| 0%| F| |TAMS 0x000000070b000000| PB 0x000000070b000000| Untracked | 0 -| 89|0x000000070b200000, 0x000000070b200000, 0x000000070b400000| 0%| F| |TAMS 0x000000070b200000| PB 0x000000070b200000| Untracked | 0 -| 90|0x000000070b400000, 0x000000070b400000, 0x000000070b600000| 0%| F| |TAMS 0x000000070b400000| PB 0x000000070b400000| Untracked | 0 -| 91|0x000000070b600000, 0x000000070b600000, 0x000000070b800000| 0%| F| |TAMS 0x000000070b600000| PB 0x000000070b600000| Untracked | 0 -| 92|0x000000070b800000, 0x000000070b800000, 0x000000070ba00000| 0%| F| |TAMS 0x000000070b800000| PB 0x000000070b800000| Untracked | 0 -| 93|0x000000070ba00000, 0x000000070ba00000, 0x000000070bc00000| 0%| F| |TAMS 0x000000070ba00000| PB 0x000000070ba00000| Untracked | 0 -| 94|0x000000070bc00000, 0x000000070bc00000, 0x000000070be00000| 0%| F| |TAMS 0x000000070bc00000| PB 0x000000070bc00000| Untracked | 0 -| 95|0x000000070be00000, 0x000000070be00000, 0x000000070c000000| 0%| F| |TAMS 0x000000070be00000| PB 0x000000070be00000| Untracked | 0 -| 96|0x000000070c000000, 0x000000070c000000, 0x000000070c200000| 0%| F| |TAMS 0x000000070c000000| PB 0x000000070c000000| Untracked | 0 -| 97|0x000000070c200000, 0x000000070c200000, 0x000000070c400000| 0%| F| |TAMS 0x000000070c200000| PB 0x000000070c200000| Untracked | 0 -| 98|0x000000070c400000, 0x000000070c400000, 0x000000070c600000| 0%| F| |TAMS 0x000000070c400000| PB 0x000000070c400000| Untracked | 0 -| 99|0x000000070c600000, 0x000000070c600000, 0x000000070c800000| 0%| F| |TAMS 0x000000070c600000| PB 0x000000070c600000| Untracked | 0 -| 100|0x000000070c800000, 0x000000070c800000, 0x000000070ca00000| 0%| F| |TAMS 0x000000070c800000| PB 0x000000070c800000| Untracked | 0 -| 101|0x000000070ca00000, 0x000000070ca00000, 0x000000070cc00000| 0%| F| |TAMS 0x000000070ca00000| PB 0x000000070ca00000| Untracked | 0 -| 102|0x000000070cc00000, 0x000000070cc00000, 0x000000070ce00000| 0%| F| |TAMS 0x000000070cc00000| PB 0x000000070cc00000| Untracked | 0 -| 103|0x000000070ce00000, 0x000000070ce00000, 0x000000070d000000| 0%| F| |TAMS 0x000000070ce00000| PB 0x000000070ce00000| Untracked | 0 -| 104|0x000000070d000000, 0x000000070d000000, 0x000000070d200000| 0%| F| |TAMS 0x000000070d000000| PB 0x000000070d000000| Untracked | 0 -| 105|0x000000070d200000, 0x000000070d200000, 0x000000070d400000| 0%| F| |TAMS 0x000000070d200000| PB 0x000000070d200000| Untracked | 0 -| 106|0x000000070d400000, 0x000000070d400000, 0x000000070d600000| 0%| F| |TAMS 0x000000070d400000| PB 0x000000070d400000| Untracked | 0 -| 107|0x000000070d600000, 0x000000070d600000, 0x000000070d800000| 0%| F| |TAMS 0x000000070d600000| PB 0x000000070d600000| Untracked | 0 -| 108|0x000000070d800000, 0x000000070d800000, 0x000000070da00000| 0%| F| |TAMS 0x000000070d800000| PB 0x000000070d800000| Untracked | 0 -| 109|0x000000070da00000, 0x000000070da00000, 0x000000070dc00000| 0%| F| |TAMS 0x000000070da00000| PB 0x000000070da00000| Untracked | 0 -| 110|0x000000070dc00000, 0x000000070dc00000, 0x000000070de00000| 0%| F| |TAMS 0x000000070dc00000| PB 0x000000070dc00000| Untracked | 0 -| 111|0x000000070de00000, 0x000000070de00000, 0x000000070e000000| 0%| F| |TAMS 0x000000070de00000| PB 0x000000070de00000| Untracked | 0 -| 112|0x000000070e000000, 0x000000070e000000, 0x000000070e200000| 0%| F| |TAMS 0x000000070e000000| PB 0x000000070e000000| Untracked | 0 -| 113|0x000000070e200000, 0x000000070e200000, 0x000000070e400000| 0%| F| |TAMS 0x000000070e200000| PB 0x000000070e200000| Untracked | 0 -| 114|0x000000070e400000, 0x000000070e400000, 0x000000070e600000| 0%| F| |TAMS 0x000000070e400000| PB 0x000000070e400000| Untracked | 0 -| 115|0x000000070e600000, 0x000000070e600000, 0x000000070e800000| 0%| F| |TAMS 0x000000070e600000| PB 0x000000070e600000| Untracked | 0 -| 116|0x000000070e800000, 0x000000070e800000, 0x000000070ea00000| 0%| F| |TAMS 0x000000070e800000| PB 0x000000070e800000| Untracked | 0 -| 117|0x000000070ea00000, 0x000000070ea00000, 0x000000070ec00000| 0%| F| |TAMS 0x000000070ea00000| PB 0x000000070ea00000| Untracked | 0 -| 118|0x000000070ec00000, 0x000000070ecf5c70, 0x000000070ee00000| 48%| E| |TAMS 0x000000070ec00000| PB 0x000000070ec00000| Complete | 0 -| 119|0x000000070ee00000, 0x000000070f000000, 0x000000070f000000|100%| E|CS|TAMS 0x000000070ee00000| PB 0x000000070ee00000| Complete | 0 -| 120|0x000000070f000000, 0x000000070f200000, 0x000000070f200000|100%| E|CS|TAMS 0x000000070f000000| PB 0x000000070f000000| Complete | 0 -| 121|0x000000070f200000, 0x000000070f400000, 0x000000070f400000|100%| E|CS|TAMS 0x000000070f200000| PB 0x000000070f200000| Complete | 0 -| 122|0x000000070f400000, 0x000000070f600000, 0x000000070f600000|100%| E|CS|TAMS 0x000000070f400000| PB 0x000000070f400000| Complete | 0 -| 123|0x000000070f600000, 0x000000070f800000, 0x000000070f800000|100%| E|CS|TAMS 0x000000070f600000| PB 0x000000070f600000| Complete | 0 -| 124|0x000000070f800000, 0x000000070fa00000, 0x000000070fa00000|100%| E|CS|TAMS 0x000000070f800000| PB 0x000000070f800000| Complete | 0 -| 125|0x000000070fa00000, 0x000000070fc00000, 0x000000070fc00000|100%| E|CS|TAMS 0x000000070fa00000| PB 0x000000070fa00000| Complete | 0 -| 126|0x000000070fc00000, 0x000000070fe00000, 0x000000070fe00000|100%| E|CS|TAMS 0x000000070fc00000| PB 0x000000070fc00000| Complete | 0 -| 127|0x000000070fe00000, 0x0000000710000000, 0x0000000710000000|100%| E|CS|TAMS 0x000000070fe00000| PB 0x000000070fe00000| Complete | 0 - -Card table byte_map: [0x00000001053c8000,0x0000000105bc8000] _byte_map_base: 0x0000000101bc8000 - -Marking Bits: (CMBitMap*) 0x0000000124030410 - Bits: [0x0000000148000000, 0x000000014c000000) - -Polling page: 0x00000001045c8000 - -Metaspace: - -Usage: - Non-class: 13.36 MB used. - Class: 1.68 MB used. - Both: 15.04 MB used. - -Virtual space: - Non-class space: 64.00 MB reserved, 13.56 MB ( 21%) committed, 1 nodes. - Class space: 1.00 GB reserved, 1.88 MB ( <1%) committed, 1 nodes. - Both: 1.06 GB reserved, 15.44 MB ( 1%) committed. - -Chunk freelists: - Non-Class: 2.35 MB - Class: 14.17 MB - Both: 16.52 MB - -MaxMetaspaceSize: unlimited -CompressedClassSpaceSize: 1.00 GB -Initial GC threshold: 21.00 MB -Current GC threshold: 21.00 MB -CDS: off - - commit_granule_bytes: 65536. - - commit_granule_words: 8192. - - virtual_space_node_default_size: 8388608. - - enlarge_chunks_in_place: 1. - - use_allocation_guard: 0. - - -Internal statistics: - -num_allocs_failed_limit: 0. -num_arena_births: 342. -num_arena_deaths: 0. -num_vsnodes_births: 2. -num_vsnodes_deaths: 0. -num_space_committed: 247. -num_space_uncommitted: 0. -num_chunks_returned_to_freelist: 0. -num_chunks_taken_from_freelist: 560. -num_chunk_merges: 0. -num_chunk_splits: 332. -num_chunks_enlarged: 190. -num_inconsistent_stats: 0. - -CodeHeap 'non-profiled nmethods': size=120032Kb used=365Kb max_used=365Kb free=119666Kb - bounds [0x0000000137ac8000, 0x0000000137d38000, 0x000000013f000000] -CodeHeap 'profiled nmethods': size=120016Kb used=2231Kb max_used=2231Kb free=117784Kb - bounds [0x0000000130000000, 0x0000000130270000, 0x0000000137534000] -CodeHeap 'non-nmethods': size=5712Kb used=1326Kb max_used=1338Kb free=4385Kb - bounds [0x0000000137534000, 0x00000001377a4000, 0x0000000137ac8000] - total_blobs=1688 nmethods=1204 adapters=391 - compilation: enabled - stopped_count=0, restarted_count=0 - full_count=0 - -Compilation events (20 events): -Event: 0.271 Thread 0x0000000123025a00 nmethod 1198 0x0000000130210c10 code [0x0000000130210dc0, 0x0000000130210f30] -Event: 0.271 Thread 0x0000000123025a00 1196 3 jdk.internal.classfile.impl.DirectCodeBuilder::with (30 bytes) -Event: 0.271 Thread 0x0000000123025a00 nmethod 1196 0x0000000130211010 code [0x0000000130211240, 0x00000001302119a0] -Event: 0.271 Thread 0x0000000123025a00 1199 3 jdk.internal.classfile.impl.AbstractPoolEntry::width (23 bytes) -Event: 0.271 Thread 0x0000000123025a00 nmethod 1199 0x0000000130211b90 code [0x0000000130211d40, 0x0000000130211ef8] -Event: 0.271 Thread 0x0000000123025a00 1197 3 jdk.internal.classfile.impl.AbstractInstruction$UnboundInstruction:: (10 bytes) -Event: 0.271 Thread 0x0000000123025a00 nmethod 1197 0x0000000130211f90 code [0x0000000130212140, 0x00000001302123f0] -Event: 0.271 Thread 0x0000000123025a00 1201 3 jdk.internal.classfile.impl.AbstractPoolEntry::phiMix (12 bytes) -Event: 0.271 Thread 0x0000000123025a00 nmethod 1201 0x0000000130212590 code [0x0000000130212700, 0x00000001302127e8] -Event: 0.271 Thread 0x0000000123025a00 1200 3 jdk.internal.classfile.impl.Util::checkKind (41 bytes) -Event: 0.271 Thread 0x0000000123025a00 nmethod 1200 0x0000000130212890 code [0x0000000130212b80, 0x0000000130213950] -Event: 0.271 Thread 0x0000000123025a00 1202 3 jdk.internal.classfile.impl.BufWriterImpl::writeU2 (8 bytes) -Event: 0.271 Thread 0x0000000123025a00 nmethod 1202 0x0000000130213e10 code [0x0000000130213fc0, 0x0000000130214138] -Event: 0.272 Thread 0x0000000123025a00 1203 3 jdk.internal.classfile.impl.SplitConstantPool::map (145 bytes) -Event: 0.272 Thread 0x0000000123025a00 nmethod 1203 0x0000000130214210 code [0x0000000130214500, 0x0000000130215280] -Event: 0.272 Thread 0x0000000123025a00 1204 3 java.util.stream.Sink$ChainedReference::cancellationRequested (10 bytes) -Event: 0.272 Thread 0x0000000123025a00 nmethod 1204 0x0000000130215690 code [0x0000000130215840, 0x0000000130215a58] -Event: 0.273 Thread 0x0000000123025a00 1206 3 java.util.ArrayList::isEmpty (13 bytes) -Event: 0.273 Thread 0x0000000123025a00 nmethod 1206 0x0000000130215b10 code [0x0000000130215cc0, 0x0000000130215e30] -Event: 0.273 Thread 0x0000000123025a00 1208 3 jdk.internal.classfile.impl.StackMapGenerator::processBlock (2767 bytes) - -GC Heap History (0 events): -No events - -Dll operation events (10 events): -Event: 0.005 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjava.dylib -Event: 0.056 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libzip.dylib -Event: 0.057 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libinstrument.dylib -Event: 0.060 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libnio.dylib -Event: 0.064 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libzip.dylib -Event: 0.072 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libnet.dylib -Event: 0.076 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libextnet.dylib -Event: 0.100 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjimage.dylib -Event: 0.229 Loaded shared library libsomelib.dylib -Event: 0.231 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libsyslookup.dylib - -Deoptimization events (20 events): -Event: 0.217 Thread 0x0000000124008c00 DEOPT PACKING pc=0x0000000137acf064 sp=0x000000016bad7330 -Event: 0.217 Thread 0x0000000124008c00 DEOPT UNPACKING pc=0x000000013757701c sp=0x000000016bad72d0 mode 2 -Event: 0.217 Thread 0x0000000124008c00 Uncommon trap: trap_request=0xffffff45 fr.pc=0x0000000137b083e0 relative=0x0000000000000060 -Event: 0.217 Thread 0x0000000124008c00 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000137b083e0 method=java.lang.CharacterData.of(I)Ljava/lang/CharacterData; @ 4 c2 -Event: 0.217 Thread 0x0000000124008c00 DEOPT PACKING pc=0x0000000137b083e0 sp=0x000000016bad6b60 -Event: 0.217 Thread 0x0000000124008c00 DEOPT UNPACKING pc=0x000000013757701c sp=0x000000016bad6b00 mode 2 -Event: 0.218 Thread 0x0000000124008c00 Uncommon trap: trap_request=0xffffff45 fr.pc=0x0000000137ad1af0 relative=0x00000000000000b0 -Event: 0.218 Thread 0x0000000124008c00 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000137ad1af0 method=java.lang.String.isLatin1()Z @ 10 c2 -Event: 0.218 Thread 0x0000000124008c00 DEOPT PACKING pc=0x0000000137ad1af0 sp=0x000000016bad74a0 -Event: 0.218 Thread 0x0000000124008c00 DEOPT UNPACKING pc=0x000000013757701c sp=0x000000016bad73d0 mode 2 -Event: 0.218 Thread 0x0000000124008c00 Uncommon trap: trap_request=0xffffff45 fr.pc=0x0000000137ae5350 relative=0x0000000000000190 -Event: 0.218 Thread 0x0000000124008c00 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000137ae5350 method=jdk.internal.util.ArraysSupport.vectorizedHashCode(Ljava/lang/Object;IIII)I @ 2 c2 -Event: 0.218 Thread 0x0000000124008c00 DEOPT PACKING pc=0x0000000137ae5350 sp=0x000000016bad7370 -Event: 0.218 Thread 0x0000000124008c00 DEOPT UNPACKING pc=0x000000013757701c sp=0x000000016bad7310 mode 2 -Event: 0.222 Thread 0x0000000124008c00 Uncommon trap: trap_request=0xffffff45 fr.pc=0x0000000137b0c7a0 relative=0x00000000000000e0 -Event: 0.222 Thread 0x0000000124008c00 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000137b0c7a0 method=sun.net.www.ParseUtil.firstEncodeIndex(Ljava/lang/String;)I @ 51 c2 -Event: 0.222 Thread 0x0000000124008c00 DEOPT PACKING pc=0x0000000137b0c7a0 sp=0x000000016bad67a0 -Event: 0.222 Thread 0x0000000124008c00 DEOPT UNPACKING pc=0x000000013757701c sp=0x000000016bad6720 mode 2 -Event: 0.255 Thread 0x0000000124008c00 DEOPT PACKING pc=0x00000001301c77e0 sp=0x000000016bad66e0 -Event: 0.255 Thread 0x0000000124008c00 DEOPT UNPACKING pc=0x0000000137576e7c sp=0x000000016bad6450 mode 3 - -Classes loaded (20 events): -Event: 0.273 Loading class jdk/internal/classfile/impl/BufferedCodeBuilder -Event: 0.273 Loading class jdk/internal/classfile/impl/BufferedCodeBuilder done -Event: 0.273 Loading class jdk/internal/classfile/impl/TransformingCodeBuilder -Event: 0.273 Loading class jdk/internal/classfile/impl/TransformingCodeBuilder done -Event: 0.274 Loading class java/lang/classfile/instruction/ThrowInstruction -Event: 0.274 Loading class java/lang/classfile/instruction/ThrowInstruction done -Event: 0.274 Loading class jdk/internal/classfile/impl/AbstractInstruction$UnboundThrowInstruction -Event: 0.274 Loading class jdk/internal/classfile/impl/AbstractInstruction$UnboundThrowInstruction done -Event: 0.274 Loading class java/lang/classfile/instruction/ExceptionCatch -Event: 0.274 Loading class java/lang/classfile/instruction/ExceptionCatch done -Event: 0.274 Loading class jdk/internal/classfile/impl/AbstractPseudoInstruction$ExceptionCatchImpl -Event: 0.274 Loading class jdk/internal/classfile/impl/AbstractPseudoInstruction -Event: 0.274 Loading class jdk/internal/classfile/impl/AbstractPseudoInstruction done -Event: 0.274 Loading class jdk/internal/classfile/impl/AbstractPseudoInstruction$ExceptionCatchImpl done -Event: 0.274 Loading class jdk/internal/classfile/impl/StackMapGenerator$RawExceptionCatch -Event: 0.274 Loading class jdk/internal/classfile/impl/StackMapGenerator$RawExceptionCatch done -Event: 0.274 Loading class jdk/internal/classfile/impl/SplitConstantPool$1 -Event: 0.275 Loading class jdk/internal/classfile/impl/SplitConstantPool$1 done -Event: 0.275 Loading class java/lang/invoke/ConstantBootstraps -Event: 0.275 Loading class java/lang/invoke/ConstantBootstraps done - -Classes unloaded (0 events): -No events - -Classes redefined (0 events): -No events - -Internal exceptions (20 events): -Event: 0.255 Thread 0x0000000124008c00 Exception (0x000000070ef3af28) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 0.256 Thread 0x0000000124008c00 Exception (0x000000070ef5a200) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 0.256 Thread 0x0000000124008c00 Exception (0x000000070ef5e850) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 0.256 Thread 0x0000000124008c00 Exception (0x000000070ef62408) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 0.257 Thread 0x0000000124008c00 Exception (0x000000070ef69f58) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 0.257 Thread 0x0000000124008c00 Exception (0x000000070ef71358) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 0.257 Thread 0x0000000124008c00 Exception (0x000000070ef78328) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 0.257 Thread 0x0000000124008c00 Exception (0x000000070ef7cde0) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 0.258 Thread 0x0000000124008c00 Exception (0x000000070ef9b0b8) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 0.261 Thread 0x0000000124008c00 Exception (0x000000070efc1bc0) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 841] -Event: 0.262 Thread 0x0000000124008c00 Exception (0x000000070efd3ce8) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 0.266 Thread 0x0000000124008c00 Exception (0x000000070ec30680) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 0.266 Thread 0x0000000124008c00 Exception (0x000000070ec3ac78) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 0.267 Thread 0x0000000124008c00 Exception (0x000000070ec4c5b8) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 0.268 Thread 0x0000000124008c00 Exception (0x000000070ec68c28) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 0.268 Thread 0x0000000124008c00 Exception (0x000000070ec6e0f8) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 0.269 Thread 0x0000000124008c00 Exception (0x000000070ec78050) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 0.272 Thread 0x0000000124008c00 Exception (0x000000070eca3ff8) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 0.275 Thread 0x0000000124008c00 Exception (0x000000070ecc5148) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 0.276 Thread 0x0000000124008c00 Exception (0x000000070ecd6920) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] - -ZGC Phase Switch (0 events): -No events - -VM Operations (10 events): -Event: 0.050 Executing VM operation: HandshakeAllThreads (Deoptimize) -Event: 0.050 Executing VM operation: HandshakeAllThreads (Deoptimize) done -Event: 0.121 Executing VM operation: HandshakeAllThreads (Deoptimize) -Event: 0.121 Executing VM operation: HandshakeAllThreads (Deoptimize) done -Event: 0.185 Executing VM operation: ICBufferFull -Event: 0.185 Executing VM operation: ICBufferFull done -Event: 0.213 Executing VM operation: HandshakeAllThreads (Deoptimize) -Event: 0.213 Executing VM operation: HandshakeAllThreads (Deoptimize) done -Event: 0.217 Executing VM operation: HandshakeAllThreads (Deoptimize) -Event: 0.217 Executing VM operation: HandshakeAllThreads (Deoptimize) done - -Events (20 events): -Event: 0.023 Thread 0x0000000123010a00 Thread added: 0x0000000123010a00 -Event: 0.023 Protecting memory [0x000000016ca50000,0x000000016ca5c000] with protection modes 0 -Event: 0.023 Thread 0x0000000122008200 Thread added: 0x0000000122008200 -Event: 0.023 Protecting memory [0x000000016cc5c000,0x000000016cc68000] with protection modes 0 -Event: 0.024 Thread 0x000000012508f400 Thread added: 0x000000012508f400 -Event: 0.024 Protecting memory [0x000000016ce68000,0x000000016ce74000] with protection modes 0 -Event: 0.024 Thread 0x000000012508fc00 Thread added: 0x000000012508fc00 -Event: 0.024 Protecting memory [0x000000016d074000,0x000000016d080000] with protection modes 0 -Event: 0.024 Thread 0x000000012509b200 Thread added: 0x000000012509b200 -Event: 0.024 Protecting memory [0x000000016d280000,0x000000016d28c000] with protection modes 0 -Event: 0.024 Thread 0x0000000123025200 Thread added: 0x0000000123025200 -Event: 0.024 Protecting memory [0x000000016d48c000,0x000000016d498000] with protection modes 0 -Event: 0.024 Thread 0x0000000123025a00 Thread added: 0x0000000123025a00 -Event: 0.024 Protecting memory [0x000000016d698000,0x000000016d6a4000] with protection modes 0 -Event: 0.044 Thread 0x000000010f8b2a00 Thread added: 0x000000010f8b2a00 -Event: 0.044 Protecting memory [0x000000016d8a4000,0x000000016d8b0000] with protection modes 0 -Event: 0.071 Thread 0x0000000124041200 Thread added: 0x0000000124041200 -Event: 0.071 Protecting memory [0x000000016dab0000,0x000000016dabc000] with protection modes 0 -Event: 0.071 Thread 0x0000000124041a00 Thread added: 0x0000000124041a00 -Event: 0.071 Protecting memory [0x000000016dcbc000,0x000000016dcc8000] with protection modes 0 - - -Dynamic libraries: -0x0000000104a3c000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjli.dylib -0x00000001a96bb000 /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa -0x0000000192c62000 /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit -0x0000000195cce000 /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData -0x0000000190515000 /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation -0x000000019bfdc000 /usr/lib/libSystem.B.dylib -0x0000000193f9f000 /System/Library/PrivateFrameworks/UIFoundation.framework/Versions/A/UIFoundation -0x000000022ab7f000 /System/Library/PrivateFrameworks/CollectionViewCore.framework/Versions/A/CollectionViewCore -0x00000001a3255000 /System/Library/PrivateFrameworks/RemoteViewServices.framework/Versions/A/RemoteViewServices -0x0000000199e89000 /System/Library/PrivateFrameworks/XCTTargetBootstrap.framework/Versions/A/XCTTargetBootstrap -0x000000019e618000 /System/Library/PrivateFrameworks/InternationalSupport.framework/Versions/A/InternationalSupport -0x000000019e66c000 /System/Library/PrivateFrameworks/UserActivity.framework/Versions/A/UserActivity -0x000000024efd6000 /System/Library/PrivateFrameworks/WindowManagement.framework/Versions/A/WindowManagement -0x0000000190195000 /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration -0x000000019da86000 /usr/lib/libspindump.dylib -0x0000000194154000 /System/Library/Frameworks/UniformTypeIdentifiers.framework/Versions/A/UniformTypeIdentifiers -0x0000000197d00000 /usr/lib/libapp_launch_measurement.dylib -0x0000000197126000 /System/Library/PrivateFrameworks/CoreAnalytics.framework/Versions/A/CoreAnalytics -0x0000000197d07000 /System/Library/PrivateFrameworks/CoreAutoLayout.framework/Versions/A/CoreAutoLayout -0x00000001996a9000 /System/Library/Frameworks/Metal.framework/Versions/A/Metal -0x000000019a631000 /usr/lib/liblangid.dylib -0x0000000199e8f000 /System/Library/PrivateFrameworks/CoreSVG.framework/Versions/A/CoreSVG -0x0000000194b19000 /System/Library/PrivateFrameworks/SkyLight.framework/Versions/A/SkyLight -0x0000000194fba000 /System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics -0x00000001a392f000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate -0x000000019d8e0000 /System/Library/PrivateFrameworks/IconServices.framework/Versions/A/IconServices -0x0000000199687000 /System/Library/Frameworks/IOSurface.framework/Versions/A/IOSurface -0x0000000197155000 /usr/lib/libDiagnosticMessagesClient.dylib -0x000000019bf1e000 /usr/lib/libz.1.dylib -0x00000001a70d4000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices -0x0000000199e71000 /System/Library/PrivateFrameworks/DFRFoundation.framework/Versions/A/DFRFoundation -0x00000001924bc000 /usr/lib/libicucore.A.dylib -0x000000019f676000 /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox -0x000000019e627000 /System/Library/PrivateFrameworks/DataDetectorsCore.framework/Versions/A/DataDetectorsCore -0x00000001b809a000 /System/Library/PrivateFrameworks/TextInput.framework/Versions/A/TextInput -0x0000000194a6a000 /usr/lib/libMobileGestalt.dylib -0x0000000199bad000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox -0x000000019762c000 /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore -0x00000001920e9000 /System/Library/Frameworks/Security.framework/Versions/A/Security -0x00000001a3295000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SpeechRecognition.framework/Versions/A/SpeechRecognition -0x0000000197a2e000 /System/Library/PrivateFrameworks/CoreUI.framework/Versions/A/CoreUI -0x00000001919e2000 /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio -0x0000000197239000 /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration -0x000000019dee2000 /System/Library/PrivateFrameworks/MultitouchSupport.framework/Versions/A/MultitouchSupport -0x0000000194a68000 /usr/lib/libenergytrace.dylib -0x00000001ad793000 /System/Library/PrivateFrameworks/RenderBox.framework/Versions/A/RenderBox -0x0000000192b16000 /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit -0x00000001a366a000 /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices -0x0000000197c8c000 /System/Library/PrivateFrameworks/PerformanceAnalysis.framework/Versions/A/PerformanceAnalysis -0x00000001e603f000 /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL -0x0000000197d51000 /usr/lib/libxml2.2.dylib -0x000000019b360000 /System/Library/PrivateFrameworks/MobileKeyBag.framework/Versions/A/MobileKeyBag -0x000000018ef80000 /usr/lib/libobjc.A.dylib -0x000000018f274000 /usr/lib/libc++.1.dylib -0x00000001a35e7000 /System/Library/Frameworks/Accessibility.framework/Versions/A/Accessibility -0x000000019569a000 /System/Library/Frameworks/ColorSync.framework/Versions/A/ColorSync -0x000000018f3c0000 /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation -0x000000019a1ec000 /System/Library/Frameworks/CoreImage.framework/Versions/A/CoreImage -0x00000001917ed000 /System/Library/Frameworks/CoreText.framework/Versions/A/CoreText -0x00000001ea89e000 /System/Library/Frameworks/CoreTransferable.framework/Versions/A/CoreTransferable -0x00000001ead63000 /System/Library/Frameworks/DeveloperToolsSupport.framework/Versions/A/DeveloperToolsSupport -0x0000000199eca000 /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO -0x0000000224d1f000 /System/Library/Frameworks/Symbols.framework/Versions/A/Symbols -0x000000019bfe2000 /System/Library/PrivateFrameworks/SoftLinking.framework/Versions/A/SoftLinking -0x000000019f028000 /usr/lib/swift/libswiftCore.dylib -0x00000001b4d27000 /usr/lib/swift/libswiftCoreFoundation.dylib -0x00000001b2790000 /usr/lib/swift/libswiftCoreGraphics.dylib -0x00000001b4d71000 /usr/lib/swift/libswiftCoreImage.dylib -0x00000001b2797000 /usr/lib/swift/libswiftDarwin.dylib -0x00000001a4cda000 /usr/lib/swift/libswiftDispatch.dylib -0x00000001b4d72000 /usr/lib/swift/libswiftIOKit.dylib -0x00000001c07cc000 /usr/lib/swift/libswiftMetal.dylib -0x00000001cde91000 /usr/lib/swift/libswiftOSLog.dylib -0x00000001a754f000 /usr/lib/swift/libswiftObjectiveC.dylib -0x00000001c4f00000 /usr/lib/swift/libswiftQuartzCore.dylib -0x00000001c9005000 /usr/lib/swift/libswiftUniformTypeIdentifiers.dylib -0x00000001b4d39000 /usr/lib/swift/libswiftXPC.dylib -0x000000025747d000 /usr/lib/swift/libswift_Concurrency.dylib -0x00000001a7553000 /usr/lib/swift/libswiftos.dylib -0x00000001b7ffe000 /usr/lib/swift/libswiftsimd.dylib -0x000000019c191000 /usr/lib/libcompression.dylib -0x000000019e572000 /System/Library/PrivateFrameworks/TextureIO.framework/Versions/A/TextureIO -0x000000019d58c000 /usr/lib/libate.dylib -0x000000019bfd6000 /usr/lib/system/libcache.dylib -0x000000019bf90000 /usr/lib/system/libcommonCrypto.dylib -0x000000019bfbc000 /usr/lib/system/libcompiler_rt.dylib -0x000000019bfb2000 /usr/lib/system/libcopyfile.dylib -0x000000018f0c4000 /usr/lib/system/libcorecrypto.dylib -0x000000018f1aa000 /usr/lib/system/libdispatch.dylib -0x000000018f365000 /usr/lib/system/libdyld.dylib -0x000000019bfcc000 /usr/lib/system/libkeymgr.dylib -0x000000019bf68000 /usr/lib/system/libmacho.dylib -0x000000019b448000 /usr/lib/system/libquarantine.dylib -0x000000019bfc9000 /usr/lib/system/libremovefile.dylib -0x0000000194ae0000 /usr/lib/system/libsystem_asl.dylib -0x000000018f059000 /usr/lib/system/libsystem_blocks.dylib -0x000000018f1f5000 /usr/lib/system/libsystem_c.dylib -0x000000019bfc0000 /usr/lib/system/libsystem_collections.dylib -0x000000019a620000 /usr/lib/system/libsystem_configuration.dylib -0x000000019965c000 /usr/lib/system/libsystem_containermanager.dylib -0x000000019bbff000 /usr/lib/system/libsystem_coreservices.dylib -0x0000000192783000 /usr/lib/system/libsystem_darwin.dylib -0x00000002577ca000 /usr/lib/system/libsystem_darwindirectory.dylib -0x000000019bfcd000 /usr/lib/system/libsystem_dnssd.dylib -0x00000002577ce000 /usr/lib/system/libsystem_eligibility.dylib -0x000000018f1f2000 /usr/lib/system/libsystem_featureflags.dylib -0x000000018f393000 /usr/lib/system/libsystem_info.dylib -0x000000019bf2d000 /usr/lib/system/libsystem_m.dylib -0x000000018f16d000 /usr/lib/system/libsystem_malloc.dylib -0x0000000194a4d000 /usr/lib/system/libsystem_networkextension.dylib -0x0000000192bf9000 /usr/lib/system/libsystem_notify.dylib -0x000000019a625000 /usr/lib/system/libsystem_sandbox.dylib -0x00000002577d2000 /usr/lib/system/libsystem_sanitizers.dylib -0x000000019bfc5000 /usr/lib/system/libsystem_secinit.dylib -0x000000018f31d000 /usr/lib/system/libsystem_kernel.dylib -0x000000018f38b000 /usr/lib/system/libsystem_platform.dylib -0x000000018f358000 /usr/lib/system/libsystem_pthread.dylib -0x00000001964d0000 /usr/lib/system/libsystem_symptoms.dylib -0x000000018f0a9000 /usr/lib/system/libsystem_trace.dylib -0x000000019bf9e000 /usr/lib/system/libunwind.dylib -0x000000018f05e000 /usr/lib/system/libxpc.dylib -0x000000018f301000 /usr/lib/libc++abi.dylib -0x000000019bfaa000 /usr/lib/liboah.dylib -0x000000019d438000 /usr/lib/liblzma.5.dylib -0x000000019bfde000 /usr/lib/libfakelink.dylib -0x0000000194679000 /System/Library/Frameworks/CFNetwork.framework/Versions/A/CFNetwork -0x000000019c032000 /usr/lib/libarchive.2.dylib -0x00000001a1568000 /System/Library/Frameworks/Combine.framework/Versions/A/Combine -0x000000022ab93000 /System/Library/PrivateFrameworks/CollectionsInternal.framework/Versions/A/CollectionsInternal -0x0000000241543000 /System/Library/PrivateFrameworks/ReflectionInternal.framework/Versions/A/ReflectionInternal -0x0000000241ad5000 /System/Library/PrivateFrameworks/RuntimeInternal.framework/Versions/A/RuntimeInternal -0x00000002575d1000 /usr/lib/swift/libswift_StringProcessing.dylib -0x0000000192a94000 /System/Library/PrivateFrameworks/CoreServicesInternal.framework/Versions/A/CoreServicesInternal -0x000000019b46f000 /usr/lib/libbsm.0.dylib -0x000000019bf70000 /usr/lib/system/libkxld.dylib -0x0000000197cc8000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/FSEvents.framework/Versions/A/FSEvents -0x000000019278e000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore -0x000000019719e000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata -0x000000019bc05000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices -0x000000019c0bb000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit -0x0000000196451000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE -0x000000018f899000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices -0x000000019d3e1000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/DictionaryServices.framework/Versions/A/DictionaryServices -0x0000000197cd5000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SharedFileList.framework/Versions/A/SharedFileList -0x000000019c15b000 /usr/lib/libapple_nghttp2.dylib -0x00000001960c5000 /usr/lib/libsqlite3.dylib -0x00000001964d9000 /System/Library/Frameworks/Network.framework/Versions/A/Network -0x0000000255e8e000 /usr/lib/libCoreEntitlements.dylib -0x000000023c44d000 /System/Library/PrivateFrameworks/MessageSecurity.framework/Versions/A/MessageSecurity -0x00000001960ab000 /System/Library/PrivateFrameworks/ProtocolBuffer.framework/Versions/A/ProtocolBuffer -0x000000019bb2e000 /System/Library/PrivateFrameworks/AppleFSCompression.framework/Versions/A/AppleFSCompression -0x000000019b457000 /usr/lib/libcoretls.dylib -0x000000019d457000 /usr/lib/libcoretls_cfhelpers.dylib -0x000000019c18b000 /usr/lib/libpam.2.dylib -0x000000019d4c9000 /usr/lib/libxar.1.dylib -0x000000019d8b7000 /usr/lib/libheimdal-asn1.dylib -0x0000000194678000 /usr/lib/libnetwork.dylib -0x000000019bfe3000 /usr/lib/libpcap.A.dylib -0x00000001964c5000 /usr/lib/libdns_services.dylib -0x000000019a62d000 /System/Library/PrivateFrameworks/AppleSystemInfo.framework/Versions/A/AppleSystemInfo -0x000000019b155000 /System/Library/PrivateFrameworks/IOMobileFramebuffer.framework/Versions/A/IOMobileFramebuffer -0x0000000257528000 /usr/lib/swift/libswift_RegexParser.dylib -0x000000019bbf2000 /usr/lib/libbz2.1.0.dylib -0x000000019b44b000 /usr/lib/libCheckFix.dylib -0x0000000194af8000 /System/Library/PrivateFrameworks/TCC.framework/Versions/A/TCC -0x000000019a633000 /System/Library/PrivateFrameworks/CoreNLP.framework/Versions/A/CoreNLP -0x0000000197157000 /System/Library/PrivateFrameworks/MetadataUtilities.framework/Versions/A/MetadataUtilities -0x000000019b481000 /usr/lib/libmecab.dylib -0x0000000190229000 /usr/lib/libCRFSuite.dylib -0x000000019b4dd000 /usr/lib/libgermantok.dylib -0x000000019c132000 /usr/lib/libThaiTokenizer.dylib -0x0000000197242000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.framework/Versions/A/vImage -0x00000001a3641000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/vecLib -0x000000019d510000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvMisc.dylib -0x000000019b030000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvDSP.dylib -0x000000018fca0000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib -0x000000019c266000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib -0x000000019b4e0000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLinearAlgebra.dylib -0x000000019c176000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparseBLAS.dylib -0x000000019c261000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libQuadrature.dylib -0x000000019a75c000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBNNS.dylib -0x000000019012e000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparse.dylib -0x000000023ab9c000 /System/Library/PrivateFrameworks/MIL.framework/Versions/A/MIL -0x000000019c019000 /usr/lib/libiconv.2.dylib -0x000000019bf64000 /usr/lib/libcharset.1.dylib -0x0000000197ca8000 /System/Library/Frameworks/OpenDirectory.framework/Versions/A/Frameworks/CFOpenDirectory.framework/Versions/A/CFOpenDirectory -0x0000000197c98000 /System/Library/Frameworks/OpenDirectory.framework/Versions/A/OpenDirectory -0x000000019d459000 /System/Library/PrivateFrameworks/APFS.framework/Versions/A/APFS -0x000000019b387000 /System/Library/Frameworks/SecurityFoundation.framework/Versions/A/SecurityFoundation -0x000000019d4d8000 /usr/lib/libutil.dylib -0x0000000238cfd000 /System/Library/PrivateFrameworks/InstalledContentLibrary.framework/Versions/A/InstalledContentLibrary -0x0000000192ad5000 /System/Library/PrivateFrameworks/CoreServicesStore.framework/Versions/A/CoreServicesStore -0x0000000228340000 /System/Library/PrivateFrameworks/AppleMobileFileIntegrity.framework/Versions/A/AppleMobileFileIntegrity -0x00000001b4cf5000 /usr/lib/libmis.dylib -0x00000001c53e7000 /System/Library/PrivateFrameworks/MobileSystemServices.framework/Versions/A/MobileSystemServices -0x00000001e3449000 /System/Library/PrivateFrameworks/ConfigProfileHelper.framework/Versions/A/ConfigProfileHelper -0x000000019c134000 /System/Library/PrivateFrameworks/AppleSauce.framework/Versions/A/AppleSauce -0x0000000191173000 /System/Library/PrivateFrameworks/LanguageModeling.framework/Versions/A/LanguageModeling -0x000000019d4dc000 /usr/lib/libxslt.1.dylib -0x000000019c020000 /usr/lib/libcmph.dylib -0x000000019b121000 /System/Library/PrivateFrameworks/CoreEmoji.framework/Versions/A/CoreEmoji -0x000000019a756000 /System/Library/PrivateFrameworks/LinguisticData.framework/Versions/A/LinguisticData -0x000000019003c000 /System/Library/PrivateFrameworks/Lexicon.framework/Versions/A/Lexicon -0x000000019b415000 /System/Library/PrivateFrameworks/BackgroundTaskManagement.framework/Versions/A/BackgroundTaskManagement -0x0000000256078000 /usr/lib/libTLE.dylib -0x000000019dda8000 /System/Library/PrivateFrameworks/AppleJPEG.framework/Versions/A/AppleJPEG -0x000000019d89c000 /usr/lib/libexpat.1.dylib -0x000000019e3d0000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libPng.dylib -0x000000019e3fb000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib -0x000000019e4e6000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libGIF.dylib -0x000000019ddee000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJP2.dylib -0x000000019e48b000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib -0x000000019e482000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libRadiance.dylib -0x0000000199a48000 /System/Library/PrivateFrameworks/FontServices.framework/libFontParser.dylib -0x00000001963ea000 /System/Library/PrivateFrameworks/RunningBoardServices.framework/Versions/A/RunningBoardServices -0x00000001a9f95000 /System/Library/PrivateFrameworks/IOSurfaceAccelerator.framework/Versions/A/IOSurfaceAccelerator -0x000000019dede000 /System/Library/PrivateFrameworks/WatchdogClient.framework/Versions/A/WatchdogClient -0x0000000191359000 /System/Library/Frameworks/CoreDisplay.framework/Versions/A/CoreDisplay -0x00000001998ff000 /System/Library/Frameworks/CoreMedia.framework/Versions/A/CoreMedia -0x000000019969f000 /System/Library/PrivateFrameworks/IOAccelerator.framework/Versions/A/IOAccelerator -0x0000000197e3b000 /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo -0x000000019c189000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/MetalPerformanceShaders -0x000000019df21000 /System/Library/Frameworks/VideoToolbox.framework/Versions/A/VideoToolbox -0x0000000197ed7000 /System/Library/PrivateFrameworks/UserManagement.framework/Versions/A/UserManagement -0x0000000196311000 /System/Library/PrivateFrameworks/BaseBoard.framework/Versions/A/BaseBoard -0x000000019a62b000 /System/Library/PrivateFrameworks/AggregateDictionary.framework/Versions/A/AggregateDictionary -0x000000022817a000 /System/Library/PrivateFrameworks/AppleKeyStore.framework/Versions/A/AppleKeyStore -0x000000019e47d000 /System/Library/PrivateFrameworks/GPUWrangler.framework/Versions/A/GPUWrangler -0x000000019e45d000 /System/Library/PrivateFrameworks/IOPresentment.framework/Versions/A/IOPresentment -0x000000019e485000 /System/Library/PrivateFrameworks/DSExternalDisplay.framework/Versions/A/DSExternalDisplay -0x0000000234d8a000 /System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/32023/Libraries/libllvm-flatbuffers.dylib -0x00000001e6032000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCoreFSCache.dylib -0x00000002319ee000 /System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/32023/Libraries/libGPUCompilerUtils.dylib -0x000000019e4ec000 /System/Library/PrivateFrameworks/CMCaptureCore.framework/Versions/A/CMCaptureCore -0x00000001eae86000 /System/Library/Frameworks/ExtensionFoundation.framework/Versions/A/ExtensionFoundation -0x00000001a5543000 /System/Library/PrivateFrameworks/CoreTime.framework/Versions/A/CoreTime -0x000000019da70000 /System/Library/PrivateFrameworks/AppServerSupport.framework/Versions/A/AppServerSupport -0x00000001a0004000 /System/Library/PrivateFrameworks/perfdata.framework/Versions/A/perfdata -0x000000019147d000 /System/Library/PrivateFrameworks/AudioToolboxCore.framework/Versions/A/AudioToolboxCore -0x00000001998d5000 /System/Library/PrivateFrameworks/caulk.framework/Versions/A/caulk -0x000000019f872000 /usr/lib/libAudioStatistics.dylib -0x00000001b402e000 /System/Library/PrivateFrameworks/SystemPolicy.framework/Versions/A/SystemPolicy -0x000000019fb4b000 /usr/lib/libSMC.dylib -0x00000001a953d000 /System/Library/Frameworks/CoreMIDI.framework/Versions/A/CoreMIDI -0x000000019e397000 /usr/lib/libAudioToolboxUtility.dylib -0x00000001af42f000 /System/Library/PrivateFrameworks/OSAServicesClient.framework/Versions/A/OSAServicesClient -0x00000001a0012000 /usr/lib/libperfcheck.dylib -0x00000001a4ffa000 /System/Library/PrivateFrameworks/BoardServices.framework/Versions/A/BoardServices -0x000000019d784000 /System/Library/PrivateFrameworks/PlugInKit.framework/Versions/A/PlugInKit -0x000000019b379000 /System/Library/PrivateFrameworks/AssertionServices.framework/Versions/A/AssertionServices -0x00000001a864e000 /System/Library/PrivateFrameworks/ASEProcessing.framework/Versions/A/ASEProcessing -0x00000001d1318000 /System/Library/PrivateFrameworks/Symbolication.framework/Versions/A/Symbolication -0x0000000240330000 /System/Library/PrivateFrameworks/PhotosensitivityProcessing.framework/Versions/A/PhotosensitivityProcessing -0x000000019da21000 /System/Library/PrivateFrameworks/GraphVisualizer.framework/Versions/A/GraphVisualizer -0x00000001e6094000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib -0x00000001e6053000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGFXShared.dylib -0x00000001e622c000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib -0x00000001e605c000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLImage.dylib -0x00000001e6050000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCVMSPluginSupport.dylib -0x0000000256030000 /usr/lib/libRosetta.dylib -0x00000001e6039000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCoreVMClient.dylib -0x000000022fbf4000 /System/Library/PrivateFrameworks/FontServices.framework/Versions/A/FontServices -0x000000019da2d000 /System/Library/PrivateFrameworks/OTSVG.framework/Versions/A/OTSVG -0x00000001979dc000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/Resources/libFontRegistry.dylib -0x000000019da7b000 /System/Library/PrivateFrameworks/FontServices.framework/libhvf.dylib -0x000000022fbf5000 /System/Library/PrivateFrameworks/FontServices.framework/libXTFontStaticRegistryData.dylib -0x000000019a572000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSCore.framework/Versions/A/MPSCore -0x000000019ba9c000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSImage.framework/Versions/A/MPSImage -0x000000019b4f5000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSNeuralNetwork.framework/Versions/A/MPSNeuralNetwork -0x000000019b940000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSMatrix.framework/Versions/A/MPSMatrix -0x000000019b74b000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSRayIntersector.framework/Versions/A/MPSRayIntersector -0x000000019b972000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSNDArray.framework/Versions/A/MPSNDArray -0x00000001ec760000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSFunctions.framework/Versions/A/MPSFunctions -0x00000001ec745000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSBenchmarkLoop.framework/Versions/A/MPSBenchmarkLoop -0x000000018fb54000 /System/Library/PrivateFrameworks/MetalTools.framework/Versions/A/MetalTools -0x00000001b91d7000 /System/Library/PrivateFrameworks/IOAccelMemoryInfo.framework/Versions/A/IOAccelMemoryInfo -0x00000001c52e0000 /System/Library/PrivateFrameworks/kperf.framework/Versions/A/kperf -0x00000001b4d1a000 /System/Library/PrivateFrameworks/GPURawCounter.framework/Versions/A/GPURawCounter -0x00000001a5415000 /System/Library/PrivateFrameworks/CoreSymbolication.framework/Versions/A/CoreSymbolication -0x00000001b4cc6000 /System/Library/PrivateFrameworks/MallocStackLogging.framework/Versions/A/MallocStackLogging -0x000000019d626000 /System/Library/PrivateFrameworks/CrashReporterSupport.framework/Versions/A/CrashReporterSupport -0x00000001a53d0000 /System/Library/PrivateFrameworks/DebugSymbols.framework/Versions/A/DebugSymbols -0x00000001c3c47000 /System/Library/PrivateFrameworks/OSAnalytics.framework/Versions/A/OSAnalytics -0x000000024d229000 /System/Library/PrivateFrameworks/VideoToolboxParavirtualizationSupport.framework/Versions/A/VideoToolboxParavirtualizationSupport -0x000000019d850000 /System/Library/PrivateFrameworks/AppleVA.framework/Versions/A/AppleVA -0x000000019f8ba000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS -0x0000000195849000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices -0x000000019e4fa000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/PrintCore -0x000000019fca4000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/QD.framework/Versions/A/QD -0x000000019fc98000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSyncLegacy.framework/Versions/A/ColorSyncLegacy -0x000000019f88a000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis -0x000000019e4b6000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATSUI.framework/Versions/A/ATSUI -0x000000019fc2b000 /usr/lib/libcups.2.dylib -0x00000001a0020000 /System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos -0x00000001a0031000 /System/Library/Frameworks/GSS.framework/Versions/A/GSS -0x000000019f939000 /usr/lib/libresolv.9.dylib -0x000000019da8c000 /System/Library/PrivateFrameworks/Heimdal.framework/Versions/A/Heimdal -0x00000001a74bc000 /System/Library/Frameworks/Kerberos.framework/Versions/A/Libraries/libHeimdalProxy.dylib -0x00000001a008b000 /System/Library/PrivateFrameworks/CommonAuth.framework/Versions/A/CommonAuth -0x00000001e9c6c000 /System/Library/Frameworks/AVFAudio.framework/Versions/A/AVFAudio -0x00000001af47e000 /System/Library/PrivateFrameworks/AXCoreUtilities.framework/Versions/A/AXCoreUtilities -0x000000023a274000 /System/Library/PrivateFrameworks/IsolatedCoreAudioClient.framework/Versions/A/IsolatedCoreAudioClient -0x000000019f7f6000 /System/Library/PrivateFrameworks/AudioSession.framework/Versions/A/AudioSession -0x00000001a1307000 /System/Library/Frameworks/IOBluetooth.framework/Versions/A/IOBluetooth -0x000000019d95b000 /System/Library/PrivateFrameworks/MediaExperience.framework/Versions/A/MediaExperience -0x000000019f635000 /System/Library/PrivateFrameworks/AudioSession.framework/libSessionUtility.dylib -0x000000019fcb0000 /System/Library/PrivateFrameworks/AudioResourceArbitration.framework/Versions/A/AudioResourceArbitration -0x00000001a4388000 /System/Library/PrivateFrameworks/PowerLog.framework/Versions/A/PowerLog -0x00000001a42a6000 /System/Library/Frameworks/CoreBluetooth.framework/Versions/A/CoreBluetooth -0x00000001a74bd000 /System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit -0x000000019b1e2000 /System/Library/PrivateFrameworks/CoreUtils.framework/Versions/A/CoreUtils -0x000000022de3f000 /System/Library/PrivateFrameworks/CoreUtilsExtras.framework/Versions/A/CoreUtilsExtras -0x0000000238b8a000 /System/Library/PrivateFrameworks/IO80211.framework/Versions/A/IO80211 -0x00000001a4f3e000 /System/Library/PrivateFrameworks/FrontBoardServices.framework/Versions/A/FrontBoardServices -0x00000001a6a85000 /System/Library/PrivateFrameworks/BackBoardServices.framework/Versions/A/BackBoardServices -0x000000019d8c2000 /System/Library/PrivateFrameworks/IconFoundation.framework/Versions/A/IconFoundation -0x00000001a3281000 /System/Library/PrivateFrameworks/SpeechRecognitionCore.framework/Versions/A/SpeechRecognitionCore -0x00000001af49d000 /usr/lib/libAccessibility.dylib -0x00000001a397b000 /System/Library/Frameworks/MediaAccessibility.framework/Versions/A/MediaAccessibility -0x00000001d49cc000 /System/Library/Frameworks/OSLog.framework/Versions/A/OSLog -0x00000001b4c54000 /System/Library/PrivateFrameworks/LoggingSupport.framework/Versions/A/LoggingSupport -0x0000000105c48000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/server/libjvm.dylib -0x00000001045dc000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjimage.dylib -0x0000000104608000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libinstrument.dylib -0x0000000104650000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjava.dylib -0x00000001048ec000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libzip.dylib -0x0000000104914000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libnio.dylib -0x0000000104638000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libnet.dylib -0x00000001046e8000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libextnet.dylib -0x0000000105bc8000 /Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/libsomelib.dylib -0x000000010462c000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libsyslookup.dylib - - -VM Arguments: -jvm_args: -ea -Didea.test.cyclic.buffer.size=1048576 -javaagent:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/lib/idea_rt.jar=60586:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/bin -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 -java_command: com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit5 dev.diplomattest.somelib.Float64VecTest,testFloat64Vec -java_class_path (initial): /Users/cristina/.m2/repository/org/junit/platform/junit-platform-launcher/1.10.3/junit-platform-launcher-1.10.3.jar:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/lib/idea_rt.jar:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/plugins/junit/lib/junit5-rt.jar:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/plugins/junit/lib/junit-rt.jar:/Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/target/test-classes:/Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/target/classes:/Users/cristina/.m2/repository/net/java/dev/jna/jna/5.14.0/jna-5.14.0.jar:/Users/cristina/.m2/repository/org/junit/jupiter/junit-jupiter/5.10.3/junit-jupiter-5.10.3.jar:/Users/cristina/.m2/repository/org/junit/jupiter/junit-jupiter-api/5.10.3/junit-jupiter-api-5.10.3.jar:/Users/cristina/.m2/repository/org/opentest4j/opentest4j/1.3.0/opentest4j-1.3.0.jar:/Users/cristina/.m2/repository/org/junit/platform/junit-platform-commons/1.10.3/junit-platform-commons-1.10.3.jar:/Users/cristina/.m2/repository/org/apiguardian/apiguardian-api/1.1.2/apiguardian-api-1.1.2.jar:/Users/cristina/.m2/repository/org/junit/jupiter/junit-jupiter-params/5.10.3/junit-jupiter-params-5.10.3.jar:/Users/cristina/.m2/repository/org/junit/jupiter/junit-jupiter-engine/5.10.3/junit-jupiter-engine-5.10.3.jar:/Users/cristina/.m2/repository/org/junit/platform/junit-platform-engine/1.10.3/junit-platform-engine-1.10.3.jar:/Users/cristina/.m2/repository/org/openjdk/jmh/jmh-core/1.37/jmh-core-1.37.jar:/Users/cristina/.m2/repository/net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4.jar:/Users/cristina/.m2/repository/org/apache/commons/commons-math3/3.6.1/commons-math3-3.6.1.jar:/Users/cristina/.m2/repository/org/openjdk/jmh/jmh-generator-annprocess/1.37/jmh-generator-annprocess-1.37.jar -Launcher Type: SUN_STANDARD - -[Global flags] - intx CICompilerCount = 4 {product} {ergonomic} - uint ConcGCThreads = 2 {product} {ergonomic} - uint G1ConcRefinementThreads = 8 {product} {ergonomic} - size_t G1HeapRegionSize = 2097152 {product} {ergonomic} - size_t InitialHeapSize = 268435456 {product} {ergonomic} - size_t MarkStackSize = 4194304 {product} {ergonomic} - size_t MaxHeapSize = 4294967296 {product} {ergonomic} - size_t MaxNewSize = 2575302656 {product} {ergonomic} - size_t MinHeapDeltaBytes = 2097152 {product} {ergonomic} - size_t MinHeapSize = 8388608 {product} {ergonomic} - uintx NonNMethodCodeHeapSize = 5839564 {pd product} {ergonomic} - uintx NonProfiledCodeHeapSize = 122909338 {pd product} {ergonomic} - uintx ProfiledCodeHeapSize = 122909338 {pd product} {ergonomic} - uintx ReservedCodeCacheSize = 251658240 {pd product} {ergonomic} - bool SegmentedCodeCache = true {product} {ergonomic} - size_t SoftMaxHeapSize = 4294967296 {manageable} {ergonomic} - bool UseCompressedOops = true {product lp64_product} {ergonomic} - bool UseG1GC = true {product} {ergonomic} - bool UseNUMA = false {product} {ergonomic} - bool UseNUMAInterleaving = false {product} {ergonomic} - -Logging: -Log output configuration: - #0: stdout all=warning uptime,level,tags foldmultilines=false - #1: stderr all=off uptime,level,tags foldmultilines=false - -Environment Variables: -JAVA_HOME=/Users/cristina/Library/Java/JavaVirtualMachines/corretto-19.0.1/Contents/Home/ -PATH=/Users/cristina/bin/jextract-22/bin:/bin:/Users/cristina/.modular/pkg/packages.modular.com_mojo/bin:/Users/cristina/Downloads/dart-sdk/bin:/opt/homebrew/Cellar/llvm/15.0.6/bin:/opt/homebrew/opt/openjdk/bin:/Users/cristina/.elan/bin:/Users/cristina/bin:/Users/cristina/Library/Application Support/Coursier/bin:/Users/cristina/Library/Python/3.8/bin:/Users/cristina/.local/bin:/Users/cristina/.cargo/bin:/Users/cristina/.cargo:/opt/homebrew/bin:/Users/cristina/.fzf/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/X11/bin:/Library/Apple/usr/bin:/usr/local/go/bin:/Library/TeX/texbin:/Users/cristina/.krew/bin -SHELL=/opt/homebrew/bin/fish -LC_CTYPE=en_US.UTF-8 -TMPDIR=/var/folders/x_/9qhndrhs79j640bxvmbkddfw0000gn/T/ - -Active Locale: -LC_ALL=C/en_US.UTF-8/C/C/C/C -LC_COLLATE=C -LC_CTYPE=en_US.UTF-8 -LC_MESSAGES=C -LC_MONETARY=C -LC_NUMERIC=C -LC_TIME=C - -Signal Handlers: - SIGSEGV: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_ONSTACK|SA_RESTART|SA_SIGINFO, unblocked - SIGBUS: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, unblocked - SIGFPE: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, unblocked - SIGPIPE: javaSignalHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked - SIGXFSZ: javaSignalHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked - SIGILL: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, unblocked - SIGUSR2: SR_handler in libjvm.dylib, mask=00100000000000000000000000000000, flags=SA_RESTART|SA_SIGINFO, blocked - SIGHUP: UserHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked - SIGINT: UserHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked - SIGTERM: UserHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked - SIGQUIT: UserHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked - SIGTRAP: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, unblocked - - -Periodic native trim disabled - ---------------- S Y S T E M --------------- - -OS: -uname: Darwin 23.5.0 Darwin Kernel Version 23.5.0: Wed May 1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000 arm64 -OS uptime: 45 days 10:06 hours -rlimit (soft/hard): STACK 8176k/65520k , CORE 0k/infinity , NPROC 2666/4000 , NOFILE 10240/infinity , AS infinity/infinity , CPU infinity/infinity , DATA infinity/infinity , FSIZE infinity/infinity , MEMLOCK infinity/infinity , RSS infinity/infinity -load average: 5.72 4.67 4.57 - -CPU: total 8 (initial active 8) 0x61:0x0:0x1b588bb3:0, fp, asimd, aes, pmull, sha1, sha256, crc32, lse, sha3, sha512 -machdep.cpu.brand_string:Apple M1 Pro -hw.cachelinesize:128 -hw.l1icachesize:131072 -hw.l1dcachesize:65536 -hw.l2cachesize:4194304 - -Memory: 16k page, physical 16777216k(111072k free), swap 3145728k(1371968k free) - -vm_info: OpenJDK 64-Bit Server VM (22.0.1+8) for bsd-aarch64 JRE (22.0.1+8), built on 2024-04-16T00:00:00Z by "admin" with clang Apple LLVM 15.0.0 (clang-1500.1.0.2.5) - -END. diff --git a/feature_tests/java/somelib/hs_err_pid98829.log b/feature_tests/java/somelib/hs_err_pid98829.log deleted file mode 100644 index df207147e..000000000 --- a/feature_tests/java/somelib/hs_err_pid98829.log +++ /dev/null @@ -1,1291 +0,0 @@ -# -# A fatal error has been detected by the Java Runtime Environment: -# -# SIGSEGV (0xb) at pc=0x000000010188daec, pid=98829, tid=10243 -# -# JRE version: OpenJDK Runtime Environment Temurin-22.0.1+8 (22.0.1+8) (build 22.0.1+8) -# Java VM: OpenJDK 64-Bit Server VM Temurin-22.0.1+8 (22.0.1+8, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-aarch64) -# Problematic frame: -# C [libsomelib.dylib+0x5aec] Float64Vec_new_isize+0xb4 -# -# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again -# -# If you would like to submit a bug report, please visit: -# https://github.com/adoptium/adoptium-support/issues -# The crash happened outside the Java Virtual Machine in native code. -# See problematic frame for where to report the bug. -# - ---------------- S U M M A R Y ------------ - -Command Line: -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:60588,suspend=y,server=n -ea -Didea.test.cyclic.buffer.size=1048576 -javaagent:/Users/cristina/Library/Caches/JetBrains/IdeaIC2024.1/captureAgent/debugger-agent.jar -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit5 dev.diplomattest.somelib.Float64VecTest,testFloat64Vec - -Host: "MacBookPro18,3" arm64, 8 cores, 16G, Darwin 23.5.0, macOS 14.5 (23F79) -Time: Wed Aug 14 21:07:28 2024 CEST elapsed time: 7.932889 seconds (0d 0h 0m 7s) - ---------------- T H R E A D --------------- - -Current thread (0x000000015580d200): JavaThread "main" [_thread_in_native, id=10243, stack(0x000000016fb98000,0x000000016fd9b000) (2060K)] - -Stack: [0x000000016fb98000,0x000000016fd9b000], sp=0x000000016fd97870, free space=2046k -Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) -C [libsomelib.dylib+0x5aec] Float64Vec_new_isize+0xb4 -v ~RuntimeStub::nep_invoker_blob 0x000000011267ecbc -j java.lang.invoke.LambdaForm$MH+0x00007e00001d0400.invoke(Ljava/lang/Object;JJJ)J+12 java.base@22.0.1 -j java.lang.invoke.LambdaForm$MH+0x00007e00001d3000.invokeExact_MT(Ljava/lang/Object;JJJLjava/lang/Object;)J+23 java.base@22.0.1 -j jdk.internal.foreign.abi.DowncallStub+0x00007e00001d1000.invoke(Ljava/lang/foreign/SegmentAllocator;Ljava/lang/foreign/MemorySegment;Ljava/lang/foreign/MemorySegment;)Ljava/lang/foreign/MemorySegment;+69 java.base@22.0.1 -j java.lang.invoke.LambdaForm$DMH+0x00007e00001d1400.invokeStaticInit(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+14 java.base@22.0.1 -j java.lang.invoke.LambdaForm$MH+0x00007e00001d2400.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+44 java.base@22.0.1 -j java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+19 java.base@22.0.1 -j dev.diplomattest.somelib.ntv.somelib_h.Float64Vec_new_isize(Ljava/lang/foreign/MemorySegment;)Ljava/lang/foreign/MemorySegment;+26 -j dev.diplomattest.somelib.Float64Vec.newIsize([J)Ldev/diplomattest/somelib/Float64Vec;+38 -j dev.diplomattest.somelib.Float64VecTest.testFloat64Vec()V+53 -j java.lang.invoke.LambdaForm$DMH+0x00007e0000140c00.invokeVirtual(Ljava/lang/Object;Ljava/lang/Object;)V+10 java.base@22.0.1 -j java.lang.invoke.LambdaForm$MH+0x00007e0000148400.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+31 java.base@22.0.1 -j java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+19 java.base@22.0.1 -j jdk.internal.reflect.DirectMethodHandleAccessor.invokeImpl(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+41 java.base@22.0.1 -j jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+23 java.base@22.0.1 -j java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+102 java.base@22.0.1 -j org.junit.platform.commons.util.ReflectionUtils.invokeMethod(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+42 -j org.junit.jupiter.engine.execution.MethodInvocation.proceed()Ljava/lang/Object;+16 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed()Ljava/lang/Object;+8 -j org.junit.jupiter.engine.extension.TimeoutExtension.intercept(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/TimeoutDuration;Lorg/junit/jupiter/engine/extension/TimeoutExtension$TimeoutProvider;)Ljava/lang/Object;+28 -j org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/TimeoutExtension$TimeoutProvider;)Ljava/lang/Object;+31 -j org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)V+9 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda+0x00007e0000117998.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)V+5 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall$VoidMethodInterceptorCall;Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)Ljava/lang/Void;+6 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall$$Lambda+0x00007e0000117da8.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)Ljava/lang/Object;+9 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+6 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$$Lambda+0x00007e00001465f0.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+14 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed()Ljava/lang/Object;+12 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+1 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/engine/execution/InvocationInterceptorChain$InterceptorCall;Ljava/util/List;)Ljava/lang/Object;+24 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InvocationInterceptorChain$InterceptorCall;)Ljava/lang/Object;+31 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;)Ljava/lang/Object;+15 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(Ljava/lang/reflect/Method;Ljava/lang/Object;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;)Ljava/lang/Object;+55 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;)V+28 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda+0x00007e0000142aa8.execute()V+12 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)V+21 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;+44 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;+6 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+79 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00007e0000136220.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00007e0000136000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 -j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00007e0000133bc0.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService$$Lambda+0x00007e0000136d10.accept(Ljava/lang/Object;)V+4 -j java.util.ArrayList.forEach(Ljava/util/function/Consumer;)V+46 java.base@22.0.1 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(Ljava/util/List;)V+6 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+116 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00007e0000136220.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00007e0000136000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 -j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00007e0000133bc0.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService$$Lambda+0x00007e0000136d10.accept(Ljava/lang/Object;)V+4 -j java.util.ArrayList.forEach(Ljava/util/function/Consumer;)V+46 java.base@22.0.1 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(Ljava/util/List;)V+6 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+116 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00007e0000136220.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00007e0000136000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 -j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00007e0000133bc0.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(Lorg/junit/platform/engine/support/hierarchical/HierarchicalTestExecutorService$TestTask;)Ljava/util/concurrent/Future;+1 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute()Ljava/util/concurrent/Future;+74 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(Lorg/junit/platform/engine/ExecutionRequest;)V+31 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/engine/TestDescriptor;Lorg/junit/platform/engine/EngineExecutionListener;Lorg/junit/platform/engine/ConfigurationParameters;Lorg/junit/platform/engine/TestEngine;)V+24 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/LauncherDiscoveryResult;Lorg/junit/platform/engine/EngineExecutionListener;)V+115 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;Lorg/junit/platform/engine/EngineExecutionListener;Lorg/junit/platform/launcher/TestExecutionListener;)V+55 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(Lorg/junit/platform/launcher/core/InternalTestPlan;Lorg/junit/platform/launcher/TestExecutionListener;)V+6 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator$$Lambda+0x00007e0000120000.accept(Ljava/lang/Object;)V+12 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(Lorg/junit/platform/engine/ConfigurationParameters;Lorg/junit/platform/launcher/core/ListenerRegistry;Ljava/util/function/Consumer;)V+51 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;[Lorg/junit/platform/launcher/TestExecutionListener;)V+23 -j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;[Lorg/junit/platform/launcher/TestExecutionListener;)V+6 -j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+34 -j org.junit.platform.launcher.core.DelegatingLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+6 -j org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+13 -j com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs([Ljava/lang/String;Ljava/lang/String;IZ)I+203 -j com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(Z)I+17 -j com.intellij.rt.execution.junit.TestsRepeater.repeat(IZLcom/intellij/rt/execution/junit/TestsRepeater$TestRun;)I+7 -j com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(Lcom/intellij/rt/junit/IdeaTestRunner;[Ljava/lang/String;Ljava/util/ArrayList;Ljava/lang/String;IZ)I+25 -j com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart([Ljava/lang/String;Ljava/lang/String;Ljava/util/ArrayList;Ljava/lang/String;)I+117 -j com.intellij.rt.junit.JUnitStarter.main([Ljava/lang/String;)V+97 -v ~StubRoutines::call_stub 0x0000000112554154 -...... -Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) -v ~RuntimeStub::nep_invoker_blob 0x000000011267ec8c -j java.lang.invoke.LambdaForm$MH+0x00007e00001d0400.invoke(Ljava/lang/Object;JJJ)J+12 java.base@22.0.1 -j java.lang.invoke.LambdaForm$MH+0x00007e00001d3000.invokeExact_MT(Ljava/lang/Object;JJJLjava/lang/Object;)J+23 java.base@22.0.1 -j jdk.internal.foreign.abi.DowncallStub+0x00007e00001d1000.invoke(Ljava/lang/foreign/SegmentAllocator;Ljava/lang/foreign/MemorySegment;Ljava/lang/foreign/MemorySegment;)Ljava/lang/foreign/MemorySegment;+69 java.base@22.0.1 -j java.lang.invoke.LambdaForm$DMH+0x00007e00001d1400.invokeStaticInit(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+14 java.base@22.0.1 -j java.lang.invoke.LambdaForm$MH+0x00007e00001d2400.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+44 java.base@22.0.1 -j java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+19 java.base@22.0.1 -j dev.diplomattest.somelib.ntv.somelib_h.Float64Vec_new_isize(Ljava/lang/foreign/MemorySegment;)Ljava/lang/foreign/MemorySegment;+26 -j dev.diplomattest.somelib.Float64Vec.newIsize([J)Ldev/diplomattest/somelib/Float64Vec;+38 -j dev.diplomattest.somelib.Float64VecTest.testFloat64Vec()V+53 -j java.lang.invoke.LambdaForm$DMH+0x00007e0000140c00.invokeVirtual(Ljava/lang/Object;Ljava/lang/Object;)V+10 java.base@22.0.1 -j java.lang.invoke.LambdaForm$MH+0x00007e0000148400.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+31 java.base@22.0.1 -j java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+19 java.base@22.0.1 -j jdk.internal.reflect.DirectMethodHandleAccessor.invokeImpl(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+41 java.base@22.0.1 -j jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+23 java.base@22.0.1 -j java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+102 java.base@22.0.1 -j org.junit.platform.commons.util.ReflectionUtils.invokeMethod(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+42 -j org.junit.jupiter.engine.execution.MethodInvocation.proceed()Ljava/lang/Object;+16 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed()Ljava/lang/Object;+8 -j org.junit.jupiter.engine.extension.TimeoutExtension.intercept(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/TimeoutDuration;Lorg/junit/jupiter/engine/extension/TimeoutExtension$TimeoutProvider;)Ljava/lang/Object;+28 -j org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/TimeoutExtension$TimeoutProvider;)Ljava/lang/Object;+31 -j org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)V+9 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda+0x00007e0000117998.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)V+5 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall$VoidMethodInterceptorCall;Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)Ljava/lang/Void;+6 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall$$Lambda+0x00007e0000117da8.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)Ljava/lang/Object;+9 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+6 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$$Lambda+0x00007e00001465f0.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+14 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed()Ljava/lang/Object;+12 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+1 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/engine/execution/InvocationInterceptorChain$InterceptorCall;Ljava/util/List;)Ljava/lang/Object;+24 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InvocationInterceptorChain$InterceptorCall;)Ljava/lang/Object;+31 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;)Ljava/lang/Object;+15 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(Ljava/lang/reflect/Method;Ljava/lang/Object;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;)Ljava/lang/Object;+55 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;)V+28 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda+0x00007e0000142aa8.execute()V+12 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)V+21 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;+44 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;+6 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+79 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00007e0000136220.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00007e0000136000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 -j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00007e0000133bc0.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService$$Lambda+0x00007e0000136d10.accept(Ljava/lang/Object;)V+4 -j java.util.ArrayList.forEach(Ljava/util/function/Consumer;)V+46 java.base@22.0.1 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(Ljava/util/List;)V+6 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+116 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00007e0000136220.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00007e0000136000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 -j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00007e0000133bc0.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService$$Lambda+0x00007e0000136d10.accept(Ljava/lang/Object;)V+4 -j java.util.ArrayList.forEach(Ljava/util/function/Consumer;)V+46 java.base@22.0.1 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(Ljava/util/List;)V+6 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+116 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00007e0000136220.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00007e0000136000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 -j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x00007e0000133bc0.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(Lorg/junit/platform/engine/support/hierarchical/HierarchicalTestExecutorService$TestTask;)Ljava/util/concurrent/Future;+1 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute()Ljava/util/concurrent/Future;+74 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(Lorg/junit/platform/engine/ExecutionRequest;)V+31 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/engine/TestDescriptor;Lorg/junit/platform/engine/EngineExecutionListener;Lorg/junit/platform/engine/ConfigurationParameters;Lorg/junit/platform/engine/TestEngine;)V+24 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/LauncherDiscoveryResult;Lorg/junit/platform/engine/EngineExecutionListener;)V+115 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;Lorg/junit/platform/engine/EngineExecutionListener;Lorg/junit/platform/launcher/TestExecutionListener;)V+55 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(Lorg/junit/platform/launcher/core/InternalTestPlan;Lorg/junit/platform/launcher/TestExecutionListener;)V+6 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator$$Lambda+0x00007e0000120000.accept(Ljava/lang/Object;)V+12 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(Lorg/junit/platform/engine/ConfigurationParameters;Lorg/junit/platform/launcher/core/ListenerRegistry;Ljava/util/function/Consumer;)V+51 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;[Lorg/junit/platform/launcher/TestExecutionListener;)V+23 -j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;[Lorg/junit/platform/launcher/TestExecutionListener;)V+6 -j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+34 -j org.junit.platform.launcher.core.DelegatingLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+6 -j org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+13 -j com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs([Ljava/lang/String;Ljava/lang/String;IZ)I+203 -j com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(Z)I+17 -j com.intellij.rt.execution.junit.TestsRepeater.repeat(IZLcom/intellij/rt/execution/junit/TestsRepeater$TestRun;)I+7 -j com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(Lcom/intellij/rt/junit/IdeaTestRunner;[Ljava/lang/String;Ljava/util/ArrayList;Ljava/lang/String;IZ)I+25 -j com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart([Ljava/lang/String;Ljava/lang/String;Ljava/util/ArrayList;Ljava/lang/String;)I+117 -j com.intellij.rt.junit.JUnitStarter.main([Ljava/lang/String;)V+97 -v ~StubRoutines::call_stub 0x0000000112554154 - -siginfo: si_signo: 11 (SIGSEGV), si_code: 2 (SEGV_ACCERR), si_addr: 0x0000000000000001 - -Registers: - x0=0x0000600002f88a70 x1=0x0000000089c748a8 x2=0x0000000000000010 x3=0x0000000000000000 - x4=0x0000000000000003 x5=0x0000000000000a70 x6=0x0000600002f88a70 x7=0x0000000000000eb0 - x8=0x0000000000000000 x9=0x0000000000000000 x10=0x0000767e198f0000 x11=0x0000000000000010 -x12=0x0000600002fb22bc x13=0x00000000001ff800 x14=0x00000000000007fb x15=0x0000000089c748a8 -x16=0x00000000000000a7 x17=0x0000000089e74098 x18=0x0000000000000000 x19=0x0000000000000010 -x20=0x0000000000000002 x21=0x0000600002f88a70 x22=0x00000001018d8141 x23=0x0000000000000001 -x24=0x000000016fd979b8 x25=0x00000000fd81c000 x26=0x0000000121d20c08 x27=0x0000000000000000 -x28=0x000000015580d200 fp=0x000000016fd978a0 lr=0x000000010188da7c sp=0x000000016fd97870 -pc=0x000000010188daec cpsr=0x0000000080001000 - -Register to memory mapping: - -x0 =0x0000600002f88a70 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00 -x1 =0x0000000089c748a8 is an unknown value -x2 =0x0000000000000010 is an unknown value -x3 =0x0 is null -x4 =0x0000000000000003 is an unknown value -x5 =0x0000000000000a70 is an unknown value -x6 =0x0000600002f88a70 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00 -x7 =0x0000000000000eb0 is an unknown value -x8 =0x0 is null -x9 =0x0 is null -x10=0x0000767e198f0000 is an unknown value -x11=0x0000000000000010 is an unknown value -x12=0x0000600002fb22bc points into unknown readable memory: 98 3a 47 8a -x13=0x00000000001ff800 is an unknown value -x14=0x00000000000007fb is an unknown value -x15=0x0000000089c748a8 is an unknown value -x16=0x00000000000000a7 is an unknown value -x17=0x0000000089e74098 is an unknown value -x18=0x0 is null -x19=0x0000000000000010 is an unknown value -x20=0x0000000000000002 is an unknown value -x21=0x0000600002f88a70 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00 -x22=0x00000001018d8141: __rust_no_alloc_shim_is_unstable+0 in /Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/libsomelib.dylib at 0x0000000101888000 -x23=0x0000000000000001 is an unknown value -x24=0x000000016fd979b8 is pointing into the stack for thread: 0x000000015580d200 -x25=0x00000000fd81c000 is an unknown value -x26=0x0000000121d20c08 is pointing into metadata -x27=0x0 is null -x28=0x000000015580d200 is a thread - fp=0x000000016fd978a0 is pointing into the stack for thread: 0x000000015580d200 - lr=0x000000010188da7c: Float64Vec_new_isize+0x44 in /Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/libsomelib.dylib at 0x0000000101888000 - sp=0x000000016fd97870 is pointing into the stack for thread: 0x000000015580d200 - -Top of Stack: (sp=0x000000016fd97870) -0x000000016fd97870: 000000016fd979b8 000000070eb0b500 -0x000000016fd97880: 0000000121d20a54 00000001026dd2b0 -0x000000016fd97890: 000000016fd978e8 000000016fd978d0 -0x000000016fd978a0: 000000016fd978c0 000000011267ecbc -0x000000016fd978b0: 000000016fd97970 2c6380011256d844 -0x000000016fd978c0: 000000016fd97970 00000001125597a8 -0x000000016fd978d0: 000000070e6f01f8 fffffffffffffff2 -0x000000016fd978e0: 0000000000000000 000000070e600220 -0x000000016fd978f0: 0000000000000002 0000000000000000 -0x000000016fd97900: 0000000000000001 0000000000000000 -0x000000016fd97910: 000000010188da38 0000000000000000 -0x000000016fd97920: fffffffffffffff6 0000000121d20a54 -0x000000016fd97930: 0000000000000009 0000000121d20c08 -0x000000016fd97940: 000000070e62aaa0 ffffffffffffffec -0x000000016fd97950: 0000000000000000 0000000121d20a60 -0x000000016fd97960: ffffffffffffffef 000000016fd97970 -0x000000016fd97970: 000000016fd97a10 00000001125597a8 -0x000000016fd97980: 000000070e600220 0000000000000002 -0x000000016fd97990: 0000000000000000 0000000000000001 -0x000000016fd979a0: 0000000000000000 000000010188da38 -0x000000016fd979b0: 0000000000000000 000000070e600110 -0x000000016fd979c0: fffffffffffffff6 0000000121d2629f -0x000000016fd979d0: 0000000000000009 0000000121d26470 -0x000000016fd979e0: 000000070ff2c2c8 ffffffffffffffec -0x000000016fd979f0: 0000000000000000 0000000121d262b0 -0x000000016fd97a00: ffffffffffffffef 000000016fd97a10 -0x000000016fd97a10: 000000016fd97ab0 00000001125597a8 -0x000000016fd97a20: 000000070e6001f8 0000000000000002 -0x000000016fd97a30: 0000000000000000 0000000000000001 -0x000000016fd97a40: 0000000000000000 000000010188da38 -0x000000016fd97a50: 0000000000000000 000000070e600110 -0x000000016fd97a60: fffffffffffffff6 0000000121d22465 - -Instructions: (pc=0x000000010188daec) -0x000000010188d9ec: f6 57 41 a9 f8 5f c4 a8 c0 03 5f d6 00 01 80 52 -0x000000010188d9fc: 01 03 80 52 c7 d9 00 94 20 00 20 d4 16 00 80 d2 -0x000000010188da0c: e0 03 16 aa e1 03 15 aa bd d9 00 94 f5 03 00 aa -0x000000010188da1c: b3 00 00 b4 61 f2 7d d3 e0 03 14 aa 02 01 80 52 -0x000000010188da2c: 3a 03 00 94 e0 03 15 aa 54 db 00 94 f8 5f bc a9 -0x000000010188da3c: f6 57 01 a9 f4 4f 02 a9 fd 7b 03 a9 fd c3 00 91 -0x000000010188da4c: f4 03 01 aa 15 01 80 52 3f 00 00 f1 b7 02 80 9a -0x000000010188da5c: 33 f0 7d d3 56 02 00 f0 d6 06 05 91 e1 04 00 b4 -0x000000010188da6c: df 02 40 39 e0 03 13 aa 01 01 80 52 26 03 00 94 -0x000000010188da7c: 40 06 00 b4 f5 03 00 aa 08 00 80 d2 9f 22 00 f1 -0x000000010188da8c: e3 02 00 54 a9 02 17 cb 3f 01 01 f1 83 02 00 54 -0x000000010188da9c: 09 00 80 d2 88 f2 7d 92 ea 82 00 91 eb 03 08 aa -0x000000010188daac: 4c 01 09 8b 80 05 7f ad 82 0d 40 ad 00 d8 61 4e -0x000000010188dabc: 21 d8 61 4e 42 d8 61 4e 63 d8 61 4e ac 02 09 8b -0x000000010188dacc: 80 05 00 ad 82 0d 01 ad 29 01 01 91 6b 21 00 f1 -0x000000010188dadc: 81 fe ff 54 1f 01 14 eb 00 01 00 54 09 f1 7d d3 -0x000000010188daec: e0 6a 69 fc 00 d8 61 5e a0 6a 29 fc 08 05 00 91 -0x000000010188dafc: 9f 02 08 eb 41 ff ff 54 df 02 40 39 00 03 80 52 -0x000000010188db0c: 01 01 80 52 00 03 00 94 00 01 00 b4 14 54 00 a9 -0x000000010188db1c: 14 08 00 f9 fd 7b 43 a9 f4 4f 42 a9 f6 57 41 a9 -0x000000010188db2c: f8 5f c4 a8 c0 03 5f d6 00 01 80 52 01 03 80 52 -0x000000010188db3c: 78 d9 00 94 20 00 20 d4 00 01 80 52 e1 03 13 aa -0x000000010188db4c: 6f d9 00 94 f6 03 00 aa b4 00 00 b4 e0 03 15 aa -0x000000010188db5c: e1 03 13 aa 02 01 80 52 ec 02 00 94 e0 03 16 aa -0x000000010188db6c: 06 db 00 94 f8 5f bc a9 f6 57 01 a9 f4 4f 02 a9 -0x000000010188db7c: fd 7b 03 a9 fd c3 00 91 f4 03 01 aa 15 01 80 52 -0x000000010188db8c: 3f 00 00 f1 b7 02 80 9a 33 f0 7d d3 56 02 00 f0 -0x000000010188db9c: d6 06 05 91 e1 04 00 b4 df 02 40 39 e0 03 13 aa -0x000000010188dbac: 01 01 80 52 d8 02 00 94 40 06 00 b4 f5 03 00 aa -0x000000010188dbbc: 08 00 80 d2 9f 22 00 f1 e3 02 00 54 a9 02 17 cb -0x000000010188dbcc: 3f 01 01 f1 83 02 00 54 09 00 80 d2 88 f2 7d 92 -0x000000010188dbdc: ea 82 00 91 eb 03 08 aa 4c 01 09 8b 80 05 7f ad - - -Stack slot to memory mapping: - -stack at sp + 0 slots: 0x000000016fd979b8 is pointing into the stack for thread: 0x000000015580d200 -stack at sp + 1 slots: 0x000000070eb0b500 is an oop: jdk.internal.org.objectweb.asm.SymbolTable$Entry -{0x000000070eb0b500} - klass: 'jdk/internal/org/objectweb/asm/SymbolTable$Entry' - - ---- fields (total size 7 words): - - final 'index' 'I' @12 45 (0x0000002d) - - final 'data' 'J' @16 0 (0x0000000000000000) - - final 'tag' 'I' @24 1 (0x00000001) - - 'info' 'I' @28 0 (0x00000000) - - final 'owner' 'Ljava/lang/String;' @32 null (0x00000000) - - final 'name' 'Ljava/lang/String;' @36 null (0x00000000) - - final 'value' 'Ljava/lang/String;' @40 a 'java/util/ArrayList$Itr'{0x000000070fe74df0} (0xe1fce9be) - - final 'hashCode' 'I' @44 881600600 (0x348c2858) - - 'next' 'Ljdk/internal/org/objectweb/asm/SymbolTable$Entry;' @48 null (0x00000000) -stack at sp + 2 slots: 0x0000000121d20a54 is pointing into metadata -stack at sp + 3 slots: 0x00000001026dd2b0: _ZN19TemplateInterpreter13_active_tableE+0 in /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/server/libjvm.dylib at 0x0000000101988000 -stack at sp + 4 slots: 0x000000016fd978e8 is pointing into the stack for thread: 0x000000015580d200 -stack at sp + 5 slots: 0x000000016fd978d0 is pointing into the stack for thread: 0x000000015580d200 -stack at sp + 6 slots: 0x000000016fd978c0 is pointing into the stack for thread: 0x000000015580d200 -stack at sp + 7 slots: 0x000000011267ecbc is at code_begin+60 in -[CodeBlob (0x000000011267ec10)] -Framesize: 4 -Runtime Stub (0x000000011267ec10): nep_invoker_blob --------------------------------------------------------------------------------- -Decoding CodeBlob, name: nep_invoker_blob, at [0x000000011267ec80, 0x000000011267ed50] 208 bytes -[MachCode] - 0x000000011267ec80: fd7b bfa9 | fd03 0091 | bf43 00d1 | 0900 0010 | 89d7 01f9 | e903 0091 | 89d3 01f9 | 9ddb 01f9 - 0x000000011267eca0: e903 7eb2 | 8a53 1191 | 49fd 9f88 | e903 01aa | e103 03aa | e003 02aa | 2001 3fd6 | a900 80d2 - 0x000000011267ecc0: 8957 04b9 | bf3b 03d5 | 8963 1191 | 29fd dfc8 | bf03 09eb | e801 0054 | 8953 44b9 | a901 0035 - 0x000000011267ece0: e903 7db2 | 8a53 1191 | 49fd 9f88 | 8943 5339 | 3f09 0071 | e001 0054 | 9fd3 01f9 | 9fdb 01f9 - 0x000000011267ed00: 9fd7 01f9 | bf03 0091 | fd7b c1a8 | c003 5fd6 | e003 00f9 | e003 1caa | 897d 9cd2 | 893c a0f2 - 0x000000011267ed20: 2900 c0f2 | 2001 3fd6 | e003 40f9 | edff ff17 | e003 00f9 | 0919 95d2 | a944 a0f2 | 2900 c0f2 - 0x000000011267ed40: 2001 3fd6 | e003 40f9 | ecff ff17 | 0000 0000 -[/MachCode] --------------------------------------------------------------------------------- - --------------------------------------------------------------------------------- -Decoding CodeBlob, name: nep_invoker_blob, at [0x000000011267ec80, 0x000000011267ed50] 208 bytes -[MachCode] - 0x000000011267ec80: fd7b bfa9 | fd03 0091 | bf43 00d1 | 0900 0010 | 89d7 01f9 | e903 0091 | 89d3 01f9 | 9ddb 01f9 - 0x000000011267eca0: e903 7eb2 | 8a53 1191 | 49fd 9f88 | e903 01aa | e103 03aa | e003 02aa | 2001 3fd6 | a900 80d2 - 0x000000011267ecc0: 8957 04b9 | bf3b 03d5 | 8963 1191 | 29fd dfc8 | bf03 09eb | e801 0054 | 8953 44b9 | a901 0035 - 0x000000011267ece0: e903 7db2 | 8a53 1191 | 49fd 9f88 | 8943 5339 | 3f09 0071 | e001 0054 | 9fd3 01f9 | 9fdb 01f9 - 0x000000011267ed00: 9fd7 01f9 | bf03 0091 | fd7b c1a8 | c003 5fd6 | e003 00f9 | e003 1caa | 897d 9cd2 | 893c a0f2 - 0x000000011267ed20: 2900 c0f2 | 2001 3fd6 | e003 40f9 | edff ff17 | e003 00f9 | 0919 95d2 | a944 a0f2 | 2900 c0f2 - 0x000000011267ed40: 2001 3fd6 | e003 40f9 | ecff ff17 | 0000 0000 -[/MachCode] --------------------------------------------------------------------------------- - - ---------------- P R O C E S S --------------- - -Threads class SMR info: -_java_thread_list=0x0000600002df8300, length=13, elements={ -0x000000015580d200, 0x00000001570f0000, 0x00000001570ef000, 0x000000015580ea00, -0x000000015580f200, 0x000000015580da00, 0x000000015580e200, 0x0000000155814000, -0x00000001570ef800, 0x0000000126808200, 0x0000000120819e00, 0x0000000155814800, -0x000000015690ca00 -} - -Java Threads: ( => current thread ) -=>0x000000015580d200 JavaThread "main" [_thread_in_native, id=10243, stack(0x000000016fb98000,0x000000016fd9b000) (2060K)] - 0x00000001570f0000 JavaThread "Reference Handler" daemon [_thread_blocked, id=29187, stack(0x0000000170d10000,0x0000000170f13000) (2060K)] - 0x00000001570ef000 JavaThread "Finalizer" daemon [_thread_blocked, id=28675, stack(0x0000000170f1c000,0x000000017111f000) (2060K)] - 0x000000015580ea00 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=24579, stack(0x0000000171128000,0x000000017132b000) (2060K)] - 0x000000015580f200 JavaThread "Service Thread" daemon [_thread_blocked, id=24835, stack(0x0000000171334000,0x0000000171537000) (2060K)] - 0x000000015580da00 JavaThread "Monitor Deflation Thread" daemon [_thread_blocked, id=25091, stack(0x0000000171540000,0x0000000171743000) (2060K)] - 0x000000015580e200 JavaThread "C2 CompilerThread0" daemon [_thread_in_vm, id=27651, stack(0x000000017174c000,0x000000017194f000) (2060K)] - 0x0000000155814000 JavaThread "C1 CompilerThread0" daemon [_thread_in_vm, id=27395, stack(0x0000000171958000,0x0000000171b5b000) (2060K)] - 0x00000001570ef800 JavaThread "Common-Cleaner" daemon [_thread_blocked, id=26883, stack(0x0000000171b64000,0x0000000171d67000) (2060K)] - 0x0000000126808200 JavaThread "JDWP Transport Listener: dt_socket" daemon [_thread_blocked, id=26627, stack(0x0000000171d70000,0x0000000171f73000) (2060K)] - 0x0000000120819e00 JavaThread "JDWP Event Helper Thread" daemon [_thread_blocked, id=25859, stack(0x0000000171f7c000,0x000000017217f000) (2060K)] - 0x0000000155814800 JavaThread "JDWP Command Reader" daemon [_thread_in_native, id=32771, stack(0x0000000172188000,0x000000017238b000) (2060K)] - 0x000000015690ca00 JavaThread "Notification Thread" daemon [_thread_blocked, id=43267, stack(0x0000000172394000,0x0000000172597000) (2060K)] -Total: 13 - -Other Threads: - 0x000000015610a330 VMThread "VM Thread" [id=17923, stack(0x00000001709ec000,0x0000000170bef000) (2060K)] - 0x00000001561073b0 WatcherThread "VM Periodic Task Thread" [id=19971, stack(0x00000001707e0000,0x00000001709e3000) (2060K)] - 0x00000001560064d0 WorkerThread "GC Thread#0" [id=13315, stack(0x000000016fda4000,0x000000016ffa7000) (2060K)] - 0x000000012020f8d0 WorkerThread "GC Thread#1" [id=23815, stack(0x00000001725a0000,0x00000001727a3000) (2060K)] - 0x000000012020fe40 WorkerThread "GC Thread#2" [id=42755, stack(0x00000001727ac000,0x00000001729af000) (2060K)] - 0x000000015562e790 WorkerThread "GC Thread#3" [id=42499, stack(0x00000001729b8000,0x0000000172bbb000) (2060K)] - 0x0000000145620b80 WorkerThread "GC Thread#4" [id=41987, stack(0x0000000172bc4000,0x0000000172dc7000) (2060K)] - 0x0000000120130d50 WorkerThread "GC Thread#5" [id=41475, stack(0x0000000172dd0000,0x0000000172fd3000) (2060K)] - 0x0000000145621760 WorkerThread "GC Thread#6" [id=41219, stack(0x0000000172fdc000,0x00000001731df000) (2060K)] - 0x00000001456220c0 WorkerThread "GC Thread#7" [id=34051, stack(0x00000001731e8000,0x00000001733eb000) (2060K)] - 0x00000001256042b0 ConcurrentGCThread "G1 Main Marker" [id=14595, stack(0x000000016ffb0000,0x00000001701b3000) (2060K)] - 0x0000000145604900 WorkerThread "G1 Conc#0" [id=13827, stack(0x00000001701bc000,0x00000001703bf000) (2060K)] - 0x000000015705f400 ConcurrentGCThread "G1 Refine#0" [id=21507, stack(0x00000001703c8000,0x00000001705cb000) (2060K)] - 0x0000000155704100 ConcurrentGCThread "G1 Service" [id=20995, stack(0x00000001705d4000,0x00000001707d7000) (2060K)] -Total: 14 - -Threads with active compile tasks: -C2 CompilerThread0 7938 1237 4 jdk.internal.org.objectweb.asm.SymbolTable::addConstantUtf8Reference (101 bytes) -C1 CompilerThread0 7938 1248 3 jdk.internal.classfile.impl.StackMapGenerator::processBlock (2767 bytes) -Total: 2 - -VM state: not at safepoint (normal execution) - -VM Mutex/Monitor currently owned by a thread: ([mutex/lock_event]) -[0x00000001027467d8] MethodCompileQueue_lock - owner thread: 0x0000000155814000 -[0x0000000102747198] CodeCache_lock - owner thread: 0x0000000155814000 -[0x0000000102747258] Compile_lock - owner thread: 0x0000000155814000 - -Heap address: 0x0000000700000000, size: 4096 MB, Compressed Oops mode: Zero based, Oop shift amount: 3 - -CDS archive(s) not mapped -Compressed class space mapped at: 0x00007e0000000000-0x00007e0040000000, reserved size: 1073741824 -Narrow klass base: 0x00007e0000000000, Narrow klass shift: 0, Narrow klass range: 0x40000000 - -GC Precious Log: - CardTable entry size: 512 - Card Set container configuration: InlinePtr #cards 4 size 8 Array Of Cards #cards 16 size 48 Howl #buckets 8 coarsen threshold 3686 Howl Bitmap #cards 512 size 80 coarsen threshold 460 Card regions per heap region 1 cards per card region 4096 - CPUs: 8 total, 8 available - Memory: 16384M - Large Page Support: Disabled - NUMA Support: Disabled - Compressed Oops: Enabled (Zero based) - Heap Region Size: 2M - Heap Min Capacity: 8M - Heap Initial Capacity: 256M - Heap Max Capacity: 4G - Pre-touch: Disabled - Parallel Workers: 8 - Concurrent Workers: 2 - Concurrent Refinement Workers: 8 - Periodic GC: Disabled - -Heap: - garbage-first heap total reserved 4194304K, committed 262144K, used 2773K [0x0000000700000000, 0x0000000800000000) - region size 2048K, 3 young (6144K), 2 survivors (4096K) - Metaspace used 15165K, committed 15552K, reserved 1114112K - class space used 1680K, committed 1856K, reserved 1048576K - -Heap Regions: E=young(eden), S=young(survivor), O=old, HS=humongous(starts), HC=humongous(continues), CS=collection set, F=free, TAMS=top-at-mark-start, PB=parsable bottom -| 0|0x0000000700000000, 0x0000000700000000, 0x0000000700200000| 0%| F| |TAMS 0x0000000700000000| PB 0x0000000700000000| Untracked | 0 -| 1|0x0000000700200000, 0x0000000700200000, 0x0000000700400000| 0%| F| |TAMS 0x0000000700200000| PB 0x0000000700200000| Untracked | 0 -| 2|0x0000000700400000, 0x0000000700400000, 0x0000000700600000| 0%| F| |TAMS 0x0000000700400000| PB 0x0000000700400000| Untracked | 0 -| 3|0x0000000700600000, 0x0000000700600000, 0x0000000700800000| 0%| F| |TAMS 0x0000000700600000| PB 0x0000000700600000| Untracked | 0 -| 4|0x0000000700800000, 0x0000000700800000, 0x0000000700a00000| 0%| F| |TAMS 0x0000000700800000| PB 0x0000000700800000| Untracked | 0 -| 5|0x0000000700a00000, 0x0000000700a00000, 0x0000000700c00000| 0%| F| |TAMS 0x0000000700a00000| PB 0x0000000700a00000| Untracked | 0 -| 6|0x0000000700c00000, 0x0000000700c00000, 0x0000000700e00000| 0%| F| |TAMS 0x0000000700c00000| PB 0x0000000700c00000| Untracked | 0 -| 7|0x0000000700e00000, 0x0000000700e00000, 0x0000000701000000| 0%| F| |TAMS 0x0000000700e00000| PB 0x0000000700e00000| Untracked | 0 -| 8|0x0000000701000000, 0x0000000701000000, 0x0000000701200000| 0%| F| |TAMS 0x0000000701000000| PB 0x0000000701000000| Untracked | 0 -| 9|0x0000000701200000, 0x0000000701200000, 0x0000000701400000| 0%| F| |TAMS 0x0000000701200000| PB 0x0000000701200000| Untracked | 0 -| 10|0x0000000701400000, 0x0000000701400000, 0x0000000701600000| 0%| F| |TAMS 0x0000000701400000| PB 0x0000000701400000| Untracked | 0 -| 11|0x0000000701600000, 0x0000000701600000, 0x0000000701800000| 0%| F| |TAMS 0x0000000701600000| PB 0x0000000701600000| Untracked | 0 -| 12|0x0000000701800000, 0x0000000701800000, 0x0000000701a00000| 0%| F| |TAMS 0x0000000701800000| PB 0x0000000701800000| Untracked | 0 -| 13|0x0000000701a00000, 0x0000000701a00000, 0x0000000701c00000| 0%| F| |TAMS 0x0000000701a00000| PB 0x0000000701a00000| Untracked | 0 -| 14|0x0000000701c00000, 0x0000000701c00000, 0x0000000701e00000| 0%| F| |TAMS 0x0000000701c00000| PB 0x0000000701c00000| Untracked | 0 -| 15|0x0000000701e00000, 0x0000000701e00000, 0x0000000702000000| 0%| F| |TAMS 0x0000000701e00000| PB 0x0000000701e00000| Untracked | 0 -| 16|0x0000000702000000, 0x0000000702000000, 0x0000000702200000| 0%| F| |TAMS 0x0000000702000000| PB 0x0000000702000000| Untracked | 0 -| 17|0x0000000702200000, 0x0000000702200000, 0x0000000702400000| 0%| F| |TAMS 0x0000000702200000| PB 0x0000000702200000| Untracked | 0 -| 18|0x0000000702400000, 0x0000000702400000, 0x0000000702600000| 0%| F| |TAMS 0x0000000702400000| PB 0x0000000702400000| Untracked | 0 -| 19|0x0000000702600000, 0x0000000702600000, 0x0000000702800000| 0%| F| |TAMS 0x0000000702600000| PB 0x0000000702600000| Untracked | 0 -| 20|0x0000000702800000, 0x0000000702800000, 0x0000000702a00000| 0%| F| |TAMS 0x0000000702800000| PB 0x0000000702800000| Untracked | 0 -| 21|0x0000000702a00000, 0x0000000702a00000, 0x0000000702c00000| 0%| F| |TAMS 0x0000000702a00000| PB 0x0000000702a00000| Untracked | 0 -| 22|0x0000000702c00000, 0x0000000702c00000, 0x0000000702e00000| 0%| F| |TAMS 0x0000000702c00000| PB 0x0000000702c00000| Untracked | 0 -| 23|0x0000000702e00000, 0x0000000702e00000, 0x0000000703000000| 0%| F| |TAMS 0x0000000702e00000| PB 0x0000000702e00000| Untracked | 0 -| 24|0x0000000703000000, 0x0000000703000000, 0x0000000703200000| 0%| F| |TAMS 0x0000000703000000| PB 0x0000000703000000| Untracked | 0 -| 25|0x0000000703200000, 0x0000000703200000, 0x0000000703400000| 0%| F| |TAMS 0x0000000703200000| PB 0x0000000703200000| Untracked | 0 -| 26|0x0000000703400000, 0x0000000703400000, 0x0000000703600000| 0%| F| |TAMS 0x0000000703400000| PB 0x0000000703400000| Untracked | 0 -| 27|0x0000000703600000, 0x0000000703600000, 0x0000000703800000| 0%| F| |TAMS 0x0000000703600000| PB 0x0000000703600000| Untracked | 0 -| 28|0x0000000703800000, 0x0000000703800000, 0x0000000703a00000| 0%| F| |TAMS 0x0000000703800000| PB 0x0000000703800000| Untracked | 0 -| 29|0x0000000703a00000, 0x0000000703a00000, 0x0000000703c00000| 0%| F| |TAMS 0x0000000703a00000| PB 0x0000000703a00000| Untracked | 0 -| 30|0x0000000703c00000, 0x0000000703c00000, 0x0000000703e00000| 0%| F| |TAMS 0x0000000703c00000| PB 0x0000000703c00000| Untracked | 0 -| 31|0x0000000703e00000, 0x0000000703e00000, 0x0000000704000000| 0%| F| |TAMS 0x0000000703e00000| PB 0x0000000703e00000| Untracked | 0 -| 32|0x0000000704000000, 0x0000000704000000, 0x0000000704200000| 0%| F| |TAMS 0x0000000704000000| PB 0x0000000704000000| Untracked | 0 -| 33|0x0000000704200000, 0x0000000704200000, 0x0000000704400000| 0%| F| |TAMS 0x0000000704200000| PB 0x0000000704200000| Untracked | 0 -| 34|0x0000000704400000, 0x0000000704400000, 0x0000000704600000| 0%| F| |TAMS 0x0000000704400000| PB 0x0000000704400000| Untracked | 0 -| 35|0x0000000704600000, 0x0000000704600000, 0x0000000704800000| 0%| F| |TAMS 0x0000000704600000| PB 0x0000000704600000| Untracked | 0 -| 36|0x0000000704800000, 0x0000000704800000, 0x0000000704a00000| 0%| F| |TAMS 0x0000000704800000| PB 0x0000000704800000| Untracked | 0 -| 37|0x0000000704a00000, 0x0000000704a00000, 0x0000000704c00000| 0%| F| |TAMS 0x0000000704a00000| PB 0x0000000704a00000| Untracked | 0 -| 38|0x0000000704c00000, 0x0000000704c00000, 0x0000000704e00000| 0%| F| |TAMS 0x0000000704c00000| PB 0x0000000704c00000| Untracked | 0 -| 39|0x0000000704e00000, 0x0000000704e00000, 0x0000000705000000| 0%| F| |TAMS 0x0000000704e00000| PB 0x0000000704e00000| Untracked | 0 -| 40|0x0000000705000000, 0x0000000705000000, 0x0000000705200000| 0%| F| |TAMS 0x0000000705000000| PB 0x0000000705000000| Untracked | 0 -| 41|0x0000000705200000, 0x0000000705200000, 0x0000000705400000| 0%| F| |TAMS 0x0000000705200000| PB 0x0000000705200000| Untracked | 0 -| 42|0x0000000705400000, 0x0000000705400000, 0x0000000705600000| 0%| F| |TAMS 0x0000000705400000| PB 0x0000000705400000| Untracked | 0 -| 43|0x0000000705600000, 0x0000000705600000, 0x0000000705800000| 0%| F| |TAMS 0x0000000705600000| PB 0x0000000705600000| Untracked | 0 -| 44|0x0000000705800000, 0x0000000705800000, 0x0000000705a00000| 0%| F| |TAMS 0x0000000705800000| PB 0x0000000705800000| Untracked | 0 -| 45|0x0000000705a00000, 0x0000000705a00000, 0x0000000705c00000| 0%| F| |TAMS 0x0000000705a00000| PB 0x0000000705a00000| Untracked | 0 -| 46|0x0000000705c00000, 0x0000000705c00000, 0x0000000705e00000| 0%| F| |TAMS 0x0000000705c00000| PB 0x0000000705c00000| Untracked | 0 -| 47|0x0000000705e00000, 0x0000000705e00000, 0x0000000706000000| 0%| F| |TAMS 0x0000000705e00000| PB 0x0000000705e00000| Untracked | 0 -| 48|0x0000000706000000, 0x0000000706000000, 0x0000000706200000| 0%| F| |TAMS 0x0000000706000000| PB 0x0000000706000000| Untracked | 0 -| 49|0x0000000706200000, 0x0000000706200000, 0x0000000706400000| 0%| F| |TAMS 0x0000000706200000| PB 0x0000000706200000| Untracked | 0 -| 50|0x0000000706400000, 0x0000000706400000, 0x0000000706600000| 0%| F| |TAMS 0x0000000706400000| PB 0x0000000706400000| Untracked | 0 -| 51|0x0000000706600000, 0x0000000706600000, 0x0000000706800000| 0%| F| |TAMS 0x0000000706600000| PB 0x0000000706600000| Untracked | 0 -| 52|0x0000000706800000, 0x0000000706800000, 0x0000000706a00000| 0%| F| |TAMS 0x0000000706800000| PB 0x0000000706800000| Untracked | 0 -| 53|0x0000000706a00000, 0x0000000706a00000, 0x0000000706c00000| 0%| F| |TAMS 0x0000000706a00000| PB 0x0000000706a00000| Untracked | 0 -| 54|0x0000000706c00000, 0x0000000706c00000, 0x0000000706e00000| 0%| F| |TAMS 0x0000000706c00000| PB 0x0000000706c00000| Untracked | 0 -| 55|0x0000000706e00000, 0x0000000706e00000, 0x0000000707000000| 0%| F| |TAMS 0x0000000706e00000| PB 0x0000000706e00000| Untracked | 0 -| 56|0x0000000707000000, 0x0000000707000000, 0x0000000707200000| 0%| F| |TAMS 0x0000000707000000| PB 0x0000000707000000| Untracked | 0 -| 57|0x0000000707200000, 0x0000000707200000, 0x0000000707400000| 0%| F| |TAMS 0x0000000707200000| PB 0x0000000707200000| Untracked | 0 -| 58|0x0000000707400000, 0x0000000707400000, 0x0000000707600000| 0%| F| |TAMS 0x0000000707400000| PB 0x0000000707400000| Untracked | 0 -| 59|0x0000000707600000, 0x0000000707600000, 0x0000000707800000| 0%| F| |TAMS 0x0000000707600000| PB 0x0000000707600000| Untracked | 0 -| 60|0x0000000707800000, 0x0000000707800000, 0x0000000707a00000| 0%| F| |TAMS 0x0000000707800000| PB 0x0000000707800000| Untracked | 0 -| 61|0x0000000707a00000, 0x0000000707a00000, 0x0000000707c00000| 0%| F| |TAMS 0x0000000707a00000| PB 0x0000000707a00000| Untracked | 0 -| 62|0x0000000707c00000, 0x0000000707c00000, 0x0000000707e00000| 0%| F| |TAMS 0x0000000707c00000| PB 0x0000000707c00000| Untracked | 0 -| 63|0x0000000707e00000, 0x0000000707e00000, 0x0000000708000000| 0%| F| |TAMS 0x0000000707e00000| PB 0x0000000707e00000| Untracked | 0 -| 64|0x0000000708000000, 0x0000000708000000, 0x0000000708200000| 0%| F| |TAMS 0x0000000708000000| PB 0x0000000708000000| Untracked | 0 -| 65|0x0000000708200000, 0x0000000708200000, 0x0000000708400000| 0%| F| |TAMS 0x0000000708200000| PB 0x0000000708200000| Untracked | 0 -| 66|0x0000000708400000, 0x0000000708400000, 0x0000000708600000| 0%| F| |TAMS 0x0000000708400000| PB 0x0000000708400000| Untracked | 0 -| 67|0x0000000708600000, 0x0000000708600000, 0x0000000708800000| 0%| F| |TAMS 0x0000000708600000| PB 0x0000000708600000| Untracked | 0 -| 68|0x0000000708800000, 0x0000000708800000, 0x0000000708a00000| 0%| F| |TAMS 0x0000000708800000| PB 0x0000000708800000| Untracked | 0 -| 69|0x0000000708a00000, 0x0000000708a00000, 0x0000000708c00000| 0%| F| |TAMS 0x0000000708a00000| PB 0x0000000708a00000| Untracked | 0 -| 70|0x0000000708c00000, 0x0000000708c00000, 0x0000000708e00000| 0%| F| |TAMS 0x0000000708c00000| PB 0x0000000708c00000| Untracked | 0 -| 71|0x0000000708e00000, 0x0000000708e00000, 0x0000000709000000| 0%| F| |TAMS 0x0000000708e00000| PB 0x0000000708e00000| Untracked | 0 -| 72|0x0000000709000000, 0x0000000709000000, 0x0000000709200000| 0%| F| |TAMS 0x0000000709000000| PB 0x0000000709000000| Untracked | 0 -| 73|0x0000000709200000, 0x0000000709200000, 0x0000000709400000| 0%| F| |TAMS 0x0000000709200000| PB 0x0000000709200000| Untracked | 0 -| 74|0x0000000709400000, 0x0000000709400000, 0x0000000709600000| 0%| F| |TAMS 0x0000000709400000| PB 0x0000000709400000| Untracked | 0 -| 75|0x0000000709600000, 0x0000000709600000, 0x0000000709800000| 0%| F| |TAMS 0x0000000709600000| PB 0x0000000709600000| Untracked | 0 -| 76|0x0000000709800000, 0x0000000709800000, 0x0000000709a00000| 0%| F| |TAMS 0x0000000709800000| PB 0x0000000709800000| Untracked | 0 -| 77|0x0000000709a00000, 0x0000000709a00000, 0x0000000709c00000| 0%| F| |TAMS 0x0000000709a00000| PB 0x0000000709a00000| Untracked | 0 -| 78|0x0000000709c00000, 0x0000000709c00000, 0x0000000709e00000| 0%| F| |TAMS 0x0000000709c00000| PB 0x0000000709c00000| Untracked | 0 -| 79|0x0000000709e00000, 0x0000000709e00000, 0x000000070a000000| 0%| F| |TAMS 0x0000000709e00000| PB 0x0000000709e00000| Untracked | 0 -| 80|0x000000070a000000, 0x000000070a000000, 0x000000070a200000| 0%| F| |TAMS 0x000000070a000000| PB 0x000000070a000000| Untracked | 0 -| 81|0x000000070a200000, 0x000000070a200000, 0x000000070a400000| 0%| F| |TAMS 0x000000070a200000| PB 0x000000070a200000| Untracked | 0 -| 82|0x000000070a400000, 0x000000070a400000, 0x000000070a600000| 0%| F| |TAMS 0x000000070a400000| PB 0x000000070a400000| Untracked | 0 -| 83|0x000000070a600000, 0x000000070a600000, 0x000000070a800000| 0%| F| |TAMS 0x000000070a600000| PB 0x000000070a600000| Untracked | 0 -| 84|0x000000070a800000, 0x000000070a800000, 0x000000070aa00000| 0%| F| |TAMS 0x000000070a800000| PB 0x000000070a800000| Untracked | 0 -| 85|0x000000070aa00000, 0x000000070aa00000, 0x000000070ac00000| 0%| F| |TAMS 0x000000070aa00000| PB 0x000000070aa00000| Untracked | 0 -| 86|0x000000070ac00000, 0x000000070ac00000, 0x000000070ae00000| 0%| F| |TAMS 0x000000070ac00000| PB 0x000000070ac00000| Untracked | 0 -| 87|0x000000070ae00000, 0x000000070ae00000, 0x000000070b000000| 0%| F| |TAMS 0x000000070ae00000| PB 0x000000070ae00000| Untracked | 0 -| 88|0x000000070b000000, 0x000000070b000000, 0x000000070b200000| 0%| F| |TAMS 0x000000070b000000| PB 0x000000070b000000| Untracked | 0 -| 89|0x000000070b200000, 0x000000070b200000, 0x000000070b400000| 0%| F| |TAMS 0x000000070b200000| PB 0x000000070b200000| Untracked | 0 -| 90|0x000000070b400000, 0x000000070b400000, 0x000000070b600000| 0%| F| |TAMS 0x000000070b400000| PB 0x000000070b400000| Untracked | 0 -| 91|0x000000070b600000, 0x000000070b600000, 0x000000070b800000| 0%| F| |TAMS 0x000000070b600000| PB 0x000000070b600000| Untracked | 0 -| 92|0x000000070b800000, 0x000000070b800000, 0x000000070ba00000| 0%| F| |TAMS 0x000000070b800000| PB 0x000000070b800000| Untracked | 0 -| 93|0x000000070ba00000, 0x000000070ba00000, 0x000000070bc00000| 0%| F| |TAMS 0x000000070ba00000| PB 0x000000070ba00000| Untracked | 0 -| 94|0x000000070bc00000, 0x000000070bc00000, 0x000000070be00000| 0%| F| |TAMS 0x000000070bc00000| PB 0x000000070bc00000| Untracked | 0 -| 95|0x000000070be00000, 0x000000070be00000, 0x000000070c000000| 0%| F| |TAMS 0x000000070be00000| PB 0x000000070be00000| Untracked | 0 -| 96|0x000000070c000000, 0x000000070c000000, 0x000000070c200000| 0%| F| |TAMS 0x000000070c000000| PB 0x000000070c000000| Untracked | 0 -| 97|0x000000070c200000, 0x000000070c200000, 0x000000070c400000| 0%| F| |TAMS 0x000000070c200000| PB 0x000000070c200000| Untracked | 0 -| 98|0x000000070c400000, 0x000000070c400000, 0x000000070c600000| 0%| F| |TAMS 0x000000070c400000| PB 0x000000070c400000| Untracked | 0 -| 99|0x000000070c600000, 0x000000070c600000, 0x000000070c800000| 0%| F| |TAMS 0x000000070c600000| PB 0x000000070c600000| Untracked | 0 -| 100|0x000000070c800000, 0x000000070c800000, 0x000000070ca00000| 0%| F| |TAMS 0x000000070c800000| PB 0x000000070c800000| Untracked | 0 -| 101|0x000000070ca00000, 0x000000070ca00000, 0x000000070cc00000| 0%| F| |TAMS 0x000000070ca00000| PB 0x000000070ca00000| Untracked | 0 -| 102|0x000000070cc00000, 0x000000070cc00000, 0x000000070ce00000| 0%| F| |TAMS 0x000000070cc00000| PB 0x000000070cc00000| Untracked | 0 -| 103|0x000000070ce00000, 0x000000070ce00000, 0x000000070d000000| 0%| F| |TAMS 0x000000070ce00000| PB 0x000000070ce00000| Untracked | 0 -| 104|0x000000070d000000, 0x000000070d000000, 0x000000070d200000| 0%| F| |TAMS 0x000000070d000000| PB 0x000000070d000000| Untracked | 0 -| 105|0x000000070d200000, 0x000000070d200000, 0x000000070d400000| 0%| F| |TAMS 0x000000070d200000| PB 0x000000070d200000| Untracked | 0 -| 106|0x000000070d400000, 0x000000070d400000, 0x000000070d600000| 0%| F| |TAMS 0x000000070d400000| PB 0x000000070d400000| Untracked | 0 -| 107|0x000000070d600000, 0x000000070d600000, 0x000000070d800000| 0%| F| |TAMS 0x000000070d600000| PB 0x000000070d600000| Untracked | 0 -| 108|0x000000070d800000, 0x000000070d800000, 0x000000070da00000| 0%| F| |TAMS 0x000000070d800000| PB 0x000000070d800000| Untracked | 0 -| 109|0x000000070da00000, 0x000000070da00000, 0x000000070dc00000| 0%| F| |TAMS 0x000000070da00000| PB 0x000000070da00000| Untracked | 0 -| 110|0x000000070dc00000, 0x000000070dc00000, 0x000000070de00000| 0%| F| |TAMS 0x000000070dc00000| PB 0x000000070dc00000| Untracked | 0 -| 111|0x000000070de00000, 0x000000070de00000, 0x000000070e000000| 0%| F| |TAMS 0x000000070de00000| PB 0x000000070de00000| Untracked | 0 -| 112|0x000000070e000000, 0x000000070e000000, 0x000000070e200000| 0%| F| |TAMS 0x000000070e000000| PB 0x000000070e000000| Untracked | 0 -| 113|0x000000070e200000, 0x000000070e200000, 0x000000070e400000| 0%| F| |TAMS 0x000000070e200000| PB 0x000000070e200000| Untracked | 0 -| 114|0x000000070e400000, 0x000000070e4b5528, 0x000000070e600000| 35%| S|CS|TAMS 0x000000070e400000| PB 0x000000070e400000| Complete | 0 -| 115|0x000000070e600000, 0x000000070e800000, 0x000000070e800000|100%| S|CS|TAMS 0x000000070e600000| PB 0x000000070e600000| Complete | 0 -| 116|0x000000070e800000, 0x000000070e800000, 0x000000070ea00000| 0%| F| |TAMS 0x000000070e800000| PB 0x000000070e800000| Untracked | 0 -| 117|0x000000070ea00000, 0x000000070ea00000, 0x000000070ec00000| 0%| F| |TAMS 0x000000070ea00000| PB 0x000000070ea00000| Untracked | 0 -| 118|0x000000070ec00000, 0x000000070ec00000, 0x000000070ee00000| 0%| F| |TAMS 0x000000070ec00000| PB 0x000000070ec00000| Untracked | 0 -| 119|0x000000070ee00000, 0x000000070ee00000, 0x000000070f000000| 0%| F| |TAMS 0x000000070ee00000| PB 0x000000070ee00000| Untracked | 0 -| 120|0x000000070f000000, 0x000000070f000000, 0x000000070f200000| 0%| F| |TAMS 0x000000070f000000| PB 0x000000070f000000| Untracked | 0 -| 121|0x000000070f200000, 0x000000070f200000, 0x000000070f400000| 0%| F| |TAMS 0x000000070f200000| PB 0x000000070f200000| Untracked | 0 -| 122|0x000000070f400000, 0x000000070f400000, 0x000000070f600000| 0%| F| |TAMS 0x000000070f400000| PB 0x000000070f400000| Untracked | 0 -| 123|0x000000070f600000, 0x000000070f600000, 0x000000070f800000| 0%| F| |TAMS 0x000000070f600000| PB 0x000000070f600000| Untracked | 0 -| 124|0x000000070f800000, 0x000000070f800000, 0x000000070fa00000| 0%| F| |TAMS 0x000000070f800000| PB 0x000000070f800000| Untracked | 0 -| 125|0x000000070fa00000, 0x000000070fa00000, 0x000000070fc00000| 0%| F| |TAMS 0x000000070fa00000| PB 0x000000070fa00000| Untracked | 0 -| 126|0x000000070fc00000, 0x000000070fc00000, 0x000000070fe00000| 0%| F| |TAMS 0x000000070fc00000| PB 0x000000070fc00000| Untracked | 0 -| 127|0x000000070fe00000, 0x000000070ff64b80, 0x0000000710000000| 69%| E| |TAMS 0x000000070fe00000| PB 0x000000070fe00000| Complete | 0 - -Card table byte_map: [0x000000010101c000,0x000000010181c000] _byte_map_base: 0x00000000fd81c000 - -Marking Bits: (CMBitMap*) 0x0000000125808210 - Bits: [0x000000011a020000, 0x000000011e020000) - -Polling page: 0x0000000100308000 - -Metaspace: - -Usage: - Non-class: 13.17 MB used. - Class: 1.64 MB used. - Both: 14.81 MB used. - -Virtual space: - Non-class space: 64.00 MB reserved, 13.38 MB ( 21%) committed, 1 nodes. - Class space: 1.00 GB reserved, 1.81 MB ( <1%) committed, 1 nodes. - Both: 1.06 GB reserved, 15.19 MB ( 1%) committed. - -Chunk freelists: - Non-Class: 2.35 MB - Class: 14.17 MB - Both: 16.52 MB - -MaxMetaspaceSize: unlimited -CompressedClassSpaceSize: 1.00 GB -Initial GC threshold: 21.00 MB -Current GC threshold: 21.00 MB -CDS: off - - commit_granule_bytes: 65536. - - commit_granule_words: 8192. - - virtual_space_node_default_size: 8388608. - - enlarge_chunks_in_place: 1. - - use_allocation_guard: 0. - - -Internal statistics: - -num_allocs_failed_limit: 0. -num_arena_births: 342. -num_arena_deaths: 0. -num_vsnodes_births: 2. -num_vsnodes_deaths: 0. -num_space_committed: 243. -num_space_uncommitted: 0. -num_chunks_returned_to_freelist: 0. -num_chunks_taken_from_freelist: 561. -num_chunk_merges: 0. -num_chunk_splits: 335. -num_chunks_enlarged: 197. -num_inconsistent_stats: 0. - -CodeHeap 'non-profiled nmethods': size=120032Kb used=383Kb max_used=383Kb free=119649Kb - bounds [0x0000000112ae8000, 0x0000000112d58000, 0x000000011a020000] -CodeHeap 'profiled nmethods': size=120016Kb used=2374Kb max_used=2374Kb free=117641Kb - bounds [0x000000010b020000, 0x000000010b290000, 0x0000000112554000] -CodeHeap 'non-nmethods': size=5712Kb used=1356Kb max_used=1371Kb free=4355Kb - bounds [0x0000000112554000, 0x00000001127c4000, 0x0000000112ae8000] - total_blobs=1719 nmethods=1243 adapters=383 - compilation: enabled - stopped_count=0, restarted_count=0 - full_count=0 - -Compilation events (20 events): -Event: 7.925 Thread 0x0000000155814000 nmethod 1224 0x000000010b250d90 code [0x000000010b250f40, 0x000000010b251208] -Event: 7.925 Thread 0x0000000155814000 1217 3 java.lang.invoke.LambdaForm::create (95 bytes) -Event: 7.925 Thread 0x0000000155814000 nmethod 1217 0x000000010b251310 code [0x000000010b251540, 0x000000010b251b58] -Event: 7.925 Thread 0x0000000155814000 1218 3 java.lang.invoke.LambdaForm::fixResult (31 bytes) -Event: 7.925 Thread 0x0000000155814000 nmethod 1218 0x000000010b251e10 code [0x000000010b251fc0, 0x000000010b252188] -Event: 7.926 Thread 0x0000000155814000 1238 3 jdk.internal.classfile.impl.AbstractElement:: (5 bytes) -Event: 7.926 Thread 0x0000000155814000 nmethod 1238 0x000000010b252290 code [0x000000010b252440, 0x000000010b2525b8] -Event: 7.926 Thread 0x0000000155814000 1239 3 java.lang.constant.ConstantUtils::skipOverFieldSignature (296 bytes) -Event: 7.927 Thread 0x0000000155814000 nmethod 1239 0x000000010b252690 code [0x000000010b252b80, 0x000000010b254838] -Event: 7.927 Thread 0x0000000155814000 1242 3 java.util.Arrays::fill (28 bytes) -Event: 7.927 Thread 0x0000000155814000 nmethod 1242 0x000000010b255310 code [0x000000010b2554c0, 0x000000010b255840] -Event: 7.927 Thread 0x0000000155814000 1240 3 jdk.internal.classfile.impl.DirectCodeBuilder::with (9 bytes) -Event: 7.927 Thread 0x0000000155814000 nmethod 1240 0x000000010b255990 code [0x000000010b255bc0, 0x000000010b256490] -Event: 7.927 Thread 0x0000000155814000 1241 3 jdk.internal.classfile.impl.DirectCodeBuilder::with (30 bytes) -Event: 7.927 Thread 0x0000000155814000 nmethod 1241 0x000000010b256710 code [0x000000010b256940, 0x000000010b2570b0] -Event: 7.928 Thread 0x0000000155814000 1244 3 jdk.internal.classfile.impl.SplitConstantPool::map (145 bytes) -Event: 7.928 Thread 0x0000000155814000 nmethod 1244 0x000000010b257310 code [0x000000010b257600, 0x000000010b258390] -Event: 7.929 Thread 0x0000000155814000 1246 3 java.util.ArrayList::isEmpty (13 bytes) -Event: 7.929 Thread 0x0000000155814000 nmethod 1246 0x000000010b258810 code [0x000000010b2589c0, 0x000000010b258b30] -Event: 7.929 Thread 0x0000000155814000 1248 3 jdk.internal.classfile.impl.StackMapGenerator::processBlock (2767 bytes) - -GC Heap History (2 events): -Event: 7.920 GC heap before -{Heap before GC invocations=0 (full 0): - garbage-first heap total reserved 4194304K, committed 262144K, used 22528K [0x0000000700000000, 0x0000000800000000) - region size 2048K, 12 young (24576K), 0 survivors (0K) - Metaspace used 14790K, committed 15168K, reserved 1114112K - class space used 1618K, committed 1792K, reserved 1048576K -} -Event: 7.922 GC heap after -{Heap after GC invocations=1 (full 0): - garbage-first heap total reserved 4194304K, committed 262144K, used 2773K [0x0000000700000000, 0x0000000800000000) - region size 2048K, 2 young (4096K), 2 survivors (4096K) - Metaspace used 14790K, committed 15168K, reserved 1114112K - class space used 1618K, committed 1792K, reserved 1048576K -} - -Dll operation events (8 events): -Event: 0.006 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjava.dylib -Event: 0.006 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libzip.dylib -Event: 0.079 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libinstrument.dylib -Event: 0.092 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libnio.dylib -Event: 0.096 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libzip.dylib -Event: 0.134 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjimage.dylib -Event: 7.870 Loaded shared library libsomelib.dylib -Event: 7.876 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libsyslookup.dylib - -Deoptimization events (20 events): -Event: 0.272 Thread 0x000000015580d200 DEOPT PACKING pc=0x0000000112b05b60 sp=0x000000016fd97350 -Event: 0.272 Thread 0x000000015580d200 DEOPT UNPACKING pc=0x000000011259701c sp=0x000000016fd97310 mode 2 -Event: 7.839 Thread 0x000000015580d200 Uncommon trap: trap_request=0xffffff45 fr.pc=0x0000000112b2f7a0 relative=0x00000000000000e0 -Event: 7.839 Thread 0x000000015580d200 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000112b2f7a0 method=sun.net.www.ParseUtil.firstEncodeIndex(Ljava/lang/String;)I @ 51 c2 -Event: 7.839 Thread 0x000000015580d200 DEOPT PACKING pc=0x0000000112b2f7a0 sp=0x000000016fd96770 -Event: 7.839 Thread 0x000000015580d200 DEOPT UNPACKING pc=0x000000011259701c sp=0x000000016fd966f0 mode 2 -Event: 7.906 Thread 0x000000015580d200 DEOPT PACKING pc=0x000000010b1f8fc8 sp=0x000000016fd96500 -Event: 7.906 Thread 0x000000015580d200 DEOPT UNPACKING pc=0x0000000112596e7c sp=0x000000016fd96300 mode 3 -Event: 7.923 Thread 0x000000015580d200 Uncommon trap: trap_request=0xffffff45 fr.pc=0x0000000112b2679c relative=0x000000000000025c -Event: 7.923 Thread 0x000000015580d200 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000112b2679c method=java.util.concurrent.ConcurrentHashMap.get(Ljava/lang/Object;)Ljava/lang/Object; @ 76 c2 -Event: 7.923 Thread 0x000000015580d200 DEOPT PACKING pc=0x0000000112b2679c sp=0x000000016fd95840 -Event: 7.923 Thread 0x000000015580d200 DEOPT UNPACKING pc=0x000000011259701c sp=0x000000016fd957c0 mode 2 -Event: 7.923 Thread 0x000000015580d200 Uncommon trap: trap_request=0xffffff45 fr.pc=0x0000000112b33a68 relative=0x00000000000000a8 -Event: 7.923 Thread 0x000000015580d200 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000112b33a68 method=java.lang.ref.ReferenceQueue.headIsNull()Z @ 4 c2 -Event: 7.923 Thread 0x000000015580d200 DEOPT PACKING pc=0x0000000112b33a68 sp=0x000000016fd960a0 -Event: 7.923 Thread 0x000000015580d200 DEOPT UNPACKING pc=0x000000011259701c sp=0x000000016fd95f60 mode 2 -Event: 7.923 Thread 0x000000015580d200 Uncommon trap: trap_request=0xffffff45 fr.pc=0x0000000112b274ec relative=0x000000000000006c -Event: 7.923 Thread 0x000000015580d200 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000112b274ec method=java.lang.ref.ReferenceQueue.headIsNull()Z @ 4 c2 -Event: 7.923 Thread 0x000000015580d200 DEOPT PACKING pc=0x0000000112b274ec sp=0x000000016fd96010 -Event: 7.923 Thread 0x000000015580d200 DEOPT UNPACKING pc=0x000000011259701c sp=0x000000016fd95f40 mode 2 - -Classes loaded (20 events): -Event: 7.929 Loading class jdk/internal/classfile/impl/BufferedCodeBuilder -Event: 7.929 Loading class jdk/internal/classfile/impl/BufferedCodeBuilder done -Event: 7.929 Loading class jdk/internal/classfile/impl/TransformingCodeBuilder -Event: 7.929 Loading class jdk/internal/classfile/impl/TransformingCodeBuilder done -Event: 7.930 Loading class java/lang/classfile/instruction/ThrowInstruction -Event: 7.930 Loading class java/lang/classfile/instruction/ThrowInstruction done -Event: 7.930 Loading class jdk/internal/classfile/impl/AbstractInstruction$UnboundThrowInstruction -Event: 7.930 Loading class jdk/internal/classfile/impl/AbstractInstruction$UnboundThrowInstruction done -Event: 7.930 Loading class java/lang/classfile/instruction/ExceptionCatch -Event: 7.930 Loading class java/lang/classfile/instruction/ExceptionCatch done -Event: 7.930 Loading class jdk/internal/classfile/impl/AbstractPseudoInstruction$ExceptionCatchImpl -Event: 7.930 Loading class jdk/internal/classfile/impl/AbstractPseudoInstruction -Event: 7.930 Loading class jdk/internal/classfile/impl/AbstractPseudoInstruction done -Event: 7.930 Loading class jdk/internal/classfile/impl/AbstractPseudoInstruction$ExceptionCatchImpl done -Event: 7.930 Loading class jdk/internal/classfile/impl/StackMapGenerator$RawExceptionCatch -Event: 7.930 Loading class jdk/internal/classfile/impl/StackMapGenerator$RawExceptionCatch done -Event: 7.931 Loading class jdk/internal/classfile/impl/SplitConstantPool$1 -Event: 7.931 Loading class jdk/internal/classfile/impl/SplitConstantPool$1 done -Event: 7.931 Loading class java/lang/invoke/ConstantBootstraps -Event: 7.931 Loading class java/lang/invoke/ConstantBootstraps done - -Classes unloaded (0 events): -No events - -Classes redefined (0 events): -No events - -Internal exceptions (20 events): -Event: 7.906 Thread 0x000000015580d200 Exception (0x000000070e87d458) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 7.908 Thread 0x000000015580d200 Exception (0x000000070e8a0820) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 7.908 Thread 0x000000015580d200 Exception (0x000000070e8a4e70) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 7.908 Thread 0x000000015580d200 Exception (0x000000070e8a8a28) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 7.908 Thread 0x000000015580d200 Exception (0x000000070e8b0578) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 7.908 Thread 0x000000015580d200 Exception (0x000000070e8b7550) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 7.909 Thread 0x000000015580d200 Exception (0x000000070e8be520) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 7.909 Thread 0x000000015580d200 Exception (0x000000070e8c2fd8) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 7.910 Thread 0x000000015580d200 Exception (0x000000070e8e12b0) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 7.913 Thread 0x000000015580d200 Exception (0x000000070e92fd70) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 841] -Event: 7.914 Thread 0x000000015580d200 Exception (0x000000070e9468c8) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 7.918 Thread 0x000000015580d200 Exception (0x000000070e9b1470) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 7.918 Thread 0x000000015580d200 Exception (0x000000070e9bc208) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 7.918 Thread 0x000000015580d200 Exception (0x000000070e9cdb48) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 7.919 Thread 0x000000015580d200 Exception (0x000000070e9ea1b8) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 7.919 Thread 0x000000015580d200 Exception (0x000000070e9ef688) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 7.923 Thread 0x000000015580d200 Exception (0x000000070fe72398) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 7.928 Thread 0x000000015580d200 Exception (0x000000070feb20c0) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 7.931 Thread 0x000000015580d200 Exception (0x000000070ff0dfe8) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 7.931 Thread 0x000000015580d200 Exception (0x000000070ff22048) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] - -ZGC Phase Switch (0 events): -No events - -VM Operations (20 events): -Event: 0.287 Executing VM operation: get/set locals -Event: 0.287 Executing VM operation: get/set locals done -Event: 0.288 Executing VM operation: get/set locals -Event: 0.288 Executing VM operation: get/set locals done -Event: 5.227 Executing VM operation: get/set locals -Event: 5.227 Executing VM operation: get/set locals done -Event: 5.227 Executing VM operation: get/set locals -Event: 5.227 Executing VM operation: get/set locals done -Event: 5.229 Executing VM operation: get/set locals -Event: 5.229 Executing VM operation: get/set locals done -Event: 7.826 Executing VM operation: ChangeBreakpoints -Event: 7.827 Executing VM operation: ChangeBreakpoints done -Event: 7.827 Executing VM operation: ChangeBreakpoints -Event: 7.827 Executing VM operation: ChangeBreakpoints done -Event: 7.828 Executing VM operation: ChangeBreakpoints -Event: 7.828 Executing VM operation: ChangeBreakpoints done -Event: 7.867 Executing VM operation: ChangeBreakpoints -Event: 7.867 Executing VM operation: ChangeBreakpoints done -Event: 7.920 Executing VM operation: G1CollectForAllocation (G1 Evacuation Pause) -Event: 7.922 Executing VM operation: G1CollectForAllocation (G1 Evacuation Pause) done - -Events (20 events): -Event: 0.027 Thread 0x000000015580ea00 Thread added: 0x000000015580ea00 -Event: 0.027 Protecting memory [0x0000000171128000,0x0000000171134000] with protection modes 0 -Event: 0.027 Thread 0x000000015580f200 Thread added: 0x000000015580f200 -Event: 0.027 Protecting memory [0x0000000171334000,0x0000000171340000] with protection modes 0 -Event: 0.027 Thread 0x000000015580da00 Thread added: 0x000000015580da00 -Event: 0.027 Protecting memory [0x0000000171540000,0x000000017154c000] with protection modes 0 -Event: 0.027 Thread 0x000000015580e200 Thread added: 0x000000015580e200 -Event: 0.027 Protecting memory [0x000000017174c000,0x0000000171758000] with protection modes 0 -Event: 0.027 Thread 0x0000000155814000 Thread added: 0x0000000155814000 -Event: 0.027 Protecting memory [0x0000000171958000,0x0000000171964000] with protection modes 0 -Event: 0.049 Thread 0x00000001570ef800 Thread added: 0x00000001570ef800 -Event: 0.050 Protecting memory [0x0000000171b64000,0x0000000171b70000] with protection modes 0 -Event: 0.065 Thread 0x0000000126808200 Thread added: 0x0000000126808200 -Event: 0.065 Protecting memory [0x0000000171d70000,0x0000000171d7c000] with protection modes 0 -Event: 0.066 Thread 0x0000000120819e00 Thread added: 0x0000000120819e00 -Event: 0.066 Protecting memory [0x0000000171f7c000,0x0000000171f88000] with protection modes 0 -Event: 0.066 Thread 0x0000000155814800 Thread added: 0x0000000155814800 -Event: 0.066 Protecting memory [0x0000000172188000,0x0000000172194000] with protection modes 0 -Event: 0.087 Thread 0x000000015690ca00 Thread added: 0x000000015690ca00 -Event: 0.088 Protecting memory [0x0000000172394000,0x00000001723a0000] with protection modes 0 - - -Dynamic libraries: -0x000000010077c000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjli.dylib -0x00000001a96bb000 /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa -0x0000000192c62000 /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit -0x0000000195cce000 /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData -0x0000000190515000 /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation -0x000000019bfdc000 /usr/lib/libSystem.B.dylib -0x0000000193f9f000 /System/Library/PrivateFrameworks/UIFoundation.framework/Versions/A/UIFoundation -0x000000022ab7f000 /System/Library/PrivateFrameworks/CollectionViewCore.framework/Versions/A/CollectionViewCore -0x00000001a3255000 /System/Library/PrivateFrameworks/RemoteViewServices.framework/Versions/A/RemoteViewServices -0x0000000199e89000 /System/Library/PrivateFrameworks/XCTTargetBootstrap.framework/Versions/A/XCTTargetBootstrap -0x000000019e618000 /System/Library/PrivateFrameworks/InternationalSupport.framework/Versions/A/InternationalSupport -0x000000019e66c000 /System/Library/PrivateFrameworks/UserActivity.framework/Versions/A/UserActivity -0x000000024efd6000 /System/Library/PrivateFrameworks/WindowManagement.framework/Versions/A/WindowManagement -0x0000000190195000 /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration -0x000000019da86000 /usr/lib/libspindump.dylib -0x0000000194154000 /System/Library/Frameworks/UniformTypeIdentifiers.framework/Versions/A/UniformTypeIdentifiers -0x0000000197d00000 /usr/lib/libapp_launch_measurement.dylib -0x0000000197126000 /System/Library/PrivateFrameworks/CoreAnalytics.framework/Versions/A/CoreAnalytics -0x0000000197d07000 /System/Library/PrivateFrameworks/CoreAutoLayout.framework/Versions/A/CoreAutoLayout -0x00000001996a9000 /System/Library/Frameworks/Metal.framework/Versions/A/Metal -0x000000019a631000 /usr/lib/liblangid.dylib -0x0000000199e8f000 /System/Library/PrivateFrameworks/CoreSVG.framework/Versions/A/CoreSVG -0x0000000194b19000 /System/Library/PrivateFrameworks/SkyLight.framework/Versions/A/SkyLight -0x0000000194fba000 /System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics -0x00000001a392f000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate -0x000000019d8e0000 /System/Library/PrivateFrameworks/IconServices.framework/Versions/A/IconServices -0x0000000199687000 /System/Library/Frameworks/IOSurface.framework/Versions/A/IOSurface -0x0000000197155000 /usr/lib/libDiagnosticMessagesClient.dylib -0x000000019bf1e000 /usr/lib/libz.1.dylib -0x00000001a70d4000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices -0x0000000199e71000 /System/Library/PrivateFrameworks/DFRFoundation.framework/Versions/A/DFRFoundation -0x00000001924bc000 /usr/lib/libicucore.A.dylib -0x000000019f676000 /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox -0x000000019e627000 /System/Library/PrivateFrameworks/DataDetectorsCore.framework/Versions/A/DataDetectorsCore -0x00000001b809a000 /System/Library/PrivateFrameworks/TextInput.framework/Versions/A/TextInput -0x0000000194a6a000 /usr/lib/libMobileGestalt.dylib -0x0000000199bad000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox -0x000000019762c000 /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore -0x00000001920e9000 /System/Library/Frameworks/Security.framework/Versions/A/Security -0x00000001a3295000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SpeechRecognition.framework/Versions/A/SpeechRecognition -0x0000000197a2e000 /System/Library/PrivateFrameworks/CoreUI.framework/Versions/A/CoreUI -0x00000001919e2000 /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio -0x0000000197239000 /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration -0x000000019dee2000 /System/Library/PrivateFrameworks/MultitouchSupport.framework/Versions/A/MultitouchSupport -0x0000000194a68000 /usr/lib/libenergytrace.dylib -0x00000001ad793000 /System/Library/PrivateFrameworks/RenderBox.framework/Versions/A/RenderBox -0x0000000192b16000 /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit -0x00000001a366a000 /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices -0x0000000197c8c000 /System/Library/PrivateFrameworks/PerformanceAnalysis.framework/Versions/A/PerformanceAnalysis -0x00000001e603f000 /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL -0x0000000197d51000 /usr/lib/libxml2.2.dylib -0x000000019b360000 /System/Library/PrivateFrameworks/MobileKeyBag.framework/Versions/A/MobileKeyBag -0x000000018ef80000 /usr/lib/libobjc.A.dylib -0x000000018f274000 /usr/lib/libc++.1.dylib -0x00000001a35e7000 /System/Library/Frameworks/Accessibility.framework/Versions/A/Accessibility -0x000000019569a000 /System/Library/Frameworks/ColorSync.framework/Versions/A/ColorSync -0x000000018f3c0000 /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation -0x000000019a1ec000 /System/Library/Frameworks/CoreImage.framework/Versions/A/CoreImage -0x00000001917ed000 /System/Library/Frameworks/CoreText.framework/Versions/A/CoreText -0x00000001ea89e000 /System/Library/Frameworks/CoreTransferable.framework/Versions/A/CoreTransferable -0x00000001ead63000 /System/Library/Frameworks/DeveloperToolsSupport.framework/Versions/A/DeveloperToolsSupport -0x0000000199eca000 /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO -0x0000000224d1f000 /System/Library/Frameworks/Symbols.framework/Versions/A/Symbols -0x000000019bfe2000 /System/Library/PrivateFrameworks/SoftLinking.framework/Versions/A/SoftLinking -0x000000019f028000 /usr/lib/swift/libswiftCore.dylib -0x00000001b4d27000 /usr/lib/swift/libswiftCoreFoundation.dylib -0x00000001b2790000 /usr/lib/swift/libswiftCoreGraphics.dylib -0x00000001b4d71000 /usr/lib/swift/libswiftCoreImage.dylib -0x00000001b2797000 /usr/lib/swift/libswiftDarwin.dylib -0x00000001a4cda000 /usr/lib/swift/libswiftDispatch.dylib -0x00000001b4d72000 /usr/lib/swift/libswiftIOKit.dylib -0x00000001c07cc000 /usr/lib/swift/libswiftMetal.dylib -0x00000001cde91000 /usr/lib/swift/libswiftOSLog.dylib -0x00000001a754f000 /usr/lib/swift/libswiftObjectiveC.dylib -0x00000001c4f00000 /usr/lib/swift/libswiftQuartzCore.dylib -0x00000001c9005000 /usr/lib/swift/libswiftUniformTypeIdentifiers.dylib -0x00000001b4d39000 /usr/lib/swift/libswiftXPC.dylib -0x000000025747d000 /usr/lib/swift/libswift_Concurrency.dylib -0x00000001a7553000 /usr/lib/swift/libswiftos.dylib -0x00000001b7ffe000 /usr/lib/swift/libswiftsimd.dylib -0x000000019c191000 /usr/lib/libcompression.dylib -0x000000019e572000 /System/Library/PrivateFrameworks/TextureIO.framework/Versions/A/TextureIO -0x000000019d58c000 /usr/lib/libate.dylib -0x000000019bfd6000 /usr/lib/system/libcache.dylib -0x000000019bf90000 /usr/lib/system/libcommonCrypto.dylib -0x000000019bfbc000 /usr/lib/system/libcompiler_rt.dylib -0x000000019bfb2000 /usr/lib/system/libcopyfile.dylib -0x000000018f0c4000 /usr/lib/system/libcorecrypto.dylib -0x000000018f1aa000 /usr/lib/system/libdispatch.dylib -0x000000018f365000 /usr/lib/system/libdyld.dylib -0x000000019bfcc000 /usr/lib/system/libkeymgr.dylib -0x000000019bf68000 /usr/lib/system/libmacho.dylib -0x000000019b448000 /usr/lib/system/libquarantine.dylib -0x000000019bfc9000 /usr/lib/system/libremovefile.dylib -0x0000000194ae0000 /usr/lib/system/libsystem_asl.dylib -0x000000018f059000 /usr/lib/system/libsystem_blocks.dylib -0x000000018f1f5000 /usr/lib/system/libsystem_c.dylib -0x000000019bfc0000 /usr/lib/system/libsystem_collections.dylib -0x000000019a620000 /usr/lib/system/libsystem_configuration.dylib -0x000000019965c000 /usr/lib/system/libsystem_containermanager.dylib -0x000000019bbff000 /usr/lib/system/libsystem_coreservices.dylib -0x0000000192783000 /usr/lib/system/libsystem_darwin.dylib -0x00000002577ca000 /usr/lib/system/libsystem_darwindirectory.dylib -0x000000019bfcd000 /usr/lib/system/libsystem_dnssd.dylib -0x00000002577ce000 /usr/lib/system/libsystem_eligibility.dylib -0x000000018f1f2000 /usr/lib/system/libsystem_featureflags.dylib -0x000000018f393000 /usr/lib/system/libsystem_info.dylib -0x000000019bf2d000 /usr/lib/system/libsystem_m.dylib -0x000000018f16d000 /usr/lib/system/libsystem_malloc.dylib -0x0000000194a4d000 /usr/lib/system/libsystem_networkextension.dylib -0x0000000192bf9000 /usr/lib/system/libsystem_notify.dylib -0x000000019a625000 /usr/lib/system/libsystem_sandbox.dylib -0x00000002577d2000 /usr/lib/system/libsystem_sanitizers.dylib -0x000000019bfc5000 /usr/lib/system/libsystem_secinit.dylib -0x000000018f31d000 /usr/lib/system/libsystem_kernel.dylib -0x000000018f38b000 /usr/lib/system/libsystem_platform.dylib -0x000000018f358000 /usr/lib/system/libsystem_pthread.dylib -0x00000001964d0000 /usr/lib/system/libsystem_symptoms.dylib -0x000000018f0a9000 /usr/lib/system/libsystem_trace.dylib -0x000000019bf9e000 /usr/lib/system/libunwind.dylib -0x000000018f05e000 /usr/lib/system/libxpc.dylib -0x000000018f301000 /usr/lib/libc++abi.dylib -0x000000019bfaa000 /usr/lib/liboah.dylib -0x000000019d438000 /usr/lib/liblzma.5.dylib -0x000000019bfde000 /usr/lib/libfakelink.dylib -0x0000000194679000 /System/Library/Frameworks/CFNetwork.framework/Versions/A/CFNetwork -0x000000019c032000 /usr/lib/libarchive.2.dylib -0x00000001a1568000 /System/Library/Frameworks/Combine.framework/Versions/A/Combine -0x000000022ab93000 /System/Library/PrivateFrameworks/CollectionsInternal.framework/Versions/A/CollectionsInternal -0x0000000241543000 /System/Library/PrivateFrameworks/ReflectionInternal.framework/Versions/A/ReflectionInternal -0x0000000241ad5000 /System/Library/PrivateFrameworks/RuntimeInternal.framework/Versions/A/RuntimeInternal -0x00000002575d1000 /usr/lib/swift/libswift_StringProcessing.dylib -0x0000000192a94000 /System/Library/PrivateFrameworks/CoreServicesInternal.framework/Versions/A/CoreServicesInternal -0x000000019b46f000 /usr/lib/libbsm.0.dylib -0x000000019bf70000 /usr/lib/system/libkxld.dylib -0x0000000197cc8000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/FSEvents.framework/Versions/A/FSEvents -0x000000019278e000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore -0x000000019719e000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata -0x000000019bc05000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices -0x000000019c0bb000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit -0x0000000196451000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE -0x000000018f899000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices -0x000000019d3e1000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/DictionaryServices.framework/Versions/A/DictionaryServices -0x0000000197cd5000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SharedFileList.framework/Versions/A/SharedFileList -0x000000019c15b000 /usr/lib/libapple_nghttp2.dylib -0x00000001960c5000 /usr/lib/libsqlite3.dylib -0x00000001964d9000 /System/Library/Frameworks/Network.framework/Versions/A/Network -0x0000000255e8e000 /usr/lib/libCoreEntitlements.dylib -0x000000023c44d000 /System/Library/PrivateFrameworks/MessageSecurity.framework/Versions/A/MessageSecurity -0x00000001960ab000 /System/Library/PrivateFrameworks/ProtocolBuffer.framework/Versions/A/ProtocolBuffer -0x000000019bb2e000 /System/Library/PrivateFrameworks/AppleFSCompression.framework/Versions/A/AppleFSCompression -0x000000019b457000 /usr/lib/libcoretls.dylib -0x000000019d457000 /usr/lib/libcoretls_cfhelpers.dylib -0x000000019c18b000 /usr/lib/libpam.2.dylib -0x000000019d4c9000 /usr/lib/libxar.1.dylib -0x000000019d8b7000 /usr/lib/libheimdal-asn1.dylib -0x0000000194678000 /usr/lib/libnetwork.dylib -0x000000019bfe3000 /usr/lib/libpcap.A.dylib -0x00000001964c5000 /usr/lib/libdns_services.dylib -0x000000019a62d000 /System/Library/PrivateFrameworks/AppleSystemInfo.framework/Versions/A/AppleSystemInfo -0x000000019b155000 /System/Library/PrivateFrameworks/IOMobileFramebuffer.framework/Versions/A/IOMobileFramebuffer -0x0000000257528000 /usr/lib/swift/libswift_RegexParser.dylib -0x000000019bbf2000 /usr/lib/libbz2.1.0.dylib -0x000000019b44b000 /usr/lib/libCheckFix.dylib -0x0000000194af8000 /System/Library/PrivateFrameworks/TCC.framework/Versions/A/TCC -0x000000019a633000 /System/Library/PrivateFrameworks/CoreNLP.framework/Versions/A/CoreNLP -0x0000000197157000 /System/Library/PrivateFrameworks/MetadataUtilities.framework/Versions/A/MetadataUtilities -0x000000019b481000 /usr/lib/libmecab.dylib -0x0000000190229000 /usr/lib/libCRFSuite.dylib -0x000000019b4dd000 /usr/lib/libgermantok.dylib -0x000000019c132000 /usr/lib/libThaiTokenizer.dylib -0x0000000197242000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.framework/Versions/A/vImage -0x00000001a3641000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/vecLib -0x000000019d510000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvMisc.dylib -0x000000019b030000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvDSP.dylib -0x000000018fca0000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib -0x000000019c266000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib -0x000000019b4e0000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLinearAlgebra.dylib -0x000000019c176000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparseBLAS.dylib -0x000000019c261000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libQuadrature.dylib -0x000000019a75c000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBNNS.dylib -0x000000019012e000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparse.dylib -0x000000023ab9c000 /System/Library/PrivateFrameworks/MIL.framework/Versions/A/MIL -0x000000019c019000 /usr/lib/libiconv.2.dylib -0x000000019bf64000 /usr/lib/libcharset.1.dylib -0x0000000197ca8000 /System/Library/Frameworks/OpenDirectory.framework/Versions/A/Frameworks/CFOpenDirectory.framework/Versions/A/CFOpenDirectory -0x0000000197c98000 /System/Library/Frameworks/OpenDirectory.framework/Versions/A/OpenDirectory -0x000000019d459000 /System/Library/PrivateFrameworks/APFS.framework/Versions/A/APFS -0x000000019b387000 /System/Library/Frameworks/SecurityFoundation.framework/Versions/A/SecurityFoundation -0x000000019d4d8000 /usr/lib/libutil.dylib -0x0000000238cfd000 /System/Library/PrivateFrameworks/InstalledContentLibrary.framework/Versions/A/InstalledContentLibrary -0x0000000192ad5000 /System/Library/PrivateFrameworks/CoreServicesStore.framework/Versions/A/CoreServicesStore -0x0000000228340000 /System/Library/PrivateFrameworks/AppleMobileFileIntegrity.framework/Versions/A/AppleMobileFileIntegrity -0x00000001b4cf5000 /usr/lib/libmis.dylib -0x00000001c53e7000 /System/Library/PrivateFrameworks/MobileSystemServices.framework/Versions/A/MobileSystemServices -0x00000001e3449000 /System/Library/PrivateFrameworks/ConfigProfileHelper.framework/Versions/A/ConfigProfileHelper -0x000000019c134000 /System/Library/PrivateFrameworks/AppleSauce.framework/Versions/A/AppleSauce -0x0000000191173000 /System/Library/PrivateFrameworks/LanguageModeling.framework/Versions/A/LanguageModeling -0x000000019d4dc000 /usr/lib/libxslt.1.dylib -0x000000019c020000 /usr/lib/libcmph.dylib -0x000000019b121000 /System/Library/PrivateFrameworks/CoreEmoji.framework/Versions/A/CoreEmoji -0x000000019a756000 /System/Library/PrivateFrameworks/LinguisticData.framework/Versions/A/LinguisticData -0x000000019003c000 /System/Library/PrivateFrameworks/Lexicon.framework/Versions/A/Lexicon -0x000000019b415000 /System/Library/PrivateFrameworks/BackgroundTaskManagement.framework/Versions/A/BackgroundTaskManagement -0x0000000256078000 /usr/lib/libTLE.dylib -0x000000019dda8000 /System/Library/PrivateFrameworks/AppleJPEG.framework/Versions/A/AppleJPEG -0x000000019d89c000 /usr/lib/libexpat.1.dylib -0x000000019e3d0000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libPng.dylib -0x000000019e3fb000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib -0x000000019e4e6000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libGIF.dylib -0x000000019ddee000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJP2.dylib -0x000000019e48b000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib -0x000000019e482000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libRadiance.dylib -0x0000000199a48000 /System/Library/PrivateFrameworks/FontServices.framework/libFontParser.dylib -0x00000001963ea000 /System/Library/PrivateFrameworks/RunningBoardServices.framework/Versions/A/RunningBoardServices -0x00000001a9f95000 /System/Library/PrivateFrameworks/IOSurfaceAccelerator.framework/Versions/A/IOSurfaceAccelerator -0x000000019dede000 /System/Library/PrivateFrameworks/WatchdogClient.framework/Versions/A/WatchdogClient -0x0000000191359000 /System/Library/Frameworks/CoreDisplay.framework/Versions/A/CoreDisplay -0x00000001998ff000 /System/Library/Frameworks/CoreMedia.framework/Versions/A/CoreMedia -0x000000019969f000 /System/Library/PrivateFrameworks/IOAccelerator.framework/Versions/A/IOAccelerator -0x0000000197e3b000 /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo -0x000000019c189000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/MetalPerformanceShaders -0x000000019df21000 /System/Library/Frameworks/VideoToolbox.framework/Versions/A/VideoToolbox -0x0000000197ed7000 /System/Library/PrivateFrameworks/UserManagement.framework/Versions/A/UserManagement -0x0000000196311000 /System/Library/PrivateFrameworks/BaseBoard.framework/Versions/A/BaseBoard -0x000000019a62b000 /System/Library/PrivateFrameworks/AggregateDictionary.framework/Versions/A/AggregateDictionary -0x000000022817a000 /System/Library/PrivateFrameworks/AppleKeyStore.framework/Versions/A/AppleKeyStore -0x000000019e47d000 /System/Library/PrivateFrameworks/GPUWrangler.framework/Versions/A/GPUWrangler -0x000000019e45d000 /System/Library/PrivateFrameworks/IOPresentment.framework/Versions/A/IOPresentment -0x000000019e485000 /System/Library/PrivateFrameworks/DSExternalDisplay.framework/Versions/A/DSExternalDisplay -0x0000000234d8a000 /System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/32023/Libraries/libllvm-flatbuffers.dylib -0x00000001e6032000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCoreFSCache.dylib -0x00000002319ee000 /System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/32023/Libraries/libGPUCompilerUtils.dylib -0x000000019e4ec000 /System/Library/PrivateFrameworks/CMCaptureCore.framework/Versions/A/CMCaptureCore -0x00000001eae86000 /System/Library/Frameworks/ExtensionFoundation.framework/Versions/A/ExtensionFoundation -0x00000001a5543000 /System/Library/PrivateFrameworks/CoreTime.framework/Versions/A/CoreTime -0x000000019da70000 /System/Library/PrivateFrameworks/AppServerSupport.framework/Versions/A/AppServerSupport -0x00000001a0004000 /System/Library/PrivateFrameworks/perfdata.framework/Versions/A/perfdata -0x000000019147d000 /System/Library/PrivateFrameworks/AudioToolboxCore.framework/Versions/A/AudioToolboxCore -0x00000001998d5000 /System/Library/PrivateFrameworks/caulk.framework/Versions/A/caulk -0x000000019f872000 /usr/lib/libAudioStatistics.dylib -0x00000001b402e000 /System/Library/PrivateFrameworks/SystemPolicy.framework/Versions/A/SystemPolicy -0x000000019fb4b000 /usr/lib/libSMC.dylib -0x00000001a953d000 /System/Library/Frameworks/CoreMIDI.framework/Versions/A/CoreMIDI -0x000000019e397000 /usr/lib/libAudioToolboxUtility.dylib -0x00000001af42f000 /System/Library/PrivateFrameworks/OSAServicesClient.framework/Versions/A/OSAServicesClient -0x00000001a0012000 /usr/lib/libperfcheck.dylib -0x00000001a4ffa000 /System/Library/PrivateFrameworks/BoardServices.framework/Versions/A/BoardServices -0x000000019d784000 /System/Library/PrivateFrameworks/PlugInKit.framework/Versions/A/PlugInKit -0x000000019b379000 /System/Library/PrivateFrameworks/AssertionServices.framework/Versions/A/AssertionServices -0x00000001a864e000 /System/Library/PrivateFrameworks/ASEProcessing.framework/Versions/A/ASEProcessing -0x00000001d1318000 /System/Library/PrivateFrameworks/Symbolication.framework/Versions/A/Symbolication -0x0000000240330000 /System/Library/PrivateFrameworks/PhotosensitivityProcessing.framework/Versions/A/PhotosensitivityProcessing -0x000000019da21000 /System/Library/PrivateFrameworks/GraphVisualizer.framework/Versions/A/GraphVisualizer -0x00000001e6094000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib -0x00000001e6053000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGFXShared.dylib -0x00000001e622c000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib -0x00000001e605c000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLImage.dylib -0x00000001e6050000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCVMSPluginSupport.dylib -0x0000000256030000 /usr/lib/libRosetta.dylib -0x00000001e6039000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCoreVMClient.dylib -0x000000022fbf4000 /System/Library/PrivateFrameworks/FontServices.framework/Versions/A/FontServices -0x000000019da2d000 /System/Library/PrivateFrameworks/OTSVG.framework/Versions/A/OTSVG -0x00000001979dc000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/Resources/libFontRegistry.dylib -0x000000019da7b000 /System/Library/PrivateFrameworks/FontServices.framework/libhvf.dylib -0x000000022fbf5000 /System/Library/PrivateFrameworks/FontServices.framework/libXTFontStaticRegistryData.dylib -0x000000019a572000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSCore.framework/Versions/A/MPSCore -0x000000019ba9c000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSImage.framework/Versions/A/MPSImage -0x000000019b4f5000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSNeuralNetwork.framework/Versions/A/MPSNeuralNetwork -0x000000019b940000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSMatrix.framework/Versions/A/MPSMatrix -0x000000019b74b000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSRayIntersector.framework/Versions/A/MPSRayIntersector -0x000000019b972000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSNDArray.framework/Versions/A/MPSNDArray -0x00000001ec760000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSFunctions.framework/Versions/A/MPSFunctions -0x00000001ec745000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSBenchmarkLoop.framework/Versions/A/MPSBenchmarkLoop -0x000000018fb54000 /System/Library/PrivateFrameworks/MetalTools.framework/Versions/A/MetalTools -0x00000001b91d7000 /System/Library/PrivateFrameworks/IOAccelMemoryInfo.framework/Versions/A/IOAccelMemoryInfo -0x00000001c52e0000 /System/Library/PrivateFrameworks/kperf.framework/Versions/A/kperf -0x00000001b4d1a000 /System/Library/PrivateFrameworks/GPURawCounter.framework/Versions/A/GPURawCounter -0x00000001a5415000 /System/Library/PrivateFrameworks/CoreSymbolication.framework/Versions/A/CoreSymbolication -0x00000001b4cc6000 /System/Library/PrivateFrameworks/MallocStackLogging.framework/Versions/A/MallocStackLogging -0x000000019d626000 /System/Library/PrivateFrameworks/CrashReporterSupport.framework/Versions/A/CrashReporterSupport -0x00000001a53d0000 /System/Library/PrivateFrameworks/DebugSymbols.framework/Versions/A/DebugSymbols -0x00000001c3c47000 /System/Library/PrivateFrameworks/OSAnalytics.framework/Versions/A/OSAnalytics -0x000000024d229000 /System/Library/PrivateFrameworks/VideoToolboxParavirtualizationSupport.framework/Versions/A/VideoToolboxParavirtualizationSupport -0x000000019d850000 /System/Library/PrivateFrameworks/AppleVA.framework/Versions/A/AppleVA -0x000000019f8ba000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS -0x0000000195849000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices -0x000000019e4fa000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/PrintCore -0x000000019fca4000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/QD.framework/Versions/A/QD -0x000000019fc98000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSyncLegacy.framework/Versions/A/ColorSyncLegacy -0x000000019f88a000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis -0x000000019e4b6000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATSUI.framework/Versions/A/ATSUI -0x000000019fc2b000 /usr/lib/libcups.2.dylib -0x00000001a0020000 /System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos -0x00000001a0031000 /System/Library/Frameworks/GSS.framework/Versions/A/GSS -0x000000019f939000 /usr/lib/libresolv.9.dylib -0x000000019da8c000 /System/Library/PrivateFrameworks/Heimdal.framework/Versions/A/Heimdal -0x00000001a74bc000 /System/Library/Frameworks/Kerberos.framework/Versions/A/Libraries/libHeimdalProxy.dylib -0x00000001a008b000 /System/Library/PrivateFrameworks/CommonAuth.framework/Versions/A/CommonAuth -0x00000001e9c6c000 /System/Library/Frameworks/AVFAudio.framework/Versions/A/AVFAudio -0x00000001af47e000 /System/Library/PrivateFrameworks/AXCoreUtilities.framework/Versions/A/AXCoreUtilities -0x000000023a274000 /System/Library/PrivateFrameworks/IsolatedCoreAudioClient.framework/Versions/A/IsolatedCoreAudioClient -0x000000019f7f6000 /System/Library/PrivateFrameworks/AudioSession.framework/Versions/A/AudioSession -0x00000001a1307000 /System/Library/Frameworks/IOBluetooth.framework/Versions/A/IOBluetooth -0x000000019d95b000 /System/Library/PrivateFrameworks/MediaExperience.framework/Versions/A/MediaExperience -0x000000019f635000 /System/Library/PrivateFrameworks/AudioSession.framework/libSessionUtility.dylib -0x000000019fcb0000 /System/Library/PrivateFrameworks/AudioResourceArbitration.framework/Versions/A/AudioResourceArbitration -0x00000001a4388000 /System/Library/PrivateFrameworks/PowerLog.framework/Versions/A/PowerLog -0x00000001a42a6000 /System/Library/Frameworks/CoreBluetooth.framework/Versions/A/CoreBluetooth -0x00000001a74bd000 /System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit -0x000000019b1e2000 /System/Library/PrivateFrameworks/CoreUtils.framework/Versions/A/CoreUtils -0x000000022de3f000 /System/Library/PrivateFrameworks/CoreUtilsExtras.framework/Versions/A/CoreUtilsExtras -0x0000000238b8a000 /System/Library/PrivateFrameworks/IO80211.framework/Versions/A/IO80211 -0x00000001a4f3e000 /System/Library/PrivateFrameworks/FrontBoardServices.framework/Versions/A/FrontBoardServices -0x00000001a6a85000 /System/Library/PrivateFrameworks/BackBoardServices.framework/Versions/A/BackBoardServices -0x000000019d8c2000 /System/Library/PrivateFrameworks/IconFoundation.framework/Versions/A/IconFoundation -0x00000001a3281000 /System/Library/PrivateFrameworks/SpeechRecognitionCore.framework/Versions/A/SpeechRecognitionCore -0x00000001af49d000 /usr/lib/libAccessibility.dylib -0x00000001a397b000 /System/Library/Frameworks/MediaAccessibility.framework/Versions/A/MediaAccessibility -0x00000001d49cc000 /System/Library/Frameworks/OSLog.framework/Versions/A/OSLog -0x00000001b4c54000 /System/Library/PrivateFrameworks/LoggingSupport.framework/Versions/A/LoggingSupport -0x0000000101988000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/server/libjvm.dylib -0x000000010031c000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjimage.dylib -0x000000010037c000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjdwp.dylib -0x00000001003c8000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjava.dylib -0x0000000100348000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libinstrument.dylib -0x0000000100420000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libzip.dylib -0x0000000255d1b000 /usr/lib/i18n/libiconv_std.dylib -0x0000000255d03000 /usr/lib/i18n/libUTF8.dylib -0x0000000255d23000 /usr/lib/i18n/libmapper_none.dylib -0x00000001003f8000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libdt_socket.dylib -0x00000001006a8000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libnio.dylib -0x0000000100688000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libnet.dylib -0x0000000101888000 /Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/libsomelib.dylib -0x0000000100370000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libsyslookup.dylib - - -VM Arguments: -jvm_args: -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:60588,suspend=y,server=n -ea -Didea.test.cyclic.buffer.size=1048576 -javaagent:/Users/cristina/Library/Caches/JetBrains/IdeaIC2024.1/captureAgent/debugger-agent.jar -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 -java_command: com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit5 dev.diplomattest.somelib.Float64VecTest,testFloat64Vec -java_class_path (initial): /Users/cristina/.m2/repository/org/junit/platform/junit-platform-launcher/1.10.3/junit-platform-launcher-1.10.3.jar:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/lib/idea_rt.jar:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/plugins/junit/lib/junit5-rt.jar:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/plugins/junit/lib/junit-rt.jar:/Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/target/test-classes:/Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/target/classes:/Users/cristina/.m2/repository/net/java/dev/jna/jna/5.14.0/jna-5.14.0.jar:/Users/cristina/.m2/repository/org/junit/jupiter/junit-jupiter/5.10.3/junit-jupiter-5.10.3.jar:/Users/cristina/.m2/repository/org/junit/jupiter/junit-jupiter-api/5.10.3/junit-jupiter-api-5.10.3.jar:/Users/cristina/.m2/repository/org/opentest4j/opentest4j/1.3.0/opentest4j-1.3.0.jar:/Users/cristina/.m2/repository/org/junit/platform/junit-platform-commons/1.10.3/junit-platform-commons-1.10.3.jar:/Users/cristina/.m2/repository/org/apiguardian/apiguardian-api/1.1.2/apiguardian-api-1.1.2.jar:/Users/cristina/.m2/repository/org/junit/jupiter/junit-jupiter-params/5.10.3/junit-jupiter-params-5.10.3.jar:/Users/cristina/.m2/repository/org/junit/jupiter/junit-jupiter-engine/5.10.3/junit-jupiter-engine-5.10.3.jar:/Users/cristina/.m2/repository/org/junit/platform/junit-platform-engine/1.10.3/junit-platform-engine-1.10.3.jar:/Users/cristina/.m2/repository/org/openjdk/jmh/jmh-core/1.37/jmh-core-1.37.jar:/Users/cristina/.m2/repository/net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4.jar:/Users/cristina/.m2/repository/org/apache/commons/commons-math3/3.6.1/commons-math3-3.6.1.jar:/Users/cristina/.m2/repository/org/openjdk/jmh/jmh-generator-annprocess/1.37/jmh-generator-annprocess-1.37.jar -Launcher Type: SUN_STANDARD - -[Global flags] - intx CICompilerCount = 4 {product} {ergonomic} - uint ConcGCThreads = 2 {product} {ergonomic} - uint G1ConcRefinementThreads = 8 {product} {ergonomic} - size_t G1HeapRegionSize = 2097152 {product} {ergonomic} - size_t InitialHeapSize = 268435456 {product} {ergonomic} - size_t MarkStackSize = 4194304 {product} {ergonomic} - size_t MaxHeapSize = 4294967296 {product} {ergonomic} - size_t MaxNewSize = 2575302656 {product} {ergonomic} - size_t MinHeapDeltaBytes = 2097152 {product} {ergonomic} - size_t MinHeapSize = 8388608 {product} {ergonomic} - uintx NonNMethodCodeHeapSize = 5839564 {pd product} {ergonomic} - uintx NonProfiledCodeHeapSize = 122909338 {pd product} {ergonomic} - uintx ProfiledCodeHeapSize = 122909338 {pd product} {ergonomic} - uintx ReservedCodeCacheSize = 251658240 {pd product} {ergonomic} - bool SegmentedCodeCache = true {product} {ergonomic} - size_t SoftMaxHeapSize = 4294967296 {manageable} {ergonomic} - bool UseCompressedOops = true {product lp64_product} {ergonomic} - bool UseG1GC = true {product} {ergonomic} - bool UseNUMA = false {product} {ergonomic} - bool UseNUMAInterleaving = false {product} {ergonomic} - -Logging: -Log output configuration: - #0: stdout all=warning uptime,level,tags foldmultilines=false - #1: stderr all=off uptime,level,tags foldmultilines=false - -Environment Variables: -JAVA_HOME=/Users/cristina/Library/Java/JavaVirtualMachines/corretto-19.0.1/Contents/Home/ -PATH=/Users/cristina/bin/jextract-22/bin:/bin:/Users/cristina/.modular/pkg/packages.modular.com_mojo/bin:/Users/cristina/Downloads/dart-sdk/bin:/opt/homebrew/Cellar/llvm/15.0.6/bin:/opt/homebrew/opt/openjdk/bin:/Users/cristina/.elan/bin:/Users/cristina/bin:/Users/cristina/Library/Application Support/Coursier/bin:/Users/cristina/Library/Python/3.8/bin:/Users/cristina/.local/bin:/Users/cristina/.cargo/bin:/Users/cristina/.cargo:/opt/homebrew/bin:/Users/cristina/.fzf/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/X11/bin:/Library/Apple/usr/bin:/usr/local/go/bin:/Library/TeX/texbin:/Users/cristina/.krew/bin -SHELL=/opt/homebrew/bin/fish -LC_CTYPE=en_US.UTF-8 -TMPDIR=/var/folders/x_/9qhndrhs79j640bxvmbkddfw0000gn/T/ - -Active Locale: -LC_ALL=C/en_US.UTF-8/C/C/C/C -LC_COLLATE=C -LC_CTYPE=en_US.UTF-8 -LC_MESSAGES=C -LC_MONETARY=C -LC_NUMERIC=C -LC_TIME=C - -Signal Handlers: - SIGSEGV: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_ONSTACK|SA_RESTART|SA_SIGINFO, unblocked - SIGBUS: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, unblocked - SIGFPE: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, unblocked - SIGPIPE: javaSignalHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked - SIGXFSZ: javaSignalHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked - SIGILL: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, unblocked - SIGUSR2: SR_handler in libjvm.dylib, mask=00100000000000000000000000000000, flags=SA_RESTART|SA_SIGINFO, blocked - SIGHUP: UserHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked - SIGINT: UserHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked - SIGTERM: UserHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked - SIGQUIT: UserHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked - SIGTRAP: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, unblocked - - -Periodic native trim disabled - ---------------- S Y S T E M --------------- - -OS: -uname: Darwin 23.5.0 Darwin Kernel Version 23.5.0: Wed May 1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000 arm64 -OS uptime: 45 days 10:06 hours -rlimit (soft/hard): STACK 8176k/65520k , CORE 0k/infinity , NPROC 2666/4000 , NOFILE 10240/infinity , AS infinity/infinity , CPU infinity/infinity , DATA infinity/infinity , FSIZE infinity/infinity , MEMLOCK infinity/infinity , RSS infinity/infinity -load average: 5.58 4.66 4.56 - -CPU: total 8 (initial active 8) 0x61:0x0:0x1b588bb3:0, fp, asimd, aes, pmull, sha1, sha256, crc32, lse, sha3, sha512 -machdep.cpu.brand_string:Apple M1 Pro -hw.cachelinesize:128 -hw.l1icachesize:131072 -hw.l1dcachesize:65536 -hw.l2cachesize:4194304 - -Memory: 16k page, physical 16777216k(21552k free), swap 3145728k(1371968k free) - -vm_info: OpenJDK 64-Bit Server VM (22.0.1+8) for bsd-aarch64 JRE (22.0.1+8), built on 2024-04-16T00:00:00Z by "admin" with clang Apple LLVM 15.0.0 (clang-1500.1.0.2.5) - -END. diff --git a/feature_tests/java/somelib/hs_err_pid98866.log b/feature_tests/java/somelib/hs_err_pid98866.log deleted file mode 100644 index f832aeed6..000000000 --- a/feature_tests/java/somelib/hs_err_pid98866.log +++ /dev/null @@ -1,1291 +0,0 @@ -# -# A fatal error has been detected by the Java Runtime Environment: -# -# SIGSEGV (0xb) at pc=0x0000000101791aec, pid=98866, tid=8707 -# -# JRE version: OpenJDK Runtime Environment Temurin-22.0.1+8 (22.0.1+8) (build 22.0.1+8) -# Java VM: OpenJDK 64-Bit Server VM Temurin-22.0.1+8 (22.0.1+8, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-aarch64) -# Problematic frame: -# C [libsomelib.dylib+0x5aec] Float64Vec_new_isize+0xb4 -# -# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again -# -# If you would like to submit a bug report, please visit: -# https://github.com/adoptium/adoptium-support/issues -# The crash happened outside the Java Virtual Machine in native code. -# See problematic frame for where to report the bug. -# - ---------------- S U M M A R Y ------------ - -Command Line: -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:60599,suspend=y,server=n -ea -Didea.test.cyclic.buffer.size=1048576 -javaagent:/Users/cristina/Library/Caches/JetBrains/IdeaIC2024.1/captureAgent/debugger-agent.jar -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit5 dev.diplomattest.somelib.Float64VecTest,testFloat64Vec - -Host: "MacBookPro18,3" arm64, 8 cores, 16G, Darwin 23.5.0, macOS 14.5 (23F79) -Time: Wed Aug 14 21:08:10 2024 CEST elapsed time: 18.374079 seconds (0d 0h 0m 18s) - ---------------- T H R E A D --------------- - -Current thread (0x0000000114818200): JavaThread "main" [_thread_in_native, id=8707, stack(0x000000016fc94000,0x000000016fe97000) (2060K)] - -Stack: [0x000000016fc94000,0x000000016fe97000], sp=0x000000016fe93870, free space=2046k -Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) -C [libsomelib.dylib+0x5aec] Float64Vec_new_isize+0xb4 -v ~RuntimeStub::nep_invoker_blob 0x000000014765bdbc -j java.lang.invoke.LambdaForm$MH+0x00007800001d0400.invoke(Ljava/lang/Object;JJJ)J+12 java.base@22.0.1 -j java.lang.invoke.LambdaForm$MH+0x00007800001d3000.invokeExact_MT(Ljava/lang/Object;JJJLjava/lang/Object;)J+23 java.base@22.0.1 -j jdk.internal.foreign.abi.DowncallStub+0x00007800001d1000.invoke(Ljava/lang/foreign/SegmentAllocator;Ljava/lang/foreign/MemorySegment;Ljava/lang/foreign/MemorySegment;)Ljava/lang/foreign/MemorySegment;+69 java.base@22.0.1 -j java.lang.invoke.LambdaForm$DMH+0x00007800001d1400.invokeStaticInit(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+14 java.base@22.0.1 -j java.lang.invoke.LambdaForm$MH+0x00007800001d2400.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+44 java.base@22.0.1 -j java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+19 java.base@22.0.1 -j dev.diplomattest.somelib.ntv.somelib_h.Float64Vec_new_isize(Ljava/lang/foreign/MemorySegment;)Ljava/lang/foreign/MemorySegment;+26 -j dev.diplomattest.somelib.Float64Vec.newIsize([J)Ldev/diplomattest/somelib/Float64Vec;+38 -j dev.diplomattest.somelib.Float64VecTest.testFloat64Vec()V+53 -j java.lang.invoke.LambdaForm$DMH+0x0000780000140c00.invokeVirtual(Ljava/lang/Object;Ljava/lang/Object;)V+10 java.base@22.0.1 -j java.lang.invoke.LambdaForm$MH+0x0000780000148400.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+31 java.base@22.0.1 -j java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+19 java.base@22.0.1 -j jdk.internal.reflect.DirectMethodHandleAccessor.invokeImpl(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+41 java.base@22.0.1 -j jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+23 java.base@22.0.1 -j java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+102 java.base@22.0.1 -j org.junit.platform.commons.util.ReflectionUtils.invokeMethod(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+42 -j org.junit.jupiter.engine.execution.MethodInvocation.proceed()Ljava/lang/Object;+16 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed()Ljava/lang/Object;+8 -j org.junit.jupiter.engine.extension.TimeoutExtension.intercept(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/TimeoutDuration;Lorg/junit/jupiter/engine/extension/TimeoutExtension$TimeoutProvider;)Ljava/lang/Object;+28 -j org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/TimeoutExtension$TimeoutProvider;)Ljava/lang/Object;+31 -j org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)V+9 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda+0x0000780000117998.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)V+5 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall$VoidMethodInterceptorCall;Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)Ljava/lang/Void;+6 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall$$Lambda+0x0000780000117da8.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)Ljava/lang/Object;+9 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+6 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$$Lambda+0x00007800001465f0.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+14 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed()Ljava/lang/Object;+12 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+1 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/engine/execution/InvocationInterceptorChain$InterceptorCall;Ljava/util/List;)Ljava/lang/Object;+24 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InvocationInterceptorChain$InterceptorCall;)Ljava/lang/Object;+31 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;)Ljava/lang/Object;+15 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(Ljava/lang/reflect/Method;Ljava/lang/Object;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;)Ljava/lang/Object;+55 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;)V+28 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda+0x0000780000142aa8.execute()V+12 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)V+21 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;+44 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;+6 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+79 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x0000780000136220.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x0000780000136000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 -j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x0000780000133bc0.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService$$Lambda+0x0000780000136d10.accept(Ljava/lang/Object;)V+4 -j java.util.ArrayList.forEach(Ljava/util/function/Consumer;)V+46 java.base@22.0.1 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(Ljava/util/List;)V+6 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+116 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x0000780000136220.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x0000780000136000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 -j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x0000780000133bc0.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService$$Lambda+0x0000780000136d10.accept(Ljava/lang/Object;)V+4 -j java.util.ArrayList.forEach(Ljava/util/function/Consumer;)V+46 java.base@22.0.1 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(Ljava/util/List;)V+6 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+116 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x0000780000136220.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x0000780000136000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 -j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x0000780000133bc0.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(Lorg/junit/platform/engine/support/hierarchical/HierarchicalTestExecutorService$TestTask;)Ljava/util/concurrent/Future;+1 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute()Ljava/util/concurrent/Future;+74 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(Lorg/junit/platform/engine/ExecutionRequest;)V+31 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/engine/TestDescriptor;Lorg/junit/platform/engine/EngineExecutionListener;Lorg/junit/platform/engine/ConfigurationParameters;Lorg/junit/platform/engine/TestEngine;)V+24 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/LauncherDiscoveryResult;Lorg/junit/platform/engine/EngineExecutionListener;)V+115 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;Lorg/junit/platform/engine/EngineExecutionListener;Lorg/junit/platform/launcher/TestExecutionListener;)V+55 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(Lorg/junit/platform/launcher/core/InternalTestPlan;Lorg/junit/platform/launcher/TestExecutionListener;)V+6 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator$$Lambda+0x0000780000120000.accept(Ljava/lang/Object;)V+12 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(Lorg/junit/platform/engine/ConfigurationParameters;Lorg/junit/platform/launcher/core/ListenerRegistry;Ljava/util/function/Consumer;)V+51 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;[Lorg/junit/platform/launcher/TestExecutionListener;)V+23 -j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;[Lorg/junit/platform/launcher/TestExecutionListener;)V+6 -j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+34 -j org.junit.platform.launcher.core.DelegatingLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+6 -j org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+13 -j com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs([Ljava/lang/String;Ljava/lang/String;IZ)I+203 -j com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(Z)I+17 -j com.intellij.rt.execution.junit.TestsRepeater.repeat(IZLcom/intellij/rt/execution/junit/TestsRepeater$TestRun;)I+7 -j com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(Lcom/intellij/rt/junit/IdeaTestRunner;[Ljava/lang/String;Ljava/util/ArrayList;Ljava/lang/String;IZ)I+25 -j com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart([Ljava/lang/String;Ljava/lang/String;Ljava/util/ArrayList;Ljava/lang/String;)I+117 -j com.intellij.rt.junit.JUnitStarter.main([Ljava/lang/String;)V+97 -v ~StubRoutines::call_stub 0x0000000147534154 -...... -Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) -v ~RuntimeStub::nep_invoker_blob 0x000000014765bd8c -j java.lang.invoke.LambdaForm$MH+0x00007800001d0400.invoke(Ljava/lang/Object;JJJ)J+12 java.base@22.0.1 -j java.lang.invoke.LambdaForm$MH+0x00007800001d3000.invokeExact_MT(Ljava/lang/Object;JJJLjava/lang/Object;)J+23 java.base@22.0.1 -j jdk.internal.foreign.abi.DowncallStub+0x00007800001d1000.invoke(Ljava/lang/foreign/SegmentAllocator;Ljava/lang/foreign/MemorySegment;Ljava/lang/foreign/MemorySegment;)Ljava/lang/foreign/MemorySegment;+69 java.base@22.0.1 -j java.lang.invoke.LambdaForm$DMH+0x00007800001d1400.invokeStaticInit(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+14 java.base@22.0.1 -j java.lang.invoke.LambdaForm$MH+0x00007800001d2400.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+44 java.base@22.0.1 -j java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+19 java.base@22.0.1 -j dev.diplomattest.somelib.ntv.somelib_h.Float64Vec_new_isize(Ljava/lang/foreign/MemorySegment;)Ljava/lang/foreign/MemorySegment;+26 -j dev.diplomattest.somelib.Float64Vec.newIsize([J)Ldev/diplomattest/somelib/Float64Vec;+38 -j dev.diplomattest.somelib.Float64VecTest.testFloat64Vec()V+53 -j java.lang.invoke.LambdaForm$DMH+0x0000780000140c00.invokeVirtual(Ljava/lang/Object;Ljava/lang/Object;)V+10 java.base@22.0.1 -j java.lang.invoke.LambdaForm$MH+0x0000780000148400.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+31 java.base@22.0.1 -j java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+19 java.base@22.0.1 -j jdk.internal.reflect.DirectMethodHandleAccessor.invokeImpl(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+41 java.base@22.0.1 -j jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+23 java.base@22.0.1 -j java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+102 java.base@22.0.1 -j org.junit.platform.commons.util.ReflectionUtils.invokeMethod(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+42 -j org.junit.jupiter.engine.execution.MethodInvocation.proceed()Ljava/lang/Object;+16 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed()Ljava/lang/Object;+8 -j org.junit.jupiter.engine.extension.TimeoutExtension.intercept(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/TimeoutDuration;Lorg/junit/jupiter/engine/extension/TimeoutExtension$TimeoutProvider;)Ljava/lang/Object;+28 -j org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/TimeoutExtension$TimeoutProvider;)Ljava/lang/Object;+31 -j org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)V+9 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda+0x0000780000117998.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)V+5 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall$VoidMethodInterceptorCall;Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)Ljava/lang/Void;+6 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall$$Lambda+0x0000780000117da8.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;)Ljava/lang/Object;+9 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+6 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$$Lambda+0x00007800001465f0.apply(Lorg/junit/jupiter/api/extension/InvocationInterceptor;Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+14 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed()Ljava/lang/Object;+12 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;)Ljava/lang/Object;+1 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/engine/execution/InvocationInterceptorChain$InterceptorCall;Ljava/util/List;)Ljava/lang/Object;+24 -j org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InvocationInterceptorChain$InterceptorCall;)Ljava/lang/Object;+31 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(Lorg/junit/jupiter/api/extension/InvocationInterceptor$Invocation;Lorg/junit/jupiter/api/extension/ReflectiveInvocationContext;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;)Ljava/lang/Object;+15 -j org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(Ljava/lang/reflect/Method;Ljava/lang/Object;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;Lorg/junit/jupiter/engine/execution/InterceptingExecutableInvoker$ReflectiveInterceptorCall;)Ljava/lang/Object;+55 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;)V+28 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda+0x0000780000142aa8.execute()V+12 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)V+21 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;+44 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;+6 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+79 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x0000780000136220.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x0000780000136000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 -j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x0000780000133bc0.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService$$Lambda+0x0000780000136d10.accept(Ljava/lang/Object;)V+4 -j java.util.ArrayList.forEach(Ljava/util/function/Consumer;)V+46 java.base@22.0.1 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(Ljava/util/List;)V+6 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+116 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x0000780000136220.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x0000780000136000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 -j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x0000780000133bc0.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService$$Lambda+0x0000780000136d10.accept(Ljava/lang/Object;)V+4 -j java.util.ArrayList.forEach(Ljava/util/function/Consumer;)V+46 java.base@22.0.1 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(Ljava/util/List;)V+6 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6()V+116 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x0000780000136220.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+15 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x0000780000136000.invoke(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;)V+5 -j org.junit.platform.engine.support.hierarchical.Node.around(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$Invocation;)V+2 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9()V+14 -j org.junit.platform.engine.support.hierarchical.NodeTestTask$$Lambda+0x0000780000133bc0.execute()V+4 -j org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(Lorg/junit/platform/engine/support/hierarchical/ThrowableCollector$Executable;)V+1 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively()V+31 -j org.junit.platform.engine.support.hierarchical.NodeTestTask.execute()V+55 -j org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(Lorg/junit/platform/engine/support/hierarchical/HierarchicalTestExecutorService$TestTask;)Ljava/util/concurrent/Future;+1 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute()Ljava/util/concurrent/Future;+74 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(Lorg/junit/platform/engine/ExecutionRequest;)V+31 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/engine/TestDescriptor;Lorg/junit/platform/engine/EngineExecutionListener;Lorg/junit/platform/engine/ConfigurationParameters;Lorg/junit/platform/engine/TestEngine;)V+24 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/LauncherDiscoveryResult;Lorg/junit/platform/engine/EngineExecutionListener;)V+115 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;Lorg/junit/platform/engine/EngineExecutionListener;Lorg/junit/platform/launcher/TestExecutionListener;)V+55 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(Lorg/junit/platform/launcher/core/InternalTestPlan;Lorg/junit/platform/launcher/TestExecutionListener;)V+6 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator$$Lambda+0x0000780000120000.accept(Ljava/lang/Object;)V+12 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(Lorg/junit/platform/engine/ConfigurationParameters;Lorg/junit/platform/launcher/core/ListenerRegistry;Ljava/util/function/Consumer;)V+51 -j org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;[Lorg/junit/platform/launcher/TestExecutionListener;)V+23 -j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/core/InternalTestPlan;[Lorg/junit/platform/launcher/TestExecutionListener;)V+6 -j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+34 -j org.junit.platform.launcher.core.DelegatingLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+6 -j org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+13 -j com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs([Ljava/lang/String;Ljava/lang/String;IZ)I+203 -j com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(Z)I+17 -j com.intellij.rt.execution.junit.TestsRepeater.repeat(IZLcom/intellij/rt/execution/junit/TestsRepeater$TestRun;)I+7 -j com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(Lcom/intellij/rt/junit/IdeaTestRunner;[Ljava/lang/String;Ljava/util/ArrayList;Ljava/lang/String;IZ)I+25 -j com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart([Ljava/lang/String;Ljava/lang/String;Ljava/util/ArrayList;Ljava/lang/String;)I+117 -j com.intellij.rt.junit.JUnitStarter.main([Ljava/lang/String;)V+97 -v ~StubRoutines::call_stub 0x0000000147534154 - -siginfo: si_signo: 11 (SIGSEGV), si_code: 2 (SEGV_ACCERR), si_addr: 0x0000000000000001 - -Registers: - x0=0x0000600000dac050 x1=0x00000000e0e03806 x2=0x0000000000000010 x3=0x0000000000000000 - x4=0x0000000000000002 x5=0x0000000000000050 x6=0x0000600000dac050 x7=0x0000000000000eb0 - x8=0x0000000000000000 x9=0x0000000000000000 x10=0x00006b3e118f0000 x11=0x0000000000000010 -x12=0x0000600000d82b34 x13=0x00000000001ff800 x14=0x00000000000007fb x15=0x00000000e0e03806 -x16=0x0000000000000005 x17=0x00000000e100319d x18=0x0000000000000000 x19=0x0000000000000010 -x20=0x0000000000000002 x21=0x0000600000dac050 x22=0x00000001017dc141 x23=0x0000000000000001 -x24=0x000000016fe939b8 x25=0x00000000fd720000 x26=0x0000000120d20c08 x27=0x0000000000000000 -x28=0x0000000114818200 fp=0x000000016fe938a0 lr=0x0000000101791a7c sp=0x000000016fe93870 -pc=0x0000000101791aec cpsr=0x0000000080001000 - -Register to memory mapping: - -x0 =0x0000600000dac050 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00 -x1 =0x00000000e0e03806 is an unknown value -x2 =0x0000000000000010 is an unknown value -x3 =0x0 is null -x4 =0x0000000000000002 is an unknown value -x5 =0x0000000000000050 is an unknown value -x6 =0x0000600000dac050 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00 -x7 =0x0000000000000eb0 is an unknown value -x8 =0x0 is null -x9 =0x0 is null -x10=0x00006b3e118f0000 is an unknown value -x11=0x0000000000000010 is an unknown value -x12=0x0000600000d82b34 points into unknown readable memory: f5 29 60 e1 -x13=0x00000000001ff800 is an unknown value -x14=0x00000000000007fb is an unknown value -x15=0x00000000e0e03806 is an unknown value -x16=0x0000000000000005 is an unknown value -x17=0x00000000e100319d is an unknown value -x18=0x0 is null -x19=0x0000000000000010 is an unknown value -x20=0x0000000000000002 is an unknown value -x21=0x0000600000dac050 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00 -x22=0x00000001017dc141: __rust_no_alloc_shim_is_unstable+0 in /Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/libsomelib.dylib at 0x000000010178c000 -x23=0x0000000000000001 is an unknown value -x24=0x000000016fe939b8 is pointing into the stack for thread: 0x0000000114818200 -x25=0x00000000fd720000 is an unknown value -x26=0x0000000120d20c08 is pointing into metadata -x27=0x0 is null -x28=0x0000000114818200 is a thread - fp=0x000000016fe938a0 is pointing into the stack for thread: 0x0000000114818200 - lr=0x0000000101791a7c: Float64Vec_new_isize+0x44 in /Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/libsomelib.dylib at 0x000000010178c000 - sp=0x000000016fe93870 is pointing into the stack for thread: 0x0000000114818200 - -Top of Stack: (sp=0x000000016fe93870) -0x000000016fe93870: 000000016fe939b8 000000070eb2bef0 -0x000000016fe93880: 0000000120d20a54 00000001025e12b0 -0x000000016fe93890: 000000016fe938e8 000000016fe938d0 -0x000000016fe938a0: 000000016fe938c0 000000014765bdbc -0x000000016fe938b0: 000000016fe93970 530d80014754d844 -0x000000016fe938c0: 000000016fe93970 00000001475397a8 -0x000000016fe938d0: 000000070e4231a0 fffffffffffffff2 -0x000000016fe938e0: 0000000000000000 000000070fe03058 -0x000000016fe938f0: 0000000000000002 0000000000000000 -0x000000016fe93900: 0000000000000001 0000000000000000 -0x000000016fe93910: 0000000101791a38 0000000000000000 -0x000000016fe93920: fffffffffffffff6 0000000120d20a54 -0x000000016fe93930: 0000000000000009 0000000120d20c08 -0x000000016fe93940: 000000070fe109c8 ffffffffffffffec -0x000000016fe93950: 0000000000000000 0000000120d20a60 -0x000000016fe93960: ffffffffffffffef 000000016fe93970 -0x000000016fe93970: 000000016fe93a10 00000001475397a8 -0x000000016fe93980: 000000070fe03058 0000000000000002 -0x000000016fe93990: 0000000000000000 0000000000000001 -0x000000016fe939a0: 0000000000000000 0000000101791a38 -0x000000016fe939b0: 0000000000000000 000000070fe10ae0 -0x000000016fe939c0: fffffffffffffff6 0000000120d2629f -0x000000016fe939d0: 0000000000000009 0000000120d26470 -0x000000016fe939e0: 000000070ff3ce20 ffffffffffffffec -0x000000016fe939f0: 0000000000000000 0000000120d262b0 -0x000000016fe93a00: ffffffffffffffef 000000016fe93a10 -0x000000016fe93a10: 000000016fe93ab0 00000001475397a8 -0x000000016fe93a20: 000000070e6e1808 0000000000000002 -0x000000016fe93a30: 0000000000000000 0000000000000001 -0x000000016fe93a40: 0000000000000000 0000000101791a38 -0x000000016fe93a50: 0000000000000000 000000070fe10ae0 -0x000000016fe93a60: fffffffffffffff6 0000000120d22465 - -Instructions: (pc=0x0000000101791aec) -0x00000001017919ec: f6 57 41 a9 f8 5f c4 a8 c0 03 5f d6 00 01 80 52 -0x00000001017919fc: 01 03 80 52 c7 d9 00 94 20 00 20 d4 16 00 80 d2 -0x0000000101791a0c: e0 03 16 aa e1 03 15 aa bd d9 00 94 f5 03 00 aa -0x0000000101791a1c: b3 00 00 b4 61 f2 7d d3 e0 03 14 aa 02 01 80 52 -0x0000000101791a2c: 3a 03 00 94 e0 03 15 aa 54 db 00 94 f8 5f bc a9 -0x0000000101791a3c: f6 57 01 a9 f4 4f 02 a9 fd 7b 03 a9 fd c3 00 91 -0x0000000101791a4c: f4 03 01 aa 15 01 80 52 3f 00 00 f1 b7 02 80 9a -0x0000000101791a5c: 33 f0 7d d3 56 02 00 f0 d6 06 05 91 e1 04 00 b4 -0x0000000101791a6c: df 02 40 39 e0 03 13 aa 01 01 80 52 26 03 00 94 -0x0000000101791a7c: 40 06 00 b4 f5 03 00 aa 08 00 80 d2 9f 22 00 f1 -0x0000000101791a8c: e3 02 00 54 a9 02 17 cb 3f 01 01 f1 83 02 00 54 -0x0000000101791a9c: 09 00 80 d2 88 f2 7d 92 ea 82 00 91 eb 03 08 aa -0x0000000101791aac: 4c 01 09 8b 80 05 7f ad 82 0d 40 ad 00 d8 61 4e -0x0000000101791abc: 21 d8 61 4e 42 d8 61 4e 63 d8 61 4e ac 02 09 8b -0x0000000101791acc: 80 05 00 ad 82 0d 01 ad 29 01 01 91 6b 21 00 f1 -0x0000000101791adc: 81 fe ff 54 1f 01 14 eb 00 01 00 54 09 f1 7d d3 -0x0000000101791aec: e0 6a 69 fc 00 d8 61 5e a0 6a 29 fc 08 05 00 91 -0x0000000101791afc: 9f 02 08 eb 41 ff ff 54 df 02 40 39 00 03 80 52 -0x0000000101791b0c: 01 01 80 52 00 03 00 94 00 01 00 b4 14 54 00 a9 -0x0000000101791b1c: 14 08 00 f9 fd 7b 43 a9 f4 4f 42 a9 f6 57 41 a9 -0x0000000101791b2c: f8 5f c4 a8 c0 03 5f d6 00 01 80 52 01 03 80 52 -0x0000000101791b3c: 78 d9 00 94 20 00 20 d4 00 01 80 52 e1 03 13 aa -0x0000000101791b4c: 6f d9 00 94 f6 03 00 aa b4 00 00 b4 e0 03 15 aa -0x0000000101791b5c: e1 03 13 aa 02 01 80 52 ec 02 00 94 e0 03 16 aa -0x0000000101791b6c: 06 db 00 94 f8 5f bc a9 f6 57 01 a9 f4 4f 02 a9 -0x0000000101791b7c: fd 7b 03 a9 fd c3 00 91 f4 03 01 aa 15 01 80 52 -0x0000000101791b8c: 3f 00 00 f1 b7 02 80 9a 33 f0 7d d3 56 02 00 f0 -0x0000000101791b9c: d6 06 05 91 e1 04 00 b4 df 02 40 39 e0 03 13 aa -0x0000000101791bac: 01 01 80 52 d8 02 00 94 40 06 00 b4 f5 03 00 aa -0x0000000101791bbc: 08 00 80 d2 9f 22 00 f1 e3 02 00 54 a9 02 17 cb -0x0000000101791bcc: 3f 01 01 f1 83 02 00 54 09 00 80 d2 88 f2 7d 92 -0x0000000101791bdc: ea 82 00 91 eb 03 08 aa 4c 01 09 8b 80 05 7f ad - - -Stack slot to memory mapping: - -stack at sp + 0 slots: 0x000000016fe939b8 is pointing into the stack for thread: 0x0000000114818200 -stack at sp + 1 slots: 0x000000070eb2bef0 is an oop: jdk.internal.org.objectweb.asm.SymbolTable$Entry -{0x000000070eb2bef0} - klass: 'jdk/internal/org/objectweb/asm/SymbolTable$Entry' - - ---- fields (total size 7 words): - - final 'index' 'I' @12 45 (0x0000002d) - - final 'data' 'J' @16 0 (0x0000000000000000) - - final 'tag' 'I' @24 1 (0x00000001) - - 'info' 'I' @28 0 (0x00000000) - - final 'owner' 'Ljava/lang/String;' @32 null (0x00000000) - - final 'name' 'Ljava/lang/String;' @36 null (0x00000000) - - final 'value' 'Ljava/lang/String;' @40 a 'java/lang/runtime/SwitchBootstraps$1Element'{0x000000070fe74df0} (0xe1fce9be) - - final 'hashCode' 'I' @44 881600600 (0x348c2858) - - 'next' 'Ljdk/internal/org/objectweb/asm/SymbolTable$Entry;' @48 null (0x00000000) -stack at sp + 2 slots: 0x0000000120d20a54 is pointing into metadata -stack at sp + 3 slots: 0x00000001025e12b0: _ZN19TemplateInterpreter13_active_tableE+0 in /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/server/libjvm.dylib at 0x000000010188c000 -stack at sp + 4 slots: 0x000000016fe938e8 is pointing into the stack for thread: 0x0000000114818200 -stack at sp + 5 slots: 0x000000016fe938d0 is pointing into the stack for thread: 0x0000000114818200 -stack at sp + 6 slots: 0x000000016fe938c0 is pointing into the stack for thread: 0x0000000114818200 -stack at sp + 7 slots: 0x000000014765bdbc is at code_begin+60 in -[CodeBlob (0x000000014765bd10)] -Framesize: 4 -Runtime Stub (0x000000014765bd10): nep_invoker_blob --------------------------------------------------------------------------------- -Decoding CodeBlob, name: nep_invoker_blob, at [0x000000014765bd80, 0x000000014765be50] 208 bytes -[MachCode] - 0x000000014765bd80: fd7b bfa9 | fd03 0091 | bf43 00d1 | 0900 0010 | 89d7 01f9 | e903 0091 | 89d3 01f9 | 9ddb 01f9 - 0x000000014765bda0: e903 7eb2 | 8a53 1191 | 49fd 9f88 | e903 01aa | e103 03aa | e003 02aa | 2001 3fd6 | a900 80d2 - 0x000000014765bdc0: 8957 04b9 | bf3b 03d5 | 8963 1191 | 29fd dfc8 | bf03 09eb | e801 0054 | 8953 44b9 | a901 0035 - 0x000000014765bde0: e903 7db2 | 8a53 1191 | 49fd 9f88 | 8943 5339 | 3f09 0071 | e001 0054 | 9fd3 01f9 | 9fdb 01f9 - 0x000000014765be00: 9fd7 01f9 | bf03 0091 | fd7b c1a8 | c003 5fd6 | e003 00f9 | e003 1caa | 897d 84d2 | a93a a0f2 - 0x000000014765be20: 2900 c0f2 | 2001 3fd6 | e003 40f9 | edff ff17 | e003 00f9 | 0919 9dd2 | a942 a0f2 | 2900 c0f2 - 0x000000014765be40: 2001 3fd6 | e003 40f9 | ecff ff17 | 0000 0000 -[/MachCode] --------------------------------------------------------------------------------- - --------------------------------------------------------------------------------- -Decoding CodeBlob, name: nep_invoker_blob, at [0x000000014765bd80, 0x000000014765be50] 208 bytes -[MachCode] - 0x000000014765bd80: fd7b bfa9 | fd03 0091 | bf43 00d1 | 0900 0010 | 89d7 01f9 | e903 0091 | 89d3 01f9 | 9ddb 01f9 - 0x000000014765bda0: e903 7eb2 | 8a53 1191 | 49fd 9f88 | e903 01aa | e103 03aa | e003 02aa | 2001 3fd6 | a900 80d2 - 0x000000014765bdc0: 8957 04b9 | bf3b 03d5 | 8963 1191 | 29fd dfc8 | bf03 09eb | e801 0054 | 8953 44b9 | a901 0035 - 0x000000014765bde0: e903 7db2 | 8a53 1191 | 49fd 9f88 | 8943 5339 | 3f09 0071 | e001 0054 | 9fd3 01f9 | 9fdb 01f9 - 0x000000014765be00: 9fd7 01f9 | bf03 0091 | fd7b c1a8 | c003 5fd6 | e003 00f9 | e003 1caa | 897d 84d2 | a93a a0f2 - 0x000000014765be20: 2900 c0f2 | 2001 3fd6 | e003 40f9 | edff ff17 | e003 00f9 | 0919 9dd2 | a942 a0f2 | 2900 c0f2 - 0x000000014765be40: 2001 3fd6 | e003 40f9 | ecff ff17 | 0000 0000 -[/MachCode] --------------------------------------------------------------------------------- - - ---------------- P R O C E S S --------------- - -Threads class SMR info: -_java_thread_list=0x0000600000fb94e0, length=13, elements={ -0x0000000114818200, 0x000000011485b000, 0x0000000114815c00, 0x000000013480d800, -0x0000000134811400, 0x000000013480ec00, 0x0000000115008200, 0x0000000114816400, -0x000000013500b200, 0x00000001248e8600, 0x000000013503d200, 0x000000013483be00, -0x0000000135808200 -} - -Java Threads: ( => current thread ) -=>0x0000000114818200 JavaThread "main" [_thread_in_native, id=8707, stack(0x000000016fc94000,0x000000016fe97000) (2060K)] - 0x000000011485b000 JavaThread "Reference Handler" daemon [_thread_blocked, id=24323, stack(0x0000000170e0c000,0x000000017100f000) (2060K)] - 0x0000000114815c00 JavaThread "Finalizer" daemon [_thread_blocked, id=24579, stack(0x0000000171018000,0x000000017121b000) (2060K)] - 0x000000013480d800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=24835, stack(0x0000000171224000,0x0000000171427000) (2060K)] - 0x0000000134811400 JavaThread "Service Thread" daemon [_thread_blocked, id=25091, stack(0x0000000171430000,0x0000000171633000) (2060K)] - 0x000000013480ec00 JavaThread "Monitor Deflation Thread" daemon [_thread_blocked, id=25603, stack(0x000000017163c000,0x000000017183f000) (2060K)] - 0x0000000115008200 JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=28419, stack(0x0000000171848000,0x0000000171a4b000) (2060K)] - 0x0000000114816400 JavaThread "C1 CompilerThread0" daemon [_thread_in_vm, id=28163, stack(0x0000000171a54000,0x0000000171c57000) (2060K)] - 0x000000013500b200 JavaThread "Common-Cleaner" daemon [_thread_blocked, id=27907, stack(0x0000000171c60000,0x0000000171e63000) (2060K)] - 0x00000001248e8600 JavaThread "JDWP Transport Listener: dt_socket" daemon [_thread_blocked, id=27395, stack(0x0000000171e6c000,0x000000017206f000) (2060K)] - 0x000000013503d200 JavaThread "JDWP Event Helper Thread" daemon [_thread_blocked, id=26883, stack(0x0000000172078000,0x000000017227b000) (2060K)] - 0x000000013483be00 JavaThread "JDWP Command Reader" daemon [_thread_in_native, id=32771, stack(0x0000000172284000,0x0000000172487000) (2060K)] - 0x0000000135808200 JavaThread "Notification Thread" daemon [_thread_blocked, id=43011, stack(0x0000000172490000,0x0000000172693000) (2060K)] -Total: 13 - -Other Threads: - 0x0000000134704f50 VMThread "VM Thread" [id=17923, stack(0x0000000170ae8000,0x0000000170ceb000) (2060K)] - 0x0000000114707930 WatcherThread "VM Periodic Task Thread" [id=17411, stack(0x00000001708dc000,0x0000000170adf000) (2060K)] - 0x0000000124606dd0 WorkerThread "GC Thread#0" [id=12291, stack(0x000000016fea0000,0x00000001700a3000) (2060K)] - 0x00000001146157c0 WorkerThread "GC Thread#1" [id=23303, stack(0x000000017269c000,0x000000017289f000) (2060K)] - 0x0000000114615d30 WorkerThread "GC Thread#2" [id=33027, stack(0x00000001728a8000,0x0000000172aab000) (2060K)] - 0x0000000134733c70 WorkerThread "GC Thread#3" [id=33539, stack(0x0000000172ab4000,0x0000000172cb7000) (2060K)] - 0x00000001347341e0 WorkerThread "GC Thread#4" [id=33795, stack(0x0000000172cc0000,0x0000000172ec3000) (2060K)] - 0x0000000134734750 WorkerThread "GC Thread#5" [id=41731, stack(0x0000000172ecc000,0x00000001730cf000) (2060K)] - 0x0000000134735140 WorkerThread "GC Thread#6" [id=41475, stack(0x00000001730d8000,0x00000001732db000) (2060K)] - 0x00000001347354e0 WorkerThread "GC Thread#7" [id=41219, stack(0x00000001732e4000,0x00000001734e7000) (2060K)] - 0x0000000124607570 ConcurrentGCThread "G1 Main Marker" [id=13571, stack(0x00000001700ac000,0x00000001702af000) (2060K)] - 0x0000000114704080 WorkerThread "G1 Conc#0" [id=12803, stack(0x00000001702b8000,0x00000001704bb000) (2060K)] - 0x0000000124858a00 ConcurrentGCThread "G1 Refine#0" [id=21507, stack(0x00000001704c4000,0x00000001706c7000) (2060K)] - 0x00000001147065a0 ConcurrentGCThread "G1 Service" [id=16643, stack(0x00000001706d0000,0x00000001708d3000) (2060K)] -Total: 14 - -Threads with active compile tasks: -C2 CompilerThread0 18380 1238 4 jdk.internal.org.objectweb.asm.SymbolTable::addConstantUtf8Reference (101 bytes) -C1 CompilerThread0 18380 1254 3 jdk.internal.classfile.impl.StackMapGenerator::processBlock (2767 bytes) -Total: 2 - -VM state: not at safepoint (normal execution) - -VM Mutex/Monitor currently owned by a thread: ([mutex/lock_event]) -[0x000000010264a7d8] MethodCompileQueue_lock - owner thread: 0x0000000114816400 -[0x000000010264b198] CodeCache_lock - owner thread: 0x0000000114816400 -[0x000000010264b258] Compile_lock - owner thread: 0x0000000114816400 - -Heap address: 0x0000000700000000, size: 4096 MB, Compressed Oops mode: Zero based, Oop shift amount: 3 - -CDS archive(s) not mapped -Compressed class space mapped at: 0x0000780000000000-0x0000780040000000, reserved size: 1073741824 -Narrow klass base: 0x0000780000000000, Narrow klass shift: 0, Narrow klass range: 0x40000000 - -GC Precious Log: - CardTable entry size: 512 - Card Set container configuration: InlinePtr #cards 4 size 8 Array Of Cards #cards 16 size 48 Howl #buckets 8 coarsen threshold 3686 Howl Bitmap #cards 512 size 80 coarsen threshold 460 Card regions per heap region 1 cards per card region 4096 - CPUs: 8 total, 8 available - Memory: 16384M - Large Page Support: Disabled - NUMA Support: Disabled - Compressed Oops: Enabled (Zero based) - Heap Region Size: 2M - Heap Min Capacity: 8M - Heap Initial Capacity: 256M - Heap Max Capacity: 4G - Pre-touch: Disabled - Parallel Workers: 8 - Concurrent Workers: 2 - Concurrent Refinement Workers: 8 - Periodic GC: Disabled - -Heap: - garbage-first heap total reserved 4194304K, committed 262144K, used 2858K [0x0000000700000000, 0x0000000800000000) - region size 2048K, 3 young (6144K), 2 survivors (4096K) - Metaspace used 15291K, committed 15680K, reserved 1114112K - class space used 1690K, committed 1856K, reserved 1048576K - -Heap Regions: E=young(eden), S=young(survivor), O=old, HS=humongous(starts), HC=humongous(continues), CS=collection set, F=free, TAMS=top-at-mark-start, PB=parsable bottom -| 0|0x0000000700000000, 0x0000000700000000, 0x0000000700200000| 0%| F| |TAMS 0x0000000700000000| PB 0x0000000700000000| Untracked | 0 -| 1|0x0000000700200000, 0x0000000700200000, 0x0000000700400000| 0%| F| |TAMS 0x0000000700200000| PB 0x0000000700200000| Untracked | 0 -| 2|0x0000000700400000, 0x0000000700400000, 0x0000000700600000| 0%| F| |TAMS 0x0000000700400000| PB 0x0000000700400000| Untracked | 0 -| 3|0x0000000700600000, 0x0000000700600000, 0x0000000700800000| 0%| F| |TAMS 0x0000000700600000| PB 0x0000000700600000| Untracked | 0 -| 4|0x0000000700800000, 0x0000000700800000, 0x0000000700a00000| 0%| F| |TAMS 0x0000000700800000| PB 0x0000000700800000| Untracked | 0 -| 5|0x0000000700a00000, 0x0000000700a00000, 0x0000000700c00000| 0%| F| |TAMS 0x0000000700a00000| PB 0x0000000700a00000| Untracked | 0 -| 6|0x0000000700c00000, 0x0000000700c00000, 0x0000000700e00000| 0%| F| |TAMS 0x0000000700c00000| PB 0x0000000700c00000| Untracked | 0 -| 7|0x0000000700e00000, 0x0000000700e00000, 0x0000000701000000| 0%| F| |TAMS 0x0000000700e00000| PB 0x0000000700e00000| Untracked | 0 -| 8|0x0000000701000000, 0x0000000701000000, 0x0000000701200000| 0%| F| |TAMS 0x0000000701000000| PB 0x0000000701000000| Untracked | 0 -| 9|0x0000000701200000, 0x0000000701200000, 0x0000000701400000| 0%| F| |TAMS 0x0000000701200000| PB 0x0000000701200000| Untracked | 0 -| 10|0x0000000701400000, 0x0000000701400000, 0x0000000701600000| 0%| F| |TAMS 0x0000000701400000| PB 0x0000000701400000| Untracked | 0 -| 11|0x0000000701600000, 0x0000000701600000, 0x0000000701800000| 0%| F| |TAMS 0x0000000701600000| PB 0x0000000701600000| Untracked | 0 -| 12|0x0000000701800000, 0x0000000701800000, 0x0000000701a00000| 0%| F| |TAMS 0x0000000701800000| PB 0x0000000701800000| Untracked | 0 -| 13|0x0000000701a00000, 0x0000000701a00000, 0x0000000701c00000| 0%| F| |TAMS 0x0000000701a00000| PB 0x0000000701a00000| Untracked | 0 -| 14|0x0000000701c00000, 0x0000000701c00000, 0x0000000701e00000| 0%| F| |TAMS 0x0000000701c00000| PB 0x0000000701c00000| Untracked | 0 -| 15|0x0000000701e00000, 0x0000000701e00000, 0x0000000702000000| 0%| F| |TAMS 0x0000000701e00000| PB 0x0000000701e00000| Untracked | 0 -| 16|0x0000000702000000, 0x0000000702000000, 0x0000000702200000| 0%| F| |TAMS 0x0000000702000000| PB 0x0000000702000000| Untracked | 0 -| 17|0x0000000702200000, 0x0000000702200000, 0x0000000702400000| 0%| F| |TAMS 0x0000000702200000| PB 0x0000000702200000| Untracked | 0 -| 18|0x0000000702400000, 0x0000000702400000, 0x0000000702600000| 0%| F| |TAMS 0x0000000702400000| PB 0x0000000702400000| Untracked | 0 -| 19|0x0000000702600000, 0x0000000702600000, 0x0000000702800000| 0%| F| |TAMS 0x0000000702600000| PB 0x0000000702600000| Untracked | 0 -| 20|0x0000000702800000, 0x0000000702800000, 0x0000000702a00000| 0%| F| |TAMS 0x0000000702800000| PB 0x0000000702800000| Untracked | 0 -| 21|0x0000000702a00000, 0x0000000702a00000, 0x0000000702c00000| 0%| F| |TAMS 0x0000000702a00000| PB 0x0000000702a00000| Untracked | 0 -| 22|0x0000000702c00000, 0x0000000702c00000, 0x0000000702e00000| 0%| F| |TAMS 0x0000000702c00000| PB 0x0000000702c00000| Untracked | 0 -| 23|0x0000000702e00000, 0x0000000702e00000, 0x0000000703000000| 0%| F| |TAMS 0x0000000702e00000| PB 0x0000000702e00000| Untracked | 0 -| 24|0x0000000703000000, 0x0000000703000000, 0x0000000703200000| 0%| F| |TAMS 0x0000000703000000| PB 0x0000000703000000| Untracked | 0 -| 25|0x0000000703200000, 0x0000000703200000, 0x0000000703400000| 0%| F| |TAMS 0x0000000703200000| PB 0x0000000703200000| Untracked | 0 -| 26|0x0000000703400000, 0x0000000703400000, 0x0000000703600000| 0%| F| |TAMS 0x0000000703400000| PB 0x0000000703400000| Untracked | 0 -| 27|0x0000000703600000, 0x0000000703600000, 0x0000000703800000| 0%| F| |TAMS 0x0000000703600000| PB 0x0000000703600000| Untracked | 0 -| 28|0x0000000703800000, 0x0000000703800000, 0x0000000703a00000| 0%| F| |TAMS 0x0000000703800000| PB 0x0000000703800000| Untracked | 0 -| 29|0x0000000703a00000, 0x0000000703a00000, 0x0000000703c00000| 0%| F| |TAMS 0x0000000703a00000| PB 0x0000000703a00000| Untracked | 0 -| 30|0x0000000703c00000, 0x0000000703c00000, 0x0000000703e00000| 0%| F| |TAMS 0x0000000703c00000| PB 0x0000000703c00000| Untracked | 0 -| 31|0x0000000703e00000, 0x0000000703e00000, 0x0000000704000000| 0%| F| |TAMS 0x0000000703e00000| PB 0x0000000703e00000| Untracked | 0 -| 32|0x0000000704000000, 0x0000000704000000, 0x0000000704200000| 0%| F| |TAMS 0x0000000704000000| PB 0x0000000704000000| Untracked | 0 -| 33|0x0000000704200000, 0x0000000704200000, 0x0000000704400000| 0%| F| |TAMS 0x0000000704200000| PB 0x0000000704200000| Untracked | 0 -| 34|0x0000000704400000, 0x0000000704400000, 0x0000000704600000| 0%| F| |TAMS 0x0000000704400000| PB 0x0000000704400000| Untracked | 0 -| 35|0x0000000704600000, 0x0000000704600000, 0x0000000704800000| 0%| F| |TAMS 0x0000000704600000| PB 0x0000000704600000| Untracked | 0 -| 36|0x0000000704800000, 0x0000000704800000, 0x0000000704a00000| 0%| F| |TAMS 0x0000000704800000| PB 0x0000000704800000| Untracked | 0 -| 37|0x0000000704a00000, 0x0000000704a00000, 0x0000000704c00000| 0%| F| |TAMS 0x0000000704a00000| PB 0x0000000704a00000| Untracked | 0 -| 38|0x0000000704c00000, 0x0000000704c00000, 0x0000000704e00000| 0%| F| |TAMS 0x0000000704c00000| PB 0x0000000704c00000| Untracked | 0 -| 39|0x0000000704e00000, 0x0000000704e00000, 0x0000000705000000| 0%| F| |TAMS 0x0000000704e00000| PB 0x0000000704e00000| Untracked | 0 -| 40|0x0000000705000000, 0x0000000705000000, 0x0000000705200000| 0%| F| |TAMS 0x0000000705000000| PB 0x0000000705000000| Untracked | 0 -| 41|0x0000000705200000, 0x0000000705200000, 0x0000000705400000| 0%| F| |TAMS 0x0000000705200000| PB 0x0000000705200000| Untracked | 0 -| 42|0x0000000705400000, 0x0000000705400000, 0x0000000705600000| 0%| F| |TAMS 0x0000000705400000| PB 0x0000000705400000| Untracked | 0 -| 43|0x0000000705600000, 0x0000000705600000, 0x0000000705800000| 0%| F| |TAMS 0x0000000705600000| PB 0x0000000705600000| Untracked | 0 -| 44|0x0000000705800000, 0x0000000705800000, 0x0000000705a00000| 0%| F| |TAMS 0x0000000705800000| PB 0x0000000705800000| Untracked | 0 -| 45|0x0000000705a00000, 0x0000000705a00000, 0x0000000705c00000| 0%| F| |TAMS 0x0000000705a00000| PB 0x0000000705a00000| Untracked | 0 -| 46|0x0000000705c00000, 0x0000000705c00000, 0x0000000705e00000| 0%| F| |TAMS 0x0000000705c00000| PB 0x0000000705c00000| Untracked | 0 -| 47|0x0000000705e00000, 0x0000000705e00000, 0x0000000706000000| 0%| F| |TAMS 0x0000000705e00000| PB 0x0000000705e00000| Untracked | 0 -| 48|0x0000000706000000, 0x0000000706000000, 0x0000000706200000| 0%| F| |TAMS 0x0000000706000000| PB 0x0000000706000000| Untracked | 0 -| 49|0x0000000706200000, 0x0000000706200000, 0x0000000706400000| 0%| F| |TAMS 0x0000000706200000| PB 0x0000000706200000| Untracked | 0 -| 50|0x0000000706400000, 0x0000000706400000, 0x0000000706600000| 0%| F| |TAMS 0x0000000706400000| PB 0x0000000706400000| Untracked | 0 -| 51|0x0000000706600000, 0x0000000706600000, 0x0000000706800000| 0%| F| |TAMS 0x0000000706600000| PB 0x0000000706600000| Untracked | 0 -| 52|0x0000000706800000, 0x0000000706800000, 0x0000000706a00000| 0%| F| |TAMS 0x0000000706800000| PB 0x0000000706800000| Untracked | 0 -| 53|0x0000000706a00000, 0x0000000706a00000, 0x0000000706c00000| 0%| F| |TAMS 0x0000000706a00000| PB 0x0000000706a00000| Untracked | 0 -| 54|0x0000000706c00000, 0x0000000706c00000, 0x0000000706e00000| 0%| F| |TAMS 0x0000000706c00000| PB 0x0000000706c00000| Untracked | 0 -| 55|0x0000000706e00000, 0x0000000706e00000, 0x0000000707000000| 0%| F| |TAMS 0x0000000706e00000| PB 0x0000000706e00000| Untracked | 0 -| 56|0x0000000707000000, 0x0000000707000000, 0x0000000707200000| 0%| F| |TAMS 0x0000000707000000| PB 0x0000000707000000| Untracked | 0 -| 57|0x0000000707200000, 0x0000000707200000, 0x0000000707400000| 0%| F| |TAMS 0x0000000707200000| PB 0x0000000707200000| Untracked | 0 -| 58|0x0000000707400000, 0x0000000707400000, 0x0000000707600000| 0%| F| |TAMS 0x0000000707400000| PB 0x0000000707400000| Untracked | 0 -| 59|0x0000000707600000, 0x0000000707600000, 0x0000000707800000| 0%| F| |TAMS 0x0000000707600000| PB 0x0000000707600000| Untracked | 0 -| 60|0x0000000707800000, 0x0000000707800000, 0x0000000707a00000| 0%| F| |TAMS 0x0000000707800000| PB 0x0000000707800000| Untracked | 0 -| 61|0x0000000707a00000, 0x0000000707a00000, 0x0000000707c00000| 0%| F| |TAMS 0x0000000707a00000| PB 0x0000000707a00000| Untracked | 0 -| 62|0x0000000707c00000, 0x0000000707c00000, 0x0000000707e00000| 0%| F| |TAMS 0x0000000707c00000| PB 0x0000000707c00000| Untracked | 0 -| 63|0x0000000707e00000, 0x0000000707e00000, 0x0000000708000000| 0%| F| |TAMS 0x0000000707e00000| PB 0x0000000707e00000| Untracked | 0 -| 64|0x0000000708000000, 0x0000000708000000, 0x0000000708200000| 0%| F| |TAMS 0x0000000708000000| PB 0x0000000708000000| Untracked | 0 -| 65|0x0000000708200000, 0x0000000708200000, 0x0000000708400000| 0%| F| |TAMS 0x0000000708200000| PB 0x0000000708200000| Untracked | 0 -| 66|0x0000000708400000, 0x0000000708400000, 0x0000000708600000| 0%| F| |TAMS 0x0000000708400000| PB 0x0000000708400000| Untracked | 0 -| 67|0x0000000708600000, 0x0000000708600000, 0x0000000708800000| 0%| F| |TAMS 0x0000000708600000| PB 0x0000000708600000| Untracked | 0 -| 68|0x0000000708800000, 0x0000000708800000, 0x0000000708a00000| 0%| F| |TAMS 0x0000000708800000| PB 0x0000000708800000| Untracked | 0 -| 69|0x0000000708a00000, 0x0000000708a00000, 0x0000000708c00000| 0%| F| |TAMS 0x0000000708a00000| PB 0x0000000708a00000| Untracked | 0 -| 70|0x0000000708c00000, 0x0000000708c00000, 0x0000000708e00000| 0%| F| |TAMS 0x0000000708c00000| PB 0x0000000708c00000| Untracked | 0 -| 71|0x0000000708e00000, 0x0000000708e00000, 0x0000000709000000| 0%| F| |TAMS 0x0000000708e00000| PB 0x0000000708e00000| Untracked | 0 -| 72|0x0000000709000000, 0x0000000709000000, 0x0000000709200000| 0%| F| |TAMS 0x0000000709000000| PB 0x0000000709000000| Untracked | 0 -| 73|0x0000000709200000, 0x0000000709200000, 0x0000000709400000| 0%| F| |TAMS 0x0000000709200000| PB 0x0000000709200000| Untracked | 0 -| 74|0x0000000709400000, 0x0000000709400000, 0x0000000709600000| 0%| F| |TAMS 0x0000000709400000| PB 0x0000000709400000| Untracked | 0 -| 75|0x0000000709600000, 0x0000000709600000, 0x0000000709800000| 0%| F| |TAMS 0x0000000709600000| PB 0x0000000709600000| Untracked | 0 -| 76|0x0000000709800000, 0x0000000709800000, 0x0000000709a00000| 0%| F| |TAMS 0x0000000709800000| PB 0x0000000709800000| Untracked | 0 -| 77|0x0000000709a00000, 0x0000000709a00000, 0x0000000709c00000| 0%| F| |TAMS 0x0000000709a00000| PB 0x0000000709a00000| Untracked | 0 -| 78|0x0000000709c00000, 0x0000000709c00000, 0x0000000709e00000| 0%| F| |TAMS 0x0000000709c00000| PB 0x0000000709c00000| Untracked | 0 -| 79|0x0000000709e00000, 0x0000000709e00000, 0x000000070a000000| 0%| F| |TAMS 0x0000000709e00000| PB 0x0000000709e00000| Untracked | 0 -| 80|0x000000070a000000, 0x000000070a000000, 0x000000070a200000| 0%| F| |TAMS 0x000000070a000000| PB 0x000000070a000000| Untracked | 0 -| 81|0x000000070a200000, 0x000000070a200000, 0x000000070a400000| 0%| F| |TAMS 0x000000070a200000| PB 0x000000070a200000| Untracked | 0 -| 82|0x000000070a400000, 0x000000070a400000, 0x000000070a600000| 0%| F| |TAMS 0x000000070a400000| PB 0x000000070a400000| Untracked | 0 -| 83|0x000000070a600000, 0x000000070a600000, 0x000000070a800000| 0%| F| |TAMS 0x000000070a600000| PB 0x000000070a600000| Untracked | 0 -| 84|0x000000070a800000, 0x000000070a800000, 0x000000070aa00000| 0%| F| |TAMS 0x000000070a800000| PB 0x000000070a800000| Untracked | 0 -| 85|0x000000070aa00000, 0x000000070aa00000, 0x000000070ac00000| 0%| F| |TAMS 0x000000070aa00000| PB 0x000000070aa00000| Untracked | 0 -| 86|0x000000070ac00000, 0x000000070ac00000, 0x000000070ae00000| 0%| F| |TAMS 0x000000070ac00000| PB 0x000000070ac00000| Untracked | 0 -| 87|0x000000070ae00000, 0x000000070ae00000, 0x000000070b000000| 0%| F| |TAMS 0x000000070ae00000| PB 0x000000070ae00000| Untracked | 0 -| 88|0x000000070b000000, 0x000000070b000000, 0x000000070b200000| 0%| F| |TAMS 0x000000070b000000| PB 0x000000070b000000| Untracked | 0 -| 89|0x000000070b200000, 0x000000070b200000, 0x000000070b400000| 0%| F| |TAMS 0x000000070b200000| PB 0x000000070b200000| Untracked | 0 -| 90|0x000000070b400000, 0x000000070b400000, 0x000000070b600000| 0%| F| |TAMS 0x000000070b400000| PB 0x000000070b400000| Untracked | 0 -| 91|0x000000070b600000, 0x000000070b600000, 0x000000070b800000| 0%| F| |TAMS 0x000000070b600000| PB 0x000000070b600000| Untracked | 0 -| 92|0x000000070b800000, 0x000000070b800000, 0x000000070ba00000| 0%| F| |TAMS 0x000000070b800000| PB 0x000000070b800000| Untracked | 0 -| 93|0x000000070ba00000, 0x000000070ba00000, 0x000000070bc00000| 0%| F| |TAMS 0x000000070ba00000| PB 0x000000070ba00000| Untracked | 0 -| 94|0x000000070bc00000, 0x000000070bc00000, 0x000000070be00000| 0%| F| |TAMS 0x000000070bc00000| PB 0x000000070bc00000| Untracked | 0 -| 95|0x000000070be00000, 0x000000070be00000, 0x000000070c000000| 0%| F| |TAMS 0x000000070be00000| PB 0x000000070be00000| Untracked | 0 -| 96|0x000000070c000000, 0x000000070c000000, 0x000000070c200000| 0%| F| |TAMS 0x000000070c000000| PB 0x000000070c000000| Untracked | 0 -| 97|0x000000070c200000, 0x000000070c200000, 0x000000070c400000| 0%| F| |TAMS 0x000000070c200000| PB 0x000000070c200000| Untracked | 0 -| 98|0x000000070c400000, 0x000000070c400000, 0x000000070c600000| 0%| F| |TAMS 0x000000070c400000| PB 0x000000070c400000| Untracked | 0 -| 99|0x000000070c600000, 0x000000070c600000, 0x000000070c800000| 0%| F| |TAMS 0x000000070c600000| PB 0x000000070c600000| Untracked | 0 -| 100|0x000000070c800000, 0x000000070c800000, 0x000000070ca00000| 0%| F| |TAMS 0x000000070c800000| PB 0x000000070c800000| Untracked | 0 -| 101|0x000000070ca00000, 0x000000070ca00000, 0x000000070cc00000| 0%| F| |TAMS 0x000000070ca00000| PB 0x000000070ca00000| Untracked | 0 -| 102|0x000000070cc00000, 0x000000070cc00000, 0x000000070ce00000| 0%| F| |TAMS 0x000000070cc00000| PB 0x000000070cc00000| Untracked | 0 -| 103|0x000000070ce00000, 0x000000070ce00000, 0x000000070d000000| 0%| F| |TAMS 0x000000070ce00000| PB 0x000000070ce00000| Untracked | 0 -| 104|0x000000070d000000, 0x000000070d000000, 0x000000070d200000| 0%| F| |TAMS 0x000000070d000000| PB 0x000000070d000000| Untracked | 0 -| 105|0x000000070d200000, 0x000000070d200000, 0x000000070d400000| 0%| F| |TAMS 0x000000070d200000| PB 0x000000070d200000| Untracked | 0 -| 106|0x000000070d400000, 0x000000070d400000, 0x000000070d600000| 0%| F| |TAMS 0x000000070d400000| PB 0x000000070d400000| Untracked | 0 -| 107|0x000000070d600000, 0x000000070d600000, 0x000000070d800000| 0%| F| |TAMS 0x000000070d600000| PB 0x000000070d600000| Untracked | 0 -| 108|0x000000070d800000, 0x000000070d800000, 0x000000070da00000| 0%| F| |TAMS 0x000000070d800000| PB 0x000000070d800000| Untracked | 0 -| 109|0x000000070da00000, 0x000000070da00000, 0x000000070dc00000| 0%| F| |TAMS 0x000000070da00000| PB 0x000000070da00000| Untracked | 0 -| 110|0x000000070dc00000, 0x000000070dc00000, 0x000000070de00000| 0%| F| |TAMS 0x000000070dc00000| PB 0x000000070dc00000| Untracked | 0 -| 111|0x000000070de00000, 0x000000070de00000, 0x000000070e000000| 0%| F| |TAMS 0x000000070de00000| PB 0x000000070de00000| Untracked | 0 -| 112|0x000000070e000000, 0x000000070e000000, 0x000000070e200000| 0%| F| |TAMS 0x000000070e000000| PB 0x000000070e000000| Untracked | 0 -| 113|0x000000070e200000, 0x000000070e200000, 0x000000070e400000| 0%| F| |TAMS 0x000000070e200000| PB 0x000000070e200000| Untracked | 0 -| 114|0x000000070e400000, 0x000000070e4caa78, 0x000000070e600000| 39%| S|CS|TAMS 0x000000070e400000| PB 0x000000070e400000| Complete | 0 -| 115|0x000000070e600000, 0x000000070e800000, 0x000000070e800000|100%| S|CS|TAMS 0x000000070e600000| PB 0x000000070e600000| Complete | 0 -| 116|0x000000070e800000, 0x000000070e800000, 0x000000070ea00000| 0%| F| |TAMS 0x000000070e800000| PB 0x000000070e800000| Untracked | 0 -| 117|0x000000070ea00000, 0x000000070ea00000, 0x000000070ec00000| 0%| F| |TAMS 0x000000070ea00000| PB 0x000000070ea00000| Untracked | 0 -| 118|0x000000070ec00000, 0x000000070ec00000, 0x000000070ee00000| 0%| F| |TAMS 0x000000070ec00000| PB 0x000000070ec00000| Untracked | 0 -| 119|0x000000070ee00000, 0x000000070ee00000, 0x000000070f000000| 0%| F| |TAMS 0x000000070ee00000| PB 0x000000070ee00000| Untracked | 0 -| 120|0x000000070f000000, 0x000000070f000000, 0x000000070f200000| 0%| F| |TAMS 0x000000070f000000| PB 0x000000070f000000| Untracked | 0 -| 121|0x000000070f200000, 0x000000070f200000, 0x000000070f400000| 0%| F| |TAMS 0x000000070f200000| PB 0x000000070f200000| Untracked | 0 -| 122|0x000000070f400000, 0x000000070f400000, 0x000000070f600000| 0%| F| |TAMS 0x000000070f400000| PB 0x000000070f400000| Untracked | 0 -| 123|0x000000070f600000, 0x000000070f600000, 0x000000070f800000| 0%| F| |TAMS 0x000000070f600000| PB 0x000000070f600000| Untracked | 0 -| 124|0x000000070f800000, 0x000000070f800000, 0x000000070fa00000| 0%| F| |TAMS 0x000000070f800000| PB 0x000000070f800000| Untracked | 0 -| 125|0x000000070fa00000, 0x000000070fa00000, 0x000000070fc00000| 0%| F| |TAMS 0x000000070fa00000| PB 0x000000070fa00000| Untracked | 0 -| 126|0x000000070fc00000, 0x000000070fc00000, 0x000000070fe00000| 0%| F| |TAMS 0x000000070fc00000| PB 0x000000070fc00000| Untracked | 0 -| 127|0x000000070fe00000, 0x000000070ff75a28, 0x0000000710000000| 72%| E| |TAMS 0x000000070fe00000| PB 0x000000070fe00000| Complete | 0 - -Card table byte_map: [0x0000000100f20000,0x0000000101720000] _byte_map_base: 0x00000000fd720000 - -Marking Bits: (CMBitMap*) 0x0000000114840610 - Bits: [0x000000010af24000, 0x000000010ef24000) - -Polling page: 0x000000010020c000 - -Metaspace: - -Usage: - Non-class: 13.28 MB used. - Class: 1.65 MB used. - Both: 14.93 MB used. - -Virtual space: - Non-class space: 64.00 MB reserved, 13.50 MB ( 21%) committed, 1 nodes. - Class space: 1.00 GB reserved, 1.81 MB ( <1%) committed, 1 nodes. - Both: 1.06 GB reserved, 15.31 MB ( 1%) committed. - -Chunk freelists: - Non-Class: 2.35 MB - Class: 14.17 MB - Both: 16.52 MB - -MaxMetaspaceSize: unlimited -CompressedClassSpaceSize: 1.00 GB -Initial GC threshold: 21.00 MB -Current GC threshold: 21.00 MB -CDS: off - - commit_granule_bytes: 65536. - - commit_granule_words: 8192. - - virtual_space_node_default_size: 8388608. - - enlarge_chunks_in_place: 1. - - use_allocation_guard: 0. - - -Internal statistics: - -num_allocs_failed_limit: 0. -num_arena_births: 342. -num_arena_deaths: 0. -num_vsnodes_births: 2. -num_vsnodes_deaths: 0. -num_space_committed: 245. -num_space_uncommitted: 0. -num_chunks_returned_to_freelist: 0. -num_chunks_taken_from_freelist: 562. -num_chunk_merges: 0. -num_chunk_splits: 334. -num_chunks_enlarged: 195. -num_inconsistent_stats: 0. - -CodeHeap 'non-profiled nmethods': size=120032Kb used=384Kb max_used=384Kb free=119647Kb - bounds [0x0000000147ac8000, 0x0000000147d38000, 0x000000014f000000] -CodeHeap 'profiled nmethods': size=120016Kb used=2432Kb max_used=2432Kb free=117583Kb - bounds [0x0000000140000000, 0x0000000140270000, 0x0000000147534000] -CodeHeap 'non-nmethods': size=5712Kb used=1359Kb max_used=1372Kb free=4352Kb - bounds [0x0000000147534000, 0x00000001477a4000, 0x0000000147ac8000] - total_blobs=1729 nmethods=1250 adapters=386 - compilation: enabled - stopped_count=0, restarted_count=0 - full_count=0 - -Compilation events (20 events): -Event: 18.367 Thread 0x0000000114816400 nmethod 1240 0x000000014023d010 code [0x000000014023d300, 0x000000014023e190] -Event: 18.367 Thread 0x0000000114816400 1243 3 jdk.internal.classfile.impl.AbstractElement:: (5 bytes) -Event: 18.367 Thread 0x0000000114816400 nmethod 1243 0x000000014023e710 code [0x000000014023e8c0, 0x000000014023ea38] -Event: 18.367 Thread 0x0000000114816400 1244 3 java.lang.constant.ConstantUtils::skipOverFieldSignature (296 bytes) -Event: 18.368 Thread 0x0000000114816400 nmethod 1244 0x000000014023eb10 code [0x000000014023f000, 0x0000000140240cb8] -Event: 18.368 Thread 0x0000000114816400 1247 3 java.util.Arrays::fill (28 bytes) -Event: 18.368 Thread 0x0000000114816400 nmethod 1247 0x0000000140241790 code [0x0000000140241940, 0x0000000140241cc0] -Event: 18.368 Thread 0x0000000114816400 1245 3 jdk.internal.classfile.impl.DirectCodeBuilder::with (9 bytes) -Event: 18.368 Thread 0x0000000114816400 nmethod 1245 0x0000000140241e10 code [0x0000000140242040, 0x0000000140242910] -Event: 18.368 Thread 0x0000000114816400 1246 3 jdk.internal.classfile.impl.DirectCodeBuilder::with (30 bytes) -Event: 18.368 Thread 0x0000000114816400 nmethod 1246 0x0000000140242b90 code [0x0000000140242dc0, 0x0000000140243530] -Event: 18.369 Thread 0x0000000114816400 1248 3 jdk.internal.classfile.impl.SplitConstantPool::map (145 bytes) -Event: 18.369 Thread 0x0000000114816400 nmethod 1248 0x0000000140243790 code [0x0000000140243a80, 0x0000000140244810] -Event: 18.369 Thread 0x0000000114816400 1249 3 java.util.stream.Sink$ChainedReference::cancellationRequested (10 bytes) -Event: 18.369 Thread 0x0000000114816400 nmethod 1249 0x0000000140244c90 code [0x0000000140244e40, 0x0000000140245060] -Event: 18.369 Thread 0x0000000114816400 1251 ! 3 java.lang.invoke.MethodHandles$Lookup::canBeCached (150 bytes) -Event: 18.370 Thread 0x0000000114816400 nmethod 1251 0x0000000140245110 code [0x0000000140245540, 0x0000000140246928] -Event: 18.370 Thread 0x0000000114816400 1252 3 java.util.ArrayList::isEmpty (13 bytes) -Event: 18.370 Thread 0x0000000114816400 nmethod 1252 0x0000000140247090 code [0x0000000140247240, 0x00000001402473b0] -Event: 18.370 Thread 0x0000000114816400 1254 3 jdk.internal.classfile.impl.StackMapGenerator::processBlock (2767 bytes) - -GC Heap History (2 events): -Event: 18.360 GC heap before -{Heap before GC invocations=0 (full 0): - garbage-first heap total reserved 4194304K, committed 262144K, used 22528K [0x0000000700000000, 0x0000000800000000) - region size 2048K, 12 young (24576K), 0 survivors (0K) - Metaspace used 14901K, committed 15168K, reserved 1114112K - class space used 1624K, committed 1728K, reserved 1048576K -} -Event: 18.363 GC heap after -{Heap after GC invocations=1 (full 0): - garbage-first heap total reserved 4194304K, committed 262144K, used 2858K [0x0000000700000000, 0x0000000800000000) - region size 2048K, 2 young (4096K), 2 survivors (4096K) - Metaspace used 14901K, committed 15168K, reserved 1114112K - class space used 1624K, committed 1728K, reserved 1048576K -} - -Dll operation events (8 events): -Event: 0.005 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjava.dylib -Event: 0.006 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libzip.dylib -Event: 0.073 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libinstrument.dylib -Event: 0.084 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libnio.dylib -Event: 0.089 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libzip.dylib -Event: 0.129 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjimage.dylib -Event: 7.529 Loaded shared library libsomelib.dylib -Event: 7.533 Loaded shared library /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libsyslookup.dylib - -Deoptimization events (20 events): -Event: 0.267 Thread 0x0000000114818200 DEOPT PACKING pc=0x0000000147ad17f0 sp=0x000000016fe934a0 -Event: 0.267 Thread 0x0000000114818200 DEOPT UNPACKING pc=0x000000014757701c sp=0x000000016fe933d0 mode 2 -Event: 0.267 Thread 0x0000000114818200 Uncommon trap: trap_request=0xffffff45 fr.pc=0x0000000147ae5160 relative=0x00000000000001a0 -Event: 0.267 Thread 0x0000000114818200 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000147ae5160 method=jdk.internal.util.ArraysSupport.vectorizedHashCode(Ljava/lang/Object;IIII)I @ 2 c2 -Event: 0.267 Thread 0x0000000114818200 DEOPT PACKING pc=0x0000000147ae5160 sp=0x000000016fe93350 -Event: 0.267 Thread 0x0000000114818200 DEOPT UNPACKING pc=0x000000014757701c sp=0x000000016fe93310 mode 2 -Event: 7.496 Thread 0x0000000114818200 Uncommon trap: trap_request=0xffffff45 fr.pc=0x0000000147b0e620 relative=0x00000000000000e0 -Event: 7.496 Thread 0x0000000114818200 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000147b0e620 method=sun.net.www.ParseUtil.firstEncodeIndex(Ljava/lang/String;)I @ 51 c2 -Event: 7.496 Thread 0x0000000114818200 DEOPT PACKING pc=0x0000000147b0e620 sp=0x000000016fe92770 -Event: 7.496 Thread 0x0000000114818200 DEOPT UNPACKING pc=0x000000014757701c sp=0x000000016fe926f0 mode 2 -Event: 18.344 Thread 0x0000000114818200 DEOPT PACKING pc=0x00000001401e21c8 sp=0x000000016fe92500 -Event: 18.344 Thread 0x0000000114818200 DEOPT UNPACKING pc=0x0000000147576e7c sp=0x000000016fe92300 mode 3 -Event: 18.364 Thread 0x0000000114818200 Uncommon trap: trap_request=0xffffff45 fr.pc=0x0000000147b0dee8 relative=0x00000000000000a8 -Event: 18.364 Thread 0x0000000114818200 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000147b0dee8 method=java.lang.ref.ReferenceQueue.headIsNull()Z @ 4 c2 -Event: 18.364 Thread 0x0000000114818200 DEOPT PACKING pc=0x0000000147b0dee8 sp=0x000000016fe92a20 -Event: 18.364 Thread 0x0000000114818200 DEOPT UNPACKING pc=0x000000014757701c sp=0x000000016fe928e0 mode 2 -Event: 18.364 Thread 0x0000000114818200 Uncommon trap: trap_request=0xffffff45 fr.pc=0x0000000147b0846c relative=0x000000000000006c -Event: 18.364 Thread 0x0000000114818200 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000147b0846c method=java.lang.ref.ReferenceQueue.headIsNull()Z @ 4 c2 -Event: 18.364 Thread 0x0000000114818200 DEOPT PACKING pc=0x0000000147b0846c sp=0x000000016fe92990 -Event: 18.364 Thread 0x0000000114818200 DEOPT UNPACKING pc=0x000000014757701c sp=0x000000016fe928c0 mode 2 - -Classes loaded (20 events): -Event: 18.370 Loading class jdk/internal/classfile/impl/BufferedCodeBuilder -Event: 18.370 Loading class jdk/internal/classfile/impl/BufferedCodeBuilder done -Event: 18.370 Loading class jdk/internal/classfile/impl/TransformingCodeBuilder -Event: 18.371 Loading class jdk/internal/classfile/impl/TransformingCodeBuilder done -Event: 18.371 Loading class java/lang/classfile/instruction/ThrowInstruction -Event: 18.371 Loading class java/lang/classfile/instruction/ThrowInstruction done -Event: 18.371 Loading class jdk/internal/classfile/impl/AbstractInstruction$UnboundThrowInstruction -Event: 18.371 Loading class jdk/internal/classfile/impl/AbstractInstruction$UnboundThrowInstruction done -Event: 18.371 Loading class java/lang/classfile/instruction/ExceptionCatch -Event: 18.371 Loading class java/lang/classfile/instruction/ExceptionCatch done -Event: 18.371 Loading class jdk/internal/classfile/impl/AbstractPseudoInstruction$ExceptionCatchImpl -Event: 18.371 Loading class jdk/internal/classfile/impl/AbstractPseudoInstruction -Event: 18.371 Loading class jdk/internal/classfile/impl/AbstractPseudoInstruction done -Event: 18.371 Loading class jdk/internal/classfile/impl/AbstractPseudoInstruction$ExceptionCatchImpl done -Event: 18.371 Loading class jdk/internal/classfile/impl/StackMapGenerator$RawExceptionCatch -Event: 18.371 Loading class jdk/internal/classfile/impl/StackMapGenerator$RawExceptionCatch done -Event: 18.372 Loading class jdk/internal/classfile/impl/SplitConstantPool$1 -Event: 18.372 Loading class jdk/internal/classfile/impl/SplitConstantPool$1 done -Event: 18.372 Loading class java/lang/invoke/ConstantBootstraps -Event: 18.372 Loading class java/lang/invoke/ConstantBootstraps done - -Classes unloaded (0 events): -No events - -Classes redefined (0 events): -No events - -Internal exceptions (20 events): -Event: 18.344 Thread 0x0000000114818200 Exception (0x000000070e898618) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 18.346 Thread 0x0000000114818200 Exception (0x000000070e8bb1c8) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 18.347 Thread 0x0000000114818200 Exception (0x000000070e8bf818) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 18.347 Thread 0x0000000114818200 Exception (0x000000070e8c33d0) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 18.347 Thread 0x0000000114818200 Exception (0x000000070e8caf20) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 18.347 Thread 0x0000000114818200 Exception (0x000000070e8d1ef8) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 18.347 Thread 0x0000000114818200 Exception (0x000000070e8d8ec8) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 18.348 Thread 0x0000000114818200 Exception (0x000000070e8dd980) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 18.349 Thread 0x0000000114818200 Exception (0x000000070e8fc058) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 18.354 Thread 0x0000000114818200 Exception (0x000000070e948d90) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 841] -Event: 18.355 Thread 0x0000000114818200 Exception (0x000000070e95f8e8) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 18.358 Thread 0x0000000114818200 Exception (0x000000070e9ca4f0) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 18.359 Thread 0x0000000114818200 Exception (0x000000070e9d5288) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 18.360 Thread 0x0000000114818200 Exception (0x000000070e9e6bc8) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 18.363 Thread 0x0000000114818200 Exception (0x000000070fe03a58) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 18.364 Thread 0x0000000114818200 Exception (0x000000070fe08f28) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 18.365 Thread 0x0000000114818200 Exception (0x000000070fe1c800) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 18.369 Thread 0x0000000114818200 Exception (0x000000070fe5c528) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 18.372 Thread 0x0000000114818200 Exception (0x000000070ff1ebf8) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] -Event: 18.372 Thread 0x0000000114818200 Exception (0x000000070ff32c58) -thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 774] - -ZGC Phase Switch (0 events): -No events - -VM Operations (20 events): -Event: 12.760 Executing VM operation: get/set locals -Event: 12.760 Executing VM operation: get/set locals done -Event: 12.760 Executing VM operation: get/set locals -Event: 12.761 Executing VM operation: get/set locals done -Event: 12.761 Executing VM operation: get/set locals -Event: 12.761 Executing VM operation: get/set locals done -Event: 12.761 Executing VM operation: get/set locals -Event: 12.761 Executing VM operation: get/set locals done -Event: 14.616 Executing VM operation: get/set locals -Event: 14.616 Executing VM operation: get/set locals done -Event: 14.617 Executing VM operation: get/set locals -Event: 14.617 Executing VM operation: get/set locals done -Event: 14.617 Executing VM operation: get/set locals -Event: 14.617 Executing VM operation: get/set locals done -Event: 14.617 Executing VM operation: get/set locals -Event: 14.617 Executing VM operation: get/set locals done -Event: 14.617 Executing VM operation: get/set locals -Event: 14.617 Executing VM operation: get/set locals done -Event: 18.360 Executing VM operation: G1CollectForAllocation (G1 Evacuation Pause) -Event: 18.363 Executing VM operation: G1CollectForAllocation (G1 Evacuation Pause) done - -Events (20 events): -Event: 0.024 Thread 0x000000013480d800 Thread added: 0x000000013480d800 -Event: 0.024 Protecting memory [0x0000000171224000,0x0000000171230000] with protection modes 0 -Event: 0.024 Thread 0x0000000134811400 Thread added: 0x0000000134811400 -Event: 0.024 Protecting memory [0x0000000171430000,0x000000017143c000] with protection modes 0 -Event: 0.024 Thread 0x000000013480ec00 Thread added: 0x000000013480ec00 -Event: 0.024 Protecting memory [0x000000017163c000,0x0000000171648000] with protection modes 0 -Event: 0.024 Thread 0x0000000115008200 Thread added: 0x0000000115008200 -Event: 0.024 Protecting memory [0x0000000171848000,0x0000000171854000] with protection modes 0 -Event: 0.024 Thread 0x0000000114816400 Thread added: 0x0000000114816400 -Event: 0.024 Protecting memory [0x0000000171a54000,0x0000000171a60000] with protection modes 0 -Event: 0.044 Thread 0x000000013500b200 Thread added: 0x000000013500b200 -Event: 0.044 Protecting memory [0x0000000171c60000,0x0000000171c6c000] with protection modes 0 -Event: 0.060 Thread 0x00000001248e8600 Thread added: 0x00000001248e8600 -Event: 0.060 Protecting memory [0x0000000171e6c000,0x0000000171e78000] with protection modes 0 -Event: 0.060 Thread 0x000000013503d200 Thread added: 0x000000013503d200 -Event: 0.060 Protecting memory [0x0000000172078000,0x0000000172084000] with protection modes 0 -Event: 0.060 Thread 0x000000013483be00 Thread added: 0x000000013483be00 -Event: 0.060 Protecting memory [0x0000000172284000,0x0000000172290000] with protection modes 0 -Event: 0.080 Thread 0x0000000135808200 Thread added: 0x0000000135808200 -Event: 0.080 Protecting memory [0x0000000172490000,0x000000017249c000] with protection modes 0 - - -Dynamic libraries: -0x0000000100680000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjli.dylib -0x00000001a96bb000 /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa -0x0000000192c62000 /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit -0x0000000195cce000 /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData -0x0000000190515000 /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation -0x000000019bfdc000 /usr/lib/libSystem.B.dylib -0x0000000193f9f000 /System/Library/PrivateFrameworks/UIFoundation.framework/Versions/A/UIFoundation -0x000000022ab7f000 /System/Library/PrivateFrameworks/CollectionViewCore.framework/Versions/A/CollectionViewCore -0x00000001a3255000 /System/Library/PrivateFrameworks/RemoteViewServices.framework/Versions/A/RemoteViewServices -0x0000000199e89000 /System/Library/PrivateFrameworks/XCTTargetBootstrap.framework/Versions/A/XCTTargetBootstrap -0x000000019e618000 /System/Library/PrivateFrameworks/InternationalSupport.framework/Versions/A/InternationalSupport -0x000000019e66c000 /System/Library/PrivateFrameworks/UserActivity.framework/Versions/A/UserActivity -0x000000024efd6000 /System/Library/PrivateFrameworks/WindowManagement.framework/Versions/A/WindowManagement -0x0000000190195000 /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration -0x000000019da86000 /usr/lib/libspindump.dylib -0x0000000194154000 /System/Library/Frameworks/UniformTypeIdentifiers.framework/Versions/A/UniformTypeIdentifiers -0x0000000197d00000 /usr/lib/libapp_launch_measurement.dylib -0x0000000197126000 /System/Library/PrivateFrameworks/CoreAnalytics.framework/Versions/A/CoreAnalytics -0x0000000197d07000 /System/Library/PrivateFrameworks/CoreAutoLayout.framework/Versions/A/CoreAutoLayout -0x00000001996a9000 /System/Library/Frameworks/Metal.framework/Versions/A/Metal -0x000000019a631000 /usr/lib/liblangid.dylib -0x0000000199e8f000 /System/Library/PrivateFrameworks/CoreSVG.framework/Versions/A/CoreSVG -0x0000000194b19000 /System/Library/PrivateFrameworks/SkyLight.framework/Versions/A/SkyLight -0x0000000194fba000 /System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics -0x00000001a392f000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate -0x000000019d8e0000 /System/Library/PrivateFrameworks/IconServices.framework/Versions/A/IconServices -0x0000000199687000 /System/Library/Frameworks/IOSurface.framework/Versions/A/IOSurface -0x0000000197155000 /usr/lib/libDiagnosticMessagesClient.dylib -0x000000019bf1e000 /usr/lib/libz.1.dylib -0x00000001a70d4000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices -0x0000000199e71000 /System/Library/PrivateFrameworks/DFRFoundation.framework/Versions/A/DFRFoundation -0x00000001924bc000 /usr/lib/libicucore.A.dylib -0x000000019f676000 /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox -0x000000019e627000 /System/Library/PrivateFrameworks/DataDetectorsCore.framework/Versions/A/DataDetectorsCore -0x00000001b809a000 /System/Library/PrivateFrameworks/TextInput.framework/Versions/A/TextInput -0x0000000194a6a000 /usr/lib/libMobileGestalt.dylib -0x0000000199bad000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox -0x000000019762c000 /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore -0x00000001920e9000 /System/Library/Frameworks/Security.framework/Versions/A/Security -0x00000001a3295000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SpeechRecognition.framework/Versions/A/SpeechRecognition -0x0000000197a2e000 /System/Library/PrivateFrameworks/CoreUI.framework/Versions/A/CoreUI -0x00000001919e2000 /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio -0x0000000197239000 /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration -0x000000019dee2000 /System/Library/PrivateFrameworks/MultitouchSupport.framework/Versions/A/MultitouchSupport -0x0000000194a68000 /usr/lib/libenergytrace.dylib -0x00000001ad793000 /System/Library/PrivateFrameworks/RenderBox.framework/Versions/A/RenderBox -0x0000000192b16000 /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit -0x00000001a366a000 /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices -0x0000000197c8c000 /System/Library/PrivateFrameworks/PerformanceAnalysis.framework/Versions/A/PerformanceAnalysis -0x00000001e603f000 /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL -0x0000000197d51000 /usr/lib/libxml2.2.dylib -0x000000019b360000 /System/Library/PrivateFrameworks/MobileKeyBag.framework/Versions/A/MobileKeyBag -0x000000018ef80000 /usr/lib/libobjc.A.dylib -0x000000018f274000 /usr/lib/libc++.1.dylib -0x00000001a35e7000 /System/Library/Frameworks/Accessibility.framework/Versions/A/Accessibility -0x000000019569a000 /System/Library/Frameworks/ColorSync.framework/Versions/A/ColorSync -0x000000018f3c0000 /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation -0x000000019a1ec000 /System/Library/Frameworks/CoreImage.framework/Versions/A/CoreImage -0x00000001917ed000 /System/Library/Frameworks/CoreText.framework/Versions/A/CoreText -0x00000001ea89e000 /System/Library/Frameworks/CoreTransferable.framework/Versions/A/CoreTransferable -0x00000001ead63000 /System/Library/Frameworks/DeveloperToolsSupport.framework/Versions/A/DeveloperToolsSupport -0x0000000199eca000 /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO -0x0000000224d1f000 /System/Library/Frameworks/Symbols.framework/Versions/A/Symbols -0x000000019bfe2000 /System/Library/PrivateFrameworks/SoftLinking.framework/Versions/A/SoftLinking -0x000000019f028000 /usr/lib/swift/libswiftCore.dylib -0x00000001b4d27000 /usr/lib/swift/libswiftCoreFoundation.dylib -0x00000001b2790000 /usr/lib/swift/libswiftCoreGraphics.dylib -0x00000001b4d71000 /usr/lib/swift/libswiftCoreImage.dylib -0x00000001b2797000 /usr/lib/swift/libswiftDarwin.dylib -0x00000001a4cda000 /usr/lib/swift/libswiftDispatch.dylib -0x00000001b4d72000 /usr/lib/swift/libswiftIOKit.dylib -0x00000001c07cc000 /usr/lib/swift/libswiftMetal.dylib -0x00000001cde91000 /usr/lib/swift/libswiftOSLog.dylib -0x00000001a754f000 /usr/lib/swift/libswiftObjectiveC.dylib -0x00000001c4f00000 /usr/lib/swift/libswiftQuartzCore.dylib -0x00000001c9005000 /usr/lib/swift/libswiftUniformTypeIdentifiers.dylib -0x00000001b4d39000 /usr/lib/swift/libswiftXPC.dylib -0x000000025747d000 /usr/lib/swift/libswift_Concurrency.dylib -0x00000001a7553000 /usr/lib/swift/libswiftos.dylib -0x00000001b7ffe000 /usr/lib/swift/libswiftsimd.dylib -0x000000019c191000 /usr/lib/libcompression.dylib -0x000000019e572000 /System/Library/PrivateFrameworks/TextureIO.framework/Versions/A/TextureIO -0x000000019d58c000 /usr/lib/libate.dylib -0x000000019bfd6000 /usr/lib/system/libcache.dylib -0x000000019bf90000 /usr/lib/system/libcommonCrypto.dylib -0x000000019bfbc000 /usr/lib/system/libcompiler_rt.dylib -0x000000019bfb2000 /usr/lib/system/libcopyfile.dylib -0x000000018f0c4000 /usr/lib/system/libcorecrypto.dylib -0x000000018f1aa000 /usr/lib/system/libdispatch.dylib -0x000000018f365000 /usr/lib/system/libdyld.dylib -0x000000019bfcc000 /usr/lib/system/libkeymgr.dylib -0x000000019bf68000 /usr/lib/system/libmacho.dylib -0x000000019b448000 /usr/lib/system/libquarantine.dylib -0x000000019bfc9000 /usr/lib/system/libremovefile.dylib -0x0000000194ae0000 /usr/lib/system/libsystem_asl.dylib -0x000000018f059000 /usr/lib/system/libsystem_blocks.dylib -0x000000018f1f5000 /usr/lib/system/libsystem_c.dylib -0x000000019bfc0000 /usr/lib/system/libsystem_collections.dylib -0x000000019a620000 /usr/lib/system/libsystem_configuration.dylib -0x000000019965c000 /usr/lib/system/libsystem_containermanager.dylib -0x000000019bbff000 /usr/lib/system/libsystem_coreservices.dylib -0x0000000192783000 /usr/lib/system/libsystem_darwin.dylib -0x00000002577ca000 /usr/lib/system/libsystem_darwindirectory.dylib -0x000000019bfcd000 /usr/lib/system/libsystem_dnssd.dylib -0x00000002577ce000 /usr/lib/system/libsystem_eligibility.dylib -0x000000018f1f2000 /usr/lib/system/libsystem_featureflags.dylib -0x000000018f393000 /usr/lib/system/libsystem_info.dylib -0x000000019bf2d000 /usr/lib/system/libsystem_m.dylib -0x000000018f16d000 /usr/lib/system/libsystem_malloc.dylib -0x0000000194a4d000 /usr/lib/system/libsystem_networkextension.dylib -0x0000000192bf9000 /usr/lib/system/libsystem_notify.dylib -0x000000019a625000 /usr/lib/system/libsystem_sandbox.dylib -0x00000002577d2000 /usr/lib/system/libsystem_sanitizers.dylib -0x000000019bfc5000 /usr/lib/system/libsystem_secinit.dylib -0x000000018f31d000 /usr/lib/system/libsystem_kernel.dylib -0x000000018f38b000 /usr/lib/system/libsystem_platform.dylib -0x000000018f358000 /usr/lib/system/libsystem_pthread.dylib -0x00000001964d0000 /usr/lib/system/libsystem_symptoms.dylib -0x000000018f0a9000 /usr/lib/system/libsystem_trace.dylib -0x000000019bf9e000 /usr/lib/system/libunwind.dylib -0x000000018f05e000 /usr/lib/system/libxpc.dylib -0x000000018f301000 /usr/lib/libc++abi.dylib -0x000000019bfaa000 /usr/lib/liboah.dylib -0x000000019d438000 /usr/lib/liblzma.5.dylib -0x000000019bfde000 /usr/lib/libfakelink.dylib -0x0000000194679000 /System/Library/Frameworks/CFNetwork.framework/Versions/A/CFNetwork -0x000000019c032000 /usr/lib/libarchive.2.dylib -0x00000001a1568000 /System/Library/Frameworks/Combine.framework/Versions/A/Combine -0x000000022ab93000 /System/Library/PrivateFrameworks/CollectionsInternal.framework/Versions/A/CollectionsInternal -0x0000000241543000 /System/Library/PrivateFrameworks/ReflectionInternal.framework/Versions/A/ReflectionInternal -0x0000000241ad5000 /System/Library/PrivateFrameworks/RuntimeInternal.framework/Versions/A/RuntimeInternal -0x00000002575d1000 /usr/lib/swift/libswift_StringProcessing.dylib -0x0000000192a94000 /System/Library/PrivateFrameworks/CoreServicesInternal.framework/Versions/A/CoreServicesInternal -0x000000019b46f000 /usr/lib/libbsm.0.dylib -0x000000019bf70000 /usr/lib/system/libkxld.dylib -0x0000000197cc8000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/FSEvents.framework/Versions/A/FSEvents -0x000000019278e000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore -0x000000019719e000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata -0x000000019bc05000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices -0x000000019c0bb000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit -0x0000000196451000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE -0x000000018f899000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices -0x000000019d3e1000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/DictionaryServices.framework/Versions/A/DictionaryServices -0x0000000197cd5000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SharedFileList.framework/Versions/A/SharedFileList -0x000000019c15b000 /usr/lib/libapple_nghttp2.dylib -0x00000001960c5000 /usr/lib/libsqlite3.dylib -0x00000001964d9000 /System/Library/Frameworks/Network.framework/Versions/A/Network -0x0000000255e8e000 /usr/lib/libCoreEntitlements.dylib -0x000000023c44d000 /System/Library/PrivateFrameworks/MessageSecurity.framework/Versions/A/MessageSecurity -0x00000001960ab000 /System/Library/PrivateFrameworks/ProtocolBuffer.framework/Versions/A/ProtocolBuffer -0x000000019bb2e000 /System/Library/PrivateFrameworks/AppleFSCompression.framework/Versions/A/AppleFSCompression -0x000000019b457000 /usr/lib/libcoretls.dylib -0x000000019d457000 /usr/lib/libcoretls_cfhelpers.dylib -0x000000019c18b000 /usr/lib/libpam.2.dylib -0x000000019d4c9000 /usr/lib/libxar.1.dylib -0x000000019d8b7000 /usr/lib/libheimdal-asn1.dylib -0x0000000194678000 /usr/lib/libnetwork.dylib -0x000000019bfe3000 /usr/lib/libpcap.A.dylib -0x00000001964c5000 /usr/lib/libdns_services.dylib -0x000000019a62d000 /System/Library/PrivateFrameworks/AppleSystemInfo.framework/Versions/A/AppleSystemInfo -0x000000019b155000 /System/Library/PrivateFrameworks/IOMobileFramebuffer.framework/Versions/A/IOMobileFramebuffer -0x0000000257528000 /usr/lib/swift/libswift_RegexParser.dylib -0x000000019bbf2000 /usr/lib/libbz2.1.0.dylib -0x000000019b44b000 /usr/lib/libCheckFix.dylib -0x0000000194af8000 /System/Library/PrivateFrameworks/TCC.framework/Versions/A/TCC -0x000000019a633000 /System/Library/PrivateFrameworks/CoreNLP.framework/Versions/A/CoreNLP -0x0000000197157000 /System/Library/PrivateFrameworks/MetadataUtilities.framework/Versions/A/MetadataUtilities -0x000000019b481000 /usr/lib/libmecab.dylib -0x0000000190229000 /usr/lib/libCRFSuite.dylib -0x000000019b4dd000 /usr/lib/libgermantok.dylib -0x000000019c132000 /usr/lib/libThaiTokenizer.dylib -0x0000000197242000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.framework/Versions/A/vImage -0x00000001a3641000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/vecLib -0x000000019d510000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvMisc.dylib -0x000000019b030000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvDSP.dylib -0x000000018fca0000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib -0x000000019c266000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib -0x000000019b4e0000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLinearAlgebra.dylib -0x000000019c176000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparseBLAS.dylib -0x000000019c261000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libQuadrature.dylib -0x000000019a75c000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBNNS.dylib -0x000000019012e000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparse.dylib -0x000000023ab9c000 /System/Library/PrivateFrameworks/MIL.framework/Versions/A/MIL -0x000000019c019000 /usr/lib/libiconv.2.dylib -0x000000019bf64000 /usr/lib/libcharset.1.dylib -0x0000000197ca8000 /System/Library/Frameworks/OpenDirectory.framework/Versions/A/Frameworks/CFOpenDirectory.framework/Versions/A/CFOpenDirectory -0x0000000197c98000 /System/Library/Frameworks/OpenDirectory.framework/Versions/A/OpenDirectory -0x000000019d459000 /System/Library/PrivateFrameworks/APFS.framework/Versions/A/APFS -0x000000019b387000 /System/Library/Frameworks/SecurityFoundation.framework/Versions/A/SecurityFoundation -0x000000019d4d8000 /usr/lib/libutil.dylib -0x0000000238cfd000 /System/Library/PrivateFrameworks/InstalledContentLibrary.framework/Versions/A/InstalledContentLibrary -0x0000000192ad5000 /System/Library/PrivateFrameworks/CoreServicesStore.framework/Versions/A/CoreServicesStore -0x0000000228340000 /System/Library/PrivateFrameworks/AppleMobileFileIntegrity.framework/Versions/A/AppleMobileFileIntegrity -0x00000001b4cf5000 /usr/lib/libmis.dylib -0x00000001c53e7000 /System/Library/PrivateFrameworks/MobileSystemServices.framework/Versions/A/MobileSystemServices -0x00000001e3449000 /System/Library/PrivateFrameworks/ConfigProfileHelper.framework/Versions/A/ConfigProfileHelper -0x000000019c134000 /System/Library/PrivateFrameworks/AppleSauce.framework/Versions/A/AppleSauce -0x0000000191173000 /System/Library/PrivateFrameworks/LanguageModeling.framework/Versions/A/LanguageModeling -0x000000019d4dc000 /usr/lib/libxslt.1.dylib -0x000000019c020000 /usr/lib/libcmph.dylib -0x000000019b121000 /System/Library/PrivateFrameworks/CoreEmoji.framework/Versions/A/CoreEmoji -0x000000019a756000 /System/Library/PrivateFrameworks/LinguisticData.framework/Versions/A/LinguisticData -0x000000019003c000 /System/Library/PrivateFrameworks/Lexicon.framework/Versions/A/Lexicon -0x000000019b415000 /System/Library/PrivateFrameworks/BackgroundTaskManagement.framework/Versions/A/BackgroundTaskManagement -0x0000000256078000 /usr/lib/libTLE.dylib -0x000000019dda8000 /System/Library/PrivateFrameworks/AppleJPEG.framework/Versions/A/AppleJPEG -0x000000019d89c000 /usr/lib/libexpat.1.dylib -0x000000019e3d0000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libPng.dylib -0x000000019e3fb000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib -0x000000019e4e6000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libGIF.dylib -0x000000019ddee000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJP2.dylib -0x000000019e48b000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib -0x000000019e482000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libRadiance.dylib -0x0000000199a48000 /System/Library/PrivateFrameworks/FontServices.framework/libFontParser.dylib -0x00000001963ea000 /System/Library/PrivateFrameworks/RunningBoardServices.framework/Versions/A/RunningBoardServices -0x00000001a9f95000 /System/Library/PrivateFrameworks/IOSurfaceAccelerator.framework/Versions/A/IOSurfaceAccelerator -0x000000019dede000 /System/Library/PrivateFrameworks/WatchdogClient.framework/Versions/A/WatchdogClient -0x0000000191359000 /System/Library/Frameworks/CoreDisplay.framework/Versions/A/CoreDisplay -0x00000001998ff000 /System/Library/Frameworks/CoreMedia.framework/Versions/A/CoreMedia -0x000000019969f000 /System/Library/PrivateFrameworks/IOAccelerator.framework/Versions/A/IOAccelerator -0x0000000197e3b000 /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo -0x000000019c189000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/MetalPerformanceShaders -0x000000019df21000 /System/Library/Frameworks/VideoToolbox.framework/Versions/A/VideoToolbox -0x0000000197ed7000 /System/Library/PrivateFrameworks/UserManagement.framework/Versions/A/UserManagement -0x0000000196311000 /System/Library/PrivateFrameworks/BaseBoard.framework/Versions/A/BaseBoard -0x000000019a62b000 /System/Library/PrivateFrameworks/AggregateDictionary.framework/Versions/A/AggregateDictionary -0x000000022817a000 /System/Library/PrivateFrameworks/AppleKeyStore.framework/Versions/A/AppleKeyStore -0x000000019e47d000 /System/Library/PrivateFrameworks/GPUWrangler.framework/Versions/A/GPUWrangler -0x000000019e45d000 /System/Library/PrivateFrameworks/IOPresentment.framework/Versions/A/IOPresentment -0x000000019e485000 /System/Library/PrivateFrameworks/DSExternalDisplay.framework/Versions/A/DSExternalDisplay -0x0000000234d8a000 /System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/32023/Libraries/libllvm-flatbuffers.dylib -0x00000001e6032000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCoreFSCache.dylib -0x00000002319ee000 /System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/32023/Libraries/libGPUCompilerUtils.dylib -0x000000019e4ec000 /System/Library/PrivateFrameworks/CMCaptureCore.framework/Versions/A/CMCaptureCore -0x00000001eae86000 /System/Library/Frameworks/ExtensionFoundation.framework/Versions/A/ExtensionFoundation -0x00000001a5543000 /System/Library/PrivateFrameworks/CoreTime.framework/Versions/A/CoreTime -0x000000019da70000 /System/Library/PrivateFrameworks/AppServerSupport.framework/Versions/A/AppServerSupport -0x00000001a0004000 /System/Library/PrivateFrameworks/perfdata.framework/Versions/A/perfdata -0x000000019147d000 /System/Library/PrivateFrameworks/AudioToolboxCore.framework/Versions/A/AudioToolboxCore -0x00000001998d5000 /System/Library/PrivateFrameworks/caulk.framework/Versions/A/caulk -0x000000019f872000 /usr/lib/libAudioStatistics.dylib -0x00000001b402e000 /System/Library/PrivateFrameworks/SystemPolicy.framework/Versions/A/SystemPolicy -0x000000019fb4b000 /usr/lib/libSMC.dylib -0x00000001a953d000 /System/Library/Frameworks/CoreMIDI.framework/Versions/A/CoreMIDI -0x000000019e397000 /usr/lib/libAudioToolboxUtility.dylib -0x00000001af42f000 /System/Library/PrivateFrameworks/OSAServicesClient.framework/Versions/A/OSAServicesClient -0x00000001a0012000 /usr/lib/libperfcheck.dylib -0x00000001a4ffa000 /System/Library/PrivateFrameworks/BoardServices.framework/Versions/A/BoardServices -0x000000019d784000 /System/Library/PrivateFrameworks/PlugInKit.framework/Versions/A/PlugInKit -0x000000019b379000 /System/Library/PrivateFrameworks/AssertionServices.framework/Versions/A/AssertionServices -0x00000001a864e000 /System/Library/PrivateFrameworks/ASEProcessing.framework/Versions/A/ASEProcessing -0x00000001d1318000 /System/Library/PrivateFrameworks/Symbolication.framework/Versions/A/Symbolication -0x0000000240330000 /System/Library/PrivateFrameworks/PhotosensitivityProcessing.framework/Versions/A/PhotosensitivityProcessing -0x000000019da21000 /System/Library/PrivateFrameworks/GraphVisualizer.framework/Versions/A/GraphVisualizer -0x00000001e6094000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib -0x00000001e6053000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGFXShared.dylib -0x00000001e622c000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib -0x00000001e605c000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLImage.dylib -0x00000001e6050000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCVMSPluginSupport.dylib -0x0000000256030000 /usr/lib/libRosetta.dylib -0x00000001e6039000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCoreVMClient.dylib -0x000000022fbf4000 /System/Library/PrivateFrameworks/FontServices.framework/Versions/A/FontServices -0x000000019da2d000 /System/Library/PrivateFrameworks/OTSVG.framework/Versions/A/OTSVG -0x00000001979dc000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/Resources/libFontRegistry.dylib -0x000000019da7b000 /System/Library/PrivateFrameworks/FontServices.framework/libhvf.dylib -0x000000022fbf5000 /System/Library/PrivateFrameworks/FontServices.framework/libXTFontStaticRegistryData.dylib -0x000000019a572000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSCore.framework/Versions/A/MPSCore -0x000000019ba9c000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSImage.framework/Versions/A/MPSImage -0x000000019b4f5000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSNeuralNetwork.framework/Versions/A/MPSNeuralNetwork -0x000000019b940000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSMatrix.framework/Versions/A/MPSMatrix -0x000000019b74b000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSRayIntersector.framework/Versions/A/MPSRayIntersector -0x000000019b972000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSNDArray.framework/Versions/A/MPSNDArray -0x00000001ec760000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSFunctions.framework/Versions/A/MPSFunctions -0x00000001ec745000 /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSBenchmarkLoop.framework/Versions/A/MPSBenchmarkLoop -0x000000018fb54000 /System/Library/PrivateFrameworks/MetalTools.framework/Versions/A/MetalTools -0x00000001b91d7000 /System/Library/PrivateFrameworks/IOAccelMemoryInfo.framework/Versions/A/IOAccelMemoryInfo -0x00000001c52e0000 /System/Library/PrivateFrameworks/kperf.framework/Versions/A/kperf -0x00000001b4d1a000 /System/Library/PrivateFrameworks/GPURawCounter.framework/Versions/A/GPURawCounter -0x00000001a5415000 /System/Library/PrivateFrameworks/CoreSymbolication.framework/Versions/A/CoreSymbolication -0x00000001b4cc6000 /System/Library/PrivateFrameworks/MallocStackLogging.framework/Versions/A/MallocStackLogging -0x000000019d626000 /System/Library/PrivateFrameworks/CrashReporterSupport.framework/Versions/A/CrashReporterSupport -0x00000001a53d0000 /System/Library/PrivateFrameworks/DebugSymbols.framework/Versions/A/DebugSymbols -0x00000001c3c47000 /System/Library/PrivateFrameworks/OSAnalytics.framework/Versions/A/OSAnalytics -0x000000024d229000 /System/Library/PrivateFrameworks/VideoToolboxParavirtualizationSupport.framework/Versions/A/VideoToolboxParavirtualizationSupport -0x000000019d850000 /System/Library/PrivateFrameworks/AppleVA.framework/Versions/A/AppleVA -0x000000019f8ba000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS -0x0000000195849000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices -0x000000019e4fa000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/PrintCore -0x000000019fca4000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/QD.framework/Versions/A/QD -0x000000019fc98000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSyncLegacy.framework/Versions/A/ColorSyncLegacy -0x000000019f88a000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis -0x000000019e4b6000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATSUI.framework/Versions/A/ATSUI -0x000000019fc2b000 /usr/lib/libcups.2.dylib -0x00000001a0020000 /System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos -0x00000001a0031000 /System/Library/Frameworks/GSS.framework/Versions/A/GSS -0x000000019f939000 /usr/lib/libresolv.9.dylib -0x000000019da8c000 /System/Library/PrivateFrameworks/Heimdal.framework/Versions/A/Heimdal -0x00000001a74bc000 /System/Library/Frameworks/Kerberos.framework/Versions/A/Libraries/libHeimdalProxy.dylib -0x00000001a008b000 /System/Library/PrivateFrameworks/CommonAuth.framework/Versions/A/CommonAuth -0x00000001e9c6c000 /System/Library/Frameworks/AVFAudio.framework/Versions/A/AVFAudio -0x00000001af47e000 /System/Library/PrivateFrameworks/AXCoreUtilities.framework/Versions/A/AXCoreUtilities -0x000000023a274000 /System/Library/PrivateFrameworks/IsolatedCoreAudioClient.framework/Versions/A/IsolatedCoreAudioClient -0x000000019f7f6000 /System/Library/PrivateFrameworks/AudioSession.framework/Versions/A/AudioSession -0x00000001a1307000 /System/Library/Frameworks/IOBluetooth.framework/Versions/A/IOBluetooth -0x000000019d95b000 /System/Library/PrivateFrameworks/MediaExperience.framework/Versions/A/MediaExperience -0x000000019f635000 /System/Library/PrivateFrameworks/AudioSession.framework/libSessionUtility.dylib -0x000000019fcb0000 /System/Library/PrivateFrameworks/AudioResourceArbitration.framework/Versions/A/AudioResourceArbitration -0x00000001a4388000 /System/Library/PrivateFrameworks/PowerLog.framework/Versions/A/PowerLog -0x00000001a42a6000 /System/Library/Frameworks/CoreBluetooth.framework/Versions/A/CoreBluetooth -0x00000001a74bd000 /System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit -0x000000019b1e2000 /System/Library/PrivateFrameworks/CoreUtils.framework/Versions/A/CoreUtils -0x000000022de3f000 /System/Library/PrivateFrameworks/CoreUtilsExtras.framework/Versions/A/CoreUtilsExtras -0x0000000238b8a000 /System/Library/PrivateFrameworks/IO80211.framework/Versions/A/IO80211 -0x00000001a4f3e000 /System/Library/PrivateFrameworks/FrontBoardServices.framework/Versions/A/FrontBoardServices -0x00000001a6a85000 /System/Library/PrivateFrameworks/BackBoardServices.framework/Versions/A/BackBoardServices -0x000000019d8c2000 /System/Library/PrivateFrameworks/IconFoundation.framework/Versions/A/IconFoundation -0x00000001a3281000 /System/Library/PrivateFrameworks/SpeechRecognitionCore.framework/Versions/A/SpeechRecognitionCore -0x00000001af49d000 /usr/lib/libAccessibility.dylib -0x00000001a397b000 /System/Library/Frameworks/MediaAccessibility.framework/Versions/A/MediaAccessibility -0x00000001d49cc000 /System/Library/Frameworks/OSLog.framework/Versions/A/OSLog -0x00000001b4c54000 /System/Library/PrivateFrameworks/LoggingSupport.framework/Versions/A/LoggingSupport -0x000000010188c000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/server/libjvm.dylib -0x0000000100220000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjimage.dylib -0x0000000100280000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjdwp.dylib -0x00000001002cc000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libjava.dylib -0x000000010024c000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libinstrument.dylib -0x0000000100324000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libzip.dylib -0x0000000255d1b000 /usr/lib/i18n/libiconv_std.dylib -0x0000000255d03000 /usr/lib/i18n/libUTF8.dylib -0x0000000255d23000 /usr/lib/i18n/libmapper_none.dylib -0x00000001002fc000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libdt_socket.dylib -0x00000001005ac000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libnio.dylib -0x000000010058c000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libnet.dylib -0x000000010178c000 /Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/libsomelib.dylib -0x0000000100274000 /Users/cristina/Library/Java/JavaVirtualMachines/temurin-22.0.1/Contents/Home/lib/libsyslookup.dylib - - -VM Arguments: -jvm_args: -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:60599,suspend=y,server=n -ea -Didea.test.cyclic.buffer.size=1048576 -javaagent:/Users/cristina/Library/Caches/JetBrains/IdeaIC2024.1/captureAgent/debugger-agent.jar -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 -java_command: com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit5 dev.diplomattest.somelib.Float64VecTest,testFloat64Vec -java_class_path (initial): /Users/cristina/.m2/repository/org/junit/platform/junit-platform-launcher/1.10.3/junit-platform-launcher-1.10.3.jar:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/lib/idea_rt.jar:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/plugins/junit/lib/junit5-rt.jar:/Users/cristina/Applications/IntelliJ IDEA Community Edition.app/Contents/plugins/junit/lib/junit-rt.jar:/Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/target/test-classes:/Users/cristina/workspace/rust/diplomat/feature_tests/java/somelib/target/classes:/Users/cristina/.m2/repository/net/java/dev/jna/jna/5.14.0/jna-5.14.0.jar:/Users/cristina/.m2/repository/org/junit/jupiter/junit-jupiter/5.10.3/junit-jupiter-5.10.3.jar:/Users/cristina/.m2/repository/org/junit/jupiter/junit-jupiter-api/5.10.3/junit-jupiter-api-5.10.3.jar:/Users/cristina/.m2/repository/org/opentest4j/opentest4j/1.3.0/opentest4j-1.3.0.jar:/Users/cristina/.m2/repository/org/junit/platform/junit-platform-commons/1.10.3/junit-platform-commons-1.10.3.jar:/Users/cristina/.m2/repository/org/apiguardian/apiguardian-api/1.1.2/apiguardian-api-1.1.2.jar:/Users/cristina/.m2/repository/org/junit/jupiter/junit-jupiter-params/5.10.3/junit-jupiter-params-5.10.3.jar:/Users/cristina/.m2/repository/org/junit/jupiter/junit-jupiter-engine/5.10.3/junit-jupiter-engine-5.10.3.jar:/Users/cristina/.m2/repository/org/junit/platform/junit-platform-engine/1.10.3/junit-platform-engine-1.10.3.jar:/Users/cristina/.m2/repository/org/openjdk/jmh/jmh-core/1.37/jmh-core-1.37.jar:/Users/cristina/.m2/repository/net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4.jar:/Users/cristina/.m2/repository/org/apache/commons/commons-math3/3.6.1/commons-math3-3.6.1.jar:/Users/cristina/.m2/repository/org/openjdk/jmh/jmh-generator-annprocess/1.37/jmh-generator-annprocess-1.37.jar -Launcher Type: SUN_STANDARD - -[Global flags] - intx CICompilerCount = 4 {product} {ergonomic} - uint ConcGCThreads = 2 {product} {ergonomic} - uint G1ConcRefinementThreads = 8 {product} {ergonomic} - size_t G1HeapRegionSize = 2097152 {product} {ergonomic} - size_t InitialHeapSize = 268435456 {product} {ergonomic} - size_t MarkStackSize = 4194304 {product} {ergonomic} - size_t MaxHeapSize = 4294967296 {product} {ergonomic} - size_t MaxNewSize = 2575302656 {product} {ergonomic} - size_t MinHeapDeltaBytes = 2097152 {product} {ergonomic} - size_t MinHeapSize = 8388608 {product} {ergonomic} - uintx NonNMethodCodeHeapSize = 5839564 {pd product} {ergonomic} - uintx NonProfiledCodeHeapSize = 122909338 {pd product} {ergonomic} - uintx ProfiledCodeHeapSize = 122909338 {pd product} {ergonomic} - uintx ReservedCodeCacheSize = 251658240 {pd product} {ergonomic} - bool SegmentedCodeCache = true {product} {ergonomic} - size_t SoftMaxHeapSize = 4294967296 {manageable} {ergonomic} - bool UseCompressedOops = true {product lp64_product} {ergonomic} - bool UseG1GC = true {product} {ergonomic} - bool UseNUMA = false {product} {ergonomic} - bool UseNUMAInterleaving = false {product} {ergonomic} - -Logging: -Log output configuration: - #0: stdout all=warning uptime,level,tags foldmultilines=false - #1: stderr all=off uptime,level,tags foldmultilines=false - -Environment Variables: -JAVA_HOME=/Users/cristina/Library/Java/JavaVirtualMachines/corretto-19.0.1/Contents/Home/ -PATH=/Users/cristina/bin/jextract-22/bin:/bin:/Users/cristina/.modular/pkg/packages.modular.com_mojo/bin:/Users/cristina/Downloads/dart-sdk/bin:/opt/homebrew/Cellar/llvm/15.0.6/bin:/opt/homebrew/opt/openjdk/bin:/Users/cristina/.elan/bin:/Users/cristina/bin:/Users/cristina/Library/Application Support/Coursier/bin:/Users/cristina/Library/Python/3.8/bin:/Users/cristina/.local/bin:/Users/cristina/.cargo/bin:/Users/cristina/.cargo:/opt/homebrew/bin:/Users/cristina/.fzf/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/X11/bin:/Library/Apple/usr/bin:/usr/local/go/bin:/Library/TeX/texbin:/Users/cristina/.krew/bin -SHELL=/opt/homebrew/bin/fish -LC_CTYPE=en_US.UTF-8 -TMPDIR=/var/folders/x_/9qhndrhs79j640bxvmbkddfw0000gn/T/ - -Active Locale: -LC_ALL=C/en_US.UTF-8/C/C/C/C -LC_COLLATE=C -LC_CTYPE=en_US.UTF-8 -LC_MESSAGES=C -LC_MONETARY=C -LC_NUMERIC=C -LC_TIME=C - -Signal Handlers: - SIGSEGV: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_ONSTACK|SA_RESTART|SA_SIGINFO, unblocked - SIGBUS: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, unblocked - SIGFPE: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, unblocked - SIGPIPE: javaSignalHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked - SIGXFSZ: javaSignalHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked - SIGILL: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, unblocked - SIGUSR2: SR_handler in libjvm.dylib, mask=00100000000000000000000000000000, flags=SA_RESTART|SA_SIGINFO, blocked - SIGHUP: UserHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked - SIGINT: UserHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked - SIGTERM: UserHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked - SIGQUIT: UserHandler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, blocked - SIGTRAP: crash_handler in libjvm.dylib, mask=11100110000111110111111111111111, flags=SA_RESTART|SA_SIGINFO, unblocked - - -Periodic native trim disabled - ---------------- S Y S T E M --------------- - -OS: -uname: Darwin 23.5.0 Darwin Kernel Version 23.5.0: Wed May 1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000 arm64 -OS uptime: 45 days 10:07 hours -rlimit (soft/hard): STACK 8176k/65520k , CORE 0k/infinity , NPROC 2666/4000 , NOFILE 10240/infinity , AS infinity/infinity , CPU infinity/infinity , DATA infinity/infinity , FSIZE infinity/infinity , MEMLOCK infinity/infinity , RSS infinity/infinity -load average: 4.26 4.45 4.49 - -CPU: total 8 (initial active 8) 0x61:0x0:0x1b588bb3:0, fp, asimd, aes, pmull, sha1, sha256, crc32, lse, sha3, sha512 -machdep.cpu.brand_string:Apple M1 Pro -hw.cachelinesize:128 -hw.l1icachesize:131072 -hw.l1dcachesize:65536 -hw.l2cachesize:4194304 - -Memory: 16k page, physical 16777216k(40864k free), swap 3145728k(1371968k free) - -vm_info: OpenJDK 64-Bit Server VM (22.0.1+8) for bsd-aarch64 JRE (22.0.1+8), built on 2024-04-16T00:00:00Z by "admin" with clang Apple LLVM 15.0.0 (clang-1500.1.0.2.5) - -END. diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Foo.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Foo.java index 0bd943b4c..8f5e3ae19 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Foo.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Foo.java @@ -63,27 +63,6 @@ public static Foo new_(String x) { } } - public static Foo newStatic(String x) { - - try (var arena = Arena.ofConfined()) { - var xData= arena.allocateFrom(x, StandardCharsets.UTF_8); - var xLen = xData.byteSize() - 1; - var xView = DiplomatStringView.allocate(arena); - DiplomatStringView.len(xView, xLen); - DiplomatStringView.data(xView, xData); - var nativeVal = somelib_h.Foo_new_static(xView); - List selfEdges = List.of(); - - - - List aEdges = List.of(); - var returnVal = new Foo(nativeVal, selfEdges, aEdges); - var cleaner = new Foo.FooCleaner(nativeVal); - returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); - return returnVal; - } - } - public static Foo extractFromFields(BorrowedFields fields) { var fieldsNative = fields.internal; diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/BorrowedFieldsReturning_option.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/BorrowedFieldsReturning_option.java new file mode 100644 index 000000000..d58dc9971 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/BorrowedFieldsReturning_option.java @@ -0,0 +1,178 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct BorrowedFieldsReturning_option { + * union { + * BorrowedFieldsReturning ok; + * }; + * bool is_ok; + * } + * } + */ +public class BorrowedFieldsReturning_option { + + BorrowedFieldsReturning_option() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.unionLayout( + BorrowedFieldsReturning.layout().withName("ok") + ).withName("$anon$18:48"), + somelib_h.C_BOOL.withName("is_ok"), + MemoryLayout.paddingLayout(7) + ).withName("BorrowedFieldsReturning_option"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final GroupLayout ok$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$18:48"), groupElement("ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * BorrowedFieldsReturning ok + * } + */ + public static final GroupLayout ok$layout() { + return ok$LAYOUT; + } + + private static final long ok$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * BorrowedFieldsReturning ok + * } + */ + public static final long ok$offset() { + return ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * BorrowedFieldsReturning ok + * } + */ + public static MemorySegment ok(MemorySegment struct) { + return struct.asSlice(ok$OFFSET, ok$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * BorrowedFieldsReturning ok + * } + */ + public static void ok(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, ok$OFFSET, ok$LAYOUT.byteSize()); + } + + private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final OfBoolean is_ok$layout() { + return is_ok$LAYOUT; + } + + private static final long is_ok$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final long is_ok$offset() { + return is_ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static boolean is_ok(MemorySegment struct) { + return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static void is_ok(MemorySegment struct, boolean fieldValue) { + struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/BorrowedFieldsWithBounds_option.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/BorrowedFieldsWithBounds_option.java new file mode 100644 index 000000000..c48810c81 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/BorrowedFieldsWithBounds_option.java @@ -0,0 +1,178 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct BorrowedFieldsWithBounds_option { + * union { + * BorrowedFieldsWithBounds ok; + * }; + * bool is_ok; + * } + * } + */ +public class BorrowedFieldsWithBounds_option { + + BorrowedFieldsWithBounds_option() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.unionLayout( + BorrowedFieldsWithBounds.layout().withName("ok") + ).withName("$anon$20:49"), + somelib_h.C_BOOL.withName("is_ok"), + MemoryLayout.paddingLayout(7) + ).withName("BorrowedFieldsWithBounds_option"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final GroupLayout ok$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$20:49"), groupElement("ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * BorrowedFieldsWithBounds ok + * } + */ + public static final GroupLayout ok$layout() { + return ok$LAYOUT; + } + + private static final long ok$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * BorrowedFieldsWithBounds ok + * } + */ + public static final long ok$offset() { + return ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * BorrowedFieldsWithBounds ok + * } + */ + public static MemorySegment ok(MemorySegment struct) { + return struct.asSlice(ok$OFFSET, ok$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * BorrowedFieldsWithBounds ok + * } + */ + public static void ok(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, ok$OFFSET, ok$LAYOUT.byteSize()); + } + + private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final OfBoolean is_ok$layout() { + return is_ok$LAYOUT; + } + + private static final long is_ok$OFFSET = 48; + + /** + * Offset for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final long is_ok$offset() { + return is_ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static boolean is_ok(MemorySegment struct) { + return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static void is_ok(MemorySegment struct, boolean fieldValue) { + struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/BorrowedFields_option.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/BorrowedFields_option.java new file mode 100644 index 000000000..0ff95dbac --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/BorrowedFields_option.java @@ -0,0 +1,178 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct BorrowedFields_option { + * union { + * BorrowedFields ok; + * }; + * bool is_ok; + * } + * } + */ +public class BorrowedFields_option { + + BorrowedFields_option() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.unionLayout( + BorrowedFields.layout().withName("ok") + ).withName("$anon$20:39"), + somelib_h.C_BOOL.withName("is_ok"), + MemoryLayout.paddingLayout(7) + ).withName("BorrowedFields_option"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final GroupLayout ok$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$20:39"), groupElement("ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * BorrowedFields ok + * } + */ + public static final GroupLayout ok$layout() { + return ok$LAYOUT; + } + + private static final long ok$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * BorrowedFields ok + * } + */ + public static final long ok$offset() { + return ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * BorrowedFields ok + * } + */ + public static MemorySegment ok(MemorySegment struct) { + return struct.asSlice(ok$OFFSET, ok$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * BorrowedFields ok + * } + */ + public static void ok(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, ok$OFFSET, ok$LAYOUT.byteSize()); + } + + private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final OfBoolean is_ok$layout() { + return is_ok$LAYOUT; + } + + private static final long is_ok$OFFSET = 48; + + /** + * Offset for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final long is_ok$offset() { + return is_ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static boolean is_ok(MemorySegment struct) { + return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static void is_ok(MemorySegment struct, boolean fieldValue) { + struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ContiguousEnum_option.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ContiguousEnum_option.java new file mode 100644 index 000000000..9a2a391cb --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ContiguousEnum_option.java @@ -0,0 +1,178 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct ContiguousEnum_option { + * union { + * ContiguousEnum ok; + * }; + * bool is_ok; + * } + * } + */ +public class ContiguousEnum_option { + + ContiguousEnum_option() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.unionLayout( + somelib_h.C_INT.withName("ok") + ).withName("$anon$21:39"), + somelib_h.C_BOOL.withName("is_ok"), + MemoryLayout.paddingLayout(3) + ).withName("ContiguousEnum_option"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt ok$LAYOUT = (OfInt)$LAYOUT.select(groupElement("$anon$21:39"), groupElement("ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * ContiguousEnum ok + * } + */ + public static final OfInt ok$layout() { + return ok$LAYOUT; + } + + private static final long ok$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * ContiguousEnum ok + * } + */ + public static final long ok$offset() { + return ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * ContiguousEnum ok + * } + */ + public static int ok(MemorySegment struct) { + return struct.get(ok$LAYOUT, ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * ContiguousEnum ok + * } + */ + public static void ok(MemorySegment struct, int fieldValue) { + struct.set(ok$LAYOUT, ok$OFFSET, fieldValue); + } + + private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final OfBoolean is_ok$layout() { + return is_ok$LAYOUT; + } + + private static final long is_ok$OFFSET = 4; + + /** + * Offset for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final long is_ok$offset() { + return is_ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static boolean is_ok(MemorySegment struct) { + return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static void is_ok(MemorySegment struct, boolean fieldValue) { + struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/CyclicStructA_option.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/CyclicStructA_option.java new file mode 100644 index 000000000..7a58e5d6b --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/CyclicStructA_option.java @@ -0,0 +1,177 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct CyclicStructA_option { + * union { + * CyclicStructA ok; + * }; + * bool is_ok; + * } + * } + */ +public class CyclicStructA_option { + + CyclicStructA_option() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.unionLayout( + CyclicStructA.layout().withName("ok") + ).withName("$anon$19:38"), + somelib_h.C_BOOL.withName("is_ok") + ).withName("CyclicStructA_option"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final GroupLayout ok$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$19:38"), groupElement("ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * CyclicStructA ok + * } + */ + public static final GroupLayout ok$layout() { + return ok$LAYOUT; + } + + private static final long ok$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * CyclicStructA ok + * } + */ + public static final long ok$offset() { + return ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * CyclicStructA ok + * } + */ + public static MemorySegment ok(MemorySegment struct) { + return struct.asSlice(ok$OFFSET, ok$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * CyclicStructA ok + * } + */ + public static void ok(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, ok$OFFSET, ok$LAYOUT.byteSize()); + } + + private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final OfBoolean is_ok$layout() { + return is_ok$LAYOUT; + } + + private static final long is_ok$OFFSET = 1; + + /** + * Offset for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final long is_ok$offset() { + return is_ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static boolean is_ok(MemorySegment struct) { + return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static void is_ok(MemorySegment struct, boolean fieldValue) { + struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/CyclicStructB_option.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/CyclicStructB_option.java new file mode 100644 index 000000000..476c4557a --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/CyclicStructB_option.java @@ -0,0 +1,177 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct CyclicStructB_option { + * union { + * CyclicStructB ok; + * }; + * bool is_ok; + * } + * } + */ +public class CyclicStructB_option { + + CyclicStructB_option() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.unionLayout( + CyclicStructB.layout().withName("ok") + ).withName("$anon$18:38"), + somelib_h.C_BOOL.withName("is_ok") + ).withName("CyclicStructB_option"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final GroupLayout ok$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$18:38"), groupElement("ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * CyclicStructB ok + * } + */ + public static final GroupLayout ok$layout() { + return ok$LAYOUT; + } + + private static final long ok$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * CyclicStructB ok + * } + */ + public static final long ok$offset() { + return ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * CyclicStructB ok + * } + */ + public static MemorySegment ok(MemorySegment struct) { + return struct.asSlice(ok$OFFSET, ok$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * CyclicStructB ok + * } + */ + public static void ok(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, ok$OFFSET, ok$LAYOUT.byteSize()); + } + + private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final OfBoolean is_ok$layout() { + return is_ok$LAYOUT; + } + + private static final long is_ok$OFFSET = 1; + + /** + * Offset for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final long is_ok$offset() { + return is_ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static boolean is_ok(MemorySegment struct) { + return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static void is_ok(MemorySegment struct, boolean fieldValue) { + struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ErrorEnum_option.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ErrorEnum_option.java new file mode 100644 index 000000000..9652da70b --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ErrorEnum_option.java @@ -0,0 +1,178 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct ErrorEnum_option { + * union { + * ErrorEnum ok; + * }; + * bool is_ok; + * } + * } + */ +public class ErrorEnum_option { + + ErrorEnum_option() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.unionLayout( + somelib_h.C_INT.withName("ok") + ).withName("$anon$19:34"), + somelib_h.C_BOOL.withName("is_ok"), + MemoryLayout.paddingLayout(3) + ).withName("ErrorEnum_option"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt ok$LAYOUT = (OfInt)$LAYOUT.select(groupElement("$anon$19:34"), groupElement("ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * ErrorEnum ok + * } + */ + public static final OfInt ok$layout() { + return ok$LAYOUT; + } + + private static final long ok$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * ErrorEnum ok + * } + */ + public static final long ok$offset() { + return ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * ErrorEnum ok + * } + */ + public static int ok(MemorySegment struct) { + return struct.get(ok$LAYOUT, ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * ErrorEnum ok + * } + */ + public static void ok(MemorySegment struct, int fieldValue) { + struct.set(ok$LAYOUT, ok$OFFSET, fieldValue); + } + + private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final OfBoolean is_ok$layout() { + return is_ok$LAYOUT; + } + + private static final long is_ok$OFFSET = 4; + + /** + * Offset for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final long is_ok$offset() { + return is_ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static boolean is_ok(MemorySegment struct) { + return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static void is_ok(MemorySegment struct, boolean fieldValue) { + struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ErrorStruct_option.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ErrorStruct_option.java new file mode 100644 index 000000000..5764466b1 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ErrorStruct_option.java @@ -0,0 +1,178 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct ErrorStruct_option { + * union { + * ErrorStruct ok; + * }; + * bool is_ok; + * } + * } + */ +public class ErrorStruct_option { + + ErrorStruct_option() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.unionLayout( + ErrorStruct.layout().withName("ok") + ).withName("$anon$19:36"), + somelib_h.C_BOOL.withName("is_ok"), + MemoryLayout.paddingLayout(3) + ).withName("ErrorStruct_option"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final GroupLayout ok$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$19:36"), groupElement("ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * ErrorStruct ok + * } + */ + public static final GroupLayout ok$layout() { + return ok$LAYOUT; + } + + private static final long ok$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * ErrorStruct ok + * } + */ + public static final long ok$offset() { + return ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * ErrorStruct ok + * } + */ + public static MemorySegment ok(MemorySegment struct) { + return struct.asSlice(ok$OFFSET, ok$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * ErrorStruct ok + * } + */ + public static void ok(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, ok$OFFSET, ok$LAYOUT.byteSize()); + } + + private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final OfBoolean is_ok$layout() { + return is_ok$LAYOUT; + } + + private static final long is_ok$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final long is_ok$offset() { + return is_ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static boolean is_ok(MemorySegment struct) { + return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static void is_ok(MemorySegment struct, boolean fieldValue) { + struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ImportedStruct_option.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ImportedStruct_option.java new file mode 100644 index 000000000..37243ec7f --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/ImportedStruct_option.java @@ -0,0 +1,178 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct ImportedStruct_option { + * union { + * ImportedStruct ok; + * }; + * bool is_ok; + * } + * } + */ +public class ImportedStruct_option { + + ImportedStruct_option() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.unionLayout( + ImportedStruct.layout().withName("ok") + ).withName("$anon$20:39"), + somelib_h.C_BOOL.withName("is_ok"), + MemoryLayout.paddingLayout(3) + ).withName("ImportedStruct_option"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final GroupLayout ok$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$20:39"), groupElement("ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * ImportedStruct ok + * } + */ + public static final GroupLayout ok$layout() { + return ok$LAYOUT; + } + + private static final long ok$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * ImportedStruct ok + * } + */ + public static final long ok$offset() { + return ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * ImportedStruct ok + * } + */ + public static MemorySegment ok(MemorySegment struct) { + return struct.asSlice(ok$OFFSET, ok$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * ImportedStruct ok + * } + */ + public static void ok(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, ok$OFFSET, ok$LAYOUT.byteSize()); + } + + private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final OfBoolean is_ok$layout() { + return is_ok$LAYOUT; + } + + private static final long is_ok$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final long is_ok$offset() { + return is_ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static boolean is_ok(MemorySegment struct) { + return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static void is_ok(MemorySegment struct, boolean fieldValue) { + struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/MyEnum_option.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/MyEnum_option.java new file mode 100644 index 000000000..69c0811c6 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/MyEnum_option.java @@ -0,0 +1,178 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct MyEnum_option { + * union { + * MyEnum ok; + * }; + * bool is_ok; + * } + * } + */ +public class MyEnum_option { + + MyEnum_option() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.unionLayout( + somelib_h.C_INT.withName("ok") + ).withName("$anon$23:31"), + somelib_h.C_BOOL.withName("is_ok"), + MemoryLayout.paddingLayout(3) + ).withName("MyEnum_option"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt ok$LAYOUT = (OfInt)$LAYOUT.select(groupElement("$anon$23:31"), groupElement("ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * MyEnum ok + * } + */ + public static final OfInt ok$layout() { + return ok$LAYOUT; + } + + private static final long ok$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * MyEnum ok + * } + */ + public static final long ok$offset() { + return ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * MyEnum ok + * } + */ + public static int ok(MemorySegment struct) { + return struct.get(ok$LAYOUT, ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * MyEnum ok + * } + */ + public static void ok(MemorySegment struct, int fieldValue) { + struct.set(ok$LAYOUT, ok$OFFSET, fieldValue); + } + + private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final OfBoolean is_ok$layout() { + return is_ok$LAYOUT; + } + + private static final long is_ok$OFFSET = 4; + + /** + * Offset for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final long is_ok$offset() { + return is_ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static boolean is_ok(MemorySegment struct) { + return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static void is_ok(MemorySegment struct, boolean fieldValue) { + struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/MyStruct_option.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/MyStruct_option.java new file mode 100644 index 000000000..25582a41a --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/MyStruct_option.java @@ -0,0 +1,178 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct MyStruct_option { + * union { + * MyStruct ok; + * }; + * bool is_ok; + * } + * } + */ +public class MyStruct_option { + + MyStruct_option() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.unionLayout( + MyStruct.layout().withName("ok") + ).withName("$anon$25:33"), + somelib_h.C_BOOL.withName("is_ok"), + MemoryLayout.paddingLayout(7) + ).withName("MyStruct_option"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final GroupLayout ok$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$25:33"), groupElement("ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * MyStruct ok + * } + */ + public static final GroupLayout ok$layout() { + return ok$LAYOUT; + } + + private static final long ok$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * MyStruct ok + * } + */ + public static final long ok$offset() { + return ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * MyStruct ok + * } + */ + public static MemorySegment ok(MemorySegment struct) { + return struct.asSlice(ok$OFFSET, ok$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * MyStruct ok + * } + */ + public static void ok(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, ok$OFFSET, ok$LAYOUT.byteSize()); + } + + private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final OfBoolean is_ok$layout() { + return is_ok$LAYOUT; + } + + private static final long is_ok$OFFSET = 32; + + /** + * Offset for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final long is_ok$offset() { + return is_ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static boolean is_ok(MemorySegment struct) { + return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static void is_ok(MemorySegment struct, boolean fieldValue) { + struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/NestedBorrowedFields_option.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/NestedBorrowedFields_option.java new file mode 100644 index 000000000..519f9bd4d --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/NestedBorrowedFields_option.java @@ -0,0 +1,178 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct NestedBorrowedFields_option { + * union { + * NestedBorrowedFields ok; + * }; + * bool is_ok; + * } + * } + */ +public class NestedBorrowedFields_option { + + NestedBorrowedFields_option() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.unionLayout( + NestedBorrowedFields.layout().withName("ok") + ).withName("$anon$22:45"), + somelib_h.C_BOOL.withName("is_ok"), + MemoryLayout.paddingLayout(7) + ).withName("NestedBorrowedFields_option"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final GroupLayout ok$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$22:45"), groupElement("ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * NestedBorrowedFields ok + * } + */ + public static final GroupLayout ok$layout() { + return ok$LAYOUT; + } + + private static final long ok$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * NestedBorrowedFields ok + * } + */ + public static final long ok$offset() { + return ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * NestedBorrowedFields ok + * } + */ + public static MemorySegment ok(MemorySegment struct) { + return struct.asSlice(ok$OFFSET, ok$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * NestedBorrowedFields ok + * } + */ + public static void ok(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, ok$OFFSET, ok$LAYOUT.byteSize()); + } + + private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final OfBoolean is_ok$layout() { + return is_ok$LAYOUT; + } + + private static final long is_ok$OFFSET = 144; + + /** + * Offset for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final long is_ok$offset() { + return is_ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static boolean is_ok(MemorySegment struct) { + return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static void is_ok(MemorySegment struct, boolean fieldValue) { + struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionBool.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionBool.java new file mode 100644 index 000000000..d5b76f4cd --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionBool.java @@ -0,0 +1,177 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct OptionBool { + * union { + * bool ok; + * }; + * bool is_ok; + * } + * } + */ +public class OptionBool { + + OptionBool() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.unionLayout( + somelib_h.C_BOOL.withName("ok") + ).withName("$anon$65:1"), + somelib_h.C_BOOL.withName("is_ok") + ).withName("OptionBool"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfBoolean ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("$anon$65:1"), groupElement("ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool ok + * } + */ + public static final OfBoolean ok$layout() { + return ok$LAYOUT; + } + + private static final long ok$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * bool ok + * } + */ + public static final long ok$offset() { + return ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool ok + * } + */ + public static boolean ok(MemorySegment struct) { + return struct.get(ok$LAYOUT, ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool ok + * } + */ + public static void ok(MemorySegment struct, boolean fieldValue) { + struct.set(ok$LAYOUT, ok$OFFSET, fieldValue); + } + + private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final OfBoolean is_ok$layout() { + return is_ok$LAYOUT; + } + + private static final long is_ok$OFFSET = 1; + + /** + * Offset for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final long is_ok$offset() { + return is_ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static boolean is_ok(MemorySegment struct) { + return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static void is_ok(MemorySegment struct, boolean fieldValue) { + struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionChar.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionChar.java new file mode 100644 index 000000000..725e7a3fa --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionChar.java @@ -0,0 +1,178 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct OptionChar { + * union { + * char32_t ok; + * }; + * bool is_ok; + * } + * } + */ +public class OptionChar { + + OptionChar() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.unionLayout( + somelib_h.C_INT.withName("ok") + ).withName("$anon$66:1"), + somelib_h.C_BOOL.withName("is_ok"), + MemoryLayout.paddingLayout(3) + ).withName("OptionChar"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt ok$LAYOUT = (OfInt)$LAYOUT.select(groupElement("$anon$66:1"), groupElement("ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * char32_t ok + * } + */ + public static final OfInt ok$layout() { + return ok$LAYOUT; + } + + private static final long ok$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * char32_t ok + * } + */ + public static final long ok$offset() { + return ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * char32_t ok + * } + */ + public static int ok(MemorySegment struct) { + return struct.get(ok$LAYOUT, ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * char32_t ok + * } + */ + public static void ok(MemorySegment struct, int fieldValue) { + struct.set(ok$LAYOUT, ok$OFFSET, fieldValue); + } + + private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final OfBoolean is_ok$layout() { + return is_ok$LAYOUT; + } + + private static final long is_ok$OFFSET = 4; + + /** + * Offset for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final long is_ok$offset() { + return is_ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static boolean is_ok(MemorySegment struct) { + return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static void is_ok(MemorySegment struct, boolean fieldValue) { + struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionF32.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionF32.java new file mode 100644 index 000000000..3676aad43 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionF32.java @@ -0,0 +1,178 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct OptionF32 { + * union { + * float ok; + * }; + * bool is_ok; + * } + * } + */ +public class OptionF32 { + + OptionF32() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.unionLayout( + somelib_h.C_FLOAT.withName("ok") + ).withName("$anon$63:1"), + somelib_h.C_BOOL.withName("is_ok"), + MemoryLayout.paddingLayout(3) + ).withName("OptionF32"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfFloat ok$LAYOUT = (OfFloat)$LAYOUT.select(groupElement("$anon$63:1"), groupElement("ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * float ok + * } + */ + public static final OfFloat ok$layout() { + return ok$LAYOUT; + } + + private static final long ok$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * float ok + * } + */ + public static final long ok$offset() { + return ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * float ok + * } + */ + public static float ok(MemorySegment struct) { + return struct.get(ok$LAYOUT, ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * float ok + * } + */ + public static void ok(MemorySegment struct, float fieldValue) { + struct.set(ok$LAYOUT, ok$OFFSET, fieldValue); + } + + private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final OfBoolean is_ok$layout() { + return is_ok$LAYOUT; + } + + private static final long is_ok$OFFSET = 4; + + /** + * Offset for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final long is_ok$offset() { + return is_ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static boolean is_ok(MemorySegment struct) { + return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static void is_ok(MemorySegment struct, boolean fieldValue) { + struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionF64.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionF64.java new file mode 100644 index 000000000..c22989953 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionF64.java @@ -0,0 +1,178 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct OptionF64 { + * union { + * double ok; + * }; + * bool is_ok; + * } + * } + */ +public class OptionF64 { + + OptionF64() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.unionLayout( + somelib_h.C_DOUBLE.withName("ok") + ).withName("$anon$64:1"), + somelib_h.C_BOOL.withName("is_ok"), + MemoryLayout.paddingLayout(7) + ).withName("OptionF64"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfDouble ok$LAYOUT = (OfDouble)$LAYOUT.select(groupElement("$anon$64:1"), groupElement("ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * double ok + * } + */ + public static final OfDouble ok$layout() { + return ok$LAYOUT; + } + + private static final long ok$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * double ok + * } + */ + public static final long ok$offset() { + return ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * double ok + * } + */ + public static double ok(MemorySegment struct) { + return struct.get(ok$LAYOUT, ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * double ok + * } + */ + public static void ok(MemorySegment struct, double fieldValue) { + struct.set(ok$LAYOUT, ok$OFFSET, fieldValue); + } + + private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final OfBoolean is_ok$layout() { + return is_ok$LAYOUT; + } + + private static final long is_ok$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final long is_ok$offset() { + return is_ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static boolean is_ok(MemorySegment struct) { + return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static void is_ok(MemorySegment struct, boolean fieldValue) { + struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionI16.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionI16.java new file mode 100644 index 000000000..05771e5f9 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionI16.java @@ -0,0 +1,178 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct OptionI16 { + * union { + * int16_t ok; + * }; + * bool is_ok; + * } + * } + */ +public class OptionI16 { + + OptionI16() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.unionLayout( + somelib_h.C_SHORT.withName("ok") + ).withName("$anon$55:1"), + somelib_h.C_BOOL.withName("is_ok"), + MemoryLayout.paddingLayout(1) + ).withName("OptionI16"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfShort ok$LAYOUT = (OfShort)$LAYOUT.select(groupElement("$anon$55:1"), groupElement("ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * int16_t ok + * } + */ + public static final OfShort ok$layout() { + return ok$LAYOUT; + } + + private static final long ok$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * int16_t ok + * } + */ + public static final long ok$offset() { + return ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int16_t ok + * } + */ + public static short ok(MemorySegment struct) { + return struct.get(ok$LAYOUT, ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int16_t ok + * } + */ + public static void ok(MemorySegment struct, short fieldValue) { + struct.set(ok$LAYOUT, ok$OFFSET, fieldValue); + } + + private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final OfBoolean is_ok$layout() { + return is_ok$LAYOUT; + } + + private static final long is_ok$OFFSET = 2; + + /** + * Offset for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final long is_ok$offset() { + return is_ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static boolean is_ok(MemorySegment struct) { + return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static void is_ok(MemorySegment struct, boolean fieldValue) { + struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionI32.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionI32.java new file mode 100644 index 000000000..e551c461a --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionI32.java @@ -0,0 +1,178 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct OptionI32 { + * union { + * int32_t ok; + * }; + * bool is_ok; + * } + * } + */ +public class OptionI32 { + + OptionI32() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.unionLayout( + somelib_h.C_INT.withName("ok") + ).withName("$anon$57:1"), + somelib_h.C_BOOL.withName("is_ok"), + MemoryLayout.paddingLayout(3) + ).withName("OptionI32"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt ok$LAYOUT = (OfInt)$LAYOUT.select(groupElement("$anon$57:1"), groupElement("ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * int32_t ok + * } + */ + public static final OfInt ok$layout() { + return ok$LAYOUT; + } + + private static final long ok$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * int32_t ok + * } + */ + public static final long ok$offset() { + return ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int32_t ok + * } + */ + public static int ok(MemorySegment struct) { + return struct.get(ok$LAYOUT, ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int32_t ok + * } + */ + public static void ok(MemorySegment struct, int fieldValue) { + struct.set(ok$LAYOUT, ok$OFFSET, fieldValue); + } + + private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final OfBoolean is_ok$layout() { + return is_ok$LAYOUT; + } + + private static final long is_ok$OFFSET = 4; + + /** + * Offset for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final long is_ok$offset() { + return is_ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static boolean is_ok(MemorySegment struct) { + return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static void is_ok(MemorySegment struct, boolean fieldValue) { + struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionI64.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionI64.java new file mode 100644 index 000000000..df7b61d24 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionI64.java @@ -0,0 +1,178 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct OptionI64 { + * union { + * int64_t ok; + * }; + * bool is_ok; + * } + * } + */ +public class OptionI64 { + + OptionI64() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.unionLayout( + somelib_h.C_LONG_LONG.withName("ok") + ).withName("$anon$59:1"), + somelib_h.C_BOOL.withName("is_ok"), + MemoryLayout.paddingLayout(7) + ).withName("OptionI64"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong ok$LAYOUT = (OfLong)$LAYOUT.select(groupElement("$anon$59:1"), groupElement("ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * int64_t ok + * } + */ + public static final OfLong ok$layout() { + return ok$LAYOUT; + } + + private static final long ok$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * int64_t ok + * } + */ + public static final long ok$offset() { + return ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int64_t ok + * } + */ + public static long ok(MemorySegment struct) { + return struct.get(ok$LAYOUT, ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int64_t ok + * } + */ + public static void ok(MemorySegment struct, long fieldValue) { + struct.set(ok$LAYOUT, ok$OFFSET, fieldValue); + } + + private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final OfBoolean is_ok$layout() { + return is_ok$LAYOUT; + } + + private static final long is_ok$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final long is_ok$offset() { + return is_ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static boolean is_ok(MemorySegment struct) { + return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static void is_ok(MemorySegment struct, boolean fieldValue) { + struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionI8.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionI8.java new file mode 100644 index 000000000..b7326e6f4 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionI8.java @@ -0,0 +1,177 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct OptionI8 { + * union { + * int8_t ok; + * }; + * bool is_ok; + * } + * } + */ +public class OptionI8 { + + OptionI8() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.unionLayout( + somelib_h.C_CHAR.withName("ok") + ).withName("$anon$53:1"), + somelib_h.C_BOOL.withName("is_ok") + ).withName("OptionI8"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfByte ok$LAYOUT = (OfByte)$LAYOUT.select(groupElement("$anon$53:1"), groupElement("ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * int8_t ok + * } + */ + public static final OfByte ok$layout() { + return ok$LAYOUT; + } + + private static final long ok$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * int8_t ok + * } + */ + public static final long ok$offset() { + return ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int8_t ok + * } + */ + public static byte ok(MemorySegment struct) { + return struct.get(ok$LAYOUT, ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int8_t ok + * } + */ + public static void ok(MemorySegment struct, byte fieldValue) { + struct.set(ok$LAYOUT, ok$OFFSET, fieldValue); + } + + private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final OfBoolean is_ok$layout() { + return is_ok$LAYOUT; + } + + private static final long is_ok$OFFSET = 1; + + /** + * Offset for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final long is_ok$offset() { + return is_ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static boolean is_ok(MemorySegment struct) { + return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static void is_ok(MemorySegment struct, boolean fieldValue) { + struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionIsize.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionIsize.java new file mode 100644 index 000000000..14b7355f8 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionIsize.java @@ -0,0 +1,178 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct OptionIsize { + * union { + * intptr_t ok; + * }; + * bool is_ok; + * } + * } + */ +public class OptionIsize { + + OptionIsize() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.unionLayout( + somelib_h.C_LONG.withName("ok") + ).withName("$anon$61:1"), + somelib_h.C_BOOL.withName("is_ok"), + MemoryLayout.paddingLayout(7) + ).withName("OptionIsize"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong ok$LAYOUT = (OfLong)$LAYOUT.select(groupElement("$anon$61:1"), groupElement("ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * intptr_t ok + * } + */ + public static final OfLong ok$layout() { + return ok$LAYOUT; + } + + private static final long ok$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * intptr_t ok + * } + */ + public static final long ok$offset() { + return ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * intptr_t ok + * } + */ + public static long ok(MemorySegment struct) { + return struct.get(ok$LAYOUT, ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * intptr_t ok + * } + */ + public static void ok(MemorySegment struct, long fieldValue) { + struct.set(ok$LAYOUT, ok$OFFSET, fieldValue); + } + + private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final OfBoolean is_ok$layout() { + return is_ok$LAYOUT; + } + + private static final long is_ok$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final long is_ok$offset() { + return is_ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static boolean is_ok(MemorySegment struct) { + return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static void is_ok(MemorySegment struct, boolean fieldValue) { + struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionU16.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionU16.java new file mode 100644 index 000000000..9e96cb085 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionU16.java @@ -0,0 +1,178 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct OptionU16 { + * union { + * uint16_t ok; + * }; + * bool is_ok; + * } + * } + */ +public class OptionU16 { + + OptionU16() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.unionLayout( + somelib_h.C_SHORT.withName("ok") + ).withName("$anon$56:1"), + somelib_h.C_BOOL.withName("is_ok"), + MemoryLayout.paddingLayout(1) + ).withName("OptionU16"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfShort ok$LAYOUT = (OfShort)$LAYOUT.select(groupElement("$anon$56:1"), groupElement("ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * uint16_t ok + * } + */ + public static final OfShort ok$layout() { + return ok$LAYOUT; + } + + private static final long ok$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * uint16_t ok + * } + */ + public static final long ok$offset() { + return ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * uint16_t ok + * } + */ + public static short ok(MemorySegment struct) { + return struct.get(ok$LAYOUT, ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * uint16_t ok + * } + */ + public static void ok(MemorySegment struct, short fieldValue) { + struct.set(ok$LAYOUT, ok$OFFSET, fieldValue); + } + + private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final OfBoolean is_ok$layout() { + return is_ok$LAYOUT; + } + + private static final long is_ok$OFFSET = 2; + + /** + * Offset for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final long is_ok$offset() { + return is_ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static boolean is_ok(MemorySegment struct) { + return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static void is_ok(MemorySegment struct, boolean fieldValue) { + struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionU32.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionU32.java new file mode 100644 index 000000000..cbf82c4ec --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionU32.java @@ -0,0 +1,178 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct OptionU32 { + * union { + * uint32_t ok; + * }; + * bool is_ok; + * } + * } + */ +public class OptionU32 { + + OptionU32() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.unionLayout( + somelib_h.C_INT.withName("ok") + ).withName("$anon$58:1"), + somelib_h.C_BOOL.withName("is_ok"), + MemoryLayout.paddingLayout(3) + ).withName("OptionU32"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt ok$LAYOUT = (OfInt)$LAYOUT.select(groupElement("$anon$58:1"), groupElement("ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * uint32_t ok + * } + */ + public static final OfInt ok$layout() { + return ok$LAYOUT; + } + + private static final long ok$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * uint32_t ok + * } + */ + public static final long ok$offset() { + return ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * uint32_t ok + * } + */ + public static int ok(MemorySegment struct) { + return struct.get(ok$LAYOUT, ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * uint32_t ok + * } + */ + public static void ok(MemorySegment struct, int fieldValue) { + struct.set(ok$LAYOUT, ok$OFFSET, fieldValue); + } + + private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final OfBoolean is_ok$layout() { + return is_ok$LAYOUT; + } + + private static final long is_ok$OFFSET = 4; + + /** + * Offset for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final long is_ok$offset() { + return is_ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static boolean is_ok(MemorySegment struct) { + return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static void is_ok(MemorySegment struct, boolean fieldValue) { + struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionU64.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionU64.java new file mode 100644 index 000000000..612971fac --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionU64.java @@ -0,0 +1,178 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct OptionU64 { + * union { + * uint64_t ok; + * }; + * bool is_ok; + * } + * } + */ +public class OptionU64 { + + OptionU64() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.unionLayout( + somelib_h.C_LONG_LONG.withName("ok") + ).withName("$anon$60:1"), + somelib_h.C_BOOL.withName("is_ok"), + MemoryLayout.paddingLayout(7) + ).withName("OptionU64"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong ok$LAYOUT = (OfLong)$LAYOUT.select(groupElement("$anon$60:1"), groupElement("ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * uint64_t ok + * } + */ + public static final OfLong ok$layout() { + return ok$LAYOUT; + } + + private static final long ok$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * uint64_t ok + * } + */ + public static final long ok$offset() { + return ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * uint64_t ok + * } + */ + public static long ok(MemorySegment struct) { + return struct.get(ok$LAYOUT, ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * uint64_t ok + * } + */ + public static void ok(MemorySegment struct, long fieldValue) { + struct.set(ok$LAYOUT, ok$OFFSET, fieldValue); + } + + private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final OfBoolean is_ok$layout() { + return is_ok$LAYOUT; + } + + private static final long is_ok$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final long is_ok$offset() { + return is_ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static boolean is_ok(MemorySegment struct) { + return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static void is_ok(MemorySegment struct, boolean fieldValue) { + struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionU8.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionU8.java new file mode 100644 index 000000000..e4878a0e6 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionU8.java @@ -0,0 +1,177 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct OptionU8 { + * union { + * uint8_t ok; + * }; + * bool is_ok; + * } + * } + */ +public class OptionU8 { + + OptionU8() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.unionLayout( + somelib_h.C_CHAR.withName("ok") + ).withName("$anon$54:1"), + somelib_h.C_BOOL.withName("is_ok") + ).withName("OptionU8"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfByte ok$LAYOUT = (OfByte)$LAYOUT.select(groupElement("$anon$54:1"), groupElement("ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * uint8_t ok + * } + */ + public static final OfByte ok$layout() { + return ok$LAYOUT; + } + + private static final long ok$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * uint8_t ok + * } + */ + public static final long ok$offset() { + return ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * uint8_t ok + * } + */ + public static byte ok(MemorySegment struct) { + return struct.get(ok$LAYOUT, ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * uint8_t ok + * } + */ + public static void ok(MemorySegment struct, byte fieldValue) { + struct.set(ok$LAYOUT, ok$OFFSET, fieldValue); + } + + private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final OfBoolean is_ok$layout() { + return is_ok$LAYOUT; + } + + private static final long is_ok$OFFSET = 1; + + /** + * Offset for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final long is_ok$offset() { + return is_ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static boolean is_ok(MemorySegment struct) { + return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static void is_ok(MemorySegment struct, boolean fieldValue) { + struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionUsize.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionUsize.java new file mode 100644 index 000000000..d88ea49a8 --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/OptionUsize.java @@ -0,0 +1,178 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct OptionUsize { + * union { + * size_t ok; + * }; + * bool is_ok; + * } + * } + */ +public class OptionUsize { + + OptionUsize() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.unionLayout( + somelib_h.C_LONG.withName("ok") + ).withName("$anon$62:1"), + somelib_h.C_BOOL.withName("is_ok"), + MemoryLayout.paddingLayout(7) + ).withName("OptionUsize"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong ok$LAYOUT = (OfLong)$LAYOUT.select(groupElement("$anon$62:1"), groupElement("ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t ok + * } + */ + public static final OfLong ok$layout() { + return ok$LAYOUT; + } + + private static final long ok$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t ok + * } + */ + public static final long ok$offset() { + return ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t ok + * } + */ + public static long ok(MemorySegment struct) { + return struct.get(ok$LAYOUT, ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t ok + * } + */ + public static void ok(MemorySegment struct, long fieldValue) { + struct.set(ok$LAYOUT, ok$OFFSET, fieldValue); + } + + private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final OfBoolean is_ok$layout() { + return is_ok$LAYOUT; + } + + private static final long is_ok$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final long is_ok$offset() { + return is_ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static boolean is_ok(MemorySegment struct) { + return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static void is_ok(MemorySegment struct, boolean fieldValue) { + struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/UnimportedEnum_option.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/UnimportedEnum_option.java new file mode 100644 index 000000000..5a204c6af --- /dev/null +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/UnimportedEnum_option.java @@ -0,0 +1,178 @@ +// Generated by jextract + +package dev.diplomattest.somelib.ntv; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct UnimportedEnum_option { + * union { + * UnimportedEnum ok; + * }; + * bool is_ok; + * } + * } + */ +public class UnimportedEnum_option { + + UnimportedEnum_option() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.unionLayout( + somelib_h.C_INT.withName("ok") + ).withName("$anon$20:39"), + somelib_h.C_BOOL.withName("is_ok"), + MemoryLayout.paddingLayout(3) + ).withName("UnimportedEnum_option"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt ok$LAYOUT = (OfInt)$LAYOUT.select(groupElement("$anon$20:39"), groupElement("ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * UnimportedEnum ok + * } + */ + public static final OfInt ok$layout() { + return ok$LAYOUT; + } + + private static final long ok$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * UnimportedEnum ok + * } + */ + public static final long ok$offset() { + return ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * UnimportedEnum ok + * } + */ + public static int ok(MemorySegment struct) { + return struct.get(ok$LAYOUT, ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * UnimportedEnum ok + * } + */ + public static void ok(MemorySegment struct, int fieldValue) { + struct.set(ok$LAYOUT, ok$OFFSET, fieldValue); + } + + private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final OfBoolean is_ok$layout() { + return is_ok$LAYOUT; + } + + private static final long is_ok$OFFSET = 4; + + /** + * Offset for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static final long is_ok$offset() { + return is_ok$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static boolean is_ok(MemorySegment struct) { + return struct.get(is_ok$LAYOUT, is_ok$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool is_ok + * } + */ + public static void is_ok(MemorySegment struct, boolean fieldValue) { + struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} + diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java index e75401985..669f117d6 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java @@ -213,168 +213,6 @@ public static int _DARWIN_FEATURE_UNIX_CONFORMANCE() { public static int __has_ptrcheck() { return __has_ptrcheck; } - private static final int true_ = (int)1L; - /** - * {@snippet lang=c : - * #define true 1 - * } - */ - public static int true_() { - return true_; - } - private static final int false_ = (int)0L; - /** - * {@snippet lang=c : - * #define false 0 - * } - */ - public static int false_() { - return false_; - } - private static final int __bool_true_false_are_defined = (int)1L; - /** - * {@snippet lang=c : - * #define __bool_true_false_are_defined 1 - * } - */ - public static int __bool_true_false_are_defined() { - return __bool_true_false_are_defined; - } - private static final int __WORDSIZE = (int)64L; - /** - * {@snippet lang=c : - * #define __WORDSIZE 64 - * } - */ - public static int __WORDSIZE() { - return __WORDSIZE; - } - private static final int __PTHREAD_SIZE__ = (int)8176L; - /** - * {@snippet lang=c : - * #define __PTHREAD_SIZE__ 8176 - * } - */ - public static int __PTHREAD_SIZE__() { - return __PTHREAD_SIZE__; - } - private static final int __PTHREAD_ATTR_SIZE__ = (int)56L; - /** - * {@snippet lang=c : - * #define __PTHREAD_ATTR_SIZE__ 56 - * } - */ - public static int __PTHREAD_ATTR_SIZE__() { - return __PTHREAD_ATTR_SIZE__; - } - private static final int __PTHREAD_MUTEXATTR_SIZE__ = (int)8L; - /** - * {@snippet lang=c : - * #define __PTHREAD_MUTEXATTR_SIZE__ 8 - * } - */ - public static int __PTHREAD_MUTEXATTR_SIZE__() { - return __PTHREAD_MUTEXATTR_SIZE__; - } - private static final int __PTHREAD_MUTEX_SIZE__ = (int)56L; - /** - * {@snippet lang=c : - * #define __PTHREAD_MUTEX_SIZE__ 56 - * } - */ - public static int __PTHREAD_MUTEX_SIZE__() { - return __PTHREAD_MUTEX_SIZE__; - } - private static final int __PTHREAD_CONDATTR_SIZE__ = (int)8L; - /** - * {@snippet lang=c : - * #define __PTHREAD_CONDATTR_SIZE__ 8 - * } - */ - public static int __PTHREAD_CONDATTR_SIZE__() { - return __PTHREAD_CONDATTR_SIZE__; - } - private static final int __PTHREAD_COND_SIZE__ = (int)40L; - /** - * {@snippet lang=c : - * #define __PTHREAD_COND_SIZE__ 40 - * } - */ - public static int __PTHREAD_COND_SIZE__() { - return __PTHREAD_COND_SIZE__; - } - private static final int __PTHREAD_ONCE_SIZE__ = (int)8L; - /** - * {@snippet lang=c : - * #define __PTHREAD_ONCE_SIZE__ 8 - * } - */ - public static int __PTHREAD_ONCE_SIZE__() { - return __PTHREAD_ONCE_SIZE__; - } - private static final int __PTHREAD_RWLOCK_SIZE__ = (int)192L; - /** - * {@snippet lang=c : - * #define __PTHREAD_RWLOCK_SIZE__ 192 - * } - */ - public static int __PTHREAD_RWLOCK_SIZE__() { - return __PTHREAD_RWLOCK_SIZE__; - } - private static final int __PTHREAD_RWLOCKATTR_SIZE__ = (int)16L; - /** - * {@snippet lang=c : - * #define __PTHREAD_RWLOCKATTR_SIZE__ 16 - * } - */ - public static int __PTHREAD_RWLOCKATTR_SIZE__() { - return __PTHREAD_RWLOCKATTR_SIZE__; - } - private static final int INT8_MAX = (int)127L; - /** - * {@snippet lang=c : - * #define INT8_MAX 127 - * } - */ - public static int INT8_MAX() { - return INT8_MAX; - } - private static final int INT16_MAX = (int)32767L; - /** - * {@snippet lang=c : - * #define INT16_MAX 32767 - * } - */ - public static int INT16_MAX() { - return INT16_MAX; - } - private static final int INT32_MAX = (int)2147483647L; - /** - * {@snippet lang=c : - * #define INT32_MAX 2147483647 - * } - */ - public static int INT32_MAX() { - return INT32_MAX; - } - private static final int UINT8_MAX = (int)255L; - /** - * {@snippet lang=c : - * #define UINT8_MAX 255 - * } - */ - public static int UINT8_MAX() { - return UINT8_MAX; - } - private static final int UINT16_MAX = (int)65535L; - /** - * {@snippet lang=c : - * #define UINT16_MAX 65535 - * } - */ - public static int UINT16_MAX() { - return UINT16_MAX; - } private static final int __API_TO_BE_DEPRECATED = (int)100000L; /** * {@snippet lang=c : @@ -2949,6 +2787,87 @@ public static int __VISIONOS_1_2() { public static int __ENABLE_LEGACY_MAC_AVAILABILITY() { return __ENABLE_LEGACY_MAC_AVAILABILITY; } + private static final int __PTHREAD_SIZE__ = (int)8176L; + /** + * {@snippet lang=c : + * #define __PTHREAD_SIZE__ 8176 + * } + */ + public static int __PTHREAD_SIZE__() { + return __PTHREAD_SIZE__; + } + private static final int __PTHREAD_ATTR_SIZE__ = (int)56L; + /** + * {@snippet lang=c : + * #define __PTHREAD_ATTR_SIZE__ 56 + * } + */ + public static int __PTHREAD_ATTR_SIZE__() { + return __PTHREAD_ATTR_SIZE__; + } + private static final int __PTHREAD_MUTEXATTR_SIZE__ = (int)8L; + /** + * {@snippet lang=c : + * #define __PTHREAD_MUTEXATTR_SIZE__ 8 + * } + */ + public static int __PTHREAD_MUTEXATTR_SIZE__() { + return __PTHREAD_MUTEXATTR_SIZE__; + } + private static final int __PTHREAD_MUTEX_SIZE__ = (int)56L; + /** + * {@snippet lang=c : + * #define __PTHREAD_MUTEX_SIZE__ 56 + * } + */ + public static int __PTHREAD_MUTEX_SIZE__() { + return __PTHREAD_MUTEX_SIZE__; + } + private static final int __PTHREAD_CONDATTR_SIZE__ = (int)8L; + /** + * {@snippet lang=c : + * #define __PTHREAD_CONDATTR_SIZE__ 8 + * } + */ + public static int __PTHREAD_CONDATTR_SIZE__() { + return __PTHREAD_CONDATTR_SIZE__; + } + private static final int __PTHREAD_COND_SIZE__ = (int)40L; + /** + * {@snippet lang=c : + * #define __PTHREAD_COND_SIZE__ 40 + * } + */ + public static int __PTHREAD_COND_SIZE__() { + return __PTHREAD_COND_SIZE__; + } + private static final int __PTHREAD_ONCE_SIZE__ = (int)8L; + /** + * {@snippet lang=c : + * #define __PTHREAD_ONCE_SIZE__ 8 + * } + */ + public static int __PTHREAD_ONCE_SIZE__() { + return __PTHREAD_ONCE_SIZE__; + } + private static final int __PTHREAD_RWLOCK_SIZE__ = (int)192L; + /** + * {@snippet lang=c : + * #define __PTHREAD_RWLOCK_SIZE__ 192 + * } + */ + public static int __PTHREAD_RWLOCK_SIZE__() { + return __PTHREAD_RWLOCK_SIZE__; + } + private static final int __PTHREAD_RWLOCKATTR_SIZE__ = (int)16L; + /** + * {@snippet lang=c : + * #define __PTHREAD_RWLOCKATTR_SIZE__ 16 + * } + */ + public static int __PTHREAD_RWLOCKATTR_SIZE__() { + return __PTHREAD_RWLOCKATTR_SIZE__; + } private static final int _FORTIFY_SOURCE = (int)2L; /** * {@snippet lang=c : @@ -3282,234 +3201,87 @@ public static int L_ctermid() { public static int _USE_FORTIFY_LEVEL() { return _USE_FORTIFY_LEVEL; } - - private static class __assert_rtn { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("__assert_rtn"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - + private static final int __WORDSIZE = (int)64L; /** - * Function descriptor for: * {@snippet lang=c : - * void __assert_rtn(const char *, const char *, int, const char *) + * #define __WORDSIZE 64 * } */ - public static FunctionDescriptor __assert_rtn$descriptor() { - return __assert_rtn.DESC; + public static int __WORDSIZE() { + return __WORDSIZE; } - + private static final int INT8_MAX = (int)127L; /** - * Downcall method handle for: * {@snippet lang=c : - * void __assert_rtn(const char *, const char *, int, const char *) + * #define INT8_MAX 127 * } */ - public static MethodHandle __assert_rtn$handle() { - return __assert_rtn.HANDLE; + public static int INT8_MAX() { + return INT8_MAX; } - + private static final int INT16_MAX = (int)32767L; /** - * Address for: * {@snippet lang=c : - * void __assert_rtn(const char *, const char *, int, const char *) + * #define INT16_MAX 32767 * } */ - public static MemorySegment __assert_rtn$address() { - return __assert_rtn.ADDR; + public static int INT16_MAX() { + return INT16_MAX; } - + private static final int INT32_MAX = (int)2147483647L; /** * {@snippet lang=c : - * void __assert_rtn(const char *, const char *, int, const char *) + * #define INT32_MAX 2147483647 * } */ - public static void __assert_rtn(MemorySegment x0, MemorySegment x1, int x2, MemorySegment x3) { - var mh$ = __assert_rtn.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("__assert_rtn", x0, x1, x2, x3); - } - mh$.invokeExact(x0, x1, x2, x3); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } + public static int INT32_MAX() { + return INT32_MAX; } + private static final int UINT8_MAX = (int)255L; /** * {@snippet lang=c : - * typedef long ptrdiff_t - * } - */ - public static final OfLong ptrdiff_t = somelib_h.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned long size_t - * } - */ - public static final OfLong size_t = somelib_h.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned long rsize_t - * } - */ - public static final OfLong rsize_t = somelib_h.C_LONG; - /** - * {@snippet lang=c : - * typedef int wchar_t - * } - */ - public static final OfInt wchar_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef signed char int8_t - * } - */ - public static final OfByte int8_t = somelib_h.C_CHAR; - /** - * {@snippet lang=c : - * typedef short int16_t - * } - */ - public static final OfShort int16_t = somelib_h.C_SHORT; - /** - * {@snippet lang=c : - * typedef int int32_t - * } - */ - public static final OfInt int32_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef long long int64_t - * } - */ - public static final OfLong int64_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef unsigned char uint8_t - * } - */ - public static final OfByte uint8_t = somelib_h.C_CHAR; - /** - * {@snippet lang=c : - * typedef unsigned short uint16_t - * } - */ - public static final OfShort uint16_t = somelib_h.C_SHORT; - /** - * {@snippet lang=c : - * typedef unsigned int uint32_t - * } - */ - public static final OfInt uint32_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef unsigned long long uint64_t - * } - */ - public static final OfLong uint64_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef int8_t int_least8_t - * } - */ - public static final OfByte int_least8_t = somelib_h.C_CHAR; - /** - * {@snippet lang=c : - * typedef int16_t int_least16_t - * } - */ - public static final OfShort int_least16_t = somelib_h.C_SHORT; - /** - * {@snippet lang=c : - * typedef int32_t int_least32_t - * } - */ - public static final OfInt int_least32_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef int64_t int_least64_t - * } - */ - public static final OfLong int_least64_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef uint8_t uint_least8_t - * } - */ - public static final OfByte uint_least8_t = somelib_h.C_CHAR; - /** - * {@snippet lang=c : - * typedef uint16_t uint_least16_t - * } - */ - public static final OfShort uint_least16_t = somelib_h.C_SHORT; - /** - * {@snippet lang=c : - * typedef uint32_t uint_least32_t - * } - */ - public static final OfInt uint_least32_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef uint64_t uint_least64_t - * } - */ - public static final OfLong uint_least64_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef int8_t int_fast8_t - * } - */ - public static final OfByte int_fast8_t = somelib_h.C_CHAR; - /** - * {@snippet lang=c : - * typedef int16_t int_fast16_t - * } - */ - public static final OfShort int_fast16_t = somelib_h.C_SHORT; - /** - * {@snippet lang=c : - * typedef int32_t int_fast32_t - * } - */ - public static final OfInt int_fast32_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef int64_t int_fast64_t + * #define UINT8_MAX 255 * } */ - public static final OfLong int_fast64_t = somelib_h.C_LONG_LONG; + public static int UINT8_MAX() { + return UINT8_MAX; + } + private static final int UINT16_MAX = (int)65535L; /** * {@snippet lang=c : - * typedef uint8_t uint_fast8_t + * #define UINT16_MAX 65535 * } */ - public static final OfByte uint_fast8_t = somelib_h.C_CHAR; + public static int UINT16_MAX() { + return UINT16_MAX; + } + private static final int true_ = (int)1L; /** * {@snippet lang=c : - * typedef uint16_t uint_fast16_t + * #define true 1 * } */ - public static final OfShort uint_fast16_t = somelib_h.C_SHORT; + public static int true_() { + return true_; + } + private static final int false_ = (int)0L; /** * {@snippet lang=c : - * typedef uint32_t uint_fast32_t + * #define false 0 * } */ - public static final OfInt uint_fast32_t = somelib_h.C_INT; + public static int false_() { + return false_; + } + private static final int __bool_true_false_are_defined = (int)1L; /** * {@snippet lang=c : - * typedef uint64_t uint_fast64_t + * #define __bool_true_false_are_defined 1 * } */ - public static final OfLong uint_fast64_t = somelib_h.C_LONG_LONG; + public static int __bool_true_false_are_defined() { + return __bool_true_false_are_defined; + } /** * {@snippet lang=c : * typedef signed char __int8_t @@ -3762,186 +3534,159 @@ public static void __assert_rtn(MemorySegment x0, MemorySegment x1, int x2, Memo public static final AddressLayout __darwin_pthread_t = somelib_h.C_POINTER; /** * {@snippet lang=c : - * typedef unsigned char u_int8_t + * typedef int __darwin_nl_item * } */ - public static final OfByte u_int8_t = somelib_h.C_CHAR; + public static final OfInt __darwin_nl_item = somelib_h.C_INT; /** * {@snippet lang=c : - * typedef unsigned short u_int16_t + * typedef int __darwin_wctrans_t * } */ - public static final OfShort u_int16_t = somelib_h.C_SHORT; + public static final OfInt __darwin_wctrans_t = somelib_h.C_INT; /** * {@snippet lang=c : - * typedef unsigned int u_int32_t + * typedef __uint32_t __darwin_wctype_t * } */ - public static final OfInt u_int32_t = somelib_h.C_INT; + public static final OfInt __darwin_wctype_t = somelib_h.C_INT; /** * {@snippet lang=c : - * typedef unsigned long long u_int64_t + * typedef signed char int8_t * } */ - public static final OfLong u_int64_t = somelib_h.C_LONG_LONG; + public static final OfByte int8_t = somelib_h.C_CHAR; /** * {@snippet lang=c : - * typedef int64_t register_t + * typedef short int16_t * } */ - public static final OfLong register_t = somelib_h.C_LONG_LONG; + public static final OfShort int16_t = somelib_h.C_SHORT; /** * {@snippet lang=c : - * typedef unsigned long uintptr_t + * typedef int int32_t * } */ - public static final OfLong uintptr_t = somelib_h.C_LONG; + public static final OfInt int32_t = somelib_h.C_INT; /** * {@snippet lang=c : - * typedef u_int64_t user_addr_t + * typedef long long int64_t * } */ - public static final OfLong user_addr_t = somelib_h.C_LONG_LONG; + public static final OfLong int64_t = somelib_h.C_LONG_LONG; /** * {@snippet lang=c : - * typedef u_int64_t user_size_t + * typedef unsigned char u_int8_t * } */ - public static final OfLong user_size_t = somelib_h.C_LONG_LONG; + public static final OfByte u_int8_t = somelib_h.C_CHAR; /** * {@snippet lang=c : - * typedef int64_t user_ssize_t + * typedef unsigned short u_int16_t * } */ - public static final OfLong user_ssize_t = somelib_h.C_LONG_LONG; + public static final OfShort u_int16_t = somelib_h.C_SHORT; /** * {@snippet lang=c : - * typedef int64_t user_long_t + * typedef unsigned int u_int32_t * } */ - public static final OfLong user_long_t = somelib_h.C_LONG_LONG; + public static final OfInt u_int32_t = somelib_h.C_INT; /** * {@snippet lang=c : - * typedef u_int64_t user_ulong_t + * typedef unsigned long long u_int64_t * } */ - public static final OfLong user_ulong_t = somelib_h.C_LONG_LONG; + public static final OfLong u_int64_t = somelib_h.C_LONG_LONG; /** * {@snippet lang=c : - * typedef int64_t user_time_t + * typedef int64_t register_t * } */ - public static final OfLong user_time_t = somelib_h.C_LONG_LONG; + public static final OfLong register_t = somelib_h.C_LONG_LONG; /** * {@snippet lang=c : - * typedef int64_t user_off_t + * typedef __darwin_intptr_t intptr_t * } */ - public static final OfLong user_off_t = somelib_h.C_LONG_LONG; + public static final OfLong intptr_t = somelib_h.C_LONG; /** * {@snippet lang=c : - * typedef u_int64_t syscall_arg_t + * typedef unsigned long uintptr_t * } */ - public static final OfLong syscall_arg_t = somelib_h.C_LONG_LONG; + public static final OfLong uintptr_t = somelib_h.C_LONG; /** * {@snippet lang=c : - * typedef __darwin_intptr_t intptr_t + * typedef u_int64_t user_addr_t * } */ - public static final OfLong intptr_t = somelib_h.C_LONG; + public static final OfLong user_addr_t = somelib_h.C_LONG_LONG; /** * {@snippet lang=c : - * typedef long intmax_t + * typedef u_int64_t user_size_t * } */ - public static final OfLong intmax_t = somelib_h.C_LONG; + public static final OfLong user_size_t = somelib_h.C_LONG_LONG; /** * {@snippet lang=c : - * typedef unsigned long uintmax_t + * typedef int64_t user_ssize_t * } */ - public static final OfLong uintmax_t = somelib_h.C_LONG; + public static final OfLong user_ssize_t = somelib_h.C_LONG_LONG; /** * {@snippet lang=c : - * typedef uint_least16_t char16_t + * typedef int64_t user_long_t * } */ - public static final OfShort char16_t = somelib_h.C_SHORT; + public static final OfLong user_long_t = somelib_h.C_LONG_LONG; /** * {@snippet lang=c : - * typedef uint_least32_t char32_t + * typedef u_int64_t user_ulong_t * } */ - public static final OfInt char32_t = somelib_h.C_INT; - - private static class diplomat_is_str { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_BOOL, - somelib_h.C_POINTER, - somelib_h.C_LONG - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_is_str"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - + public static final OfLong user_ulong_t = somelib_h.C_LONG_LONG; /** - * Function descriptor for: * {@snippet lang=c : - * bool diplomat_is_str(const char *buf, size_t len) + * typedef int64_t user_time_t * } */ - public static FunctionDescriptor diplomat_is_str$descriptor() { - return diplomat_is_str.DESC; - } - + public static final OfLong user_time_t = somelib_h.C_LONG_LONG; /** - * Downcall method handle for: * {@snippet lang=c : - * bool diplomat_is_str(const char *buf, size_t len) + * typedef int64_t user_off_t * } */ - public static MethodHandle diplomat_is_str$handle() { - return diplomat_is_str.HANDLE; - } - + public static final OfLong user_off_t = somelib_h.C_LONG_LONG; /** - * Address for: * {@snippet lang=c : - * bool diplomat_is_str(const char *buf, size_t len) + * typedef u_int64_t syscall_arg_t * } */ - public static MemorySegment diplomat_is_str$address() { - return diplomat_is_str.ADDR; - } - + public static final OfLong syscall_arg_t = somelib_h.C_LONG_LONG; /** * {@snippet lang=c : - * bool diplomat_is_str(const char *buf, size_t len) + * typedef __darwin_va_list va_list * } */ - public static boolean diplomat_is_str(MemorySegment buf, long len) { - var mh$ = diplomat_is_str.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("diplomat_is_str", buf, len); - } - return (boolean)mh$.invokeExact(buf, len); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } + public static final AddressLayout va_list = somelib_h.C_POINTER; + /** + * {@snippet lang=c : + * typedef __darwin_size_t size_t + * } + */ + public static final OfLong size_t = somelib_h.C_LONG; - private static class diplomat_simple_write { + private static class renameat { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - DiplomatWrite.layout(), + somelib_h.C_INT, + somelib_h.C_INT, somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_INT, + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_simple_write"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("renameat"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -3949,57 +3694,59 @@ private static class diplomat_simple_write { /** * Function descriptor for: * {@snippet lang=c : - * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) + * int renameat(int, const char *, int, const char *) * } */ - public static FunctionDescriptor diplomat_simple_write$descriptor() { - return diplomat_simple_write.DESC; + public static FunctionDescriptor renameat$descriptor() { + return renameat.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) + * int renameat(int, const char *, int, const char *) * } */ - public static MethodHandle diplomat_simple_write$handle() { - return diplomat_simple_write.HANDLE; + public static MethodHandle renameat$handle() { + return renameat.HANDLE; } /** * Address for: * {@snippet lang=c : - * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) + * int renameat(int, const char *, int, const char *) * } */ - public static MemorySegment diplomat_simple_write$address() { - return diplomat_simple_write.ADDR; + public static MemorySegment renameat$address() { + return renameat.ADDR; } /** * {@snippet lang=c : - * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) + * int renameat(int, const char *, int, const char *) * } */ - public static MemorySegment diplomat_simple_write(SegmentAllocator allocator, MemorySegment buf, long buf_size) { - var mh$ = diplomat_simple_write.HANDLE; + public static int renameat(int x0, MemorySegment x1, int x2, MemorySegment x3) { + var mh$ = renameat.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("diplomat_simple_write", allocator, buf, buf_size); + traceDowncall("renameat", x0, x1, x2, x3); } - return (MemorySegment)mh$.invokeExact(allocator, buf, buf_size); + return (int)mh$.invokeExact(x0, x1, x2, x3); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class diplomat_buffer_write_create { + private static class renamex_np { public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_POINTER, + somelib_h.C_INT ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_create"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("renamex_np"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4007,57 +3754,61 @@ private static class diplomat_buffer_write_create { /** * Function descriptor for: * {@snippet lang=c : - * DiplomatWrite *diplomat_buffer_write_create(size_t cap) + * int renamex_np(const char *, const char *, unsigned int) * } */ - public static FunctionDescriptor diplomat_buffer_write_create$descriptor() { - return diplomat_buffer_write_create.DESC; + public static FunctionDescriptor renamex_np$descriptor() { + return renamex_np.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * DiplomatWrite *diplomat_buffer_write_create(size_t cap) + * int renamex_np(const char *, const char *, unsigned int) * } */ - public static MethodHandle diplomat_buffer_write_create$handle() { - return diplomat_buffer_write_create.HANDLE; + public static MethodHandle renamex_np$handle() { + return renamex_np.HANDLE; } /** * Address for: * {@snippet lang=c : - * DiplomatWrite *diplomat_buffer_write_create(size_t cap) + * int renamex_np(const char *, const char *, unsigned int) * } */ - public static MemorySegment diplomat_buffer_write_create$address() { - return diplomat_buffer_write_create.ADDR; + public static MemorySegment renamex_np$address() { + return renamex_np.ADDR; } /** * {@snippet lang=c : - * DiplomatWrite *diplomat_buffer_write_create(size_t cap) + * int renamex_np(const char *, const char *, unsigned int) * } */ - public static MemorySegment diplomat_buffer_write_create(long cap) { - var mh$ = diplomat_buffer_write_create.HANDLE; + public static int renamex_np(MemorySegment x0, MemorySegment x1, int x2) { + var mh$ = renamex_np.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("diplomat_buffer_write_create", cap); + traceDowncall("renamex_np", x0, x1, x2); } - return (MemorySegment)mh$.invokeExact(cap); + return (int)mh$.invokeExact(x0, x1, x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class diplomat_buffer_write_get_bytes { + private static class renameatx_np { public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_INT, somelib_h.C_POINTER, - somelib_h.C_POINTER + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_INT ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_get_bytes"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("renameatx_np"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4065,199 +3816,197 @@ private static class diplomat_buffer_write_get_bytes { /** * Function descriptor for: * {@snippet lang=c : - * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) + * int renameatx_np(int, const char *, int, const char *, unsigned int) * } */ - public static FunctionDescriptor diplomat_buffer_write_get_bytes$descriptor() { - return diplomat_buffer_write_get_bytes.DESC; + public static FunctionDescriptor renameatx_np$descriptor() { + return renameatx_np.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) + * int renameatx_np(int, const char *, int, const char *, unsigned int) * } */ - public static MethodHandle diplomat_buffer_write_get_bytes$handle() { - return diplomat_buffer_write_get_bytes.HANDLE; + public static MethodHandle renameatx_np$handle() { + return renameatx_np.HANDLE; } /** * Address for: * {@snippet lang=c : - * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) + * int renameatx_np(int, const char *, int, const char *, unsigned int) * } */ - public static MemorySegment diplomat_buffer_write_get_bytes$address() { - return diplomat_buffer_write_get_bytes.ADDR; + public static MemorySegment renameatx_np$address() { + return renameatx_np.ADDR; } /** * {@snippet lang=c : - * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) + * int renameatx_np(int, const char *, int, const char *, unsigned int) * } */ - public static MemorySegment diplomat_buffer_write_get_bytes(MemorySegment t) { - var mh$ = diplomat_buffer_write_get_bytes.HANDLE; + public static int renameatx_np(int x0, MemorySegment x1, int x2, MemorySegment x3, int x4) { + var mh$ = renameatx_np.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("diplomat_buffer_write_get_bytes", t); + traceDowncall("renameatx_np", x0, x1, x2, x3, x4); } - return (MemorySegment)mh$.invokeExact(t); + return (int)mh$.invokeExact(x0, x1, x2, x3, x4); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } + /** + * {@snippet lang=c : + * typedef __darwin_off_t fpos_t + * } + */ + public static final OfLong fpos_t = somelib_h.C_LONG_LONG; - private static class diplomat_buffer_write_len { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_LONG, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_len"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + private static class __stdinp$constants { + public static final AddressLayout LAYOUT = somelib_h.C_POINTER; + public static final MemorySegment SEGMENT = somelib_h.findOrThrow("__stdinp").reinterpret(LAYOUT.byteSize()); } /** - * Function descriptor for: + * Layout for variable: * {@snippet lang=c : - * size_t diplomat_buffer_write_len(DiplomatWrite *t) + * extern FILE *__stdinp * } */ - public static FunctionDescriptor diplomat_buffer_write_len$descriptor() { - return diplomat_buffer_write_len.DESC; + public static AddressLayout __stdinp$layout() { + return __stdinp$constants.LAYOUT; } /** - * Downcall method handle for: + * Segment for variable: * {@snippet lang=c : - * size_t diplomat_buffer_write_len(DiplomatWrite *t) + * extern FILE *__stdinp * } */ - public static MethodHandle diplomat_buffer_write_len$handle() { - return diplomat_buffer_write_len.HANDLE; + public static MemorySegment __stdinp$segment() { + return __stdinp$constants.SEGMENT; } /** - * Address for: + * Getter for variable: * {@snippet lang=c : - * size_t diplomat_buffer_write_len(DiplomatWrite *t) + * extern FILE *__stdinp * } */ - public static MemorySegment diplomat_buffer_write_len$address() { - return diplomat_buffer_write_len.ADDR; + public static MemorySegment __stdinp() { + return __stdinp$constants.SEGMENT.get(__stdinp$constants.LAYOUT, 0L); } /** + * Setter for variable: * {@snippet lang=c : - * size_t diplomat_buffer_write_len(DiplomatWrite *t) + * extern FILE *__stdinp * } */ - public static long diplomat_buffer_write_len(MemorySegment t) { - var mh$ = diplomat_buffer_write_len.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("diplomat_buffer_write_len", t); - } - return (long)mh$.invokeExact(t); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } + public static void __stdinp(MemorySegment varValue) { + __stdinp$constants.SEGMENT.set(__stdinp$constants.LAYOUT, 0L, varValue); } - private static class diplomat_buffer_write_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_destroy"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + private static class __stdoutp$constants { + public static final AddressLayout LAYOUT = somelib_h.C_POINTER; + public static final MemorySegment SEGMENT = somelib_h.findOrThrow("__stdoutp").reinterpret(LAYOUT.byteSize()); } /** - * Function descriptor for: + * Layout for variable: * {@snippet lang=c : - * void diplomat_buffer_write_destroy(DiplomatWrite *t) + * extern FILE *__stdoutp * } */ - public static FunctionDescriptor diplomat_buffer_write_destroy$descriptor() { - return diplomat_buffer_write_destroy.DESC; + public static AddressLayout __stdoutp$layout() { + return __stdoutp$constants.LAYOUT; } /** - * Downcall method handle for: + * Segment for variable: * {@snippet lang=c : - * void diplomat_buffer_write_destroy(DiplomatWrite *t) + * extern FILE *__stdoutp * } */ - public static MethodHandle diplomat_buffer_write_destroy$handle() { - return diplomat_buffer_write_destroy.HANDLE; + public static MemorySegment __stdoutp$segment() { + return __stdoutp$constants.SEGMENT; } /** - * Address for: + * Getter for variable: * {@snippet lang=c : - * void diplomat_buffer_write_destroy(DiplomatWrite *t) + * extern FILE *__stdoutp * } */ - public static MemorySegment diplomat_buffer_write_destroy$address() { - return diplomat_buffer_write_destroy.ADDR; + public static MemorySegment __stdoutp() { + return __stdoutp$constants.SEGMENT.get(__stdoutp$constants.LAYOUT, 0L); } /** + * Setter for variable: * {@snippet lang=c : - * void diplomat_buffer_write_destroy(DiplomatWrite *t) + * extern FILE *__stdoutp * } */ - public static void diplomat_buffer_write_destroy(MemorySegment t) { - var mh$ = diplomat_buffer_write_destroy.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("diplomat_buffer_write_destroy", t); - } - mh$.invokeExact(t); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } + public static void __stdoutp(MemorySegment varValue) { + __stdoutp$constants.SEGMENT.set(__stdoutp$constants.LAYOUT, 0L, varValue); + } + + private static class __stderrp$constants { + public static final AddressLayout LAYOUT = somelib_h.C_POINTER; + public static final MemorySegment SEGMENT = somelib_h.findOrThrow("__stderrp").reinterpret(LAYOUT.byteSize()); } + /** + * Layout for variable: * {@snippet lang=c : - * typedef int __darwin_nl_item + * extern FILE *__stderrp * } */ - public static final OfInt __darwin_nl_item = somelib_h.C_INT; + public static AddressLayout __stderrp$layout() { + return __stderrp$constants.LAYOUT; + } + /** + * Segment for variable: * {@snippet lang=c : - * typedef int __darwin_wctrans_t + * extern FILE *__stderrp * } */ - public static final OfInt __darwin_wctrans_t = somelib_h.C_INT; + public static MemorySegment __stderrp$segment() { + return __stderrp$constants.SEGMENT; + } + /** + * Getter for variable: * {@snippet lang=c : - * typedef __uint32_t __darwin_wctype_t + * extern FILE *__stderrp * } */ - public static final OfInt __darwin_wctype_t = somelib_h.C_INT; + public static MemorySegment __stderrp() { + return __stderrp$constants.SEGMENT.get(__stderrp$constants.LAYOUT, 0L); + } + /** + * Setter for variable: * {@snippet lang=c : - * typedef __darwin_va_list va_list + * extern FILE *__stderrp * } */ - public static final AddressLayout va_list = somelib_h.C_POINTER; + public static void __stderrp(MemorySegment varValue) { + __stderrp$constants.SEGMENT.set(__stderrp$constants.LAYOUT, 0L, varValue); + } - private static class renameat { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_INT, + private static class clearerr { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("renameat"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("clearerr"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4265,59 +4014,57 @@ private static class renameat { /** * Function descriptor for: * {@snippet lang=c : - * int renameat(int, const char *, int, const char *) + * void clearerr(FILE *) * } */ - public static FunctionDescriptor renameat$descriptor() { - return renameat.DESC; + public static FunctionDescriptor clearerr$descriptor() { + return clearerr.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int renameat(int, const char *, int, const char *) + * void clearerr(FILE *) * } */ - public static MethodHandle renameat$handle() { - return renameat.HANDLE; + public static MethodHandle clearerr$handle() { + return clearerr.HANDLE; } /** * Address for: * {@snippet lang=c : - * int renameat(int, const char *, int, const char *) + * void clearerr(FILE *) * } */ - public static MemorySegment renameat$address() { - return renameat.ADDR; + public static MemorySegment clearerr$address() { + return clearerr.ADDR; } /** * {@snippet lang=c : - * int renameat(int, const char *, int, const char *) + * void clearerr(FILE *) * } */ - public static int renameat(int x0, MemorySegment x1, int x2, MemorySegment x3) { - var mh$ = renameat.HANDLE; + public static void clearerr(MemorySegment x0) { + var mh$ = clearerr.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("renameat", x0, x1, x2, x3); + traceDowncall("clearerr", x0); } - return (int)mh$.invokeExact(x0, x1, x2, x3); + mh$.invokeExact(x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class renamex_np { + private static class fclose { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_INT + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("renamex_np"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fclose"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4325,61 +4072,57 @@ private static class renamex_np { /** * Function descriptor for: * {@snippet lang=c : - * int renamex_np(const char *, const char *, unsigned int) + * int fclose(FILE *) * } */ - public static FunctionDescriptor renamex_np$descriptor() { - return renamex_np.DESC; + public static FunctionDescriptor fclose$descriptor() { + return fclose.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int renamex_np(const char *, const char *, unsigned int) + * int fclose(FILE *) * } */ - public static MethodHandle renamex_np$handle() { - return renamex_np.HANDLE; + public static MethodHandle fclose$handle() { + return fclose.HANDLE; } /** * Address for: * {@snippet lang=c : - * int renamex_np(const char *, const char *, unsigned int) + * int fclose(FILE *) * } */ - public static MemorySegment renamex_np$address() { - return renamex_np.ADDR; + public static MemorySegment fclose$address() { + return fclose.ADDR; } /** * {@snippet lang=c : - * int renamex_np(const char *, const char *, unsigned int) + * int fclose(FILE *) * } */ - public static int renamex_np(MemorySegment x0, MemorySegment x1, int x2) { - var mh$ = renamex_np.HANDLE; + public static int fclose(MemorySegment x0) { + var mh$ = fclose.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("renamex_np", x0, x1, x2); + traceDowncall("fclose", x0); } - return (int)mh$.invokeExact(x0, x1, x2); + return (int)mh$.invokeExact(x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class renameatx_np { + private static class feof { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_INT, - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_INT + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("renameatx_np"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("feof"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4387,197 +4130,115 @@ private static class renameatx_np { /** * Function descriptor for: * {@snippet lang=c : - * int renameatx_np(int, const char *, int, const char *, unsigned int) + * int feof(FILE *) * } */ - public static FunctionDescriptor renameatx_np$descriptor() { - return renameatx_np.DESC; + public static FunctionDescriptor feof$descriptor() { + return feof.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int renameatx_np(int, const char *, int, const char *, unsigned int) + * int feof(FILE *) * } */ - public static MethodHandle renameatx_np$handle() { - return renameatx_np.HANDLE; + public static MethodHandle feof$handle() { + return feof.HANDLE; } /** * Address for: * {@snippet lang=c : - * int renameatx_np(int, const char *, int, const char *, unsigned int) + * int feof(FILE *) * } */ - public static MemorySegment renameatx_np$address() { - return renameatx_np.ADDR; + public static MemorySegment feof$address() { + return feof.ADDR; } /** * {@snippet lang=c : - * int renameatx_np(int, const char *, int, const char *, unsigned int) + * int feof(FILE *) * } */ - public static int renameatx_np(int x0, MemorySegment x1, int x2, MemorySegment x3, int x4) { - var mh$ = renameatx_np.HANDLE; + public static int feof(MemorySegment x0) { + var mh$ = feof.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("renameatx_np", x0, x1, x2, x3, x4); + traceDowncall("feof", x0); } - return (int)mh$.invokeExact(x0, x1, x2, x3, x4); + return (int)mh$.invokeExact(x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - /** - * {@snippet lang=c : - * typedef __darwin_off_t fpos_t - * } - */ - public static final OfLong fpos_t = somelib_h.C_LONG_LONG; - private static class __stdinp$constants { - public static final AddressLayout LAYOUT = somelib_h.C_POINTER; - public static final MemorySegment SEGMENT = somelib_h.findOrThrow("__stdinp").reinterpret(LAYOUT.byteSize()); + private static class ferror { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("ferror"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } /** - * Layout for variable: + * Function descriptor for: * {@snippet lang=c : - * extern FILE *__stdinp + * int ferror(FILE *) * } */ - public static AddressLayout __stdinp$layout() { - return __stdinp$constants.LAYOUT; + public static FunctionDescriptor ferror$descriptor() { + return ferror.DESC; } /** - * Segment for variable: + * Downcall method handle for: * {@snippet lang=c : - * extern FILE *__stdinp + * int ferror(FILE *) * } */ - public static MemorySegment __stdinp$segment() { - return __stdinp$constants.SEGMENT; + public static MethodHandle ferror$handle() { + return ferror.HANDLE; } /** - * Getter for variable: + * Address for: * {@snippet lang=c : - * extern FILE *__stdinp + * int ferror(FILE *) * } */ - public static MemorySegment __stdinp() { - return __stdinp$constants.SEGMENT.get(__stdinp$constants.LAYOUT, 0L); + public static MemorySegment ferror$address() { + return ferror.ADDR; } /** - * Setter for variable: * {@snippet lang=c : - * extern FILE *__stdinp + * int ferror(FILE *) * } */ - public static void __stdinp(MemorySegment varValue) { - __stdinp$constants.SEGMENT.set(__stdinp$constants.LAYOUT, 0L, varValue); - } - - private static class __stdoutp$constants { - public static final AddressLayout LAYOUT = somelib_h.C_POINTER; - public static final MemorySegment SEGMENT = somelib_h.findOrThrow("__stdoutp").reinterpret(LAYOUT.byteSize()); - } - - /** - * Layout for variable: - * {@snippet lang=c : - * extern FILE *__stdoutp - * } - */ - public static AddressLayout __stdoutp$layout() { - return __stdoutp$constants.LAYOUT; - } - - /** - * Segment for variable: - * {@snippet lang=c : - * extern FILE *__stdoutp - * } - */ - public static MemorySegment __stdoutp$segment() { - return __stdoutp$constants.SEGMENT; - } - - /** - * Getter for variable: - * {@snippet lang=c : - * extern FILE *__stdoutp - * } - */ - public static MemorySegment __stdoutp() { - return __stdoutp$constants.SEGMENT.get(__stdoutp$constants.LAYOUT, 0L); - } - - /** - * Setter for variable: - * {@snippet lang=c : - * extern FILE *__stdoutp - * } - */ - public static void __stdoutp(MemorySegment varValue) { - __stdoutp$constants.SEGMENT.set(__stdoutp$constants.LAYOUT, 0L, varValue); - } - - private static class __stderrp$constants { - public static final AddressLayout LAYOUT = somelib_h.C_POINTER; - public static final MemorySegment SEGMENT = somelib_h.findOrThrow("__stderrp").reinterpret(LAYOUT.byteSize()); - } - - /** - * Layout for variable: - * {@snippet lang=c : - * extern FILE *__stderrp - * } - */ - public static AddressLayout __stderrp$layout() { - return __stderrp$constants.LAYOUT; - } - - /** - * Segment for variable: - * {@snippet lang=c : - * extern FILE *__stderrp - * } - */ - public static MemorySegment __stderrp$segment() { - return __stderrp$constants.SEGMENT; - } - - /** - * Getter for variable: - * {@snippet lang=c : - * extern FILE *__stderrp - * } - */ - public static MemorySegment __stderrp() { - return __stderrp$constants.SEGMENT.get(__stderrp$constants.LAYOUT, 0L); - } - - /** - * Setter for variable: - * {@snippet lang=c : - * extern FILE *__stderrp - * } - */ - public static void __stderrp(MemorySegment varValue) { - __stderrp$constants.SEGMENT.set(__stderrp$constants.LAYOUT, 0L, varValue); + public static int ferror(MemorySegment x0) { + var mh$ = ferror.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("ferror", x0); + } + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } } - private static class clearerr { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class fflush { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("clearerr"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fflush"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4585,57 +4246,57 @@ private static class clearerr { /** * Function descriptor for: * {@snippet lang=c : - * void clearerr(FILE *) + * int fflush(FILE *) * } */ - public static FunctionDescriptor clearerr$descriptor() { - return clearerr.DESC; + public static FunctionDescriptor fflush$descriptor() { + return fflush.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void clearerr(FILE *) + * int fflush(FILE *) * } */ - public static MethodHandle clearerr$handle() { - return clearerr.HANDLE; + public static MethodHandle fflush$handle() { + return fflush.HANDLE; } /** * Address for: * {@snippet lang=c : - * void clearerr(FILE *) + * int fflush(FILE *) * } */ - public static MemorySegment clearerr$address() { - return clearerr.ADDR; + public static MemorySegment fflush$address() { + return fflush.ADDR; } /** * {@snippet lang=c : - * void clearerr(FILE *) + * int fflush(FILE *) * } */ - public static void clearerr(MemorySegment x0) { - var mh$ = clearerr.HANDLE; + public static int fflush(MemorySegment x0) { + var mh$ = fflush.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("clearerr", x0); + traceDowncall("fflush", x0); } - mh$.invokeExact(x0); + return (int)mh$.invokeExact(x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class fclose { + private static class fgetc { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_INT, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("fclose"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fgetc"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4643,43 +4304,43 @@ private static class fclose { /** * Function descriptor for: * {@snippet lang=c : - * int fclose(FILE *) + * int fgetc(FILE *) * } */ - public static FunctionDescriptor fclose$descriptor() { - return fclose.DESC; + public static FunctionDescriptor fgetc$descriptor() { + return fgetc.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int fclose(FILE *) + * int fgetc(FILE *) * } */ - public static MethodHandle fclose$handle() { - return fclose.HANDLE; + public static MethodHandle fgetc$handle() { + return fgetc.HANDLE; } /** * Address for: * {@snippet lang=c : - * int fclose(FILE *) + * int fgetc(FILE *) * } */ - public static MemorySegment fclose$address() { - return fclose.ADDR; + public static MemorySegment fgetc$address() { + return fgetc.ADDR; } /** * {@snippet lang=c : - * int fclose(FILE *) + * int fgetc(FILE *) * } */ - public static int fclose(MemorySegment x0) { - var mh$ = fclose.HANDLE; + public static int fgetc(MemorySegment x0) { + var mh$ = fgetc.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("fclose", x0); + traceDowncall("fgetc", x0); } return (int)mh$.invokeExact(x0); } catch (Throwable ex$) { @@ -4687,13 +4348,14 @@ public static int fclose(MemorySegment x0) { } } - private static class feof { + private static class fgetpos { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_INT, + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("feof"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fgetpos"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4701,57 +4363,59 @@ private static class feof { /** * Function descriptor for: * {@snippet lang=c : - * int feof(FILE *) + * int fgetpos(FILE *restrict, fpos_t *) * } */ - public static FunctionDescriptor feof$descriptor() { - return feof.DESC; + public static FunctionDescriptor fgetpos$descriptor() { + return fgetpos.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int feof(FILE *) + * int fgetpos(FILE *restrict, fpos_t *) * } */ - public static MethodHandle feof$handle() { - return feof.HANDLE; + public static MethodHandle fgetpos$handle() { + return fgetpos.HANDLE; } /** * Address for: * {@snippet lang=c : - * int feof(FILE *) + * int fgetpos(FILE *restrict, fpos_t *) * } */ - public static MemorySegment feof$address() { - return feof.ADDR; + public static MemorySegment fgetpos$address() { + return fgetpos.ADDR; } /** * {@snippet lang=c : - * int feof(FILE *) + * int fgetpos(FILE *restrict, fpos_t *) * } */ - public static int feof(MemorySegment x0) { - var mh$ = feof.HANDLE; + public static int fgetpos(MemorySegment x0, MemorySegment x1) { + var mh$ = fgetpos.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("feof", x0); + traceDowncall("fgetpos", x0, x1); } - return (int)mh$.invokeExact(x0); + return (int)mh$.invokeExact(x0, x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class ferror { + private static class fgets { public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, somelib_h.C_INT, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("ferror"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fgets"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4759,57 +4423,58 @@ private static class ferror { /** * Function descriptor for: * {@snippet lang=c : - * int ferror(FILE *) + * char *fgets(char *restrict, int, FILE *) * } */ - public static FunctionDescriptor ferror$descriptor() { - return ferror.DESC; + public static FunctionDescriptor fgets$descriptor() { + return fgets.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int ferror(FILE *) + * char *fgets(char *restrict, int, FILE *) * } */ - public static MethodHandle ferror$handle() { - return ferror.HANDLE; + public static MethodHandle fgets$handle() { + return fgets.HANDLE; } /** * Address for: * {@snippet lang=c : - * int ferror(FILE *) + * char *fgets(char *restrict, int, FILE *) * } */ - public static MemorySegment ferror$address() { - return ferror.ADDR; + public static MemorySegment fgets$address() { + return fgets.ADDR; } /** * {@snippet lang=c : - * int ferror(FILE *) + * char *fgets(char *restrict, int, FILE *) * } */ - public static int ferror(MemorySegment x0) { - var mh$ = ferror.HANDLE; + public static MemorySegment fgets(MemorySegment x0, int x1, MemorySegment x2) { + var mh$ = fgets.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("ferror", x0); + traceDowncall("fgets", x0, x1, x2); } - return (int)mh$.invokeExact(x0); + return (MemorySegment)mh$.invokeExact(x0, x1, x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class fflush { + private static class fopen { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("fflush"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fopen"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4817,272 +4482,36 @@ private static class fflush { /** * Function descriptor for: * {@snippet lang=c : - * int fflush(FILE *) + * FILE *fopen(const char *restrict __filename, const char *restrict __mode) * } */ - public static FunctionDescriptor fflush$descriptor() { - return fflush.DESC; + public static FunctionDescriptor fopen$descriptor() { + return fopen.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int fflush(FILE *) + * FILE *fopen(const char *restrict __filename, const char *restrict __mode) * } */ - public static MethodHandle fflush$handle() { - return fflush.HANDLE; + public static MethodHandle fopen$handle() { + return fopen.HANDLE; } /** * Address for: * {@snippet lang=c : - * int fflush(FILE *) + * FILE *fopen(const char *restrict __filename, const char *restrict __mode) * } */ - public static MemorySegment fflush$address() { - return fflush.ADDR; + public static MemorySegment fopen$address() { + return fopen.ADDR; } /** * {@snippet lang=c : - * int fflush(FILE *) - * } - */ - public static int fflush(MemorySegment x0) { - var mh$ = fflush.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("fflush", x0); - } - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class fgetc { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("fgetc"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int fgetc(FILE *) - * } - */ - public static FunctionDescriptor fgetc$descriptor() { - return fgetc.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int fgetc(FILE *) - * } - */ - public static MethodHandle fgetc$handle() { - return fgetc.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int fgetc(FILE *) - * } - */ - public static MemorySegment fgetc$address() { - return fgetc.ADDR; - } - - /** - * {@snippet lang=c : - * int fgetc(FILE *) - * } - */ - public static int fgetc(MemorySegment x0) { - var mh$ = fgetc.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("fgetc", x0); - } - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class fgetpos { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("fgetpos"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int fgetpos(FILE *restrict, fpos_t *) - * } - */ - public static FunctionDescriptor fgetpos$descriptor() { - return fgetpos.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int fgetpos(FILE *restrict, fpos_t *) - * } - */ - public static MethodHandle fgetpos$handle() { - return fgetpos.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int fgetpos(FILE *restrict, fpos_t *) - * } - */ - public static MemorySegment fgetpos$address() { - return fgetpos.ADDR; - } - - /** - * {@snippet lang=c : - * int fgetpos(FILE *restrict, fpos_t *) - * } - */ - public static int fgetpos(MemorySegment x0, MemorySegment x1) { - var mh$ = fgetpos.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("fgetpos", x0, x1); - } - return (int)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class fgets { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("fgets"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * char *fgets(char *restrict, int, FILE *) - * } - */ - public static FunctionDescriptor fgets$descriptor() { - return fgets.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * char *fgets(char *restrict, int, FILE *) - * } - */ - public static MethodHandle fgets$handle() { - return fgets.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * char *fgets(char *restrict, int, FILE *) - * } - */ - public static MemorySegment fgets$address() { - return fgets.ADDR; - } - - /** - * {@snippet lang=c : - * char *fgets(char *restrict, int, FILE *) - * } - */ - public static MemorySegment fgets(MemorySegment x0, int x1, MemorySegment x2) { - var mh$ = fgets.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("fgets", x0, x1, x2); - } - return (MemorySegment)mh$.invokeExact(x0, x1, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class fopen { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("fopen"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * FILE *fopen(const char *restrict __filename, const char *restrict __mode) - * } - */ - public static FunctionDescriptor fopen$descriptor() { - return fopen.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * FILE *fopen(const char *restrict __filename, const char *restrict __mode) - * } - */ - public static MethodHandle fopen$handle() { - return fopen.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * FILE *fopen(const char *restrict __filename, const char *restrict __mode) - * } - */ - public static MemorySegment fopen$address() { - return fopen.ADDR; - } - - /** - * {@snippet lang=c : - * FILE *fopen(const char *restrict __filename, const char *restrict __mode) + * FILE *fopen(const char *restrict __filename, const char *restrict __mode) * } */ public static MemorySegment fopen(MemorySegment __filename, MemorySegment __mode) { @@ -9838,70 +9267,470 @@ public static int __vsnprintf_chk(MemorySegment x0, long x1, int x2, long x3, Me throw new AssertionError("should not reach here", ex$); } } - - private static class CyclicStructA_get_b { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - CyclicStructB.layout() ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("CyclicStructA_get_b"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - /** - * Function descriptor for: * {@snippet lang=c : - * CyclicStructB CyclicStructA_get_b() + * typedef unsigned char uint8_t * } */ - public static FunctionDescriptor CyclicStructA_get_b$descriptor() { - return CyclicStructA_get_b.DESC; - } - + public static final OfByte uint8_t = somelib_h.C_CHAR; /** - * Downcall method handle for: * {@snippet lang=c : - * CyclicStructB CyclicStructA_get_b() + * typedef unsigned short uint16_t * } */ - public static MethodHandle CyclicStructA_get_b$handle() { - return CyclicStructA_get_b.HANDLE; + public static final OfShort uint16_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef unsigned int uint32_t + * } + */ + public static final OfInt uint32_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef unsigned long long uint64_t + * } + */ + public static final OfLong uint64_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef int8_t int_least8_t + * } + */ + public static final OfByte int_least8_t = somelib_h.C_CHAR; + /** + * {@snippet lang=c : + * typedef int16_t int_least16_t + * } + */ + public static final OfShort int_least16_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef int32_t int_least32_t + * } + */ + public static final OfInt int_least32_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef int64_t int_least64_t + * } + */ + public static final OfLong int_least64_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef uint8_t uint_least8_t + * } + */ + public static final OfByte uint_least8_t = somelib_h.C_CHAR; + /** + * {@snippet lang=c : + * typedef uint16_t uint_least16_t + * } + */ + public static final OfShort uint_least16_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef uint32_t uint_least32_t + * } + */ + public static final OfInt uint_least32_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef uint64_t uint_least64_t + * } + */ + public static final OfLong uint_least64_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef int8_t int_fast8_t + * } + */ + public static final OfByte int_fast8_t = somelib_h.C_CHAR; + /** + * {@snippet lang=c : + * typedef int16_t int_fast16_t + * } + */ + public static final OfShort int_fast16_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef int32_t int_fast32_t + * } + */ + public static final OfInt int_fast32_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef int64_t int_fast64_t + * } + */ + public static final OfLong int_fast64_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef uint8_t uint_fast8_t + * } + */ + public static final OfByte uint_fast8_t = somelib_h.C_CHAR; + /** + * {@snippet lang=c : + * typedef uint16_t uint_fast16_t + * } + */ + public static final OfShort uint_fast16_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef uint32_t uint_fast32_t + * } + */ + public static final OfInt uint_fast32_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef uint64_t uint_fast64_t + * } + */ + public static final OfLong uint_fast64_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef long intmax_t + * } + */ + public static final OfLong intmax_t = somelib_h.C_LONG; + /** + * {@snippet lang=c : + * typedef unsigned long uintmax_t + * } + */ + public static final OfLong uintmax_t = somelib_h.C_LONG; + /** + * {@snippet lang=c : + * typedef long ptrdiff_t + * } + */ + public static final OfLong ptrdiff_t = somelib_h.C_LONG; + /** + * {@snippet lang=c : + * typedef unsigned long rsize_t + * } + */ + public static final OfLong rsize_t = somelib_h.C_LONG; + /** + * {@snippet lang=c : + * typedef int wchar_t + * } + */ + public static final OfInt wchar_t = somelib_h.C_INT; + + private static class __assert_rtn { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("__assert_rtn"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void __assert_rtn(const char *, const char *, int, const char *) + * } + */ + public static FunctionDescriptor __assert_rtn$descriptor() { + return __assert_rtn.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void __assert_rtn(const char *, const char *, int, const char *) + * } + */ + public static MethodHandle __assert_rtn$handle() { + return __assert_rtn.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void __assert_rtn(const char *, const char *, int, const char *) + * } + */ + public static MemorySegment __assert_rtn$address() { + return __assert_rtn.ADDR; + } + + /** + * {@snippet lang=c : + * void __assert_rtn(const char *, const char *, int, const char *) + * } + */ + public static void __assert_rtn(MemorySegment x0, MemorySegment x1, int x2, MemorySegment x3) { + var mh$ = __assert_rtn.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("__assert_rtn", x0, x1, x2, x3); + } + mh$.invokeExact(x0, x1, x2, x3); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + /** + * {@snippet lang=c : + * typedef uint_least16_t char16_t + * } + */ + public static final OfShort char16_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef uint_least32_t char32_t + * } + */ + public static final OfInt char32_t = somelib_h.C_INT; + + private static class diplomat_is_str { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_BOOL, + somelib_h.C_POINTER, + somelib_h.C_LONG + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_is_str"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * bool diplomat_is_str(const char *buf, size_t len) + * } + */ + public static FunctionDescriptor diplomat_is_str$descriptor() { + return diplomat_is_str.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * bool diplomat_is_str(const char *buf, size_t len) + * } + */ + public static MethodHandle diplomat_is_str$handle() { + return diplomat_is_str.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * bool diplomat_is_str(const char *buf, size_t len) + * } + */ + public static MemorySegment diplomat_is_str$address() { + return diplomat_is_str.ADDR; + } + + /** + * {@snippet lang=c : + * bool diplomat_is_str(const char *buf, size_t len) + * } + */ + public static boolean diplomat_is_str(MemorySegment buf, long len) { + var mh$ = diplomat_is_str.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("diplomat_is_str", buf, len); + } + return (boolean)mh$.invokeExact(buf, len); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class diplomat_simple_write { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + DiplomatWrite.layout(), + somelib_h.C_POINTER, + somelib_h.C_LONG + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_simple_write"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) + * } + */ + public static FunctionDescriptor diplomat_simple_write$descriptor() { + return diplomat_simple_write.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) + * } + */ + public static MethodHandle diplomat_simple_write$handle() { + return diplomat_simple_write.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) + * } + */ + public static MemorySegment diplomat_simple_write$address() { + return diplomat_simple_write.ADDR; + } + + /** + * {@snippet lang=c : + * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) + * } + */ + public static MemorySegment diplomat_simple_write(SegmentAllocator allocator, MemorySegment buf, long buf_size) { + var mh$ = diplomat_simple_write.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("diplomat_simple_write", allocator, buf, buf_size); + } + return (MemorySegment)mh$.invokeExact(allocator, buf, buf_size); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class diplomat_buffer_write_create { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_LONG + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_create"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * DiplomatWrite *diplomat_buffer_write_create(size_t cap) + * } + */ + public static FunctionDescriptor diplomat_buffer_write_create$descriptor() { + return diplomat_buffer_write_create.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * DiplomatWrite *diplomat_buffer_write_create(size_t cap) + * } + */ + public static MethodHandle diplomat_buffer_write_create$handle() { + return diplomat_buffer_write_create.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * DiplomatWrite *diplomat_buffer_write_create(size_t cap) + * } + */ + public static MemorySegment diplomat_buffer_write_create$address() { + return diplomat_buffer_write_create.ADDR; + } + + /** + * {@snippet lang=c : + * DiplomatWrite *diplomat_buffer_write_create(size_t cap) + * } + */ + public static MemorySegment diplomat_buffer_write_create(long cap) { + var mh$ = diplomat_buffer_write_create.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("diplomat_buffer_write_create", cap); + } + return (MemorySegment)mh$.invokeExact(cap); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class diplomat_buffer_write_get_bytes { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_get_bytes"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) + * } + */ + public static FunctionDescriptor diplomat_buffer_write_get_bytes$descriptor() { + return diplomat_buffer_write_get_bytes.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) + * } + */ + public static MethodHandle diplomat_buffer_write_get_bytes$handle() { + return diplomat_buffer_write_get_bytes.HANDLE; } /** * Address for: * {@snippet lang=c : - * CyclicStructB CyclicStructA_get_b() + * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) * } */ - public static MemorySegment CyclicStructA_get_b$address() { - return CyclicStructA_get_b.ADDR; + public static MemorySegment diplomat_buffer_write_get_bytes$address() { + return diplomat_buffer_write_get_bytes.ADDR; } /** * {@snippet lang=c : - * CyclicStructB CyclicStructA_get_b() + * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) * } */ - public static MemorySegment CyclicStructA_get_b(SegmentAllocator allocator) { - var mh$ = CyclicStructA_get_b.HANDLE; + public static MemorySegment diplomat_buffer_write_get_bytes(MemorySegment t) { + var mh$ = diplomat_buffer_write_get_bytes.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("CyclicStructA_get_b", allocator); + traceDowncall("diplomat_buffer_write_get_bytes", t); } - return (MemorySegment)mh$.invokeExact(allocator); + return (MemorySegment)mh$.invokeExact(t); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Utf16Wrap_from_utf16 { + private static class diplomat_buffer_write_len { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - DiplomatString16View.layout() + somelib_h.C_LONG, + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_from_utf16"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_len"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -9909,57 +9738,56 @@ private static class Utf16Wrap_from_utf16 { /** * Function descriptor for: * {@snippet lang=c : - * Utf16Wrap *Utf16Wrap_from_utf16(DiplomatString16View input) + * size_t diplomat_buffer_write_len(DiplomatWrite *t) * } */ - public static FunctionDescriptor Utf16Wrap_from_utf16$descriptor() { - return Utf16Wrap_from_utf16.DESC; + public static FunctionDescriptor diplomat_buffer_write_len$descriptor() { + return diplomat_buffer_write_len.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Utf16Wrap *Utf16Wrap_from_utf16(DiplomatString16View input) + * size_t diplomat_buffer_write_len(DiplomatWrite *t) * } */ - public static MethodHandle Utf16Wrap_from_utf16$handle() { - return Utf16Wrap_from_utf16.HANDLE; + public static MethodHandle diplomat_buffer_write_len$handle() { + return diplomat_buffer_write_len.HANDLE; } /** * Address for: * {@snippet lang=c : - * Utf16Wrap *Utf16Wrap_from_utf16(DiplomatString16View input) + * size_t diplomat_buffer_write_len(DiplomatWrite *t) * } */ - public static MemorySegment Utf16Wrap_from_utf16$address() { - return Utf16Wrap_from_utf16.ADDR; + public static MemorySegment diplomat_buffer_write_len$address() { + return diplomat_buffer_write_len.ADDR; } /** * {@snippet lang=c : - * Utf16Wrap *Utf16Wrap_from_utf16(DiplomatString16View input) + * size_t diplomat_buffer_write_len(DiplomatWrite *t) * } */ - public static MemorySegment Utf16Wrap_from_utf16(MemorySegment input) { - var mh$ = Utf16Wrap_from_utf16.HANDLE; + public static long diplomat_buffer_write_len(MemorySegment t) { + var mh$ = diplomat_buffer_write_len.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Utf16Wrap_from_utf16", input); + traceDowncall("diplomat_buffer_write_len", t); } - return (MemorySegment)mh$.invokeExact(input); + return (long)mh$.invokeExact(t); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Utf16Wrap_get_debug_str { + private static class diplomat_buffer_write_destroy { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_get_debug_str"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -9967,57 +9795,57 @@ private static class Utf16Wrap_get_debug_str { /** * Function descriptor for: * {@snippet lang=c : - * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) + * void diplomat_buffer_write_destroy(DiplomatWrite *t) * } */ - public static FunctionDescriptor Utf16Wrap_get_debug_str$descriptor() { - return Utf16Wrap_get_debug_str.DESC; + public static FunctionDescriptor diplomat_buffer_write_destroy$descriptor() { + return diplomat_buffer_write_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) + * void diplomat_buffer_write_destroy(DiplomatWrite *t) * } */ - public static MethodHandle Utf16Wrap_get_debug_str$handle() { - return Utf16Wrap_get_debug_str.HANDLE; + public static MethodHandle diplomat_buffer_write_destroy$handle() { + return diplomat_buffer_write_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) + * void diplomat_buffer_write_destroy(DiplomatWrite *t) * } */ - public static MemorySegment Utf16Wrap_get_debug_str$address() { - return Utf16Wrap_get_debug_str.ADDR; + public static MemorySegment diplomat_buffer_write_destroy$address() { + return diplomat_buffer_write_destroy.ADDR; } /** * {@snippet lang=c : - * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) + * void diplomat_buffer_write_destroy(DiplomatWrite *t) * } */ - public static void Utf16Wrap_get_debug_str(MemorySegment self, MemorySegment write) { - var mh$ = Utf16Wrap_get_debug_str.HANDLE; + public static void diplomat_buffer_write_destroy(MemorySegment t) { + var mh$ = diplomat_buffer_write_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Utf16Wrap_get_debug_str", self, write); + traceDowncall("diplomat_buffer_write_destroy", t); } - mh$.invokeExact(self, write); + mh$.invokeExact(t); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Utf16Wrap_borrow_cont { + private static class RefList_node { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - DiplomatString16View.layout(), + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_borrow_cont"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("RefList_node"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10025,56 +9853,178 @@ private static class Utf16Wrap_borrow_cont { /** * Function descriptor for: * {@snippet lang=c : - * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) + * RefList *RefList_node(const RefListParameter *data) * } */ - public static FunctionDescriptor Utf16Wrap_borrow_cont$descriptor() { - return Utf16Wrap_borrow_cont.DESC; + public static FunctionDescriptor RefList_node$descriptor() { + return RefList_node.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) + * RefList *RefList_node(const RefListParameter *data) * } */ - public static MethodHandle Utf16Wrap_borrow_cont$handle() { - return Utf16Wrap_borrow_cont.HANDLE; + public static MethodHandle RefList_node$handle() { + return RefList_node.HANDLE; } /** * Address for: * {@snippet lang=c : - * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) + * RefList *RefList_node(const RefListParameter *data) * } */ - public static MemorySegment Utf16Wrap_borrow_cont$address() { - return Utf16Wrap_borrow_cont.ADDR; + public static MemorySegment RefList_node$address() { + return RefList_node.ADDR; } /** * {@snippet lang=c : - * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) + * RefList *RefList_node(const RefListParameter *data) * } */ - public static MemorySegment Utf16Wrap_borrow_cont(SegmentAllocator allocator, MemorySegment self) { - var mh$ = Utf16Wrap_borrow_cont.HANDLE; + public static MemorySegment RefList_node(MemorySegment data) { + var mh$ = RefList_node.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Utf16Wrap_borrow_cont", allocator, self); + traceDowncall("RefList_node", data); } - return (MemorySegment)mh$.invokeExact(allocator, self); + return (MemorySegment)mh$.invokeExact(data); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Utf16Wrap_destroy { + private static class RefList_destroy { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("RefList_destroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void RefList_destroy(RefList *self) + * } + */ + public static FunctionDescriptor RefList_destroy$descriptor() { + return RefList_destroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void RefList_destroy(RefList *self) + * } + */ + public static MethodHandle RefList_destroy$handle() { + return RefList_destroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void RefList_destroy(RefList *self) + * } + */ + public static MemorySegment RefList_destroy$address() { + return RefList_destroy.ADDR; + } + + /** + * {@snippet lang=c : + * void RefList_destroy(RefList *self) + * } + */ + public static void RefList_destroy(MemorySegment self) { + var mh$ = RefList_destroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("RefList_destroy", self); + } + mh$.invokeExact(self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class NestedBorrowedFields_from_bar_and_foo_and_strings { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + NestedBorrowedFields.layout(), + somelib_h.C_POINTER, + somelib_h.C_POINTER, + DiplomatString16View.layout(), + DiplomatString16View.layout(), + DiplomatStringView.layout(), + DiplomatStringView.layout() + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("NestedBorrowedFields_from_bar_and_foo_and_strings"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, DiplomatString16View dstr16_x, DiplomatString16View dstr16_z, DiplomatStringView utf8_str_y, DiplomatStringView utf8_str_z) + * } + */ + public static FunctionDescriptor NestedBorrowedFields_from_bar_and_foo_and_strings$descriptor() { + return NestedBorrowedFields_from_bar_and_foo_and_strings.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, DiplomatString16View dstr16_x, DiplomatString16View dstr16_z, DiplomatStringView utf8_str_y, DiplomatStringView utf8_str_z) + * } + */ + public static MethodHandle NestedBorrowedFields_from_bar_and_foo_and_strings$handle() { + return NestedBorrowedFields_from_bar_and_foo_and_strings.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, DiplomatString16View dstr16_x, DiplomatString16View dstr16_z, DiplomatStringView utf8_str_y, DiplomatStringView utf8_str_z) + * } + */ + public static MemorySegment NestedBorrowedFields_from_bar_and_foo_and_strings$address() { + return NestedBorrowedFields_from_bar_and_foo_and_strings.ADDR; + } + + /** + * {@snippet lang=c : + * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, DiplomatString16View dstr16_x, DiplomatString16View dstr16_z, DiplomatStringView utf8_str_y, DiplomatStringView utf8_str_z) + * } + */ + public static MemorySegment NestedBorrowedFields_from_bar_and_foo_and_strings(SegmentAllocator allocator, MemorySegment bar, MemorySegment foo, MemorySegment dstr16_x, MemorySegment dstr16_z, MemorySegment utf8_str_y, MemorySegment utf8_str_z) { + var mh$ = NestedBorrowedFields_from_bar_and_foo_and_strings.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("NestedBorrowedFields_from_bar_and_foo_and_strings", allocator, bar, foo, dstr16_x, dstr16_z, utf8_str_y, utf8_str_z); + } + return (MemorySegment)mh$.invokeExact(allocator, bar, foo, dstr16_x, dstr16_z, utf8_str_y, utf8_str_z); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class One_transitivity { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_transitivity"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10082,111 +10032,120 @@ private static class Utf16Wrap_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void Utf16Wrap_destroy(Utf16Wrap *self) + * One *One_transitivity(const One *hold, const One *nohold) * } */ - public static FunctionDescriptor Utf16Wrap_destroy$descriptor() { - return Utf16Wrap_destroy.DESC; + public static FunctionDescriptor One_transitivity$descriptor() { + return One_transitivity.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Utf16Wrap_destroy(Utf16Wrap *self) + * One *One_transitivity(const One *hold, const One *nohold) * } */ - public static MethodHandle Utf16Wrap_destroy$handle() { - return Utf16Wrap_destroy.HANDLE; + public static MethodHandle One_transitivity$handle() { + return One_transitivity.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Utf16Wrap_destroy(Utf16Wrap *self) + * One *One_transitivity(const One *hold, const One *nohold) * } */ - public static MemorySegment Utf16Wrap_destroy$address() { - return Utf16Wrap_destroy.ADDR; + public static MemorySegment One_transitivity$address() { + return One_transitivity.ADDR; } /** * {@snippet lang=c : - * void Utf16Wrap_destroy(Utf16Wrap *self) + * One *One_transitivity(const One *hold, const One *nohold) * } */ - public static void Utf16Wrap_destroy(MemorySegment self) { - var mh$ = Utf16Wrap_destroy.HANDLE; + public static MemorySegment One_transitivity(MemorySegment hold, MemorySegment nohold) { + var mh$ = One_transitivity.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Utf16Wrap_destroy", self); + traceDowncall("One_transitivity", hold, nohold); } - mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(hold, nohold); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static final int MyEnum_A = (int)-2L; - /** - * {@snippet lang=c : - * enum MyEnum.MyEnum_A = -2 - * } - */ - public static int MyEnum_A() { - return MyEnum_A; - } - private static final int MyEnum_B = (int)-1L; - /** - * {@snippet lang=c : - * enum MyEnum.MyEnum_B = -1 - * } - */ - public static int MyEnum_B() { - return MyEnum_B; + + private static class One_cycle { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_cycle"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } - private static final int MyEnum_C = (int)0L; + /** + * Function descriptor for: * {@snippet lang=c : - * enum MyEnum.MyEnum_C = 0 + * One *One_cycle(const Two *hold, const One *nohold) * } */ - public static int MyEnum_C() { - return MyEnum_C; + public static FunctionDescriptor One_cycle$descriptor() { + return One_cycle.DESC; } - private static final int MyEnum_D = (int)1L; + /** + * Downcall method handle for: * {@snippet lang=c : - * enum MyEnum.MyEnum_D = 1 + * One *One_cycle(const Two *hold, const One *nohold) * } */ - public static int MyEnum_D() { - return MyEnum_D; + public static MethodHandle One_cycle$handle() { + return One_cycle.HANDLE; } - private static final int MyEnum_E = (int)2L; + /** + * Address for: * {@snippet lang=c : - * enum MyEnum.MyEnum_E = 2 + * One *One_cycle(const Two *hold, const One *nohold) * } */ - public static int MyEnum_E() { - return MyEnum_E; + public static MemorySegment One_cycle$address() { + return One_cycle.ADDR; } - private static final int MyEnum_F = (int)3L; + /** * {@snippet lang=c : - * enum MyEnum.MyEnum_F = 3 + * One *One_cycle(const Two *hold, const One *nohold) * } */ - public static int MyEnum_F() { - return MyEnum_F; + public static MemorySegment One_cycle(MemorySegment hold, MemorySegment nohold) { + var mh$ = One_cycle.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("One_cycle", hold, nohold); + } + return (MemorySegment)mh$.invokeExact(hold, nohold); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } } - private static class MyEnum_into_value { + private static class One_many_dependents { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_CHAR, - somelib_h.C_INT + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyEnum_into_value"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_many_dependents"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10194,55 +10153,58 @@ private static class MyEnum_into_value { /** * Function descriptor for: * {@snippet lang=c : - * int8_t MyEnum_into_value(MyEnum self) + * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) * } */ - public static FunctionDescriptor MyEnum_into_value$descriptor() { - return MyEnum_into_value.DESC; + public static FunctionDescriptor One_many_dependents$descriptor() { + return One_many_dependents.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int8_t MyEnum_into_value(MyEnum self) + * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) * } */ - public static MethodHandle MyEnum_into_value$handle() { - return MyEnum_into_value.HANDLE; + public static MethodHandle One_many_dependents$handle() { + return One_many_dependents.HANDLE; } /** * Address for: * {@snippet lang=c : - * int8_t MyEnum_into_value(MyEnum self) + * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) * } */ - public static MemorySegment MyEnum_into_value$address() { - return MyEnum_into_value.ADDR; + public static MemorySegment One_many_dependents$address() { + return One_many_dependents.ADDR; } /** * {@snippet lang=c : - * int8_t MyEnum_into_value(MyEnum self) + * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) * } */ - public static byte MyEnum_into_value(int self) { - var mh$ = MyEnum_into_value.HANDLE; + public static MemorySegment One_many_dependents(MemorySegment a, MemorySegment b, MemorySegment c, MemorySegment d, MemorySegment nohold) { + var mh$ = One_many_dependents.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyEnum_into_value", self); + traceDowncall("One_many_dependents", a, b, c, d, nohold); } - return (byte)mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(a, b, c, d, nohold); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyEnum_get_a { + private static class One_return_outlives_param { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT ); + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyEnum_get_a"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_return_outlives_param"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10250,55 +10212,60 @@ private static class MyEnum_get_a { /** * Function descriptor for: * {@snippet lang=c : - * MyEnum MyEnum_get_a() + * One *One_return_outlives_param(const Two *hold, const One *nohold) * } */ - public static FunctionDescriptor MyEnum_get_a$descriptor() { - return MyEnum_get_a.DESC; + public static FunctionDescriptor One_return_outlives_param$descriptor() { + return One_return_outlives_param.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * MyEnum MyEnum_get_a() + * One *One_return_outlives_param(const Two *hold, const One *nohold) * } */ - public static MethodHandle MyEnum_get_a$handle() { - return MyEnum_get_a.HANDLE; + public static MethodHandle One_return_outlives_param$handle() { + return One_return_outlives_param.HANDLE; } /** * Address for: * {@snippet lang=c : - * MyEnum MyEnum_get_a() + * One *One_return_outlives_param(const Two *hold, const One *nohold) * } */ - public static MemorySegment MyEnum_get_a$address() { - return MyEnum_get_a.ADDR; + public static MemorySegment One_return_outlives_param$address() { + return One_return_outlives_param.ADDR; } /** * {@snippet lang=c : - * MyEnum MyEnum_get_a() + * One *One_return_outlives_param(const Two *hold, const One *nohold) * } */ - public static int MyEnum_get_a() { - var mh$ = MyEnum_get_a.HANDLE; + public static MemorySegment One_return_outlives_param(MemorySegment hold, MemorySegment nohold) { + var mh$ = One_return_outlives_param.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyEnum_get_a"); + traceDowncall("One_return_outlives_param", hold, nohold); } - return (int)mh$.invokeExact(); + return (MemorySegment)mh$.invokeExact(hold, nohold); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyStruct_new { + private static class One_diamond_top { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - MyStruct.layout() ); + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyStruct_new"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_top"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10306,57 +10273,60 @@ private static class MyStruct_new { /** * Function descriptor for: * {@snippet lang=c : - * MyStruct MyStruct_new() + * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static FunctionDescriptor MyStruct_new$descriptor() { - return MyStruct_new.DESC; + public static FunctionDescriptor One_diamond_top$descriptor() { + return One_diamond_top.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * MyStruct MyStruct_new() + * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MethodHandle MyStruct_new$handle() { - return MyStruct_new.HANDLE; + public static MethodHandle One_diamond_top$handle() { + return One_diamond_top.HANDLE; } /** * Address for: * {@snippet lang=c : - * MyStruct MyStruct_new() + * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MemorySegment MyStruct_new$address() { - return MyStruct_new.ADDR; + public static MemorySegment One_diamond_top$address() { + return One_diamond_top.ADDR; } /** * {@snippet lang=c : - * MyStruct MyStruct_new() + * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MemorySegment MyStruct_new(SegmentAllocator allocator) { - var mh$ = MyStruct_new.HANDLE; + public static MemorySegment One_diamond_top(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { + var mh$ = One_diamond_top.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyStruct_new", allocator); + traceDowncall("One_diamond_top", top, left, right, bottom); } - return (MemorySegment)mh$.invokeExact(allocator); + return (MemorySegment)mh$.invokeExact(top, left, right, bottom); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyStruct_into_a { + private static class One_diamond_left { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_CHAR, - MyStruct.layout() + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyStruct_into_a"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_left"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10364,57 +10334,60 @@ private static class MyStruct_into_a { /** * Function descriptor for: * {@snippet lang=c : - * uint8_t MyStruct_into_a(MyStruct self) + * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static FunctionDescriptor MyStruct_into_a$descriptor() { - return MyStruct_into_a.DESC; + public static FunctionDescriptor One_diamond_left$descriptor() { + return One_diamond_left.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * uint8_t MyStruct_into_a(MyStruct self) + * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MethodHandle MyStruct_into_a$handle() { - return MyStruct_into_a.HANDLE; + public static MethodHandle One_diamond_left$handle() { + return One_diamond_left.HANDLE; } /** * Address for: * {@snippet lang=c : - * uint8_t MyStruct_into_a(MyStruct self) + * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MemorySegment MyStruct_into_a$address() { - return MyStruct_into_a.ADDR; + public static MemorySegment One_diamond_left$address() { + return One_diamond_left.ADDR; } /** * {@snippet lang=c : - * uint8_t MyStruct_into_a(MyStruct self) + * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static byte MyStruct_into_a(MemorySegment self) { - var mh$ = MyStruct_into_a.HANDLE; + public static MemorySegment One_diamond_left(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { + var mh$ = One_diamond_left.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyStruct_into_a", self); + traceDowncall("One_diamond_left", top, left, right, bottom); } - return (byte)mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(top, left, right, bottom); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Bar_foo { + private static class One_diamond_right { public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Bar_foo"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_right"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10422,56 +10395,60 @@ private static class Bar_foo { /** * Function descriptor for: * {@snippet lang=c : - * const Foo *Bar_foo(const Bar *self) + * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static FunctionDescriptor Bar_foo$descriptor() { - return Bar_foo.DESC; + public static FunctionDescriptor One_diamond_right$descriptor() { + return One_diamond_right.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * const Foo *Bar_foo(const Bar *self) + * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MethodHandle Bar_foo$handle() { - return Bar_foo.HANDLE; + public static MethodHandle One_diamond_right$handle() { + return One_diamond_right.HANDLE; } /** * Address for: * {@snippet lang=c : - * const Foo *Bar_foo(const Bar *self) + * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MemorySegment Bar_foo$address() { - return Bar_foo.ADDR; + public static MemorySegment One_diamond_right$address() { + return One_diamond_right.ADDR; } /** * {@snippet lang=c : - * const Foo *Bar_foo(const Bar *self) + * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MemorySegment Bar_foo(MemorySegment self) { - var mh$ = Bar_foo.HANDLE; + public static MemorySegment One_diamond_right(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { + var mh$ = One_diamond_right.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Bar_foo", self); + traceDowncall("One_diamond_right", top, left, right, bottom); } - return (MemorySegment)mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(top, left, right, bottom); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Bar_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class One_diamond_bottom { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Bar_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_bottom"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10479,57 +10456,61 @@ private static class Bar_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void Bar_destroy(Bar *self) + * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static FunctionDescriptor Bar_destroy$descriptor() { - return Bar_destroy.DESC; + public static FunctionDescriptor One_diamond_bottom$descriptor() { + return One_diamond_bottom.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Bar_destroy(Bar *self) + * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MethodHandle Bar_destroy$handle() { - return Bar_destroy.HANDLE; + public static MethodHandle One_diamond_bottom$handle() { + return One_diamond_bottom.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Bar_destroy(Bar *self) + * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MemorySegment Bar_destroy$address() { - return Bar_destroy.ADDR; + public static MemorySegment One_diamond_bottom$address() { + return One_diamond_bottom.ADDR; } /** * {@snippet lang=c : - * void Bar_destroy(Bar *self) + * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static void Bar_destroy(MemorySegment self) { - var mh$ = Bar_destroy.HANDLE; + public static MemorySegment One_diamond_bottom(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { + var mh$ = One_diamond_bottom.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Bar_destroy", self); + traceDowncall("One_diamond_bottom", top, left, right, bottom); } - mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(top, left, right, bottom); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyString_new { + private static class One_diamond_and_nested_types { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - DiplomatStringView.layout() + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_and_nested_types"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10537,57 +10518,59 @@ private static class MyString_new { /** * Function descriptor for: * {@snippet lang=c : - * MyString *MyString_new(DiplomatStringView v) + * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) * } */ - public static FunctionDescriptor MyString_new$descriptor() { - return MyString_new.DESC; + public static FunctionDescriptor One_diamond_and_nested_types$descriptor() { + return One_diamond_and_nested_types.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * MyString *MyString_new(DiplomatStringView v) + * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) * } */ - public static MethodHandle MyString_new$handle() { - return MyString_new.HANDLE; + public static MethodHandle One_diamond_and_nested_types$handle() { + return One_diamond_and_nested_types.HANDLE; } /** * Address for: * {@snippet lang=c : - * MyString *MyString_new(DiplomatStringView v) + * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) * } */ - public static MemorySegment MyString_new$address() { - return MyString_new.ADDR; + public static MemorySegment One_diamond_and_nested_types$address() { + return One_diamond_and_nested_types.ADDR; } /** * {@snippet lang=c : - * MyString *MyString_new(DiplomatStringView v) + * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) * } */ - public static MemorySegment MyString_new(MemorySegment v) { - var mh$ = MyString_new.HANDLE; + public static MemorySegment One_diamond_and_nested_types(MemorySegment a, MemorySegment b, MemorySegment c, MemorySegment d, MemorySegment nohold) { + var mh$ = One_diamond_and_nested_types.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyString_new", v); + traceDowncall("One_diamond_and_nested_types", a, b, c, d, nohold); } - return (MemorySegment)mh$.invokeExact(v); + return (MemorySegment)mh$.invokeExact(a, b, c, d, nohold); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyString_new_unsafe { + private static class One_implicit_bounds { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - DiplomatStringView.layout() + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new_unsafe"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_implicit_bounds"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10595,57 +10578,60 @@ private static class MyString_new_unsafe { /** * Function descriptor for: * {@snippet lang=c : - * MyString *MyString_new_unsafe(DiplomatStringView v) + * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) * } */ - public static FunctionDescriptor MyString_new_unsafe$descriptor() { - return MyString_new_unsafe.DESC; + public static FunctionDescriptor One_implicit_bounds$descriptor() { + return One_implicit_bounds.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * MyString *MyString_new_unsafe(DiplomatStringView v) + * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) * } */ - public static MethodHandle MyString_new_unsafe$handle() { - return MyString_new_unsafe.HANDLE; + public static MethodHandle One_implicit_bounds$handle() { + return One_implicit_bounds.HANDLE; } /** * Address for: * {@snippet lang=c : - * MyString *MyString_new_unsafe(DiplomatStringView v) + * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) * } */ - public static MemorySegment MyString_new_unsafe$address() { - return MyString_new_unsafe.ADDR; + public static MemorySegment One_implicit_bounds$address() { + return One_implicit_bounds.ADDR; } /** * {@snippet lang=c : - * MyString *MyString_new_unsafe(DiplomatStringView v) + * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) * } */ - public static MemorySegment MyString_new_unsafe(MemorySegment v) { - var mh$ = MyString_new_unsafe.HANDLE; + public static MemorySegment One_implicit_bounds(MemorySegment explicit_hold, MemorySegment implicit_hold, MemorySegment nohold) { + var mh$ = One_implicit_bounds.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyString_new_unsafe", v); + traceDowncall("One_implicit_bounds", explicit_hold, implicit_hold, nohold); } - return (MemorySegment)mh$.invokeExact(v); + return (MemorySegment)mh$.invokeExact(explicit_hold, implicit_hold, nohold); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyString_new_owned { + private static class One_implicit_bounds_deep { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - DiplomatStringView.layout() + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new_owned"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_implicit_bounds_deep"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10653,57 +10639,56 @@ private static class MyString_new_owned { /** * Function descriptor for: * {@snippet lang=c : - * MyString *MyString_new_owned(DiplomatStringView v) + * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) * } */ - public static FunctionDescriptor MyString_new_owned$descriptor() { - return MyString_new_owned.DESC; + public static FunctionDescriptor One_implicit_bounds_deep$descriptor() { + return One_implicit_bounds_deep.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * MyString *MyString_new_owned(DiplomatStringView v) + * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) * } */ - public static MethodHandle MyString_new_owned$handle() { - return MyString_new_owned.HANDLE; + public static MethodHandle One_implicit_bounds_deep$handle() { + return One_implicit_bounds_deep.HANDLE; } /** * Address for: * {@snippet lang=c : - * MyString *MyString_new_owned(DiplomatStringView v) + * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) * } */ - public static MemorySegment MyString_new_owned$address() { - return MyString_new_owned.ADDR; + public static MemorySegment One_implicit_bounds_deep$address() { + return One_implicit_bounds_deep.ADDR; } /** * {@snippet lang=c : - * MyString *MyString_new_owned(DiplomatStringView v) + * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) * } */ - public static MemorySegment MyString_new_owned(MemorySegment v) { - var mh$ = MyString_new_owned.HANDLE; + public static MemorySegment One_implicit_bounds_deep(MemorySegment explicit_, MemorySegment implicit_1, MemorySegment implicit_2, MemorySegment nohold) { + var mh$ = One_implicit_bounds_deep.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyString_new_owned", v); + traceDowncall("One_implicit_bounds_deep", explicit_, implicit_1, implicit_2, nohold); } - return (MemorySegment)mh$.invokeExact(v); + return (MemorySegment)mh$.invokeExact(explicit_, implicit_1, implicit_2, nohold); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyString_new_from_first { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - DiplomatStringsView.layout() + private static class One_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new_from_first"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10711,57 +10696,57 @@ private static class MyString_new_from_first { /** * Function descriptor for: * {@snippet lang=c : - * MyString *MyString_new_from_first(DiplomatStringsView v) + * void One_destroy(One *self) * } */ - public static FunctionDescriptor MyString_new_from_first$descriptor() { - return MyString_new_from_first.DESC; + public static FunctionDescriptor One_destroy$descriptor() { + return One_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * MyString *MyString_new_from_first(DiplomatStringsView v) + * void One_destroy(One *self) * } */ - public static MethodHandle MyString_new_from_first$handle() { - return MyString_new_from_first.HANDLE; + public static MethodHandle One_destroy$handle() { + return One_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * MyString *MyString_new_from_first(DiplomatStringsView v) + * void One_destroy(One *self) * } */ - public static MemorySegment MyString_new_from_first$address() { - return MyString_new_from_first.ADDR; + public static MemorySegment One_destroy$address() { + return One_destroy.ADDR; } /** * {@snippet lang=c : - * MyString *MyString_new_from_first(DiplomatStringsView v) + * void One_destroy(One *self) * } */ - public static MemorySegment MyString_new_from_first(MemorySegment v) { - var mh$ = MyString_new_from_first.HANDLE; + public static void One_destroy(MemorySegment self) { + var mh$ = One_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyString_new_from_first", v); + traceDowncall("One_destroy", self); } - return (MemorySegment)mh$.invokeExact(v); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyString_set_str { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class Bar_foo { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - DiplomatStringView.layout() + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_set_str"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Bar_foo"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10769,57 +10754,56 @@ private static class MyString_set_str { /** * Function descriptor for: * {@snippet lang=c : - * void MyString_set_str(MyString *self, DiplomatStringView new_str) + * const Foo *Bar_foo(const Bar *self) * } */ - public static FunctionDescriptor MyString_set_str$descriptor() { - return MyString_set_str.DESC; + public static FunctionDescriptor Bar_foo$descriptor() { + return Bar_foo.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void MyString_set_str(MyString *self, DiplomatStringView new_str) + * const Foo *Bar_foo(const Bar *self) * } */ - public static MethodHandle MyString_set_str$handle() { - return MyString_set_str.HANDLE; + public static MethodHandle Bar_foo$handle() { + return Bar_foo.HANDLE; } /** * Address for: * {@snippet lang=c : - * void MyString_set_str(MyString *self, DiplomatStringView new_str) + * const Foo *Bar_foo(const Bar *self) * } */ - public static MemorySegment MyString_set_str$address() { - return MyString_set_str.ADDR; + public static MemorySegment Bar_foo$address() { + return Bar_foo.ADDR; } /** * {@snippet lang=c : - * void MyString_set_str(MyString *self, DiplomatStringView new_str) + * const Foo *Bar_foo(const Bar *self) * } */ - public static void MyString_set_str(MemorySegment self, MemorySegment new_str) { - var mh$ = MyString_set_str.HANDLE; + public static MemorySegment Bar_foo(MemorySegment self) { + var mh$ = Bar_foo.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyString_set_str", self, new_str); + traceDowncall("Bar_foo", self); } - mh$.invokeExact(self, new_str); + return (MemorySegment)mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyString_get_str { + private static class Bar_destroy { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_get_str"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Bar_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10827,57 +10811,77 @@ private static class MyString_get_str { /** * Function descriptor for: * {@snippet lang=c : - * void MyString_get_str(const MyString *self, DiplomatWrite *write) + * void Bar_destroy(Bar *self) * } */ - public static FunctionDescriptor MyString_get_str$descriptor() { - return MyString_get_str.DESC; + public static FunctionDescriptor Bar_destroy$descriptor() { + return Bar_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void MyString_get_str(const MyString *self, DiplomatWrite *write) + * void Bar_destroy(Bar *self) * } */ - public static MethodHandle MyString_get_str$handle() { - return MyString_get_str.HANDLE; + public static MethodHandle Bar_destroy$handle() { + return Bar_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * void MyString_get_str(const MyString *self, DiplomatWrite *write) + * void Bar_destroy(Bar *self) * } */ - public static MemorySegment MyString_get_str$address() { - return MyString_get_str.ADDR; + public static MemorySegment Bar_destroy$address() { + return Bar_destroy.ADDR; } /** * {@snippet lang=c : - * void MyString_get_str(const MyString *self, DiplomatWrite *write) + * void Bar_destroy(Bar *self) * } */ - public static void MyString_get_str(MemorySegment self, MemorySegment write) { - var mh$ = MyString_get_str.HANDLE; + public static void Bar_destroy(MemorySegment self) { + var mh$ = Bar_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyString_get_str", self, write); + traceDowncall("Bar_destroy", self); } - mh$.invokeExact(self, write); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } + private static final int ErrorEnum_Foo = (int)0L; + /** + * {@snippet lang=c : + * enum ErrorEnum.ErrorEnum_Foo = 0 + * } + */ + public static int ErrorEnum_Foo() { + return ErrorEnum_Foo; + } + private static final int ErrorEnum_Bar = (int)1L; + /** + * {@snippet lang=c : + * enum ErrorEnum.ErrorEnum_Bar = 1 + * } + */ + public static int ErrorEnum_Bar() { + return ErrorEnum_Bar; + } - private static class MyString_string_transform { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - DiplomatStringView.layout(), - somelib_h.C_POINTER + private static class BorrowedFieldsWithBounds_from_foo_and_strings { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + BorrowedFieldsWithBounds.layout(), + somelib_h.C_POINTER, + DiplomatString16View.layout(), + DiplomatStringView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_string_transform"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("BorrowedFieldsWithBounds_from_foo_and_strings"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10885,116 +10889,120 @@ private static class MyString_string_transform { /** * Function descriptor for: * {@snippet lang=c : - * void MyString_string_transform(DiplomatStringView foo, DiplomatWrite *write) + * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, DiplomatString16View dstr16_x, DiplomatStringView utf8_str_z) * } */ - public static FunctionDescriptor MyString_string_transform$descriptor() { - return MyString_string_transform.DESC; + public static FunctionDescriptor BorrowedFieldsWithBounds_from_foo_and_strings$descriptor() { + return BorrowedFieldsWithBounds_from_foo_and_strings.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void MyString_string_transform(DiplomatStringView foo, DiplomatWrite *write) + * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, DiplomatString16View dstr16_x, DiplomatStringView utf8_str_z) * } */ - public static MethodHandle MyString_string_transform$handle() { - return MyString_string_transform.HANDLE; + public static MethodHandle BorrowedFieldsWithBounds_from_foo_and_strings$handle() { + return BorrowedFieldsWithBounds_from_foo_and_strings.HANDLE; } /** * Address for: * {@snippet lang=c : - * void MyString_string_transform(DiplomatStringView foo, DiplomatWrite *write) + * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, DiplomatString16View dstr16_x, DiplomatStringView utf8_str_z) * } */ - public static MemorySegment MyString_string_transform$address() { - return MyString_string_transform.ADDR; + public static MemorySegment BorrowedFieldsWithBounds_from_foo_and_strings$address() { + return BorrowedFieldsWithBounds_from_foo_and_strings.ADDR; } /** * {@snippet lang=c : - * void MyString_string_transform(DiplomatStringView foo, DiplomatWrite *write) + * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, DiplomatString16View dstr16_x, DiplomatStringView utf8_str_z) * } */ - public static void MyString_string_transform(MemorySegment foo, MemorySegment write) { - var mh$ = MyString_string_transform.HANDLE; + public static MemorySegment BorrowedFieldsWithBounds_from_foo_and_strings(SegmentAllocator allocator, MemorySegment foo, MemorySegment dstr16_x, MemorySegment utf8_str_z) { + var mh$ = BorrowedFieldsWithBounds_from_foo_and_strings.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyString_string_transform", foo, write); + traceDowncall("BorrowedFieldsWithBounds_from_foo_and_strings", allocator, foo, dstr16_x, utf8_str_z); } - mh$.invokeExact(foo, write); + return (MemorySegment)mh$.invokeExact(allocator, foo, dstr16_x, utf8_str_z); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - - private static class MyString_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_destroy"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + private static final int ContiguousEnum_C = (int)0L; + /** + * {@snippet lang=c : + * enum ContiguousEnum.ContiguousEnum_C = 0 + * } + */ + public static int ContiguousEnum_C() { + return ContiguousEnum_C; } - + private static final int ContiguousEnum_D = (int)1L; /** - * Function descriptor for: * {@snippet lang=c : - * void MyString_destroy(MyString *self) + * enum ContiguousEnum.ContiguousEnum_D = 1 * } */ - public static FunctionDescriptor MyString_destroy$descriptor() { - return MyString_destroy.DESC; + public static int ContiguousEnum_D() { + return ContiguousEnum_D; } - + private static final int ContiguousEnum_E = (int)2L; /** - * Downcall method handle for: * {@snippet lang=c : - * void MyString_destroy(MyString *self) + * enum ContiguousEnum.ContiguousEnum_E = 2 * } */ - public static MethodHandle MyString_destroy$handle() { - return MyString_destroy.HANDLE; + public static int ContiguousEnum_E() { + return ContiguousEnum_E; } - + private static final int ContiguousEnum_F = (int)3L; /** - * Address for: * {@snippet lang=c : - * void MyString_destroy(MyString *self) + * enum ContiguousEnum.ContiguousEnum_F = 3 * } */ - public static MemorySegment MyString_destroy$address() { - return MyString_destroy.ADDR; + public static int ContiguousEnum_F() { + return ContiguousEnum_F; } - + private static final int UnimportedEnum_A = (int)0L; /** * {@snippet lang=c : - * void MyString_destroy(MyString *self) + * enum UnimportedEnum.UnimportedEnum_A = 0 * } */ - public static void MyString_destroy(MemorySegment self) { - var mh$ = MyString_destroy.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("MyString_destroy", self); - } - mh$.invokeExact(self); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } + public static int UnimportedEnum_A() { + return UnimportedEnum_A; + } + private static final int UnimportedEnum_B = (int)1L; + /** + * {@snippet lang=c : + * enum UnimportedEnum.UnimportedEnum_B = 1 + * } + */ + public static int UnimportedEnum_B() { + return UnimportedEnum_B; + } + private static final int UnimportedEnum_C = (int)2L; + /** + * {@snippet lang=c : + * enum UnimportedEnum.UnimportedEnum_C = 2 + * } + */ + public static int UnimportedEnum_C() { + return UnimportedEnum_C; } - private static class BorrowedFields_from_bar_and_strings { + private static class Float64Vec_new_bool { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - BorrowedFields.layout(), somelib_h.C_POINTER, - DiplomatString16View.layout(), - DiplomatStringView.layout() + DiplomatBoolView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("BorrowedFields_from_bar_and_strings"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_bool"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11002,95 +11010,115 @@ private static class BorrowedFields_from_bar_and_strings { /** * Function descriptor for: * {@snippet lang=c : - * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, DiplomatString16View dstr16, DiplomatStringView utf8_str) + * Float64Vec *Float64Vec_new_bool(DiplomatBoolView v) * } */ - public static FunctionDescriptor BorrowedFields_from_bar_and_strings$descriptor() { - return BorrowedFields_from_bar_and_strings.DESC; + public static FunctionDescriptor Float64Vec_new_bool$descriptor() { + return Float64Vec_new_bool.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, DiplomatString16View dstr16, DiplomatStringView utf8_str) + * Float64Vec *Float64Vec_new_bool(DiplomatBoolView v) * } */ - public static MethodHandle BorrowedFields_from_bar_and_strings$handle() { - return BorrowedFields_from_bar_and_strings.HANDLE; + public static MethodHandle Float64Vec_new_bool$handle() { + return Float64Vec_new_bool.HANDLE; } /** * Address for: * {@snippet lang=c : - * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, DiplomatString16View dstr16, DiplomatStringView utf8_str) + * Float64Vec *Float64Vec_new_bool(DiplomatBoolView v) * } */ - public static MemorySegment BorrowedFields_from_bar_and_strings$address() { - return BorrowedFields_from_bar_and_strings.ADDR; + public static MemorySegment Float64Vec_new_bool$address() { + return Float64Vec_new_bool.ADDR; } /** * {@snippet lang=c : - * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, DiplomatString16View dstr16, DiplomatStringView utf8_str) + * Float64Vec *Float64Vec_new_bool(DiplomatBoolView v) * } */ - public static MemorySegment BorrowedFields_from_bar_and_strings(SegmentAllocator allocator, MemorySegment bar, MemorySegment dstr16, MemorySegment utf8_str) { - var mh$ = BorrowedFields_from_bar_and_strings.HANDLE; + public static MemorySegment Float64Vec_new_bool(MemorySegment v) { + var mh$ = Float64Vec_new_bool.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("BorrowedFields_from_bar_and_strings", allocator, bar, dstr16, utf8_str); + traceDowncall("Float64Vec_new_bool", v); } - return (MemorySegment)mh$.invokeExact(allocator, bar, dstr16, utf8_str); + return (MemorySegment)mh$.invokeExact(v); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static final int ContiguousEnum_C = (int)0L; + + private static class Float64Vec_new_i16 { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + DiplomatI16View.layout() + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_i16"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + /** + * Function descriptor for: * {@snippet lang=c : - * enum ContiguousEnum.ContiguousEnum_C = 0 + * Float64Vec *Float64Vec_new_i16(DiplomatI16View v) * } */ - public static int ContiguousEnum_C() { - return ContiguousEnum_C; + public static FunctionDescriptor Float64Vec_new_i16$descriptor() { + return Float64Vec_new_i16.DESC; } - private static final int ContiguousEnum_D = (int)1L; + /** + * Downcall method handle for: * {@snippet lang=c : - * enum ContiguousEnum.ContiguousEnum_D = 1 + * Float64Vec *Float64Vec_new_i16(DiplomatI16View v) * } */ - public static int ContiguousEnum_D() { - return ContiguousEnum_D; + public static MethodHandle Float64Vec_new_i16$handle() { + return Float64Vec_new_i16.HANDLE; } - private static final int ContiguousEnum_E = (int)2L; + /** + * Address for: * {@snippet lang=c : - * enum ContiguousEnum.ContiguousEnum_E = 2 + * Float64Vec *Float64Vec_new_i16(DiplomatI16View v) * } */ - public static int ContiguousEnum_E() { - return ContiguousEnum_E; + public static MemorySegment Float64Vec_new_i16$address() { + return Float64Vec_new_i16.ADDR; } - private static final int ContiguousEnum_F = (int)3L; + /** * {@snippet lang=c : - * enum ContiguousEnum.ContiguousEnum_F = 3 + * Float64Vec *Float64Vec_new_i16(DiplomatI16View v) * } */ - public static int ContiguousEnum_F() { - return ContiguousEnum_F; + public static MemorySegment Float64Vec_new_i16(MemorySegment v) { + var mh$ = Float64Vec_new_i16.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Float64Vec_new_i16", v); + } + return (MemorySegment)mh$.invokeExact(v); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } } - private static class BorrowedFieldsWithBounds_from_foo_and_strings { + private static class Float64Vec_new_u16 { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - BorrowedFieldsWithBounds.layout(), somelib_h.C_POINTER, - DiplomatString16View.layout(), - DiplomatStringView.layout() + DiplomatU16View.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("BorrowedFieldsWithBounds_from_foo_and_strings"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_u16"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11098,82 +11126,57 @@ private static class BorrowedFieldsWithBounds_from_foo_and_strings { /** * Function descriptor for: * {@snippet lang=c : - * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, DiplomatString16View dstr16_x, DiplomatStringView utf8_str_z) + * Float64Vec *Float64Vec_new_u16(DiplomatU16View v) * } */ - public static FunctionDescriptor BorrowedFieldsWithBounds_from_foo_and_strings$descriptor() { - return BorrowedFieldsWithBounds_from_foo_and_strings.DESC; + public static FunctionDescriptor Float64Vec_new_u16$descriptor() { + return Float64Vec_new_u16.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, DiplomatString16View dstr16_x, DiplomatStringView utf8_str_z) + * Float64Vec *Float64Vec_new_u16(DiplomatU16View v) * } */ - public static MethodHandle BorrowedFieldsWithBounds_from_foo_and_strings$handle() { - return BorrowedFieldsWithBounds_from_foo_and_strings.HANDLE; + public static MethodHandle Float64Vec_new_u16$handle() { + return Float64Vec_new_u16.HANDLE; } /** * Address for: * {@snippet lang=c : - * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, DiplomatString16View dstr16_x, DiplomatStringView utf8_str_z) + * Float64Vec *Float64Vec_new_u16(DiplomatU16View v) * } */ - public static MemorySegment BorrowedFieldsWithBounds_from_foo_and_strings$address() { - return BorrowedFieldsWithBounds_from_foo_and_strings.ADDR; + public static MemorySegment Float64Vec_new_u16$address() { + return Float64Vec_new_u16.ADDR; } /** * {@snippet lang=c : - * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, DiplomatString16View dstr16_x, DiplomatStringView utf8_str_z) + * Float64Vec *Float64Vec_new_u16(DiplomatU16View v) * } */ - public static MemorySegment BorrowedFieldsWithBounds_from_foo_and_strings(SegmentAllocator allocator, MemorySegment foo, MemorySegment dstr16_x, MemorySegment utf8_str_z) { - var mh$ = BorrowedFieldsWithBounds_from_foo_and_strings.HANDLE; + public static MemorySegment Float64Vec_new_u16(MemorySegment v) { + var mh$ = Float64Vec_new_u16.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("BorrowedFieldsWithBounds_from_foo_and_strings", allocator, foo, dstr16_x, utf8_str_z); + traceDowncall("Float64Vec_new_u16", v); } - return (MemorySegment)mh$.invokeExact(allocator, foo, dstr16_x, utf8_str_z); + return (MemorySegment)mh$.invokeExact(v); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static final int UnimportedEnum_A = (int)0L; - /** - * {@snippet lang=c : - * enum UnimportedEnum.UnimportedEnum_A = 0 - * } - */ - public static int UnimportedEnum_A() { - return UnimportedEnum_A; - } - private static final int UnimportedEnum_B = (int)1L; - /** - * {@snippet lang=c : - * enum UnimportedEnum.UnimportedEnum_B = 1 - * } - */ - public static int UnimportedEnum_B() { - return UnimportedEnum_B; - } - private static final int UnimportedEnum_C = (int)2L; - /** - * {@snippet lang=c : - * enum UnimportedEnum.UnimportedEnum_C = 2 - * } - */ - public static int UnimportedEnum_C() { - return UnimportedEnum_C; - } - private static class Opaque_new { + private static class Float64Vec_new_isize { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER ); + somelib_h.C_POINTER, + DiplomatIsizeView.layout() + ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_new"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_isize"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11181,57 +11184,57 @@ private static class Opaque_new { /** * Function descriptor for: * {@snippet lang=c : - * Opaque *Opaque_new() + * Float64Vec *Float64Vec_new_isize(DiplomatIsizeView v) * } */ - public static FunctionDescriptor Opaque_new$descriptor() { - return Opaque_new.DESC; + public static FunctionDescriptor Float64Vec_new_isize$descriptor() { + return Float64Vec_new_isize.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Opaque *Opaque_new() + * Float64Vec *Float64Vec_new_isize(DiplomatIsizeView v) * } */ - public static MethodHandle Opaque_new$handle() { - return Opaque_new.HANDLE; + public static MethodHandle Float64Vec_new_isize$handle() { + return Float64Vec_new_isize.HANDLE; } /** * Address for: * {@snippet lang=c : - * Opaque *Opaque_new() + * Float64Vec *Float64Vec_new_isize(DiplomatIsizeView v) * } */ - public static MemorySegment Opaque_new$address() { - return Opaque_new.ADDR; + public static MemorySegment Float64Vec_new_isize$address() { + return Float64Vec_new_isize.ADDR; } /** * {@snippet lang=c : - * Opaque *Opaque_new() + * Float64Vec *Float64Vec_new_isize(DiplomatIsizeView v) * } */ - public static MemorySegment Opaque_new() { - var mh$ = Opaque_new.HANDLE; + public static MemorySegment Float64Vec_new_isize(MemorySegment v) { + var mh$ = Float64Vec_new_isize.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_new"); + traceDowncall("Float64Vec_new_isize", v); } - return (MemorySegment)mh$.invokeExact(); + return (MemorySegment)mh$.invokeExact(v); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Opaque_from_str { + private static class Float64Vec_new_usize { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - DiplomatStringView.layout() + DiplomatUsizeView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_from_str"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_usize"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11239,57 +11242,57 @@ private static class Opaque_from_str { /** * Function descriptor for: * {@snippet lang=c : - * Opaque *Opaque_from_str(DiplomatStringView input) + * Float64Vec *Float64Vec_new_usize(DiplomatUsizeView v) * } */ - public static FunctionDescriptor Opaque_from_str$descriptor() { - return Opaque_from_str.DESC; + public static FunctionDescriptor Float64Vec_new_usize$descriptor() { + return Float64Vec_new_usize.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Opaque *Opaque_from_str(DiplomatStringView input) + * Float64Vec *Float64Vec_new_usize(DiplomatUsizeView v) * } */ - public static MethodHandle Opaque_from_str$handle() { - return Opaque_from_str.HANDLE; + public static MethodHandle Float64Vec_new_usize$handle() { + return Float64Vec_new_usize.HANDLE; } /** * Address for: * {@snippet lang=c : - * Opaque *Opaque_from_str(DiplomatStringView input) + * Float64Vec *Float64Vec_new_usize(DiplomatUsizeView v) * } */ - public static MemorySegment Opaque_from_str$address() { - return Opaque_from_str.ADDR; + public static MemorySegment Float64Vec_new_usize$address() { + return Float64Vec_new_usize.ADDR; } /** * {@snippet lang=c : - * Opaque *Opaque_from_str(DiplomatStringView input) + * Float64Vec *Float64Vec_new_usize(DiplomatUsizeView v) * } */ - public static MemorySegment Opaque_from_str(MemorySegment input) { - var mh$ = Opaque_from_str.HANDLE; + public static MemorySegment Float64Vec_new_usize(MemorySegment v) { + var mh$ = Float64Vec_new_usize.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_from_str", input); + traceDowncall("Float64Vec_new_usize", v); } - return (MemorySegment)mh$.invokeExact(input); + return (MemorySegment)mh$.invokeExact(v); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Opaque_get_debug_str { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class Float64Vec_new_f64_be_bytes { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - somelib_h.C_POINTER + DiplomatU8View.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_get_debug_str"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_f64_be_bytes"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11297,57 +11300,57 @@ private static class Opaque_get_debug_str { /** * Function descriptor for: * {@snippet lang=c : - * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) + * Float64Vec *Float64Vec_new_f64_be_bytes(DiplomatU8View v) * } */ - public static FunctionDescriptor Opaque_get_debug_str$descriptor() { - return Opaque_get_debug_str.DESC; + public static FunctionDescriptor Float64Vec_new_f64_be_bytes$descriptor() { + return Float64Vec_new_f64_be_bytes.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) + * Float64Vec *Float64Vec_new_f64_be_bytes(DiplomatU8View v) * } */ - public static MethodHandle Opaque_get_debug_str$handle() { - return Opaque_get_debug_str.HANDLE; + public static MethodHandle Float64Vec_new_f64_be_bytes$handle() { + return Float64Vec_new_f64_be_bytes.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) + * Float64Vec *Float64Vec_new_f64_be_bytes(DiplomatU8View v) * } */ - public static MemorySegment Opaque_get_debug_str$address() { - return Opaque_get_debug_str.ADDR; + public static MemorySegment Float64Vec_new_f64_be_bytes$address() { + return Float64Vec_new_f64_be_bytes.ADDR; } /** * {@snippet lang=c : - * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) + * Float64Vec *Float64Vec_new_f64_be_bytes(DiplomatU8View v) * } */ - public static void Opaque_get_debug_str(MemorySegment self, MemorySegment write) { - var mh$ = Opaque_get_debug_str.HANDLE; + public static MemorySegment Float64Vec_new_f64_be_bytes(MemorySegment v) { + var mh$ = Float64Vec_new_f64_be_bytes.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_get_debug_str", self, write); + traceDowncall("Float64Vec_new_f64_be_bytes", v); } - mh$.invokeExact(self, write); + return (MemorySegment)mh$.invokeExact(v); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Opaque_assert_struct { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class Float64Vec_new_from_owned { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - MyStruct.layout() + DiplomatF64ViewMut.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_assert_struct"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_from_owned"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11355,55 +11358,57 @@ private static class Opaque_assert_struct { /** * Function descriptor for: * {@snippet lang=c : - * void Opaque_assert_struct(const Opaque *self, MyStruct s) + * Float64Vec *Float64Vec_new_from_owned(DiplomatF64ViewMut v) * } */ - public static FunctionDescriptor Opaque_assert_struct$descriptor() { - return Opaque_assert_struct.DESC; + public static FunctionDescriptor Float64Vec_new_from_owned$descriptor() { + return Float64Vec_new_from_owned.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Opaque_assert_struct(const Opaque *self, MyStruct s) + * Float64Vec *Float64Vec_new_from_owned(DiplomatF64ViewMut v) * } */ - public static MethodHandle Opaque_assert_struct$handle() { - return Opaque_assert_struct.HANDLE; + public static MethodHandle Float64Vec_new_from_owned$handle() { + return Float64Vec_new_from_owned.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Opaque_assert_struct(const Opaque *self, MyStruct s) + * Float64Vec *Float64Vec_new_from_owned(DiplomatF64ViewMut v) * } */ - public static MemorySegment Opaque_assert_struct$address() { - return Opaque_assert_struct.ADDR; + public static MemorySegment Float64Vec_new_from_owned$address() { + return Float64Vec_new_from_owned.ADDR; } /** * {@snippet lang=c : - * void Opaque_assert_struct(const Opaque *self, MyStruct s) + * Float64Vec *Float64Vec_new_from_owned(DiplomatF64ViewMut v) * } */ - public static void Opaque_assert_struct(MemorySegment self, MemorySegment s) { - var mh$ = Opaque_assert_struct.HANDLE; + public static MemorySegment Float64Vec_new_from_owned(MemorySegment v) { + var mh$ = Float64Vec_new_from_owned.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_assert_struct", self, s); + traceDowncall("Float64Vec_new_from_owned", v); } - mh$.invokeExact(self, s); + return (MemorySegment)mh$.invokeExact(v); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Opaque_returns_usize { + private static class Float64Vec_as_slice { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_LONG ); + DiplomatF64View.layout(), + somelib_h.C_POINTER + ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_returns_usize"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_as_slice"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11411,57 +11416,57 @@ private static class Opaque_returns_usize { /** * Function descriptor for: * {@snippet lang=c : - * size_t Opaque_returns_usize() + * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) * } */ - public static FunctionDescriptor Opaque_returns_usize$descriptor() { - return Opaque_returns_usize.DESC; + public static FunctionDescriptor Float64Vec_as_slice$descriptor() { + return Float64Vec_as_slice.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * size_t Opaque_returns_usize() + * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) * } */ - public static MethodHandle Opaque_returns_usize$handle() { - return Opaque_returns_usize.HANDLE; + public static MethodHandle Float64Vec_as_slice$handle() { + return Float64Vec_as_slice.HANDLE; } /** * Address for: * {@snippet lang=c : - * size_t Opaque_returns_usize() + * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) * } */ - public static MemorySegment Opaque_returns_usize$address() { - return Opaque_returns_usize.ADDR; + public static MemorySegment Float64Vec_as_slice$address() { + return Float64Vec_as_slice.ADDR; } /** * {@snippet lang=c : - * size_t Opaque_returns_usize() + * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) * } */ - public static long Opaque_returns_usize() { - var mh$ = Opaque_returns_usize.HANDLE; + public static MemorySegment Float64Vec_as_slice(SegmentAllocator allocator, MemorySegment self) { + var mh$ = Float64Vec_as_slice.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_returns_usize"); + traceDowncall("Float64Vec_as_slice", allocator, self); } - return (long)mh$.invokeExact(); + return (MemorySegment)mh$.invokeExact(allocator, self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Opaque_internal_len { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_LONG, - somelib_h.C_POINTER + private static class Float64Vec_fill_slice { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, + DiplomatF64ViewMut.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_internal_len"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_fill_slice"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11469,55 +11474,57 @@ private static class Opaque_internal_len { /** * Function descriptor for: * {@snippet lang=c : - * size_t Opaque_internal_len(const Opaque *self) + * void Float64Vec_fill_slice(const Float64Vec *self, DiplomatF64ViewMut v) * } */ - public static FunctionDescriptor Opaque_internal_len$descriptor() { - return Opaque_internal_len.DESC; + public static FunctionDescriptor Float64Vec_fill_slice$descriptor() { + return Float64Vec_fill_slice.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * size_t Opaque_internal_len(const Opaque *self) + * void Float64Vec_fill_slice(const Float64Vec *self, DiplomatF64ViewMut v) * } */ - public static MethodHandle Opaque_internal_len$handle() { - return Opaque_internal_len.HANDLE; + public static MethodHandle Float64Vec_fill_slice$handle() { + return Float64Vec_fill_slice.HANDLE; } /** * Address for: * {@snippet lang=c : - * size_t Opaque_internal_len(const Opaque *self) + * void Float64Vec_fill_slice(const Float64Vec *self, DiplomatF64ViewMut v) * } */ - public static MemorySegment Opaque_internal_len$address() { - return Opaque_internal_len.ADDR; + public static MemorySegment Float64Vec_fill_slice$address() { + return Float64Vec_fill_slice.ADDR; } /** * {@snippet lang=c : - * size_t Opaque_internal_len(const Opaque *self) + * void Float64Vec_fill_slice(const Float64Vec *self, DiplomatF64ViewMut v) * } */ - public static long Opaque_internal_len(MemorySegment self) { - var mh$ = Opaque_internal_len.HANDLE; + public static void Float64Vec_fill_slice(MemorySegment self, MemorySegment v) { + var mh$ = Float64Vec_fill_slice.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_internal_len", self); + traceDowncall("Float64Vec_fill_slice", self, v); } - return (long)mh$.invokeExact(self); + mh$.invokeExact(self, v); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Opaque_returns_imported { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - ImportedStruct.layout() ); + private static class Float64Vec_set_value { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, + DiplomatF64View.layout() + ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_returns_imported"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_set_value"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11525,55 +11532,57 @@ private static class Opaque_returns_imported { /** * Function descriptor for: * {@snippet lang=c : - * ImportedStruct Opaque_returns_imported() + * void Float64Vec_set_value(Float64Vec *self, DiplomatF64View new_slice) * } */ - public static FunctionDescriptor Opaque_returns_imported$descriptor() { - return Opaque_returns_imported.DESC; + public static FunctionDescriptor Float64Vec_set_value$descriptor() { + return Float64Vec_set_value.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * ImportedStruct Opaque_returns_imported() + * void Float64Vec_set_value(Float64Vec *self, DiplomatF64View new_slice) * } */ - public static MethodHandle Opaque_returns_imported$handle() { - return Opaque_returns_imported.HANDLE; + public static MethodHandle Float64Vec_set_value$handle() { + return Float64Vec_set_value.HANDLE; } /** * Address for: * {@snippet lang=c : - * ImportedStruct Opaque_returns_imported() + * void Float64Vec_set_value(Float64Vec *self, DiplomatF64View new_slice) * } */ - public static MemorySegment Opaque_returns_imported$address() { - return Opaque_returns_imported.ADDR; + public static MemorySegment Float64Vec_set_value$address() { + return Float64Vec_set_value.ADDR; } /** * {@snippet lang=c : - * ImportedStruct Opaque_returns_imported() + * void Float64Vec_set_value(Float64Vec *self, DiplomatF64View new_slice) * } */ - public static MemorySegment Opaque_returns_imported(SegmentAllocator allocator) { - var mh$ = Opaque_returns_imported.HANDLE; + public static void Float64Vec_set_value(MemorySegment self, MemorySegment new_slice) { + var mh$ = Float64Vec_set_value.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_returns_imported", allocator); + traceDowncall("Float64Vec_set_value", self, new_slice); } - return (MemorySegment)mh$.invokeExact(allocator); + mh$.invokeExact(self, new_slice); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Opaque_cmp { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_CHAR ); + private static class Float64Vec_to_string { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_cmp"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_to_string"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11581,56 +11590,57 @@ private static class Opaque_cmp { /** * Function descriptor for: * {@snippet lang=c : - * int8_t Opaque_cmp() + * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) * } */ - public static FunctionDescriptor Opaque_cmp$descriptor() { - return Opaque_cmp.DESC; + public static FunctionDescriptor Float64Vec_to_string$descriptor() { + return Float64Vec_to_string.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int8_t Opaque_cmp() + * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) * } */ - public static MethodHandle Opaque_cmp$handle() { - return Opaque_cmp.HANDLE; + public static MethodHandle Float64Vec_to_string$handle() { + return Float64Vec_to_string.HANDLE; } /** * Address for: * {@snippet lang=c : - * int8_t Opaque_cmp() + * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) * } */ - public static MemorySegment Opaque_cmp$address() { - return Opaque_cmp.ADDR; + public static MemorySegment Float64Vec_to_string$address() { + return Float64Vec_to_string.ADDR; } /** * {@snippet lang=c : - * int8_t Opaque_cmp() + * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) * } */ - public static byte Opaque_cmp() { - var mh$ = Opaque_cmp.HANDLE; + public static void Float64Vec_to_string(MemorySegment self, MemorySegment write) { + var mh$ = Float64Vec_to_string.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_cmp"); + traceDowncall("Float64Vec_to_string", self, write); } - return (byte)mh$.invokeExact(); + mh$.invokeExact(self, write); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Opaque_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class Float64Vec_borrow { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + DiplomatF64View.layout(), somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_borrow"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11638,58 +11648,56 @@ private static class Opaque_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void Opaque_destroy(Opaque *self) + * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) * } */ - public static FunctionDescriptor Opaque_destroy$descriptor() { - return Opaque_destroy.DESC; + public static FunctionDescriptor Float64Vec_borrow$descriptor() { + return Float64Vec_borrow.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Opaque_destroy(Opaque *self) + * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) * } */ - public static MethodHandle Opaque_destroy$handle() { - return Opaque_destroy.HANDLE; + public static MethodHandle Float64Vec_borrow$handle() { + return Float64Vec_borrow.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Opaque_destroy(Opaque *self) + * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) * } */ - public static MemorySegment Opaque_destroy$address() { - return Opaque_destroy.ADDR; + public static MemorySegment Float64Vec_borrow$address() { + return Float64Vec_borrow.ADDR; } /** * {@snippet lang=c : - * void Opaque_destroy(Opaque *self) + * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) * } */ - public static void Opaque_destroy(MemorySegment self) { - var mh$ = Opaque_destroy.HANDLE; + public static MemorySegment Float64Vec_borrow(SegmentAllocator allocator, MemorySegment self) { + var mh$ = Float64Vec_borrow.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_destroy", self); + traceDowncall("Float64Vec_borrow", allocator, self); } - mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(allocator, self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_transitivity { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, + private static class Float64Vec_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_transitivity"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11697,120 +11705,109 @@ private static class One_transitivity { /** * Function descriptor for: * {@snippet lang=c : - * One *One_transitivity(const One *hold, const One *nohold) + * void Float64Vec_destroy(Float64Vec *self) * } */ - public static FunctionDescriptor One_transitivity$descriptor() { - return One_transitivity.DESC; + public static FunctionDescriptor Float64Vec_destroy$descriptor() { + return Float64Vec_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_transitivity(const One *hold, const One *nohold) + * void Float64Vec_destroy(Float64Vec *self) * } */ - public static MethodHandle One_transitivity$handle() { - return One_transitivity.HANDLE; + public static MethodHandle Float64Vec_destroy$handle() { + return Float64Vec_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_transitivity(const One *hold, const One *nohold) + * void Float64Vec_destroy(Float64Vec *self) * } */ - public static MemorySegment One_transitivity$address() { - return One_transitivity.ADDR; + public static MemorySegment Float64Vec_destroy$address() { + return Float64Vec_destroy.ADDR; } /** * {@snippet lang=c : - * One *One_transitivity(const One *hold, const One *nohold) + * void Float64Vec_destroy(Float64Vec *self) * } */ - public static MemorySegment One_transitivity(MemorySegment hold, MemorySegment nohold) { - var mh$ = One_transitivity.HANDLE; + public static void Float64Vec_destroy(MemorySegment self) { + var mh$ = Float64Vec_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_transitivity", hold, nohold); + traceDowncall("Float64Vec_destroy", self); } - return (MemorySegment)mh$.invokeExact(hold, nohold); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - - private static class One_cycle { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_cycle"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + private static final int MyEnum_A = (int)-2L; + /** + * {@snippet lang=c : + * enum MyEnum.MyEnum_A = -2 + * } + */ + public static int MyEnum_A() { + return MyEnum_A; } - + private static final int MyEnum_B = (int)-1L; /** - * Function descriptor for: * {@snippet lang=c : - * One *One_cycle(const Two *hold, const One *nohold) + * enum MyEnum.MyEnum_B = -1 * } */ - public static FunctionDescriptor One_cycle$descriptor() { - return One_cycle.DESC; + public static int MyEnum_B() { + return MyEnum_B; } - + private static final int MyEnum_C = (int)0L; /** - * Downcall method handle for: * {@snippet lang=c : - * One *One_cycle(const Two *hold, const One *nohold) + * enum MyEnum.MyEnum_C = 0 * } */ - public static MethodHandle One_cycle$handle() { - return One_cycle.HANDLE; + public static int MyEnum_C() { + return MyEnum_C; } - + private static final int MyEnum_D = (int)1L; /** - * Address for: * {@snippet lang=c : - * One *One_cycle(const Two *hold, const One *nohold) + * enum MyEnum.MyEnum_D = 1 * } */ - public static MemorySegment One_cycle$address() { - return One_cycle.ADDR; + public static int MyEnum_D() { + return MyEnum_D; } - + private static final int MyEnum_E = (int)2L; /** * {@snippet lang=c : - * One *One_cycle(const Two *hold, const One *nohold) + * enum MyEnum.MyEnum_E = 2 * } */ - public static MemorySegment One_cycle(MemorySegment hold, MemorySegment nohold) { - var mh$ = One_cycle.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("One_cycle", hold, nohold); - } - return (MemorySegment)mh$.invokeExact(hold, nohold); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } + public static int MyEnum_E() { + return MyEnum_E; + } + private static final int MyEnum_F = (int)3L; + /** + * {@snippet lang=c : + * enum MyEnum.MyEnum_F = 3 + * } + */ + public static int MyEnum_F() { + return MyEnum_F; } - private static class One_many_dependents { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_many_dependents"); + private static class MyStruct_new { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + MyStruct.layout() ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyStruct_new"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11818,58 +11815,57 @@ private static class One_many_dependents { /** * Function descriptor for: * {@snippet lang=c : - * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) + * MyStruct MyStruct_new() * } */ - public static FunctionDescriptor One_many_dependents$descriptor() { - return One_many_dependents.DESC; + public static FunctionDescriptor MyStruct_new$descriptor() { + return MyStruct_new.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) + * MyStruct MyStruct_new() * } */ - public static MethodHandle One_many_dependents$handle() { - return One_many_dependents.HANDLE; + public static MethodHandle MyStruct_new$handle() { + return MyStruct_new.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) + * MyStruct MyStruct_new() * } */ - public static MemorySegment One_many_dependents$address() { - return One_many_dependents.ADDR; + public static MemorySegment MyStruct_new$address() { + return MyStruct_new.ADDR; } /** * {@snippet lang=c : - * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) + * MyStruct MyStruct_new() * } */ - public static MemorySegment One_many_dependents(MemorySegment a, MemorySegment b, MemorySegment c, MemorySegment d, MemorySegment nohold) { - var mh$ = One_many_dependents.HANDLE; + public static MemorySegment MyStruct_new(SegmentAllocator allocator) { + var mh$ = MyStruct_new.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_many_dependents", a, b, c, d, nohold); + traceDowncall("MyStruct_new", allocator); } - return (MemorySegment)mh$.invokeExact(a, b, c, d, nohold); + return (MemorySegment)mh$.invokeExact(allocator); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_return_outlives_param { + private static class MyStruct_into_a { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER + somelib_h.C_CHAR, + MyStruct.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_return_outlives_param"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyStruct_into_a"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11877,60 +11873,57 @@ private static class One_return_outlives_param { /** * Function descriptor for: * {@snippet lang=c : - * One *One_return_outlives_param(const Two *hold, const One *nohold) + * uint8_t MyStruct_into_a(MyStruct self) * } */ - public static FunctionDescriptor One_return_outlives_param$descriptor() { - return One_return_outlives_param.DESC; + public static FunctionDescriptor MyStruct_into_a$descriptor() { + return MyStruct_into_a.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_return_outlives_param(const Two *hold, const One *nohold) + * uint8_t MyStruct_into_a(MyStruct self) * } */ - public static MethodHandle One_return_outlives_param$handle() { - return One_return_outlives_param.HANDLE; + public static MethodHandle MyStruct_into_a$handle() { + return MyStruct_into_a.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_return_outlives_param(const Two *hold, const One *nohold) + * uint8_t MyStruct_into_a(MyStruct self) * } */ - public static MemorySegment One_return_outlives_param$address() { - return One_return_outlives_param.ADDR; + public static MemorySegment MyStruct_into_a$address() { + return MyStruct_into_a.ADDR; } /** * {@snippet lang=c : - * One *One_return_outlives_param(const Two *hold, const One *nohold) + * uint8_t MyStruct_into_a(MyStruct self) * } */ - public static MemorySegment One_return_outlives_param(MemorySegment hold, MemorySegment nohold) { - var mh$ = One_return_outlives_param.HANDLE; + public static byte MyStruct_into_a(MemorySegment self) { + var mh$ = MyStruct_into_a.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_return_outlives_param", hold, nohold); + traceDowncall("MyStruct_into_a", self); } - return (MemorySegment)mh$.invokeExact(hold, nohold); + return (byte)mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_diamond_top { + private static class OpaqueMutexedString_from_usize { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_top"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_from_usize"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11938,60 +11931,57 @@ private static class One_diamond_top { /** * Function descriptor for: * {@snippet lang=c : - * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) + * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) * } */ - public static FunctionDescriptor One_diamond_top$descriptor() { - return One_diamond_top.DESC; + public static FunctionDescriptor OpaqueMutexedString_from_usize$descriptor() { + return OpaqueMutexedString_from_usize.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) + * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) * } */ - public static MethodHandle One_diamond_top$handle() { - return One_diamond_top.HANDLE; + public static MethodHandle OpaqueMutexedString_from_usize$handle() { + return OpaqueMutexedString_from_usize.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) + * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) * } */ - public static MemorySegment One_diamond_top$address() { - return One_diamond_top.ADDR; + public static MemorySegment OpaqueMutexedString_from_usize$address() { + return OpaqueMutexedString_from_usize.ADDR; } /** * {@snippet lang=c : - * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) + * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) * } */ - public static MemorySegment One_diamond_top(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { - var mh$ = One_diamond_top.HANDLE; + public static MemorySegment OpaqueMutexedString_from_usize(long number) { + var mh$ = OpaqueMutexedString_from_usize.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_diamond_top", top, left, right, bottom); + traceDowncall("OpaqueMutexedString_from_usize", number); } - return (MemorySegment)mh$.invokeExact(top, left, right, bottom); + return (MemorySegment)mh$.invokeExact(number); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_diamond_left { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, + private static class OpaqueMutexedString_change { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER, - somelib_h.C_POINTER + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_left"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_change"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11999,60 +11989,57 @@ private static class One_diamond_left { /** * Function descriptor for: * {@snippet lang=c : - * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) + * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) * } */ - public static FunctionDescriptor One_diamond_left$descriptor() { - return One_diamond_left.DESC; + public static FunctionDescriptor OpaqueMutexedString_change$descriptor() { + return OpaqueMutexedString_change.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) + * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) * } */ - public static MethodHandle One_diamond_left$handle() { - return One_diamond_left.HANDLE; + public static MethodHandle OpaqueMutexedString_change$handle() { + return OpaqueMutexedString_change.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) + * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) * } */ - public static MemorySegment One_diamond_left$address() { - return One_diamond_left.ADDR; + public static MemorySegment OpaqueMutexedString_change$address() { + return OpaqueMutexedString_change.ADDR; } /** * {@snippet lang=c : - * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) + * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) * } */ - public static MemorySegment One_diamond_left(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { - var mh$ = One_diamond_left.HANDLE; + public static void OpaqueMutexedString_change(MemorySegment self, long number) { + var mh$ = OpaqueMutexedString_change.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_diamond_left", top, left, right, bottom); + traceDowncall("OpaqueMutexedString_change", self, number); } - return (MemorySegment)mh$.invokeExact(top, left, right, bottom); + mh$.invokeExact(self, number); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_diamond_right { + private static class OpaqueMutexedString_borrow { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_right"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_borrow"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12060,60 +12047,57 @@ private static class One_diamond_right { /** * Function descriptor for: * {@snippet lang=c : - * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) + * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) * } */ - public static FunctionDescriptor One_diamond_right$descriptor() { - return One_diamond_right.DESC; + public static FunctionDescriptor OpaqueMutexedString_borrow$descriptor() { + return OpaqueMutexedString_borrow.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) + * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) * } */ - public static MethodHandle One_diamond_right$handle() { - return One_diamond_right.HANDLE; + public static MethodHandle OpaqueMutexedString_borrow$handle() { + return OpaqueMutexedString_borrow.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) + * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) * } */ - public static MemorySegment One_diamond_right$address() { - return One_diamond_right.ADDR; + public static MemorySegment OpaqueMutexedString_borrow$address() { + return OpaqueMutexedString_borrow.ADDR; } /** * {@snippet lang=c : - * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) + * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) * } */ - public static MemorySegment One_diamond_right(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { - var mh$ = One_diamond_right.HANDLE; + public static MemorySegment OpaqueMutexedString_borrow(MemorySegment self) { + var mh$ = OpaqueMutexedString_borrow.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_diamond_right", top, left, right, bottom); + traceDowncall("OpaqueMutexedString_borrow", self); } - return (MemorySegment)mh$.invokeExact(top, left, right, bottom); + return (MemorySegment)mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_diamond_bottom { + private static class OpaqueMutexedString_borrow_other { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_bottom"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_borrow_other"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12121,61 +12105,58 @@ private static class One_diamond_bottom { /** * Function descriptor for: * {@snippet lang=c : - * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) + * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) * } */ - public static FunctionDescriptor One_diamond_bottom$descriptor() { - return One_diamond_bottom.DESC; + public static FunctionDescriptor OpaqueMutexedString_borrow_other$descriptor() { + return OpaqueMutexedString_borrow_other.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) + * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) * } */ - public static MethodHandle One_diamond_bottom$handle() { - return One_diamond_bottom.HANDLE; + public static MethodHandle OpaqueMutexedString_borrow_other$handle() { + return OpaqueMutexedString_borrow_other.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) + * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) * } */ - public static MemorySegment One_diamond_bottom$address() { - return One_diamond_bottom.ADDR; + public static MemorySegment OpaqueMutexedString_borrow_other$address() { + return OpaqueMutexedString_borrow_other.ADDR; } /** * {@snippet lang=c : - * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) + * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) * } */ - public static MemorySegment One_diamond_bottom(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { - var mh$ = One_diamond_bottom.HANDLE; + public static MemorySegment OpaqueMutexedString_borrow_other(MemorySegment other) { + var mh$ = OpaqueMutexedString_borrow_other.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_diamond_bottom", top, left, right, bottom); + traceDowncall("OpaqueMutexedString_borrow_other", other); } - return (MemorySegment)mh$.invokeExact(top, left, right, bottom); + return (MemorySegment)mh$.invokeExact(other); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_diamond_and_nested_types { + private static class OpaqueMutexedString_borrow_self_or_other { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_and_nested_types"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_borrow_self_or_other"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12183,59 +12164,58 @@ private static class One_diamond_and_nested_types { /** * Function descriptor for: * {@snippet lang=c : - * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) + * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) * } */ - public static FunctionDescriptor One_diamond_and_nested_types$descriptor() { - return One_diamond_and_nested_types.DESC; + public static FunctionDescriptor OpaqueMutexedString_borrow_self_or_other$descriptor() { + return OpaqueMutexedString_borrow_self_or_other.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) + * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) * } */ - public static MethodHandle One_diamond_and_nested_types$handle() { - return One_diamond_and_nested_types.HANDLE; + public static MethodHandle OpaqueMutexedString_borrow_self_or_other$handle() { + return OpaqueMutexedString_borrow_self_or_other.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) + * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) * } */ - public static MemorySegment One_diamond_and_nested_types$address() { - return One_diamond_and_nested_types.ADDR; + public static MemorySegment OpaqueMutexedString_borrow_self_or_other$address() { + return OpaqueMutexedString_borrow_self_or_other.ADDR; } /** * {@snippet lang=c : - * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) + * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) * } */ - public static MemorySegment One_diamond_and_nested_types(MemorySegment a, MemorySegment b, MemorySegment c, MemorySegment d, MemorySegment nohold) { - var mh$ = One_diamond_and_nested_types.HANDLE; + public static MemorySegment OpaqueMutexedString_borrow_self_or_other(MemorySegment self, MemorySegment other) { + var mh$ = OpaqueMutexedString_borrow_self_or_other.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_diamond_and_nested_types", a, b, c, d, nohold); + traceDowncall("OpaqueMutexedString_borrow_self_or_other", self, other); } - return (MemorySegment)mh$.invokeExact(a, b, c, d, nohold); + return (MemorySegment)mh$.invokeExact(self, other); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_implicit_bounds { + private static class OpaqueMutexedString_get_len_and_add { public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_LONG, somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_implicit_bounds"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_get_len_and_add"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12243,60 +12223,57 @@ private static class One_implicit_bounds { /** * Function descriptor for: * {@snippet lang=c : - * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) + * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) * } */ - public static FunctionDescriptor One_implicit_bounds$descriptor() { - return One_implicit_bounds.DESC; + public static FunctionDescriptor OpaqueMutexedString_get_len_and_add$descriptor() { + return OpaqueMutexedString_get_len_and_add.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) + * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) * } */ - public static MethodHandle One_implicit_bounds$handle() { - return One_implicit_bounds.HANDLE; + public static MethodHandle OpaqueMutexedString_get_len_and_add$handle() { + return OpaqueMutexedString_get_len_and_add.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) + * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) * } */ - public static MemorySegment One_implicit_bounds$address() { - return One_implicit_bounds.ADDR; + public static MemorySegment OpaqueMutexedString_get_len_and_add$address() { + return OpaqueMutexedString_get_len_and_add.ADDR; } /** * {@snippet lang=c : - * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) + * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) * } */ - public static MemorySegment One_implicit_bounds(MemorySegment explicit_hold, MemorySegment implicit_hold, MemorySegment nohold) { - var mh$ = One_implicit_bounds.HANDLE; + public static long OpaqueMutexedString_get_len_and_add(MemorySegment self, long other) { + var mh$ = OpaqueMutexedString_get_len_and_add.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_implicit_bounds", explicit_hold, implicit_hold, nohold); + traceDowncall("OpaqueMutexedString_get_len_and_add", self, other); } - return (MemorySegment)mh$.invokeExact(explicit_hold, implicit_hold, nohold); + return (long)mh$.invokeExact(self, other); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_implicit_bounds_deep { + private static class OpaqueMutexedString_dummy_str { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, + DiplomatStringView.layout(), somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_implicit_bounds_deep"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_dummy_str"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12304,56 +12281,57 @@ private static class One_implicit_bounds_deep { /** * Function descriptor for: * {@snippet lang=c : - * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) + * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) * } */ - public static FunctionDescriptor One_implicit_bounds_deep$descriptor() { - return One_implicit_bounds_deep.DESC; + public static FunctionDescriptor OpaqueMutexedString_dummy_str$descriptor() { + return OpaqueMutexedString_dummy_str.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) + * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) * } */ - public static MethodHandle One_implicit_bounds_deep$handle() { - return One_implicit_bounds_deep.HANDLE; + public static MethodHandle OpaqueMutexedString_dummy_str$handle() { + return OpaqueMutexedString_dummy_str.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) + * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) * } */ - public static MemorySegment One_implicit_bounds_deep$address() { - return One_implicit_bounds_deep.ADDR; + public static MemorySegment OpaqueMutexedString_dummy_str$address() { + return OpaqueMutexedString_dummy_str.ADDR; } /** * {@snippet lang=c : - * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) + * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) * } */ - public static MemorySegment One_implicit_bounds_deep(MemorySegment explicit_, MemorySegment implicit_1, MemorySegment implicit_2, MemorySegment nohold) { - var mh$ = One_implicit_bounds_deep.HANDLE; + public static MemorySegment OpaqueMutexedString_dummy_str(SegmentAllocator allocator, MemorySegment self) { + var mh$ = OpaqueMutexedString_dummy_str.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_implicit_bounds_deep", explicit_, implicit_1, implicit_2, nohold); + traceDowncall("OpaqueMutexedString_dummy_str", allocator, self); } - return (MemorySegment)mh$.invokeExact(explicit_, implicit_1, implicit_2, nohold); + return (MemorySegment)mh$.invokeExact(allocator, self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class OpaqueMutexedString_wrapper { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_wrapper"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12361,75 +12339,56 @@ private static class One_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void One_destroy(One *self) + * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) * } */ - public static FunctionDescriptor One_destroy$descriptor() { - return One_destroy.DESC; + public static FunctionDescriptor OpaqueMutexedString_wrapper$descriptor() { + return OpaqueMutexedString_wrapper.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void One_destroy(One *self) + * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) * } */ - public static MethodHandle One_destroy$handle() { - return One_destroy.HANDLE; + public static MethodHandle OpaqueMutexedString_wrapper$handle() { + return OpaqueMutexedString_wrapper.HANDLE; } /** * Address for: * {@snippet lang=c : - * void One_destroy(One *self) + * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) * } */ - public static MemorySegment One_destroy$address() { - return One_destroy.ADDR; + public static MemorySegment OpaqueMutexedString_wrapper$address() { + return OpaqueMutexedString_wrapper.ADDR; } /** * {@snippet lang=c : - * void One_destroy(One *self) + * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) * } */ - public static void One_destroy(MemorySegment self) { - var mh$ = One_destroy.HANDLE; + public static MemorySegment OpaqueMutexedString_wrapper(MemorySegment self) { + var mh$ = OpaqueMutexedString_wrapper.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_destroy", self); + traceDowncall("OpaqueMutexedString_wrapper", self); } - mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static final int ErrorEnum_Foo = (int)0L; - /** - * {@snippet lang=c : - * enum ErrorEnum.ErrorEnum_Foo = 0 - * } - */ - public static int ErrorEnum_Foo() { - return ErrorEnum_Foo; - } - private static final int ErrorEnum_Bar = (int)1L; - /** - * {@snippet lang=c : - * enum ErrorEnum.ErrorEnum_Bar = 1 - * } - */ - public static int ErrorEnum_Bar() { - return ErrorEnum_Bar; - } - private static class OpaqueMutexedString_from_usize { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_LONG + private static class OpaqueMutexedString_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_from_usize"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12437,57 +12396,56 @@ private static class OpaqueMutexedString_from_usize { /** * Function descriptor for: * {@snippet lang=c : - * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) + * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) * } */ - public static FunctionDescriptor OpaqueMutexedString_from_usize$descriptor() { - return OpaqueMutexedString_from_usize.DESC; + public static FunctionDescriptor OpaqueMutexedString_destroy$descriptor() { + return OpaqueMutexedString_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) + * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) * } */ - public static MethodHandle OpaqueMutexedString_from_usize$handle() { - return OpaqueMutexedString_from_usize.HANDLE; + public static MethodHandle OpaqueMutexedString_destroy$handle() { + return OpaqueMutexedString_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) + * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) * } */ - public static MemorySegment OpaqueMutexedString_from_usize$address() { - return OpaqueMutexedString_from_usize.ADDR; + public static MemorySegment OpaqueMutexedString_destroy$address() { + return OpaqueMutexedString_destroy.ADDR; } /** * {@snippet lang=c : - * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) + * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) * } */ - public static MemorySegment OpaqueMutexedString_from_usize(long number) { - var mh$ = OpaqueMutexedString_from_usize.HANDLE; + public static void OpaqueMutexedString_destroy(MemorySegment self) { + var mh$ = OpaqueMutexedString_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_from_usize", number); + traceDowncall("OpaqueMutexedString_destroy", self); } - return (MemorySegment)mh$.invokeExact(number); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OpaqueMutexedString_change { + private static class RefListParameter_destroy { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_change"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("RefListParameter_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12495,57 +12453,57 @@ private static class OpaqueMutexedString_change { /** * Function descriptor for: * {@snippet lang=c : - * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) + * void RefListParameter_destroy(RefListParameter *self) * } */ - public static FunctionDescriptor OpaqueMutexedString_change$descriptor() { - return OpaqueMutexedString_change.DESC; + public static FunctionDescriptor RefListParameter_destroy$descriptor() { + return RefListParameter_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) + * void RefListParameter_destroy(RefListParameter *self) * } */ - public static MethodHandle OpaqueMutexedString_change$handle() { - return OpaqueMutexedString_change.HANDLE; + public static MethodHandle RefListParameter_destroy$handle() { + return RefListParameter_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) + * void RefListParameter_destroy(RefListParameter *self) * } */ - public static MemorySegment OpaqueMutexedString_change$address() { - return OpaqueMutexedString_change.ADDR; + public static MemorySegment RefListParameter_destroy$address() { + return RefListParameter_destroy.ADDR; } /** * {@snippet lang=c : - * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) + * void RefListParameter_destroy(RefListParameter *self) * } */ - public static void OpaqueMutexedString_change(MemorySegment self, long number) { - var mh$ = OpaqueMutexedString_change.HANDLE; + public static void RefListParameter_destroy(MemorySegment self) { + var mh$ = RefListParameter_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_change", self, number); + traceDowncall("RefListParameter_destroy", self); } - mh$.invokeExact(self, number); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OpaqueMutexedString_borrow { + private static class MyEnum_into_value { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER + somelib_h.C_CHAR, + somelib_h.C_INT ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_borrow"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyEnum_into_value"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12553,57 +12511,55 @@ private static class OpaqueMutexedString_borrow { /** * Function descriptor for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) + * int8_t MyEnum_into_value(MyEnum self) * } */ - public static FunctionDescriptor OpaqueMutexedString_borrow$descriptor() { - return OpaqueMutexedString_borrow.DESC; + public static FunctionDescriptor MyEnum_into_value$descriptor() { + return MyEnum_into_value.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) + * int8_t MyEnum_into_value(MyEnum self) * } */ - public static MethodHandle OpaqueMutexedString_borrow$handle() { - return OpaqueMutexedString_borrow.HANDLE; + public static MethodHandle MyEnum_into_value$handle() { + return MyEnum_into_value.HANDLE; } /** * Address for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) + * int8_t MyEnum_into_value(MyEnum self) * } */ - public static MemorySegment OpaqueMutexedString_borrow$address() { - return OpaqueMutexedString_borrow.ADDR; + public static MemorySegment MyEnum_into_value$address() { + return MyEnum_into_value.ADDR; } /** * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) + * int8_t MyEnum_into_value(MyEnum self) * } */ - public static MemorySegment OpaqueMutexedString_borrow(MemorySegment self) { - var mh$ = OpaqueMutexedString_borrow.HANDLE; + public static byte MyEnum_into_value(int self) { + var mh$ = MyEnum_into_value.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_borrow", self); + traceDowncall("MyEnum_into_value", self); } - return (MemorySegment)mh$.invokeExact(self); + return (byte)mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OpaqueMutexedString_borrow_other { + private static class MyEnum_get_a { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); + somelib_h.C_INT ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_borrow_other"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyEnum_get_a"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12611,58 +12567,57 @@ private static class OpaqueMutexedString_borrow_other { /** * Function descriptor for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) + * MyEnum MyEnum_get_a() * } */ - public static FunctionDescriptor OpaqueMutexedString_borrow_other$descriptor() { - return OpaqueMutexedString_borrow_other.DESC; + public static FunctionDescriptor MyEnum_get_a$descriptor() { + return MyEnum_get_a.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) + * MyEnum MyEnum_get_a() * } */ - public static MethodHandle OpaqueMutexedString_borrow_other$handle() { - return OpaqueMutexedString_borrow_other.HANDLE; + public static MethodHandle MyEnum_get_a$handle() { + return MyEnum_get_a.HANDLE; } /** * Address for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) + * MyEnum MyEnum_get_a() * } */ - public static MemorySegment OpaqueMutexedString_borrow_other$address() { - return OpaqueMutexedString_borrow_other.ADDR; + public static MemorySegment MyEnum_get_a$address() { + return MyEnum_get_a.ADDR; } /** * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) + * MyEnum MyEnum_get_a() * } */ - public static MemorySegment OpaqueMutexedString_borrow_other(MemorySegment other) { - var mh$ = OpaqueMutexedString_borrow_other.HANDLE; + public static int MyEnum_get_a() { + var mh$ = MyEnum_get_a.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_borrow_other", other); + traceDowncall("MyEnum_get_a"); } - return (MemorySegment)mh$.invokeExact(other); + return (int)mh$.invokeExact(); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OpaqueMutexedString_borrow_self_or_other { + private static class MyString_new { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER + DiplomatStringView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_borrow_self_or_other"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12670,58 +12625,57 @@ private static class OpaqueMutexedString_borrow_self_or_other { /** * Function descriptor for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) + * MyString *MyString_new(DiplomatStringView v) * } */ - public static FunctionDescriptor OpaqueMutexedString_borrow_self_or_other$descriptor() { - return OpaqueMutexedString_borrow_self_or_other.DESC; + public static FunctionDescriptor MyString_new$descriptor() { + return MyString_new.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) + * MyString *MyString_new(DiplomatStringView v) * } */ - public static MethodHandle OpaqueMutexedString_borrow_self_or_other$handle() { - return OpaqueMutexedString_borrow_self_or_other.HANDLE; + public static MethodHandle MyString_new$handle() { + return MyString_new.HANDLE; } /** * Address for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) + * MyString *MyString_new(DiplomatStringView v) * } */ - public static MemorySegment OpaqueMutexedString_borrow_self_or_other$address() { - return OpaqueMutexedString_borrow_self_or_other.ADDR; + public static MemorySegment MyString_new$address() { + return MyString_new.ADDR; } /** * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) + * MyString *MyString_new(DiplomatStringView v) * } */ - public static MemorySegment OpaqueMutexedString_borrow_self_or_other(MemorySegment self, MemorySegment other) { - var mh$ = OpaqueMutexedString_borrow_self_or_other.HANDLE; + public static MemorySegment MyString_new(MemorySegment v) { + var mh$ = MyString_new.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_borrow_self_or_other", self, other); + traceDowncall("MyString_new", v); } - return (MemorySegment)mh$.invokeExact(self, other); + return (MemorySegment)mh$.invokeExact(v); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OpaqueMutexedString_get_len_and_add { + private static class MyString_new_unsafe { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_LONG, somelib_h.C_POINTER, - somelib_h.C_LONG + DiplomatStringView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_get_len_and_add"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new_unsafe"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12729,57 +12683,57 @@ private static class OpaqueMutexedString_get_len_and_add { /** * Function descriptor for: * {@snippet lang=c : - * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) + * MyString *MyString_new_unsafe(DiplomatStringView v) * } */ - public static FunctionDescriptor OpaqueMutexedString_get_len_and_add$descriptor() { - return OpaqueMutexedString_get_len_and_add.DESC; + public static FunctionDescriptor MyString_new_unsafe$descriptor() { + return MyString_new_unsafe.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) + * MyString *MyString_new_unsafe(DiplomatStringView v) * } */ - public static MethodHandle OpaqueMutexedString_get_len_and_add$handle() { - return OpaqueMutexedString_get_len_and_add.HANDLE; + public static MethodHandle MyString_new_unsafe$handle() { + return MyString_new_unsafe.HANDLE; } /** * Address for: * {@snippet lang=c : - * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) + * MyString *MyString_new_unsafe(DiplomatStringView v) * } */ - public static MemorySegment OpaqueMutexedString_get_len_and_add$address() { - return OpaqueMutexedString_get_len_and_add.ADDR; + public static MemorySegment MyString_new_unsafe$address() { + return MyString_new_unsafe.ADDR; } /** * {@snippet lang=c : - * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) + * MyString *MyString_new_unsafe(DiplomatStringView v) * } */ - public static long OpaqueMutexedString_get_len_and_add(MemorySegment self, long other) { - var mh$ = OpaqueMutexedString_get_len_and_add.HANDLE; + public static MemorySegment MyString_new_unsafe(MemorySegment v) { + var mh$ = MyString_new_unsafe.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_get_len_and_add", self, other); + traceDowncall("MyString_new_unsafe", v); } - return (long)mh$.invokeExact(self, other); + return (MemorySegment)mh$.invokeExact(v); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OpaqueMutexedString_dummy_str { + private static class MyString_new_owned { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - DiplomatStringView.layout(), - somelib_h.C_POINTER + somelib_h.C_POINTER, + DiplomatStringView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_dummy_str"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new_owned"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12787,57 +12741,57 @@ private static class OpaqueMutexedString_dummy_str { /** * Function descriptor for: * {@snippet lang=c : - * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) + * MyString *MyString_new_owned(DiplomatStringView v) * } */ - public static FunctionDescriptor OpaqueMutexedString_dummy_str$descriptor() { - return OpaqueMutexedString_dummy_str.DESC; + public static FunctionDescriptor MyString_new_owned$descriptor() { + return MyString_new_owned.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) + * MyString *MyString_new_owned(DiplomatStringView v) * } */ - public static MethodHandle OpaqueMutexedString_dummy_str$handle() { - return OpaqueMutexedString_dummy_str.HANDLE; + public static MethodHandle MyString_new_owned$handle() { + return MyString_new_owned.HANDLE; } /** * Address for: * {@snippet lang=c : - * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) + * MyString *MyString_new_owned(DiplomatStringView v) * } */ - public static MemorySegment OpaqueMutexedString_dummy_str$address() { - return OpaqueMutexedString_dummy_str.ADDR; + public static MemorySegment MyString_new_owned$address() { + return MyString_new_owned.ADDR; } /** * {@snippet lang=c : - * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) + * MyString *MyString_new_owned(DiplomatStringView v) * } */ - public static MemorySegment OpaqueMutexedString_dummy_str(SegmentAllocator allocator, MemorySegment self) { - var mh$ = OpaqueMutexedString_dummy_str.HANDLE; + public static MemorySegment MyString_new_owned(MemorySegment v) { + var mh$ = MyString_new_owned.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_dummy_str", allocator, self); + traceDowncall("MyString_new_owned", v); } - return (MemorySegment)mh$.invokeExact(allocator, self); + return (MemorySegment)mh$.invokeExact(v); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OpaqueMutexedString_wrapper { + private static class MyString_new_from_first { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - somelib_h.C_POINTER + DiplomatStringsView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_wrapper"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new_from_first"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12845,56 +12799,57 @@ private static class OpaqueMutexedString_wrapper { /** * Function descriptor for: * {@snippet lang=c : - * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) + * MyString *MyString_new_from_first(DiplomatStringsView v) * } */ - public static FunctionDescriptor OpaqueMutexedString_wrapper$descriptor() { - return OpaqueMutexedString_wrapper.DESC; + public static FunctionDescriptor MyString_new_from_first$descriptor() { + return MyString_new_from_first.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) + * MyString *MyString_new_from_first(DiplomatStringsView v) * } */ - public static MethodHandle OpaqueMutexedString_wrapper$handle() { - return OpaqueMutexedString_wrapper.HANDLE; + public static MethodHandle MyString_new_from_first$handle() { + return MyString_new_from_first.HANDLE; } /** * Address for: * {@snippet lang=c : - * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) + * MyString *MyString_new_from_first(DiplomatStringsView v) * } */ - public static MemorySegment OpaqueMutexedString_wrapper$address() { - return OpaqueMutexedString_wrapper.ADDR; + public static MemorySegment MyString_new_from_first$address() { + return MyString_new_from_first.ADDR; } /** * {@snippet lang=c : - * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) + * MyString *MyString_new_from_first(DiplomatStringsView v) * } */ - public static MemorySegment OpaqueMutexedString_wrapper(MemorySegment self) { - var mh$ = OpaqueMutexedString_wrapper.HANDLE; + public static MemorySegment MyString_new_from_first(MemorySegment v) { + var mh$ = MyString_new_from_first.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_wrapper", self); + traceDowncall("MyString_new_from_first", v); } - return (MemorySegment)mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(v); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OpaqueMutexedString_destroy { + private static class MyString_set_str { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER + somelib_h.C_POINTER, + DiplomatStringView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_set_str"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12902,57 +12857,57 @@ private static class OpaqueMutexedString_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) + * void MyString_set_str(MyString *self, DiplomatStringView new_str) * } */ - public static FunctionDescriptor OpaqueMutexedString_destroy$descriptor() { - return OpaqueMutexedString_destroy.DESC; + public static FunctionDescriptor MyString_set_str$descriptor() { + return MyString_set_str.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) + * void MyString_set_str(MyString *self, DiplomatStringView new_str) * } */ - public static MethodHandle OpaqueMutexedString_destroy$handle() { - return OpaqueMutexedString_destroy.HANDLE; + public static MethodHandle MyString_set_str$handle() { + return MyString_set_str.HANDLE; } /** * Address for: * {@snippet lang=c : - * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) + * void MyString_set_str(MyString *self, DiplomatStringView new_str) * } */ - public static MemorySegment OpaqueMutexedString_destroy$address() { - return OpaqueMutexedString_destroy.ADDR; + public static MemorySegment MyString_set_str$address() { + return MyString_set_str.ADDR; } /** * {@snippet lang=c : - * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) + * void MyString_set_str(MyString *self, DiplomatStringView new_str) * } */ - public static void OpaqueMutexedString_destroy(MemorySegment self) { - var mh$ = OpaqueMutexedString_destroy.HANDLE; + public static void MyString_set_str(MemorySegment self, MemorySegment new_str) { + var mh$ = MyString_set_str.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_destroy", self); + traceDowncall("MyString_set_str", self, new_str); } - mh$.invokeExact(self); + mh$.invokeExact(self, new_str); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class RefList_node { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( + private static class MyString_get_str { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("RefList_node"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_get_str"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12960,56 +12915,57 @@ private static class RefList_node { /** * Function descriptor for: * {@snippet lang=c : - * RefList *RefList_node(const RefListParameter *data) + * void MyString_get_str(const MyString *self, DiplomatWrite *write) * } */ - public static FunctionDescriptor RefList_node$descriptor() { - return RefList_node.DESC; + public static FunctionDescriptor MyString_get_str$descriptor() { + return MyString_get_str.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * RefList *RefList_node(const RefListParameter *data) + * void MyString_get_str(const MyString *self, DiplomatWrite *write) * } */ - public static MethodHandle RefList_node$handle() { - return RefList_node.HANDLE; + public static MethodHandle MyString_get_str$handle() { + return MyString_get_str.HANDLE; } /** * Address for: * {@snippet lang=c : - * RefList *RefList_node(const RefListParameter *data) + * void MyString_get_str(const MyString *self, DiplomatWrite *write) * } */ - public static MemorySegment RefList_node$address() { - return RefList_node.ADDR; + public static MemorySegment MyString_get_str$address() { + return MyString_get_str.ADDR; } /** * {@snippet lang=c : - * RefList *RefList_node(const RefListParameter *data) + * void MyString_get_str(const MyString *self, DiplomatWrite *write) * } */ - public static MemorySegment RefList_node(MemorySegment data) { - var mh$ = RefList_node.HANDLE; + public static void MyString_get_str(MemorySegment self, MemorySegment write) { + var mh$ = MyString_get_str.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("RefList_node", data); + traceDowncall("MyString_get_str", self, write); } - return (MemorySegment)mh$.invokeExact(data); + mh$.invokeExact(self, write); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class RefList_destroy { + private static class MyString_string_transform { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + DiplomatStringView.layout(), somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("RefList_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_string_transform"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13017,56 +12973,56 @@ private static class RefList_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void RefList_destroy(RefList *self) + * void MyString_string_transform(DiplomatStringView foo, DiplomatWrite *write) * } */ - public static FunctionDescriptor RefList_destroy$descriptor() { - return RefList_destroy.DESC; + public static FunctionDescriptor MyString_string_transform$descriptor() { + return MyString_string_transform.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void RefList_destroy(RefList *self) + * void MyString_string_transform(DiplomatStringView foo, DiplomatWrite *write) * } */ - public static MethodHandle RefList_destroy$handle() { - return RefList_destroy.HANDLE; + public static MethodHandle MyString_string_transform$handle() { + return MyString_string_transform.HANDLE; } /** * Address for: * {@snippet lang=c : - * void RefList_destroy(RefList *self) + * void MyString_string_transform(DiplomatStringView foo, DiplomatWrite *write) * } */ - public static MemorySegment RefList_destroy$address() { - return RefList_destroy.ADDR; + public static MemorySegment MyString_string_transform$address() { + return MyString_string_transform.ADDR; } /** * {@snippet lang=c : - * void RefList_destroy(RefList *self) + * void MyString_string_transform(DiplomatStringView foo, DiplomatWrite *write) * } */ - public static void RefList_destroy(MemorySegment self) { - var mh$ = RefList_destroy.HANDLE; + public static void MyString_string_transform(MemorySegment foo, MemorySegment write) { + var mh$ = MyString_string_transform.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("RefList_destroy", self); + traceDowncall("MyString_string_transform", foo, write); } - mh$.invokeExact(self); + mh$.invokeExact(foo, write); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Two_destroy { + private static class MyString_destroy { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Two_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13074,43 +13030,43 @@ private static class Two_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void Two_destroy(Two *self) + * void MyString_destroy(MyString *self) * } */ - public static FunctionDescriptor Two_destroy$descriptor() { - return Two_destroy.DESC; + public static FunctionDescriptor MyString_destroy$descriptor() { + return MyString_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Two_destroy(Two *self) + * void MyString_destroy(MyString *self) * } */ - public static MethodHandle Two_destroy$handle() { - return Two_destroy.HANDLE; + public static MethodHandle MyString_destroy$handle() { + return MyString_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Two_destroy(Two *self) + * void MyString_destroy(MyString *self) * } */ - public static MemorySegment Two_destroy$address() { - return Two_destroy.ADDR; + public static MemorySegment MyString_destroy$address() { + return MyString_destroy.ADDR; } /** * {@snippet lang=c : - * void Two_destroy(Two *self) + * void MyString_destroy(MyString *self) * } */ - public static void Two_destroy(MemorySegment self) { - var mh$ = Two_destroy.HANDLE; + public static void MyString_destroy(MemorySegment self) { + var mh$ = MyString_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Two_destroy", self); + traceDowncall("MyString_destroy", self); } mh$.invokeExact(self); } catch (Throwable ex$) { @@ -13118,12 +13074,13 @@ public static void Two_destroy(MemorySegment self) { } } - private static class RefListParameter_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER + private static class Utf16Wrap_from_utf16 { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + DiplomatString16View.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("RefListParameter_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_from_utf16"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13131,55 +13088,57 @@ private static class RefListParameter_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void RefListParameter_destroy(RefListParameter *self) + * Utf16Wrap *Utf16Wrap_from_utf16(DiplomatString16View input) * } */ - public static FunctionDescriptor RefListParameter_destroy$descriptor() { - return RefListParameter_destroy.DESC; + public static FunctionDescriptor Utf16Wrap_from_utf16$descriptor() { + return Utf16Wrap_from_utf16.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void RefListParameter_destroy(RefListParameter *self) + * Utf16Wrap *Utf16Wrap_from_utf16(DiplomatString16View input) * } */ - public static MethodHandle RefListParameter_destroy$handle() { - return RefListParameter_destroy.HANDLE; + public static MethodHandle Utf16Wrap_from_utf16$handle() { + return Utf16Wrap_from_utf16.HANDLE; } /** * Address for: * {@snippet lang=c : - * void RefListParameter_destroy(RefListParameter *self) + * Utf16Wrap *Utf16Wrap_from_utf16(DiplomatString16View input) * } */ - public static MemorySegment RefListParameter_destroy$address() { - return RefListParameter_destroy.ADDR; + public static MemorySegment Utf16Wrap_from_utf16$address() { + return Utf16Wrap_from_utf16.ADDR; } /** * {@snippet lang=c : - * void RefListParameter_destroy(RefListParameter *self) + * Utf16Wrap *Utf16Wrap_from_utf16(DiplomatString16View input) * } */ - public static void RefListParameter_destroy(MemorySegment self) { - var mh$ = RefListParameter_destroy.HANDLE; + public static MemorySegment Utf16Wrap_from_utf16(MemorySegment input) { + var mh$ = Utf16Wrap_from_utf16.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("RefListParameter_destroy", self); + traceDowncall("Utf16Wrap_from_utf16", input); } - mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(input); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class CyclicStructB_get_a { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - CyclicStructA.layout() ); + private static class Utf16Wrap_get_debug_str { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("CyclicStructB_get_a"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_get_debug_str"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13187,57 +13146,57 @@ private static class CyclicStructB_get_a { /** * Function descriptor for: * {@snippet lang=c : - * CyclicStructA CyclicStructB_get_a() + * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) * } */ - public static FunctionDescriptor CyclicStructB_get_a$descriptor() { - return CyclicStructB_get_a.DESC; + public static FunctionDescriptor Utf16Wrap_get_debug_str$descriptor() { + return Utf16Wrap_get_debug_str.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * CyclicStructA CyclicStructB_get_a() + * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) * } */ - public static MethodHandle CyclicStructB_get_a$handle() { - return CyclicStructB_get_a.HANDLE; + public static MethodHandle Utf16Wrap_get_debug_str$handle() { + return Utf16Wrap_get_debug_str.HANDLE; } /** * Address for: * {@snippet lang=c : - * CyclicStructA CyclicStructB_get_a() + * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) * } */ - public static MemorySegment CyclicStructB_get_a$address() { - return CyclicStructB_get_a.ADDR; + public static MemorySegment Utf16Wrap_get_debug_str$address() { + return Utf16Wrap_get_debug_str.ADDR; } /** * {@snippet lang=c : - * CyclicStructA CyclicStructB_get_a() + * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) * } */ - public static MemorySegment CyclicStructB_get_a(SegmentAllocator allocator) { - var mh$ = CyclicStructB_get_a.HANDLE; + public static void Utf16Wrap_get_debug_str(MemorySegment self, MemorySegment write) { + var mh$ = Utf16Wrap_get_debug_str.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("CyclicStructB_get_a", allocator); + traceDowncall("Utf16Wrap_get_debug_str", self, write); } - return (MemorySegment)mh$.invokeExact(allocator); + mh$.invokeExact(self, write); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Foo_new { + private static class Utf16Wrap_borrow_cont { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - DiplomatStringView.layout() + DiplomatString16View.layout(), + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_new"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_borrow_cont"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13245,57 +13204,56 @@ private static class Foo_new { /** * Function descriptor for: * {@snippet lang=c : - * Foo *Foo_new(DiplomatStringView x) + * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) * } */ - public static FunctionDescriptor Foo_new$descriptor() { - return Foo_new.DESC; + public static FunctionDescriptor Utf16Wrap_borrow_cont$descriptor() { + return Utf16Wrap_borrow_cont.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Foo *Foo_new(DiplomatStringView x) + * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) * } */ - public static MethodHandle Foo_new$handle() { - return Foo_new.HANDLE; + public static MethodHandle Utf16Wrap_borrow_cont$handle() { + return Utf16Wrap_borrow_cont.HANDLE; } /** * Address for: * {@snippet lang=c : - * Foo *Foo_new(DiplomatStringView x) + * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) * } */ - public static MemorySegment Foo_new$address() { - return Foo_new.ADDR; + public static MemorySegment Utf16Wrap_borrow_cont$address() { + return Utf16Wrap_borrow_cont.ADDR; } /** * {@snippet lang=c : - * Foo *Foo_new(DiplomatStringView x) + * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) * } */ - public static MemorySegment Foo_new(MemorySegment x) { - var mh$ = Foo_new.HANDLE; + public static MemorySegment Utf16Wrap_borrow_cont(SegmentAllocator allocator, MemorySegment self) { + var mh$ = Utf16Wrap_borrow_cont.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Foo_new", x); + traceDowncall("Utf16Wrap_borrow_cont", allocator, self); } - return (MemorySegment)mh$.invokeExact(x); + return (MemorySegment)mh$.invokeExact(allocator, self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Foo_get_bar { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, + private static class Utf16Wrap_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_get_bar"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13303,57 +13261,56 @@ private static class Foo_get_bar { /** * Function descriptor for: * {@snippet lang=c : - * Bar *Foo_get_bar(const Foo *self) + * void Utf16Wrap_destroy(Utf16Wrap *self) * } */ - public static FunctionDescriptor Foo_get_bar$descriptor() { - return Foo_get_bar.DESC; + public static FunctionDescriptor Utf16Wrap_destroy$descriptor() { + return Utf16Wrap_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Bar *Foo_get_bar(const Foo *self) + * void Utf16Wrap_destroy(Utf16Wrap *self) * } */ - public static MethodHandle Foo_get_bar$handle() { - return Foo_get_bar.HANDLE; + public static MethodHandle Utf16Wrap_destroy$handle() { + return Utf16Wrap_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * Bar *Foo_get_bar(const Foo *self) + * void Utf16Wrap_destroy(Utf16Wrap *self) * } */ - public static MemorySegment Foo_get_bar$address() { - return Foo_get_bar.ADDR; + public static MemorySegment Utf16Wrap_destroy$address() { + return Utf16Wrap_destroy.ADDR; } /** * {@snippet lang=c : - * Bar *Foo_get_bar(const Foo *self) + * void Utf16Wrap_destroy(Utf16Wrap *self) * } */ - public static MemorySegment Foo_get_bar(MemorySegment self) { - var mh$ = Foo_get_bar.HANDLE; + public static void Utf16Wrap_destroy(MemorySegment self) { + var mh$ = Utf16Wrap_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Foo_get_bar", self); + traceDowncall("Utf16Wrap_destroy", self); } - return (MemorySegment)mh$.invokeExact(self); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Foo_new_static { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - DiplomatStringView.layout() + private static class Two_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_new_static"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Two_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13361,57 +13318,55 @@ private static class Foo_new_static { /** * Function descriptor for: * {@snippet lang=c : - * Foo *Foo_new_static(DiplomatStringView x) + * void Two_destroy(Two *self) * } */ - public static FunctionDescriptor Foo_new_static$descriptor() { - return Foo_new_static.DESC; + public static FunctionDescriptor Two_destroy$descriptor() { + return Two_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Foo *Foo_new_static(DiplomatStringView x) + * void Two_destroy(Two *self) * } */ - public static MethodHandle Foo_new_static$handle() { - return Foo_new_static.HANDLE; + public static MethodHandle Two_destroy$handle() { + return Two_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * Foo *Foo_new_static(DiplomatStringView x) + * void Two_destroy(Two *self) * } */ - public static MemorySegment Foo_new_static$address() { - return Foo_new_static.ADDR; + public static MemorySegment Two_destroy$address() { + return Two_destroy.ADDR; } /** * {@snippet lang=c : - * Foo *Foo_new_static(DiplomatStringView x) + * void Two_destroy(Two *self) * } */ - public static MemorySegment Foo_new_static(MemorySegment x) { - var mh$ = Foo_new_static.HANDLE; + public static void Two_destroy(MemorySegment self) { + var mh$ = Two_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Foo_new_static", x); + traceDowncall("Two_destroy", self); } - return (MemorySegment)mh$.invokeExact(x); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Foo_as_returning { + private static class CyclicStructA_get_b { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - BorrowedFieldsReturning.layout(), - somelib_h.C_POINTER - ); + CyclicStructB.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_as_returning"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("CyclicStructA_get_b"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13419,57 +13374,55 @@ private static class Foo_as_returning { /** * Function descriptor for: * {@snippet lang=c : - * BorrowedFieldsReturning Foo_as_returning(const Foo *self) + * CyclicStructB CyclicStructA_get_b() * } */ - public static FunctionDescriptor Foo_as_returning$descriptor() { - return Foo_as_returning.DESC; + public static FunctionDescriptor CyclicStructA_get_b$descriptor() { + return CyclicStructA_get_b.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * BorrowedFieldsReturning Foo_as_returning(const Foo *self) + * CyclicStructB CyclicStructA_get_b() * } */ - public static MethodHandle Foo_as_returning$handle() { - return Foo_as_returning.HANDLE; + public static MethodHandle CyclicStructA_get_b$handle() { + return CyclicStructA_get_b.HANDLE; } /** * Address for: * {@snippet lang=c : - * BorrowedFieldsReturning Foo_as_returning(const Foo *self) + * CyclicStructB CyclicStructA_get_b() * } */ - public static MemorySegment Foo_as_returning$address() { - return Foo_as_returning.ADDR; + public static MemorySegment CyclicStructA_get_b$address() { + return CyclicStructA_get_b.ADDR; } /** * {@snippet lang=c : - * BorrowedFieldsReturning Foo_as_returning(const Foo *self) + * CyclicStructB CyclicStructA_get_b() * } */ - public static MemorySegment Foo_as_returning(SegmentAllocator allocator, MemorySegment self) { - var mh$ = Foo_as_returning.HANDLE; + public static MemorySegment CyclicStructA_get_b(SegmentAllocator allocator) { + var mh$ = CyclicStructA_get_b.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Foo_as_returning", allocator, self); + traceDowncall("CyclicStructA_get_b", allocator); } - return (MemorySegment)mh$.invokeExact(allocator, self); + return (MemorySegment)mh$.invokeExact(allocator); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Foo_extract_from_fields { + private static class CyclicStructB_get_a { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - BorrowedFields.layout() - ); + CyclicStructA.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_extract_from_fields"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("CyclicStructB_get_a"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13477,58 +13430,57 @@ private static class Foo_extract_from_fields { /** * Function descriptor for: * {@snippet lang=c : - * Foo *Foo_extract_from_fields(BorrowedFields fields) + * CyclicStructA CyclicStructB_get_a() * } */ - public static FunctionDescriptor Foo_extract_from_fields$descriptor() { - return Foo_extract_from_fields.DESC; + public static FunctionDescriptor CyclicStructB_get_a$descriptor() { + return CyclicStructB_get_a.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Foo *Foo_extract_from_fields(BorrowedFields fields) + * CyclicStructA CyclicStructB_get_a() * } */ - public static MethodHandle Foo_extract_from_fields$handle() { - return Foo_extract_from_fields.HANDLE; + public static MethodHandle CyclicStructB_get_a$handle() { + return CyclicStructB_get_a.HANDLE; } /** * Address for: * {@snippet lang=c : - * Foo *Foo_extract_from_fields(BorrowedFields fields) + * CyclicStructA CyclicStructB_get_a() * } - */ - public static MemorySegment Foo_extract_from_fields$address() { - return Foo_extract_from_fields.ADDR; + */ + public static MemorySegment CyclicStructB_get_a$address() { + return CyclicStructB_get_a.ADDR; } /** * {@snippet lang=c : - * Foo *Foo_extract_from_fields(BorrowedFields fields) + * CyclicStructA CyclicStructB_get_a() * } */ - public static MemorySegment Foo_extract_from_fields(MemorySegment fields) { - var mh$ = Foo_extract_from_fields.HANDLE; + public static MemorySegment CyclicStructB_get_a(SegmentAllocator allocator) { + var mh$ = CyclicStructB_get_a.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Foo_extract_from_fields", fields); + traceDowncall("CyclicStructB_get_a", allocator); } - return (MemorySegment)mh$.invokeExact(fields); + return (MemorySegment)mh$.invokeExact(allocator); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Foo_extract_from_bounds { + private static class Foo_new { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - BorrowedFieldsWithBounds.layout(), DiplomatStringView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_extract_from_bounds"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_new"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13536,56 +13488,57 @@ private static class Foo_extract_from_bounds { /** * Function descriptor for: * {@snippet lang=c : - * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, DiplomatStringView another_string) + * Foo *Foo_new(DiplomatStringView x) * } */ - public static FunctionDescriptor Foo_extract_from_bounds$descriptor() { - return Foo_extract_from_bounds.DESC; + public static FunctionDescriptor Foo_new$descriptor() { + return Foo_new.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, DiplomatStringView another_string) + * Foo *Foo_new(DiplomatStringView x) * } */ - public static MethodHandle Foo_extract_from_bounds$handle() { - return Foo_extract_from_bounds.HANDLE; + public static MethodHandle Foo_new$handle() { + return Foo_new.HANDLE; } /** * Address for: * {@snippet lang=c : - * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, DiplomatStringView another_string) + * Foo *Foo_new(DiplomatStringView x) * } */ - public static MemorySegment Foo_extract_from_bounds$address() { - return Foo_extract_from_bounds.ADDR; + public static MemorySegment Foo_new$address() { + return Foo_new.ADDR; } /** * {@snippet lang=c : - * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, DiplomatStringView another_string) + * Foo *Foo_new(DiplomatStringView x) * } */ - public static MemorySegment Foo_extract_from_bounds(MemorySegment bounds, MemorySegment another_string) { - var mh$ = Foo_extract_from_bounds.HANDLE; + public static MemorySegment Foo_new(MemorySegment x) { + var mh$ = Foo_new.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Foo_extract_from_bounds", bounds, another_string); + traceDowncall("Foo_new", x); } - return (MemorySegment)mh$.invokeExact(bounds, another_string); + return (MemorySegment)mh$.invokeExact(x); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Foo_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class Foo_get_bar { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_get_bar"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13593,62 +13546,57 @@ private static class Foo_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void Foo_destroy(Foo *self) + * Bar *Foo_get_bar(const Foo *self) * } */ - public static FunctionDescriptor Foo_destroy$descriptor() { - return Foo_destroy.DESC; + public static FunctionDescriptor Foo_get_bar$descriptor() { + return Foo_get_bar.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Foo_destroy(Foo *self) + * Bar *Foo_get_bar(const Foo *self) * } */ - public static MethodHandle Foo_destroy$handle() { - return Foo_destroy.HANDLE; + public static MethodHandle Foo_get_bar$handle() { + return Foo_get_bar.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Foo_destroy(Foo *self) + * Bar *Foo_get_bar(const Foo *self) * } */ - public static MemorySegment Foo_destroy$address() { - return Foo_destroy.ADDR; + public static MemorySegment Foo_get_bar$address() { + return Foo_get_bar.ADDR; } /** * {@snippet lang=c : - * void Foo_destroy(Foo *self) + * Bar *Foo_get_bar(const Foo *self) * } */ - public static void Foo_destroy(MemorySegment self) { - var mh$ = Foo_destroy.HANDLE; + public static MemorySegment Foo_get_bar(MemorySegment self) { + var mh$ = Foo_get_bar.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Foo_destroy", self); + traceDowncall("Foo_get_bar", self); } - mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class NestedBorrowedFields_from_bar_and_foo_and_strings { + private static class Foo_as_returning { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - NestedBorrowedFields.layout(), - somelib_h.C_POINTER, - somelib_h.C_POINTER, - DiplomatString16View.layout(), - DiplomatString16View.layout(), - DiplomatStringView.layout(), - DiplomatStringView.layout() + BorrowedFieldsReturning.layout(), + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("NestedBorrowedFields_from_bar_and_foo_and_strings"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_as_returning"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13656,57 +13604,57 @@ private static class NestedBorrowedFields_from_bar_and_foo_and_strings { /** * Function descriptor for: * {@snippet lang=c : - * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, DiplomatString16View dstr16_x, DiplomatString16View dstr16_z, DiplomatStringView utf8_str_y, DiplomatStringView utf8_str_z) + * BorrowedFieldsReturning Foo_as_returning(const Foo *self) * } */ - public static FunctionDescriptor NestedBorrowedFields_from_bar_and_foo_and_strings$descriptor() { - return NestedBorrowedFields_from_bar_and_foo_and_strings.DESC; + public static FunctionDescriptor Foo_as_returning$descriptor() { + return Foo_as_returning.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, DiplomatString16View dstr16_x, DiplomatString16View dstr16_z, DiplomatStringView utf8_str_y, DiplomatStringView utf8_str_z) + * BorrowedFieldsReturning Foo_as_returning(const Foo *self) * } */ - public static MethodHandle NestedBorrowedFields_from_bar_and_foo_and_strings$handle() { - return NestedBorrowedFields_from_bar_and_foo_and_strings.HANDLE; + public static MethodHandle Foo_as_returning$handle() { + return Foo_as_returning.HANDLE; } /** * Address for: * {@snippet lang=c : - * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, DiplomatString16View dstr16_x, DiplomatString16View dstr16_z, DiplomatStringView utf8_str_y, DiplomatStringView utf8_str_z) + * BorrowedFieldsReturning Foo_as_returning(const Foo *self) * } */ - public static MemorySegment NestedBorrowedFields_from_bar_and_foo_and_strings$address() { - return NestedBorrowedFields_from_bar_and_foo_and_strings.ADDR; + public static MemorySegment Foo_as_returning$address() { + return Foo_as_returning.ADDR; } /** * {@snippet lang=c : - * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, DiplomatString16View dstr16_x, DiplomatString16View dstr16_z, DiplomatStringView utf8_str_y, DiplomatStringView utf8_str_z) + * BorrowedFieldsReturning Foo_as_returning(const Foo *self) * } */ - public static MemorySegment NestedBorrowedFields_from_bar_and_foo_and_strings(SegmentAllocator allocator, MemorySegment bar, MemorySegment foo, MemorySegment dstr16_x, MemorySegment dstr16_z, MemorySegment utf8_str_y, MemorySegment utf8_str_z) { - var mh$ = NestedBorrowedFields_from_bar_and_foo_and_strings.HANDLE; + public static MemorySegment Foo_as_returning(SegmentAllocator allocator, MemorySegment self) { + var mh$ = Foo_as_returning.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("NestedBorrowedFields_from_bar_and_foo_and_strings", allocator, bar, foo, dstr16_x, dstr16_z, utf8_str_y, utf8_str_z); + traceDowncall("Foo_as_returning", allocator, self); } - return (MemorySegment)mh$.invokeExact(allocator, bar, foo, dstr16_x, dstr16_z, utf8_str_y, utf8_str_z); + return (MemorySegment)mh$.invokeExact(allocator, self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_new_bool { + private static class Foo_extract_from_fields { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - DiplomatBoolView.layout() + BorrowedFields.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_bool"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_extract_from_fields"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13714,57 +13662,58 @@ private static class Float64Vec_new_bool { /** * Function descriptor for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_bool(DiplomatBoolView v) + * Foo *Foo_extract_from_fields(BorrowedFields fields) * } */ - public static FunctionDescriptor Float64Vec_new_bool$descriptor() { - return Float64Vec_new_bool.DESC; + public static FunctionDescriptor Foo_extract_from_fields$descriptor() { + return Foo_extract_from_fields.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_bool(DiplomatBoolView v) + * Foo *Foo_extract_from_fields(BorrowedFields fields) * } */ - public static MethodHandle Float64Vec_new_bool$handle() { - return Float64Vec_new_bool.HANDLE; + public static MethodHandle Foo_extract_from_fields$handle() { + return Foo_extract_from_fields.HANDLE; } /** * Address for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_bool(DiplomatBoolView v) + * Foo *Foo_extract_from_fields(BorrowedFields fields) * } */ - public static MemorySegment Float64Vec_new_bool$address() { - return Float64Vec_new_bool.ADDR; + public static MemorySegment Foo_extract_from_fields$address() { + return Foo_extract_from_fields.ADDR; } /** * {@snippet lang=c : - * Float64Vec *Float64Vec_new_bool(DiplomatBoolView v) + * Foo *Foo_extract_from_fields(BorrowedFields fields) * } */ - public static MemorySegment Float64Vec_new_bool(MemorySegment v) { - var mh$ = Float64Vec_new_bool.HANDLE; + public static MemorySegment Foo_extract_from_fields(MemorySegment fields) { + var mh$ = Foo_extract_from_fields.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_new_bool", v); + traceDowncall("Foo_extract_from_fields", fields); } - return (MemorySegment)mh$.invokeExact(v); + return (MemorySegment)mh$.invokeExact(fields); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_new_i16 { + private static class Foo_extract_from_bounds { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - DiplomatI16View.layout() + BorrowedFieldsWithBounds.layout(), + DiplomatStringView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_i16"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_extract_from_bounds"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13772,57 +13721,56 @@ private static class Float64Vec_new_i16 { /** * Function descriptor for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_i16(DiplomatI16View v) + * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, DiplomatStringView another_string) * } */ - public static FunctionDescriptor Float64Vec_new_i16$descriptor() { - return Float64Vec_new_i16.DESC; + public static FunctionDescriptor Foo_extract_from_bounds$descriptor() { + return Foo_extract_from_bounds.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_i16(DiplomatI16View v) + * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, DiplomatStringView another_string) * } */ - public static MethodHandle Float64Vec_new_i16$handle() { - return Float64Vec_new_i16.HANDLE; + public static MethodHandle Foo_extract_from_bounds$handle() { + return Foo_extract_from_bounds.HANDLE; } /** * Address for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_i16(DiplomatI16View v) + * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, DiplomatStringView another_string) * } */ - public static MemorySegment Float64Vec_new_i16$address() { - return Float64Vec_new_i16.ADDR; + public static MemorySegment Foo_extract_from_bounds$address() { + return Foo_extract_from_bounds.ADDR; } /** * {@snippet lang=c : - * Float64Vec *Float64Vec_new_i16(DiplomatI16View v) + * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, DiplomatStringView another_string) * } */ - public static MemorySegment Float64Vec_new_i16(MemorySegment v) { - var mh$ = Float64Vec_new_i16.HANDLE; + public static MemorySegment Foo_extract_from_bounds(MemorySegment bounds, MemorySegment another_string) { + var mh$ = Foo_extract_from_bounds.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_new_i16", v); + traceDowncall("Foo_extract_from_bounds", bounds, another_string); } - return (MemorySegment)mh$.invokeExact(v); + return (MemorySegment)mh$.invokeExact(bounds, another_string); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_new_u16 { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - DiplomatU16View.layout() + private static class Foo_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_u16"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13830,57 +13778,59 @@ private static class Float64Vec_new_u16 { /** * Function descriptor for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_u16(DiplomatU16View v) + * void Foo_destroy(Foo *self) * } */ - public static FunctionDescriptor Float64Vec_new_u16$descriptor() { - return Float64Vec_new_u16.DESC; + public static FunctionDescriptor Foo_destroy$descriptor() { + return Foo_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_u16(DiplomatU16View v) + * void Foo_destroy(Foo *self) * } */ - public static MethodHandle Float64Vec_new_u16$handle() { - return Float64Vec_new_u16.HANDLE; + public static MethodHandle Foo_destroy$handle() { + return Foo_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_u16(DiplomatU16View v) + * void Foo_destroy(Foo *self) * } */ - public static MemorySegment Float64Vec_new_u16$address() { - return Float64Vec_new_u16.ADDR; + public static MemorySegment Foo_destroy$address() { + return Foo_destroy.ADDR; } /** * {@snippet lang=c : - * Float64Vec *Float64Vec_new_u16(DiplomatU16View v) + * void Foo_destroy(Foo *self) * } */ - public static MemorySegment Float64Vec_new_u16(MemorySegment v) { - var mh$ = Float64Vec_new_u16.HANDLE; + public static void Foo_destroy(MemorySegment self) { + var mh$ = Foo_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_new_u16", v); + traceDowncall("Foo_destroy", self); } - return (MemorySegment)mh$.invokeExact(v); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_new_isize { + private static class BorrowedFields_from_bar_and_strings { public static final FunctionDescriptor DESC = FunctionDescriptor.of( + BorrowedFields.layout(), somelib_h.C_POINTER, - DiplomatIsizeView.layout() + DiplomatString16View.layout(), + DiplomatStringView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_isize"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("BorrowedFields_from_bar_and_strings"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13888,57 +13838,55 @@ private static class Float64Vec_new_isize { /** * Function descriptor for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_isize(DiplomatIsizeView v) + * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, DiplomatString16View dstr16, DiplomatStringView utf8_str) * } */ - public static FunctionDescriptor Float64Vec_new_isize$descriptor() { - return Float64Vec_new_isize.DESC; + public static FunctionDescriptor BorrowedFields_from_bar_and_strings$descriptor() { + return BorrowedFields_from_bar_and_strings.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_isize(DiplomatIsizeView v) + * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, DiplomatString16View dstr16, DiplomatStringView utf8_str) * } */ - public static MethodHandle Float64Vec_new_isize$handle() { - return Float64Vec_new_isize.HANDLE; + public static MethodHandle BorrowedFields_from_bar_and_strings$handle() { + return BorrowedFields_from_bar_and_strings.HANDLE; } /** * Address for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_isize(DiplomatIsizeView v) + * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, DiplomatString16View dstr16, DiplomatStringView utf8_str) * } */ - public static MemorySegment Float64Vec_new_isize$address() { - return Float64Vec_new_isize.ADDR; + public static MemorySegment BorrowedFields_from_bar_and_strings$address() { + return BorrowedFields_from_bar_and_strings.ADDR; } /** * {@snippet lang=c : - * Float64Vec *Float64Vec_new_isize(DiplomatIsizeView v) + * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, DiplomatString16View dstr16, DiplomatStringView utf8_str) * } */ - public static MemorySegment Float64Vec_new_isize(MemorySegment v) { - var mh$ = Float64Vec_new_isize.HANDLE; + public static MemorySegment BorrowedFields_from_bar_and_strings(SegmentAllocator allocator, MemorySegment bar, MemorySegment dstr16, MemorySegment utf8_str) { + var mh$ = BorrowedFields_from_bar_and_strings.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_new_isize", v); + traceDowncall("BorrowedFields_from_bar_and_strings", allocator, bar, dstr16, utf8_str); } - return (MemorySegment)mh$.invokeExact(v); + return (MemorySegment)mh$.invokeExact(allocator, bar, dstr16, utf8_str); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_new_usize { + private static class Opaque_new { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - DiplomatUsizeView.layout() - ); + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_usize"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_new"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13946,57 +13894,57 @@ private static class Float64Vec_new_usize { /** * Function descriptor for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_usize(DiplomatUsizeView v) + * Opaque *Opaque_new() * } */ - public static FunctionDescriptor Float64Vec_new_usize$descriptor() { - return Float64Vec_new_usize.DESC; + public static FunctionDescriptor Opaque_new$descriptor() { + return Opaque_new.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_usize(DiplomatUsizeView v) + * Opaque *Opaque_new() * } */ - public static MethodHandle Float64Vec_new_usize$handle() { - return Float64Vec_new_usize.HANDLE; + public static MethodHandle Opaque_new$handle() { + return Opaque_new.HANDLE; } /** * Address for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_usize(DiplomatUsizeView v) + * Opaque *Opaque_new() * } */ - public static MemorySegment Float64Vec_new_usize$address() { - return Float64Vec_new_usize.ADDR; + public static MemorySegment Opaque_new$address() { + return Opaque_new.ADDR; } /** * {@snippet lang=c : - * Float64Vec *Float64Vec_new_usize(DiplomatUsizeView v) + * Opaque *Opaque_new() * } */ - public static MemorySegment Float64Vec_new_usize(MemorySegment v) { - var mh$ = Float64Vec_new_usize.HANDLE; + public static MemorySegment Opaque_new() { + var mh$ = Opaque_new.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_new_usize", v); + traceDowncall("Opaque_new"); } - return (MemorySegment)mh$.invokeExact(v); + return (MemorySegment)mh$.invokeExact(); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_new_f64_be_bytes { + private static class Opaque_from_str { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - DiplomatU8View.layout() + DiplomatStringView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_f64_be_bytes"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_from_str"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14004,57 +13952,57 @@ private static class Float64Vec_new_f64_be_bytes { /** * Function descriptor for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_f64_be_bytes(DiplomatU8View v) + * Opaque *Opaque_from_str(DiplomatStringView input) * } */ - public static FunctionDescriptor Float64Vec_new_f64_be_bytes$descriptor() { - return Float64Vec_new_f64_be_bytes.DESC; + public static FunctionDescriptor Opaque_from_str$descriptor() { + return Opaque_from_str.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_f64_be_bytes(DiplomatU8View v) + * Opaque *Opaque_from_str(DiplomatStringView input) * } */ - public static MethodHandle Float64Vec_new_f64_be_bytes$handle() { - return Float64Vec_new_f64_be_bytes.HANDLE; + public static MethodHandle Opaque_from_str$handle() { + return Opaque_from_str.HANDLE; } /** * Address for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_f64_be_bytes(DiplomatU8View v) + * Opaque *Opaque_from_str(DiplomatStringView input) * } */ - public static MemorySegment Float64Vec_new_f64_be_bytes$address() { - return Float64Vec_new_f64_be_bytes.ADDR; + public static MemorySegment Opaque_from_str$address() { + return Opaque_from_str.ADDR; } /** * {@snippet lang=c : - * Float64Vec *Float64Vec_new_f64_be_bytes(DiplomatU8View v) + * Opaque *Opaque_from_str(DiplomatStringView input) * } */ - public static MemorySegment Float64Vec_new_f64_be_bytes(MemorySegment v) { - var mh$ = Float64Vec_new_f64_be_bytes.HANDLE; + public static MemorySegment Opaque_from_str(MemorySegment input) { + var mh$ = Opaque_from_str.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_new_f64_be_bytes", v); + traceDowncall("Opaque_from_str", input); } - return (MemorySegment)mh$.invokeExact(v); + return (MemorySegment)mh$.invokeExact(input); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_new_from_owned { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( + private static class Opaque_get_debug_str { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER, - DiplomatF64ViewMut.layout() + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_from_owned"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_get_debug_str"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14062,57 +14010,57 @@ private static class Float64Vec_new_from_owned { /** * Function descriptor for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_from_owned(DiplomatF64ViewMut v) + * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) * } */ - public static FunctionDescriptor Float64Vec_new_from_owned$descriptor() { - return Float64Vec_new_from_owned.DESC; + public static FunctionDescriptor Opaque_get_debug_str$descriptor() { + return Opaque_get_debug_str.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_from_owned(DiplomatF64ViewMut v) + * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) * } */ - public static MethodHandle Float64Vec_new_from_owned$handle() { - return Float64Vec_new_from_owned.HANDLE; + public static MethodHandle Opaque_get_debug_str$handle() { + return Opaque_get_debug_str.HANDLE; } /** * Address for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_from_owned(DiplomatF64ViewMut v) + * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) * } */ - public static MemorySegment Float64Vec_new_from_owned$address() { - return Float64Vec_new_from_owned.ADDR; + public static MemorySegment Opaque_get_debug_str$address() { + return Opaque_get_debug_str.ADDR; } /** * {@snippet lang=c : - * Float64Vec *Float64Vec_new_from_owned(DiplomatF64ViewMut v) + * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) * } */ - public static MemorySegment Float64Vec_new_from_owned(MemorySegment v) { - var mh$ = Float64Vec_new_from_owned.HANDLE; + public static void Opaque_get_debug_str(MemorySegment self, MemorySegment write) { + var mh$ = Opaque_get_debug_str.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_new_from_owned", v); + traceDowncall("Opaque_get_debug_str", self, write); } - return (MemorySegment)mh$.invokeExact(v); + mh$.invokeExact(self, write); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_as_slice { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - DiplomatF64View.layout(), - somelib_h.C_POINTER + private static class Opaque_assert_struct { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, + MyStruct.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_as_slice"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_assert_struct"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14120,57 +14068,55 @@ private static class Float64Vec_as_slice { /** * Function descriptor for: * {@snippet lang=c : - * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) + * void Opaque_assert_struct(const Opaque *self, MyStruct s) * } */ - public static FunctionDescriptor Float64Vec_as_slice$descriptor() { - return Float64Vec_as_slice.DESC; + public static FunctionDescriptor Opaque_assert_struct$descriptor() { + return Opaque_assert_struct.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) + * void Opaque_assert_struct(const Opaque *self, MyStruct s) * } */ - public static MethodHandle Float64Vec_as_slice$handle() { - return Float64Vec_as_slice.HANDLE; + public static MethodHandle Opaque_assert_struct$handle() { + return Opaque_assert_struct.HANDLE; } /** * Address for: * {@snippet lang=c : - * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) + * void Opaque_assert_struct(const Opaque *self, MyStruct s) * } */ - public static MemorySegment Float64Vec_as_slice$address() { - return Float64Vec_as_slice.ADDR; + public static MemorySegment Opaque_assert_struct$address() { + return Opaque_assert_struct.ADDR; } /** * {@snippet lang=c : - * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) + * void Opaque_assert_struct(const Opaque *self, MyStruct s) * } */ - public static MemorySegment Float64Vec_as_slice(SegmentAllocator allocator, MemorySegment self) { - var mh$ = Float64Vec_as_slice.HANDLE; + public static void Opaque_assert_struct(MemorySegment self, MemorySegment s) { + var mh$ = Opaque_assert_struct.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_as_slice", allocator, self); + traceDowncall("Opaque_assert_struct", self, s); } - return (MemorySegment)mh$.invokeExact(allocator, self); + mh$.invokeExact(self, s); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_fill_slice { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER, - DiplomatF64ViewMut.layout() - ); + private static class Opaque_returns_usize { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_fill_slice"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_returns_usize"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14178,57 +14124,57 @@ private static class Float64Vec_fill_slice { /** * Function descriptor for: * {@snippet lang=c : - * void Float64Vec_fill_slice(const Float64Vec *self, DiplomatF64ViewMut v) + * size_t Opaque_returns_usize() * } */ - public static FunctionDescriptor Float64Vec_fill_slice$descriptor() { - return Float64Vec_fill_slice.DESC; + public static FunctionDescriptor Opaque_returns_usize$descriptor() { + return Opaque_returns_usize.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Float64Vec_fill_slice(const Float64Vec *self, DiplomatF64ViewMut v) + * size_t Opaque_returns_usize() * } */ - public static MethodHandle Float64Vec_fill_slice$handle() { - return Float64Vec_fill_slice.HANDLE; + public static MethodHandle Opaque_returns_usize$handle() { + return Opaque_returns_usize.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Float64Vec_fill_slice(const Float64Vec *self, DiplomatF64ViewMut v) + * size_t Opaque_returns_usize() * } */ - public static MemorySegment Float64Vec_fill_slice$address() { - return Float64Vec_fill_slice.ADDR; + public static MemorySegment Opaque_returns_usize$address() { + return Opaque_returns_usize.ADDR; } /** * {@snippet lang=c : - * void Float64Vec_fill_slice(const Float64Vec *self, DiplomatF64ViewMut v) + * size_t Opaque_returns_usize() * } */ - public static void Float64Vec_fill_slice(MemorySegment self, MemorySegment v) { - var mh$ = Float64Vec_fill_slice.HANDLE; + public static long Opaque_returns_usize() { + var mh$ = Opaque_returns_usize.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_fill_slice", self, v); + traceDowncall("Opaque_returns_usize"); } - mh$.invokeExact(self, v); + return (long)mh$.invokeExact(); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_set_value { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER, - DiplomatF64View.layout() + private static class Opaque_internal_len { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_LONG, + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_set_value"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_internal_len"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14236,57 +14182,55 @@ private static class Float64Vec_set_value { /** * Function descriptor for: * {@snippet lang=c : - * void Float64Vec_set_value(Float64Vec *self, DiplomatF64View new_slice) + * size_t Opaque_internal_len(const Opaque *self) * } */ - public static FunctionDescriptor Float64Vec_set_value$descriptor() { - return Float64Vec_set_value.DESC; + public static FunctionDescriptor Opaque_internal_len$descriptor() { + return Opaque_internal_len.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Float64Vec_set_value(Float64Vec *self, DiplomatF64View new_slice) + * size_t Opaque_internal_len(const Opaque *self) * } */ - public static MethodHandle Float64Vec_set_value$handle() { - return Float64Vec_set_value.HANDLE; + public static MethodHandle Opaque_internal_len$handle() { + return Opaque_internal_len.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Float64Vec_set_value(Float64Vec *self, DiplomatF64View new_slice) + * size_t Opaque_internal_len(const Opaque *self) * } */ - public static MemorySegment Float64Vec_set_value$address() { - return Float64Vec_set_value.ADDR; + public static MemorySegment Opaque_internal_len$address() { + return Opaque_internal_len.ADDR; } /** * {@snippet lang=c : - * void Float64Vec_set_value(Float64Vec *self, DiplomatF64View new_slice) + * size_t Opaque_internal_len(const Opaque *self) * } */ - public static void Float64Vec_set_value(MemorySegment self, MemorySegment new_slice) { - var mh$ = Float64Vec_set_value.HANDLE; + public static long Opaque_internal_len(MemorySegment self) { + var mh$ = Opaque_internal_len.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_set_value", self, new_slice); + traceDowncall("Opaque_internal_len", self); } - mh$.invokeExact(self, new_slice); + return (long)mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_to_string { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); + private static class Opaque_returns_imported { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + ImportedStruct.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_to_string"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_returns_imported"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14294,57 +14238,55 @@ private static class Float64Vec_to_string { /** * Function descriptor for: * {@snippet lang=c : - * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) + * ImportedStruct Opaque_returns_imported() * } */ - public static FunctionDescriptor Float64Vec_to_string$descriptor() { - return Float64Vec_to_string.DESC; + public static FunctionDescriptor Opaque_returns_imported$descriptor() { + return Opaque_returns_imported.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) + * ImportedStruct Opaque_returns_imported() * } */ - public static MethodHandle Float64Vec_to_string$handle() { - return Float64Vec_to_string.HANDLE; + public static MethodHandle Opaque_returns_imported$handle() { + return Opaque_returns_imported.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) + * ImportedStruct Opaque_returns_imported() * } */ - public static MemorySegment Float64Vec_to_string$address() { - return Float64Vec_to_string.ADDR; + public static MemorySegment Opaque_returns_imported$address() { + return Opaque_returns_imported.ADDR; } /** * {@snippet lang=c : - * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) + * ImportedStruct Opaque_returns_imported() * } */ - public static void Float64Vec_to_string(MemorySegment self, MemorySegment write) { - var mh$ = Float64Vec_to_string.HANDLE; + public static MemorySegment Opaque_returns_imported(SegmentAllocator allocator) { + var mh$ = Opaque_returns_imported.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_to_string", self, write); + traceDowncall("Opaque_returns_imported", allocator); } - mh$.invokeExact(self, write); + return (MemorySegment)mh$.invokeExact(allocator); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_borrow { + private static class Opaque_cmp { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - DiplomatF64View.layout(), - somelib_h.C_POINTER - ); + somelib_h.C_CHAR ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_borrow"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_cmp"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14352,56 +14294,56 @@ private static class Float64Vec_borrow { /** * Function descriptor for: * {@snippet lang=c : - * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) + * int8_t Opaque_cmp() * } */ - public static FunctionDescriptor Float64Vec_borrow$descriptor() { - return Float64Vec_borrow.DESC; + public static FunctionDescriptor Opaque_cmp$descriptor() { + return Opaque_cmp.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) + * int8_t Opaque_cmp() * } */ - public static MethodHandle Float64Vec_borrow$handle() { - return Float64Vec_borrow.HANDLE; + public static MethodHandle Opaque_cmp$handle() { + return Opaque_cmp.HANDLE; } /** * Address for: * {@snippet lang=c : - * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) + * int8_t Opaque_cmp() * } */ - public static MemorySegment Float64Vec_borrow$address() { - return Float64Vec_borrow.ADDR; + public static MemorySegment Opaque_cmp$address() { + return Opaque_cmp.ADDR; } /** * {@snippet lang=c : - * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) + * int8_t Opaque_cmp() * } */ - public static MemorySegment Float64Vec_borrow(SegmentAllocator allocator, MemorySegment self) { - var mh$ = Float64Vec_borrow.HANDLE; + public static byte Opaque_cmp() { + var mh$ = Opaque_cmp.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_borrow", allocator, self); + traceDowncall("Opaque_cmp"); } - return (MemorySegment)mh$.invokeExact(allocator, self); + return (byte)mh$.invokeExact(); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_destroy { + private static class Opaque_destroy { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14409,43 +14351,43 @@ private static class Float64Vec_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void Float64Vec_destroy(Float64Vec *self) + * void Opaque_destroy(Opaque *self) * } */ - public static FunctionDescriptor Float64Vec_destroy$descriptor() { - return Float64Vec_destroy.DESC; + public static FunctionDescriptor Opaque_destroy$descriptor() { + return Opaque_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Float64Vec_destroy(Float64Vec *self) + * void Opaque_destroy(Opaque *self) * } */ - public static MethodHandle Float64Vec_destroy$handle() { - return Float64Vec_destroy.HANDLE; + public static MethodHandle Opaque_destroy$handle() { + return Opaque_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Float64Vec_destroy(Float64Vec *self) + * void Opaque_destroy(Opaque *self) * } */ - public static MemorySegment Float64Vec_destroy$address() { - return Float64Vec_destroy.ADDR; + public static MemorySegment Opaque_destroy$address() { + return Opaque_destroy.ADDR; } /** * {@snippet lang=c : - * void Float64Vec_destroy(Float64Vec *self) + * void Opaque_destroy(Opaque *self) * } */ - public static void Float64Vec_destroy(MemorySegment self) { - var mh$ = Float64Vec_destroy.HANDLE; + public static void Opaque_destroy(MemorySegment self) { + var mh$ = Opaque_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_destroy", self); + traceDowncall("Opaque_destroy", self); } mh$.invokeExact(self); } catch (Throwable ex$) { @@ -14491,1073 +14433,1073 @@ public static long __DARWIN_C_FULL() { public static long __DARWIN_C_LEVEL() { return __DARWIN_C_LEVEL; } + private static final int MAC_OS_X_VERSION_10_0 = (int)1000L; /** * {@snippet lang=c : - * #define __ASSERT_FILE_NAME "jextract$13440747494818414911.h" + * #define MAC_OS_X_VERSION_10_0 1000 * } */ - public static MemorySegment __ASSERT_FILE_NAME() { - class Holder { - static final MemorySegment __ASSERT_FILE_NAME - = somelib_h.LIBRARY_ARENA.allocateFrom("jextract$13440747494818414911.h"); - } - return Holder.__ASSERT_FILE_NAME; + public static int MAC_OS_X_VERSION_10_0() { + return MAC_OS_X_VERSION_10_0; } - private static final MemorySegment NULL = MemorySegment.ofAddress(0L); + private static final int MAC_OS_X_VERSION_10_1 = (int)1010L; /** * {@snippet lang=c : - * #define NULL (void*) 0 + * #define MAC_OS_X_VERSION_10_1 1010 * } */ - public static MemorySegment NULL() { - return NULL; + public static int MAC_OS_X_VERSION_10_1() { + return MAC_OS_X_VERSION_10_1; } - private static final MemorySegment __DARWIN_NULL = MemorySegment.ofAddress(0L); + private static final int MAC_OS_X_VERSION_10_2 = (int)1020L; /** * {@snippet lang=c : - * #define __DARWIN_NULL (void*) 0 + * #define MAC_OS_X_VERSION_10_2 1020 * } */ - public static MemorySegment __DARWIN_NULL() { - return __DARWIN_NULL; + public static int MAC_OS_X_VERSION_10_2() { + return MAC_OS_X_VERSION_10_2; } - private static final long USER_ADDR_NULL = 0L; + private static final int MAC_OS_X_VERSION_10_3 = (int)1030L; /** * {@snippet lang=c : - * #define USER_ADDR_NULL 0 + * #define MAC_OS_X_VERSION_10_3 1030 * } */ - public static long USER_ADDR_NULL() { - return USER_ADDR_NULL; + public static int MAC_OS_X_VERSION_10_3() { + return MAC_OS_X_VERSION_10_3; } - private static final long INT64_MAX = 9223372036854775807L; + private static final int MAC_OS_X_VERSION_10_4 = (int)1040L; /** * {@snippet lang=c : - * #define INT64_MAX 9223372036854775807 + * #define MAC_OS_X_VERSION_10_4 1040 * } */ - public static long INT64_MAX() { - return INT64_MAX; + public static int MAC_OS_X_VERSION_10_4() { + return MAC_OS_X_VERSION_10_4; } - private static final int INT8_MIN = (int)-128L; + private static final int MAC_OS_X_VERSION_10_5 = (int)1050L; /** * {@snippet lang=c : - * #define INT8_MIN -128 + * #define MAC_OS_X_VERSION_10_5 1050 * } */ - public static int INT8_MIN() { - return INT8_MIN; + public static int MAC_OS_X_VERSION_10_5() { + return MAC_OS_X_VERSION_10_5; } - private static final int INT16_MIN = (int)-32768L; + private static final int MAC_OS_X_VERSION_10_6 = (int)1060L; /** * {@snippet lang=c : - * #define INT16_MIN -32768 + * #define MAC_OS_X_VERSION_10_6 1060 * } */ - public static int INT16_MIN() { - return INT16_MIN; + public static int MAC_OS_X_VERSION_10_6() { + return MAC_OS_X_VERSION_10_6; } - private static final int INT32_MIN = (int)-2147483648L; + private static final int MAC_OS_X_VERSION_10_7 = (int)1070L; /** * {@snippet lang=c : - * #define INT32_MIN -2147483648 + * #define MAC_OS_X_VERSION_10_7 1070 * } */ - public static int INT32_MIN() { - return INT32_MIN; + public static int MAC_OS_X_VERSION_10_7() { + return MAC_OS_X_VERSION_10_7; } - private static final long INT64_MIN = -9223372036854775808L; + private static final int MAC_OS_X_VERSION_10_8 = (int)1080L; /** * {@snippet lang=c : - * #define INT64_MIN -9223372036854775808 + * #define MAC_OS_X_VERSION_10_8 1080 * } */ - public static long INT64_MIN() { - return INT64_MIN; + public static int MAC_OS_X_VERSION_10_8() { + return MAC_OS_X_VERSION_10_8; } - private static final int UINT32_MAX = (int)4294967295L; + private static final int MAC_OS_X_VERSION_10_9 = (int)1090L; /** * {@snippet lang=c : - * #define UINT32_MAX 4294967295 + * #define MAC_OS_X_VERSION_10_9 1090 * } */ - public static int UINT32_MAX() { - return UINT32_MAX; + public static int MAC_OS_X_VERSION_10_9() { + return MAC_OS_X_VERSION_10_9; } - private static final long UINT64_MAX = -1L; + private static final int MAC_OS_X_VERSION_10_10 = (int)101000L; /** * {@snippet lang=c : - * #define UINT64_MAX -1 + * #define MAC_OS_X_VERSION_10_10 101000 * } */ - public static long UINT64_MAX() { - return UINT64_MAX; + public static int MAC_OS_X_VERSION_10_10() { + return MAC_OS_X_VERSION_10_10; } - private static final int INT_LEAST8_MIN = (int)-128L; + private static final int MAC_OS_X_VERSION_10_10_2 = (int)101002L; /** * {@snippet lang=c : - * #define INT_LEAST8_MIN -128 + * #define MAC_OS_X_VERSION_10_10_2 101002 * } */ - public static int INT_LEAST8_MIN() { - return INT_LEAST8_MIN; + public static int MAC_OS_X_VERSION_10_10_2() { + return MAC_OS_X_VERSION_10_10_2; } - private static final int INT_LEAST16_MIN = (int)-32768L; + private static final int MAC_OS_X_VERSION_10_10_3 = (int)101003L; /** * {@snippet lang=c : - * #define INT_LEAST16_MIN -32768 + * #define MAC_OS_X_VERSION_10_10_3 101003 * } */ - public static int INT_LEAST16_MIN() { - return INT_LEAST16_MIN; + public static int MAC_OS_X_VERSION_10_10_3() { + return MAC_OS_X_VERSION_10_10_3; } - private static final int INT_LEAST32_MIN = (int)-2147483648L; + private static final int MAC_OS_X_VERSION_10_11 = (int)101100L; /** * {@snippet lang=c : - * #define INT_LEAST32_MIN -2147483648 + * #define MAC_OS_X_VERSION_10_11 101100 * } */ - public static int INT_LEAST32_MIN() { - return INT_LEAST32_MIN; + public static int MAC_OS_X_VERSION_10_11() { + return MAC_OS_X_VERSION_10_11; } - private static final long INT_LEAST64_MIN = -9223372036854775808L; + private static final int MAC_OS_X_VERSION_10_11_2 = (int)101102L; /** * {@snippet lang=c : - * #define INT_LEAST64_MIN -9223372036854775808 + * #define MAC_OS_X_VERSION_10_11_2 101102 * } */ - public static long INT_LEAST64_MIN() { - return INT_LEAST64_MIN; + public static int MAC_OS_X_VERSION_10_11_2() { + return MAC_OS_X_VERSION_10_11_2; } - private static final int INT_LEAST8_MAX = (int)127L; + private static final int MAC_OS_X_VERSION_10_11_3 = (int)101103L; /** * {@snippet lang=c : - * #define INT_LEAST8_MAX 127 + * #define MAC_OS_X_VERSION_10_11_3 101103 * } */ - public static int INT_LEAST8_MAX() { - return INT_LEAST8_MAX; + public static int MAC_OS_X_VERSION_10_11_3() { + return MAC_OS_X_VERSION_10_11_3; } - private static final int INT_LEAST16_MAX = (int)32767L; + private static final int MAC_OS_X_VERSION_10_11_4 = (int)101104L; /** * {@snippet lang=c : - * #define INT_LEAST16_MAX 32767 + * #define MAC_OS_X_VERSION_10_11_4 101104 * } */ - public static int INT_LEAST16_MAX() { - return INT_LEAST16_MAX; + public static int MAC_OS_X_VERSION_10_11_4() { + return MAC_OS_X_VERSION_10_11_4; } - private static final int INT_LEAST32_MAX = (int)2147483647L; + private static final int MAC_OS_X_VERSION_10_12 = (int)101200L; /** * {@snippet lang=c : - * #define INT_LEAST32_MAX 2147483647 + * #define MAC_OS_X_VERSION_10_12 101200 * } */ - public static int INT_LEAST32_MAX() { - return INT_LEAST32_MAX; + public static int MAC_OS_X_VERSION_10_12() { + return MAC_OS_X_VERSION_10_12; } - private static final long INT_LEAST64_MAX = 9223372036854775807L; + private static final int MAC_OS_X_VERSION_10_12_1 = (int)101201L; /** * {@snippet lang=c : - * #define INT_LEAST64_MAX 9223372036854775807 + * #define MAC_OS_X_VERSION_10_12_1 101201 * } */ - public static long INT_LEAST64_MAX() { - return INT_LEAST64_MAX; + public static int MAC_OS_X_VERSION_10_12_1() { + return MAC_OS_X_VERSION_10_12_1; } - private static final int UINT_LEAST8_MAX = (int)255L; + private static final int MAC_OS_X_VERSION_10_12_2 = (int)101202L; /** * {@snippet lang=c : - * #define UINT_LEAST8_MAX 255 + * #define MAC_OS_X_VERSION_10_12_2 101202 * } */ - public static int UINT_LEAST8_MAX() { - return UINT_LEAST8_MAX; + public static int MAC_OS_X_VERSION_10_12_2() { + return MAC_OS_X_VERSION_10_12_2; } - private static final int UINT_LEAST16_MAX = (int)65535L; + private static final int MAC_OS_X_VERSION_10_12_4 = (int)101204L; /** * {@snippet lang=c : - * #define UINT_LEAST16_MAX 65535 + * #define MAC_OS_X_VERSION_10_12_4 101204 * } */ - public static int UINT_LEAST16_MAX() { - return UINT_LEAST16_MAX; + public static int MAC_OS_X_VERSION_10_12_4() { + return MAC_OS_X_VERSION_10_12_4; } - private static final int UINT_LEAST32_MAX = (int)4294967295L; + private static final int MAC_OS_X_VERSION_10_13 = (int)101300L; /** * {@snippet lang=c : - * #define UINT_LEAST32_MAX 4294967295 + * #define MAC_OS_X_VERSION_10_13 101300 * } */ - public static int UINT_LEAST32_MAX() { - return UINT_LEAST32_MAX; + public static int MAC_OS_X_VERSION_10_13() { + return MAC_OS_X_VERSION_10_13; } - private static final long UINT_LEAST64_MAX = -1L; + private static final int MAC_OS_X_VERSION_10_13_1 = (int)101301L; /** * {@snippet lang=c : - * #define UINT_LEAST64_MAX -1 + * #define MAC_OS_X_VERSION_10_13_1 101301 * } */ - public static long UINT_LEAST64_MAX() { - return UINT_LEAST64_MAX; + public static int MAC_OS_X_VERSION_10_13_1() { + return MAC_OS_X_VERSION_10_13_1; } - private static final int INT_FAST8_MIN = (int)-128L; + private static final int MAC_OS_X_VERSION_10_13_2 = (int)101302L; /** * {@snippet lang=c : - * #define INT_FAST8_MIN -128 + * #define MAC_OS_X_VERSION_10_13_2 101302 * } */ - public static int INT_FAST8_MIN() { - return INT_FAST8_MIN; + public static int MAC_OS_X_VERSION_10_13_2() { + return MAC_OS_X_VERSION_10_13_2; } - private static final int INT_FAST16_MIN = (int)-32768L; + private static final int MAC_OS_X_VERSION_10_13_4 = (int)101304L; /** * {@snippet lang=c : - * #define INT_FAST16_MIN -32768 + * #define MAC_OS_X_VERSION_10_13_4 101304 * } */ - public static int INT_FAST16_MIN() { - return INT_FAST16_MIN; + public static int MAC_OS_X_VERSION_10_13_4() { + return MAC_OS_X_VERSION_10_13_4; } - private static final int INT_FAST32_MIN = (int)-2147483648L; + private static final int MAC_OS_X_VERSION_10_14 = (int)101400L; /** * {@snippet lang=c : - * #define INT_FAST32_MIN -2147483648 + * #define MAC_OS_X_VERSION_10_14 101400 * } */ - public static int INT_FAST32_MIN() { - return INT_FAST32_MIN; + public static int MAC_OS_X_VERSION_10_14() { + return MAC_OS_X_VERSION_10_14; } - private static final long INT_FAST64_MIN = -9223372036854775808L; + private static final int MAC_OS_X_VERSION_10_14_1 = (int)101401L; /** * {@snippet lang=c : - * #define INT_FAST64_MIN -9223372036854775808 + * #define MAC_OS_X_VERSION_10_14_1 101401 * } */ - public static long INT_FAST64_MIN() { - return INT_FAST64_MIN; + public static int MAC_OS_X_VERSION_10_14_1() { + return MAC_OS_X_VERSION_10_14_1; } - private static final int INT_FAST8_MAX = (int)127L; + private static final int MAC_OS_X_VERSION_10_14_4 = (int)101404L; /** * {@snippet lang=c : - * #define INT_FAST8_MAX 127 + * #define MAC_OS_X_VERSION_10_14_4 101404 * } */ - public static int INT_FAST8_MAX() { - return INT_FAST8_MAX; + public static int MAC_OS_X_VERSION_10_14_4() { + return MAC_OS_X_VERSION_10_14_4; } - private static final int INT_FAST16_MAX = (int)32767L; + private static final int MAC_OS_X_VERSION_10_14_5 = (int)101405L; /** * {@snippet lang=c : - * #define INT_FAST16_MAX 32767 + * #define MAC_OS_X_VERSION_10_14_5 101405 * } */ - public static int INT_FAST16_MAX() { - return INT_FAST16_MAX; + public static int MAC_OS_X_VERSION_10_14_5() { + return MAC_OS_X_VERSION_10_14_5; } - private static final int INT_FAST32_MAX = (int)2147483647L; + private static final int MAC_OS_X_VERSION_10_14_6 = (int)101406L; /** * {@snippet lang=c : - * #define INT_FAST32_MAX 2147483647 + * #define MAC_OS_X_VERSION_10_14_6 101406 * } */ - public static int INT_FAST32_MAX() { - return INT_FAST32_MAX; + public static int MAC_OS_X_VERSION_10_14_6() { + return MAC_OS_X_VERSION_10_14_6; } - private static final long INT_FAST64_MAX = 9223372036854775807L; + private static final int MAC_OS_X_VERSION_10_15 = (int)101500L; /** * {@snippet lang=c : - * #define INT_FAST64_MAX 9223372036854775807 + * #define MAC_OS_X_VERSION_10_15 101500 * } */ - public static long INT_FAST64_MAX() { - return INT_FAST64_MAX; + public static int MAC_OS_X_VERSION_10_15() { + return MAC_OS_X_VERSION_10_15; } - private static final int UINT_FAST8_MAX = (int)255L; + private static final int MAC_OS_X_VERSION_10_15_1 = (int)101501L; /** * {@snippet lang=c : - * #define UINT_FAST8_MAX 255 + * #define MAC_OS_X_VERSION_10_15_1 101501 * } */ - public static int UINT_FAST8_MAX() { - return UINT_FAST8_MAX; + public static int MAC_OS_X_VERSION_10_15_1() { + return MAC_OS_X_VERSION_10_15_1; } - private static final int UINT_FAST16_MAX = (int)65535L; + private static final int MAC_OS_X_VERSION_10_15_4 = (int)101504L; /** * {@snippet lang=c : - * #define UINT_FAST16_MAX 65535 + * #define MAC_OS_X_VERSION_10_15_4 101504 * } */ - public static int UINT_FAST16_MAX() { - return UINT_FAST16_MAX; + public static int MAC_OS_X_VERSION_10_15_4() { + return MAC_OS_X_VERSION_10_15_4; } - private static final int UINT_FAST32_MAX = (int)4294967295L; + private static final int MAC_OS_X_VERSION_10_16 = (int)101600L; /** * {@snippet lang=c : - * #define UINT_FAST32_MAX 4294967295 + * #define MAC_OS_X_VERSION_10_16 101600 * } */ - public static int UINT_FAST32_MAX() { - return UINT_FAST32_MAX; + public static int MAC_OS_X_VERSION_10_16() { + return MAC_OS_X_VERSION_10_16; } - private static final long UINT_FAST64_MAX = -1L; + private static final int MAC_OS_VERSION_11_0 = (int)110000L; /** * {@snippet lang=c : - * #define UINT_FAST64_MAX -1 + * #define MAC_OS_VERSION_11_0 110000 * } */ - public static long UINT_FAST64_MAX() { - return UINT_FAST64_MAX; + public static int MAC_OS_VERSION_11_0() { + return MAC_OS_VERSION_11_0; } - private static final long INTPTR_MAX = 9223372036854775807L; + private static final int MAC_OS_VERSION_11_1 = (int)110100L; /** * {@snippet lang=c : - * #define INTPTR_MAX 9223372036854775807 + * #define MAC_OS_VERSION_11_1 110100 * } */ - public static long INTPTR_MAX() { - return INTPTR_MAX; + public static int MAC_OS_VERSION_11_1() { + return MAC_OS_VERSION_11_1; } - private static final long INTPTR_MIN = -9223372036854775808L; + private static final int MAC_OS_VERSION_11_3 = (int)110300L; /** * {@snippet lang=c : - * #define INTPTR_MIN -9223372036854775808 + * #define MAC_OS_VERSION_11_3 110300 * } */ - public static long INTPTR_MIN() { - return INTPTR_MIN; + public static int MAC_OS_VERSION_11_3() { + return MAC_OS_VERSION_11_3; } - private static final long UINTPTR_MAX = -1L; + private static final int MAC_OS_VERSION_11_4 = (int)110400L; /** * {@snippet lang=c : - * #define UINTPTR_MAX -1 + * #define MAC_OS_VERSION_11_4 110400 * } */ - public static long UINTPTR_MAX() { - return UINTPTR_MAX; + public static int MAC_OS_VERSION_11_4() { + return MAC_OS_VERSION_11_4; } - private static final long INTMAX_MAX = 9223372036854775807L; + private static final int MAC_OS_VERSION_11_5 = (int)110500L; /** * {@snippet lang=c : - * #define INTMAX_MAX 9223372036854775807 + * #define MAC_OS_VERSION_11_5 110500 * } */ - public static long INTMAX_MAX() { - return INTMAX_MAX; + public static int MAC_OS_VERSION_11_5() { + return MAC_OS_VERSION_11_5; } - private static final long UINTMAX_MAX = -1L; + private static final int MAC_OS_VERSION_11_6 = (int)110600L; /** * {@snippet lang=c : - * #define UINTMAX_MAX -1 + * #define MAC_OS_VERSION_11_6 110600 * } */ - public static long UINTMAX_MAX() { - return UINTMAX_MAX; + public static int MAC_OS_VERSION_11_6() { + return MAC_OS_VERSION_11_6; } - private static final long INTMAX_MIN = -9223372036854775808L; + private static final int MAC_OS_VERSION_12_0 = (int)120000L; /** * {@snippet lang=c : - * #define INTMAX_MIN -9223372036854775808 + * #define MAC_OS_VERSION_12_0 120000 * } */ - public static long INTMAX_MIN() { - return INTMAX_MIN; + public static int MAC_OS_VERSION_12_0() { + return MAC_OS_VERSION_12_0; } - private static final long PTRDIFF_MIN = -9223372036854775808L; + private static final int MAC_OS_VERSION_12_1 = (int)120100L; /** * {@snippet lang=c : - * #define PTRDIFF_MIN -9223372036854775808 + * #define MAC_OS_VERSION_12_1 120100 * } */ - public static long PTRDIFF_MIN() { - return PTRDIFF_MIN; + public static int MAC_OS_VERSION_12_1() { + return MAC_OS_VERSION_12_1; } - private static final long PTRDIFF_MAX = 9223372036854775807L; + private static final int MAC_OS_VERSION_12_2 = (int)120200L; /** * {@snippet lang=c : - * #define PTRDIFF_MAX 9223372036854775807 + * #define MAC_OS_VERSION_12_2 120200 * } */ - public static long PTRDIFF_MAX() { - return PTRDIFF_MAX; + public static int MAC_OS_VERSION_12_2() { + return MAC_OS_VERSION_12_2; } - private static final long SIZE_MAX = -1L; + private static final int MAC_OS_VERSION_12_3 = (int)120300L; /** * {@snippet lang=c : - * #define SIZE_MAX -1 + * #define MAC_OS_VERSION_12_3 120300 * } */ - public static long SIZE_MAX() { - return SIZE_MAX; + public static int MAC_OS_VERSION_12_3() { + return MAC_OS_VERSION_12_3; } - private static final long RSIZE_MAX = 9223372036854775807L; + private static final int MAC_OS_VERSION_12_4 = (int)120400L; /** * {@snippet lang=c : - * #define RSIZE_MAX 9223372036854775807 + * #define MAC_OS_VERSION_12_4 120400 * } */ - public static long RSIZE_MAX() { - return RSIZE_MAX; + public static int MAC_OS_VERSION_12_4() { + return MAC_OS_VERSION_12_4; } - private static final int WCHAR_MAX = (int)2147483647L; + private static final int MAC_OS_VERSION_12_5 = (int)120500L; /** * {@snippet lang=c : - * #define WCHAR_MAX 2147483647 + * #define MAC_OS_VERSION_12_5 120500 * } */ - public static int WCHAR_MAX() { - return WCHAR_MAX; + public static int MAC_OS_VERSION_12_5() { + return MAC_OS_VERSION_12_5; } - private static final int WCHAR_MIN = (int)-2147483648L; + private static final int MAC_OS_VERSION_12_6 = (int)120600L; /** * {@snippet lang=c : - * #define WCHAR_MIN -2147483648 + * #define MAC_OS_VERSION_12_6 120600 * } */ - public static int WCHAR_MIN() { - return WCHAR_MIN; + public static int MAC_OS_VERSION_12_6() { + return MAC_OS_VERSION_12_6; } - private static final int WINT_MIN = (int)-2147483648L; + private static final int MAC_OS_VERSION_12_7 = (int)120700L; /** * {@snippet lang=c : - * #define WINT_MIN -2147483648 + * #define MAC_OS_VERSION_12_7 120700 * } */ - public static int WINT_MIN() { - return WINT_MIN; + public static int MAC_OS_VERSION_12_7() { + return MAC_OS_VERSION_12_7; } - private static final int WINT_MAX = (int)2147483647L; + private static final int MAC_OS_VERSION_13_0 = (int)130000L; /** * {@snippet lang=c : - * #define WINT_MAX 2147483647 + * #define MAC_OS_VERSION_13_0 130000 * } */ - public static int WINT_MAX() { - return WINT_MAX; + public static int MAC_OS_VERSION_13_0() { + return MAC_OS_VERSION_13_0; } - private static final int SIG_ATOMIC_MIN = (int)-2147483648L; + private static final int MAC_OS_VERSION_13_1 = (int)130100L; /** * {@snippet lang=c : - * #define SIG_ATOMIC_MIN -2147483648 + * #define MAC_OS_VERSION_13_1 130100 * } */ - public static int SIG_ATOMIC_MIN() { - return SIG_ATOMIC_MIN; + public static int MAC_OS_VERSION_13_1() { + return MAC_OS_VERSION_13_1; } - private static final int SIG_ATOMIC_MAX = (int)2147483647L; + private static final int MAC_OS_VERSION_13_2 = (int)130200L; /** * {@snippet lang=c : - * #define SIG_ATOMIC_MAX 2147483647 + * #define MAC_OS_VERSION_13_2 130200 * } */ - public static int SIG_ATOMIC_MAX() { - return SIG_ATOMIC_MAX; + public static int MAC_OS_VERSION_13_2() { + return MAC_OS_VERSION_13_2; } - private static final int MAC_OS_X_VERSION_10_0 = (int)1000L; + private static final int MAC_OS_VERSION_13_3 = (int)130300L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_0 1000 + * #define MAC_OS_VERSION_13_3 130300 * } */ - public static int MAC_OS_X_VERSION_10_0() { - return MAC_OS_X_VERSION_10_0; + public static int MAC_OS_VERSION_13_3() { + return MAC_OS_VERSION_13_3; } - private static final int MAC_OS_X_VERSION_10_1 = (int)1010L; + private static final int MAC_OS_VERSION_13_4 = (int)130400L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_1 1010 + * #define MAC_OS_VERSION_13_4 130400 * } */ - public static int MAC_OS_X_VERSION_10_1() { - return MAC_OS_X_VERSION_10_1; + public static int MAC_OS_VERSION_13_4() { + return MAC_OS_VERSION_13_4; } - private static final int MAC_OS_X_VERSION_10_2 = (int)1020L; + private static final int MAC_OS_VERSION_13_5 = (int)130500L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_2 1020 + * #define MAC_OS_VERSION_13_5 130500 * } */ - public static int MAC_OS_X_VERSION_10_2() { - return MAC_OS_X_VERSION_10_2; + public static int MAC_OS_VERSION_13_5() { + return MAC_OS_VERSION_13_5; } - private static final int MAC_OS_X_VERSION_10_3 = (int)1030L; + private static final int MAC_OS_VERSION_13_6 = (int)130600L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_3 1030 + * #define MAC_OS_VERSION_13_6 130600 * } */ - public static int MAC_OS_X_VERSION_10_3() { - return MAC_OS_X_VERSION_10_3; + public static int MAC_OS_VERSION_13_6() { + return MAC_OS_VERSION_13_6; } - private static final int MAC_OS_X_VERSION_10_4 = (int)1040L; + private static final int MAC_OS_VERSION_14_0 = (int)140000L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_4 1040 + * #define MAC_OS_VERSION_14_0 140000 * } */ - public static int MAC_OS_X_VERSION_10_4() { - return MAC_OS_X_VERSION_10_4; + public static int MAC_OS_VERSION_14_0() { + return MAC_OS_VERSION_14_0; } - private static final int MAC_OS_X_VERSION_10_5 = (int)1050L; + private static final int MAC_OS_VERSION_14_1 = (int)140100L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_5 1050 + * #define MAC_OS_VERSION_14_1 140100 * } */ - public static int MAC_OS_X_VERSION_10_5() { - return MAC_OS_X_VERSION_10_5; + public static int MAC_OS_VERSION_14_1() { + return MAC_OS_VERSION_14_1; } - private static final int MAC_OS_X_VERSION_10_6 = (int)1060L; + private static final int MAC_OS_VERSION_14_2 = (int)140200L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_6 1060 + * #define MAC_OS_VERSION_14_2 140200 * } */ - public static int MAC_OS_X_VERSION_10_6() { - return MAC_OS_X_VERSION_10_6; + public static int MAC_OS_VERSION_14_2() { + return MAC_OS_VERSION_14_2; } - private static final int MAC_OS_X_VERSION_10_7 = (int)1070L; + private static final int MAC_OS_VERSION_14_3 = (int)140300L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_7 1070 + * #define MAC_OS_VERSION_14_3 140300 * } */ - public static int MAC_OS_X_VERSION_10_7() { - return MAC_OS_X_VERSION_10_7; + public static int MAC_OS_VERSION_14_3() { + return MAC_OS_VERSION_14_3; } - private static final int MAC_OS_X_VERSION_10_8 = (int)1080L; + private static final int MAC_OS_VERSION_14_4 = (int)140400L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_8 1080 + * #define MAC_OS_VERSION_14_4 140400 * } */ - public static int MAC_OS_X_VERSION_10_8() { - return MAC_OS_X_VERSION_10_8; + public static int MAC_OS_VERSION_14_4() { + return MAC_OS_VERSION_14_4; } - private static final int MAC_OS_X_VERSION_10_9 = (int)1090L; + private static final int MAC_OS_VERSION_14_5 = (int)140500L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_9 1090 + * #define MAC_OS_VERSION_14_5 140500 * } */ - public static int MAC_OS_X_VERSION_10_9() { - return MAC_OS_X_VERSION_10_9; + public static int MAC_OS_VERSION_14_5() { + return MAC_OS_VERSION_14_5; } - private static final int MAC_OS_X_VERSION_10_10 = (int)101000L; + private static final int __MAC_OS_X_VERSION_MAX_ALLOWED = (int)140500L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_10 101000 + * #define __MAC_OS_X_VERSION_MAX_ALLOWED 140500 * } */ - public static int MAC_OS_X_VERSION_10_10() { - return MAC_OS_X_VERSION_10_10; + public static int __MAC_OS_X_VERSION_MAX_ALLOWED() { + return __MAC_OS_X_VERSION_MAX_ALLOWED; } - private static final int MAC_OS_X_VERSION_10_10_2 = (int)101002L; + private static final MemorySegment __DARWIN_NULL = MemorySegment.ofAddress(0L); /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_10_2 101002 + * #define __DARWIN_NULL (void*) 0 * } */ - public static int MAC_OS_X_VERSION_10_10_2() { - return MAC_OS_X_VERSION_10_10_2; + public static MemorySegment __DARWIN_NULL() { + return __DARWIN_NULL; } - private static final int MAC_OS_X_VERSION_10_10_3 = (int)101003L; + private static final int __DARWIN_WCHAR_MAX = (int)2147483647L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_10_3 101003 + * #define __DARWIN_WCHAR_MAX 2147483647 * } */ - public static int MAC_OS_X_VERSION_10_10_3() { - return MAC_OS_X_VERSION_10_10_3; + public static int __DARWIN_WCHAR_MAX() { + return __DARWIN_WCHAR_MAX; } - private static final int MAC_OS_X_VERSION_10_11 = (int)101100L; + private static final int __DARWIN_WCHAR_MIN = (int)-2147483648L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_11 101100 + * #define __DARWIN_WCHAR_MIN -2147483648 * } */ - public static int MAC_OS_X_VERSION_10_11() { - return MAC_OS_X_VERSION_10_11; + public static int __DARWIN_WCHAR_MIN() { + return __DARWIN_WCHAR_MIN; } - private static final int MAC_OS_X_VERSION_10_11_2 = (int)101102L; + private static final int __DARWIN_WEOF = (int)-1L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_11_2 101102 + * #define __DARWIN_WEOF -1 * } */ - public static int MAC_OS_X_VERSION_10_11_2() { - return MAC_OS_X_VERSION_10_11_2; + public static int __DARWIN_WEOF() { + return __DARWIN_WEOF; } - private static final int MAC_OS_X_VERSION_10_11_3 = (int)101103L; + private static final long USER_ADDR_NULL = 0L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_11_3 101103 + * #define USER_ADDR_NULL 0 * } */ - public static int MAC_OS_X_VERSION_10_11_3() { - return MAC_OS_X_VERSION_10_11_3; + public static long USER_ADDR_NULL() { + return USER_ADDR_NULL; } - private static final int MAC_OS_X_VERSION_10_11_4 = (int)101104L; + private static final MemorySegment NULL = MemorySegment.ofAddress(0L); /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_11_4 101104 + * #define NULL (void*) 0 * } */ - public static int MAC_OS_X_VERSION_10_11_4() { - return MAC_OS_X_VERSION_10_11_4; + public static MemorySegment NULL() { + return NULL; } - private static final int MAC_OS_X_VERSION_10_12 = (int)101200L; + private static final int EOF = (int)-1L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_12 101200 + * #define EOF -1 * } */ - public static int MAC_OS_X_VERSION_10_12() { - return MAC_OS_X_VERSION_10_12; + public static int EOF() { + return EOF; } - private static final int MAC_OS_X_VERSION_10_12_1 = (int)101201L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_12_1 101201 + * #define P_tmpdir "/var/tmp/" * } */ - public static int MAC_OS_X_VERSION_10_12_1() { - return MAC_OS_X_VERSION_10_12_1; + public static MemorySegment P_tmpdir() { + class Holder { + static final MemorySegment P_tmpdir + = somelib_h.LIBRARY_ARENA.allocateFrom("/var/tmp/"); + } + return Holder.P_tmpdir; } - private static final int MAC_OS_X_VERSION_10_12_2 = (int)101202L; + private static final long INT64_MAX = 9223372036854775807L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_12_2 101202 + * #define INT64_MAX 9223372036854775807 * } */ - public static int MAC_OS_X_VERSION_10_12_2() { - return MAC_OS_X_VERSION_10_12_2; + public static long INT64_MAX() { + return INT64_MAX; } - private static final int MAC_OS_X_VERSION_10_12_4 = (int)101204L; + private static final int INT8_MIN = (int)-128L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_12_4 101204 + * #define INT8_MIN -128 * } */ - public static int MAC_OS_X_VERSION_10_12_4() { - return MAC_OS_X_VERSION_10_12_4; + public static int INT8_MIN() { + return INT8_MIN; } - private static final int MAC_OS_X_VERSION_10_13 = (int)101300L; + private static final int INT16_MIN = (int)-32768L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_13 101300 + * #define INT16_MIN -32768 * } */ - public static int MAC_OS_X_VERSION_10_13() { - return MAC_OS_X_VERSION_10_13; + public static int INT16_MIN() { + return INT16_MIN; } - private static final int MAC_OS_X_VERSION_10_13_1 = (int)101301L; + private static final int INT32_MIN = (int)-2147483648L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_13_1 101301 + * #define INT32_MIN -2147483648 * } */ - public static int MAC_OS_X_VERSION_10_13_1() { - return MAC_OS_X_VERSION_10_13_1; + public static int INT32_MIN() { + return INT32_MIN; } - private static final int MAC_OS_X_VERSION_10_13_2 = (int)101302L; + private static final long INT64_MIN = -9223372036854775808L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_13_2 101302 + * #define INT64_MIN -9223372036854775808 * } */ - public static int MAC_OS_X_VERSION_10_13_2() { - return MAC_OS_X_VERSION_10_13_2; + public static long INT64_MIN() { + return INT64_MIN; } - private static final int MAC_OS_X_VERSION_10_13_4 = (int)101304L; + private static final int UINT32_MAX = (int)4294967295L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_13_4 101304 + * #define UINT32_MAX 4294967295 * } */ - public static int MAC_OS_X_VERSION_10_13_4() { - return MAC_OS_X_VERSION_10_13_4; + public static int UINT32_MAX() { + return UINT32_MAX; } - private static final int MAC_OS_X_VERSION_10_14 = (int)101400L; + private static final long UINT64_MAX = -1L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_14 101400 + * #define UINT64_MAX -1 * } */ - public static int MAC_OS_X_VERSION_10_14() { - return MAC_OS_X_VERSION_10_14; + public static long UINT64_MAX() { + return UINT64_MAX; } - private static final int MAC_OS_X_VERSION_10_14_1 = (int)101401L; + private static final int INT_LEAST8_MIN = (int)-128L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_14_1 101401 + * #define INT_LEAST8_MIN -128 * } */ - public static int MAC_OS_X_VERSION_10_14_1() { - return MAC_OS_X_VERSION_10_14_1; + public static int INT_LEAST8_MIN() { + return INT_LEAST8_MIN; } - private static final int MAC_OS_X_VERSION_10_14_4 = (int)101404L; + private static final int INT_LEAST16_MIN = (int)-32768L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_14_4 101404 + * #define INT_LEAST16_MIN -32768 * } */ - public static int MAC_OS_X_VERSION_10_14_4() { - return MAC_OS_X_VERSION_10_14_4; + public static int INT_LEAST16_MIN() { + return INT_LEAST16_MIN; } - private static final int MAC_OS_X_VERSION_10_14_5 = (int)101405L; + private static final int INT_LEAST32_MIN = (int)-2147483648L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_14_5 101405 + * #define INT_LEAST32_MIN -2147483648 * } */ - public static int MAC_OS_X_VERSION_10_14_5() { - return MAC_OS_X_VERSION_10_14_5; + public static int INT_LEAST32_MIN() { + return INT_LEAST32_MIN; } - private static final int MAC_OS_X_VERSION_10_14_6 = (int)101406L; + private static final long INT_LEAST64_MIN = -9223372036854775808L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_14_6 101406 + * #define INT_LEAST64_MIN -9223372036854775808 * } */ - public static int MAC_OS_X_VERSION_10_14_6() { - return MAC_OS_X_VERSION_10_14_6; + public static long INT_LEAST64_MIN() { + return INT_LEAST64_MIN; } - private static final int MAC_OS_X_VERSION_10_15 = (int)101500L; + private static final int INT_LEAST8_MAX = (int)127L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_15 101500 + * #define INT_LEAST8_MAX 127 * } */ - public static int MAC_OS_X_VERSION_10_15() { - return MAC_OS_X_VERSION_10_15; + public static int INT_LEAST8_MAX() { + return INT_LEAST8_MAX; } - private static final int MAC_OS_X_VERSION_10_15_1 = (int)101501L; + private static final int INT_LEAST16_MAX = (int)32767L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_15_1 101501 + * #define INT_LEAST16_MAX 32767 * } */ - public static int MAC_OS_X_VERSION_10_15_1() { - return MAC_OS_X_VERSION_10_15_1; + public static int INT_LEAST16_MAX() { + return INT_LEAST16_MAX; } - private static final int MAC_OS_X_VERSION_10_15_4 = (int)101504L; + private static final int INT_LEAST32_MAX = (int)2147483647L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_15_4 101504 + * #define INT_LEAST32_MAX 2147483647 * } */ - public static int MAC_OS_X_VERSION_10_15_4() { - return MAC_OS_X_VERSION_10_15_4; + public static int INT_LEAST32_MAX() { + return INT_LEAST32_MAX; } - private static final int MAC_OS_X_VERSION_10_16 = (int)101600L; + private static final long INT_LEAST64_MAX = 9223372036854775807L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_16 101600 + * #define INT_LEAST64_MAX 9223372036854775807 * } */ - public static int MAC_OS_X_VERSION_10_16() { - return MAC_OS_X_VERSION_10_16; + public static long INT_LEAST64_MAX() { + return INT_LEAST64_MAX; } - private static final int MAC_OS_VERSION_11_0 = (int)110000L; + private static final int UINT_LEAST8_MAX = (int)255L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_11_0 110000 + * #define UINT_LEAST8_MAX 255 * } */ - public static int MAC_OS_VERSION_11_0() { - return MAC_OS_VERSION_11_0; + public static int UINT_LEAST8_MAX() { + return UINT_LEAST8_MAX; } - private static final int MAC_OS_VERSION_11_1 = (int)110100L; + private static final int UINT_LEAST16_MAX = (int)65535L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_11_1 110100 + * #define UINT_LEAST16_MAX 65535 * } */ - public static int MAC_OS_VERSION_11_1() { - return MAC_OS_VERSION_11_1; + public static int UINT_LEAST16_MAX() { + return UINT_LEAST16_MAX; } - private static final int MAC_OS_VERSION_11_3 = (int)110300L; + private static final int UINT_LEAST32_MAX = (int)4294967295L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_11_3 110300 + * #define UINT_LEAST32_MAX 4294967295 * } */ - public static int MAC_OS_VERSION_11_3() { - return MAC_OS_VERSION_11_3; + public static int UINT_LEAST32_MAX() { + return UINT_LEAST32_MAX; } - private static final int MAC_OS_VERSION_11_4 = (int)110400L; + private static final long UINT_LEAST64_MAX = -1L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_11_4 110400 + * #define UINT_LEAST64_MAX -1 * } */ - public static int MAC_OS_VERSION_11_4() { - return MAC_OS_VERSION_11_4; + public static long UINT_LEAST64_MAX() { + return UINT_LEAST64_MAX; } - private static final int MAC_OS_VERSION_11_5 = (int)110500L; + private static final int INT_FAST8_MIN = (int)-128L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_11_5 110500 + * #define INT_FAST8_MIN -128 * } */ - public static int MAC_OS_VERSION_11_5() { - return MAC_OS_VERSION_11_5; + public static int INT_FAST8_MIN() { + return INT_FAST8_MIN; } - private static final int MAC_OS_VERSION_11_6 = (int)110600L; + private static final int INT_FAST16_MIN = (int)-32768L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_11_6 110600 + * #define INT_FAST16_MIN -32768 * } */ - public static int MAC_OS_VERSION_11_6() { - return MAC_OS_VERSION_11_6; + public static int INT_FAST16_MIN() { + return INT_FAST16_MIN; } - private static final int MAC_OS_VERSION_12_0 = (int)120000L; + private static final int INT_FAST32_MIN = (int)-2147483648L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_12_0 120000 + * #define INT_FAST32_MIN -2147483648 * } */ - public static int MAC_OS_VERSION_12_0() { - return MAC_OS_VERSION_12_0; + public static int INT_FAST32_MIN() { + return INT_FAST32_MIN; } - private static final int MAC_OS_VERSION_12_1 = (int)120100L; + private static final long INT_FAST64_MIN = -9223372036854775808L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_12_1 120100 + * #define INT_FAST64_MIN -9223372036854775808 * } */ - public static int MAC_OS_VERSION_12_1() { - return MAC_OS_VERSION_12_1; + public static long INT_FAST64_MIN() { + return INT_FAST64_MIN; } - private static final int MAC_OS_VERSION_12_2 = (int)120200L; + private static final int INT_FAST8_MAX = (int)127L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_12_2 120200 + * #define INT_FAST8_MAX 127 * } */ - public static int MAC_OS_VERSION_12_2() { - return MAC_OS_VERSION_12_2; + public static int INT_FAST8_MAX() { + return INT_FAST8_MAX; } - private static final int MAC_OS_VERSION_12_3 = (int)120300L; + private static final int INT_FAST16_MAX = (int)32767L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_12_3 120300 + * #define INT_FAST16_MAX 32767 * } */ - public static int MAC_OS_VERSION_12_3() { - return MAC_OS_VERSION_12_3; + public static int INT_FAST16_MAX() { + return INT_FAST16_MAX; } - private static final int MAC_OS_VERSION_12_4 = (int)120400L; + private static final int INT_FAST32_MAX = (int)2147483647L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_12_4 120400 + * #define INT_FAST32_MAX 2147483647 * } */ - public static int MAC_OS_VERSION_12_4() { - return MAC_OS_VERSION_12_4; + public static int INT_FAST32_MAX() { + return INT_FAST32_MAX; } - private static final int MAC_OS_VERSION_12_5 = (int)120500L; + private static final long INT_FAST64_MAX = 9223372036854775807L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_12_5 120500 + * #define INT_FAST64_MAX 9223372036854775807 * } */ - public static int MAC_OS_VERSION_12_5() { - return MAC_OS_VERSION_12_5; + public static long INT_FAST64_MAX() { + return INT_FAST64_MAX; } - private static final int MAC_OS_VERSION_12_6 = (int)120600L; + private static final int UINT_FAST8_MAX = (int)255L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_12_6 120600 + * #define UINT_FAST8_MAX 255 * } */ - public static int MAC_OS_VERSION_12_6() { - return MAC_OS_VERSION_12_6; + public static int UINT_FAST8_MAX() { + return UINT_FAST8_MAX; } - private static final int MAC_OS_VERSION_12_7 = (int)120700L; + private static final int UINT_FAST16_MAX = (int)65535L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_12_7 120700 + * #define UINT_FAST16_MAX 65535 * } */ - public static int MAC_OS_VERSION_12_7() { - return MAC_OS_VERSION_12_7; + public static int UINT_FAST16_MAX() { + return UINT_FAST16_MAX; } - private static final int MAC_OS_VERSION_13_0 = (int)130000L; + private static final int UINT_FAST32_MAX = (int)4294967295L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_13_0 130000 + * #define UINT_FAST32_MAX 4294967295 * } */ - public static int MAC_OS_VERSION_13_0() { - return MAC_OS_VERSION_13_0; + public static int UINT_FAST32_MAX() { + return UINT_FAST32_MAX; } - private static final int MAC_OS_VERSION_13_1 = (int)130100L; + private static final long UINT_FAST64_MAX = -1L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_13_1 130100 + * #define UINT_FAST64_MAX -1 * } */ - public static int MAC_OS_VERSION_13_1() { - return MAC_OS_VERSION_13_1; + public static long UINT_FAST64_MAX() { + return UINT_FAST64_MAX; } - private static final int MAC_OS_VERSION_13_2 = (int)130200L; + private static final long INTPTR_MAX = 9223372036854775807L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_13_2 130200 + * #define INTPTR_MAX 9223372036854775807 * } */ - public static int MAC_OS_VERSION_13_2() { - return MAC_OS_VERSION_13_2; + public static long INTPTR_MAX() { + return INTPTR_MAX; } - private static final int MAC_OS_VERSION_13_3 = (int)130300L; + private static final long INTPTR_MIN = -9223372036854775808L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_13_3 130300 + * #define INTPTR_MIN -9223372036854775808 * } */ - public static int MAC_OS_VERSION_13_3() { - return MAC_OS_VERSION_13_3; + public static long INTPTR_MIN() { + return INTPTR_MIN; } - private static final int MAC_OS_VERSION_13_4 = (int)130400L; + private static final long UINTPTR_MAX = -1L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_13_4 130400 + * #define UINTPTR_MAX -1 * } */ - public static int MAC_OS_VERSION_13_4() { - return MAC_OS_VERSION_13_4; + public static long UINTPTR_MAX() { + return UINTPTR_MAX; } - private static final int MAC_OS_VERSION_13_5 = (int)130500L; + private static final long INTMAX_MAX = 9223372036854775807L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_13_5 130500 + * #define INTMAX_MAX 9223372036854775807 * } */ - public static int MAC_OS_VERSION_13_5() { - return MAC_OS_VERSION_13_5; + public static long INTMAX_MAX() { + return INTMAX_MAX; } - private static final int MAC_OS_VERSION_13_6 = (int)130600L; + private static final long UINTMAX_MAX = -1L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_13_6 130600 + * #define UINTMAX_MAX -1 * } */ - public static int MAC_OS_VERSION_13_6() { - return MAC_OS_VERSION_13_6; + public static long UINTMAX_MAX() { + return UINTMAX_MAX; } - private static final int MAC_OS_VERSION_14_0 = (int)140000L; + private static final long INTMAX_MIN = -9223372036854775808L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_14_0 140000 + * #define INTMAX_MIN -9223372036854775808 * } */ - public static int MAC_OS_VERSION_14_0() { - return MAC_OS_VERSION_14_0; + public static long INTMAX_MIN() { + return INTMAX_MIN; } - private static final int MAC_OS_VERSION_14_1 = (int)140100L; + private static final long PTRDIFF_MIN = -9223372036854775808L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_14_1 140100 + * #define PTRDIFF_MIN -9223372036854775808 * } */ - public static int MAC_OS_VERSION_14_1() { - return MAC_OS_VERSION_14_1; + public static long PTRDIFF_MIN() { + return PTRDIFF_MIN; } - private static final int MAC_OS_VERSION_14_2 = (int)140200L; + private static final long PTRDIFF_MAX = 9223372036854775807L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_14_2 140200 + * #define PTRDIFF_MAX 9223372036854775807 * } */ - public static int MAC_OS_VERSION_14_2() { - return MAC_OS_VERSION_14_2; + public static long PTRDIFF_MAX() { + return PTRDIFF_MAX; } - private static final int MAC_OS_VERSION_14_3 = (int)140300L; + private static final long SIZE_MAX = -1L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_14_3 140300 + * #define SIZE_MAX -1 * } */ - public static int MAC_OS_VERSION_14_3() { - return MAC_OS_VERSION_14_3; + public static long SIZE_MAX() { + return SIZE_MAX; } - private static final int MAC_OS_VERSION_14_4 = (int)140400L; + private static final long RSIZE_MAX = 9223372036854775807L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_14_4 140400 + * #define RSIZE_MAX 9223372036854775807 * } */ - public static int MAC_OS_VERSION_14_4() { - return MAC_OS_VERSION_14_4; + public static long RSIZE_MAX() { + return RSIZE_MAX; } - private static final int MAC_OS_VERSION_14_5 = (int)140500L; + private static final int WCHAR_MAX = (int)2147483647L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_14_5 140500 + * #define WCHAR_MAX 2147483647 * } */ - public static int MAC_OS_VERSION_14_5() { - return MAC_OS_VERSION_14_5; + public static int WCHAR_MAX() { + return WCHAR_MAX; } - private static final int __MAC_OS_X_VERSION_MAX_ALLOWED = (int)140500L; + private static final int WCHAR_MIN = (int)-2147483648L; /** * {@snippet lang=c : - * #define __MAC_OS_X_VERSION_MAX_ALLOWED 140500 + * #define WCHAR_MIN -2147483648 * } */ - public static int __MAC_OS_X_VERSION_MAX_ALLOWED() { - return __MAC_OS_X_VERSION_MAX_ALLOWED; + public static int WCHAR_MIN() { + return WCHAR_MIN; } - private static final int __DARWIN_WCHAR_MAX = (int)2147483647L; + private static final int WINT_MIN = (int)-2147483648L; /** * {@snippet lang=c : - * #define __DARWIN_WCHAR_MAX 2147483647 + * #define WINT_MIN -2147483648 * } */ - public static int __DARWIN_WCHAR_MAX() { - return __DARWIN_WCHAR_MAX; + public static int WINT_MIN() { + return WINT_MIN; } - private static final int __DARWIN_WCHAR_MIN = (int)-2147483648L; + private static final int WINT_MAX = (int)2147483647L; /** * {@snippet lang=c : - * #define __DARWIN_WCHAR_MIN -2147483648 + * #define WINT_MAX 2147483647 * } */ - public static int __DARWIN_WCHAR_MIN() { - return __DARWIN_WCHAR_MIN; + public static int WINT_MAX() { + return WINT_MAX; } - private static final int __DARWIN_WEOF = (int)-1L; + private static final int SIG_ATOMIC_MIN = (int)-2147483648L; /** * {@snippet lang=c : - * #define __DARWIN_WEOF -1 + * #define SIG_ATOMIC_MIN -2147483648 * } */ - public static int __DARWIN_WEOF() { - return __DARWIN_WEOF; + public static int SIG_ATOMIC_MIN() { + return SIG_ATOMIC_MIN; } - private static final int EOF = (int)-1L; + private static final int SIG_ATOMIC_MAX = (int)2147483647L; /** * {@snippet lang=c : - * #define EOF -1 + * #define SIG_ATOMIC_MAX 2147483647 * } */ - public static int EOF() { - return EOF; + public static int SIG_ATOMIC_MAX() { + return SIG_ATOMIC_MAX; } /** * {@snippet lang=c : - * #define P_tmpdir "/var/tmp/" + * #define __ASSERT_FILE_NAME "jextract$11772684471921758602.h" * } */ - public static MemorySegment P_tmpdir() { + public static MemorySegment __ASSERT_FILE_NAME() { class Holder { - static final MemorySegment P_tmpdir - = somelib_h.LIBRARY_ARENA.allocateFrom("/var/tmp/"); + static final MemorySegment __ASSERT_FILE_NAME + = somelib_h.LIBRARY_ARENA.allocateFrom("jextract$11772684471921758602.h"); } - return Holder.P_tmpdir; + return Holder.__ASSERT_FILE_NAME; } } diff --git a/feature_tests/src/structs.rs b/feature_tests/src/structs.rs index 16b3411d0..e454eb719 100644 --- a/feature_tests/src/structs.rs +++ b/feature_tests/src/structs.rs @@ -198,6 +198,7 @@ pub mod ffi { Ok(()) } + #[diplomat::attr(java, disable)] pub fn fails_zst_result() -> Result<(), MyZst> { Err(MyZst {}) } diff --git a/tool/src/kotlin/snapshots/diplomat_tool__kotlin__test__opaque_gen.snap b/tool/src/kotlin/snapshots/diplomat_tool__kotlin__test__opaque_gen.snap index 5ec134359..6065357df 100644 --- a/tool/src/kotlin/snapshots/diplomat_tool__kotlin__test__opaque_gen.snap +++ b/tool/src/kotlin/snapshots/diplomat_tool__kotlin__test__opaque_gen.snap @@ -2,7 +2,78 @@ source: tool/src/kotlin/mod.rs expression: res --- -package dev.gigapixel.somelib; +package dev.diplomattest.somelib + +import com.sun.jna.Callback +import com.sun.jna.Library +import com.sun.jna.Native +import com.sun.jna.Pointer +import com.sun.jna.Structure + +internal interface OwndingStructLib: Library { +} + +internal class OwndingStructNative: Structure(), Structure.ByValue { + @JvmField + internal var a: OwnedStructNative = OwnedStructNative(); + @JvmField + internal var b: OwnedStructNative = OwnedStructNative(); + + // Define the fields of the struct + override fun getFieldOrder(): List { + return listOf("a", "b") + } +} + +class OwndingStruct internal constructor ( + internal val nativeStruct: OwndingStructNative) { + val a: OwnedStruct = OwnedStruct(nativeStruct.a) + val b: OwnedStruct = OwnedStruct(nativeStruct.b) + + companion object { + internal val libClass: Class = OwndingStructLib::class.java + internal val lib: OwndingStructLib = Native.load("somelib", libClass) + val NATIVESIZE: Long = Native.getNativeSize(OwndingStructNative::class.java).toLong() + } + +} + +======================= +package dev.diplomattest.somelib + +import com.sun.jna.Callback +import com.sun.jna.Library +import com.sun.jna.Native +import com.sun.jna.Pointer +import com.sun.jna.Structure + +internal interface OwnedStructLib: Library { +} + +internal class OwnedStructNative: Structure(), Structure.ByValue { + @JvmField + internal var int: Int = 0; + + // Define the fields of the struct + override fun getFieldOrder(): List { + return listOf("int") + } +} + +class OwnedStruct internal constructor ( + internal val nativeStruct: OwnedStructNative) { + val int: Int = nativeStruct.int + + companion object { + internal val libClass: Class = OwnedStructLib::class.java + internal val lib: OwnedStructLib = Native.load("somelib", libClass) + val NATIVESIZE: Long = Native.getNativeSize(OwnedStructNative::class.java).toLong() + } + +} + +======================= +package dev.diplomattest.somelib; import com.sun.jna.Callback import com.sun.jna.Library import com.sun.jna.Native @@ -38,9 +109,11 @@ class BorrowWrapper internal constructor ( ======================= package dev.diplomattest.somelib; +import com.sun.jna.Callback import com.sun.jna.Library import com.sun.jna.Native import com.sun.jna.Pointer +import com.sun.jna.Structure internal interface InputStructLib: Library { @@ -69,9 +142,11 @@ class InputStruct internal constructor ( ======================= package dev.diplomattest.somelib; +import com.sun.jna.Callback import com.sun.jna.Library import com.sun.jna.Native import com.sun.jna.Pointer +import com.sun.jna.Structure internal interface MyOpaqueStructLib: Library { From 04fdbbaae5923196890298ba75f7fa26e147e296 Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Sun, 1 Sep 2024 10:39:31 +0200 Subject: [PATCH 25/69] panama-backend - make ci actually test java and not kotlin --- Makefile.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.toml b/Makefile.toml index c2d8f77cb..7061d50f8 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -71,7 +71,7 @@ dependencies = [ [tasks.test-java] category = "Tests" dependencies = [ - "test-kotlin-feature", + "test-java-feature", ] [tasks.test-example] From 42898fe2ed0c175d248477ad7f6578ac750df453 Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Sun, 1 Sep 2024 10:43:16 +0200 Subject: [PATCH 26/69] panama-backend - remove static string from test --- tool/src/java/mod.rs | 4 ---- .../diplomat_tool__java__test__lifetimes.snap | 21 ------------------- 2 files changed, 25 deletions(-) diff --git a/tool/src/java/mod.rs b/tool/src/java/mod.rs index 38fdfcec0..8d8ba4ad5 100644 --- a/tool/src/java/mod.rs +++ b/tool/src/java/mod.rs @@ -1391,10 +1391,6 @@ mod test { Box::new(Bar(self)) } - pub fn new_static(x: &'static DiplomatStr) -> Box { - Box::new(Foo(x)) - } - pub fn as_returning(&self) -> BorrowedFieldsReturning<'a> { BorrowedFieldsReturning { bytes: self.0 } } diff --git a/tool/src/java/snapshots/diplomat_tool__java__test__lifetimes.snap b/tool/src/java/snapshots/diplomat_tool__java__test__lifetimes.snap index 563f145a3..805ad2a2e 100644 --- a/tool/src/java/snapshots/diplomat_tool__java__test__lifetimes.snap +++ b/tool/src/java/snapshots/diplomat_tool__java__test__lifetimes.snap @@ -254,27 +254,6 @@ public class Foo { } } - public static Foo newStatic(String x) { - - try (var arena = Arena.ofConfined()) { - var xData= arena.allocateFrom(x, StandardCharsets.UTF_8); - var xLen = xData.byteSize() - 1; - var xView = DiplomatStringView.allocate(arena); - DiplomatStringView.len(xView, xLen); - DiplomatStringView.data(xView, xData); - var nativeVal = somelib_h.Foo_new_static(xView); - List selfEdges = List.of(); - - - - List aEdges = List.of(); - var returnVal = new Foo(nativeVal, selfEdges, aEdges); - var cleaner = new Foo.FooCleaner(nativeVal); - returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); - return returnVal; - } - } - public static Foo extractFromFields(BorrowedFields fields) { var fieldsNative = fields.internal; From 3973f197eaa6abbfa7610934cc5123c58e7a4a4c Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Sun, 1 Sep 2024 11:39:02 +0200 Subject: [PATCH 27/69] panama-backend - test adding jextract --- .github/workflows/ci.yml | 400 +++++++++++++++++++++------------------ 1 file changed, 212 insertions(+), 188 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6d066c241..8ce3a7aaf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,193 +10,208 @@ env: CARGO_TERM_COLOR: always jobs: - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Check rustfmt - run: cargo fmt --all -- --check - - - name: Check clippy - run: cargo clippy --all-targets --all-features -- -D warnings - - build-test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Build - run: cargo build --verbose - - - name: Run tests - run: cargo test --verbose - - gen: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Install cargo-make - uses: taiki-e/install-action@v2 - with: - tool: cargo-make@0.36.13 # https://github.com/rust-diplomat/diplomat/issues/440 - - - name: Run regeneration - run: cargo make gen - - name: Test code is fresh - run: git add . && git diff --cached --exit-code - - - test-c: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Install cargo-make - uses: taiki-e/install-action@cargo-make - - - name: Test C - run: cargo make test-c - - check-c: - strategy: - matrix: - os: [ ubuntu-latest, macos-latest, windows-latest ] - fail-fast: false - runs-on: ${{ matrix.os }} - - steps: - - uses: actions/checkout@v2 - - - name: Install cargo-make - uses: taiki-e/install-action@cargo-make - - - name: clang, c11 - run: cargo make check-c - env: - CC: clang - C_STD: c11 - - - name: gcc, c11 - run: cargo make check-c - env: - CC: gcc - C_STD: c11 - - - name: gcc, c2x - run: cargo make check-c - env: - CC: gcc - C_STD: c2x - - test-cpp: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Install cargo-make - uses: taiki-e/install-action@cargo-make - - - name: clang - run: CXX=clang++-14 cargo make test-cpp - - - name: gcc - run: CXX=g++ cargo make test-cpp - - check-cpp: - strategy: - matrix: - os: [ ubuntu-latest, macos-latest, windows-latest ] - fail-fast: false - runs-on: ${{ matrix.os }} - - steps: - - uses: actions/checkout@v2 - - - name: Install cargo-make - uses: taiki-e/install-action@cargo-make - - - name: clang, c++17 - run: cargo make check-cpp - env: - CXX: clang - CXX_STD: c++17 - - - name: clang, c++20 - run: cargo make check-cpp - env: - CXX: clang - CXX_STD: c++20 - - - name: gcc, c++23 - if: ${{ matrix.os != 'macos-latest' }} - run: cargo make check-cpp - env: - CXX: gcc - CXX_STD: c++23 - - test-js: - runs-on: ubuntu-latest - strategy: - matrix: - node-version: [ - 18.20.3, # supported until 2025-04-30 - 20.14.0, # supported until 2026-04-30 - 22.3.0, # current, supported until 2027-04-30 - ] - fail-fast: false - steps: - - uses: actions/checkout@v2 - - - name: Install cargo-make - uses: taiki-e/install-action@cargo-make - - - name: Load Rust toolchain for WASM. - run: rustup target add wasm32-unknown-unknown - - - name: Install Node.js - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - - name: Test JS - run: cargo make test-js - - test-dart: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Install cargo-make - uses: taiki-e/install-action@cargo-make - - - name: Install Dart - uses: dart-lang/setup-dart@v1 - with: - sdk: 3.4.0-204.0.dev - - - name: Test Dart - run: cargo make test-dart - - test-kotlin: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install cargo-make - uses: taiki-e/install-action@cargo-make - - name: Set up JDK 17 for x64 - uses: actions/setup-java@v4 - with: - java-version: '17' - distribution: 'temurin' - architecture: x64 - - name: Setup Gradle - uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0 - - name: Test Kotlin - run: cargo make test-kotlin - - test-java: + # lint: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v2 + # + # - name: Check rustfmt + # run: cargo fmt --all -- --check + # + # - name: Check clippy + # run: cargo clippy --all-targets --all-features -- -D warnings + # + # build-test: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v2 + # + # - name: Build + # run: cargo build --verbose + # + # - name: Run tests + # run: cargo test --verbose + # + # gen: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v2 + # + # - name: Install cargo-make + # uses: taiki-e/install-action@v2 + # with: + # tool: cargo-make@0.36.13 # https://github.com/rust-diplomat/diplomat/issues/440 + # + # - name: Run regeneration + # run: cargo make gen + # - name: Test code is fresh + # run: git add . && git diff --cached --exit-code + # + # + # test-c: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v2 + # + # - name: Install cargo-make + # uses: taiki-e/install-action@cargo-make + # + # - name: Test C + # run: cargo make test-c + # + # check-c: + # strategy: + # matrix: + # os: [ ubuntu-latest, macos-latest, windows-latest ] + # fail-fast: false + # runs-on: ${{ matrix.os }} + # + # steps: + # - uses: actions/checkout@v2 + # + # - name: Install cargo-make + # uses: taiki-e/install-action@cargo-make + # + # - name: clang, c11 + # run: cargo make check-c + # env: + # CC: clang + # C_STD: c11 + # + # - name: gcc, c11 + # run: cargo make check-c + # env: + # CC: gcc + # C_STD: c11 + # + # - name: gcc, c2x + # run: cargo make check-c + # env: + # CC: gcc + # C_STD: c2x + # + # test-cpp: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v2 + # + # - name: Install cargo-make + # uses: taiki-e/install-action@cargo-make + # + # - name: clang + # run: CXX=clang++-14 cargo make test-cpp + # + # - name: gcc + # run: CXX=g++ cargo make test-cpp + # + # check-cpp: + # strategy: + # matrix: + # os: [ ubuntu-latest, macos-latest, windows-latest ] + # fail-fast: false + # runs-on: ${{ matrix.os }} + # + # steps: + # - uses: actions/checkout@v2 + # + # - name: Install cargo-make + # uses: taiki-e/install-action@cargo-make + # + # - name: clang, c++17 + # run: cargo make check-cpp + # env: + # CXX: clang + # CXX_STD: c++17 + # + # - name: clang, c++20 + # run: cargo make check-cpp + # env: + # CXX: clang + # CXX_STD: c++20 + # + # - name: gcc, c++23 + # if: ${{ matrix.os != 'macos-latest' }} + # run: cargo make check-cpp + # env: + # CXX: gcc + # CXX_STD: c++23 + # + # test-js: + # runs-on: ubuntu-latest + # strategy: + # matrix: + # node-version: [ + # 18.20.3, # supported until 2025-04-30 + # 20.14.0, # supported until 2026-04-30 + # 22.3.0, # current, supported until 2027-04-30 + # ] + # fail-fast: false + # steps: + # - uses: actions/checkout@v2 + # + # - name: Install cargo-make + # uses: taiki-e/install-action@cargo-make + # + # - name: Load Rust toolchain for WASM. + # run: rustup target add wasm32-unknown-unknown + # + # - name: Install Node.js + # uses: actions/setup-node@v1 + # with: + # node-version: ${{ matrix.node-version }} + # + # - name: Test JS + # run: cargo make test-js + # + # test-dart: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v2 + # + # - name: Install cargo-make + # uses: taiki-e/install-action@cargo-make + # + # - name: Install Dart + # uses: dart-lang/setup-dart@v1 + # with: + # sdk: 3.4.0-204.0.dev + # + # - name: Test Dart + # run: cargo make test-dart + # + # test-kotlin: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 + # - name: Install cargo-make + # uses: taiki-e/install-action@cargo-make + # - name: Set up JDK 17 for x64 + # uses: actions/setup-java@v4 + # with: + # java-version: '17' + # distribution: 'temurin' + # architecture: x64 + # - name: Setup Gradle + # uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0 + # - name: Test Kotlin + # run: cargo make test-kotlin + # + # test-java: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 + # - name: Install cargo-make + # uses: taiki-e/install-action@cargo-make + # - name: Set up JDK 22 for x64 + # uses: actions/setup-java@v4 + # with: + # java-version: '22' + # distribution: 'temurin' + # architecture: x64 + # cache: maven + # - name: Test Java + # run: cargo make test-java + test-java-gen: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -209,5 +224,14 @@ jobs: distribution: 'temurin' architecture: x64 cache: maven + - name: get jextract + uses: enflo/curl-action@master + with: + curl: + - "-o" + - "/opt/jextract.tgz" + - "https://download.java.net/java/early_access/jextract/22/5/openjdk-22-jextract+5-33_linux-x64_bin.tar.gz" + - name: config jextract + run: tar -xzf jextract.tgz - name: Test Java - run: cargo make test-java + run: PATH=$PATH:"/opt/jextract-22/bin" echo $PATH From 21481833fd4ecda2d91f3af70f9d6bbd965c1fc2 Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Sun, 1 Sep 2024 11:40:24 +0200 Subject: [PATCH 28/69] panama-backend - test new ci --- .github/workflows/ci.yml | 48 ++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8ce3a7aaf..d74be2af1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,6 +10,30 @@ env: CARGO_TERM_COLOR: always jobs: + test-java-gen: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install cargo-make + uses: taiki-e/install-action@cargo-make + - name: Set up JDK 22 for x64 + uses: actions/setup-java@v4 + with: + java-version: '22' + distribution: 'temurin' + architecture: x64 + cache: maven + - name: get jextract + uses: enflo/curl-action@master + with: + curl: + - "-o" + - "/opt/jextract.tgz" + - "https://download.java.net/java/early_access/jextract/22/5/openjdk-22-jextract+5-33_linux-x64_bin.tar.gz" + - name: config jextract + run: tar -xzf jextract.tgz + - name: Test Java + run: PATH=$PATH:"/opt/jextract-22/bin" echo $PATH # lint: # runs-on: ubuntu-latest # steps: @@ -211,27 +235,3 @@ jobs: # cache: maven # - name: Test Java # run: cargo make test-java - test-java-gen: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install cargo-make - uses: taiki-e/install-action@cargo-make - - name: Set up JDK 22 for x64 - uses: actions/setup-java@v4 - with: - java-version: '22' - distribution: 'temurin' - architecture: x64 - cache: maven - - name: get jextract - uses: enflo/curl-action@master - with: - curl: - - "-o" - - "/opt/jextract.tgz" - - "https://download.java.net/java/early_access/jextract/22/5/openjdk-22-jextract+5-33_linux-x64_bin.tar.gz" - - name: config jextract - run: tar -xzf jextract.tgz - - name: Test Java - run: PATH=$PATH:"/opt/jextract-22/bin" echo $PATH From 57e67e6c4240a1b92800c8b3c632789b7679f390 Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Sun, 1 Sep 2024 11:41:31 +0200 Subject: [PATCH 29/69] panama-backend - test jextract ci --- .github/workflows/ci.yml | 402 +++++++++++++++++++-------------------- 1 file changed, 201 insertions(+), 201 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d74be2af1..d3e09cece 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,6 +10,207 @@ env: CARGO_TERM_COLOR: always jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Check rustfmt + run: cargo fmt --all -- --check + + - name: Check clippy + run: cargo clippy --all-targets --all-features -- -D warnings + + build-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Build + run: cargo build --verbose + + - name: Run tests + run: cargo test --verbose + + gen: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Install cargo-make + uses: taiki-e/install-action@v2 + with: + tool: cargo-make@0.36.13 # https://github.com/rust-diplomat/diplomat/issues/440 + + - name: Run regeneration + run: cargo make gen + - name: Test code is fresh + run: git add . && git diff --cached --exit-code + + + test-c: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Install cargo-make + uses: taiki-e/install-action@cargo-make + + - name: Test C + run: cargo make test-c + + check-c: + strategy: + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] + fail-fast: false + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v2 + + - name: Install cargo-make + uses: taiki-e/install-action@cargo-make + + - name: clang, c11 + run: cargo make check-c + env: + CC: clang + C_STD: c11 + + - name: gcc, c11 + run: cargo make check-c + env: + CC: gcc + C_STD: c11 + + - name: gcc, c2x + run: cargo make check-c + env: + CC: gcc + C_STD: c2x + + test-cpp: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Install cargo-make + uses: taiki-e/install-action@cargo-make + + - name: clang + run: CXX=clang++-14 cargo make test-cpp + + - name: gcc + run: CXX=g++ cargo make test-cpp + + check-cpp: + strategy: + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] + fail-fast: false + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v2 + + - name: Install cargo-make + uses: taiki-e/install-action@cargo-make + + - name: clang, c++17 + run: cargo make check-cpp + env: + CXX: clang + CXX_STD: c++17 + + - name: clang, c++20 + run: cargo make check-cpp + env: + CXX: clang + CXX_STD: c++20 + + - name: gcc, c++23 + if: ${{ matrix.os != 'macos-latest' }} + run: cargo make check-cpp + env: + CXX: gcc + CXX_STD: c++23 + + test-js: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [ + 18.20.3, # supported until 2025-04-30 + 20.14.0, # supported until 2026-04-30 + 22.3.0, # current, supported until 2027-04-30 + ] + fail-fast: false + steps: + - uses: actions/checkout@v2 + + - name: Install cargo-make + uses: taiki-e/install-action@cargo-make + + - name: Load Rust toolchain for WASM. + run: rustup target add wasm32-unknown-unknown + + - name: Install Node.js + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + + - name: Test JS + run: cargo make test-js + + test-dart: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Install cargo-make + uses: taiki-e/install-action@cargo-make + + - name: Install Dart + uses: dart-lang/setup-dart@v1 + with: + sdk: 3.4.0-204.0.dev + + - name: Test Dart + run: cargo make test-dart + + test-kotlin: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install cargo-make + uses: taiki-e/install-action@cargo-make + - name: Set up JDK 17 for x64 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + architecture: x64 + - name: Setup Gradle + uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0 + - name: Test Kotlin + run: cargo make test-kotlin + + test-java: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install cargo-make + uses: taiki-e/install-action@cargo-make + - name: Set up JDK 22 for x64 + uses: actions/setup-java@v4 + with: + java-version: '22' + distribution: 'temurin' + architecture: x64 + cache: maven + - name: Test Java + run: cargo make test-java test-java-gen: runs-on: ubuntu-latest steps: @@ -34,204 +235,3 @@ jobs: run: tar -xzf jextract.tgz - name: Test Java run: PATH=$PATH:"/opt/jextract-22/bin" echo $PATH - # lint: - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v2 - # - # - name: Check rustfmt - # run: cargo fmt --all -- --check - # - # - name: Check clippy - # run: cargo clippy --all-targets --all-features -- -D warnings - # - # build-test: - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v2 - # - # - name: Build - # run: cargo build --verbose - # - # - name: Run tests - # run: cargo test --verbose - # - # gen: - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v2 - # - # - name: Install cargo-make - # uses: taiki-e/install-action@v2 - # with: - # tool: cargo-make@0.36.13 # https://github.com/rust-diplomat/diplomat/issues/440 - # - # - name: Run regeneration - # run: cargo make gen - # - name: Test code is fresh - # run: git add . && git diff --cached --exit-code - # - # - # test-c: - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v2 - # - # - name: Install cargo-make - # uses: taiki-e/install-action@cargo-make - # - # - name: Test C - # run: cargo make test-c - # - # check-c: - # strategy: - # matrix: - # os: [ ubuntu-latest, macos-latest, windows-latest ] - # fail-fast: false - # runs-on: ${{ matrix.os }} - # - # steps: - # - uses: actions/checkout@v2 - # - # - name: Install cargo-make - # uses: taiki-e/install-action@cargo-make - # - # - name: clang, c11 - # run: cargo make check-c - # env: - # CC: clang - # C_STD: c11 - # - # - name: gcc, c11 - # run: cargo make check-c - # env: - # CC: gcc - # C_STD: c11 - # - # - name: gcc, c2x - # run: cargo make check-c - # env: - # CC: gcc - # C_STD: c2x - # - # test-cpp: - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v2 - # - # - name: Install cargo-make - # uses: taiki-e/install-action@cargo-make - # - # - name: clang - # run: CXX=clang++-14 cargo make test-cpp - # - # - name: gcc - # run: CXX=g++ cargo make test-cpp - # - # check-cpp: - # strategy: - # matrix: - # os: [ ubuntu-latest, macos-latest, windows-latest ] - # fail-fast: false - # runs-on: ${{ matrix.os }} - # - # steps: - # - uses: actions/checkout@v2 - # - # - name: Install cargo-make - # uses: taiki-e/install-action@cargo-make - # - # - name: clang, c++17 - # run: cargo make check-cpp - # env: - # CXX: clang - # CXX_STD: c++17 - # - # - name: clang, c++20 - # run: cargo make check-cpp - # env: - # CXX: clang - # CXX_STD: c++20 - # - # - name: gcc, c++23 - # if: ${{ matrix.os != 'macos-latest' }} - # run: cargo make check-cpp - # env: - # CXX: gcc - # CXX_STD: c++23 - # - # test-js: - # runs-on: ubuntu-latest - # strategy: - # matrix: - # node-version: [ - # 18.20.3, # supported until 2025-04-30 - # 20.14.0, # supported until 2026-04-30 - # 22.3.0, # current, supported until 2027-04-30 - # ] - # fail-fast: false - # steps: - # - uses: actions/checkout@v2 - # - # - name: Install cargo-make - # uses: taiki-e/install-action@cargo-make - # - # - name: Load Rust toolchain for WASM. - # run: rustup target add wasm32-unknown-unknown - # - # - name: Install Node.js - # uses: actions/setup-node@v1 - # with: - # node-version: ${{ matrix.node-version }} - # - # - name: Test JS - # run: cargo make test-js - # - # test-dart: - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v2 - # - # - name: Install cargo-make - # uses: taiki-e/install-action@cargo-make - # - # - name: Install Dart - # uses: dart-lang/setup-dart@v1 - # with: - # sdk: 3.4.0-204.0.dev - # - # - name: Test Dart - # run: cargo make test-dart - # - # test-kotlin: - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v4 - # - name: Install cargo-make - # uses: taiki-e/install-action@cargo-make - # - name: Set up JDK 17 for x64 - # uses: actions/setup-java@v4 - # with: - # java-version: '17' - # distribution: 'temurin' - # architecture: x64 - # - name: Setup Gradle - # uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0 - # - name: Test Kotlin - # run: cargo make test-kotlin - # - # test-java: - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v4 - # - name: Install cargo-make - # uses: taiki-e/install-action@cargo-make - # - name: Set up JDK 22 for x64 - # uses: actions/setup-java@v4 - # with: - # java-version: '22' - # distribution: 'temurin' - # architecture: x64 - # cache: maven - # - name: Test Java - # run: cargo make test-java From 9bebc5b79b948e07af08765711266d96fadd6cc6 Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Sun, 1 Sep 2024 11:43:45 +0200 Subject: [PATCH 30/69] panama-backend - debug ci --- .github/workflows/ci.yml | 49 ++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d3e09cece..c2834d566 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -211,27 +211,28 @@ jobs: cache: maven - name: Test Java run: cargo make test-java - test-java-gen: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install cargo-make - uses: taiki-e/install-action@cargo-make - - name: Set up JDK 22 for x64 - uses: actions/setup-java@v4 - with: - java-version: '22' - distribution: 'temurin' - architecture: x64 - cache: maven - - name: get jextract - uses: enflo/curl-action@master - with: - curl: - - "-o" - - "/opt/jextract.tgz" - - "https://download.java.net/java/early_access/jextract/22/5/openjdk-22-jextract+5-33_linux-x64_bin.tar.gz" - - name: config jextract - run: tar -xzf jextract.tgz - - name: Test Java - run: PATH=$PATH:"/opt/jextract-22/bin" echo $PATH + + # test-java-gen: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 + # - name: Install cargo-make + # uses: taiki-e/install-action@cargo-make + # - name: Set up JDK 22 for x64 + # uses: actions/setup-java@v4 + # with: + # java-version: '22' + # distribution: 'temurin' + # architecture: x64 + # cache: maven + # - name: get jextract + # uses: enflo/curl-action@master + # with: + # curl: + # - "-o" + # - "/opt/jextract.tgz" + # - "https://download.java.net/java/early_access/jextract/22/5/openjdk-22-jextract+5-33_linux-x64_bin.tar.gz" + # - name: config jextract + # run: tar -xzf jextract.tgz + # - name: Test Java + # run: PATH=$PATH:"/opt/jextract-22/bin" echo $PATH From b9bc603e98fddfda0dd88263f6e3a0ba79b89ba1 Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Sun, 1 Sep 2024 11:45:12 +0200 Subject: [PATCH 31/69] panama-backend - limit ci to new task --- .github/workflows/ci.yml | 426 +++++++++++++++++++-------------------- 1 file changed, 213 insertions(+), 213 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c2834d566..8adbe6de0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,209 +10,193 @@ env: CARGO_TERM_COLOR: always jobs: - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Check rustfmt - run: cargo fmt --all -- --check - - - name: Check clippy - run: cargo clippy --all-targets --all-features -- -D warnings - - build-test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Build - run: cargo build --verbose - - - name: Run tests - run: cargo test --verbose - - gen: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Install cargo-make - uses: taiki-e/install-action@v2 - with: - tool: cargo-make@0.36.13 # https://github.com/rust-diplomat/diplomat/issues/440 - - - name: Run regeneration - run: cargo make gen - - name: Test code is fresh - run: git add . && git diff --cached --exit-code - - - test-c: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Install cargo-make - uses: taiki-e/install-action@cargo-make - - - name: Test C - run: cargo make test-c - - check-c: - strategy: - matrix: - os: [ ubuntu-latest, macos-latest, windows-latest ] - fail-fast: false - runs-on: ${{ matrix.os }} - - steps: - - uses: actions/checkout@v2 - - - name: Install cargo-make - uses: taiki-e/install-action@cargo-make - - - name: clang, c11 - run: cargo make check-c - env: - CC: clang - C_STD: c11 - - - name: gcc, c11 - run: cargo make check-c - env: - CC: gcc - C_STD: c11 - - - name: gcc, c2x - run: cargo make check-c - env: - CC: gcc - C_STD: c2x - - test-cpp: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Install cargo-make - uses: taiki-e/install-action@cargo-make - - - name: clang - run: CXX=clang++-14 cargo make test-cpp - - - name: gcc - run: CXX=g++ cargo make test-cpp - - check-cpp: - strategy: - matrix: - os: [ ubuntu-latest, macos-latest, windows-latest ] - fail-fast: false - runs-on: ${{ matrix.os }} - - steps: - - uses: actions/checkout@v2 - - - name: Install cargo-make - uses: taiki-e/install-action@cargo-make - - - name: clang, c++17 - run: cargo make check-cpp - env: - CXX: clang - CXX_STD: c++17 - - - name: clang, c++20 - run: cargo make check-cpp - env: - CXX: clang - CXX_STD: c++20 - - - name: gcc, c++23 - if: ${{ matrix.os != 'macos-latest' }} - run: cargo make check-cpp - env: - CXX: gcc - CXX_STD: c++23 - - test-js: - runs-on: ubuntu-latest - strategy: - matrix: - node-version: [ - 18.20.3, # supported until 2025-04-30 - 20.14.0, # supported until 2026-04-30 - 22.3.0, # current, supported until 2027-04-30 - ] - fail-fast: false - steps: - - uses: actions/checkout@v2 - - - name: Install cargo-make - uses: taiki-e/install-action@cargo-make - - - name: Load Rust toolchain for WASM. - run: rustup target add wasm32-unknown-unknown - - - name: Install Node.js - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - - name: Test JS - run: cargo make test-js - - test-dart: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Install cargo-make - uses: taiki-e/install-action@cargo-make - - - name: Install Dart - uses: dart-lang/setup-dart@v1 - with: - sdk: 3.4.0-204.0.dev - - - name: Test Dart - run: cargo make test-dart - - test-kotlin: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install cargo-make - uses: taiki-e/install-action@cargo-make - - name: Set up JDK 17 for x64 - uses: actions/setup-java@v4 - with: - java-version: '17' - distribution: 'temurin' - architecture: x64 - - name: Setup Gradle - uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0 - - name: Test Kotlin - run: cargo make test-kotlin - - test-java: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install cargo-make - uses: taiki-e/install-action@cargo-make - - name: Set up JDK 22 for x64 - uses: actions/setup-java@v4 - with: - java-version: '22' - distribution: 'temurin' - architecture: x64 - cache: maven - - name: Test Java - run: cargo make test-java - - # test-java-gen: + # lint: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v2 + # + # - name: Check rustfmt + # run: cargo fmt --all -- --check + # + # - name: Check clippy + # run: cargo clippy --all-targets --all-features -- -D warnings + # + # build-test: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v2 + # + # - name: Build + # run: cargo build --verbose + # + # - name: Run tests + # run: cargo test --verbose + # + # gen: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v2 + # + # - name: Install cargo-make + # uses: taiki-e/install-action@v2 + # with: + # tool: cargo-make@0.36.13 # https://github.com/rust-diplomat/diplomat/issues/440 + # + # - name: Run regeneration + # run: cargo make gen + # - name: Test code is fresh + # run: git add . && git diff --cached --exit-code + # + # + # test-c: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v2 + # + # - name: Install cargo-make + # uses: taiki-e/install-action@cargo-make + # + # - name: Test C + # run: cargo make test-c + # + # check-c: + # strategy: + # matrix: + # os: [ ubuntu-latest, macos-latest, windows-latest ] + # fail-fast: false + # runs-on: ${{ matrix.os }} + # + # steps: + # - uses: actions/checkout@v2 + # + # - name: Install cargo-make + # uses: taiki-e/install-action@cargo-make + # + # - name: clang, c11 + # run: cargo make check-c + # env: + # CC: clang + # C_STD: c11 + # + # - name: gcc, c11 + # run: cargo make check-c + # env: + # CC: gcc + # C_STD: c11 + # + # - name: gcc, c2x + # run: cargo make check-c + # env: + # CC: gcc + # C_STD: c2x + # + # test-cpp: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v2 + # + # - name: Install cargo-make + # uses: taiki-e/install-action@cargo-make + # + # - name: clang + # run: CXX=clang++-14 cargo make test-cpp + # + # - name: gcc + # run: CXX=g++ cargo make test-cpp + # + # check-cpp: + # strategy: + # matrix: + # os: [ ubuntu-latest, macos-latest, windows-latest ] + # fail-fast: false + # runs-on: ${{ matrix.os }} + # + # steps: + # - uses: actions/checkout@v2 + # + # - name: Install cargo-make + # uses: taiki-e/install-action@cargo-make + # + # - name: clang, c++17 + # run: cargo make check-cpp + # env: + # CXX: clang + # CXX_STD: c++17 + # + # - name: clang, c++20 + # run: cargo make check-cpp + # env: + # CXX: clang + # CXX_STD: c++20 + # + # - name: gcc, c++23 + # if: ${{ matrix.os != 'macos-latest' }} + # run: cargo make check-cpp + # env: + # CXX: gcc + # CXX_STD: c++23 + # + # test-js: + # runs-on: ubuntu-latest + # strategy: + # matrix: + # node-version: [ + # 18.20.3, # supported until 2025-04-30 + # 20.14.0, # supported until 2026-04-30 + # 22.3.0, # current, supported until 2027-04-30 + # ] + # fail-fast: false + # steps: + # - uses: actions/checkout@v2 + # + # - name: Install cargo-make + # uses: taiki-e/install-action@cargo-make + # + # - name: Load Rust toolchain for WASM. + # run: rustup target add wasm32-unknown-unknown + # + # - name: Install Node.js + # uses: actions/setup-node@v1 + # with: + # node-version: ${{ matrix.node-version }} + # + # - name: Test JS + # run: cargo make test-js + # + # test-dart: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v2 + # + # - name: Install cargo-make + # uses: taiki-e/install-action@cargo-make + # + # - name: Install Dart + # uses: dart-lang/setup-dart@v1 + # with: + # sdk: 3.4.0-204.0.dev + # + # - name: Test Dart + # run: cargo make test-dart + # + # test-kotlin: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 + # - name: Install cargo-make + # uses: taiki-e/install-action@cargo-make + # - name: Set up JDK 17 for x64 + # uses: actions/setup-java@v4 + # with: + # java-version: '17' + # distribution: 'temurin' + # architecture: x64 + # - name: Setup Gradle + # uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0 + # - name: Test Kotlin + # run: cargo make test-kotlin + # + # test-java: # runs-on: ubuntu-latest # steps: # - uses: actions/checkout@v4 @@ -225,14 +209,30 @@ jobs: # distribution: 'temurin' # architecture: x64 # cache: maven - # - name: get jextract - # uses: enflo/curl-action@master - # with: - # curl: - # - "-o" - # - "/opt/jextract.tgz" - # - "https://download.java.net/java/early_access/jextract/22/5/openjdk-22-jextract+5-33_linux-x64_bin.tar.gz" - # - name: config jextract - # run: tar -xzf jextract.tgz # - name: Test Java - # run: PATH=$PATH:"/opt/jextract-22/bin" echo $PATH + # run: cargo make test-java + + test-java-gen: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install cargo-make + uses: taiki-e/install-action@cargo-make + - name: Set up JDK 22 for x64 + uses: actions/setup-java@v4 + with: + java-version: '22' + distribution: 'temurin' + architecture: x64 + cache: maven + # - name: get jextract + # uses: enflo/curl-action@master + # with: + # curl: + # - "-o" + # - "/opt/jextract.tgz" + # - "https://download.java.net/java/early_access/jextract/22/5/openjdk-22-jextract+5-33_linux-x64_bin.tar.gz" + # - name: config jextract + # run: tar -xzf jextract.tgz + # - name: Test Java + # run: PATH=$PATH:"/opt/jextract-22/bin" echo $PATH From 5666887b2092d3855f4dc35b813155a1e748fb29 Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Sun, 1 Sep 2024 11:47:13 +0200 Subject: [PATCH 32/69] panama-backend - use taiki-e to install curl? --- .github/workflows/ci.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8adbe6de0..8c4db0793 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -218,6 +218,8 @@ jobs: - uses: actions/checkout@v4 - name: Install cargo-make uses: taiki-e/install-action@cargo-make + - name: Install curl + uses: taiki-e/install-action@curl - name: Set up JDK 22 for x64 uses: actions/setup-java@v4 with: @@ -225,13 +227,9 @@ jobs: distribution: 'temurin' architecture: x64 cache: maven - # - name: get jextract - # uses: enflo/curl-action@master - # with: - # curl: - # - "-o" - # - "/opt/jextract.tgz" - # - "https://download.java.net/java/early_access/jextract/22/5/openjdk-22-jextract+5-33_linux-x64_bin.tar.gz" + - name: get jextract + uses: enflo/curl-action@master + run: curl -o /opt/jextract.tgz https://download.java.net/java/early_access/jextract/22/5/openjdk-22-jextract+5-33_linux-x64_bin.tar.gz # - name: config jextract # run: tar -xzf jextract.tgz # - name: Test Java From e323f50d2d926fcec6d4b7cb371b5c76e8a43aee Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Sun, 1 Sep 2024 11:48:03 +0200 Subject: [PATCH 33/69] panama-backend - remove enflo --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8c4db0793..a95ab4fa3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -228,7 +228,6 @@ jobs: architecture: x64 cache: maven - name: get jextract - uses: enflo/curl-action@master run: curl -o /opt/jextract.tgz https://download.java.net/java/early_access/jextract/22/5/openjdk-22-jextract+5-33_linux-x64_bin.tar.gz # - name: config jextract # run: tar -xzf jextract.tgz From d56671e7f42ae8f75a65b41fea70c04c9c94ee7b Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Sun, 1 Sep 2024 11:51:14 +0200 Subject: [PATCH 34/69] panama-backend - good ol' apt? --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a95ab4fa3..cd038879f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -219,7 +219,7 @@ jobs: - name: Install cargo-make uses: taiki-e/install-action@cargo-make - name: Install curl - uses: taiki-e/install-action@curl + run: apt-get update && apt-get install -y curl - name: Set up JDK 22 for x64 uses: actions/setup-java@v4 with: From 0d9a024b72ff1b2b897e83777a596396e9517ea8 Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Sun, 1 Sep 2024 11:52:23 +0200 Subject: [PATCH 35/69] panama-backend - sudo make me a sandwich --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cd038879f..365618d2e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -219,7 +219,7 @@ jobs: - name: Install cargo-make uses: taiki-e/install-action@cargo-make - name: Install curl - run: apt-get update && apt-get install -y curl + run: sudo apt-get update && sudo apt-get install -y curl - name: Set up JDK 22 for x64 uses: actions/setup-java@v4 with: From 99e0ec270c0270297ff069812253fc629cc35187 Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Sun, 1 Sep 2024 11:54:45 +0200 Subject: [PATCH 36/69] panama-backend - full test pipeline --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 365618d2e..5a0997e26 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -229,7 +229,7 @@ jobs: cache: maven - name: get jextract run: curl -o /opt/jextract.tgz https://download.java.net/java/early_access/jextract/22/5/openjdk-22-jextract+5-33_linux-x64_bin.tar.gz - # - name: config jextract - # run: tar -xzf jextract.tgz - # - name: Test Java - # run: PATH=$PATH:"/opt/jextract-22/bin" echo $PATH + - name: config jextract + run: tar -xzf /opt/jextract.tgz -C /opt/ + - name: Test Java + run: PATH=$PATH:"/opt/jextract-22/bin" echo $PATH From 89f1aab44d8473b664fd83a7785cdf5d464607ea Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Sun, 1 Sep 2024 11:56:48 +0200 Subject: [PATCH 37/69] panama-backend - see if it downloaded --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5a0997e26..a19ebfd9a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -232,4 +232,4 @@ jobs: - name: config jextract run: tar -xzf /opt/jextract.tgz -C /opt/ - name: Test Java - run: PATH=$PATH:"/opt/jextract-22/bin" echo $PATH + run: ls /opt/ From fba6db24fe2377a1270fb0dccec2b64c257d55c5 Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Sun, 1 Sep 2024 11:58:58 +0200 Subject: [PATCH 38/69] panama-backend - test jextract --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a19ebfd9a..be03e79f9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -231,5 +231,7 @@ jobs: run: curl -o /opt/jextract.tgz https://download.java.net/java/early_access/jextract/22/5/openjdk-22-jextract+5-33_linux-x64_bin.tar.gz - name: config jextract run: tar -xzf /opt/jextract.tgz -C /opt/ + - name: Add jextract to path + run: export PATH=$PATH:/opt/jextract-22/bin - name: Test Java - run: ls /opt/ + run: jextract --help From 108417a1d1c5dd7a71c29dacd7fdda7d34812ff1 Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Sun, 1 Sep 2024 12:00:50 +0200 Subject: [PATCH 39/69] panama-backend - test path --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index be03e79f9..3a07beb79 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -232,6 +232,8 @@ jobs: - name: config jextract run: tar -xzf /opt/jextract.tgz -C /opt/ - name: Add jextract to path - run: export PATH=$PATH:/opt/jextract-22/bin + run: echo "PATH=$PATH:/opt/jextract-22/bin" >> ~/.bashrc + - name: Test PATH + run: echo $PATH - name: Test Java run: jextract --help From fc5a255e0fb3115a965b756c1e56c5ff86169aa1 Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Sun, 1 Sep 2024 12:02:49 +0200 Subject: [PATCH 40/69] panama-backend - more debugging --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3a07beb79..44a839c42 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -235,5 +235,3 @@ jobs: run: echo "PATH=$PATH:/opt/jextract-22/bin" >> ~/.bashrc - name: Test PATH run: echo $PATH - - name: Test Java - run: jextract --help From 85da4d5fa2fa32bbacdbda35344476d8e1bc205d Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Sun, 1 Sep 2024 12:06:28 +0200 Subject: [PATCH 41/69] panama-backend - cat profile --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 44a839c42..9721ac11a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -233,5 +233,7 @@ jobs: run: tar -xzf /opt/jextract.tgz -C /opt/ - name: Add jextract to path run: echo "PATH=$PATH:/opt/jextract-22/bin" >> ~/.bashrc + - name: cat bash profile + run: cat ~/.basrc - name: Test PATH run: echo $PATH From 6c2f94e40189fa9314aa37da877cc5bac96468b1 Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Sun, 1 Sep 2024 12:11:42 +0200 Subject: [PATCH 42/69] panama-backend - change last step --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9721ac11a..373aa4c3f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -235,5 +235,5 @@ jobs: run: echo "PATH=$PATH:/opt/jextract-22/bin" >> ~/.bashrc - name: cat bash profile run: cat ~/.basrc - - name: Test PATH - run: echo $PATH + # - name: Test PATH + # run: echo $PATH From 7aabcc271d8f54b5dbfc20cc7974baaeb62224d3 Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Sun, 1 Sep 2024 15:07:43 +0200 Subject: [PATCH 43/69] panama-backend - fix bashrc debug --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 373aa4c3f..5812b8a53 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -232,8 +232,8 @@ jobs: - name: config jextract run: tar -xzf /opt/jextract.tgz -C /opt/ - name: Add jextract to path - run: echo "PATH=$PATH:/opt/jextract-22/bin" >> ~/.bashrc + run: echo "PATH=\$PATH:/opt/jextract-22/bin" >> ~/.bashrc - name: cat bash profile - run: cat ~/.basrc + run: cat ~/.bashrc # - name: Test PATH # run: echo $PATH From cae2a94a041a6984c5aeb33f7d3829bc713134a9 Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Sun, 1 Sep 2024 15:09:05 +0200 Subject: [PATCH 44/69] panama-backend - add export to set env var --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5812b8a53..3f1183be2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -232,7 +232,7 @@ jobs: - name: config jextract run: tar -xzf /opt/jextract.tgz -C /opt/ - name: Add jextract to path - run: echo "PATH=\$PATH:/opt/jextract-22/bin" >> ~/.bashrc + run: echo "export PATH=\$PATH:/opt/jextract-22/bin" >> ~/.bashrc - name: cat bash profile run: cat ~/.bashrc # - name: Test PATH From 2252b85ecacbe4ae3120375d777255ccc76b3839 Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Sun, 1 Sep 2024 15:10:22 +0200 Subject: [PATCH 45/69] panama - uncomment PATH var debug --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3f1183be2..2b2a8526f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -235,5 +235,5 @@ jobs: run: echo "export PATH=\$PATH:/opt/jextract-22/bin" >> ~/.bashrc - name: cat bash profile run: cat ~/.bashrc - # - name: Test PATH - # run: echo $PATH + - name: Test PATH var + run: echo $PATH From 9878fb9a66c08cb016e118b9caafa1013acaadce Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Sun, 1 Sep 2024 15:11:22 +0200 Subject: [PATCH 46/69] panama-backend - add jextract --help to steps --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2b2a8526f..7277ef508 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -237,3 +237,5 @@ jobs: run: cat ~/.bashrc - name: Test PATH var run: echo $PATH + - name: jextract help + run: jextract --help From f3eb060746fcb89ed790e7671da1fbdc17bfae67 Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Sun, 1 Sep 2024 15:12:18 +0200 Subject: [PATCH 47/69] panama-backend - source the rc file --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7277ef508..e4ad92f6b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -236,6 +236,6 @@ jobs: - name: cat bash profile run: cat ~/.bashrc - name: Test PATH var - run: echo $PATH + run: source ~/bashrc && echo $PATH - name: jextract help - run: jextract --help + run: source ~/.bashrc && jextract --help From 4de1b97edefec217b7e7514d5ac941da3623e0d7 Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Sun, 1 Sep 2024 15:13:20 +0200 Subject: [PATCH 48/69] panama-backend - fix source path --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e4ad92f6b..85e169f55 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -236,6 +236,6 @@ jobs: - name: cat bash profile run: cat ~/.bashrc - name: Test PATH var - run: source ~/bashrc && echo $PATH + run: source ~/.bashrc && echo $PATH - name: jextract help run: source ~/.bashrc && jextract --help From 2ec77350cf49f4779496dc136f6c90ef7bc7dac5 Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Sun, 1 Sep 2024 15:16:31 +0200 Subject: [PATCH 49/69] panama-backend - use $GITHUB_PATH for path vars --- .github/workflows/ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 85e169f55..4230b6498 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -232,10 +232,10 @@ jobs: - name: config jextract run: tar -xzf /opt/jextract.tgz -C /opt/ - name: Add jextract to path - run: echo "export PATH=\$PATH:/opt/jextract-22/bin" >> ~/.bashrc - - name: cat bash profile - run: cat ~/.bashrc + run: echo "/opt/jextract-22/bin" >> $GITHUB_PATH - name: Test PATH var - run: source ~/.bashrc && echo $PATH + run: echo $PATH + - name: Test GITHUB_PATH var + run: cat $GITHUB_PATH - name: jextract help - run: source ~/.bashrc && jextract --help + run: jextract --help From 5ab860a1a11fd8b464a84eba6c61d52f33a354cf Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Sun, 1 Sep 2024 15:18:12 +0200 Subject: [PATCH 50/69] panama-backend - cleanup debug and add cargo make gen-java-feature --- .github/workflows/ci.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4230b6498..58fe9b3da 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -233,9 +233,5 @@ jobs: run: tar -xzf /opt/jextract.tgz -C /opt/ - name: Add jextract to path run: echo "/opt/jextract-22/bin" >> $GITHUB_PATH - - name: Test PATH var - run: echo $PATH - - name: Test GITHUB_PATH var - run: cat $GITHUB_PATH - - name: jextract help - run: jextract --help + - name: Run generated java + run: cargo make gen-java-feature From a796ffb32dcdb9495570759b2140573b3707552d Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Sun, 1 Sep 2024 15:24:58 +0200 Subject: [PATCH 51/69] panama-backend - uncomment other actions --- .github/workflows/ci.yml | 402 +++++++++++++++++++-------------------- 1 file changed, 201 insertions(+), 201 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 58fe9b3da..1cac9d449 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,207 +10,207 @@ env: CARGO_TERM_COLOR: always jobs: - # lint: - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v2 - # - # - name: Check rustfmt - # run: cargo fmt --all -- --check - # - # - name: Check clippy - # run: cargo clippy --all-targets --all-features -- -D warnings - # - # build-test: - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v2 - # - # - name: Build - # run: cargo build --verbose - # - # - name: Run tests - # run: cargo test --verbose - # - # gen: - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v2 - # - # - name: Install cargo-make - # uses: taiki-e/install-action@v2 - # with: - # tool: cargo-make@0.36.13 # https://github.com/rust-diplomat/diplomat/issues/440 - # - # - name: Run regeneration - # run: cargo make gen - # - name: Test code is fresh - # run: git add . && git diff --cached --exit-code - # - # - # test-c: - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v2 - # - # - name: Install cargo-make - # uses: taiki-e/install-action@cargo-make - # - # - name: Test C - # run: cargo make test-c - # - # check-c: - # strategy: - # matrix: - # os: [ ubuntu-latest, macos-latest, windows-latest ] - # fail-fast: false - # runs-on: ${{ matrix.os }} - # - # steps: - # - uses: actions/checkout@v2 - # - # - name: Install cargo-make - # uses: taiki-e/install-action@cargo-make - # - # - name: clang, c11 - # run: cargo make check-c - # env: - # CC: clang - # C_STD: c11 - # - # - name: gcc, c11 - # run: cargo make check-c - # env: - # CC: gcc - # C_STD: c11 - # - # - name: gcc, c2x - # run: cargo make check-c - # env: - # CC: gcc - # C_STD: c2x - # - # test-cpp: - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v2 - # - # - name: Install cargo-make - # uses: taiki-e/install-action@cargo-make - # - # - name: clang - # run: CXX=clang++-14 cargo make test-cpp - # - # - name: gcc - # run: CXX=g++ cargo make test-cpp - # - # check-cpp: - # strategy: - # matrix: - # os: [ ubuntu-latest, macos-latest, windows-latest ] - # fail-fast: false - # runs-on: ${{ matrix.os }} - # - # steps: - # - uses: actions/checkout@v2 - # - # - name: Install cargo-make - # uses: taiki-e/install-action@cargo-make - # - # - name: clang, c++17 - # run: cargo make check-cpp - # env: - # CXX: clang - # CXX_STD: c++17 - # - # - name: clang, c++20 - # run: cargo make check-cpp - # env: - # CXX: clang - # CXX_STD: c++20 - # - # - name: gcc, c++23 - # if: ${{ matrix.os != 'macos-latest' }} - # run: cargo make check-cpp - # env: - # CXX: gcc - # CXX_STD: c++23 - # - # test-js: - # runs-on: ubuntu-latest - # strategy: - # matrix: - # node-version: [ - # 18.20.3, # supported until 2025-04-30 - # 20.14.0, # supported until 2026-04-30 - # 22.3.0, # current, supported until 2027-04-30 - # ] - # fail-fast: false - # steps: - # - uses: actions/checkout@v2 - # - # - name: Install cargo-make - # uses: taiki-e/install-action@cargo-make - # - # - name: Load Rust toolchain for WASM. - # run: rustup target add wasm32-unknown-unknown - # - # - name: Install Node.js - # uses: actions/setup-node@v1 - # with: - # node-version: ${{ matrix.node-version }} - # - # - name: Test JS - # run: cargo make test-js - # - # test-dart: - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v2 - # - # - name: Install cargo-make - # uses: taiki-e/install-action@cargo-make - # - # - name: Install Dart - # uses: dart-lang/setup-dart@v1 - # with: - # sdk: 3.4.0-204.0.dev - # - # - name: Test Dart - # run: cargo make test-dart - # - # test-kotlin: - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v4 - # - name: Install cargo-make - # uses: taiki-e/install-action@cargo-make - # - name: Set up JDK 17 for x64 - # uses: actions/setup-java@v4 - # with: - # java-version: '17' - # distribution: 'temurin' - # architecture: x64 - # - name: Setup Gradle - # uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0 - # - name: Test Kotlin - # run: cargo make test-kotlin - # - # test-java: - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v4 - # - name: Install cargo-make - # uses: taiki-e/install-action@cargo-make - # - name: Set up JDK 22 for x64 - # uses: actions/setup-java@v4 - # with: - # java-version: '22' - # distribution: 'temurin' - # architecture: x64 - # cache: maven - # - name: Test Java - # run: cargo make test-java + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Check rustfmt + run: cargo fmt --all -- --check + + - name: Check clippy + run: cargo clippy --all-targets --all-features -- -D warnings + + build-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Build + run: cargo build --verbose + + - name: Run tests + run: cargo test --verbose + + gen: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Install cargo-make + uses: taiki-e/install-action@v2 + with: + tool: cargo-make@0.36.13 # https://github.com/rust-diplomat/diplomat/issues/440 + + - name: Run regeneration + run: cargo make gen + - name: Test code is fresh + run: git add . && git diff --cached --exit-code + + + test-c: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Install cargo-make + uses: taiki-e/install-action@cargo-make + + - name: Test C + run: cargo make test-c + + check-c: + strategy: + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] + fail-fast: false + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v2 + + - name: Install cargo-make + uses: taiki-e/install-action@cargo-make + + - name: clang, c11 + run: cargo make check-c + env: + CC: clang + C_STD: c11 + + - name: gcc, c11 + run: cargo make check-c + env: + CC: gcc + C_STD: c11 + + - name: gcc, c2x + run: cargo make check-c + env: + CC: gcc + C_STD: c2x + + test-cpp: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Install cargo-make + uses: taiki-e/install-action@cargo-make + + - name: clang + run: CXX=clang++-14 cargo make test-cpp + + - name: gcc + run: CXX=g++ cargo make test-cpp + + check-cpp: + strategy: + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] + fail-fast: false + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v2 + + - name: Install cargo-make + uses: taiki-e/install-action@cargo-make + + - name: clang, c++17 + run: cargo make check-cpp + env: + CXX: clang + CXX_STD: c++17 + + - name: clang, c++20 + run: cargo make check-cpp + env: + CXX: clang + CXX_STD: c++20 + + - name: gcc, c++23 + if: ${{ matrix.os != 'macos-latest' }} + run: cargo make check-cpp + env: + CXX: gcc + CXX_STD: c++23 + + test-js: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [ + 18.20.3, # supported until 2025-04-30 + 20.14.0, # supported until 2026-04-30 + 22.3.0, # current, supported until 2027-04-30 + ] + fail-fast: false + steps: + - uses: actions/checkout@v2 + + - name: Install cargo-make + uses: taiki-e/install-action@cargo-make + + - name: Load Rust toolchain for WASM. + run: rustup target add wasm32-unknown-unknown + + - name: Install Node.js + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + + - name: Test JS + run: cargo make test-js + + test-dart: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Install cargo-make + uses: taiki-e/install-action@cargo-make + + - name: Install Dart + uses: dart-lang/setup-dart@v1 + with: + sdk: 3.4.0-204.0.dev + + - name: Test Dart + run: cargo make test-dart + + test-kotlin: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install cargo-make + uses: taiki-e/install-action@cargo-make + - name: Set up JDK 17 for x64 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + architecture: x64 + - name: Setup Gradle + uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0 + - name: Test Kotlin + run: cargo make test-kotlin + + test-java: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install cargo-make + uses: taiki-e/install-action@cargo-make + - name: Set up JDK 22 for x64 + uses: actions/setup-java@v4 + with: + java-version: '22' + distribution: 'temurin' + architecture: x64 + cache: maven + - name: Test Java + run: cargo make test-java test-java-gen: runs-on: ubuntu-latest From 5abfc5dddd35abc032cfb2a4f4dcfad7bf5f5dd5 Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Sun, 1 Sep 2024 15:41:20 +0200 Subject: [PATCH 52/69] panama-backend - remove ICU4X java code --- example/java/ICU4X4J/.gitignore | 39 - example/java/ICU4X4J/pom.xml | 17 - .../src/main/java/dev/diplomattest/Main.java | 17 - .../somelib/ntv/DiplomatBoolArray.java | 173 - .../somelib/ntv/DiplomatBoolView.java | 173 - .../somelib/ntv/DiplomatCharArray.java | 173 - .../somelib/ntv/DiplomatCharView.java | 173 - .../somelib/ntv/DiplomatF32Array.java | 173 - .../somelib/ntv/DiplomatF32View.java | 173 - .../somelib/ntv/DiplomatF64Array.java | 173 - .../somelib/ntv/DiplomatF64View.java | 173 - .../somelib/ntv/DiplomatI16Array.java | 173 - .../somelib/ntv/DiplomatI16View.java | 173 - .../somelib/ntv/DiplomatI32Array.java | 173 - .../somelib/ntv/DiplomatI32View.java | 173 - .../somelib/ntv/DiplomatI64Array.java | 173 - .../somelib/ntv/DiplomatI64View.java | 173 - .../somelib/ntv/DiplomatI8Array.java | 173 - .../somelib/ntv/DiplomatI8View.java | 173 - .../somelib/ntv/DiplomatIsizeArray.java | 173 - .../somelib/ntv/DiplomatIsizeView.java | 173 - .../somelib/ntv/DiplomatString16Array.java | 173 - .../somelib/ntv/DiplomatString16View.java | 173 - .../somelib/ntv/DiplomatStringArray.java | 173 - .../somelib/ntv/DiplomatStringView.java | 173 - .../somelib/ntv/DiplomatStrings16Array.java | 173 - .../somelib/ntv/DiplomatStrings16View.java | 173 - .../somelib/ntv/DiplomatStringsArray.java | 173 - .../somelib/ntv/DiplomatStringsView.java | 173 - .../somelib/ntv/DiplomatU16Array.java | 173 - .../somelib/ntv/DiplomatU16View.java | 173 - .../somelib/ntv/DiplomatU32Array.java | 173 - .../somelib/ntv/DiplomatU32View.java | 173 - .../somelib/ntv/DiplomatU64Array.java | 173 - .../somelib/ntv/DiplomatU64View.java | 173 - .../somelib/ntv/DiplomatU8Array.java | 173 - .../somelib/ntv/DiplomatU8View.java | 173 - .../somelib/ntv/DiplomatUsizeArray.java | 173 - .../somelib/ntv/DiplomatUsizeView.java | 173 - .../somelib/ntv/DiplomatWrite.java | 512 - .../dev/diplomattest/somelib/ntv/FILE.java | 47 - ...U4XDataProvider_returns_result_result.java | 127 - .../ICU4XFixedDecimalFormatterOptions.java | 174 - ...XFixedDecimalFormatter_try_new_result.java | 178 - .../ICU4XFixedDecimal_to_string_result.java | 127 - .../somelib/ntv/_OSUnalignedU16.java | 127 - .../somelib/ntv/_OSUnalignedU32.java | 127 - .../somelib/ntv/_OSUnalignedU64.java | 127 - .../somelib/ntv/__darwin_mbstate_t.java | 26 - .../somelib/ntv/__darwin_pthread_attr_t.java | 29 - .../somelib/ntv/__darwin_pthread_cond_t.java | 29 - .../ntv/__darwin_pthread_condattr_t.java | 29 - .../ntv/__darwin_pthread_handler_rec.java | 272 - .../somelib/ntv/__darwin_pthread_mutex_t.java | 29 - .../ntv/__darwin_pthread_mutexattr_t.java | 29 - .../somelib/ntv/__darwin_pthread_once_t.java | 29 - .../ntv/__darwin_pthread_rwlock_t.java | 29 - .../ntv/__darwin_pthread_rwlockattr_t.java | 29 - .../diplomattest/somelib/ntv/__mbstate_t.java | 206 - .../dev/diplomattest/somelib/ntv/__sFILE.java | 1292 -- .../dev/diplomattest/somelib/ntv/__sbuf.java | 174 - .../somelib/ntv/_opaque_pthread_attr_t.java | 206 - .../somelib/ntv/_opaque_pthread_cond_t.java | 206 - .../ntv/_opaque_pthread_condattr_t.java | 206 - .../somelib/ntv/_opaque_pthread_mutex_t.java | 206 - .../ntv/_opaque_pthread_mutexattr_t.java | 206 - .../somelib/ntv/_opaque_pthread_once_t.java | 206 - .../somelib/ntv/_opaque_pthread_rwlock_t.java | 206 - .../ntv/_opaque_pthread_rwlockattr_t.java | 206 - .../somelib/ntv/_opaque_pthread_t.java | 252 - .../dev/diplomattest/somelib/ntv/fd_set.java | 160 - .../diplomattest/somelib/ntv/funopen$x0.java | 70 - .../diplomattest/somelib/ntv/funopen$x1.java | 70 - .../diplomattest/somelib/ntv/funopen$x2.java | 70 - .../diplomattest/somelib/ntv/funopen$x3.java | 68 - .../somelib/ntv/pthread_attr_t.java | 26 - .../somelib/ntv/pthread_cond_t.java | 26 - .../somelib/ntv/pthread_condattr_t.java | 26 - .../somelib/ntv/pthread_mutex_t.java | 26 - .../somelib/ntv/pthread_mutexattr_t.java | 26 - .../somelib/ntv/pthread_once_t.java | 26 - .../somelib/ntv/pthread_rwlock_t.java | 26 - .../somelib/ntv/pthread_rwlockattr_t.java | 26 - .../diplomattest/somelib/ntv/somelib_h.java | 12136 ---------------- tool/src/java/README.md | 37 - 85 files changed, 24768 deletions(-) delete mode 100644 example/java/ICU4X4J/.gitignore delete mode 100644 example/java/ICU4X4J/pom.xml delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/Main.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatBoolArray.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatBoolView.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatCharArray.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatCharView.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF32Array.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF32View.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF64Array.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF64View.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI16Array.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI16View.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI32Array.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI32View.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI64Array.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI64View.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI8Array.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI8View.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatIsizeArray.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatIsizeView.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatString16Array.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatString16View.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringArray.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringView.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStrings16Array.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStrings16View.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringsArray.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringsView.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU16Array.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU16View.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU32Array.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU32View.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU64Array.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU64View.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU8Array.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU8View.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatUsizeArray.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatUsizeView.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatWrite.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/FILE.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/ICU4XDataProvider_returns_result_result.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/ICU4XFixedDecimalFormatterOptions.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/ICU4XFixedDecimalFormatter_try_new_result.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/ICU4XFixedDecimal_to_string_result.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_OSUnalignedU16.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_OSUnalignedU32.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_OSUnalignedU64.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_mbstate_t.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_attr_t.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_cond_t.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_condattr_t.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_handler_rec.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_mutex_t.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_mutexattr_t.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_once_t.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_rwlock_t.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_rwlockattr_t.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__mbstate_t.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__sFILE.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__sbuf.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_attr_t.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_cond_t.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_condattr_t.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_mutex_t.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_mutexattr_t.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_once_t.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_rwlock_t.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_rwlockattr_t.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_t.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/fd_set.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/funopen$x0.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/funopen$x1.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/funopen$x2.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/funopen$x3.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_attr_t.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_cond_t.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_condattr_t.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_mutex_t.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_mutexattr_t.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_once_t.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_rwlock_t.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_rwlockattr_t.java delete mode 100644 example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java delete mode 100644 tool/src/java/README.md diff --git a/example/java/ICU4X4J/.gitignore b/example/java/ICU4X4J/.gitignore deleted file mode 100644 index 4bc86d39c..000000000 --- a/example/java/ICU4X4J/.gitignore +++ /dev/null @@ -1,39 +0,0 @@ -target/ -!.mvn/wrapper/maven-wrapper.jar -!**/src/main/**/target/ -!**/src/test/**/target/ - -### IntelliJ IDEA ### -.idea/modules.xml -.idea/jarRepositories.xml -.idea/compiler.xml -.idea/libraries/ -.idea/* -*.iws -*.iml -*.ipr - -### Eclipse ### -.apt_generated -.classpath -.factorypath -.project -.settings -.springBeans -.sts4-cache - -### NetBeans ### -/nbproject/private/ -/nbbuild/ -/dist/ -/nbdist/ -/.nb-gradle/ -build/ -!**/src/main/**/build/ -!**/src/test/**/build/ - -### VS Code ### -.vscode/ - -### Mac OS ### -.DS_Store diff --git a/example/java/ICU4X4J/pom.xml b/example/java/ICU4X4J/pom.xml deleted file mode 100644 index 9bcb61e50..000000000 --- a/example/java/ICU4X4J/pom.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - 4.0.0 - - dev.diplomattest - ICU4X4J - 1.0-SNAPSHOT - - - 22 - 22 - UTF-8 - - - \ No newline at end of file diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/Main.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/Main.java deleted file mode 100644 index 79b4286fb..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/Main.java +++ /dev/null @@ -1,17 +0,0 @@ -package dev.diplomattest; - -//TIP To Run code, press or -// click the icon in the gutter. -public class Main { - public static void main(String[] args) { - //TIP Press with your caret at the highlighted text - // to see how IntelliJ IDEA suggests fixing it. - System.out.printf("Hello and welcome!"); - - for (int i = 1; i <= 5; i++) { - //TIP Press to start debugging your code. We have set one breakpoint - // for you, but you can always add more by pressing . - System.out.println("i = " + i); - } - } -} \ No newline at end of file diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatBoolArray.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatBoolArray.java deleted file mode 100644 index b4d33578a..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatBoolArray.java +++ /dev/null @@ -1,173 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct DiplomatBoolArray { - * const bool *data; - * size_t len; - * } - * } - */ -public class DiplomatBoolArray { - - DiplomatBoolArray() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_POINTER.withName("data"), - somelib_h.C_LONG.withName("len") - ).withName("DiplomatBoolArray"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); - - /** - * Layout for field: - * {@snippet lang=c : - * const bool *data - * } - */ - public static final AddressLayout data$layout() { - return data$LAYOUT; - } - - private static final long data$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * const bool *data - * } - */ - public static final long data$offset() { - return data$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * const bool *data - * } - */ - public static MemorySegment data(MemorySegment struct) { - return struct.get(data$LAYOUT, data$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * const bool *data - * } - */ - public static void data(MemorySegment struct, MemorySegment fieldValue) { - struct.set(data$LAYOUT, data$OFFSET, fieldValue); - } - - private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final OfLong len$layout() { - return len$LAYOUT; - } - - private static final long len$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final long len$offset() { - return len$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static long len(MemorySegment struct) { - return struct.get(len$LAYOUT, len$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static void len(MemorySegment struct, long fieldValue) { - struct.set(len$LAYOUT, len$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatBoolView.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatBoolView.java deleted file mode 100644 index f72f81bda..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatBoolView.java +++ /dev/null @@ -1,173 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct DiplomatBoolView { - * const bool *data; - * size_t len; - * } - * } - */ -public class DiplomatBoolView { - - DiplomatBoolView() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_POINTER.withName("data"), - somelib_h.C_LONG.withName("len") - ).withName("DiplomatBoolView"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); - - /** - * Layout for field: - * {@snippet lang=c : - * const bool *data - * } - */ - public static final AddressLayout data$layout() { - return data$LAYOUT; - } - - private static final long data$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * const bool *data - * } - */ - public static final long data$offset() { - return data$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * const bool *data - * } - */ - public static MemorySegment data(MemorySegment struct) { - return struct.get(data$LAYOUT, data$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * const bool *data - * } - */ - public static void data(MemorySegment struct, MemorySegment fieldValue) { - struct.set(data$LAYOUT, data$OFFSET, fieldValue); - } - - private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final OfLong len$layout() { - return len$LAYOUT; - } - - private static final long len$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final long len$offset() { - return len$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static long len(MemorySegment struct) { - return struct.get(len$LAYOUT, len$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static void len(MemorySegment struct, long fieldValue) { - struct.set(len$LAYOUT, len$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatCharArray.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatCharArray.java deleted file mode 100644 index ad43f41a1..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatCharArray.java +++ /dev/null @@ -1,173 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct DiplomatCharArray { - * const char32_t *data; - * size_t len; - * } - * } - */ -public class DiplomatCharArray { - - DiplomatCharArray() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_POINTER.withName("data"), - somelib_h.C_LONG.withName("len") - ).withName("DiplomatCharArray"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); - - /** - * Layout for field: - * {@snippet lang=c : - * const char32_t *data - * } - */ - public static final AddressLayout data$layout() { - return data$LAYOUT; - } - - private static final long data$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * const char32_t *data - * } - */ - public static final long data$offset() { - return data$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * const char32_t *data - * } - */ - public static MemorySegment data(MemorySegment struct) { - return struct.get(data$LAYOUT, data$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * const char32_t *data - * } - */ - public static void data(MemorySegment struct, MemorySegment fieldValue) { - struct.set(data$LAYOUT, data$OFFSET, fieldValue); - } - - private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final OfLong len$layout() { - return len$LAYOUT; - } - - private static final long len$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final long len$offset() { - return len$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static long len(MemorySegment struct) { - return struct.get(len$LAYOUT, len$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static void len(MemorySegment struct, long fieldValue) { - struct.set(len$LAYOUT, len$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatCharView.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatCharView.java deleted file mode 100644 index 6dc3f0ec4..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatCharView.java +++ /dev/null @@ -1,173 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct DiplomatCharView { - * const char32_t *data; - * size_t len; - * } - * } - */ -public class DiplomatCharView { - - DiplomatCharView() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_POINTER.withName("data"), - somelib_h.C_LONG.withName("len") - ).withName("DiplomatCharView"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); - - /** - * Layout for field: - * {@snippet lang=c : - * const char32_t *data - * } - */ - public static final AddressLayout data$layout() { - return data$LAYOUT; - } - - private static final long data$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * const char32_t *data - * } - */ - public static final long data$offset() { - return data$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * const char32_t *data - * } - */ - public static MemorySegment data(MemorySegment struct) { - return struct.get(data$LAYOUT, data$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * const char32_t *data - * } - */ - public static void data(MemorySegment struct, MemorySegment fieldValue) { - struct.set(data$LAYOUT, data$OFFSET, fieldValue); - } - - private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final OfLong len$layout() { - return len$LAYOUT; - } - - private static final long len$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final long len$offset() { - return len$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static long len(MemorySegment struct) { - return struct.get(len$LAYOUT, len$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static void len(MemorySegment struct, long fieldValue) { - struct.set(len$LAYOUT, len$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF32Array.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF32Array.java deleted file mode 100644 index 3483f6970..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF32Array.java +++ /dev/null @@ -1,173 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct DiplomatF32Array { - * const float *data; - * size_t len; - * } - * } - */ -public class DiplomatF32Array { - - DiplomatF32Array() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_POINTER.withName("data"), - somelib_h.C_LONG.withName("len") - ).withName("DiplomatF32Array"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); - - /** - * Layout for field: - * {@snippet lang=c : - * const float *data - * } - */ - public static final AddressLayout data$layout() { - return data$LAYOUT; - } - - private static final long data$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * const float *data - * } - */ - public static final long data$offset() { - return data$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * const float *data - * } - */ - public static MemorySegment data(MemorySegment struct) { - return struct.get(data$LAYOUT, data$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * const float *data - * } - */ - public static void data(MemorySegment struct, MemorySegment fieldValue) { - struct.set(data$LAYOUT, data$OFFSET, fieldValue); - } - - private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final OfLong len$layout() { - return len$LAYOUT; - } - - private static final long len$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final long len$offset() { - return len$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static long len(MemorySegment struct) { - return struct.get(len$LAYOUT, len$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static void len(MemorySegment struct, long fieldValue) { - struct.set(len$LAYOUT, len$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF32View.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF32View.java deleted file mode 100644 index ef9439b3d..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF32View.java +++ /dev/null @@ -1,173 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct DiplomatF32View { - * const float *data; - * size_t len; - * } - * } - */ -public class DiplomatF32View { - - DiplomatF32View() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_POINTER.withName("data"), - somelib_h.C_LONG.withName("len") - ).withName("DiplomatF32View"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); - - /** - * Layout for field: - * {@snippet lang=c : - * const float *data - * } - */ - public static final AddressLayout data$layout() { - return data$LAYOUT; - } - - private static final long data$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * const float *data - * } - */ - public static final long data$offset() { - return data$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * const float *data - * } - */ - public static MemorySegment data(MemorySegment struct) { - return struct.get(data$LAYOUT, data$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * const float *data - * } - */ - public static void data(MemorySegment struct, MemorySegment fieldValue) { - struct.set(data$LAYOUT, data$OFFSET, fieldValue); - } - - private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final OfLong len$layout() { - return len$LAYOUT; - } - - private static final long len$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final long len$offset() { - return len$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static long len(MemorySegment struct) { - return struct.get(len$LAYOUT, len$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static void len(MemorySegment struct, long fieldValue) { - struct.set(len$LAYOUT, len$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF64Array.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF64Array.java deleted file mode 100644 index f31fa2fa2..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF64Array.java +++ /dev/null @@ -1,173 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct DiplomatF64Array { - * const double *data; - * size_t len; - * } - * } - */ -public class DiplomatF64Array { - - DiplomatF64Array() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_POINTER.withName("data"), - somelib_h.C_LONG.withName("len") - ).withName("DiplomatF64Array"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); - - /** - * Layout for field: - * {@snippet lang=c : - * const double *data - * } - */ - public static final AddressLayout data$layout() { - return data$LAYOUT; - } - - private static final long data$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * const double *data - * } - */ - public static final long data$offset() { - return data$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * const double *data - * } - */ - public static MemorySegment data(MemorySegment struct) { - return struct.get(data$LAYOUT, data$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * const double *data - * } - */ - public static void data(MemorySegment struct, MemorySegment fieldValue) { - struct.set(data$LAYOUT, data$OFFSET, fieldValue); - } - - private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final OfLong len$layout() { - return len$LAYOUT; - } - - private static final long len$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final long len$offset() { - return len$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static long len(MemorySegment struct) { - return struct.get(len$LAYOUT, len$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static void len(MemorySegment struct, long fieldValue) { - struct.set(len$LAYOUT, len$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF64View.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF64View.java deleted file mode 100644 index d1960966d..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatF64View.java +++ /dev/null @@ -1,173 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct DiplomatF64View { - * const double *data; - * size_t len; - * } - * } - */ -public class DiplomatF64View { - - DiplomatF64View() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_POINTER.withName("data"), - somelib_h.C_LONG.withName("len") - ).withName("DiplomatF64View"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); - - /** - * Layout for field: - * {@snippet lang=c : - * const double *data - * } - */ - public static final AddressLayout data$layout() { - return data$LAYOUT; - } - - private static final long data$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * const double *data - * } - */ - public static final long data$offset() { - return data$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * const double *data - * } - */ - public static MemorySegment data(MemorySegment struct) { - return struct.get(data$LAYOUT, data$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * const double *data - * } - */ - public static void data(MemorySegment struct, MemorySegment fieldValue) { - struct.set(data$LAYOUT, data$OFFSET, fieldValue); - } - - private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final OfLong len$layout() { - return len$LAYOUT; - } - - private static final long len$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final long len$offset() { - return len$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static long len(MemorySegment struct) { - return struct.get(len$LAYOUT, len$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static void len(MemorySegment struct, long fieldValue) { - struct.set(len$LAYOUT, len$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI16Array.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI16Array.java deleted file mode 100644 index 08f04934b..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI16Array.java +++ /dev/null @@ -1,173 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct DiplomatI16Array { - * const int16_t *data; - * size_t len; - * } - * } - */ -public class DiplomatI16Array { - - DiplomatI16Array() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_POINTER.withName("data"), - somelib_h.C_LONG.withName("len") - ).withName("DiplomatI16Array"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); - - /** - * Layout for field: - * {@snippet lang=c : - * const int16_t *data - * } - */ - public static final AddressLayout data$layout() { - return data$LAYOUT; - } - - private static final long data$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * const int16_t *data - * } - */ - public static final long data$offset() { - return data$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * const int16_t *data - * } - */ - public static MemorySegment data(MemorySegment struct) { - return struct.get(data$LAYOUT, data$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * const int16_t *data - * } - */ - public static void data(MemorySegment struct, MemorySegment fieldValue) { - struct.set(data$LAYOUT, data$OFFSET, fieldValue); - } - - private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final OfLong len$layout() { - return len$LAYOUT; - } - - private static final long len$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final long len$offset() { - return len$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static long len(MemorySegment struct) { - return struct.get(len$LAYOUT, len$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static void len(MemorySegment struct, long fieldValue) { - struct.set(len$LAYOUT, len$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI16View.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI16View.java deleted file mode 100644 index 265552cd6..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI16View.java +++ /dev/null @@ -1,173 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct DiplomatI16View { - * const int16_t *data; - * size_t len; - * } - * } - */ -public class DiplomatI16View { - - DiplomatI16View() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_POINTER.withName("data"), - somelib_h.C_LONG.withName("len") - ).withName("DiplomatI16View"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); - - /** - * Layout for field: - * {@snippet lang=c : - * const int16_t *data - * } - */ - public static final AddressLayout data$layout() { - return data$LAYOUT; - } - - private static final long data$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * const int16_t *data - * } - */ - public static final long data$offset() { - return data$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * const int16_t *data - * } - */ - public static MemorySegment data(MemorySegment struct) { - return struct.get(data$LAYOUT, data$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * const int16_t *data - * } - */ - public static void data(MemorySegment struct, MemorySegment fieldValue) { - struct.set(data$LAYOUT, data$OFFSET, fieldValue); - } - - private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final OfLong len$layout() { - return len$LAYOUT; - } - - private static final long len$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final long len$offset() { - return len$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static long len(MemorySegment struct) { - return struct.get(len$LAYOUT, len$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static void len(MemorySegment struct, long fieldValue) { - struct.set(len$LAYOUT, len$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI32Array.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI32Array.java deleted file mode 100644 index a33abc59b..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI32Array.java +++ /dev/null @@ -1,173 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct DiplomatI32Array { - * const int32_t *data; - * size_t len; - * } - * } - */ -public class DiplomatI32Array { - - DiplomatI32Array() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_POINTER.withName("data"), - somelib_h.C_LONG.withName("len") - ).withName("DiplomatI32Array"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); - - /** - * Layout for field: - * {@snippet lang=c : - * const int32_t *data - * } - */ - public static final AddressLayout data$layout() { - return data$LAYOUT; - } - - private static final long data$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * const int32_t *data - * } - */ - public static final long data$offset() { - return data$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * const int32_t *data - * } - */ - public static MemorySegment data(MemorySegment struct) { - return struct.get(data$LAYOUT, data$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * const int32_t *data - * } - */ - public static void data(MemorySegment struct, MemorySegment fieldValue) { - struct.set(data$LAYOUT, data$OFFSET, fieldValue); - } - - private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final OfLong len$layout() { - return len$LAYOUT; - } - - private static final long len$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final long len$offset() { - return len$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static long len(MemorySegment struct) { - return struct.get(len$LAYOUT, len$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static void len(MemorySegment struct, long fieldValue) { - struct.set(len$LAYOUT, len$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI32View.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI32View.java deleted file mode 100644 index d5c0eff9f..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI32View.java +++ /dev/null @@ -1,173 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct DiplomatI32View { - * const int32_t *data; - * size_t len; - * } - * } - */ -public class DiplomatI32View { - - DiplomatI32View() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_POINTER.withName("data"), - somelib_h.C_LONG.withName("len") - ).withName("DiplomatI32View"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); - - /** - * Layout for field: - * {@snippet lang=c : - * const int32_t *data - * } - */ - public static final AddressLayout data$layout() { - return data$LAYOUT; - } - - private static final long data$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * const int32_t *data - * } - */ - public static final long data$offset() { - return data$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * const int32_t *data - * } - */ - public static MemorySegment data(MemorySegment struct) { - return struct.get(data$LAYOUT, data$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * const int32_t *data - * } - */ - public static void data(MemorySegment struct, MemorySegment fieldValue) { - struct.set(data$LAYOUT, data$OFFSET, fieldValue); - } - - private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final OfLong len$layout() { - return len$LAYOUT; - } - - private static final long len$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final long len$offset() { - return len$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static long len(MemorySegment struct) { - return struct.get(len$LAYOUT, len$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static void len(MemorySegment struct, long fieldValue) { - struct.set(len$LAYOUT, len$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI64Array.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI64Array.java deleted file mode 100644 index db760366f..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI64Array.java +++ /dev/null @@ -1,173 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct DiplomatI64Array { - * const int64_t *data; - * size_t len; - * } - * } - */ -public class DiplomatI64Array { - - DiplomatI64Array() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_POINTER.withName("data"), - somelib_h.C_LONG.withName("len") - ).withName("DiplomatI64Array"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); - - /** - * Layout for field: - * {@snippet lang=c : - * const int64_t *data - * } - */ - public static final AddressLayout data$layout() { - return data$LAYOUT; - } - - private static final long data$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * const int64_t *data - * } - */ - public static final long data$offset() { - return data$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * const int64_t *data - * } - */ - public static MemorySegment data(MemorySegment struct) { - return struct.get(data$LAYOUT, data$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * const int64_t *data - * } - */ - public static void data(MemorySegment struct, MemorySegment fieldValue) { - struct.set(data$LAYOUT, data$OFFSET, fieldValue); - } - - private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final OfLong len$layout() { - return len$LAYOUT; - } - - private static final long len$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final long len$offset() { - return len$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static long len(MemorySegment struct) { - return struct.get(len$LAYOUT, len$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static void len(MemorySegment struct, long fieldValue) { - struct.set(len$LAYOUT, len$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI64View.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI64View.java deleted file mode 100644 index 2ae01c5e3..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI64View.java +++ /dev/null @@ -1,173 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct DiplomatI64View { - * const int64_t *data; - * size_t len; - * } - * } - */ -public class DiplomatI64View { - - DiplomatI64View() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_POINTER.withName("data"), - somelib_h.C_LONG.withName("len") - ).withName("DiplomatI64View"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); - - /** - * Layout for field: - * {@snippet lang=c : - * const int64_t *data - * } - */ - public static final AddressLayout data$layout() { - return data$LAYOUT; - } - - private static final long data$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * const int64_t *data - * } - */ - public static final long data$offset() { - return data$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * const int64_t *data - * } - */ - public static MemorySegment data(MemorySegment struct) { - return struct.get(data$LAYOUT, data$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * const int64_t *data - * } - */ - public static void data(MemorySegment struct, MemorySegment fieldValue) { - struct.set(data$LAYOUT, data$OFFSET, fieldValue); - } - - private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final OfLong len$layout() { - return len$LAYOUT; - } - - private static final long len$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final long len$offset() { - return len$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static long len(MemorySegment struct) { - return struct.get(len$LAYOUT, len$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static void len(MemorySegment struct, long fieldValue) { - struct.set(len$LAYOUT, len$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI8Array.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI8Array.java deleted file mode 100644 index cea362b51..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI8Array.java +++ /dev/null @@ -1,173 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct DiplomatI8Array { - * const int8_t *data; - * size_t len; - * } - * } - */ -public class DiplomatI8Array { - - DiplomatI8Array() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_POINTER.withName("data"), - somelib_h.C_LONG.withName("len") - ).withName("DiplomatI8Array"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); - - /** - * Layout for field: - * {@snippet lang=c : - * const int8_t *data - * } - */ - public static final AddressLayout data$layout() { - return data$LAYOUT; - } - - private static final long data$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * const int8_t *data - * } - */ - public static final long data$offset() { - return data$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * const int8_t *data - * } - */ - public static MemorySegment data(MemorySegment struct) { - return struct.get(data$LAYOUT, data$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * const int8_t *data - * } - */ - public static void data(MemorySegment struct, MemorySegment fieldValue) { - struct.set(data$LAYOUT, data$OFFSET, fieldValue); - } - - private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final OfLong len$layout() { - return len$LAYOUT; - } - - private static final long len$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final long len$offset() { - return len$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static long len(MemorySegment struct) { - return struct.get(len$LAYOUT, len$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static void len(MemorySegment struct, long fieldValue) { - struct.set(len$LAYOUT, len$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI8View.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI8View.java deleted file mode 100644 index c8240e123..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatI8View.java +++ /dev/null @@ -1,173 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct DiplomatI8View { - * const int8_t *data; - * size_t len; - * } - * } - */ -public class DiplomatI8View { - - DiplomatI8View() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_POINTER.withName("data"), - somelib_h.C_LONG.withName("len") - ).withName("DiplomatI8View"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); - - /** - * Layout for field: - * {@snippet lang=c : - * const int8_t *data - * } - */ - public static final AddressLayout data$layout() { - return data$LAYOUT; - } - - private static final long data$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * const int8_t *data - * } - */ - public static final long data$offset() { - return data$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * const int8_t *data - * } - */ - public static MemorySegment data(MemorySegment struct) { - return struct.get(data$LAYOUT, data$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * const int8_t *data - * } - */ - public static void data(MemorySegment struct, MemorySegment fieldValue) { - struct.set(data$LAYOUT, data$OFFSET, fieldValue); - } - - private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final OfLong len$layout() { - return len$LAYOUT; - } - - private static final long len$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final long len$offset() { - return len$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static long len(MemorySegment struct) { - return struct.get(len$LAYOUT, len$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static void len(MemorySegment struct, long fieldValue) { - struct.set(len$LAYOUT, len$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatIsizeArray.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatIsizeArray.java deleted file mode 100644 index 4e4b5a287..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatIsizeArray.java +++ /dev/null @@ -1,173 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct DiplomatIsizeArray { - * const intptr_t *data; - * size_t len; - * } - * } - */ -public class DiplomatIsizeArray { - - DiplomatIsizeArray() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_POINTER.withName("data"), - somelib_h.C_LONG.withName("len") - ).withName("DiplomatIsizeArray"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); - - /** - * Layout for field: - * {@snippet lang=c : - * const intptr_t *data - * } - */ - public static final AddressLayout data$layout() { - return data$LAYOUT; - } - - private static final long data$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * const intptr_t *data - * } - */ - public static final long data$offset() { - return data$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * const intptr_t *data - * } - */ - public static MemorySegment data(MemorySegment struct) { - return struct.get(data$LAYOUT, data$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * const intptr_t *data - * } - */ - public static void data(MemorySegment struct, MemorySegment fieldValue) { - struct.set(data$LAYOUT, data$OFFSET, fieldValue); - } - - private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final OfLong len$layout() { - return len$LAYOUT; - } - - private static final long len$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final long len$offset() { - return len$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static long len(MemorySegment struct) { - return struct.get(len$LAYOUT, len$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static void len(MemorySegment struct, long fieldValue) { - struct.set(len$LAYOUT, len$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatIsizeView.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatIsizeView.java deleted file mode 100644 index 953f1aacd..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatIsizeView.java +++ /dev/null @@ -1,173 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct DiplomatIsizeView { - * const intptr_t *data; - * size_t len; - * } - * } - */ -public class DiplomatIsizeView { - - DiplomatIsizeView() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_POINTER.withName("data"), - somelib_h.C_LONG.withName("len") - ).withName("DiplomatIsizeView"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); - - /** - * Layout for field: - * {@snippet lang=c : - * const intptr_t *data - * } - */ - public static final AddressLayout data$layout() { - return data$LAYOUT; - } - - private static final long data$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * const intptr_t *data - * } - */ - public static final long data$offset() { - return data$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * const intptr_t *data - * } - */ - public static MemorySegment data(MemorySegment struct) { - return struct.get(data$LAYOUT, data$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * const intptr_t *data - * } - */ - public static void data(MemorySegment struct, MemorySegment fieldValue) { - struct.set(data$LAYOUT, data$OFFSET, fieldValue); - } - - private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final OfLong len$layout() { - return len$LAYOUT; - } - - private static final long len$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final long len$offset() { - return len$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static long len(MemorySegment struct) { - return struct.get(len$LAYOUT, len$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static void len(MemorySegment struct, long fieldValue) { - struct.set(len$LAYOUT, len$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatString16Array.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatString16Array.java deleted file mode 100644 index d69cc5c7d..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatString16Array.java +++ /dev/null @@ -1,173 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct DiplomatString16Array { - * const char16_t *data; - * size_t len; - * } - * } - */ -public class DiplomatString16Array { - - DiplomatString16Array() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_POINTER.withName("data"), - somelib_h.C_LONG.withName("len") - ).withName("DiplomatString16Array"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); - - /** - * Layout for field: - * {@snippet lang=c : - * const char16_t *data - * } - */ - public static final AddressLayout data$layout() { - return data$LAYOUT; - } - - private static final long data$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * const char16_t *data - * } - */ - public static final long data$offset() { - return data$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * const char16_t *data - * } - */ - public static MemorySegment data(MemorySegment struct) { - return struct.get(data$LAYOUT, data$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * const char16_t *data - * } - */ - public static void data(MemorySegment struct, MemorySegment fieldValue) { - struct.set(data$LAYOUT, data$OFFSET, fieldValue); - } - - private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final OfLong len$layout() { - return len$LAYOUT; - } - - private static final long len$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final long len$offset() { - return len$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static long len(MemorySegment struct) { - return struct.get(len$LAYOUT, len$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static void len(MemorySegment struct, long fieldValue) { - struct.set(len$LAYOUT, len$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatString16View.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatString16View.java deleted file mode 100644 index 192de994e..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatString16View.java +++ /dev/null @@ -1,173 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct DiplomatString16View { - * const char16_t *data; - * size_t len; - * } - * } - */ -public class DiplomatString16View { - - DiplomatString16View() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_POINTER.withName("data"), - somelib_h.C_LONG.withName("len") - ).withName("DiplomatString16View"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); - - /** - * Layout for field: - * {@snippet lang=c : - * const char16_t *data - * } - */ - public static final AddressLayout data$layout() { - return data$LAYOUT; - } - - private static final long data$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * const char16_t *data - * } - */ - public static final long data$offset() { - return data$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * const char16_t *data - * } - */ - public static MemorySegment data(MemorySegment struct) { - return struct.get(data$LAYOUT, data$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * const char16_t *data - * } - */ - public static void data(MemorySegment struct, MemorySegment fieldValue) { - struct.set(data$LAYOUT, data$OFFSET, fieldValue); - } - - private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final OfLong len$layout() { - return len$LAYOUT; - } - - private static final long len$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final long len$offset() { - return len$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static long len(MemorySegment struct) { - return struct.get(len$LAYOUT, len$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static void len(MemorySegment struct, long fieldValue) { - struct.set(len$LAYOUT, len$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringArray.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringArray.java deleted file mode 100644 index d7aa9f6ff..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringArray.java +++ /dev/null @@ -1,173 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct DiplomatStringArray { - * const char *data; - * size_t len; - * } - * } - */ -public class DiplomatStringArray { - - DiplomatStringArray() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_POINTER.withName("data"), - somelib_h.C_LONG.withName("len") - ).withName("DiplomatStringArray"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); - - /** - * Layout for field: - * {@snippet lang=c : - * const char *data - * } - */ - public static final AddressLayout data$layout() { - return data$LAYOUT; - } - - private static final long data$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * const char *data - * } - */ - public static final long data$offset() { - return data$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * const char *data - * } - */ - public static MemorySegment data(MemorySegment struct) { - return struct.get(data$LAYOUT, data$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * const char *data - * } - */ - public static void data(MemorySegment struct, MemorySegment fieldValue) { - struct.set(data$LAYOUT, data$OFFSET, fieldValue); - } - - private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final OfLong len$layout() { - return len$LAYOUT; - } - - private static final long len$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final long len$offset() { - return len$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static long len(MemorySegment struct) { - return struct.get(len$LAYOUT, len$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static void len(MemorySegment struct, long fieldValue) { - struct.set(len$LAYOUT, len$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringView.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringView.java deleted file mode 100644 index 185d5aff6..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringView.java +++ /dev/null @@ -1,173 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct DiplomatStringView { - * const char *data; - * size_t len; - * } - * } - */ -public class DiplomatStringView { - - DiplomatStringView() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_POINTER.withName("data"), - somelib_h.C_LONG.withName("len") - ).withName("DiplomatStringView"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); - - /** - * Layout for field: - * {@snippet lang=c : - * const char *data - * } - */ - public static final AddressLayout data$layout() { - return data$LAYOUT; - } - - private static final long data$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * const char *data - * } - */ - public static final long data$offset() { - return data$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * const char *data - * } - */ - public static MemorySegment data(MemorySegment struct) { - return struct.get(data$LAYOUT, data$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * const char *data - * } - */ - public static void data(MemorySegment struct, MemorySegment fieldValue) { - struct.set(data$LAYOUT, data$OFFSET, fieldValue); - } - - private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final OfLong len$layout() { - return len$LAYOUT; - } - - private static final long len$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final long len$offset() { - return len$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static long len(MemorySegment struct) { - return struct.get(len$LAYOUT, len$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static void len(MemorySegment struct, long fieldValue) { - struct.set(len$LAYOUT, len$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStrings16Array.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStrings16Array.java deleted file mode 100644 index b2c9354d1..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStrings16Array.java +++ /dev/null @@ -1,173 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct DiplomatStrings16Array { - * const DiplomatString16View *data; - * size_t len; - * } - * } - */ -public class DiplomatStrings16Array { - - DiplomatStrings16Array() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_POINTER.withName("data"), - somelib_h.C_LONG.withName("len") - ).withName("DiplomatStrings16Array"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); - - /** - * Layout for field: - * {@snippet lang=c : - * const DiplomatString16View *data - * } - */ - public static final AddressLayout data$layout() { - return data$LAYOUT; - } - - private static final long data$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * const DiplomatString16View *data - * } - */ - public static final long data$offset() { - return data$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * const DiplomatString16View *data - * } - */ - public static MemorySegment data(MemorySegment struct) { - return struct.get(data$LAYOUT, data$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * const DiplomatString16View *data - * } - */ - public static void data(MemorySegment struct, MemorySegment fieldValue) { - struct.set(data$LAYOUT, data$OFFSET, fieldValue); - } - - private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final OfLong len$layout() { - return len$LAYOUT; - } - - private static final long len$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final long len$offset() { - return len$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static long len(MemorySegment struct) { - return struct.get(len$LAYOUT, len$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static void len(MemorySegment struct, long fieldValue) { - struct.set(len$LAYOUT, len$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStrings16View.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStrings16View.java deleted file mode 100644 index 3e10bbeba..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStrings16View.java +++ /dev/null @@ -1,173 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct DiplomatStrings16View { - * const DiplomatString16View *data; - * size_t len; - * } - * } - */ -public class DiplomatStrings16View { - - DiplomatStrings16View() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_POINTER.withName("data"), - somelib_h.C_LONG.withName("len") - ).withName("DiplomatStrings16View"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); - - /** - * Layout for field: - * {@snippet lang=c : - * const DiplomatString16View *data - * } - */ - public static final AddressLayout data$layout() { - return data$LAYOUT; - } - - private static final long data$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * const DiplomatString16View *data - * } - */ - public static final long data$offset() { - return data$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * const DiplomatString16View *data - * } - */ - public static MemorySegment data(MemorySegment struct) { - return struct.get(data$LAYOUT, data$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * const DiplomatString16View *data - * } - */ - public static void data(MemorySegment struct, MemorySegment fieldValue) { - struct.set(data$LAYOUT, data$OFFSET, fieldValue); - } - - private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final OfLong len$layout() { - return len$LAYOUT; - } - - private static final long len$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final long len$offset() { - return len$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static long len(MemorySegment struct) { - return struct.get(len$LAYOUT, len$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static void len(MemorySegment struct, long fieldValue) { - struct.set(len$LAYOUT, len$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringsArray.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringsArray.java deleted file mode 100644 index bef36d353..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringsArray.java +++ /dev/null @@ -1,173 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct DiplomatStringsArray { - * const DiplomatStringView *data; - * size_t len; - * } - * } - */ -public class DiplomatStringsArray { - - DiplomatStringsArray() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_POINTER.withName("data"), - somelib_h.C_LONG.withName("len") - ).withName("DiplomatStringsArray"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); - - /** - * Layout for field: - * {@snippet lang=c : - * const DiplomatStringView *data - * } - */ - public static final AddressLayout data$layout() { - return data$LAYOUT; - } - - private static final long data$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * const DiplomatStringView *data - * } - */ - public static final long data$offset() { - return data$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * const DiplomatStringView *data - * } - */ - public static MemorySegment data(MemorySegment struct) { - return struct.get(data$LAYOUT, data$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * const DiplomatStringView *data - * } - */ - public static void data(MemorySegment struct, MemorySegment fieldValue) { - struct.set(data$LAYOUT, data$OFFSET, fieldValue); - } - - private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final OfLong len$layout() { - return len$LAYOUT; - } - - private static final long len$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final long len$offset() { - return len$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static long len(MemorySegment struct) { - return struct.get(len$LAYOUT, len$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static void len(MemorySegment struct, long fieldValue) { - struct.set(len$LAYOUT, len$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringsView.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringsView.java deleted file mode 100644 index 9e16e26b7..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatStringsView.java +++ /dev/null @@ -1,173 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct DiplomatStringsView { - * const DiplomatStringView *data; - * size_t len; - * } - * } - */ -public class DiplomatStringsView { - - DiplomatStringsView() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_POINTER.withName("data"), - somelib_h.C_LONG.withName("len") - ).withName("DiplomatStringsView"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); - - /** - * Layout for field: - * {@snippet lang=c : - * const DiplomatStringView *data - * } - */ - public static final AddressLayout data$layout() { - return data$LAYOUT; - } - - private static final long data$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * const DiplomatStringView *data - * } - */ - public static final long data$offset() { - return data$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * const DiplomatStringView *data - * } - */ - public static MemorySegment data(MemorySegment struct) { - return struct.get(data$LAYOUT, data$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * const DiplomatStringView *data - * } - */ - public static void data(MemorySegment struct, MemorySegment fieldValue) { - struct.set(data$LAYOUT, data$OFFSET, fieldValue); - } - - private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final OfLong len$layout() { - return len$LAYOUT; - } - - private static final long len$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final long len$offset() { - return len$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static long len(MemorySegment struct) { - return struct.get(len$LAYOUT, len$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static void len(MemorySegment struct, long fieldValue) { - struct.set(len$LAYOUT, len$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU16Array.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU16Array.java deleted file mode 100644 index 482eea704..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU16Array.java +++ /dev/null @@ -1,173 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct DiplomatU16Array { - * const uint16_t *data; - * size_t len; - * } - * } - */ -public class DiplomatU16Array { - - DiplomatU16Array() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_POINTER.withName("data"), - somelib_h.C_LONG.withName("len") - ).withName("DiplomatU16Array"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); - - /** - * Layout for field: - * {@snippet lang=c : - * const uint16_t *data - * } - */ - public static final AddressLayout data$layout() { - return data$LAYOUT; - } - - private static final long data$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * const uint16_t *data - * } - */ - public static final long data$offset() { - return data$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * const uint16_t *data - * } - */ - public static MemorySegment data(MemorySegment struct) { - return struct.get(data$LAYOUT, data$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * const uint16_t *data - * } - */ - public static void data(MemorySegment struct, MemorySegment fieldValue) { - struct.set(data$LAYOUT, data$OFFSET, fieldValue); - } - - private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final OfLong len$layout() { - return len$LAYOUT; - } - - private static final long len$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final long len$offset() { - return len$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static long len(MemorySegment struct) { - return struct.get(len$LAYOUT, len$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static void len(MemorySegment struct, long fieldValue) { - struct.set(len$LAYOUT, len$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU16View.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU16View.java deleted file mode 100644 index a8c75ea49..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU16View.java +++ /dev/null @@ -1,173 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct DiplomatU16View { - * const uint16_t *data; - * size_t len; - * } - * } - */ -public class DiplomatU16View { - - DiplomatU16View() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_POINTER.withName("data"), - somelib_h.C_LONG.withName("len") - ).withName("DiplomatU16View"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); - - /** - * Layout for field: - * {@snippet lang=c : - * const uint16_t *data - * } - */ - public static final AddressLayout data$layout() { - return data$LAYOUT; - } - - private static final long data$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * const uint16_t *data - * } - */ - public static final long data$offset() { - return data$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * const uint16_t *data - * } - */ - public static MemorySegment data(MemorySegment struct) { - return struct.get(data$LAYOUT, data$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * const uint16_t *data - * } - */ - public static void data(MemorySegment struct, MemorySegment fieldValue) { - struct.set(data$LAYOUT, data$OFFSET, fieldValue); - } - - private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final OfLong len$layout() { - return len$LAYOUT; - } - - private static final long len$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final long len$offset() { - return len$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static long len(MemorySegment struct) { - return struct.get(len$LAYOUT, len$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static void len(MemorySegment struct, long fieldValue) { - struct.set(len$LAYOUT, len$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU32Array.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU32Array.java deleted file mode 100644 index 8ecc93d8b..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU32Array.java +++ /dev/null @@ -1,173 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct DiplomatU32Array { - * const uint32_t *data; - * size_t len; - * } - * } - */ -public class DiplomatU32Array { - - DiplomatU32Array() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_POINTER.withName("data"), - somelib_h.C_LONG.withName("len") - ).withName("DiplomatU32Array"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); - - /** - * Layout for field: - * {@snippet lang=c : - * const uint32_t *data - * } - */ - public static final AddressLayout data$layout() { - return data$LAYOUT; - } - - private static final long data$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * const uint32_t *data - * } - */ - public static final long data$offset() { - return data$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * const uint32_t *data - * } - */ - public static MemorySegment data(MemorySegment struct) { - return struct.get(data$LAYOUT, data$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * const uint32_t *data - * } - */ - public static void data(MemorySegment struct, MemorySegment fieldValue) { - struct.set(data$LAYOUT, data$OFFSET, fieldValue); - } - - private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final OfLong len$layout() { - return len$LAYOUT; - } - - private static final long len$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final long len$offset() { - return len$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static long len(MemorySegment struct) { - return struct.get(len$LAYOUT, len$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static void len(MemorySegment struct, long fieldValue) { - struct.set(len$LAYOUT, len$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU32View.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU32View.java deleted file mode 100644 index 5b0e57b04..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU32View.java +++ /dev/null @@ -1,173 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct DiplomatU32View { - * const uint32_t *data; - * size_t len; - * } - * } - */ -public class DiplomatU32View { - - DiplomatU32View() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_POINTER.withName("data"), - somelib_h.C_LONG.withName("len") - ).withName("DiplomatU32View"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); - - /** - * Layout for field: - * {@snippet lang=c : - * const uint32_t *data - * } - */ - public static final AddressLayout data$layout() { - return data$LAYOUT; - } - - private static final long data$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * const uint32_t *data - * } - */ - public static final long data$offset() { - return data$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * const uint32_t *data - * } - */ - public static MemorySegment data(MemorySegment struct) { - return struct.get(data$LAYOUT, data$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * const uint32_t *data - * } - */ - public static void data(MemorySegment struct, MemorySegment fieldValue) { - struct.set(data$LAYOUT, data$OFFSET, fieldValue); - } - - private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final OfLong len$layout() { - return len$LAYOUT; - } - - private static final long len$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final long len$offset() { - return len$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static long len(MemorySegment struct) { - return struct.get(len$LAYOUT, len$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static void len(MemorySegment struct, long fieldValue) { - struct.set(len$LAYOUT, len$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU64Array.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU64Array.java deleted file mode 100644 index 5b407a970..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU64Array.java +++ /dev/null @@ -1,173 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct DiplomatU64Array { - * const uint64_t *data; - * size_t len; - * } - * } - */ -public class DiplomatU64Array { - - DiplomatU64Array() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_POINTER.withName("data"), - somelib_h.C_LONG.withName("len") - ).withName("DiplomatU64Array"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); - - /** - * Layout for field: - * {@snippet lang=c : - * const uint64_t *data - * } - */ - public static final AddressLayout data$layout() { - return data$LAYOUT; - } - - private static final long data$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * const uint64_t *data - * } - */ - public static final long data$offset() { - return data$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * const uint64_t *data - * } - */ - public static MemorySegment data(MemorySegment struct) { - return struct.get(data$LAYOUT, data$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * const uint64_t *data - * } - */ - public static void data(MemorySegment struct, MemorySegment fieldValue) { - struct.set(data$LAYOUT, data$OFFSET, fieldValue); - } - - private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final OfLong len$layout() { - return len$LAYOUT; - } - - private static final long len$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final long len$offset() { - return len$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static long len(MemorySegment struct) { - return struct.get(len$LAYOUT, len$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static void len(MemorySegment struct, long fieldValue) { - struct.set(len$LAYOUT, len$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU64View.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU64View.java deleted file mode 100644 index 2ec76ae90..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU64View.java +++ /dev/null @@ -1,173 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct DiplomatU64View { - * const uint64_t *data; - * size_t len; - * } - * } - */ -public class DiplomatU64View { - - DiplomatU64View() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_POINTER.withName("data"), - somelib_h.C_LONG.withName("len") - ).withName("DiplomatU64View"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); - - /** - * Layout for field: - * {@snippet lang=c : - * const uint64_t *data - * } - */ - public static final AddressLayout data$layout() { - return data$LAYOUT; - } - - private static final long data$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * const uint64_t *data - * } - */ - public static final long data$offset() { - return data$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * const uint64_t *data - * } - */ - public static MemorySegment data(MemorySegment struct) { - return struct.get(data$LAYOUT, data$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * const uint64_t *data - * } - */ - public static void data(MemorySegment struct, MemorySegment fieldValue) { - struct.set(data$LAYOUT, data$OFFSET, fieldValue); - } - - private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final OfLong len$layout() { - return len$LAYOUT; - } - - private static final long len$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final long len$offset() { - return len$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static long len(MemorySegment struct) { - return struct.get(len$LAYOUT, len$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static void len(MemorySegment struct, long fieldValue) { - struct.set(len$LAYOUT, len$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU8Array.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU8Array.java deleted file mode 100644 index 66872b949..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU8Array.java +++ /dev/null @@ -1,173 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct DiplomatU8Array { - * const uint8_t *data; - * size_t len; - * } - * } - */ -public class DiplomatU8Array { - - DiplomatU8Array() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_POINTER.withName("data"), - somelib_h.C_LONG.withName("len") - ).withName("DiplomatU8Array"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); - - /** - * Layout for field: - * {@snippet lang=c : - * const uint8_t *data - * } - */ - public static final AddressLayout data$layout() { - return data$LAYOUT; - } - - private static final long data$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * const uint8_t *data - * } - */ - public static final long data$offset() { - return data$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * const uint8_t *data - * } - */ - public static MemorySegment data(MemorySegment struct) { - return struct.get(data$LAYOUT, data$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * const uint8_t *data - * } - */ - public static void data(MemorySegment struct, MemorySegment fieldValue) { - struct.set(data$LAYOUT, data$OFFSET, fieldValue); - } - - private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final OfLong len$layout() { - return len$LAYOUT; - } - - private static final long len$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final long len$offset() { - return len$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static long len(MemorySegment struct) { - return struct.get(len$LAYOUT, len$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static void len(MemorySegment struct, long fieldValue) { - struct.set(len$LAYOUT, len$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU8View.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU8View.java deleted file mode 100644 index 3c6671156..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatU8View.java +++ /dev/null @@ -1,173 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct DiplomatU8View { - * const uint8_t *data; - * size_t len; - * } - * } - */ -public class DiplomatU8View { - - DiplomatU8View() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_POINTER.withName("data"), - somelib_h.C_LONG.withName("len") - ).withName("DiplomatU8View"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); - - /** - * Layout for field: - * {@snippet lang=c : - * const uint8_t *data - * } - */ - public static final AddressLayout data$layout() { - return data$LAYOUT; - } - - private static final long data$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * const uint8_t *data - * } - */ - public static final long data$offset() { - return data$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * const uint8_t *data - * } - */ - public static MemorySegment data(MemorySegment struct) { - return struct.get(data$LAYOUT, data$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * const uint8_t *data - * } - */ - public static void data(MemorySegment struct, MemorySegment fieldValue) { - struct.set(data$LAYOUT, data$OFFSET, fieldValue); - } - - private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final OfLong len$layout() { - return len$LAYOUT; - } - - private static final long len$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final long len$offset() { - return len$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static long len(MemorySegment struct) { - return struct.get(len$LAYOUT, len$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static void len(MemorySegment struct, long fieldValue) { - struct.set(len$LAYOUT, len$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatUsizeArray.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatUsizeArray.java deleted file mode 100644 index 21b119c6a..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatUsizeArray.java +++ /dev/null @@ -1,173 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct DiplomatUsizeArray { - * const size_t *data; - * size_t len; - * } - * } - */ -public class DiplomatUsizeArray { - - DiplomatUsizeArray() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_POINTER.withName("data"), - somelib_h.C_LONG.withName("len") - ).withName("DiplomatUsizeArray"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); - - /** - * Layout for field: - * {@snippet lang=c : - * const size_t *data - * } - */ - public static final AddressLayout data$layout() { - return data$LAYOUT; - } - - private static final long data$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * const size_t *data - * } - */ - public static final long data$offset() { - return data$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * const size_t *data - * } - */ - public static MemorySegment data(MemorySegment struct) { - return struct.get(data$LAYOUT, data$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * const size_t *data - * } - */ - public static void data(MemorySegment struct, MemorySegment fieldValue) { - struct.set(data$LAYOUT, data$OFFSET, fieldValue); - } - - private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final OfLong len$layout() { - return len$LAYOUT; - } - - private static final long len$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final long len$offset() { - return len$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static long len(MemorySegment struct) { - return struct.get(len$LAYOUT, len$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static void len(MemorySegment struct, long fieldValue) { - struct.set(len$LAYOUT, len$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatUsizeView.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatUsizeView.java deleted file mode 100644 index ba9b410d6..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatUsizeView.java +++ /dev/null @@ -1,173 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct DiplomatUsizeView { - * const size_t *data; - * size_t len; - * } - * } - */ -public class DiplomatUsizeView { - - DiplomatUsizeView() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_POINTER.withName("data"), - somelib_h.C_LONG.withName("len") - ).withName("DiplomatUsizeView"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); - - /** - * Layout for field: - * {@snippet lang=c : - * const size_t *data - * } - */ - public static final AddressLayout data$layout() { - return data$LAYOUT; - } - - private static final long data$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * const size_t *data - * } - */ - public static final long data$offset() { - return data$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * const size_t *data - * } - */ - public static MemorySegment data(MemorySegment struct) { - return struct.get(data$LAYOUT, data$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * const size_t *data - * } - */ - public static void data(MemorySegment struct, MemorySegment fieldValue) { - struct.set(data$LAYOUT, data$OFFSET, fieldValue); - } - - private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final OfLong len$layout() { - return len$LAYOUT; - } - - private static final long len$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final long len$offset() { - return len$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static long len(MemorySegment struct) { - return struct.get(len$LAYOUT, len$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static void len(MemorySegment struct, long fieldValue) { - struct.set(len$LAYOUT, len$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatWrite.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatWrite.java deleted file mode 100644 index 6da2825dd..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/DiplomatWrite.java +++ /dev/null @@ -1,512 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct DiplomatWrite { - * void *context; - * char *buf; - * size_t len; - * size_t cap; - * bool grow_failed; - * void (*flush)(struct DiplomatWrite *); - * bool (*grow)(struct DiplomatWrite *, size_t); - * } - * } - */ -public class DiplomatWrite { - - DiplomatWrite() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_POINTER.withName("context"), - somelib_h.C_POINTER.withName("buf"), - somelib_h.C_LONG.withName("len"), - somelib_h.C_LONG.withName("cap"), - somelib_h.C_BOOL.withName("grow_failed"), - MemoryLayout.paddingLayout(7), - somelib_h.C_POINTER.withName("flush"), - somelib_h.C_POINTER.withName("grow") - ).withName("DiplomatWrite"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout context$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("context")); - - /** - * Layout for field: - * {@snippet lang=c : - * void *context - * } - */ - public static final AddressLayout context$layout() { - return context$LAYOUT; - } - - private static final long context$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * void *context - * } - */ - public static final long context$offset() { - return context$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * void *context - * } - */ - public static MemorySegment context(MemorySegment struct) { - return struct.get(context$LAYOUT, context$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * void *context - * } - */ - public static void context(MemorySegment struct, MemorySegment fieldValue) { - struct.set(context$LAYOUT, context$OFFSET, fieldValue); - } - - private static final AddressLayout buf$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("buf")); - - /** - * Layout for field: - * {@snippet lang=c : - * char *buf - * } - */ - public static final AddressLayout buf$layout() { - return buf$LAYOUT; - } - - private static final long buf$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * char *buf - * } - */ - public static final long buf$offset() { - return buf$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * char *buf - * } - */ - public static MemorySegment buf(MemorySegment struct) { - return struct.get(buf$LAYOUT, buf$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * char *buf - * } - */ - public static void buf(MemorySegment struct, MemorySegment fieldValue) { - struct.set(buf$LAYOUT, buf$OFFSET, fieldValue); - } - - private static final OfLong len$LAYOUT = (OfLong)$LAYOUT.select(groupElement("len")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final OfLong len$layout() { - return len$LAYOUT; - } - - private static final long len$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static final long len$offset() { - return len$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static long len(MemorySegment struct) { - return struct.get(len$LAYOUT, len$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t len - * } - */ - public static void len(MemorySegment struct, long fieldValue) { - struct.set(len$LAYOUT, len$OFFSET, fieldValue); - } - - private static final OfLong cap$LAYOUT = (OfLong)$LAYOUT.select(groupElement("cap")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t cap - * } - */ - public static final OfLong cap$layout() { - return cap$LAYOUT; - } - - private static final long cap$OFFSET = 24; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t cap - * } - */ - public static final long cap$offset() { - return cap$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t cap - * } - */ - public static long cap(MemorySegment struct) { - return struct.get(cap$LAYOUT, cap$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t cap - * } - */ - public static void cap(MemorySegment struct, long fieldValue) { - struct.set(cap$LAYOUT, cap$OFFSET, fieldValue); - } - - private static final OfBoolean grow_failed$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("grow_failed")); - - /** - * Layout for field: - * {@snippet lang=c : - * bool grow_failed - * } - */ - public static final OfBoolean grow_failed$layout() { - return grow_failed$LAYOUT; - } - - private static final long grow_failed$OFFSET = 32; - - /** - * Offset for field: - * {@snippet lang=c : - * bool grow_failed - * } - */ - public static final long grow_failed$offset() { - return grow_failed$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * bool grow_failed - * } - */ - public static boolean grow_failed(MemorySegment struct) { - return struct.get(grow_failed$LAYOUT, grow_failed$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * bool grow_failed - * } - */ - public static void grow_failed(MemorySegment struct, boolean fieldValue) { - struct.set(grow_failed$LAYOUT, grow_failed$OFFSET, fieldValue); - } - - /** - * {@snippet lang=c : - * void (*flush)(struct DiplomatWrite *) - * } - */ - public static class flush { - - flush() { - // Should not be called directly - } - - /** - * The function pointer signature, expressed as a functional interface - */ - public interface Function { - void apply(MemorySegment _x0); - } - - private static final FunctionDescriptor $DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER - ); - - /** - * The descriptor of this function pointer - */ - public static FunctionDescriptor descriptor() { - return $DESC; - } - - private static final MethodHandle UP$MH = somelib_h.upcallHandle(flush.Function.class, "apply", $DESC); - - /** - * Allocates a new upcall stub, whose implementation is defined by {@code fi}. - * The lifetime of the returned segment is managed by {@code arena} - */ - public static MemorySegment allocate(flush.Function fi, Arena arena) { - return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena); - } - - private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC); - - /** - * Invoke the upcall stub {@code funcPtr}, with given parameters - */ - public static void invoke(MemorySegment funcPtr,MemorySegment _x0) { - try { - DOWN$MH.invokeExact(funcPtr, _x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - } - - private static final AddressLayout flush$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("flush")); - - /** - * Layout for field: - * {@snippet lang=c : - * void (*flush)(struct DiplomatWrite *) - * } - */ - public static final AddressLayout flush$layout() { - return flush$LAYOUT; - } - - private static final long flush$OFFSET = 40; - - /** - * Offset for field: - * {@snippet lang=c : - * void (*flush)(struct DiplomatWrite *) - * } - */ - public static final long flush$offset() { - return flush$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * void (*flush)(struct DiplomatWrite *) - * } - */ - public static MemorySegment flush(MemorySegment struct) { - return struct.get(flush$LAYOUT, flush$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * void (*flush)(struct DiplomatWrite *) - * } - */ - public static void flush(MemorySegment struct, MemorySegment fieldValue) { - struct.set(flush$LAYOUT, flush$OFFSET, fieldValue); - } - - /** - * {@snippet lang=c : - * bool (*grow)(struct DiplomatWrite *, size_t) - * } - */ - public static class grow { - - grow() { - // Should not be called directly - } - - /** - * The function pointer signature, expressed as a functional interface - */ - public interface Function { - boolean apply(MemorySegment _x0, long _x1); - } - - private static final FunctionDescriptor $DESC = FunctionDescriptor.of( - somelib_h.C_BOOL, - somelib_h.C_POINTER, - somelib_h.C_LONG - ); - - /** - * The descriptor of this function pointer - */ - public static FunctionDescriptor descriptor() { - return $DESC; - } - - private static final MethodHandle UP$MH = somelib_h.upcallHandle(grow.Function.class, "apply", $DESC); - - /** - * Allocates a new upcall stub, whose implementation is defined by {@code fi}. - * The lifetime of the returned segment is managed by {@code arena} - */ - public static MemorySegment allocate(grow.Function fi, Arena arena) { - return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena); - } - - private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC); - - /** - * Invoke the upcall stub {@code funcPtr}, with given parameters - */ - public static boolean invoke(MemorySegment funcPtr,MemorySegment _x0, long _x1) { - try { - return (boolean) DOWN$MH.invokeExact(funcPtr, _x0, _x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - } - - private static final AddressLayout grow$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("grow")); - - /** - * Layout for field: - * {@snippet lang=c : - * bool (*grow)(struct DiplomatWrite *, size_t) - * } - */ - public static final AddressLayout grow$layout() { - return grow$LAYOUT; - } - - private static final long grow$OFFSET = 48; - - /** - * Offset for field: - * {@snippet lang=c : - * bool (*grow)(struct DiplomatWrite *, size_t) - * } - */ - public static final long grow$offset() { - return grow$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * bool (*grow)(struct DiplomatWrite *, size_t) - * } - */ - public static MemorySegment grow(MemorySegment struct) { - return struct.get(grow$LAYOUT, grow$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * bool (*grow)(struct DiplomatWrite *, size_t) - * } - */ - public static void grow(MemorySegment struct, MemorySegment fieldValue) { - struct.set(grow$LAYOUT, grow$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/FILE.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/FILE.java deleted file mode 100644 index c73dc11c2..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/FILE.java +++ /dev/null @@ -1,47 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * typedef struct __sFILE { - * unsigned char *_p; - * int _r; - * int _w; - * short _flags; - * short _file; - * struct __sbuf _bf; - * int _lbfsize; - * void *_cookie; - * int (* _Nullable _close)(void *); - * int (* _Nullable _read)(void *, char *, int); - * fpos_t (* _Nullable _seek)(void *, fpos_t, int); - * int (* _Nullable _write)(void *, const char *, int); - * struct __sbuf _ub; - * struct __sFILEX *_extra; - * int _ur; - * unsigned char _ubuf[3]; - * unsigned char _nbuf[1]; - * struct __sbuf _lb; - * int _blksize; - * fpos_t _offset; - * } FILE - * } - */ -public class FILE extends __sFILE { - - FILE() { - // Should not be called directly - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/ICU4XDataProvider_returns_result_result.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/ICU4XDataProvider_returns_result_result.java deleted file mode 100644 index 19cbf6237..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/ICU4XDataProvider_returns_result_result.java +++ /dev/null @@ -1,127 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct ICU4XDataProvider_returns_result_result { - * bool is_ok; - * } - * } - */ -public class ICU4XDataProvider_returns_result_result { - - ICU4XDataProvider_returns_result_result() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_BOOL.withName("is_ok") - ).withName("ICU4XDataProvider_returns_result_result"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); - - /** - * Layout for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static final OfBoolean is_ok$layout() { - return is_ok$LAYOUT; - } - - private static final long is_ok$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static final long is_ok$offset() { - return is_ok$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static boolean is_ok(MemorySegment struct) { - return struct.get(is_ok$LAYOUT, is_ok$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static void is_ok(MemorySegment struct, boolean fieldValue) { - struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/ICU4XFixedDecimalFormatterOptions.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/ICU4XFixedDecimalFormatterOptions.java deleted file mode 100644 index ddb172209..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/ICU4XFixedDecimalFormatterOptions.java +++ /dev/null @@ -1,174 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct ICU4XFixedDecimalFormatterOptions { - * ICU4XFixedDecimalGroupingStrategy grouping_strategy; - * bool some_other_config; - * } - * } - */ -public class ICU4XFixedDecimalFormatterOptions { - - ICU4XFixedDecimalFormatterOptions() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_INT.withName("grouping_strategy"), - somelib_h.C_BOOL.withName("some_other_config"), - MemoryLayout.paddingLayout(3) - ).withName("ICU4XFixedDecimalFormatterOptions"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfInt grouping_strategy$LAYOUT = (OfInt)$LAYOUT.select(groupElement("grouping_strategy")); - - /** - * Layout for field: - * {@snippet lang=c : - * ICU4XFixedDecimalGroupingStrategy grouping_strategy - * } - */ - public static final OfInt grouping_strategy$layout() { - return grouping_strategy$LAYOUT; - } - - private static final long grouping_strategy$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * ICU4XFixedDecimalGroupingStrategy grouping_strategy - * } - */ - public static final long grouping_strategy$offset() { - return grouping_strategy$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * ICU4XFixedDecimalGroupingStrategy grouping_strategy - * } - */ - public static int grouping_strategy(MemorySegment struct) { - return struct.get(grouping_strategy$LAYOUT, grouping_strategy$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * ICU4XFixedDecimalGroupingStrategy grouping_strategy - * } - */ - public static void grouping_strategy(MemorySegment struct, int fieldValue) { - struct.set(grouping_strategy$LAYOUT, grouping_strategy$OFFSET, fieldValue); - } - - private static final OfBoolean some_other_config$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("some_other_config")); - - /** - * Layout for field: - * {@snippet lang=c : - * bool some_other_config - * } - */ - public static final OfBoolean some_other_config$layout() { - return some_other_config$LAYOUT; - } - - private static final long some_other_config$OFFSET = 4; - - /** - * Offset for field: - * {@snippet lang=c : - * bool some_other_config - * } - */ - public static final long some_other_config$offset() { - return some_other_config$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * bool some_other_config - * } - */ - public static boolean some_other_config(MemorySegment struct) { - return struct.get(some_other_config$LAYOUT, some_other_config$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * bool some_other_config - * } - */ - public static void some_other_config(MemorySegment struct, boolean fieldValue) { - struct.set(some_other_config$LAYOUT, some_other_config$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/ICU4XFixedDecimalFormatter_try_new_result.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/ICU4XFixedDecimalFormatter_try_new_result.java deleted file mode 100644 index 21c683836..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/ICU4XFixedDecimalFormatter_try_new_result.java +++ /dev/null @@ -1,178 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct ICU4XFixedDecimalFormatter_try_new_result { - * union { - * ICU4XFixedDecimalFormatter *ok; - * }; - * bool is_ok; - * } - * } - */ -public class ICU4XFixedDecimalFormatter_try_new_result { - - ICU4XFixedDecimalFormatter_try_new_result() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - MemoryLayout.unionLayout( - somelib_h.C_POINTER.withName("ok") - ).withName("$anon$22:51"), - somelib_h.C_BOOL.withName("is_ok"), - MemoryLayout.paddingLayout(7) - ).withName("ICU4XFixedDecimalFormatter_try_new_result"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout ok$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("$anon$22:51"), groupElement("ok")); - - /** - * Layout for field: - * {@snippet lang=c : - * ICU4XFixedDecimalFormatter *ok - * } - */ - public static final AddressLayout ok$layout() { - return ok$LAYOUT; - } - - private static final long ok$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * ICU4XFixedDecimalFormatter *ok - * } - */ - public static final long ok$offset() { - return ok$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * ICU4XFixedDecimalFormatter *ok - * } - */ - public static MemorySegment ok(MemorySegment struct) { - return struct.get(ok$LAYOUT, ok$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * ICU4XFixedDecimalFormatter *ok - * } - */ - public static void ok(MemorySegment struct, MemorySegment fieldValue) { - struct.set(ok$LAYOUT, ok$OFFSET, fieldValue); - } - - private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); - - /** - * Layout for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static final OfBoolean is_ok$layout() { - return is_ok$LAYOUT; - } - - private static final long is_ok$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static final long is_ok$offset() { - return is_ok$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static boolean is_ok(MemorySegment struct) { - return struct.get(is_ok$LAYOUT, is_ok$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static void is_ok(MemorySegment struct, boolean fieldValue) { - struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/ICU4XFixedDecimal_to_string_result.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/ICU4XFixedDecimal_to_string_result.java deleted file mode 100644 index dc86523e9..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/ICU4XFixedDecimal_to_string_result.java +++ /dev/null @@ -1,127 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct ICU4XFixedDecimal_to_string_result { - * bool is_ok; - * } - * } - */ -public class ICU4XFixedDecimal_to_string_result { - - ICU4XFixedDecimal_to_string_result() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_BOOL.withName("is_ok") - ).withName("ICU4XFixedDecimal_to_string_result"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfBoolean is_ok$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("is_ok")); - - /** - * Layout for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static final OfBoolean is_ok$layout() { - return is_ok$LAYOUT; - } - - private static final long is_ok$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static final long is_ok$offset() { - return is_ok$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static boolean is_ok(MemorySegment struct) { - return struct.get(is_ok$LAYOUT, is_ok$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * bool is_ok - * } - */ - public static void is_ok(MemorySegment struct, boolean fieldValue) { - struct.set(is_ok$LAYOUT, is_ok$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_OSUnalignedU16.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_OSUnalignedU16.java deleted file mode 100644 index 7d88e1de8..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_OSUnalignedU16.java +++ /dev/null @@ -1,127 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct _OSUnalignedU16 { - * volatile uint16_t __val; - * } - * } - */ -public class _OSUnalignedU16 { - - _OSUnalignedU16() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.align(somelib_h.C_SHORT, 1).withName("__val") - ).withName("_OSUnalignedU16"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfShort __val$LAYOUT = (OfShort)$LAYOUT.select(groupElement("__val")); - - /** - * Layout for field: - * {@snippet lang=c : - * volatile uint16_t __val - * } - */ - public static final OfShort __val$layout() { - return __val$LAYOUT; - } - - private static final long __val$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * volatile uint16_t __val - * } - */ - public static final long __val$offset() { - return __val$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * volatile uint16_t __val - * } - */ - public static short __val(MemorySegment struct) { - return struct.get(__val$LAYOUT, __val$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * volatile uint16_t __val - * } - */ - public static void __val(MemorySegment struct, short fieldValue) { - struct.set(__val$LAYOUT, __val$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_OSUnalignedU32.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_OSUnalignedU32.java deleted file mode 100644 index e92d4f122..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_OSUnalignedU32.java +++ /dev/null @@ -1,127 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct _OSUnalignedU32 { - * volatile uint32_t __val; - * } - * } - */ -public class _OSUnalignedU32 { - - _OSUnalignedU32() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.align(somelib_h.C_INT, 1).withName("__val") - ).withName("_OSUnalignedU32"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfInt __val$LAYOUT = (OfInt)$LAYOUT.select(groupElement("__val")); - - /** - * Layout for field: - * {@snippet lang=c : - * volatile uint32_t __val - * } - */ - public static final OfInt __val$layout() { - return __val$LAYOUT; - } - - private static final long __val$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * volatile uint32_t __val - * } - */ - public static final long __val$offset() { - return __val$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * volatile uint32_t __val - * } - */ - public static int __val(MemorySegment struct) { - return struct.get(__val$LAYOUT, __val$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * volatile uint32_t __val - * } - */ - public static void __val(MemorySegment struct, int fieldValue) { - struct.set(__val$LAYOUT, __val$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_OSUnalignedU64.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_OSUnalignedU64.java deleted file mode 100644 index 3c28f93f5..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_OSUnalignedU64.java +++ /dev/null @@ -1,127 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct _OSUnalignedU64 { - * volatile uint64_t __val; - * } - * } - */ -public class _OSUnalignedU64 { - - _OSUnalignedU64() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.align(somelib_h.C_LONG_LONG, 1).withName("__val") - ).withName("_OSUnalignedU64"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong __val$LAYOUT = (OfLong)$LAYOUT.select(groupElement("__val")); - - /** - * Layout for field: - * {@snippet lang=c : - * volatile uint64_t __val - * } - */ - public static final OfLong __val$layout() { - return __val$LAYOUT; - } - - private static final long __val$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * volatile uint64_t __val - * } - */ - public static final long __val$offset() { - return __val$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * volatile uint64_t __val - * } - */ - public static long __val(MemorySegment struct) { - return struct.get(__val$LAYOUT, __val$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * volatile uint64_t __val - * } - */ - public static void __val(MemorySegment struct, long fieldValue) { - struct.set(__val$LAYOUT, __val$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_mbstate_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_mbstate_t.java deleted file mode 100644 index 53cbe9810..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_mbstate_t.java +++ /dev/null @@ -1,26 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * typedef __mbstate_t __darwin_mbstate_t - * } - */ -public class __darwin_mbstate_t extends __mbstate_t { - - __darwin_mbstate_t() { - // Should not be called directly - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_attr_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_attr_t.java deleted file mode 100644 index 5ec0ad420..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_attr_t.java +++ /dev/null @@ -1,29 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * typedef struct _opaque_pthread_attr_t { - * long __sig; - * char __opaque[56]; - * } __darwin_pthread_attr_t - * } - */ -public class __darwin_pthread_attr_t extends _opaque_pthread_attr_t { - - __darwin_pthread_attr_t() { - // Should not be called directly - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_cond_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_cond_t.java deleted file mode 100644 index 82e1d131b..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_cond_t.java +++ /dev/null @@ -1,29 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * typedef struct _opaque_pthread_cond_t { - * long __sig; - * char __opaque[40]; - * } __darwin_pthread_cond_t - * } - */ -public class __darwin_pthread_cond_t extends _opaque_pthread_cond_t { - - __darwin_pthread_cond_t() { - // Should not be called directly - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_condattr_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_condattr_t.java deleted file mode 100644 index 598f5a21f..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_condattr_t.java +++ /dev/null @@ -1,29 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * typedef struct _opaque_pthread_condattr_t { - * long __sig; - * char __opaque[8]; - * } __darwin_pthread_condattr_t - * } - */ -public class __darwin_pthread_condattr_t extends _opaque_pthread_condattr_t { - - __darwin_pthread_condattr_t() { - // Should not be called directly - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_handler_rec.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_handler_rec.java deleted file mode 100644 index ea9c9af0b..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_handler_rec.java +++ /dev/null @@ -1,272 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct __darwin_pthread_handler_rec { - * void (*__routine)(void *); - * void *__arg; - * struct __darwin_pthread_handler_rec *__next; - * } - * } - */ -public class __darwin_pthread_handler_rec { - - __darwin_pthread_handler_rec() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_POINTER.withName("__routine"), - somelib_h.C_POINTER.withName("__arg"), - somelib_h.C_POINTER.withName("__next") - ).withName("__darwin_pthread_handler_rec"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - /** - * {@snippet lang=c : - * void (*__routine)(void *) - * } - */ - public static class __routine { - - __routine() { - // Should not be called directly - } - - /** - * The function pointer signature, expressed as a functional interface - */ - public interface Function { - void apply(MemorySegment _x0); - } - - private static final FunctionDescriptor $DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER - ); - - /** - * The descriptor of this function pointer - */ - public static FunctionDescriptor descriptor() { - return $DESC; - } - - private static final MethodHandle UP$MH = somelib_h.upcallHandle(__routine.Function.class, "apply", $DESC); - - /** - * Allocates a new upcall stub, whose implementation is defined by {@code fi}. - * The lifetime of the returned segment is managed by {@code arena} - */ - public static MemorySegment allocate(__routine.Function fi, Arena arena) { - return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena); - } - - private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC); - - /** - * Invoke the upcall stub {@code funcPtr}, with given parameters - */ - public static void invoke(MemorySegment funcPtr,MemorySegment _x0) { - try { - DOWN$MH.invokeExact(funcPtr, _x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - } - - private static final AddressLayout __routine$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("__routine")); - - /** - * Layout for field: - * {@snippet lang=c : - * void (*__routine)(void *) - * } - */ - public static final AddressLayout __routine$layout() { - return __routine$LAYOUT; - } - - private static final long __routine$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * void (*__routine)(void *) - * } - */ - public static final long __routine$offset() { - return __routine$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * void (*__routine)(void *) - * } - */ - public static MemorySegment __routine(MemorySegment struct) { - return struct.get(__routine$LAYOUT, __routine$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * void (*__routine)(void *) - * } - */ - public static void __routine(MemorySegment struct, MemorySegment fieldValue) { - struct.set(__routine$LAYOUT, __routine$OFFSET, fieldValue); - } - - private static final AddressLayout __arg$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("__arg")); - - /** - * Layout for field: - * {@snippet lang=c : - * void *__arg - * } - */ - public static final AddressLayout __arg$layout() { - return __arg$LAYOUT; - } - - private static final long __arg$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * void *__arg - * } - */ - public static final long __arg$offset() { - return __arg$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * void *__arg - * } - */ - public static MemorySegment __arg(MemorySegment struct) { - return struct.get(__arg$LAYOUT, __arg$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * void *__arg - * } - */ - public static void __arg(MemorySegment struct, MemorySegment fieldValue) { - struct.set(__arg$LAYOUT, __arg$OFFSET, fieldValue); - } - - private static final AddressLayout __next$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("__next")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct __darwin_pthread_handler_rec *__next - * } - */ - public static final AddressLayout __next$layout() { - return __next$LAYOUT; - } - - private static final long __next$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * struct __darwin_pthread_handler_rec *__next - * } - */ - public static final long __next$offset() { - return __next$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct __darwin_pthread_handler_rec *__next - * } - */ - public static MemorySegment __next(MemorySegment struct) { - return struct.get(__next$LAYOUT, __next$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct __darwin_pthread_handler_rec *__next - * } - */ - public static void __next(MemorySegment struct, MemorySegment fieldValue) { - struct.set(__next$LAYOUT, __next$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_mutex_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_mutex_t.java deleted file mode 100644 index 60a2fde5e..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_mutex_t.java +++ /dev/null @@ -1,29 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * typedef struct _opaque_pthread_mutex_t { - * long __sig; - * char __opaque[56]; - * } __darwin_pthread_mutex_t - * } - */ -public class __darwin_pthread_mutex_t extends _opaque_pthread_mutex_t { - - __darwin_pthread_mutex_t() { - // Should not be called directly - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_mutexattr_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_mutexattr_t.java deleted file mode 100644 index d0212cad8..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_mutexattr_t.java +++ /dev/null @@ -1,29 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * typedef struct _opaque_pthread_mutexattr_t { - * long __sig; - * char __opaque[8]; - * } __darwin_pthread_mutexattr_t - * } - */ -public class __darwin_pthread_mutexattr_t extends _opaque_pthread_mutexattr_t { - - __darwin_pthread_mutexattr_t() { - // Should not be called directly - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_once_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_once_t.java deleted file mode 100644 index 7bd98a64e..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_once_t.java +++ /dev/null @@ -1,29 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * typedef struct _opaque_pthread_once_t { - * long __sig; - * char __opaque[8]; - * } __darwin_pthread_once_t - * } - */ -public class __darwin_pthread_once_t extends _opaque_pthread_once_t { - - __darwin_pthread_once_t() { - // Should not be called directly - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_rwlock_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_rwlock_t.java deleted file mode 100644 index b39afdd2b..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_rwlock_t.java +++ /dev/null @@ -1,29 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * typedef struct _opaque_pthread_rwlock_t { - * long __sig; - * char __opaque[192]; - * } __darwin_pthread_rwlock_t - * } - */ -public class __darwin_pthread_rwlock_t extends _opaque_pthread_rwlock_t { - - __darwin_pthread_rwlock_t() { - // Should not be called directly - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_rwlockattr_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_rwlockattr_t.java deleted file mode 100644 index 1c415ffc7..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__darwin_pthread_rwlockattr_t.java +++ /dev/null @@ -1,29 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * typedef struct _opaque_pthread_rwlockattr_t { - * long __sig; - * char __opaque[16]; - * } __darwin_pthread_rwlockattr_t - * } - */ -public class __darwin_pthread_rwlockattr_t extends _opaque_pthread_rwlockattr_t { - - __darwin_pthread_rwlockattr_t() { - // Should not be called directly - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__mbstate_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__mbstate_t.java deleted file mode 100644 index b83bd44db..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__mbstate_t.java +++ /dev/null @@ -1,206 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * union { - * char __mbstate8[128]; - * long long _mbstateL; - * } - * } - */ -public class __mbstate_t { - - __mbstate_t() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.unionLayout( - MemoryLayout.sequenceLayout(128, somelib_h.C_CHAR).withName("__mbstate8"), - somelib_h.C_LONG_LONG.withName("_mbstateL") - ).withName("$anon$54:9"); - - /** - * The layout of this union - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final SequenceLayout __mbstate8$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("__mbstate8")); - - /** - * Layout for field: - * {@snippet lang=c : - * char __mbstate8[128] - * } - */ - public static final SequenceLayout __mbstate8$layout() { - return __mbstate8$LAYOUT; - } - - private static final long __mbstate8$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * char __mbstate8[128] - * } - */ - public static final long __mbstate8$offset() { - return __mbstate8$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * char __mbstate8[128] - * } - */ - public static MemorySegment __mbstate8(MemorySegment union) { - return union.asSlice(__mbstate8$OFFSET, __mbstate8$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * char __mbstate8[128] - * } - */ - public static void __mbstate8(MemorySegment union, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, union, __mbstate8$OFFSET, __mbstate8$LAYOUT.byteSize()); - } - - private static long[] __mbstate8$DIMS = { 128 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * char __mbstate8[128] - * } - */ - public static long[] __mbstate8$dimensions() { - return __mbstate8$DIMS; - } - private static final VarHandle __mbstate8$ELEM_HANDLE = __mbstate8$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * char __mbstate8[128] - * } - */ - public static byte __mbstate8(MemorySegment union, long index0) { - return (byte)__mbstate8$ELEM_HANDLE.get(union, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * char __mbstate8[128] - * } - */ - public static void __mbstate8(MemorySegment union, long index0, byte fieldValue) { - __mbstate8$ELEM_HANDLE.set(union, 0L, index0, fieldValue); - } - - private static final OfLong _mbstateL$LAYOUT = (OfLong)$LAYOUT.select(groupElement("_mbstateL")); - - /** - * Layout for field: - * {@snippet lang=c : - * long long _mbstateL - * } - */ - public static final OfLong _mbstateL$layout() { - return _mbstateL$LAYOUT; - } - - private static final long _mbstateL$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * long long _mbstateL - * } - */ - public static final long _mbstateL$offset() { - return _mbstateL$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * long long _mbstateL - * } - */ - public static long _mbstateL(MemorySegment union) { - return union.get(_mbstateL$LAYOUT, _mbstateL$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * long long _mbstateL - * } - */ - public static void _mbstateL(MemorySegment union, long fieldValue) { - union.set(_mbstateL$LAYOUT, _mbstateL$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this union - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__sFILE.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__sFILE.java deleted file mode 100644 index 2da0db2d6..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__sFILE.java +++ /dev/null @@ -1,1292 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct __sFILE { - * unsigned char *_p; - * int _r; - * int _w; - * short _flags; - * short _file; - * struct __sbuf _bf; - * int _lbfsize; - * void *_cookie; - * int (* _Nullable _close)(void *); - * int (* _Nullable _read)(void *, char *, int); - * fpos_t (* _Nullable _seek)(void *, fpos_t, int); - * int (* _Nullable _write)(void *, const char *, int); - * struct __sbuf _ub; - * struct __sFILEX *_extra; - * int _ur; - * unsigned char _ubuf[3]; - * unsigned char _nbuf[1]; - * struct __sbuf _lb; - * int _blksize; - * fpos_t _offset; - * } - * } - */ -public class __sFILE { - - __sFILE() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_POINTER.withName("_p"), - somelib_h.C_INT.withName("_r"), - somelib_h.C_INT.withName("_w"), - somelib_h.C_SHORT.withName("_flags"), - somelib_h.C_SHORT.withName("_file"), - MemoryLayout.paddingLayout(4), - __sbuf.layout().withName("_bf"), - somelib_h.C_INT.withName("_lbfsize"), - MemoryLayout.paddingLayout(4), - somelib_h.C_POINTER.withName("_cookie"), - somelib_h.C_POINTER.withName("_close"), - somelib_h.C_POINTER.withName("_read"), - somelib_h.C_POINTER.withName("_seek"), - somelib_h.C_POINTER.withName("_write"), - __sbuf.layout().withName("_ub"), - somelib_h.C_POINTER.withName("_extra"), - somelib_h.C_INT.withName("_ur"), - MemoryLayout.sequenceLayout(3, somelib_h.C_CHAR).withName("_ubuf"), - MemoryLayout.sequenceLayout(1, somelib_h.C_CHAR).withName("_nbuf"), - __sbuf.layout().withName("_lb"), - somelib_h.C_INT.withName("_blksize"), - MemoryLayout.paddingLayout(4), - somelib_h.C_LONG_LONG.withName("_offset") - ).withName("__sFILE"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout _p$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("_p")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned char *_p - * } - */ - public static final AddressLayout _p$layout() { - return _p$LAYOUT; - } - - private static final long _p$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned char *_p - * } - */ - public static final long _p$offset() { - return _p$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned char *_p - * } - */ - public static MemorySegment _p(MemorySegment struct) { - return struct.get(_p$LAYOUT, _p$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned char *_p - * } - */ - public static void _p(MemorySegment struct, MemorySegment fieldValue) { - struct.set(_p$LAYOUT, _p$OFFSET, fieldValue); - } - - private static final OfInt _r$LAYOUT = (OfInt)$LAYOUT.select(groupElement("_r")); - - /** - * Layout for field: - * {@snippet lang=c : - * int _r - * } - */ - public static final OfInt _r$layout() { - return _r$LAYOUT; - } - - private static final long _r$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * int _r - * } - */ - public static final long _r$offset() { - return _r$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int _r - * } - */ - public static int _r(MemorySegment struct) { - return struct.get(_r$LAYOUT, _r$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int _r - * } - */ - public static void _r(MemorySegment struct, int fieldValue) { - struct.set(_r$LAYOUT, _r$OFFSET, fieldValue); - } - - private static final OfInt _w$LAYOUT = (OfInt)$LAYOUT.select(groupElement("_w")); - - /** - * Layout for field: - * {@snippet lang=c : - * int _w - * } - */ - public static final OfInt _w$layout() { - return _w$LAYOUT; - } - - private static final long _w$OFFSET = 12; - - /** - * Offset for field: - * {@snippet lang=c : - * int _w - * } - */ - public static final long _w$offset() { - return _w$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int _w - * } - */ - public static int _w(MemorySegment struct) { - return struct.get(_w$LAYOUT, _w$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int _w - * } - */ - public static void _w(MemorySegment struct, int fieldValue) { - struct.set(_w$LAYOUT, _w$OFFSET, fieldValue); - } - - private static final OfShort _flags$LAYOUT = (OfShort)$LAYOUT.select(groupElement("_flags")); - - /** - * Layout for field: - * {@snippet lang=c : - * short _flags - * } - */ - public static final OfShort _flags$layout() { - return _flags$LAYOUT; - } - - private static final long _flags$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * short _flags - * } - */ - public static final long _flags$offset() { - return _flags$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * short _flags - * } - */ - public static short _flags(MemorySegment struct) { - return struct.get(_flags$LAYOUT, _flags$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * short _flags - * } - */ - public static void _flags(MemorySegment struct, short fieldValue) { - struct.set(_flags$LAYOUT, _flags$OFFSET, fieldValue); - } - - private static final OfShort _file$LAYOUT = (OfShort)$LAYOUT.select(groupElement("_file")); - - /** - * Layout for field: - * {@snippet lang=c : - * short _file - * } - */ - public static final OfShort _file$layout() { - return _file$LAYOUT; - } - - private static final long _file$OFFSET = 18; - - /** - * Offset for field: - * {@snippet lang=c : - * short _file - * } - */ - public static final long _file$offset() { - return _file$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * short _file - * } - */ - public static short _file(MemorySegment struct) { - return struct.get(_file$LAYOUT, _file$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * short _file - * } - */ - public static void _file(MemorySegment struct, short fieldValue) { - struct.set(_file$LAYOUT, _file$OFFSET, fieldValue); - } - - private static final GroupLayout _bf$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("_bf")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct __sbuf _bf - * } - */ - public static final GroupLayout _bf$layout() { - return _bf$LAYOUT; - } - - private static final long _bf$OFFSET = 24; - - /** - * Offset for field: - * {@snippet lang=c : - * struct __sbuf _bf - * } - */ - public static final long _bf$offset() { - return _bf$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct __sbuf _bf - * } - */ - public static MemorySegment _bf(MemorySegment struct) { - return struct.asSlice(_bf$OFFSET, _bf$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct __sbuf _bf - * } - */ - public static void _bf(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, _bf$OFFSET, _bf$LAYOUT.byteSize()); - } - - private static final OfInt _lbfsize$LAYOUT = (OfInt)$LAYOUT.select(groupElement("_lbfsize")); - - /** - * Layout for field: - * {@snippet lang=c : - * int _lbfsize - * } - */ - public static final OfInt _lbfsize$layout() { - return _lbfsize$LAYOUT; - } - - private static final long _lbfsize$OFFSET = 40; - - /** - * Offset for field: - * {@snippet lang=c : - * int _lbfsize - * } - */ - public static final long _lbfsize$offset() { - return _lbfsize$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int _lbfsize - * } - */ - public static int _lbfsize(MemorySegment struct) { - return struct.get(_lbfsize$LAYOUT, _lbfsize$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int _lbfsize - * } - */ - public static void _lbfsize(MemorySegment struct, int fieldValue) { - struct.set(_lbfsize$LAYOUT, _lbfsize$OFFSET, fieldValue); - } - - private static final AddressLayout _cookie$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("_cookie")); - - /** - * Layout for field: - * {@snippet lang=c : - * void *_cookie - * } - */ - public static final AddressLayout _cookie$layout() { - return _cookie$LAYOUT; - } - - private static final long _cookie$OFFSET = 48; - - /** - * Offset for field: - * {@snippet lang=c : - * void *_cookie - * } - */ - public static final long _cookie$offset() { - return _cookie$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * void *_cookie - * } - */ - public static MemorySegment _cookie(MemorySegment struct) { - return struct.get(_cookie$LAYOUT, _cookie$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * void *_cookie - * } - */ - public static void _cookie(MemorySegment struct, MemorySegment fieldValue) { - struct.set(_cookie$LAYOUT, _cookie$OFFSET, fieldValue); - } - - /** - * {@snippet lang=c : - * int (* _Nullable _close)(void *) - * } - */ - public static class _close { - - _close() { - // Should not be called directly - } - - /** - * The function pointer signature, expressed as a functional interface - */ - public interface Function { - int apply(MemorySegment _x0); - } - - private static final FunctionDescriptor $DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - /** - * The descriptor of this function pointer - */ - public static FunctionDescriptor descriptor() { - return $DESC; - } - - private static final MethodHandle UP$MH = somelib_h.upcallHandle(_close.Function.class, "apply", $DESC); - - /** - * Allocates a new upcall stub, whose implementation is defined by {@code fi}. - * The lifetime of the returned segment is managed by {@code arena} - */ - public static MemorySegment allocate(_close.Function fi, Arena arena) { - return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena); - } - - private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC); - - /** - * Invoke the upcall stub {@code funcPtr}, with given parameters - */ - public static int invoke(MemorySegment funcPtr,MemorySegment _x0) { - try { - return (int) DOWN$MH.invokeExact(funcPtr, _x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - } - - private static final AddressLayout _close$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("_close")); - - /** - * Layout for field: - * {@snippet lang=c : - * int (* _Nullable _close)(void *) - * } - */ - public static final AddressLayout _close$layout() { - return _close$LAYOUT; - } - - private static final long _close$OFFSET = 56; - - /** - * Offset for field: - * {@snippet lang=c : - * int (* _Nullable _close)(void *) - * } - */ - public static final long _close$offset() { - return _close$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int (* _Nullable _close)(void *) - * } - */ - public static MemorySegment _close(MemorySegment struct) { - return struct.get(_close$LAYOUT, _close$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int (* _Nullable _close)(void *) - * } - */ - public static void _close(MemorySegment struct, MemorySegment fieldValue) { - struct.set(_close$LAYOUT, _close$OFFSET, fieldValue); - } - - /** - * {@snippet lang=c : - * int (* _Nullable _read)(void *, char *, int) - * } - */ - public static class _read { - - _read() { - // Should not be called directly - } - - /** - * The function pointer signature, expressed as a functional interface - */ - public interface Function { - int apply(MemorySegment _x0, MemorySegment _x1, int _x2); - } - - private static final FunctionDescriptor $DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_INT - ); - - /** - * The descriptor of this function pointer - */ - public static FunctionDescriptor descriptor() { - return $DESC; - } - - private static final MethodHandle UP$MH = somelib_h.upcallHandle(_read.Function.class, "apply", $DESC); - - /** - * Allocates a new upcall stub, whose implementation is defined by {@code fi}. - * The lifetime of the returned segment is managed by {@code arena} - */ - public static MemorySegment allocate(_read.Function fi, Arena arena) { - return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena); - } - - private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC); - - /** - * Invoke the upcall stub {@code funcPtr}, with given parameters - */ - public static int invoke(MemorySegment funcPtr,MemorySegment _x0, MemorySegment _x1, int _x2) { - try { - return (int) DOWN$MH.invokeExact(funcPtr, _x0, _x1, _x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - } - - private static final AddressLayout _read$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("_read")); - - /** - * Layout for field: - * {@snippet lang=c : - * int (* _Nullable _read)(void *, char *, int) - * } - */ - public static final AddressLayout _read$layout() { - return _read$LAYOUT; - } - - private static final long _read$OFFSET = 64; - - /** - * Offset for field: - * {@snippet lang=c : - * int (* _Nullable _read)(void *, char *, int) - * } - */ - public static final long _read$offset() { - return _read$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int (* _Nullable _read)(void *, char *, int) - * } - */ - public static MemorySegment _read(MemorySegment struct) { - return struct.get(_read$LAYOUT, _read$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int (* _Nullable _read)(void *, char *, int) - * } - */ - public static void _read(MemorySegment struct, MemorySegment fieldValue) { - struct.set(_read$LAYOUT, _read$OFFSET, fieldValue); - } - - /** - * {@snippet lang=c : - * fpos_t (* _Nullable _seek)(void *, fpos_t, int) - * } - */ - public static class _seek { - - _seek() { - // Should not be called directly - } - - /** - * The function pointer signature, expressed as a functional interface - */ - public interface Function { - long apply(MemorySegment _x0, long _x1, int _x2); - } - - private static final FunctionDescriptor $DESC = FunctionDescriptor.of( - somelib_h.C_LONG_LONG, - somelib_h.C_POINTER, - somelib_h.C_LONG_LONG, - somelib_h.C_INT - ); - - /** - * The descriptor of this function pointer - */ - public static FunctionDescriptor descriptor() { - return $DESC; - } - - private static final MethodHandle UP$MH = somelib_h.upcallHandle(_seek.Function.class, "apply", $DESC); - - /** - * Allocates a new upcall stub, whose implementation is defined by {@code fi}. - * The lifetime of the returned segment is managed by {@code arena} - */ - public static MemorySegment allocate(_seek.Function fi, Arena arena) { - return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena); - } - - private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC); - - /** - * Invoke the upcall stub {@code funcPtr}, with given parameters - */ - public static long invoke(MemorySegment funcPtr,MemorySegment _x0, long _x1, int _x2) { - try { - return (long) DOWN$MH.invokeExact(funcPtr, _x0, _x1, _x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - } - - private static final AddressLayout _seek$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("_seek")); - - /** - * Layout for field: - * {@snippet lang=c : - * fpos_t (* _Nullable _seek)(void *, fpos_t, int) - * } - */ - public static final AddressLayout _seek$layout() { - return _seek$LAYOUT; - } - - private static final long _seek$OFFSET = 72; - - /** - * Offset for field: - * {@snippet lang=c : - * fpos_t (* _Nullable _seek)(void *, fpos_t, int) - * } - */ - public static final long _seek$offset() { - return _seek$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * fpos_t (* _Nullable _seek)(void *, fpos_t, int) - * } - */ - public static MemorySegment _seek(MemorySegment struct) { - return struct.get(_seek$LAYOUT, _seek$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * fpos_t (* _Nullable _seek)(void *, fpos_t, int) - * } - */ - public static void _seek(MemorySegment struct, MemorySegment fieldValue) { - struct.set(_seek$LAYOUT, _seek$OFFSET, fieldValue); - } - - /** - * {@snippet lang=c : - * int (* _Nullable _write)(void *, const char *, int) - * } - */ - public static class _write { - - _write() { - // Should not be called directly - } - - /** - * The function pointer signature, expressed as a functional interface - */ - public interface Function { - int apply(MemorySegment _x0, MemorySegment _x1, int _x2); - } - - private static final FunctionDescriptor $DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_INT - ); - - /** - * The descriptor of this function pointer - */ - public static FunctionDescriptor descriptor() { - return $DESC; - } - - private static final MethodHandle UP$MH = somelib_h.upcallHandle(_write.Function.class, "apply", $DESC); - - /** - * Allocates a new upcall stub, whose implementation is defined by {@code fi}. - * The lifetime of the returned segment is managed by {@code arena} - */ - public static MemorySegment allocate(_write.Function fi, Arena arena) { - return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena); - } - - private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC); - - /** - * Invoke the upcall stub {@code funcPtr}, with given parameters - */ - public static int invoke(MemorySegment funcPtr,MemorySegment _x0, MemorySegment _x1, int _x2) { - try { - return (int) DOWN$MH.invokeExact(funcPtr, _x0, _x1, _x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - } - - private static final AddressLayout _write$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("_write")); - - /** - * Layout for field: - * {@snippet lang=c : - * int (* _Nullable _write)(void *, const char *, int) - * } - */ - public static final AddressLayout _write$layout() { - return _write$LAYOUT; - } - - private static final long _write$OFFSET = 80; - - /** - * Offset for field: - * {@snippet lang=c : - * int (* _Nullable _write)(void *, const char *, int) - * } - */ - public static final long _write$offset() { - return _write$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int (* _Nullable _write)(void *, const char *, int) - * } - */ - public static MemorySegment _write(MemorySegment struct) { - return struct.get(_write$LAYOUT, _write$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int (* _Nullable _write)(void *, const char *, int) - * } - */ - public static void _write(MemorySegment struct, MemorySegment fieldValue) { - struct.set(_write$LAYOUT, _write$OFFSET, fieldValue); - } - - private static final GroupLayout _ub$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("_ub")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct __sbuf _ub - * } - */ - public static final GroupLayout _ub$layout() { - return _ub$LAYOUT; - } - - private static final long _ub$OFFSET = 88; - - /** - * Offset for field: - * {@snippet lang=c : - * struct __sbuf _ub - * } - */ - public static final long _ub$offset() { - return _ub$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct __sbuf _ub - * } - */ - public static MemorySegment _ub(MemorySegment struct) { - return struct.asSlice(_ub$OFFSET, _ub$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct __sbuf _ub - * } - */ - public static void _ub(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, _ub$OFFSET, _ub$LAYOUT.byteSize()); - } - - private static final AddressLayout _extra$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("_extra")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct __sFILEX *_extra - * } - */ - public static final AddressLayout _extra$layout() { - return _extra$LAYOUT; - } - - private static final long _extra$OFFSET = 104; - - /** - * Offset for field: - * {@snippet lang=c : - * struct __sFILEX *_extra - * } - */ - public static final long _extra$offset() { - return _extra$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct __sFILEX *_extra - * } - */ - public static MemorySegment _extra(MemorySegment struct) { - return struct.get(_extra$LAYOUT, _extra$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct __sFILEX *_extra - * } - */ - public static void _extra(MemorySegment struct, MemorySegment fieldValue) { - struct.set(_extra$LAYOUT, _extra$OFFSET, fieldValue); - } - - private static final OfInt _ur$LAYOUT = (OfInt)$LAYOUT.select(groupElement("_ur")); - - /** - * Layout for field: - * {@snippet lang=c : - * int _ur - * } - */ - public static final OfInt _ur$layout() { - return _ur$LAYOUT; - } - - private static final long _ur$OFFSET = 112; - - /** - * Offset for field: - * {@snippet lang=c : - * int _ur - * } - */ - public static final long _ur$offset() { - return _ur$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int _ur - * } - */ - public static int _ur(MemorySegment struct) { - return struct.get(_ur$LAYOUT, _ur$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int _ur - * } - */ - public static void _ur(MemorySegment struct, int fieldValue) { - struct.set(_ur$LAYOUT, _ur$OFFSET, fieldValue); - } - - private static final SequenceLayout _ubuf$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("_ubuf")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned char _ubuf[3] - * } - */ - public static final SequenceLayout _ubuf$layout() { - return _ubuf$LAYOUT; - } - - private static final long _ubuf$OFFSET = 116; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned char _ubuf[3] - * } - */ - public static final long _ubuf$offset() { - return _ubuf$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned char _ubuf[3] - * } - */ - public static MemorySegment _ubuf(MemorySegment struct) { - return struct.asSlice(_ubuf$OFFSET, _ubuf$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned char _ubuf[3] - * } - */ - public static void _ubuf(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, _ubuf$OFFSET, _ubuf$LAYOUT.byteSize()); - } - - private static long[] _ubuf$DIMS = { 3 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * unsigned char _ubuf[3] - * } - */ - public static long[] _ubuf$dimensions() { - return _ubuf$DIMS; - } - private static final VarHandle _ubuf$ELEM_HANDLE = _ubuf$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * unsigned char _ubuf[3] - * } - */ - public static byte _ubuf(MemorySegment struct, long index0) { - return (byte)_ubuf$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * unsigned char _ubuf[3] - * } - */ - public static void _ubuf(MemorySegment struct, long index0, byte fieldValue) { - _ubuf$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - private static final SequenceLayout _nbuf$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("_nbuf")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned char _nbuf[1] - * } - */ - public static final SequenceLayout _nbuf$layout() { - return _nbuf$LAYOUT; - } - - private static final long _nbuf$OFFSET = 119; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned char _nbuf[1] - * } - */ - public static final long _nbuf$offset() { - return _nbuf$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned char _nbuf[1] - * } - */ - public static MemorySegment _nbuf(MemorySegment struct) { - return struct.asSlice(_nbuf$OFFSET, _nbuf$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned char _nbuf[1] - * } - */ - public static void _nbuf(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, _nbuf$OFFSET, _nbuf$LAYOUT.byteSize()); - } - - private static long[] _nbuf$DIMS = { 1 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * unsigned char _nbuf[1] - * } - */ - public static long[] _nbuf$dimensions() { - return _nbuf$DIMS; - } - private static final VarHandle _nbuf$ELEM_HANDLE = _nbuf$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * unsigned char _nbuf[1] - * } - */ - public static byte _nbuf(MemorySegment struct, long index0) { - return (byte)_nbuf$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * unsigned char _nbuf[1] - * } - */ - public static void _nbuf(MemorySegment struct, long index0, byte fieldValue) { - _nbuf$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - private static final GroupLayout _lb$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("_lb")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct __sbuf _lb - * } - */ - public static final GroupLayout _lb$layout() { - return _lb$LAYOUT; - } - - private static final long _lb$OFFSET = 120; - - /** - * Offset for field: - * {@snippet lang=c : - * struct __sbuf _lb - * } - */ - public static final long _lb$offset() { - return _lb$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct __sbuf _lb - * } - */ - public static MemorySegment _lb(MemorySegment struct) { - return struct.asSlice(_lb$OFFSET, _lb$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct __sbuf _lb - * } - */ - public static void _lb(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, _lb$OFFSET, _lb$LAYOUT.byteSize()); - } - - private static final OfInt _blksize$LAYOUT = (OfInt)$LAYOUT.select(groupElement("_blksize")); - - /** - * Layout for field: - * {@snippet lang=c : - * int _blksize - * } - */ - public static final OfInt _blksize$layout() { - return _blksize$LAYOUT; - } - - private static final long _blksize$OFFSET = 136; - - /** - * Offset for field: - * {@snippet lang=c : - * int _blksize - * } - */ - public static final long _blksize$offset() { - return _blksize$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int _blksize - * } - */ - public static int _blksize(MemorySegment struct) { - return struct.get(_blksize$LAYOUT, _blksize$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int _blksize - * } - */ - public static void _blksize(MemorySegment struct, int fieldValue) { - struct.set(_blksize$LAYOUT, _blksize$OFFSET, fieldValue); - } - - private static final OfLong _offset$LAYOUT = (OfLong)$LAYOUT.select(groupElement("_offset")); - - /** - * Layout for field: - * {@snippet lang=c : - * fpos_t _offset - * } - */ - public static final OfLong _offset$layout() { - return _offset$LAYOUT; - } - - private static final long _offset$OFFSET = 144; - - /** - * Offset for field: - * {@snippet lang=c : - * fpos_t _offset - * } - */ - public static final long _offset$offset() { - return _offset$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * fpos_t _offset - * } - */ - public static long _offset(MemorySegment struct) { - return struct.get(_offset$LAYOUT, _offset$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * fpos_t _offset - * } - */ - public static void _offset(MemorySegment struct, long fieldValue) { - struct.set(_offset$LAYOUT, _offset$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__sbuf.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__sbuf.java deleted file mode 100644 index c4fd8a3c7..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/__sbuf.java +++ /dev/null @@ -1,174 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct __sbuf { - * unsigned char *_base; - * int _size; - * } - * } - */ -public class __sbuf { - - __sbuf() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_POINTER.withName("_base"), - somelib_h.C_INT.withName("_size"), - MemoryLayout.paddingLayout(4) - ).withName("__sbuf"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout _base$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("_base")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned char *_base - * } - */ - public static final AddressLayout _base$layout() { - return _base$LAYOUT; - } - - private static final long _base$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned char *_base - * } - */ - public static final long _base$offset() { - return _base$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned char *_base - * } - */ - public static MemorySegment _base(MemorySegment struct) { - return struct.get(_base$LAYOUT, _base$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned char *_base - * } - */ - public static void _base(MemorySegment struct, MemorySegment fieldValue) { - struct.set(_base$LAYOUT, _base$OFFSET, fieldValue); - } - - private static final OfInt _size$LAYOUT = (OfInt)$LAYOUT.select(groupElement("_size")); - - /** - * Layout for field: - * {@snippet lang=c : - * int _size - * } - */ - public static final OfInt _size$layout() { - return _size$LAYOUT; - } - - private static final long _size$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * int _size - * } - */ - public static final long _size$offset() { - return _size$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int _size - * } - */ - public static int _size(MemorySegment struct) { - return struct.get(_size$LAYOUT, _size$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int _size - * } - */ - public static void _size(MemorySegment struct, int fieldValue) { - struct.set(_size$LAYOUT, _size$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_attr_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_attr_t.java deleted file mode 100644 index 1da474a48..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_attr_t.java +++ /dev/null @@ -1,206 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct _opaque_pthread_attr_t { - * long __sig; - * char __opaque[56]; - * } - * } - */ -public class _opaque_pthread_attr_t { - - _opaque_pthread_attr_t() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_LONG.withName("__sig"), - MemoryLayout.sequenceLayout(56, somelib_h.C_CHAR).withName("__opaque") - ).withName("_opaque_pthread_attr_t"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong __sig$LAYOUT = (OfLong)$LAYOUT.select(groupElement("__sig")); - - /** - * Layout for field: - * {@snippet lang=c : - * long __sig - * } - */ - public static final OfLong __sig$layout() { - return __sig$LAYOUT; - } - - private static final long __sig$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * long __sig - * } - */ - public static final long __sig$offset() { - return __sig$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * long __sig - * } - */ - public static long __sig(MemorySegment struct) { - return struct.get(__sig$LAYOUT, __sig$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * long __sig - * } - */ - public static void __sig(MemorySegment struct, long fieldValue) { - struct.set(__sig$LAYOUT, __sig$OFFSET, fieldValue); - } - - private static final SequenceLayout __opaque$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("__opaque")); - - /** - * Layout for field: - * {@snippet lang=c : - * char __opaque[56] - * } - */ - public static final SequenceLayout __opaque$layout() { - return __opaque$LAYOUT; - } - - private static final long __opaque$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * char __opaque[56] - * } - */ - public static final long __opaque$offset() { - return __opaque$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * char __opaque[56] - * } - */ - public static MemorySegment __opaque(MemorySegment struct) { - return struct.asSlice(__opaque$OFFSET, __opaque$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * char __opaque[56] - * } - */ - public static void __opaque(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, __opaque$OFFSET, __opaque$LAYOUT.byteSize()); - } - - private static long[] __opaque$DIMS = { 56 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * char __opaque[56] - * } - */ - public static long[] __opaque$dimensions() { - return __opaque$DIMS; - } - private static final VarHandle __opaque$ELEM_HANDLE = __opaque$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * char __opaque[56] - * } - */ - public static byte __opaque(MemorySegment struct, long index0) { - return (byte)__opaque$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * char __opaque[56] - * } - */ - public static void __opaque(MemorySegment struct, long index0, byte fieldValue) { - __opaque$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_cond_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_cond_t.java deleted file mode 100644 index d558a7c41..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_cond_t.java +++ /dev/null @@ -1,206 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct _opaque_pthread_cond_t { - * long __sig; - * char __opaque[40]; - * } - * } - */ -public class _opaque_pthread_cond_t { - - _opaque_pthread_cond_t() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_LONG.withName("__sig"), - MemoryLayout.sequenceLayout(40, somelib_h.C_CHAR).withName("__opaque") - ).withName("_opaque_pthread_cond_t"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong __sig$LAYOUT = (OfLong)$LAYOUT.select(groupElement("__sig")); - - /** - * Layout for field: - * {@snippet lang=c : - * long __sig - * } - */ - public static final OfLong __sig$layout() { - return __sig$LAYOUT; - } - - private static final long __sig$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * long __sig - * } - */ - public static final long __sig$offset() { - return __sig$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * long __sig - * } - */ - public static long __sig(MemorySegment struct) { - return struct.get(__sig$LAYOUT, __sig$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * long __sig - * } - */ - public static void __sig(MemorySegment struct, long fieldValue) { - struct.set(__sig$LAYOUT, __sig$OFFSET, fieldValue); - } - - private static final SequenceLayout __opaque$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("__opaque")); - - /** - * Layout for field: - * {@snippet lang=c : - * char __opaque[40] - * } - */ - public static final SequenceLayout __opaque$layout() { - return __opaque$LAYOUT; - } - - private static final long __opaque$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * char __opaque[40] - * } - */ - public static final long __opaque$offset() { - return __opaque$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * char __opaque[40] - * } - */ - public static MemorySegment __opaque(MemorySegment struct) { - return struct.asSlice(__opaque$OFFSET, __opaque$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * char __opaque[40] - * } - */ - public static void __opaque(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, __opaque$OFFSET, __opaque$LAYOUT.byteSize()); - } - - private static long[] __opaque$DIMS = { 40 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * char __opaque[40] - * } - */ - public static long[] __opaque$dimensions() { - return __opaque$DIMS; - } - private static final VarHandle __opaque$ELEM_HANDLE = __opaque$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * char __opaque[40] - * } - */ - public static byte __opaque(MemorySegment struct, long index0) { - return (byte)__opaque$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * char __opaque[40] - * } - */ - public static void __opaque(MemorySegment struct, long index0, byte fieldValue) { - __opaque$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_condattr_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_condattr_t.java deleted file mode 100644 index 02538b060..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_condattr_t.java +++ /dev/null @@ -1,206 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct _opaque_pthread_condattr_t { - * long __sig; - * char __opaque[8]; - * } - * } - */ -public class _opaque_pthread_condattr_t { - - _opaque_pthread_condattr_t() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_LONG.withName("__sig"), - MemoryLayout.sequenceLayout(8, somelib_h.C_CHAR).withName("__opaque") - ).withName("_opaque_pthread_condattr_t"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong __sig$LAYOUT = (OfLong)$LAYOUT.select(groupElement("__sig")); - - /** - * Layout for field: - * {@snippet lang=c : - * long __sig - * } - */ - public static final OfLong __sig$layout() { - return __sig$LAYOUT; - } - - private static final long __sig$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * long __sig - * } - */ - public static final long __sig$offset() { - return __sig$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * long __sig - * } - */ - public static long __sig(MemorySegment struct) { - return struct.get(__sig$LAYOUT, __sig$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * long __sig - * } - */ - public static void __sig(MemorySegment struct, long fieldValue) { - struct.set(__sig$LAYOUT, __sig$OFFSET, fieldValue); - } - - private static final SequenceLayout __opaque$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("__opaque")); - - /** - * Layout for field: - * {@snippet lang=c : - * char __opaque[8] - * } - */ - public static final SequenceLayout __opaque$layout() { - return __opaque$LAYOUT; - } - - private static final long __opaque$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * char __opaque[8] - * } - */ - public static final long __opaque$offset() { - return __opaque$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * char __opaque[8] - * } - */ - public static MemorySegment __opaque(MemorySegment struct) { - return struct.asSlice(__opaque$OFFSET, __opaque$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * char __opaque[8] - * } - */ - public static void __opaque(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, __opaque$OFFSET, __opaque$LAYOUT.byteSize()); - } - - private static long[] __opaque$DIMS = { 8 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * char __opaque[8] - * } - */ - public static long[] __opaque$dimensions() { - return __opaque$DIMS; - } - private static final VarHandle __opaque$ELEM_HANDLE = __opaque$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * char __opaque[8] - * } - */ - public static byte __opaque(MemorySegment struct, long index0) { - return (byte)__opaque$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * char __opaque[8] - * } - */ - public static void __opaque(MemorySegment struct, long index0, byte fieldValue) { - __opaque$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_mutex_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_mutex_t.java deleted file mode 100644 index 6d772cce2..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_mutex_t.java +++ /dev/null @@ -1,206 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct _opaque_pthread_mutex_t { - * long __sig; - * char __opaque[56]; - * } - * } - */ -public class _opaque_pthread_mutex_t { - - _opaque_pthread_mutex_t() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_LONG.withName("__sig"), - MemoryLayout.sequenceLayout(56, somelib_h.C_CHAR).withName("__opaque") - ).withName("_opaque_pthread_mutex_t"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong __sig$LAYOUT = (OfLong)$LAYOUT.select(groupElement("__sig")); - - /** - * Layout for field: - * {@snippet lang=c : - * long __sig - * } - */ - public static final OfLong __sig$layout() { - return __sig$LAYOUT; - } - - private static final long __sig$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * long __sig - * } - */ - public static final long __sig$offset() { - return __sig$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * long __sig - * } - */ - public static long __sig(MemorySegment struct) { - return struct.get(__sig$LAYOUT, __sig$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * long __sig - * } - */ - public static void __sig(MemorySegment struct, long fieldValue) { - struct.set(__sig$LAYOUT, __sig$OFFSET, fieldValue); - } - - private static final SequenceLayout __opaque$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("__opaque")); - - /** - * Layout for field: - * {@snippet lang=c : - * char __opaque[56] - * } - */ - public static final SequenceLayout __opaque$layout() { - return __opaque$LAYOUT; - } - - private static final long __opaque$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * char __opaque[56] - * } - */ - public static final long __opaque$offset() { - return __opaque$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * char __opaque[56] - * } - */ - public static MemorySegment __opaque(MemorySegment struct) { - return struct.asSlice(__opaque$OFFSET, __opaque$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * char __opaque[56] - * } - */ - public static void __opaque(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, __opaque$OFFSET, __opaque$LAYOUT.byteSize()); - } - - private static long[] __opaque$DIMS = { 56 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * char __opaque[56] - * } - */ - public static long[] __opaque$dimensions() { - return __opaque$DIMS; - } - private static final VarHandle __opaque$ELEM_HANDLE = __opaque$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * char __opaque[56] - * } - */ - public static byte __opaque(MemorySegment struct, long index0) { - return (byte)__opaque$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * char __opaque[56] - * } - */ - public static void __opaque(MemorySegment struct, long index0, byte fieldValue) { - __opaque$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_mutexattr_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_mutexattr_t.java deleted file mode 100644 index 5910bf334..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_mutexattr_t.java +++ /dev/null @@ -1,206 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct _opaque_pthread_mutexattr_t { - * long __sig; - * char __opaque[8]; - * } - * } - */ -public class _opaque_pthread_mutexattr_t { - - _opaque_pthread_mutexattr_t() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_LONG.withName("__sig"), - MemoryLayout.sequenceLayout(8, somelib_h.C_CHAR).withName("__opaque") - ).withName("_opaque_pthread_mutexattr_t"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong __sig$LAYOUT = (OfLong)$LAYOUT.select(groupElement("__sig")); - - /** - * Layout for field: - * {@snippet lang=c : - * long __sig - * } - */ - public static final OfLong __sig$layout() { - return __sig$LAYOUT; - } - - private static final long __sig$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * long __sig - * } - */ - public static final long __sig$offset() { - return __sig$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * long __sig - * } - */ - public static long __sig(MemorySegment struct) { - return struct.get(__sig$LAYOUT, __sig$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * long __sig - * } - */ - public static void __sig(MemorySegment struct, long fieldValue) { - struct.set(__sig$LAYOUT, __sig$OFFSET, fieldValue); - } - - private static final SequenceLayout __opaque$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("__opaque")); - - /** - * Layout for field: - * {@snippet lang=c : - * char __opaque[8] - * } - */ - public static final SequenceLayout __opaque$layout() { - return __opaque$LAYOUT; - } - - private static final long __opaque$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * char __opaque[8] - * } - */ - public static final long __opaque$offset() { - return __opaque$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * char __opaque[8] - * } - */ - public static MemorySegment __opaque(MemorySegment struct) { - return struct.asSlice(__opaque$OFFSET, __opaque$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * char __opaque[8] - * } - */ - public static void __opaque(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, __opaque$OFFSET, __opaque$LAYOUT.byteSize()); - } - - private static long[] __opaque$DIMS = { 8 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * char __opaque[8] - * } - */ - public static long[] __opaque$dimensions() { - return __opaque$DIMS; - } - private static final VarHandle __opaque$ELEM_HANDLE = __opaque$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * char __opaque[8] - * } - */ - public static byte __opaque(MemorySegment struct, long index0) { - return (byte)__opaque$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * char __opaque[8] - * } - */ - public static void __opaque(MemorySegment struct, long index0, byte fieldValue) { - __opaque$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_once_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_once_t.java deleted file mode 100644 index b64f81dd4..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_once_t.java +++ /dev/null @@ -1,206 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct _opaque_pthread_once_t { - * long __sig; - * char __opaque[8]; - * } - * } - */ -public class _opaque_pthread_once_t { - - _opaque_pthread_once_t() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_LONG.withName("__sig"), - MemoryLayout.sequenceLayout(8, somelib_h.C_CHAR).withName("__opaque") - ).withName("_opaque_pthread_once_t"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong __sig$LAYOUT = (OfLong)$LAYOUT.select(groupElement("__sig")); - - /** - * Layout for field: - * {@snippet lang=c : - * long __sig - * } - */ - public static final OfLong __sig$layout() { - return __sig$LAYOUT; - } - - private static final long __sig$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * long __sig - * } - */ - public static final long __sig$offset() { - return __sig$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * long __sig - * } - */ - public static long __sig(MemorySegment struct) { - return struct.get(__sig$LAYOUT, __sig$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * long __sig - * } - */ - public static void __sig(MemorySegment struct, long fieldValue) { - struct.set(__sig$LAYOUT, __sig$OFFSET, fieldValue); - } - - private static final SequenceLayout __opaque$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("__opaque")); - - /** - * Layout for field: - * {@snippet lang=c : - * char __opaque[8] - * } - */ - public static final SequenceLayout __opaque$layout() { - return __opaque$LAYOUT; - } - - private static final long __opaque$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * char __opaque[8] - * } - */ - public static final long __opaque$offset() { - return __opaque$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * char __opaque[8] - * } - */ - public static MemorySegment __opaque(MemorySegment struct) { - return struct.asSlice(__opaque$OFFSET, __opaque$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * char __opaque[8] - * } - */ - public static void __opaque(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, __opaque$OFFSET, __opaque$LAYOUT.byteSize()); - } - - private static long[] __opaque$DIMS = { 8 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * char __opaque[8] - * } - */ - public static long[] __opaque$dimensions() { - return __opaque$DIMS; - } - private static final VarHandle __opaque$ELEM_HANDLE = __opaque$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * char __opaque[8] - * } - */ - public static byte __opaque(MemorySegment struct, long index0) { - return (byte)__opaque$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * char __opaque[8] - * } - */ - public static void __opaque(MemorySegment struct, long index0, byte fieldValue) { - __opaque$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_rwlock_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_rwlock_t.java deleted file mode 100644 index 8341224b0..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_rwlock_t.java +++ /dev/null @@ -1,206 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct _opaque_pthread_rwlock_t { - * long __sig; - * char __opaque[192]; - * } - * } - */ -public class _opaque_pthread_rwlock_t { - - _opaque_pthread_rwlock_t() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_LONG.withName("__sig"), - MemoryLayout.sequenceLayout(192, somelib_h.C_CHAR).withName("__opaque") - ).withName("_opaque_pthread_rwlock_t"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong __sig$LAYOUT = (OfLong)$LAYOUT.select(groupElement("__sig")); - - /** - * Layout for field: - * {@snippet lang=c : - * long __sig - * } - */ - public static final OfLong __sig$layout() { - return __sig$LAYOUT; - } - - private static final long __sig$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * long __sig - * } - */ - public static final long __sig$offset() { - return __sig$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * long __sig - * } - */ - public static long __sig(MemorySegment struct) { - return struct.get(__sig$LAYOUT, __sig$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * long __sig - * } - */ - public static void __sig(MemorySegment struct, long fieldValue) { - struct.set(__sig$LAYOUT, __sig$OFFSET, fieldValue); - } - - private static final SequenceLayout __opaque$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("__opaque")); - - /** - * Layout for field: - * {@snippet lang=c : - * char __opaque[192] - * } - */ - public static final SequenceLayout __opaque$layout() { - return __opaque$LAYOUT; - } - - private static final long __opaque$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * char __opaque[192] - * } - */ - public static final long __opaque$offset() { - return __opaque$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * char __opaque[192] - * } - */ - public static MemorySegment __opaque(MemorySegment struct) { - return struct.asSlice(__opaque$OFFSET, __opaque$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * char __opaque[192] - * } - */ - public static void __opaque(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, __opaque$OFFSET, __opaque$LAYOUT.byteSize()); - } - - private static long[] __opaque$DIMS = { 192 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * char __opaque[192] - * } - */ - public static long[] __opaque$dimensions() { - return __opaque$DIMS; - } - private static final VarHandle __opaque$ELEM_HANDLE = __opaque$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * char __opaque[192] - * } - */ - public static byte __opaque(MemorySegment struct, long index0) { - return (byte)__opaque$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * char __opaque[192] - * } - */ - public static void __opaque(MemorySegment struct, long index0, byte fieldValue) { - __opaque$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_rwlockattr_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_rwlockattr_t.java deleted file mode 100644 index ef84d9724..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_rwlockattr_t.java +++ /dev/null @@ -1,206 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct _opaque_pthread_rwlockattr_t { - * long __sig; - * char __opaque[16]; - * } - * } - */ -public class _opaque_pthread_rwlockattr_t { - - _opaque_pthread_rwlockattr_t() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_LONG.withName("__sig"), - MemoryLayout.sequenceLayout(16, somelib_h.C_CHAR).withName("__opaque") - ).withName("_opaque_pthread_rwlockattr_t"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong __sig$LAYOUT = (OfLong)$LAYOUT.select(groupElement("__sig")); - - /** - * Layout for field: - * {@snippet lang=c : - * long __sig - * } - */ - public static final OfLong __sig$layout() { - return __sig$LAYOUT; - } - - private static final long __sig$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * long __sig - * } - */ - public static final long __sig$offset() { - return __sig$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * long __sig - * } - */ - public static long __sig(MemorySegment struct) { - return struct.get(__sig$LAYOUT, __sig$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * long __sig - * } - */ - public static void __sig(MemorySegment struct, long fieldValue) { - struct.set(__sig$LAYOUT, __sig$OFFSET, fieldValue); - } - - private static final SequenceLayout __opaque$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("__opaque")); - - /** - * Layout for field: - * {@snippet lang=c : - * char __opaque[16] - * } - */ - public static final SequenceLayout __opaque$layout() { - return __opaque$LAYOUT; - } - - private static final long __opaque$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * char __opaque[16] - * } - */ - public static final long __opaque$offset() { - return __opaque$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * char __opaque[16] - * } - */ - public static MemorySegment __opaque(MemorySegment struct) { - return struct.asSlice(__opaque$OFFSET, __opaque$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * char __opaque[16] - * } - */ - public static void __opaque(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, __opaque$OFFSET, __opaque$LAYOUT.byteSize()); - } - - private static long[] __opaque$DIMS = { 16 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * char __opaque[16] - * } - */ - public static long[] __opaque$dimensions() { - return __opaque$DIMS; - } - private static final VarHandle __opaque$ELEM_HANDLE = __opaque$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * char __opaque[16] - * } - */ - public static byte __opaque(MemorySegment struct, long index0) { - return (byte)__opaque$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * char __opaque[16] - * } - */ - public static void __opaque(MemorySegment struct, long index0, byte fieldValue) { - __opaque$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_t.java deleted file mode 100644 index 1fe6ceda3..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/_opaque_pthread_t.java +++ /dev/null @@ -1,252 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct _opaque_pthread_t { - * long __sig; - * struct __darwin_pthread_handler_rec *__cleanup_stack; - * char __opaque[8176]; - * } - * } - */ -public class _opaque_pthread_t { - - _opaque_pthread_t() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - somelib_h.C_LONG.withName("__sig"), - somelib_h.C_POINTER.withName("__cleanup_stack"), - MemoryLayout.sequenceLayout(8176, somelib_h.C_CHAR).withName("__opaque") - ).withName("_opaque_pthread_t"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong __sig$LAYOUT = (OfLong)$LAYOUT.select(groupElement("__sig")); - - /** - * Layout for field: - * {@snippet lang=c : - * long __sig - * } - */ - public static final OfLong __sig$layout() { - return __sig$LAYOUT; - } - - private static final long __sig$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * long __sig - * } - */ - public static final long __sig$offset() { - return __sig$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * long __sig - * } - */ - public static long __sig(MemorySegment struct) { - return struct.get(__sig$LAYOUT, __sig$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * long __sig - * } - */ - public static void __sig(MemorySegment struct, long fieldValue) { - struct.set(__sig$LAYOUT, __sig$OFFSET, fieldValue); - } - - private static final AddressLayout __cleanup_stack$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("__cleanup_stack")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct __darwin_pthread_handler_rec *__cleanup_stack - * } - */ - public static final AddressLayout __cleanup_stack$layout() { - return __cleanup_stack$LAYOUT; - } - - private static final long __cleanup_stack$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * struct __darwin_pthread_handler_rec *__cleanup_stack - * } - */ - public static final long __cleanup_stack$offset() { - return __cleanup_stack$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct __darwin_pthread_handler_rec *__cleanup_stack - * } - */ - public static MemorySegment __cleanup_stack(MemorySegment struct) { - return struct.get(__cleanup_stack$LAYOUT, __cleanup_stack$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct __darwin_pthread_handler_rec *__cleanup_stack - * } - */ - public static void __cleanup_stack(MemorySegment struct, MemorySegment fieldValue) { - struct.set(__cleanup_stack$LAYOUT, __cleanup_stack$OFFSET, fieldValue); - } - - private static final SequenceLayout __opaque$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("__opaque")); - - /** - * Layout for field: - * {@snippet lang=c : - * char __opaque[8176] - * } - */ - public static final SequenceLayout __opaque$layout() { - return __opaque$LAYOUT; - } - - private static final long __opaque$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * char __opaque[8176] - * } - */ - public static final long __opaque$offset() { - return __opaque$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * char __opaque[8176] - * } - */ - public static MemorySegment __opaque(MemorySegment struct) { - return struct.asSlice(__opaque$OFFSET, __opaque$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * char __opaque[8176] - * } - */ - public static void __opaque(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, __opaque$OFFSET, __opaque$LAYOUT.byteSize()); - } - - private static long[] __opaque$DIMS = { 8176 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * char __opaque[8176] - * } - */ - public static long[] __opaque$dimensions() { - return __opaque$DIMS; - } - private static final VarHandle __opaque$ELEM_HANDLE = __opaque$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * char __opaque[8176] - * } - */ - public static byte __opaque(MemorySegment struct, long index0) { - return (byte)__opaque$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * char __opaque[8176] - * } - */ - public static void __opaque(MemorySegment struct, long index0, byte fieldValue) { - __opaque$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/fd_set.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/fd_set.java deleted file mode 100644 index 618dad751..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/fd_set.java +++ /dev/null @@ -1,160 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct fd_set { - * __int32_t fds_bits[32]; - * } - * } - */ -public class fd_set { - - fd_set() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - MemoryLayout.sequenceLayout(32, somelib_h.C_INT).withName("fds_bits") - ).withName("fd_set"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final SequenceLayout fds_bits$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("fds_bits")); - - /** - * Layout for field: - * {@snippet lang=c : - * __int32_t fds_bits[32] - * } - */ - public static final SequenceLayout fds_bits$layout() { - return fds_bits$LAYOUT; - } - - private static final long fds_bits$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * __int32_t fds_bits[32] - * } - */ - public static final long fds_bits$offset() { - return fds_bits$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * __int32_t fds_bits[32] - * } - */ - public static MemorySegment fds_bits(MemorySegment struct) { - return struct.asSlice(fds_bits$OFFSET, fds_bits$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * __int32_t fds_bits[32] - * } - */ - public static void fds_bits(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, fds_bits$OFFSET, fds_bits$LAYOUT.byteSize()); - } - - private static long[] fds_bits$DIMS = { 32 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * __int32_t fds_bits[32] - * } - */ - public static long[] fds_bits$dimensions() { - return fds_bits$DIMS; - } - private static final VarHandle fds_bits$ELEM_HANDLE = fds_bits$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * __int32_t fds_bits[32] - * } - */ - public static int fds_bits(MemorySegment struct, long index0) { - return (int)fds_bits$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * __int32_t fds_bits[32] - * } - */ - public static void fds_bits(MemorySegment struct, long index0, int fieldValue) { - fds_bits$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/funopen$x0.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/funopen$x0.java deleted file mode 100644 index 1afd8820d..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/funopen$x0.java +++ /dev/null @@ -1,70 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * int (* _Nullable)(void *, char *, int) - * } - */ -public class funopen$x0 { - - funopen$x0() { - // Should not be called directly - } - - /** - * The function pointer signature, expressed as a functional interface - */ - public interface Function { - int apply(MemorySegment _x0, MemorySegment _x1, int _x2); - } - - private static final FunctionDescriptor $DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_INT - ); - - /** - * The descriptor of this function pointer - */ - public static FunctionDescriptor descriptor() { - return $DESC; - } - - private static final MethodHandle UP$MH = somelib_h.upcallHandle(funopen$x0.Function.class, "apply", $DESC); - - /** - * Allocates a new upcall stub, whose implementation is defined by {@code fi}. - * The lifetime of the returned segment is managed by {@code arena} - */ - public static MemorySegment allocate(funopen$x0.Function fi, Arena arena) { - return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena); - } - - private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC); - - /** - * Invoke the upcall stub {@code funcPtr}, with given parameters - */ - public static int invoke(MemorySegment funcPtr,MemorySegment _x0, MemorySegment _x1, int _x2) { - try { - return (int) DOWN$MH.invokeExact(funcPtr, _x0, _x1, _x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/funopen$x1.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/funopen$x1.java deleted file mode 100644 index 3dca88784..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/funopen$x1.java +++ /dev/null @@ -1,70 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * int (* _Nullable)(void *, const char *, int) - * } - */ -public class funopen$x1 { - - funopen$x1() { - // Should not be called directly - } - - /** - * The function pointer signature, expressed as a functional interface - */ - public interface Function { - int apply(MemorySegment _x0, MemorySegment _x1, int _x2); - } - - private static final FunctionDescriptor $DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_INT - ); - - /** - * The descriptor of this function pointer - */ - public static FunctionDescriptor descriptor() { - return $DESC; - } - - private static final MethodHandle UP$MH = somelib_h.upcallHandle(funopen$x1.Function.class, "apply", $DESC); - - /** - * Allocates a new upcall stub, whose implementation is defined by {@code fi}. - * The lifetime of the returned segment is managed by {@code arena} - */ - public static MemorySegment allocate(funopen$x1.Function fi, Arena arena) { - return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena); - } - - private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC); - - /** - * Invoke the upcall stub {@code funcPtr}, with given parameters - */ - public static int invoke(MemorySegment funcPtr,MemorySegment _x0, MemorySegment _x1, int _x2) { - try { - return (int) DOWN$MH.invokeExact(funcPtr, _x0, _x1, _x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/funopen$x2.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/funopen$x2.java deleted file mode 100644 index 0fe263b6a..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/funopen$x2.java +++ /dev/null @@ -1,70 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * fpos_t (* _Nullable)(void *, fpos_t, int) - * } - */ -public class funopen$x2 { - - funopen$x2() { - // Should not be called directly - } - - /** - * The function pointer signature, expressed as a functional interface - */ - public interface Function { - long apply(MemorySegment _x0, long _x1, int _x2); - } - - private static final FunctionDescriptor $DESC = FunctionDescriptor.of( - somelib_h.C_LONG_LONG, - somelib_h.C_POINTER, - somelib_h.C_LONG_LONG, - somelib_h.C_INT - ); - - /** - * The descriptor of this function pointer - */ - public static FunctionDescriptor descriptor() { - return $DESC; - } - - private static final MethodHandle UP$MH = somelib_h.upcallHandle(funopen$x2.Function.class, "apply", $DESC); - - /** - * Allocates a new upcall stub, whose implementation is defined by {@code fi}. - * The lifetime of the returned segment is managed by {@code arena} - */ - public static MemorySegment allocate(funopen$x2.Function fi, Arena arena) { - return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena); - } - - private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC); - - /** - * Invoke the upcall stub {@code funcPtr}, with given parameters - */ - public static long invoke(MemorySegment funcPtr,MemorySegment _x0, long _x1, int _x2) { - try { - return (long) DOWN$MH.invokeExact(funcPtr, _x0, _x1, _x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/funopen$x3.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/funopen$x3.java deleted file mode 100644 index dd516ce4c..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/funopen$x3.java +++ /dev/null @@ -1,68 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * int (* _Nullable)(void *) - * } - */ -public class funopen$x3 { - - funopen$x3() { - // Should not be called directly - } - - /** - * The function pointer signature, expressed as a functional interface - */ - public interface Function { - int apply(MemorySegment _x0); - } - - private static final FunctionDescriptor $DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - /** - * The descriptor of this function pointer - */ - public static FunctionDescriptor descriptor() { - return $DESC; - } - - private static final MethodHandle UP$MH = somelib_h.upcallHandle(funopen$x3.Function.class, "apply", $DESC); - - /** - * Allocates a new upcall stub, whose implementation is defined by {@code fi}. - * The lifetime of the returned segment is managed by {@code arena} - */ - public static MemorySegment allocate(funopen$x3.Function fi, Arena arena) { - return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena); - } - - private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC); - - /** - * Invoke the upcall stub {@code funcPtr}, with given parameters - */ - public static int invoke(MemorySegment funcPtr,MemorySegment _x0) { - try { - return (int) DOWN$MH.invokeExact(funcPtr, _x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_attr_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_attr_t.java deleted file mode 100644 index e4bfe4bbf..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_attr_t.java +++ /dev/null @@ -1,26 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * typedef __darwin_pthread_attr_t pthread_attr_t - * } - */ -public class pthread_attr_t extends _opaque_pthread_attr_t { - - pthread_attr_t() { - // Should not be called directly - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_cond_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_cond_t.java deleted file mode 100644 index ad8ee80cb..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_cond_t.java +++ /dev/null @@ -1,26 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * typedef __darwin_pthread_cond_t pthread_cond_t - * } - */ -public class pthread_cond_t extends _opaque_pthread_cond_t { - - pthread_cond_t() { - // Should not be called directly - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_condattr_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_condattr_t.java deleted file mode 100644 index b3b04c732..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_condattr_t.java +++ /dev/null @@ -1,26 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * typedef __darwin_pthread_condattr_t pthread_condattr_t - * } - */ -public class pthread_condattr_t extends _opaque_pthread_condattr_t { - - pthread_condattr_t() { - // Should not be called directly - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_mutex_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_mutex_t.java deleted file mode 100644 index 41e191b4b..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_mutex_t.java +++ /dev/null @@ -1,26 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * typedef __darwin_pthread_mutex_t pthread_mutex_t - * } - */ -public class pthread_mutex_t extends _opaque_pthread_mutex_t { - - pthread_mutex_t() { - // Should not be called directly - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_mutexattr_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_mutexattr_t.java deleted file mode 100644 index f7bb8b17d..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_mutexattr_t.java +++ /dev/null @@ -1,26 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * typedef __darwin_pthread_mutexattr_t pthread_mutexattr_t - * } - */ -public class pthread_mutexattr_t extends _opaque_pthread_mutexattr_t { - - pthread_mutexattr_t() { - // Should not be called directly - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_once_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_once_t.java deleted file mode 100644 index cc2bf572b..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_once_t.java +++ /dev/null @@ -1,26 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * typedef __darwin_pthread_once_t pthread_once_t - * } - */ -public class pthread_once_t extends _opaque_pthread_once_t { - - pthread_once_t() { - // Should not be called directly - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_rwlock_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_rwlock_t.java deleted file mode 100644 index 4e774a4c2..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_rwlock_t.java +++ /dev/null @@ -1,26 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * typedef __darwin_pthread_rwlock_t pthread_rwlock_t - * } - */ -public class pthread_rwlock_t extends _opaque_pthread_rwlock_t { - - pthread_rwlock_t() { - // Should not be called directly - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_rwlockattr_t.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_rwlockattr_t.java deleted file mode 100644 index a674c0acf..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/pthread_rwlockattr_t.java +++ /dev/null @@ -1,26 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * typedef __darwin_pthread_rwlockattr_t pthread_rwlockattr_t - * } - */ -public class pthread_rwlockattr_t extends _opaque_pthread_rwlockattr_t { - - pthread_rwlockattr_t() { - // Should not be called directly - } -} - diff --git a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java b/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java deleted file mode 100644 index 9683d5616..000000000 --- a/example/java/ICU4X4J/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java +++ /dev/null @@ -1,12136 +0,0 @@ -// Generated by jextract - -package dev.diplomattest.somelib.ntv; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -public class somelib_h { - - somelib_h() { - // Should not be called directly - } - - static final Arena LIBRARY_ARENA = Arena.ofAuto(); - static final boolean TRACE_DOWNCALLS = Boolean.getBoolean("jextract.trace.downcalls"); - - static void traceDowncall(String name, Object... args) { - String traceArgs = Arrays.stream(args) - .map(Object::toString) - .collect(Collectors.joining(", ")); - System.out.printf("%s(%s)\n", name, traceArgs); - } - - static MemorySegment findOrThrow(String symbol) { - return SYMBOL_LOOKUP.find(symbol) - .orElseThrow(() -> new UnsatisfiedLinkError("unresolved symbol: " + symbol)); - } - - static MethodHandle upcallHandle(Class fi, String name, FunctionDescriptor fdesc) { - try { - return MethodHandles.lookup().findVirtual(fi, name, fdesc.toMethodType()); - } catch (ReflectiveOperationException ex) { - throw new AssertionError(ex); - } - } - - static MemoryLayout align(MemoryLayout layout, long align) { - return switch (layout) { - case PaddingLayout p -> p; - case ValueLayout v -> v.withByteAlignment(align); - case GroupLayout g -> { - MemoryLayout[] alignedMembers = g.memberLayouts().stream() - .map(m -> align(m, align)).toArray(MemoryLayout[]::new); - yield g instanceof StructLayout ? - MemoryLayout.structLayout(alignedMembers) : MemoryLayout.unionLayout(alignedMembers); - } - case SequenceLayout s -> MemoryLayout.sequenceLayout(s.elementCount(), align(s.elementLayout(), align)); - }; - } - - static final SymbolLookup SYMBOL_LOOKUP = SymbolLookup.libraryLookup(System.mapLibraryName("somelib"), LIBRARY_ARENA) - .or(SymbolLookup.loaderLookup()) - .or(Linker.nativeLinker().defaultLookup()); - - public static final ValueLayout.OfBoolean C_BOOL = ValueLayout.JAVA_BOOLEAN; - public static final ValueLayout.OfByte C_CHAR = ValueLayout.JAVA_BYTE; - public static final ValueLayout.OfShort C_SHORT = ValueLayout.JAVA_SHORT; - public static final ValueLayout.OfInt C_INT = ValueLayout.JAVA_INT; - public static final ValueLayout.OfLong C_LONG_LONG = ValueLayout.JAVA_LONG; - public static final ValueLayout.OfFloat C_FLOAT = ValueLayout.JAVA_FLOAT; - public static final ValueLayout.OfDouble C_DOUBLE = ValueLayout.JAVA_DOUBLE; - public static final AddressLayout C_POINTER = ValueLayout.ADDRESS - .withTargetLayout(MemoryLayout.sequenceLayout(java.lang.Long.MAX_VALUE, JAVA_BYTE)); - public static final ValueLayout.OfLong C_LONG = ValueLayout.JAVA_LONG; - private static final int __has_safe_buffers = (int)0L; - /** - * {@snippet lang=c : - * #define __has_safe_buffers 0 - * } - */ - public static int __has_safe_buffers() { - return __has_safe_buffers; - } - private static final int __DARWIN_ONLY_64_BIT_INO_T = (int)1L; - /** - * {@snippet lang=c : - * #define __DARWIN_ONLY_64_BIT_INO_T 1 - * } - */ - public static int __DARWIN_ONLY_64_BIT_INO_T() { - return __DARWIN_ONLY_64_BIT_INO_T; - } - private static final int __DARWIN_ONLY_UNIX_CONFORMANCE = (int)1L; - /** - * {@snippet lang=c : - * #define __DARWIN_ONLY_UNIX_CONFORMANCE 1 - * } - */ - public static int __DARWIN_ONLY_UNIX_CONFORMANCE() { - return __DARWIN_ONLY_UNIX_CONFORMANCE; - } - private static final int __DARWIN_ONLY_VERS_1050 = (int)1L; - /** - * {@snippet lang=c : - * #define __DARWIN_ONLY_VERS_1050 1 - * } - */ - public static int __DARWIN_ONLY_VERS_1050() { - return __DARWIN_ONLY_VERS_1050; - } - private static final int __DARWIN_UNIX03 = (int)1L; - /** - * {@snippet lang=c : - * #define __DARWIN_UNIX03 1 - * } - */ - public static int __DARWIN_UNIX03() { - return __DARWIN_UNIX03; - } - private static final int __DARWIN_64_BIT_INO_T = (int)1L; - /** - * {@snippet lang=c : - * #define __DARWIN_64_BIT_INO_T 1 - * } - */ - public static int __DARWIN_64_BIT_INO_T() { - return __DARWIN_64_BIT_INO_T; - } - private static final int __DARWIN_VERS_1050 = (int)1L; - /** - * {@snippet lang=c : - * #define __DARWIN_VERS_1050 1 - * } - */ - public static int __DARWIN_VERS_1050() { - return __DARWIN_VERS_1050; - } - private static final int __DARWIN_NON_CANCELABLE = (int)0L; - /** - * {@snippet lang=c : - * #define __DARWIN_NON_CANCELABLE 0 - * } - */ - public static int __DARWIN_NON_CANCELABLE() { - return __DARWIN_NON_CANCELABLE; - } - private static final int __STDC_WANT_LIB_EXT1__ = (int)1L; - /** - * {@snippet lang=c : - * #define __STDC_WANT_LIB_EXT1__ 1 - * } - */ - public static int __STDC_WANT_LIB_EXT1__() { - return __STDC_WANT_LIB_EXT1__; - } - private static final int __DARWIN_NO_LONG_LONG = (int)0L; - /** - * {@snippet lang=c : - * #define __DARWIN_NO_LONG_LONG 0 - * } - */ - public static int __DARWIN_NO_LONG_LONG() { - return __DARWIN_NO_LONG_LONG; - } - private static final int _DARWIN_FEATURE_64_BIT_INODE = (int)1L; - /** - * {@snippet lang=c : - * #define _DARWIN_FEATURE_64_BIT_INODE 1 - * } - */ - public static int _DARWIN_FEATURE_64_BIT_INODE() { - return _DARWIN_FEATURE_64_BIT_INODE; - } - private static final int _DARWIN_FEATURE_ONLY_64_BIT_INODE = (int)1L; - /** - * {@snippet lang=c : - * #define _DARWIN_FEATURE_ONLY_64_BIT_INODE 1 - * } - */ - public static int _DARWIN_FEATURE_ONLY_64_BIT_INODE() { - return _DARWIN_FEATURE_ONLY_64_BIT_INODE; - } - private static final int _DARWIN_FEATURE_ONLY_VERS_1050 = (int)1L; - /** - * {@snippet lang=c : - * #define _DARWIN_FEATURE_ONLY_VERS_1050 1 - * } - */ - public static int _DARWIN_FEATURE_ONLY_VERS_1050() { - return _DARWIN_FEATURE_ONLY_VERS_1050; - } - private static final int _DARWIN_FEATURE_ONLY_UNIX_CONFORMANCE = (int)1L; - /** - * {@snippet lang=c : - * #define _DARWIN_FEATURE_ONLY_UNIX_CONFORMANCE 1 - * } - */ - public static int _DARWIN_FEATURE_ONLY_UNIX_CONFORMANCE() { - return _DARWIN_FEATURE_ONLY_UNIX_CONFORMANCE; - } - private static final int _DARWIN_FEATURE_UNIX_CONFORMANCE = (int)3L; - /** - * {@snippet lang=c : - * #define _DARWIN_FEATURE_UNIX_CONFORMANCE 3 - * } - */ - public static int _DARWIN_FEATURE_UNIX_CONFORMANCE() { - return _DARWIN_FEATURE_UNIX_CONFORMANCE; - } - private static final int __has_ptrcheck = (int)0L; - /** - * {@snippet lang=c : - * #define __has_ptrcheck 0 - * } - */ - public static int __has_ptrcheck() { - return __has_ptrcheck; - } - private static final int __API_TO_BE_DEPRECATED = (int)100000L; - /** - * {@snippet lang=c : - * #define __API_TO_BE_DEPRECATED 100000 - * } - */ - public static int __API_TO_BE_DEPRECATED() { - return __API_TO_BE_DEPRECATED; - } - private static final int __API_TO_BE_DEPRECATED_MACOS = (int)100000L; - /** - * {@snippet lang=c : - * #define __API_TO_BE_DEPRECATED_MACOS 100000 - * } - */ - public static int __API_TO_BE_DEPRECATED_MACOS() { - return __API_TO_BE_DEPRECATED_MACOS; - } - private static final int __API_TO_BE_DEPRECATED_IOS = (int)100000L; - /** - * {@snippet lang=c : - * #define __API_TO_BE_DEPRECATED_IOS 100000 - * } - */ - public static int __API_TO_BE_DEPRECATED_IOS() { - return __API_TO_BE_DEPRECATED_IOS; - } - private static final int __API_TO_BE_DEPRECATED_MACCATALYST = (int)100000L; - /** - * {@snippet lang=c : - * #define __API_TO_BE_DEPRECATED_MACCATALYST 100000 - * } - */ - public static int __API_TO_BE_DEPRECATED_MACCATALYST() { - return __API_TO_BE_DEPRECATED_MACCATALYST; - } - private static final int __API_TO_BE_DEPRECATED_WATCHOS = (int)100000L; - /** - * {@snippet lang=c : - * #define __API_TO_BE_DEPRECATED_WATCHOS 100000 - * } - */ - public static int __API_TO_BE_DEPRECATED_WATCHOS() { - return __API_TO_BE_DEPRECATED_WATCHOS; - } - private static final int __API_TO_BE_DEPRECATED_TVOS = (int)100000L; - /** - * {@snippet lang=c : - * #define __API_TO_BE_DEPRECATED_TVOS 100000 - * } - */ - public static int __API_TO_BE_DEPRECATED_TVOS() { - return __API_TO_BE_DEPRECATED_TVOS; - } - private static final int __API_TO_BE_DEPRECATED_DRIVERKIT = (int)100000L; - /** - * {@snippet lang=c : - * #define __API_TO_BE_DEPRECATED_DRIVERKIT 100000 - * } - */ - public static int __API_TO_BE_DEPRECATED_DRIVERKIT() { - return __API_TO_BE_DEPRECATED_DRIVERKIT; - } - private static final int __API_TO_BE_DEPRECATED_VISIONOS = (int)100000L; - /** - * {@snippet lang=c : - * #define __API_TO_BE_DEPRECATED_VISIONOS 100000 - * } - */ - public static int __API_TO_BE_DEPRECATED_VISIONOS() { - return __API_TO_BE_DEPRECATED_VISIONOS; - } - private static final int __MAC_10_0 = (int)1000L; - /** - * {@snippet lang=c : - * #define __MAC_10_0 1000 - * } - */ - public static int __MAC_10_0() { - return __MAC_10_0; - } - private static final int __MAC_10_1 = (int)1010L; - /** - * {@snippet lang=c : - * #define __MAC_10_1 1010 - * } - */ - public static int __MAC_10_1() { - return __MAC_10_1; - } - private static final int __MAC_10_2 = (int)1020L; - /** - * {@snippet lang=c : - * #define __MAC_10_2 1020 - * } - */ - public static int __MAC_10_2() { - return __MAC_10_2; - } - private static final int __MAC_10_3 = (int)1030L; - /** - * {@snippet lang=c : - * #define __MAC_10_3 1030 - * } - */ - public static int __MAC_10_3() { - return __MAC_10_3; - } - private static final int __MAC_10_4 = (int)1040L; - /** - * {@snippet lang=c : - * #define __MAC_10_4 1040 - * } - */ - public static int __MAC_10_4() { - return __MAC_10_4; - } - private static final int __MAC_10_5 = (int)1050L; - /** - * {@snippet lang=c : - * #define __MAC_10_5 1050 - * } - */ - public static int __MAC_10_5() { - return __MAC_10_5; - } - private static final int __MAC_10_6 = (int)1060L; - /** - * {@snippet lang=c : - * #define __MAC_10_6 1060 - * } - */ - public static int __MAC_10_6() { - return __MAC_10_6; - } - private static final int __MAC_10_7 = (int)1070L; - /** - * {@snippet lang=c : - * #define __MAC_10_7 1070 - * } - */ - public static int __MAC_10_7() { - return __MAC_10_7; - } - private static final int __MAC_10_8 = (int)1080L; - /** - * {@snippet lang=c : - * #define __MAC_10_8 1080 - * } - */ - public static int __MAC_10_8() { - return __MAC_10_8; - } - private static final int __MAC_10_9 = (int)1090L; - /** - * {@snippet lang=c : - * #define __MAC_10_9 1090 - * } - */ - public static int __MAC_10_9() { - return __MAC_10_9; - } - private static final int __MAC_10_10 = (int)101000L; - /** - * {@snippet lang=c : - * #define __MAC_10_10 101000 - * } - */ - public static int __MAC_10_10() { - return __MAC_10_10; - } - private static final int __MAC_10_10_2 = (int)101002L; - /** - * {@snippet lang=c : - * #define __MAC_10_10_2 101002 - * } - */ - public static int __MAC_10_10_2() { - return __MAC_10_10_2; - } - private static final int __MAC_10_10_3 = (int)101003L; - /** - * {@snippet lang=c : - * #define __MAC_10_10_3 101003 - * } - */ - public static int __MAC_10_10_3() { - return __MAC_10_10_3; - } - private static final int __MAC_10_11 = (int)101100L; - /** - * {@snippet lang=c : - * #define __MAC_10_11 101100 - * } - */ - public static int __MAC_10_11() { - return __MAC_10_11; - } - private static final int __MAC_10_11_2 = (int)101102L; - /** - * {@snippet lang=c : - * #define __MAC_10_11_2 101102 - * } - */ - public static int __MAC_10_11_2() { - return __MAC_10_11_2; - } - private static final int __MAC_10_11_3 = (int)101103L; - /** - * {@snippet lang=c : - * #define __MAC_10_11_3 101103 - * } - */ - public static int __MAC_10_11_3() { - return __MAC_10_11_3; - } - private static final int __MAC_10_11_4 = (int)101104L; - /** - * {@snippet lang=c : - * #define __MAC_10_11_4 101104 - * } - */ - public static int __MAC_10_11_4() { - return __MAC_10_11_4; - } - private static final int __MAC_10_12 = (int)101200L; - /** - * {@snippet lang=c : - * #define __MAC_10_12 101200 - * } - */ - public static int __MAC_10_12() { - return __MAC_10_12; - } - private static final int __MAC_10_12_1 = (int)101201L; - /** - * {@snippet lang=c : - * #define __MAC_10_12_1 101201 - * } - */ - public static int __MAC_10_12_1() { - return __MAC_10_12_1; - } - private static final int __MAC_10_12_2 = (int)101202L; - /** - * {@snippet lang=c : - * #define __MAC_10_12_2 101202 - * } - */ - public static int __MAC_10_12_2() { - return __MAC_10_12_2; - } - private static final int __MAC_10_12_4 = (int)101204L; - /** - * {@snippet lang=c : - * #define __MAC_10_12_4 101204 - * } - */ - public static int __MAC_10_12_4() { - return __MAC_10_12_4; - } - private static final int __MAC_10_13 = (int)101300L; - /** - * {@snippet lang=c : - * #define __MAC_10_13 101300 - * } - */ - public static int __MAC_10_13() { - return __MAC_10_13; - } - private static final int __MAC_10_13_1 = (int)101301L; - /** - * {@snippet lang=c : - * #define __MAC_10_13_1 101301 - * } - */ - public static int __MAC_10_13_1() { - return __MAC_10_13_1; - } - private static final int __MAC_10_13_2 = (int)101302L; - /** - * {@snippet lang=c : - * #define __MAC_10_13_2 101302 - * } - */ - public static int __MAC_10_13_2() { - return __MAC_10_13_2; - } - private static final int __MAC_10_13_4 = (int)101304L; - /** - * {@snippet lang=c : - * #define __MAC_10_13_4 101304 - * } - */ - public static int __MAC_10_13_4() { - return __MAC_10_13_4; - } - private static final int __MAC_10_14 = (int)101400L; - /** - * {@snippet lang=c : - * #define __MAC_10_14 101400 - * } - */ - public static int __MAC_10_14() { - return __MAC_10_14; - } - private static final int __MAC_10_14_1 = (int)101401L; - /** - * {@snippet lang=c : - * #define __MAC_10_14_1 101401 - * } - */ - public static int __MAC_10_14_1() { - return __MAC_10_14_1; - } - private static final int __MAC_10_14_4 = (int)101404L; - /** - * {@snippet lang=c : - * #define __MAC_10_14_4 101404 - * } - */ - public static int __MAC_10_14_4() { - return __MAC_10_14_4; - } - private static final int __MAC_10_14_5 = (int)101405L; - /** - * {@snippet lang=c : - * #define __MAC_10_14_5 101405 - * } - */ - public static int __MAC_10_14_5() { - return __MAC_10_14_5; - } - private static final int __MAC_10_14_6 = (int)101406L; - /** - * {@snippet lang=c : - * #define __MAC_10_14_6 101406 - * } - */ - public static int __MAC_10_14_6() { - return __MAC_10_14_6; - } - private static final int __MAC_10_15 = (int)101500L; - /** - * {@snippet lang=c : - * #define __MAC_10_15 101500 - * } - */ - public static int __MAC_10_15() { - return __MAC_10_15; - } - private static final int __MAC_10_15_1 = (int)101501L; - /** - * {@snippet lang=c : - * #define __MAC_10_15_1 101501 - * } - */ - public static int __MAC_10_15_1() { - return __MAC_10_15_1; - } - private static final int __MAC_10_15_4 = (int)101504L; - /** - * {@snippet lang=c : - * #define __MAC_10_15_4 101504 - * } - */ - public static int __MAC_10_15_4() { - return __MAC_10_15_4; - } - private static final int __MAC_10_16 = (int)101600L; - /** - * {@snippet lang=c : - * #define __MAC_10_16 101600 - * } - */ - public static int __MAC_10_16() { - return __MAC_10_16; - } - private static final int __MAC_11_0 = (int)110000L; - /** - * {@snippet lang=c : - * #define __MAC_11_0 110000 - * } - */ - public static int __MAC_11_0() { - return __MAC_11_0; - } - private static final int __MAC_11_1 = (int)110100L; - /** - * {@snippet lang=c : - * #define __MAC_11_1 110100 - * } - */ - public static int __MAC_11_1() { - return __MAC_11_1; - } - private static final int __MAC_11_3 = (int)110300L; - /** - * {@snippet lang=c : - * #define __MAC_11_3 110300 - * } - */ - public static int __MAC_11_3() { - return __MAC_11_3; - } - private static final int __MAC_11_4 = (int)110400L; - /** - * {@snippet lang=c : - * #define __MAC_11_4 110400 - * } - */ - public static int __MAC_11_4() { - return __MAC_11_4; - } - private static final int __MAC_11_5 = (int)110500L; - /** - * {@snippet lang=c : - * #define __MAC_11_5 110500 - * } - */ - public static int __MAC_11_5() { - return __MAC_11_5; - } - private static final int __MAC_11_6 = (int)110600L; - /** - * {@snippet lang=c : - * #define __MAC_11_6 110600 - * } - */ - public static int __MAC_11_6() { - return __MAC_11_6; - } - private static final int __MAC_12_0 = (int)120000L; - /** - * {@snippet lang=c : - * #define __MAC_12_0 120000 - * } - */ - public static int __MAC_12_0() { - return __MAC_12_0; - } - private static final int __MAC_12_1 = (int)120100L; - /** - * {@snippet lang=c : - * #define __MAC_12_1 120100 - * } - */ - public static int __MAC_12_1() { - return __MAC_12_1; - } - private static final int __MAC_12_2 = (int)120200L; - /** - * {@snippet lang=c : - * #define __MAC_12_2 120200 - * } - */ - public static int __MAC_12_2() { - return __MAC_12_2; - } - private static final int __MAC_12_3 = (int)120300L; - /** - * {@snippet lang=c : - * #define __MAC_12_3 120300 - * } - */ - public static int __MAC_12_3() { - return __MAC_12_3; - } - private static final int __MAC_12_4 = (int)120400L; - /** - * {@snippet lang=c : - * #define __MAC_12_4 120400 - * } - */ - public static int __MAC_12_4() { - return __MAC_12_4; - } - private static final int __MAC_12_5 = (int)120500L; - /** - * {@snippet lang=c : - * #define __MAC_12_5 120500 - * } - */ - public static int __MAC_12_5() { - return __MAC_12_5; - } - private static final int __MAC_12_6 = (int)120600L; - /** - * {@snippet lang=c : - * #define __MAC_12_6 120600 - * } - */ - public static int __MAC_12_6() { - return __MAC_12_6; - } - private static final int __MAC_12_7 = (int)120700L; - /** - * {@snippet lang=c : - * #define __MAC_12_7 120700 - * } - */ - public static int __MAC_12_7() { - return __MAC_12_7; - } - private static final int __MAC_13_0 = (int)130000L; - /** - * {@snippet lang=c : - * #define __MAC_13_0 130000 - * } - */ - public static int __MAC_13_0() { - return __MAC_13_0; - } - private static final int __MAC_13_1 = (int)130100L; - /** - * {@snippet lang=c : - * #define __MAC_13_1 130100 - * } - */ - public static int __MAC_13_1() { - return __MAC_13_1; - } - private static final int __MAC_13_2 = (int)130200L; - /** - * {@snippet lang=c : - * #define __MAC_13_2 130200 - * } - */ - public static int __MAC_13_2() { - return __MAC_13_2; - } - private static final int __MAC_13_3 = (int)130300L; - /** - * {@snippet lang=c : - * #define __MAC_13_3 130300 - * } - */ - public static int __MAC_13_3() { - return __MAC_13_3; - } - private static final int __MAC_13_4 = (int)130400L; - /** - * {@snippet lang=c : - * #define __MAC_13_4 130400 - * } - */ - public static int __MAC_13_4() { - return __MAC_13_4; - } - private static final int __MAC_13_5 = (int)130500L; - /** - * {@snippet lang=c : - * #define __MAC_13_5 130500 - * } - */ - public static int __MAC_13_5() { - return __MAC_13_5; - } - private static final int __MAC_13_6 = (int)130600L; - /** - * {@snippet lang=c : - * #define __MAC_13_6 130600 - * } - */ - public static int __MAC_13_6() { - return __MAC_13_6; - } - private static final int __MAC_14_0 = (int)140000L; - /** - * {@snippet lang=c : - * #define __MAC_14_0 140000 - * } - */ - public static int __MAC_14_0() { - return __MAC_14_0; - } - private static final int __MAC_14_1 = (int)140100L; - /** - * {@snippet lang=c : - * #define __MAC_14_1 140100 - * } - */ - public static int __MAC_14_1() { - return __MAC_14_1; - } - private static final int __MAC_14_2 = (int)140200L; - /** - * {@snippet lang=c : - * #define __MAC_14_2 140200 - * } - */ - public static int __MAC_14_2() { - return __MAC_14_2; - } - private static final int __MAC_14_3 = (int)140300L; - /** - * {@snippet lang=c : - * #define __MAC_14_3 140300 - * } - */ - public static int __MAC_14_3() { - return __MAC_14_3; - } - private static final int __MAC_14_4 = (int)140400L; - /** - * {@snippet lang=c : - * #define __MAC_14_4 140400 - * } - */ - public static int __MAC_14_4() { - return __MAC_14_4; - } - private static final int __MAC_14_5 = (int)140500L; - /** - * {@snippet lang=c : - * #define __MAC_14_5 140500 - * } - */ - public static int __MAC_14_5() { - return __MAC_14_5; - } - private static final int __IPHONE_2_0 = (int)20000L; - /** - * {@snippet lang=c : - * #define __IPHONE_2_0 20000 - * } - */ - public static int __IPHONE_2_0() { - return __IPHONE_2_0; - } - private static final int __IPHONE_2_1 = (int)20100L; - /** - * {@snippet lang=c : - * #define __IPHONE_2_1 20100 - * } - */ - public static int __IPHONE_2_1() { - return __IPHONE_2_1; - } - private static final int __IPHONE_2_2 = (int)20200L; - /** - * {@snippet lang=c : - * #define __IPHONE_2_2 20200 - * } - */ - public static int __IPHONE_2_2() { - return __IPHONE_2_2; - } - private static final int __IPHONE_3_0 = (int)30000L; - /** - * {@snippet lang=c : - * #define __IPHONE_3_0 30000 - * } - */ - public static int __IPHONE_3_0() { - return __IPHONE_3_0; - } - private static final int __IPHONE_3_1 = (int)30100L; - /** - * {@snippet lang=c : - * #define __IPHONE_3_1 30100 - * } - */ - public static int __IPHONE_3_1() { - return __IPHONE_3_1; - } - private static final int __IPHONE_3_2 = (int)30200L; - /** - * {@snippet lang=c : - * #define __IPHONE_3_2 30200 - * } - */ - public static int __IPHONE_3_2() { - return __IPHONE_3_2; - } - private static final int __IPHONE_4_0 = (int)40000L; - /** - * {@snippet lang=c : - * #define __IPHONE_4_0 40000 - * } - */ - public static int __IPHONE_4_0() { - return __IPHONE_4_0; - } - private static final int __IPHONE_4_1 = (int)40100L; - /** - * {@snippet lang=c : - * #define __IPHONE_4_1 40100 - * } - */ - public static int __IPHONE_4_1() { - return __IPHONE_4_1; - } - private static final int __IPHONE_4_2 = (int)40200L; - /** - * {@snippet lang=c : - * #define __IPHONE_4_2 40200 - * } - */ - public static int __IPHONE_4_2() { - return __IPHONE_4_2; - } - private static final int __IPHONE_4_3 = (int)40300L; - /** - * {@snippet lang=c : - * #define __IPHONE_4_3 40300 - * } - */ - public static int __IPHONE_4_3() { - return __IPHONE_4_3; - } - private static final int __IPHONE_5_0 = (int)50000L; - /** - * {@snippet lang=c : - * #define __IPHONE_5_0 50000 - * } - */ - public static int __IPHONE_5_0() { - return __IPHONE_5_0; - } - private static final int __IPHONE_5_1 = (int)50100L; - /** - * {@snippet lang=c : - * #define __IPHONE_5_1 50100 - * } - */ - public static int __IPHONE_5_1() { - return __IPHONE_5_1; - } - private static final int __IPHONE_6_0 = (int)60000L; - /** - * {@snippet lang=c : - * #define __IPHONE_6_0 60000 - * } - */ - public static int __IPHONE_6_0() { - return __IPHONE_6_0; - } - private static final int __IPHONE_6_1 = (int)60100L; - /** - * {@snippet lang=c : - * #define __IPHONE_6_1 60100 - * } - */ - public static int __IPHONE_6_1() { - return __IPHONE_6_1; - } - private static final int __IPHONE_7_0 = (int)70000L; - /** - * {@snippet lang=c : - * #define __IPHONE_7_0 70000 - * } - */ - public static int __IPHONE_7_0() { - return __IPHONE_7_0; - } - private static final int __IPHONE_7_1 = (int)70100L; - /** - * {@snippet lang=c : - * #define __IPHONE_7_1 70100 - * } - */ - public static int __IPHONE_7_1() { - return __IPHONE_7_1; - } - private static final int __IPHONE_8_0 = (int)80000L; - /** - * {@snippet lang=c : - * #define __IPHONE_8_0 80000 - * } - */ - public static int __IPHONE_8_0() { - return __IPHONE_8_0; - } - private static final int __IPHONE_8_1 = (int)80100L; - /** - * {@snippet lang=c : - * #define __IPHONE_8_1 80100 - * } - */ - public static int __IPHONE_8_1() { - return __IPHONE_8_1; - } - private static final int __IPHONE_8_2 = (int)80200L; - /** - * {@snippet lang=c : - * #define __IPHONE_8_2 80200 - * } - */ - public static int __IPHONE_8_2() { - return __IPHONE_8_2; - } - private static final int __IPHONE_8_3 = (int)80300L; - /** - * {@snippet lang=c : - * #define __IPHONE_8_3 80300 - * } - */ - public static int __IPHONE_8_3() { - return __IPHONE_8_3; - } - private static final int __IPHONE_8_4 = (int)80400L; - /** - * {@snippet lang=c : - * #define __IPHONE_8_4 80400 - * } - */ - public static int __IPHONE_8_4() { - return __IPHONE_8_4; - } - private static final int __IPHONE_9_0 = (int)90000L; - /** - * {@snippet lang=c : - * #define __IPHONE_9_0 90000 - * } - */ - public static int __IPHONE_9_0() { - return __IPHONE_9_0; - } - private static final int __IPHONE_9_1 = (int)90100L; - /** - * {@snippet lang=c : - * #define __IPHONE_9_1 90100 - * } - */ - public static int __IPHONE_9_1() { - return __IPHONE_9_1; - } - private static final int __IPHONE_9_2 = (int)90200L; - /** - * {@snippet lang=c : - * #define __IPHONE_9_2 90200 - * } - */ - public static int __IPHONE_9_2() { - return __IPHONE_9_2; - } - private static final int __IPHONE_9_3 = (int)90300L; - /** - * {@snippet lang=c : - * #define __IPHONE_9_3 90300 - * } - */ - public static int __IPHONE_9_3() { - return __IPHONE_9_3; - } - private static final int __IPHONE_10_0 = (int)100000L; - /** - * {@snippet lang=c : - * #define __IPHONE_10_0 100000 - * } - */ - public static int __IPHONE_10_0() { - return __IPHONE_10_0; - } - private static final int __IPHONE_10_1 = (int)100100L; - /** - * {@snippet lang=c : - * #define __IPHONE_10_1 100100 - * } - */ - public static int __IPHONE_10_1() { - return __IPHONE_10_1; - } - private static final int __IPHONE_10_2 = (int)100200L; - /** - * {@snippet lang=c : - * #define __IPHONE_10_2 100200 - * } - */ - public static int __IPHONE_10_2() { - return __IPHONE_10_2; - } - private static final int __IPHONE_10_3 = (int)100300L; - /** - * {@snippet lang=c : - * #define __IPHONE_10_3 100300 - * } - */ - public static int __IPHONE_10_3() { - return __IPHONE_10_3; - } - private static final int __IPHONE_11_0 = (int)110000L; - /** - * {@snippet lang=c : - * #define __IPHONE_11_0 110000 - * } - */ - public static int __IPHONE_11_0() { - return __IPHONE_11_0; - } - private static final int __IPHONE_11_1 = (int)110100L; - /** - * {@snippet lang=c : - * #define __IPHONE_11_1 110100 - * } - */ - public static int __IPHONE_11_1() { - return __IPHONE_11_1; - } - private static final int __IPHONE_11_2 = (int)110200L; - /** - * {@snippet lang=c : - * #define __IPHONE_11_2 110200 - * } - */ - public static int __IPHONE_11_2() { - return __IPHONE_11_2; - } - private static final int __IPHONE_11_3 = (int)110300L; - /** - * {@snippet lang=c : - * #define __IPHONE_11_3 110300 - * } - */ - public static int __IPHONE_11_3() { - return __IPHONE_11_3; - } - private static final int __IPHONE_11_4 = (int)110400L; - /** - * {@snippet lang=c : - * #define __IPHONE_11_4 110400 - * } - */ - public static int __IPHONE_11_4() { - return __IPHONE_11_4; - } - private static final int __IPHONE_12_0 = (int)120000L; - /** - * {@snippet lang=c : - * #define __IPHONE_12_0 120000 - * } - */ - public static int __IPHONE_12_0() { - return __IPHONE_12_0; - } - private static final int __IPHONE_12_1 = (int)120100L; - /** - * {@snippet lang=c : - * #define __IPHONE_12_1 120100 - * } - */ - public static int __IPHONE_12_1() { - return __IPHONE_12_1; - } - private static final int __IPHONE_12_2 = (int)120200L; - /** - * {@snippet lang=c : - * #define __IPHONE_12_2 120200 - * } - */ - public static int __IPHONE_12_2() { - return __IPHONE_12_2; - } - private static final int __IPHONE_12_3 = (int)120300L; - /** - * {@snippet lang=c : - * #define __IPHONE_12_3 120300 - * } - */ - public static int __IPHONE_12_3() { - return __IPHONE_12_3; - } - private static final int __IPHONE_12_4 = (int)120400L; - /** - * {@snippet lang=c : - * #define __IPHONE_12_4 120400 - * } - */ - public static int __IPHONE_12_4() { - return __IPHONE_12_4; - } - private static final int __IPHONE_13_0 = (int)130000L; - /** - * {@snippet lang=c : - * #define __IPHONE_13_0 130000 - * } - */ - public static int __IPHONE_13_0() { - return __IPHONE_13_0; - } - private static final int __IPHONE_13_1 = (int)130100L; - /** - * {@snippet lang=c : - * #define __IPHONE_13_1 130100 - * } - */ - public static int __IPHONE_13_1() { - return __IPHONE_13_1; - } - private static final int __IPHONE_13_2 = (int)130200L; - /** - * {@snippet lang=c : - * #define __IPHONE_13_2 130200 - * } - */ - public static int __IPHONE_13_2() { - return __IPHONE_13_2; - } - private static final int __IPHONE_13_3 = (int)130300L; - /** - * {@snippet lang=c : - * #define __IPHONE_13_3 130300 - * } - */ - public static int __IPHONE_13_3() { - return __IPHONE_13_3; - } - private static final int __IPHONE_13_4 = (int)130400L; - /** - * {@snippet lang=c : - * #define __IPHONE_13_4 130400 - * } - */ - public static int __IPHONE_13_4() { - return __IPHONE_13_4; - } - private static final int __IPHONE_13_5 = (int)130500L; - /** - * {@snippet lang=c : - * #define __IPHONE_13_5 130500 - * } - */ - public static int __IPHONE_13_5() { - return __IPHONE_13_5; - } - private static final int __IPHONE_13_6 = (int)130600L; - /** - * {@snippet lang=c : - * #define __IPHONE_13_6 130600 - * } - */ - public static int __IPHONE_13_6() { - return __IPHONE_13_6; - } - private static final int __IPHONE_13_7 = (int)130700L; - /** - * {@snippet lang=c : - * #define __IPHONE_13_7 130700 - * } - */ - public static int __IPHONE_13_7() { - return __IPHONE_13_7; - } - private static final int __IPHONE_14_0 = (int)140000L; - /** - * {@snippet lang=c : - * #define __IPHONE_14_0 140000 - * } - */ - public static int __IPHONE_14_0() { - return __IPHONE_14_0; - } - private static final int __IPHONE_14_1 = (int)140100L; - /** - * {@snippet lang=c : - * #define __IPHONE_14_1 140100 - * } - */ - public static int __IPHONE_14_1() { - return __IPHONE_14_1; - } - private static final int __IPHONE_14_2 = (int)140200L; - /** - * {@snippet lang=c : - * #define __IPHONE_14_2 140200 - * } - */ - public static int __IPHONE_14_2() { - return __IPHONE_14_2; - } - private static final int __IPHONE_14_3 = (int)140300L; - /** - * {@snippet lang=c : - * #define __IPHONE_14_3 140300 - * } - */ - public static int __IPHONE_14_3() { - return __IPHONE_14_3; - } - private static final int __IPHONE_14_5 = (int)140500L; - /** - * {@snippet lang=c : - * #define __IPHONE_14_5 140500 - * } - */ - public static int __IPHONE_14_5() { - return __IPHONE_14_5; - } - private static final int __IPHONE_14_4 = (int)140400L; - /** - * {@snippet lang=c : - * #define __IPHONE_14_4 140400 - * } - */ - public static int __IPHONE_14_4() { - return __IPHONE_14_4; - } - private static final int __IPHONE_14_6 = (int)140600L; - /** - * {@snippet lang=c : - * #define __IPHONE_14_6 140600 - * } - */ - public static int __IPHONE_14_6() { - return __IPHONE_14_6; - } - private static final int __IPHONE_14_7 = (int)140700L; - /** - * {@snippet lang=c : - * #define __IPHONE_14_7 140700 - * } - */ - public static int __IPHONE_14_7() { - return __IPHONE_14_7; - } - private static final int __IPHONE_14_8 = (int)140800L; - /** - * {@snippet lang=c : - * #define __IPHONE_14_8 140800 - * } - */ - public static int __IPHONE_14_8() { - return __IPHONE_14_8; - } - private static final int __IPHONE_15_0 = (int)150000L; - /** - * {@snippet lang=c : - * #define __IPHONE_15_0 150000 - * } - */ - public static int __IPHONE_15_0() { - return __IPHONE_15_0; - } - private static final int __IPHONE_15_1 = (int)150100L; - /** - * {@snippet lang=c : - * #define __IPHONE_15_1 150100 - * } - */ - public static int __IPHONE_15_1() { - return __IPHONE_15_1; - } - private static final int __IPHONE_15_2 = (int)150200L; - /** - * {@snippet lang=c : - * #define __IPHONE_15_2 150200 - * } - */ - public static int __IPHONE_15_2() { - return __IPHONE_15_2; - } - private static final int __IPHONE_15_3 = (int)150300L; - /** - * {@snippet lang=c : - * #define __IPHONE_15_3 150300 - * } - */ - public static int __IPHONE_15_3() { - return __IPHONE_15_3; - } - private static final int __IPHONE_15_4 = (int)150400L; - /** - * {@snippet lang=c : - * #define __IPHONE_15_4 150400 - * } - */ - public static int __IPHONE_15_4() { - return __IPHONE_15_4; - } - private static final int __IPHONE_15_5 = (int)150500L; - /** - * {@snippet lang=c : - * #define __IPHONE_15_5 150500 - * } - */ - public static int __IPHONE_15_5() { - return __IPHONE_15_5; - } - private static final int __IPHONE_15_6 = (int)150600L; - /** - * {@snippet lang=c : - * #define __IPHONE_15_6 150600 - * } - */ - public static int __IPHONE_15_6() { - return __IPHONE_15_6; - } - private static final int __IPHONE_15_7 = (int)150700L; - /** - * {@snippet lang=c : - * #define __IPHONE_15_7 150700 - * } - */ - public static int __IPHONE_15_7() { - return __IPHONE_15_7; - } - private static final int __IPHONE_15_8 = (int)150800L; - /** - * {@snippet lang=c : - * #define __IPHONE_15_8 150800 - * } - */ - public static int __IPHONE_15_8() { - return __IPHONE_15_8; - } - private static final int __IPHONE_16_0 = (int)160000L; - /** - * {@snippet lang=c : - * #define __IPHONE_16_0 160000 - * } - */ - public static int __IPHONE_16_0() { - return __IPHONE_16_0; - } - private static final int __IPHONE_16_1 = (int)160100L; - /** - * {@snippet lang=c : - * #define __IPHONE_16_1 160100 - * } - */ - public static int __IPHONE_16_1() { - return __IPHONE_16_1; - } - private static final int __IPHONE_16_2 = (int)160200L; - /** - * {@snippet lang=c : - * #define __IPHONE_16_2 160200 - * } - */ - public static int __IPHONE_16_2() { - return __IPHONE_16_2; - } - private static final int __IPHONE_16_3 = (int)160300L; - /** - * {@snippet lang=c : - * #define __IPHONE_16_3 160300 - * } - */ - public static int __IPHONE_16_3() { - return __IPHONE_16_3; - } - private static final int __IPHONE_16_4 = (int)160400L; - /** - * {@snippet lang=c : - * #define __IPHONE_16_4 160400 - * } - */ - public static int __IPHONE_16_4() { - return __IPHONE_16_4; - } - private static final int __IPHONE_16_5 = (int)160500L; - /** - * {@snippet lang=c : - * #define __IPHONE_16_5 160500 - * } - */ - public static int __IPHONE_16_5() { - return __IPHONE_16_5; - } - private static final int __IPHONE_16_6 = (int)160600L; - /** - * {@snippet lang=c : - * #define __IPHONE_16_6 160600 - * } - */ - public static int __IPHONE_16_6() { - return __IPHONE_16_6; - } - private static final int __IPHONE_16_7 = (int)160700L; - /** - * {@snippet lang=c : - * #define __IPHONE_16_7 160700 - * } - */ - public static int __IPHONE_16_7() { - return __IPHONE_16_7; - } - private static final int __IPHONE_17_0 = (int)170000L; - /** - * {@snippet lang=c : - * #define __IPHONE_17_0 170000 - * } - */ - public static int __IPHONE_17_0() { - return __IPHONE_17_0; - } - private static final int __IPHONE_17_1 = (int)170100L; - /** - * {@snippet lang=c : - * #define __IPHONE_17_1 170100 - * } - */ - public static int __IPHONE_17_1() { - return __IPHONE_17_1; - } - private static final int __IPHONE_17_2 = (int)170200L; - /** - * {@snippet lang=c : - * #define __IPHONE_17_2 170200 - * } - */ - public static int __IPHONE_17_2() { - return __IPHONE_17_2; - } - private static final int __IPHONE_17_3 = (int)170300L; - /** - * {@snippet lang=c : - * #define __IPHONE_17_3 170300 - * } - */ - public static int __IPHONE_17_3() { - return __IPHONE_17_3; - } - private static final int __IPHONE_17_4 = (int)170400L; - /** - * {@snippet lang=c : - * #define __IPHONE_17_4 170400 - * } - */ - public static int __IPHONE_17_4() { - return __IPHONE_17_4; - } - private static final int __IPHONE_17_5 = (int)170500L; - /** - * {@snippet lang=c : - * #define __IPHONE_17_5 170500 - * } - */ - public static int __IPHONE_17_5() { - return __IPHONE_17_5; - } - private static final int __WATCHOS_1_0 = (int)10000L; - /** - * {@snippet lang=c : - * #define __WATCHOS_1_0 10000 - * } - */ - public static int __WATCHOS_1_0() { - return __WATCHOS_1_0; - } - private static final int __WATCHOS_2_0 = (int)20000L; - /** - * {@snippet lang=c : - * #define __WATCHOS_2_0 20000 - * } - */ - public static int __WATCHOS_2_0() { - return __WATCHOS_2_0; - } - private static final int __WATCHOS_2_1 = (int)20100L; - /** - * {@snippet lang=c : - * #define __WATCHOS_2_1 20100 - * } - */ - public static int __WATCHOS_2_1() { - return __WATCHOS_2_1; - } - private static final int __WATCHOS_2_2 = (int)20200L; - /** - * {@snippet lang=c : - * #define __WATCHOS_2_2 20200 - * } - */ - public static int __WATCHOS_2_2() { - return __WATCHOS_2_2; - } - private static final int __WATCHOS_3_0 = (int)30000L; - /** - * {@snippet lang=c : - * #define __WATCHOS_3_0 30000 - * } - */ - public static int __WATCHOS_3_0() { - return __WATCHOS_3_0; - } - private static final int __WATCHOS_3_1 = (int)30100L; - /** - * {@snippet lang=c : - * #define __WATCHOS_3_1 30100 - * } - */ - public static int __WATCHOS_3_1() { - return __WATCHOS_3_1; - } - private static final int __WATCHOS_3_1_1 = (int)30101L; - /** - * {@snippet lang=c : - * #define __WATCHOS_3_1_1 30101 - * } - */ - public static int __WATCHOS_3_1_1() { - return __WATCHOS_3_1_1; - } - private static final int __WATCHOS_3_2 = (int)30200L; - /** - * {@snippet lang=c : - * #define __WATCHOS_3_2 30200 - * } - */ - public static int __WATCHOS_3_2() { - return __WATCHOS_3_2; - } - private static final int __WATCHOS_4_0 = (int)40000L; - /** - * {@snippet lang=c : - * #define __WATCHOS_4_0 40000 - * } - */ - public static int __WATCHOS_4_0() { - return __WATCHOS_4_0; - } - private static final int __WATCHOS_4_1 = (int)40100L; - /** - * {@snippet lang=c : - * #define __WATCHOS_4_1 40100 - * } - */ - public static int __WATCHOS_4_1() { - return __WATCHOS_4_1; - } - private static final int __WATCHOS_4_2 = (int)40200L; - /** - * {@snippet lang=c : - * #define __WATCHOS_4_2 40200 - * } - */ - public static int __WATCHOS_4_2() { - return __WATCHOS_4_2; - } - private static final int __WATCHOS_4_3 = (int)40300L; - /** - * {@snippet lang=c : - * #define __WATCHOS_4_3 40300 - * } - */ - public static int __WATCHOS_4_3() { - return __WATCHOS_4_3; - } - private static final int __WATCHOS_5_0 = (int)50000L; - /** - * {@snippet lang=c : - * #define __WATCHOS_5_0 50000 - * } - */ - public static int __WATCHOS_5_0() { - return __WATCHOS_5_0; - } - private static final int __WATCHOS_5_1 = (int)50100L; - /** - * {@snippet lang=c : - * #define __WATCHOS_5_1 50100 - * } - */ - public static int __WATCHOS_5_1() { - return __WATCHOS_5_1; - } - private static final int __WATCHOS_5_2 = (int)50200L; - /** - * {@snippet lang=c : - * #define __WATCHOS_5_2 50200 - * } - */ - public static int __WATCHOS_5_2() { - return __WATCHOS_5_2; - } - private static final int __WATCHOS_5_3 = (int)50300L; - /** - * {@snippet lang=c : - * #define __WATCHOS_5_3 50300 - * } - */ - public static int __WATCHOS_5_3() { - return __WATCHOS_5_3; - } - private static final int __WATCHOS_6_0 = (int)60000L; - /** - * {@snippet lang=c : - * #define __WATCHOS_6_0 60000 - * } - */ - public static int __WATCHOS_6_0() { - return __WATCHOS_6_0; - } - private static final int __WATCHOS_6_1 = (int)60100L; - /** - * {@snippet lang=c : - * #define __WATCHOS_6_1 60100 - * } - */ - public static int __WATCHOS_6_1() { - return __WATCHOS_6_1; - } - private static final int __WATCHOS_6_2 = (int)60200L; - /** - * {@snippet lang=c : - * #define __WATCHOS_6_2 60200 - * } - */ - public static int __WATCHOS_6_2() { - return __WATCHOS_6_2; - } - private static final int __WATCHOS_7_0 = (int)70000L; - /** - * {@snippet lang=c : - * #define __WATCHOS_7_0 70000 - * } - */ - public static int __WATCHOS_7_0() { - return __WATCHOS_7_0; - } - private static final int __WATCHOS_7_1 = (int)70100L; - /** - * {@snippet lang=c : - * #define __WATCHOS_7_1 70100 - * } - */ - public static int __WATCHOS_7_1() { - return __WATCHOS_7_1; - } - private static final int __WATCHOS_7_2 = (int)70200L; - /** - * {@snippet lang=c : - * #define __WATCHOS_7_2 70200 - * } - */ - public static int __WATCHOS_7_2() { - return __WATCHOS_7_2; - } - private static final int __WATCHOS_7_3 = (int)70300L; - /** - * {@snippet lang=c : - * #define __WATCHOS_7_3 70300 - * } - */ - public static int __WATCHOS_7_3() { - return __WATCHOS_7_3; - } - private static final int __WATCHOS_7_4 = (int)70400L; - /** - * {@snippet lang=c : - * #define __WATCHOS_7_4 70400 - * } - */ - public static int __WATCHOS_7_4() { - return __WATCHOS_7_4; - } - private static final int __WATCHOS_7_5 = (int)70500L; - /** - * {@snippet lang=c : - * #define __WATCHOS_7_5 70500 - * } - */ - public static int __WATCHOS_7_5() { - return __WATCHOS_7_5; - } - private static final int __WATCHOS_7_6 = (int)70600L; - /** - * {@snippet lang=c : - * #define __WATCHOS_7_6 70600 - * } - */ - public static int __WATCHOS_7_6() { - return __WATCHOS_7_6; - } - private static final int __WATCHOS_8_0 = (int)80000L; - /** - * {@snippet lang=c : - * #define __WATCHOS_8_0 80000 - * } - */ - public static int __WATCHOS_8_0() { - return __WATCHOS_8_0; - } - private static final int __WATCHOS_8_1 = (int)80100L; - /** - * {@snippet lang=c : - * #define __WATCHOS_8_1 80100 - * } - */ - public static int __WATCHOS_8_1() { - return __WATCHOS_8_1; - } - private static final int __WATCHOS_8_3 = (int)80300L; - /** - * {@snippet lang=c : - * #define __WATCHOS_8_3 80300 - * } - */ - public static int __WATCHOS_8_3() { - return __WATCHOS_8_3; - } - private static final int __WATCHOS_8_4 = (int)80400L; - /** - * {@snippet lang=c : - * #define __WATCHOS_8_4 80400 - * } - */ - public static int __WATCHOS_8_4() { - return __WATCHOS_8_4; - } - private static final int __WATCHOS_8_5 = (int)80500L; - /** - * {@snippet lang=c : - * #define __WATCHOS_8_5 80500 - * } - */ - public static int __WATCHOS_8_5() { - return __WATCHOS_8_5; - } - private static final int __WATCHOS_8_6 = (int)80600L; - /** - * {@snippet lang=c : - * #define __WATCHOS_8_6 80600 - * } - */ - public static int __WATCHOS_8_6() { - return __WATCHOS_8_6; - } - private static final int __WATCHOS_8_7 = (int)80700L; - /** - * {@snippet lang=c : - * #define __WATCHOS_8_7 80700 - * } - */ - public static int __WATCHOS_8_7() { - return __WATCHOS_8_7; - } - private static final int __WATCHOS_8_8 = (int)80800L; - /** - * {@snippet lang=c : - * #define __WATCHOS_8_8 80800 - * } - */ - public static int __WATCHOS_8_8() { - return __WATCHOS_8_8; - } - private static final int __WATCHOS_9_0 = (int)90000L; - /** - * {@snippet lang=c : - * #define __WATCHOS_9_0 90000 - * } - */ - public static int __WATCHOS_9_0() { - return __WATCHOS_9_0; - } - private static final int __WATCHOS_9_1 = (int)90100L; - /** - * {@snippet lang=c : - * #define __WATCHOS_9_1 90100 - * } - */ - public static int __WATCHOS_9_1() { - return __WATCHOS_9_1; - } - private static final int __WATCHOS_9_2 = (int)90200L; - /** - * {@snippet lang=c : - * #define __WATCHOS_9_2 90200 - * } - */ - public static int __WATCHOS_9_2() { - return __WATCHOS_9_2; - } - private static final int __WATCHOS_9_3 = (int)90300L; - /** - * {@snippet lang=c : - * #define __WATCHOS_9_3 90300 - * } - */ - public static int __WATCHOS_9_3() { - return __WATCHOS_9_3; - } - private static final int __WATCHOS_9_4 = (int)90400L; - /** - * {@snippet lang=c : - * #define __WATCHOS_9_4 90400 - * } - */ - public static int __WATCHOS_9_4() { - return __WATCHOS_9_4; - } - private static final int __WATCHOS_9_5 = (int)90500L; - /** - * {@snippet lang=c : - * #define __WATCHOS_9_5 90500 - * } - */ - public static int __WATCHOS_9_5() { - return __WATCHOS_9_5; - } - private static final int __WATCHOS_9_6 = (int)90600L; - /** - * {@snippet lang=c : - * #define __WATCHOS_9_6 90600 - * } - */ - public static int __WATCHOS_9_6() { - return __WATCHOS_9_6; - } - private static final int __WATCHOS_10_0 = (int)100000L; - /** - * {@snippet lang=c : - * #define __WATCHOS_10_0 100000 - * } - */ - public static int __WATCHOS_10_0() { - return __WATCHOS_10_0; - } - private static final int __WATCHOS_10_1 = (int)100100L; - /** - * {@snippet lang=c : - * #define __WATCHOS_10_1 100100 - * } - */ - public static int __WATCHOS_10_1() { - return __WATCHOS_10_1; - } - private static final int __WATCHOS_10_2 = (int)100200L; - /** - * {@snippet lang=c : - * #define __WATCHOS_10_2 100200 - * } - */ - public static int __WATCHOS_10_2() { - return __WATCHOS_10_2; - } - private static final int __WATCHOS_10_3 = (int)100300L; - /** - * {@snippet lang=c : - * #define __WATCHOS_10_3 100300 - * } - */ - public static int __WATCHOS_10_3() { - return __WATCHOS_10_3; - } - private static final int __WATCHOS_10_4 = (int)100400L; - /** - * {@snippet lang=c : - * #define __WATCHOS_10_4 100400 - * } - */ - public static int __WATCHOS_10_4() { - return __WATCHOS_10_4; - } - private static final int __WATCHOS_10_5 = (int)100500L; - /** - * {@snippet lang=c : - * #define __WATCHOS_10_5 100500 - * } - */ - public static int __WATCHOS_10_5() { - return __WATCHOS_10_5; - } - private static final int __TVOS_9_0 = (int)90000L; - /** - * {@snippet lang=c : - * #define __TVOS_9_0 90000 - * } - */ - public static int __TVOS_9_0() { - return __TVOS_9_0; - } - private static final int __TVOS_9_1 = (int)90100L; - /** - * {@snippet lang=c : - * #define __TVOS_9_1 90100 - * } - */ - public static int __TVOS_9_1() { - return __TVOS_9_1; - } - private static final int __TVOS_9_2 = (int)90200L; - /** - * {@snippet lang=c : - * #define __TVOS_9_2 90200 - * } - */ - public static int __TVOS_9_2() { - return __TVOS_9_2; - } - private static final int __TVOS_10_0 = (int)100000L; - /** - * {@snippet lang=c : - * #define __TVOS_10_0 100000 - * } - */ - public static int __TVOS_10_0() { - return __TVOS_10_0; - } - private static final int __TVOS_10_0_1 = (int)100001L; - /** - * {@snippet lang=c : - * #define __TVOS_10_0_1 100001 - * } - */ - public static int __TVOS_10_0_1() { - return __TVOS_10_0_1; - } - private static final int __TVOS_10_1 = (int)100100L; - /** - * {@snippet lang=c : - * #define __TVOS_10_1 100100 - * } - */ - public static int __TVOS_10_1() { - return __TVOS_10_1; - } - private static final int __TVOS_10_2 = (int)100200L; - /** - * {@snippet lang=c : - * #define __TVOS_10_2 100200 - * } - */ - public static int __TVOS_10_2() { - return __TVOS_10_2; - } - private static final int __TVOS_11_0 = (int)110000L; - /** - * {@snippet lang=c : - * #define __TVOS_11_0 110000 - * } - */ - public static int __TVOS_11_0() { - return __TVOS_11_0; - } - private static final int __TVOS_11_1 = (int)110100L; - /** - * {@snippet lang=c : - * #define __TVOS_11_1 110100 - * } - */ - public static int __TVOS_11_1() { - return __TVOS_11_1; - } - private static final int __TVOS_11_2 = (int)110200L; - /** - * {@snippet lang=c : - * #define __TVOS_11_2 110200 - * } - */ - public static int __TVOS_11_2() { - return __TVOS_11_2; - } - private static final int __TVOS_11_3 = (int)110300L; - /** - * {@snippet lang=c : - * #define __TVOS_11_3 110300 - * } - */ - public static int __TVOS_11_3() { - return __TVOS_11_3; - } - private static final int __TVOS_11_4 = (int)110400L; - /** - * {@snippet lang=c : - * #define __TVOS_11_4 110400 - * } - */ - public static int __TVOS_11_4() { - return __TVOS_11_4; - } - private static final int __TVOS_12_0 = (int)120000L; - /** - * {@snippet lang=c : - * #define __TVOS_12_0 120000 - * } - */ - public static int __TVOS_12_0() { - return __TVOS_12_0; - } - private static final int __TVOS_12_1 = (int)120100L; - /** - * {@snippet lang=c : - * #define __TVOS_12_1 120100 - * } - */ - public static int __TVOS_12_1() { - return __TVOS_12_1; - } - private static final int __TVOS_12_2 = (int)120200L; - /** - * {@snippet lang=c : - * #define __TVOS_12_2 120200 - * } - */ - public static int __TVOS_12_2() { - return __TVOS_12_2; - } - private static final int __TVOS_12_3 = (int)120300L; - /** - * {@snippet lang=c : - * #define __TVOS_12_3 120300 - * } - */ - public static int __TVOS_12_3() { - return __TVOS_12_3; - } - private static final int __TVOS_12_4 = (int)120400L; - /** - * {@snippet lang=c : - * #define __TVOS_12_4 120400 - * } - */ - public static int __TVOS_12_4() { - return __TVOS_12_4; - } - private static final int __TVOS_13_0 = (int)130000L; - /** - * {@snippet lang=c : - * #define __TVOS_13_0 130000 - * } - */ - public static int __TVOS_13_0() { - return __TVOS_13_0; - } - private static final int __TVOS_13_2 = (int)130200L; - /** - * {@snippet lang=c : - * #define __TVOS_13_2 130200 - * } - */ - public static int __TVOS_13_2() { - return __TVOS_13_2; - } - private static final int __TVOS_13_3 = (int)130300L; - /** - * {@snippet lang=c : - * #define __TVOS_13_3 130300 - * } - */ - public static int __TVOS_13_3() { - return __TVOS_13_3; - } - private static final int __TVOS_13_4 = (int)130400L; - /** - * {@snippet lang=c : - * #define __TVOS_13_4 130400 - * } - */ - public static int __TVOS_13_4() { - return __TVOS_13_4; - } - private static final int __TVOS_14_0 = (int)140000L; - /** - * {@snippet lang=c : - * #define __TVOS_14_0 140000 - * } - */ - public static int __TVOS_14_0() { - return __TVOS_14_0; - } - private static final int __TVOS_14_1 = (int)140100L; - /** - * {@snippet lang=c : - * #define __TVOS_14_1 140100 - * } - */ - public static int __TVOS_14_1() { - return __TVOS_14_1; - } - private static final int __TVOS_14_2 = (int)140200L; - /** - * {@snippet lang=c : - * #define __TVOS_14_2 140200 - * } - */ - public static int __TVOS_14_2() { - return __TVOS_14_2; - } - private static final int __TVOS_14_3 = (int)140300L; - /** - * {@snippet lang=c : - * #define __TVOS_14_3 140300 - * } - */ - public static int __TVOS_14_3() { - return __TVOS_14_3; - } - private static final int __TVOS_14_5 = (int)140500L; - /** - * {@snippet lang=c : - * #define __TVOS_14_5 140500 - * } - */ - public static int __TVOS_14_5() { - return __TVOS_14_5; - } - private static final int __TVOS_14_6 = (int)140600L; - /** - * {@snippet lang=c : - * #define __TVOS_14_6 140600 - * } - */ - public static int __TVOS_14_6() { - return __TVOS_14_6; - } - private static final int __TVOS_14_7 = (int)140700L; - /** - * {@snippet lang=c : - * #define __TVOS_14_7 140700 - * } - */ - public static int __TVOS_14_7() { - return __TVOS_14_7; - } - private static final int __TVOS_15_0 = (int)150000L; - /** - * {@snippet lang=c : - * #define __TVOS_15_0 150000 - * } - */ - public static int __TVOS_15_0() { - return __TVOS_15_0; - } - private static final int __TVOS_15_1 = (int)150100L; - /** - * {@snippet lang=c : - * #define __TVOS_15_1 150100 - * } - */ - public static int __TVOS_15_1() { - return __TVOS_15_1; - } - private static final int __TVOS_15_2 = (int)150200L; - /** - * {@snippet lang=c : - * #define __TVOS_15_2 150200 - * } - */ - public static int __TVOS_15_2() { - return __TVOS_15_2; - } - private static final int __TVOS_15_3 = (int)150300L; - /** - * {@snippet lang=c : - * #define __TVOS_15_3 150300 - * } - */ - public static int __TVOS_15_3() { - return __TVOS_15_3; - } - private static final int __TVOS_15_4 = (int)150400L; - /** - * {@snippet lang=c : - * #define __TVOS_15_4 150400 - * } - */ - public static int __TVOS_15_4() { - return __TVOS_15_4; - } - private static final int __TVOS_15_5 = (int)150500L; - /** - * {@snippet lang=c : - * #define __TVOS_15_5 150500 - * } - */ - public static int __TVOS_15_5() { - return __TVOS_15_5; - } - private static final int __TVOS_15_6 = (int)150600L; - /** - * {@snippet lang=c : - * #define __TVOS_15_6 150600 - * } - */ - public static int __TVOS_15_6() { - return __TVOS_15_6; - } - private static final int __TVOS_16_0 = (int)160000L; - /** - * {@snippet lang=c : - * #define __TVOS_16_0 160000 - * } - */ - public static int __TVOS_16_0() { - return __TVOS_16_0; - } - private static final int __TVOS_16_1 = (int)160100L; - /** - * {@snippet lang=c : - * #define __TVOS_16_1 160100 - * } - */ - public static int __TVOS_16_1() { - return __TVOS_16_1; - } - private static final int __TVOS_16_2 = (int)160200L; - /** - * {@snippet lang=c : - * #define __TVOS_16_2 160200 - * } - */ - public static int __TVOS_16_2() { - return __TVOS_16_2; - } - private static final int __TVOS_16_3 = (int)160300L; - /** - * {@snippet lang=c : - * #define __TVOS_16_3 160300 - * } - */ - public static int __TVOS_16_3() { - return __TVOS_16_3; - } - private static final int __TVOS_16_4 = (int)160400L; - /** - * {@snippet lang=c : - * #define __TVOS_16_4 160400 - * } - */ - public static int __TVOS_16_4() { - return __TVOS_16_4; - } - private static final int __TVOS_16_5 = (int)160500L; - /** - * {@snippet lang=c : - * #define __TVOS_16_5 160500 - * } - */ - public static int __TVOS_16_5() { - return __TVOS_16_5; - } - private static final int __TVOS_16_6 = (int)160600L; - /** - * {@snippet lang=c : - * #define __TVOS_16_6 160600 - * } - */ - public static int __TVOS_16_6() { - return __TVOS_16_6; - } - private static final int __TVOS_17_0 = (int)170000L; - /** - * {@snippet lang=c : - * #define __TVOS_17_0 170000 - * } - */ - public static int __TVOS_17_0() { - return __TVOS_17_0; - } - private static final int __TVOS_17_1 = (int)170100L; - /** - * {@snippet lang=c : - * #define __TVOS_17_1 170100 - * } - */ - public static int __TVOS_17_1() { - return __TVOS_17_1; - } - private static final int __TVOS_17_2 = (int)170200L; - /** - * {@snippet lang=c : - * #define __TVOS_17_2 170200 - * } - */ - public static int __TVOS_17_2() { - return __TVOS_17_2; - } - private static final int __TVOS_17_3 = (int)170300L; - /** - * {@snippet lang=c : - * #define __TVOS_17_3 170300 - * } - */ - public static int __TVOS_17_3() { - return __TVOS_17_3; - } - private static final int __TVOS_17_4 = (int)170400L; - /** - * {@snippet lang=c : - * #define __TVOS_17_4 170400 - * } - */ - public static int __TVOS_17_4() { - return __TVOS_17_4; - } - private static final int __TVOS_17_5 = (int)170500L; - /** - * {@snippet lang=c : - * #define __TVOS_17_5 170500 - * } - */ - public static int __TVOS_17_5() { - return __TVOS_17_5; - } - private static final int __BRIDGEOS_2_0 = (int)20000L; - /** - * {@snippet lang=c : - * #define __BRIDGEOS_2_0 20000 - * } - */ - public static int __BRIDGEOS_2_0() { - return __BRIDGEOS_2_0; - } - private static final int __BRIDGEOS_3_0 = (int)30000L; - /** - * {@snippet lang=c : - * #define __BRIDGEOS_3_0 30000 - * } - */ - public static int __BRIDGEOS_3_0() { - return __BRIDGEOS_3_0; - } - private static final int __BRIDGEOS_3_1 = (int)30100L; - /** - * {@snippet lang=c : - * #define __BRIDGEOS_3_1 30100 - * } - */ - public static int __BRIDGEOS_3_1() { - return __BRIDGEOS_3_1; - } - private static final int __BRIDGEOS_3_4 = (int)30400L; - /** - * {@snippet lang=c : - * #define __BRIDGEOS_3_4 30400 - * } - */ - public static int __BRIDGEOS_3_4() { - return __BRIDGEOS_3_4; - } - private static final int __BRIDGEOS_4_0 = (int)40000L; - /** - * {@snippet lang=c : - * #define __BRIDGEOS_4_0 40000 - * } - */ - public static int __BRIDGEOS_4_0() { - return __BRIDGEOS_4_0; - } - private static final int __BRIDGEOS_4_1 = (int)40100L; - /** - * {@snippet lang=c : - * #define __BRIDGEOS_4_1 40100 - * } - */ - public static int __BRIDGEOS_4_1() { - return __BRIDGEOS_4_1; - } - private static final int __BRIDGEOS_5_0 = (int)50000L; - /** - * {@snippet lang=c : - * #define __BRIDGEOS_5_0 50000 - * } - */ - public static int __BRIDGEOS_5_0() { - return __BRIDGEOS_5_0; - } - private static final int __BRIDGEOS_5_1 = (int)50100L; - /** - * {@snippet lang=c : - * #define __BRIDGEOS_5_1 50100 - * } - */ - public static int __BRIDGEOS_5_1() { - return __BRIDGEOS_5_1; - } - private static final int __BRIDGEOS_5_3 = (int)50300L; - /** - * {@snippet lang=c : - * #define __BRIDGEOS_5_3 50300 - * } - */ - public static int __BRIDGEOS_5_3() { - return __BRIDGEOS_5_3; - } - private static final int __BRIDGEOS_6_0 = (int)60000L; - /** - * {@snippet lang=c : - * #define __BRIDGEOS_6_0 60000 - * } - */ - public static int __BRIDGEOS_6_0() { - return __BRIDGEOS_6_0; - } - private static final int __BRIDGEOS_6_2 = (int)60200L; - /** - * {@snippet lang=c : - * #define __BRIDGEOS_6_2 60200 - * } - */ - public static int __BRIDGEOS_6_2() { - return __BRIDGEOS_6_2; - } - private static final int __BRIDGEOS_6_4 = (int)60400L; - /** - * {@snippet lang=c : - * #define __BRIDGEOS_6_4 60400 - * } - */ - public static int __BRIDGEOS_6_4() { - return __BRIDGEOS_6_4; - } - private static final int __BRIDGEOS_6_5 = (int)60500L; - /** - * {@snippet lang=c : - * #define __BRIDGEOS_6_5 60500 - * } - */ - public static int __BRIDGEOS_6_5() { - return __BRIDGEOS_6_5; - } - private static final int __BRIDGEOS_6_6 = (int)60600L; - /** - * {@snippet lang=c : - * #define __BRIDGEOS_6_6 60600 - * } - */ - public static int __BRIDGEOS_6_6() { - return __BRIDGEOS_6_6; - } - private static final int __BRIDGEOS_7_0 = (int)70000L; - /** - * {@snippet lang=c : - * #define __BRIDGEOS_7_0 70000 - * } - */ - public static int __BRIDGEOS_7_0() { - return __BRIDGEOS_7_0; - } - private static final int __BRIDGEOS_7_1 = (int)70100L; - /** - * {@snippet lang=c : - * #define __BRIDGEOS_7_1 70100 - * } - */ - public static int __BRIDGEOS_7_1() { - return __BRIDGEOS_7_1; - } - private static final int __BRIDGEOS_7_2 = (int)70200L; - /** - * {@snippet lang=c : - * #define __BRIDGEOS_7_2 70200 - * } - */ - public static int __BRIDGEOS_7_2() { - return __BRIDGEOS_7_2; - } - private static final int __BRIDGEOS_7_3 = (int)70300L; - /** - * {@snippet lang=c : - * #define __BRIDGEOS_7_3 70300 - * } - */ - public static int __BRIDGEOS_7_3() { - return __BRIDGEOS_7_3; - } - private static final int __BRIDGEOS_7_4 = (int)70400L; - /** - * {@snippet lang=c : - * #define __BRIDGEOS_7_4 70400 - * } - */ - public static int __BRIDGEOS_7_4() { - return __BRIDGEOS_7_4; - } - private static final int __BRIDGEOS_7_6 = (int)70600L; - /** - * {@snippet lang=c : - * #define __BRIDGEOS_7_6 70600 - * } - */ - public static int __BRIDGEOS_7_6() { - return __BRIDGEOS_7_6; - } - private static final int __BRIDGEOS_8_0 = (int)80000L; - /** - * {@snippet lang=c : - * #define __BRIDGEOS_8_0 80000 - * } - */ - public static int __BRIDGEOS_8_0() { - return __BRIDGEOS_8_0; - } - private static final int __BRIDGEOS_8_1 = (int)80100L; - /** - * {@snippet lang=c : - * #define __BRIDGEOS_8_1 80100 - * } - */ - public static int __BRIDGEOS_8_1() { - return __BRIDGEOS_8_1; - } - private static final int __BRIDGEOS_8_2 = (int)80200L; - /** - * {@snippet lang=c : - * #define __BRIDGEOS_8_2 80200 - * } - */ - public static int __BRIDGEOS_8_2() { - return __BRIDGEOS_8_2; - } - private static final int __BRIDGEOS_8_3 = (int)80300L; - /** - * {@snippet lang=c : - * #define __BRIDGEOS_8_3 80300 - * } - */ - public static int __BRIDGEOS_8_3() { - return __BRIDGEOS_8_3; - } - private static final int __BRIDGEOS_8_4 = (int)80400L; - /** - * {@snippet lang=c : - * #define __BRIDGEOS_8_4 80400 - * } - */ - public static int __BRIDGEOS_8_4() { - return __BRIDGEOS_8_4; - } - private static final int __BRIDGEOS_8_5 = (int)80500L; - /** - * {@snippet lang=c : - * #define __BRIDGEOS_8_5 80500 - * } - */ - public static int __BRIDGEOS_8_5() { - return __BRIDGEOS_8_5; - } - private static final int __DRIVERKIT_19_0 = (int)190000L; - /** - * {@snippet lang=c : - * #define __DRIVERKIT_19_0 190000 - * } - */ - public static int __DRIVERKIT_19_0() { - return __DRIVERKIT_19_0; - } - private static final int __DRIVERKIT_20_0 = (int)200000L; - /** - * {@snippet lang=c : - * #define __DRIVERKIT_20_0 200000 - * } - */ - public static int __DRIVERKIT_20_0() { - return __DRIVERKIT_20_0; - } - private static final int __DRIVERKIT_21_0 = (int)210000L; - /** - * {@snippet lang=c : - * #define __DRIVERKIT_21_0 210000 - * } - */ - public static int __DRIVERKIT_21_0() { - return __DRIVERKIT_21_0; - } - private static final int __DRIVERKIT_22_0 = (int)220000L; - /** - * {@snippet lang=c : - * #define __DRIVERKIT_22_0 220000 - * } - */ - public static int __DRIVERKIT_22_0() { - return __DRIVERKIT_22_0; - } - private static final int __DRIVERKIT_22_4 = (int)220400L; - /** - * {@snippet lang=c : - * #define __DRIVERKIT_22_4 220400 - * } - */ - public static int __DRIVERKIT_22_4() { - return __DRIVERKIT_22_4; - } - private static final int __DRIVERKIT_22_5 = (int)220500L; - /** - * {@snippet lang=c : - * #define __DRIVERKIT_22_5 220500 - * } - */ - public static int __DRIVERKIT_22_5() { - return __DRIVERKIT_22_5; - } - private static final int __DRIVERKIT_22_6 = (int)220600L; - /** - * {@snippet lang=c : - * #define __DRIVERKIT_22_6 220600 - * } - */ - public static int __DRIVERKIT_22_6() { - return __DRIVERKIT_22_6; - } - private static final int __DRIVERKIT_23_0 = (int)230000L; - /** - * {@snippet lang=c : - * #define __DRIVERKIT_23_0 230000 - * } - */ - public static int __DRIVERKIT_23_0() { - return __DRIVERKIT_23_0; - } - private static final int __DRIVERKIT_23_1 = (int)230100L; - /** - * {@snippet lang=c : - * #define __DRIVERKIT_23_1 230100 - * } - */ - public static int __DRIVERKIT_23_1() { - return __DRIVERKIT_23_1; - } - private static final int __DRIVERKIT_23_2 = (int)230200L; - /** - * {@snippet lang=c : - * #define __DRIVERKIT_23_2 230200 - * } - */ - public static int __DRIVERKIT_23_2() { - return __DRIVERKIT_23_2; - } - private static final int __DRIVERKIT_23_3 = (int)230300L; - /** - * {@snippet lang=c : - * #define __DRIVERKIT_23_3 230300 - * } - */ - public static int __DRIVERKIT_23_3() { - return __DRIVERKIT_23_3; - } - private static final int __DRIVERKIT_23_4 = (int)230400L; - /** - * {@snippet lang=c : - * #define __DRIVERKIT_23_4 230400 - * } - */ - public static int __DRIVERKIT_23_4() { - return __DRIVERKIT_23_4; - } - private static final int __DRIVERKIT_23_5 = (int)230500L; - /** - * {@snippet lang=c : - * #define __DRIVERKIT_23_5 230500 - * } - */ - public static int __DRIVERKIT_23_5() { - return __DRIVERKIT_23_5; - } - private static final int __VISIONOS_1_0 = (int)10000L; - /** - * {@snippet lang=c : - * #define __VISIONOS_1_0 10000 - * } - */ - public static int __VISIONOS_1_0() { - return __VISIONOS_1_0; - } - private static final int __VISIONOS_1_1 = (int)10100L; - /** - * {@snippet lang=c : - * #define __VISIONOS_1_1 10100 - * } - */ - public static int __VISIONOS_1_1() { - return __VISIONOS_1_1; - } - private static final int __VISIONOS_1_2 = (int)10200L; - /** - * {@snippet lang=c : - * #define __VISIONOS_1_2 10200 - * } - */ - public static int __VISIONOS_1_2() { - return __VISIONOS_1_2; - } - private static final int __ENABLE_LEGACY_MAC_AVAILABILITY = (int)1L; - /** - * {@snippet lang=c : - * #define __ENABLE_LEGACY_MAC_AVAILABILITY 1 - * } - */ - public static int __ENABLE_LEGACY_MAC_AVAILABILITY() { - return __ENABLE_LEGACY_MAC_AVAILABILITY; - } - private static final int __PTHREAD_SIZE__ = (int)8176L; - /** - * {@snippet lang=c : - * #define __PTHREAD_SIZE__ 8176 - * } - */ - public static int __PTHREAD_SIZE__() { - return __PTHREAD_SIZE__; - } - private static final int __PTHREAD_ATTR_SIZE__ = (int)56L; - /** - * {@snippet lang=c : - * #define __PTHREAD_ATTR_SIZE__ 56 - * } - */ - public static int __PTHREAD_ATTR_SIZE__() { - return __PTHREAD_ATTR_SIZE__; - } - private static final int __PTHREAD_MUTEXATTR_SIZE__ = (int)8L; - /** - * {@snippet lang=c : - * #define __PTHREAD_MUTEXATTR_SIZE__ 8 - * } - */ - public static int __PTHREAD_MUTEXATTR_SIZE__() { - return __PTHREAD_MUTEXATTR_SIZE__; - } - private static final int __PTHREAD_MUTEX_SIZE__ = (int)56L; - /** - * {@snippet lang=c : - * #define __PTHREAD_MUTEX_SIZE__ 56 - * } - */ - public static int __PTHREAD_MUTEX_SIZE__() { - return __PTHREAD_MUTEX_SIZE__; - } - private static final int __PTHREAD_CONDATTR_SIZE__ = (int)8L; - /** - * {@snippet lang=c : - * #define __PTHREAD_CONDATTR_SIZE__ 8 - * } - */ - public static int __PTHREAD_CONDATTR_SIZE__() { - return __PTHREAD_CONDATTR_SIZE__; - } - private static final int __PTHREAD_COND_SIZE__ = (int)40L; - /** - * {@snippet lang=c : - * #define __PTHREAD_COND_SIZE__ 40 - * } - */ - public static int __PTHREAD_COND_SIZE__() { - return __PTHREAD_COND_SIZE__; - } - private static final int __PTHREAD_ONCE_SIZE__ = (int)8L; - /** - * {@snippet lang=c : - * #define __PTHREAD_ONCE_SIZE__ 8 - * } - */ - public static int __PTHREAD_ONCE_SIZE__() { - return __PTHREAD_ONCE_SIZE__; - } - private static final int __PTHREAD_RWLOCK_SIZE__ = (int)192L; - /** - * {@snippet lang=c : - * #define __PTHREAD_RWLOCK_SIZE__ 192 - * } - */ - public static int __PTHREAD_RWLOCK_SIZE__() { - return __PTHREAD_RWLOCK_SIZE__; - } - private static final int __PTHREAD_RWLOCKATTR_SIZE__ = (int)16L; - /** - * {@snippet lang=c : - * #define __PTHREAD_RWLOCKATTR_SIZE__ 16 - * } - */ - public static int __PTHREAD_RWLOCKATTR_SIZE__() { - return __PTHREAD_RWLOCKATTR_SIZE__; - } - private static final int _FORTIFY_SOURCE = (int)2L; - /** - * {@snippet lang=c : - * #define _FORTIFY_SOURCE 2 - * } - */ - public static int _FORTIFY_SOURCE() { - return _FORTIFY_SOURCE; - } - private static final int RENAME_SECLUDE = (int)1L; - /** - * {@snippet lang=c : - * #define RENAME_SECLUDE 1 - * } - */ - public static int RENAME_SECLUDE() { - return RENAME_SECLUDE; - } - private static final int RENAME_SWAP = (int)2L; - /** - * {@snippet lang=c : - * #define RENAME_SWAP 2 - * } - */ - public static int RENAME_SWAP() { - return RENAME_SWAP; - } - private static final int RENAME_EXCL = (int)4L; - /** - * {@snippet lang=c : - * #define RENAME_EXCL 4 - * } - */ - public static int RENAME_EXCL() { - return RENAME_EXCL; - } - private static final int RENAME_RESERVED1 = (int)8L; - /** - * {@snippet lang=c : - * #define RENAME_RESERVED1 8 - * } - */ - public static int RENAME_RESERVED1() { - return RENAME_RESERVED1; - } - private static final int RENAME_NOFOLLOW_ANY = (int)16L; - /** - * {@snippet lang=c : - * #define RENAME_NOFOLLOW_ANY 16 - * } - */ - public static int RENAME_NOFOLLOW_ANY() { - return RENAME_NOFOLLOW_ANY; - } - private static final int SEEK_SET = (int)0L; - /** - * {@snippet lang=c : - * #define SEEK_SET 0 - * } - */ - public static int SEEK_SET() { - return SEEK_SET; - } - private static final int SEEK_CUR = (int)1L; - /** - * {@snippet lang=c : - * #define SEEK_CUR 1 - * } - */ - public static int SEEK_CUR() { - return SEEK_CUR; - } - private static final int SEEK_END = (int)2L; - /** - * {@snippet lang=c : - * #define SEEK_END 2 - * } - */ - public static int SEEK_END() { - return SEEK_END; - } - private static final int SEEK_HOLE = (int)3L; - /** - * {@snippet lang=c : - * #define SEEK_HOLE 3 - * } - */ - public static int SEEK_HOLE() { - return SEEK_HOLE; - } - private static final int SEEK_DATA = (int)4L; - /** - * {@snippet lang=c : - * #define SEEK_DATA 4 - * } - */ - public static int SEEK_DATA() { - return SEEK_DATA; - } - private static final int __SLBF = (int)1L; - /** - * {@snippet lang=c : - * #define __SLBF 1 - * } - */ - public static int __SLBF() { - return __SLBF; - } - private static final int __SNBF = (int)2L; - /** - * {@snippet lang=c : - * #define __SNBF 2 - * } - */ - public static int __SNBF() { - return __SNBF; - } - private static final int __SRD = (int)4L; - /** - * {@snippet lang=c : - * #define __SRD 4 - * } - */ - public static int __SRD() { - return __SRD; - } - private static final int __SWR = (int)8L; - /** - * {@snippet lang=c : - * #define __SWR 8 - * } - */ - public static int __SWR() { - return __SWR; - } - private static final int __SRW = (int)16L; - /** - * {@snippet lang=c : - * #define __SRW 16 - * } - */ - public static int __SRW() { - return __SRW; - } - private static final int __SEOF = (int)32L; - /** - * {@snippet lang=c : - * #define __SEOF 32 - * } - */ - public static int __SEOF() { - return __SEOF; - } - private static final int __SERR = (int)64L; - /** - * {@snippet lang=c : - * #define __SERR 64 - * } - */ - public static int __SERR() { - return __SERR; - } - private static final int __SMBF = (int)128L; - /** - * {@snippet lang=c : - * #define __SMBF 128 - * } - */ - public static int __SMBF() { - return __SMBF; - } - private static final int __SAPP = (int)256L; - /** - * {@snippet lang=c : - * #define __SAPP 256 - * } - */ - public static int __SAPP() { - return __SAPP; - } - private static final int __SSTR = (int)512L; - /** - * {@snippet lang=c : - * #define __SSTR 512 - * } - */ - public static int __SSTR() { - return __SSTR; - } - private static final int __SOPT = (int)1024L; - /** - * {@snippet lang=c : - * #define __SOPT 1024 - * } - */ - public static int __SOPT() { - return __SOPT; - } - private static final int __SNPT = (int)2048L; - /** - * {@snippet lang=c : - * #define __SNPT 2048 - * } - */ - public static int __SNPT() { - return __SNPT; - } - private static final int __SOFF = (int)4096L; - /** - * {@snippet lang=c : - * #define __SOFF 4096 - * } - */ - public static int __SOFF() { - return __SOFF; - } - private static final int __SMOD = (int)8192L; - /** - * {@snippet lang=c : - * #define __SMOD 8192 - * } - */ - public static int __SMOD() { - return __SMOD; - } - private static final int __SALC = (int)16384L; - /** - * {@snippet lang=c : - * #define __SALC 16384 - * } - */ - public static int __SALC() { - return __SALC; - } - private static final int __SIGN = (int)32768L; - /** - * {@snippet lang=c : - * #define __SIGN 32768 - * } - */ - public static int __SIGN() { - return __SIGN; - } - private static final int _IOFBF = (int)0L; - /** - * {@snippet lang=c : - * #define _IOFBF 0 - * } - */ - public static int _IOFBF() { - return _IOFBF; - } - private static final int _IOLBF = (int)1L; - /** - * {@snippet lang=c : - * #define _IOLBF 1 - * } - */ - public static int _IOLBF() { - return _IOLBF; - } - private static final int _IONBF = (int)2L; - /** - * {@snippet lang=c : - * #define _IONBF 2 - * } - */ - public static int _IONBF() { - return _IONBF; - } - private static final int BUFSIZ = (int)1024L; - /** - * {@snippet lang=c : - * #define BUFSIZ 1024 - * } - */ - public static int BUFSIZ() { - return BUFSIZ; - } - private static final int FOPEN_MAX = (int)20L; - /** - * {@snippet lang=c : - * #define FOPEN_MAX 20 - * } - */ - public static int FOPEN_MAX() { - return FOPEN_MAX; - } - private static final int FILENAME_MAX = (int)1024L; - /** - * {@snippet lang=c : - * #define FILENAME_MAX 1024 - * } - */ - public static int FILENAME_MAX() { - return FILENAME_MAX; - } - private static final int L_tmpnam = (int)1024L; - /** - * {@snippet lang=c : - * #define L_tmpnam 1024 - * } - */ - public static int L_tmpnam() { - return L_tmpnam; - } - private static final int TMP_MAX = (int)308915776L; - /** - * {@snippet lang=c : - * #define TMP_MAX 308915776 - * } - */ - public static int TMP_MAX() { - return TMP_MAX; - } - private static final int L_ctermid = (int)1024L; - /** - * {@snippet lang=c : - * #define L_ctermid 1024 - * } - */ - public static int L_ctermid() { - return L_ctermid; - } - private static final int _USE_FORTIFY_LEVEL = (int)2L; - /** - * {@snippet lang=c : - * #define _USE_FORTIFY_LEVEL 2 - * } - */ - public static int _USE_FORTIFY_LEVEL() { - return _USE_FORTIFY_LEVEL; - } - private static final int __WORDSIZE = (int)64L; - /** - * {@snippet lang=c : - * #define __WORDSIZE 64 - * } - */ - public static int __WORDSIZE() { - return __WORDSIZE; - } - private static final int INT8_MAX = (int)127L; - /** - * {@snippet lang=c : - * #define INT8_MAX 127 - * } - */ - public static int INT8_MAX() { - return INT8_MAX; - } - private static final int INT16_MAX = (int)32767L; - /** - * {@snippet lang=c : - * #define INT16_MAX 32767 - * } - */ - public static int INT16_MAX() { - return INT16_MAX; - } - private static final int INT32_MAX = (int)2147483647L; - /** - * {@snippet lang=c : - * #define INT32_MAX 2147483647 - * } - */ - public static int INT32_MAX() { - return INT32_MAX; - } - private static final int UINT8_MAX = (int)255L; - /** - * {@snippet lang=c : - * #define UINT8_MAX 255 - * } - */ - public static int UINT8_MAX() { - return UINT8_MAX; - } - private static final int UINT16_MAX = (int)65535L; - /** - * {@snippet lang=c : - * #define UINT16_MAX 65535 - * } - */ - public static int UINT16_MAX() { - return UINT16_MAX; - } - private static final int true_ = (int)1L; - /** - * {@snippet lang=c : - * #define true 1 - * } - */ - public static int true_() { - return true_; - } - private static final int false_ = (int)0L; - /** - * {@snippet lang=c : - * #define false 0 - * } - */ - public static int false_() { - return false_; - } - private static final int __bool_true_false_are_defined = (int)1L; - /** - * {@snippet lang=c : - * #define __bool_true_false_are_defined 1 - * } - */ - public static int __bool_true_false_are_defined() { - return __bool_true_false_are_defined; - } - private static final int _QUAD_HIGHWORD = (int)1L; - /** - * {@snippet lang=c : - * #define _QUAD_HIGHWORD 1 - * } - */ - public static int _QUAD_HIGHWORD() { - return _QUAD_HIGHWORD; - } - private static final int _QUAD_LOWWORD = (int)0L; - /** - * {@snippet lang=c : - * #define _QUAD_LOWWORD 0 - * } - */ - public static int _QUAD_LOWWORD() { - return _QUAD_LOWWORD; - } - private static final int __DARWIN_LITTLE_ENDIAN = (int)1234L; - /** - * {@snippet lang=c : - * #define __DARWIN_LITTLE_ENDIAN 1234 - * } - */ - public static int __DARWIN_LITTLE_ENDIAN() { - return __DARWIN_LITTLE_ENDIAN; - } - private static final int __DARWIN_BIG_ENDIAN = (int)4321L; - /** - * {@snippet lang=c : - * #define __DARWIN_BIG_ENDIAN 4321 - * } - */ - public static int __DARWIN_BIG_ENDIAN() { - return __DARWIN_BIG_ENDIAN; - } - private static final int __DARWIN_PDP_ENDIAN = (int)3412L; - /** - * {@snippet lang=c : - * #define __DARWIN_PDP_ENDIAN 3412 - * } - */ - public static int __DARWIN_PDP_ENDIAN() { - return __DARWIN_PDP_ENDIAN; - } - private static final int __DARWIN_FD_SETSIZE = (int)1024L; - /** - * {@snippet lang=c : - * #define __DARWIN_FD_SETSIZE 1024 - * } - */ - public static int __DARWIN_FD_SETSIZE() { - return __DARWIN_FD_SETSIZE; - } - private static final int __DARWIN_NBBY = (int)8L; - /** - * {@snippet lang=c : - * #define __DARWIN_NBBY 8 - * } - */ - public static int __DARWIN_NBBY() { - return __DARWIN_NBBY; - } - /** - * {@snippet lang=c : - * typedef signed char __int8_t - * } - */ - public static final OfByte __int8_t = somelib_h.C_CHAR; - /** - * {@snippet lang=c : - * typedef unsigned char __uint8_t - * } - */ - public static final OfByte __uint8_t = somelib_h.C_CHAR; - /** - * {@snippet lang=c : - * typedef short __int16_t - * } - */ - public static final OfShort __int16_t = somelib_h.C_SHORT; - /** - * {@snippet lang=c : - * typedef unsigned short __uint16_t - * } - */ - public static final OfShort __uint16_t = somelib_h.C_SHORT; - /** - * {@snippet lang=c : - * typedef int __int32_t - * } - */ - public static final OfInt __int32_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef unsigned int __uint32_t - * } - */ - public static final OfInt __uint32_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef long long __int64_t - * } - */ - public static final OfLong __int64_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef unsigned long long __uint64_t - * } - */ - public static final OfLong __uint64_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef long __darwin_intptr_t - * } - */ - public static final OfLong __darwin_intptr_t = somelib_h.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned int __darwin_natural_t - * } - */ - public static final OfInt __darwin_natural_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef int __darwin_ct_rune_t - * } - */ - public static final OfInt __darwin_ct_rune_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef long __darwin_ptrdiff_t - * } - */ - public static final OfLong __darwin_ptrdiff_t = somelib_h.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned long __darwin_size_t - * } - */ - public static final OfLong __darwin_size_t = somelib_h.C_LONG; - /** - * {@snippet lang=c : - * typedef __builtin_va_list __darwin_va_list - * } - */ - public static final AddressLayout __darwin_va_list = somelib_h.C_POINTER; - /** - * {@snippet lang=c : - * typedef int __darwin_wchar_t - * } - */ - public static final OfInt __darwin_wchar_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef __darwin_wchar_t __darwin_rune_t - * } - */ - public static final OfInt __darwin_rune_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef int __darwin_wint_t - * } - */ - public static final OfInt __darwin_wint_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef unsigned long __darwin_clock_t - * } - */ - public static final OfLong __darwin_clock_t = somelib_h.C_LONG; - /** - * {@snippet lang=c : - * typedef __uint32_t __darwin_socklen_t - * } - */ - public static final OfInt __darwin_socklen_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef long __darwin_ssize_t - * } - */ - public static final OfLong __darwin_ssize_t = somelib_h.C_LONG; - /** - * {@snippet lang=c : - * typedef long __darwin_time_t - * } - */ - public static final OfLong __darwin_time_t = somelib_h.C_LONG; - /** - * {@snippet lang=c : - * typedef __int64_t __darwin_blkcnt_t - * } - */ - public static final OfLong __darwin_blkcnt_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef __int32_t __darwin_blksize_t - * } - */ - public static final OfInt __darwin_blksize_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef __int32_t __darwin_dev_t - * } - */ - public static final OfInt __darwin_dev_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef unsigned int __darwin_fsblkcnt_t - * } - */ - public static final OfInt __darwin_fsblkcnt_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef unsigned int __darwin_fsfilcnt_t - * } - */ - public static final OfInt __darwin_fsfilcnt_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef __uint32_t __darwin_gid_t - * } - */ - public static final OfInt __darwin_gid_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef __uint32_t __darwin_id_t - * } - */ - public static final OfInt __darwin_id_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef __uint64_t __darwin_ino64_t - * } - */ - public static final OfLong __darwin_ino64_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef __darwin_ino64_t __darwin_ino_t - * } - */ - public static final OfLong __darwin_ino_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef __darwin_natural_t __darwin_mach_port_name_t - * } - */ - public static final OfInt __darwin_mach_port_name_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef __darwin_mach_port_name_t __darwin_mach_port_t - * } - */ - public static final OfInt __darwin_mach_port_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef __uint16_t __darwin_mode_t - * } - */ - public static final OfShort __darwin_mode_t = somelib_h.C_SHORT; - /** - * {@snippet lang=c : - * typedef __int64_t __darwin_off_t - * } - */ - public static final OfLong __darwin_off_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef __int32_t __darwin_pid_t - * } - */ - public static final OfInt __darwin_pid_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef __uint32_t __darwin_sigset_t - * } - */ - public static final OfInt __darwin_sigset_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef __int32_t __darwin_suseconds_t - * } - */ - public static final OfInt __darwin_suseconds_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef __uint32_t __darwin_uid_t - * } - */ - public static final OfInt __darwin_uid_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef __uint32_t __darwin_useconds_t - * } - */ - public static final OfInt __darwin_useconds_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef unsigned long __darwin_pthread_key_t - * } - */ - public static final OfLong __darwin_pthread_key_t = somelib_h.C_LONG; - /** - * {@snippet lang=c : - * typedef struct _opaque_pthread_t { - * long __sig; - * struct __darwin_pthread_handler_rec *__cleanup_stack; - * char __opaque[8176]; - * } *__darwin_pthread_t - * } - */ - public static final AddressLayout __darwin_pthread_t = somelib_h.C_POINTER; - /** - * {@snippet lang=c : - * typedef int __darwin_nl_item - * } - */ - public static final OfInt __darwin_nl_item = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef int __darwin_wctrans_t - * } - */ - public static final OfInt __darwin_wctrans_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef __uint32_t __darwin_wctype_t - * } - */ - public static final OfInt __darwin_wctype_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef signed char int8_t - * } - */ - public static final OfByte int8_t = somelib_h.C_CHAR; - /** - * {@snippet lang=c : - * typedef short int16_t - * } - */ - public static final OfShort int16_t = somelib_h.C_SHORT; - /** - * {@snippet lang=c : - * typedef int int32_t - * } - */ - public static final OfInt int32_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef long long int64_t - * } - */ - public static final OfLong int64_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef unsigned char u_int8_t - * } - */ - public static final OfByte u_int8_t = somelib_h.C_CHAR; - /** - * {@snippet lang=c : - * typedef unsigned short u_int16_t - * } - */ - public static final OfShort u_int16_t = somelib_h.C_SHORT; - /** - * {@snippet lang=c : - * typedef unsigned int u_int32_t - * } - */ - public static final OfInt u_int32_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef unsigned long long u_int64_t - * } - */ - public static final OfLong u_int64_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef int64_t register_t - * } - */ - public static final OfLong register_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef __darwin_intptr_t intptr_t - * } - */ - public static final OfLong intptr_t = somelib_h.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned long uintptr_t - * } - */ - public static final OfLong uintptr_t = somelib_h.C_LONG; - /** - * {@snippet lang=c : - * typedef u_int64_t user_addr_t - * } - */ - public static final OfLong user_addr_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef u_int64_t user_size_t - * } - */ - public static final OfLong user_size_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef int64_t user_ssize_t - * } - */ - public static final OfLong user_ssize_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef int64_t user_long_t - * } - */ - public static final OfLong user_long_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef u_int64_t user_ulong_t - * } - */ - public static final OfLong user_ulong_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef int64_t user_time_t - * } - */ - public static final OfLong user_time_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef int64_t user_off_t - * } - */ - public static final OfLong user_off_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef u_int64_t syscall_arg_t - * } - */ - public static final OfLong syscall_arg_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef __darwin_va_list va_list - * } - */ - public static final AddressLayout va_list = somelib_h.C_POINTER; - /** - * {@snippet lang=c : - * typedef __darwin_size_t size_t - * } - */ - public static final OfLong size_t = somelib_h.C_LONG; - - private static class renameat { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("renameat"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int renameat(int, const char *, int, const char *) - * } - */ - public static FunctionDescriptor renameat$descriptor() { - return renameat.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int renameat(int, const char *, int, const char *) - * } - */ - public static MethodHandle renameat$handle() { - return renameat.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int renameat(int, const char *, int, const char *) - * } - */ - public static MemorySegment renameat$address() { - return renameat.ADDR; - } - - /** - * {@snippet lang=c : - * int renameat(int, const char *, int, const char *) - * } - */ - public static int renameat(int x0, MemorySegment x1, int x2, MemorySegment x3) { - var mh$ = renameat.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("renameat", x0, x1, x2, x3); - } - return (int)mh$.invokeExact(x0, x1, x2, x3); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class renamex_np { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_INT - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("renamex_np"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int renamex_np(const char *, const char *, unsigned int) - * } - */ - public static FunctionDescriptor renamex_np$descriptor() { - return renamex_np.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int renamex_np(const char *, const char *, unsigned int) - * } - */ - public static MethodHandle renamex_np$handle() { - return renamex_np.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int renamex_np(const char *, const char *, unsigned int) - * } - */ - public static MemorySegment renamex_np$address() { - return renamex_np.ADDR; - } - - /** - * {@snippet lang=c : - * int renamex_np(const char *, const char *, unsigned int) - * } - */ - public static int renamex_np(MemorySegment x0, MemorySegment x1, int x2) { - var mh$ = renamex_np.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("renamex_np", x0, x1, x2); - } - return (int)mh$.invokeExact(x0, x1, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class renameatx_np { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_INT - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("renameatx_np"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int renameatx_np(int, const char *, int, const char *, unsigned int) - * } - */ - public static FunctionDescriptor renameatx_np$descriptor() { - return renameatx_np.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int renameatx_np(int, const char *, int, const char *, unsigned int) - * } - */ - public static MethodHandle renameatx_np$handle() { - return renameatx_np.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int renameatx_np(int, const char *, int, const char *, unsigned int) - * } - */ - public static MemorySegment renameatx_np$address() { - return renameatx_np.ADDR; - } - - /** - * {@snippet lang=c : - * int renameatx_np(int, const char *, int, const char *, unsigned int) - * } - */ - public static int renameatx_np(int x0, MemorySegment x1, int x2, MemorySegment x3, int x4) { - var mh$ = renameatx_np.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("renameatx_np", x0, x1, x2, x3, x4); - } - return (int)mh$.invokeExact(x0, x1, x2, x3, x4); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - /** - * {@snippet lang=c : - * typedef __darwin_off_t fpos_t - * } - */ - public static final OfLong fpos_t = somelib_h.C_LONG_LONG; - - private static class __stdinp$constants { - public static final AddressLayout LAYOUT = somelib_h.C_POINTER; - public static final MemorySegment SEGMENT = somelib_h.findOrThrow("__stdinp").reinterpret(LAYOUT.byteSize()); - } - - /** - * Layout for variable: - * {@snippet lang=c : - * extern FILE *__stdinp - * } - */ - public static AddressLayout __stdinp$layout() { - return __stdinp$constants.LAYOUT; - } - - /** - * Segment for variable: - * {@snippet lang=c : - * extern FILE *__stdinp - * } - */ - public static MemorySegment __stdinp$segment() { - return __stdinp$constants.SEGMENT; - } - - /** - * Getter for variable: - * {@snippet lang=c : - * extern FILE *__stdinp - * } - */ - public static MemorySegment __stdinp() { - return __stdinp$constants.SEGMENT.get(__stdinp$constants.LAYOUT, 0L); - } - - /** - * Setter for variable: - * {@snippet lang=c : - * extern FILE *__stdinp - * } - */ - public static void __stdinp(MemorySegment varValue) { - __stdinp$constants.SEGMENT.set(__stdinp$constants.LAYOUT, 0L, varValue); - } - - private static class __stdoutp$constants { - public static final AddressLayout LAYOUT = somelib_h.C_POINTER; - public static final MemorySegment SEGMENT = somelib_h.findOrThrow("__stdoutp").reinterpret(LAYOUT.byteSize()); - } - - /** - * Layout for variable: - * {@snippet lang=c : - * extern FILE *__stdoutp - * } - */ - public static AddressLayout __stdoutp$layout() { - return __stdoutp$constants.LAYOUT; - } - - /** - * Segment for variable: - * {@snippet lang=c : - * extern FILE *__stdoutp - * } - */ - public static MemorySegment __stdoutp$segment() { - return __stdoutp$constants.SEGMENT; - } - - /** - * Getter for variable: - * {@snippet lang=c : - * extern FILE *__stdoutp - * } - */ - public static MemorySegment __stdoutp() { - return __stdoutp$constants.SEGMENT.get(__stdoutp$constants.LAYOUT, 0L); - } - - /** - * Setter for variable: - * {@snippet lang=c : - * extern FILE *__stdoutp - * } - */ - public static void __stdoutp(MemorySegment varValue) { - __stdoutp$constants.SEGMENT.set(__stdoutp$constants.LAYOUT, 0L, varValue); - } - - private static class __stderrp$constants { - public static final AddressLayout LAYOUT = somelib_h.C_POINTER; - public static final MemorySegment SEGMENT = somelib_h.findOrThrow("__stderrp").reinterpret(LAYOUT.byteSize()); - } - - /** - * Layout for variable: - * {@snippet lang=c : - * extern FILE *__stderrp - * } - */ - public static AddressLayout __stderrp$layout() { - return __stderrp$constants.LAYOUT; - } - - /** - * Segment for variable: - * {@snippet lang=c : - * extern FILE *__stderrp - * } - */ - public static MemorySegment __stderrp$segment() { - return __stderrp$constants.SEGMENT; - } - - /** - * Getter for variable: - * {@snippet lang=c : - * extern FILE *__stderrp - * } - */ - public static MemorySegment __stderrp() { - return __stderrp$constants.SEGMENT.get(__stderrp$constants.LAYOUT, 0L); - } - - /** - * Setter for variable: - * {@snippet lang=c : - * extern FILE *__stderrp - * } - */ - public static void __stderrp(MemorySegment varValue) { - __stderrp$constants.SEGMENT.set(__stderrp$constants.LAYOUT, 0L, varValue); - } - - private static class clearerr { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("clearerr"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * void clearerr(FILE *) - * } - */ - public static FunctionDescriptor clearerr$descriptor() { - return clearerr.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * void clearerr(FILE *) - * } - */ - public static MethodHandle clearerr$handle() { - return clearerr.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * void clearerr(FILE *) - * } - */ - public static MemorySegment clearerr$address() { - return clearerr.ADDR; - } - - /** - * {@snippet lang=c : - * void clearerr(FILE *) - * } - */ - public static void clearerr(MemorySegment x0) { - var mh$ = clearerr.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("clearerr", x0); - } - mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class fclose { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("fclose"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int fclose(FILE *) - * } - */ - public static FunctionDescriptor fclose$descriptor() { - return fclose.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int fclose(FILE *) - * } - */ - public static MethodHandle fclose$handle() { - return fclose.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int fclose(FILE *) - * } - */ - public static MemorySegment fclose$address() { - return fclose.ADDR; - } - - /** - * {@snippet lang=c : - * int fclose(FILE *) - * } - */ - public static int fclose(MemorySegment x0) { - var mh$ = fclose.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("fclose", x0); - } - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class feof { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("feof"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int feof(FILE *) - * } - */ - public static FunctionDescriptor feof$descriptor() { - return feof.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int feof(FILE *) - * } - */ - public static MethodHandle feof$handle() { - return feof.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int feof(FILE *) - * } - */ - public static MemorySegment feof$address() { - return feof.ADDR; - } - - /** - * {@snippet lang=c : - * int feof(FILE *) - * } - */ - public static int feof(MemorySegment x0) { - var mh$ = feof.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("feof", x0); - } - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class ferror { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("ferror"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int ferror(FILE *) - * } - */ - public static FunctionDescriptor ferror$descriptor() { - return ferror.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int ferror(FILE *) - * } - */ - public static MethodHandle ferror$handle() { - return ferror.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int ferror(FILE *) - * } - */ - public static MemorySegment ferror$address() { - return ferror.ADDR; - } - - /** - * {@snippet lang=c : - * int ferror(FILE *) - * } - */ - public static int ferror(MemorySegment x0) { - var mh$ = ferror.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("ferror", x0); - } - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class fflush { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("fflush"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int fflush(FILE *) - * } - */ - public static FunctionDescriptor fflush$descriptor() { - return fflush.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int fflush(FILE *) - * } - */ - public static MethodHandle fflush$handle() { - return fflush.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int fflush(FILE *) - * } - */ - public static MemorySegment fflush$address() { - return fflush.ADDR; - } - - /** - * {@snippet lang=c : - * int fflush(FILE *) - * } - */ - public static int fflush(MemorySegment x0) { - var mh$ = fflush.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("fflush", x0); - } - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class fgetc { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("fgetc"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int fgetc(FILE *) - * } - */ - public static FunctionDescriptor fgetc$descriptor() { - return fgetc.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int fgetc(FILE *) - * } - */ - public static MethodHandle fgetc$handle() { - return fgetc.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int fgetc(FILE *) - * } - */ - public static MemorySegment fgetc$address() { - return fgetc.ADDR; - } - - /** - * {@snippet lang=c : - * int fgetc(FILE *) - * } - */ - public static int fgetc(MemorySegment x0) { - var mh$ = fgetc.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("fgetc", x0); - } - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class fgetpos { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("fgetpos"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int fgetpos(FILE *restrict, fpos_t *) - * } - */ - public static FunctionDescriptor fgetpos$descriptor() { - return fgetpos.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int fgetpos(FILE *restrict, fpos_t *) - * } - */ - public static MethodHandle fgetpos$handle() { - return fgetpos.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int fgetpos(FILE *restrict, fpos_t *) - * } - */ - public static MemorySegment fgetpos$address() { - return fgetpos.ADDR; - } - - /** - * {@snippet lang=c : - * int fgetpos(FILE *restrict, fpos_t *) - * } - */ - public static int fgetpos(MemorySegment x0, MemorySegment x1) { - var mh$ = fgetpos.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("fgetpos", x0, x1); - } - return (int)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class fgets { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("fgets"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * char *fgets(char *restrict, int, FILE *) - * } - */ - public static FunctionDescriptor fgets$descriptor() { - return fgets.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * char *fgets(char *restrict, int, FILE *) - * } - */ - public static MethodHandle fgets$handle() { - return fgets.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * char *fgets(char *restrict, int, FILE *) - * } - */ - public static MemorySegment fgets$address() { - return fgets.ADDR; - } - - /** - * {@snippet lang=c : - * char *fgets(char *restrict, int, FILE *) - * } - */ - public static MemorySegment fgets(MemorySegment x0, int x1, MemorySegment x2) { - var mh$ = fgets.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("fgets", x0, x1, x2); - } - return (MemorySegment)mh$.invokeExact(x0, x1, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class fopen { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("fopen"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * FILE *fopen(const char *restrict __filename, const char *restrict __mode) - * } - */ - public static FunctionDescriptor fopen$descriptor() { - return fopen.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * FILE *fopen(const char *restrict __filename, const char *restrict __mode) - * } - */ - public static MethodHandle fopen$handle() { - return fopen.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * FILE *fopen(const char *restrict __filename, const char *restrict __mode) - * } - */ - public static MemorySegment fopen$address() { - return fopen.ADDR; - } - - /** - * {@snippet lang=c : - * FILE *fopen(const char *restrict __filename, const char *restrict __mode) - * } - */ - public static MemorySegment fopen(MemorySegment __filename, MemorySegment __mode) { - var mh$ = fopen.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("fopen", __filename, __mode); - } - return (MemorySegment)mh$.invokeExact(__filename, __mode); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - /** - * Variadic invoker class for: - * {@snippet lang=c : - * int fprintf(FILE *restrict, const char *restrict, ...) - * } - */ - public static class fprintf { - private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("fprintf"); - - private final MethodHandle handle; - private final FunctionDescriptor descriptor; - private final MethodHandle spreader; - - private fprintf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { - this.handle = handle; - this.descriptor = descriptor; - this.spreader = spreader; - } - - /** - * Variadic invoker factory for: - * {@snippet lang=c : - * int fprintf(FILE *restrict, const char *restrict, ...) - * } - */ - public static fprintf makeInvoker(MemoryLayout... layouts) { - FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); - Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); - var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); - var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new fprintf(mh$, desc$, spreader$); - } - - /** - * {@return the address} - */ - public static MemorySegment address() { - return ADDR; - } - - /** - * {@return the specialized method handle} - */ - public MethodHandle handle() { - return handle; - } - - /** - * {@return the specialized descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } - - public int apply(MemorySegment x0, MemorySegment x1, Object... x2) { - try { - if (TRACE_DOWNCALLS) { - traceDowncall("fprintf", x0, x1, x2); - } - return (int)spreader.invokeExact(x0, x1, x2); - } catch(IllegalArgumentException | ClassCastException ex$) { - throw ex$; // rethrow IAE from passing wrong number/type of args - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - } - - private static class fputc { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("fputc"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int fputc(int, FILE *) - * } - */ - public static FunctionDescriptor fputc$descriptor() { - return fputc.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int fputc(int, FILE *) - * } - */ - public static MethodHandle fputc$handle() { - return fputc.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int fputc(int, FILE *) - * } - */ - public static MemorySegment fputc$address() { - return fputc.ADDR; - } - - /** - * {@snippet lang=c : - * int fputc(int, FILE *) - * } - */ - public static int fputc(int x0, MemorySegment x1) { - var mh$ = fputc.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("fputc", x0, x1); - } - return (int)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class fputs { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("fputs"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int fputs(const char *restrict, FILE *restrict) - * } - */ - public static FunctionDescriptor fputs$descriptor() { - return fputs.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int fputs(const char *restrict, FILE *restrict) - * } - */ - public static MethodHandle fputs$handle() { - return fputs.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int fputs(const char *restrict, FILE *restrict) - * } - */ - public static MemorySegment fputs$address() { - return fputs.ADDR; - } - - /** - * {@snippet lang=c : - * int fputs(const char *restrict, FILE *restrict) - * } - */ - public static int fputs(MemorySegment x0, MemorySegment x1) { - var mh$ = fputs.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("fputs", x0, x1); - } - return (int)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class fread { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_LONG, - somelib_h.C_POINTER, - somelib_h.C_LONG, - somelib_h.C_LONG, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("fread"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * unsigned long fread(void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) - * } - */ - public static FunctionDescriptor fread$descriptor() { - return fread.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * unsigned long fread(void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) - * } - */ - public static MethodHandle fread$handle() { - return fread.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * unsigned long fread(void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) - * } - */ - public static MemorySegment fread$address() { - return fread.ADDR; - } - - /** - * {@snippet lang=c : - * unsigned long fread(void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) - * } - */ - public static long fread(MemorySegment __ptr, long __size, long __nitems, MemorySegment __stream) { - var mh$ = fread.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("fread", __ptr, __size, __nitems, __stream); - } - return (long)mh$.invokeExact(__ptr, __size, __nitems, __stream); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class freopen { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("freopen"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * FILE *freopen(const char *restrict, const char *restrict, FILE *restrict) - * } - */ - public static FunctionDescriptor freopen$descriptor() { - return freopen.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * FILE *freopen(const char *restrict, const char *restrict, FILE *restrict) - * } - */ - public static MethodHandle freopen$handle() { - return freopen.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * FILE *freopen(const char *restrict, const char *restrict, FILE *restrict) - * } - */ - public static MemorySegment freopen$address() { - return freopen.ADDR; - } - - /** - * {@snippet lang=c : - * FILE *freopen(const char *restrict, const char *restrict, FILE *restrict) - * } - */ - public static MemorySegment freopen(MemorySegment x0, MemorySegment x1, MemorySegment x2) { - var mh$ = freopen.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("freopen", x0, x1, x2); - } - return (MemorySegment)mh$.invokeExact(x0, x1, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - /** - * Variadic invoker class for: - * {@snippet lang=c : - * int fscanf(FILE *restrict, const char *restrict, ...) - * } - */ - public static class fscanf { - private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("fscanf"); - - private final MethodHandle handle; - private final FunctionDescriptor descriptor; - private final MethodHandle spreader; - - private fscanf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { - this.handle = handle; - this.descriptor = descriptor; - this.spreader = spreader; - } - - /** - * Variadic invoker factory for: - * {@snippet lang=c : - * int fscanf(FILE *restrict, const char *restrict, ...) - * } - */ - public static fscanf makeInvoker(MemoryLayout... layouts) { - FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); - Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); - var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); - var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new fscanf(mh$, desc$, spreader$); - } - - /** - * {@return the address} - */ - public static MemorySegment address() { - return ADDR; - } - - /** - * {@return the specialized method handle} - */ - public MethodHandle handle() { - return handle; - } - - /** - * {@return the specialized descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } - - public int apply(MemorySegment x0, MemorySegment x1, Object... x2) { - try { - if (TRACE_DOWNCALLS) { - traceDowncall("fscanf", x0, x1, x2); - } - return (int)spreader.invokeExact(x0, x1, x2); - } catch(IllegalArgumentException | ClassCastException ex$) { - throw ex$; // rethrow IAE from passing wrong number/type of args - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - } - - private static class fseek { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_LONG, - somelib_h.C_INT - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("fseek"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int fseek(FILE *, long, int) - * } - */ - public static FunctionDescriptor fseek$descriptor() { - return fseek.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int fseek(FILE *, long, int) - * } - */ - public static MethodHandle fseek$handle() { - return fseek.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int fseek(FILE *, long, int) - * } - */ - public static MemorySegment fseek$address() { - return fseek.ADDR; - } - - /** - * {@snippet lang=c : - * int fseek(FILE *, long, int) - * } - */ - public static int fseek(MemorySegment x0, long x1, int x2) { - var mh$ = fseek.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("fseek", x0, x1, x2); - } - return (int)mh$.invokeExact(x0, x1, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class fsetpos { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("fsetpos"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int fsetpos(FILE *, const fpos_t *) - * } - */ - public static FunctionDescriptor fsetpos$descriptor() { - return fsetpos.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int fsetpos(FILE *, const fpos_t *) - * } - */ - public static MethodHandle fsetpos$handle() { - return fsetpos.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int fsetpos(FILE *, const fpos_t *) - * } - */ - public static MemorySegment fsetpos$address() { - return fsetpos.ADDR; - } - - /** - * {@snippet lang=c : - * int fsetpos(FILE *, const fpos_t *) - * } - */ - public static int fsetpos(MemorySegment x0, MemorySegment x1) { - var mh$ = fsetpos.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("fsetpos", x0, x1); - } - return (int)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class ftell { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_LONG, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("ftell"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * long ftell(FILE *) - * } - */ - public static FunctionDescriptor ftell$descriptor() { - return ftell.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * long ftell(FILE *) - * } - */ - public static MethodHandle ftell$handle() { - return ftell.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * long ftell(FILE *) - * } - */ - public static MemorySegment ftell$address() { - return ftell.ADDR; - } - - /** - * {@snippet lang=c : - * long ftell(FILE *) - * } - */ - public static long ftell(MemorySegment x0) { - var mh$ = ftell.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("ftell", x0); - } - return (long)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class fwrite { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_LONG, - somelib_h.C_POINTER, - somelib_h.C_LONG, - somelib_h.C_LONG, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("fwrite"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * unsigned long fwrite(const void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) - * } - */ - public static FunctionDescriptor fwrite$descriptor() { - return fwrite.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * unsigned long fwrite(const void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) - * } - */ - public static MethodHandle fwrite$handle() { - return fwrite.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * unsigned long fwrite(const void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) - * } - */ - public static MemorySegment fwrite$address() { - return fwrite.ADDR; - } - - /** - * {@snippet lang=c : - * unsigned long fwrite(const void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) - * } - */ - public static long fwrite(MemorySegment __ptr, long __size, long __nitems, MemorySegment __stream) { - var mh$ = fwrite.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("fwrite", __ptr, __size, __nitems, __stream); - } - return (long)mh$.invokeExact(__ptr, __size, __nitems, __stream); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class getc { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("getc"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int getc(FILE *) - * } - */ - public static FunctionDescriptor getc$descriptor() { - return getc.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int getc(FILE *) - * } - */ - public static MethodHandle getc$handle() { - return getc.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int getc(FILE *) - * } - */ - public static MemorySegment getc$address() { - return getc.ADDR; - } - - /** - * {@snippet lang=c : - * int getc(FILE *) - * } - */ - public static int getc(MemorySegment x0) { - var mh$ = getc.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("getc", x0); - } - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class getchar { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("getchar"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int getchar() - * } - */ - public static FunctionDescriptor getchar$descriptor() { - return getchar.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int getchar() - * } - */ - public static MethodHandle getchar$handle() { - return getchar.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int getchar() - * } - */ - public static MemorySegment getchar$address() { - return getchar.ADDR; - } - - /** - * {@snippet lang=c : - * int getchar() - * } - */ - public static int getchar() { - var mh$ = getchar.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("getchar"); - } - return (int)mh$.invokeExact(); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class gets { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("gets"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * char *gets(char *) - * } - */ - public static FunctionDescriptor gets$descriptor() { - return gets.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * char *gets(char *) - * } - */ - public static MethodHandle gets$handle() { - return gets.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * char *gets(char *) - * } - */ - public static MemorySegment gets$address() { - return gets.ADDR; - } - - /** - * {@snippet lang=c : - * char *gets(char *) - * } - */ - public static MemorySegment gets(MemorySegment x0) { - var mh$ = gets.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("gets", x0); - } - return (MemorySegment)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class perror { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("perror"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * void perror(const char *) - * } - */ - public static FunctionDescriptor perror$descriptor() { - return perror.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * void perror(const char *) - * } - */ - public static MethodHandle perror$handle() { - return perror.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * void perror(const char *) - * } - */ - public static MemorySegment perror$address() { - return perror.ADDR; - } - - /** - * {@snippet lang=c : - * void perror(const char *) - * } - */ - public static void perror(MemorySegment x0) { - var mh$ = perror.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("perror", x0); - } - mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - /** - * Variadic invoker class for: - * {@snippet lang=c : - * int printf(const char *restrict, ...) - * } - */ - public static class printf { - private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER - ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("printf"); - - private final MethodHandle handle; - private final FunctionDescriptor descriptor; - private final MethodHandle spreader; - - private printf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { - this.handle = handle; - this.descriptor = descriptor; - this.spreader = spreader; - } - - /** - * Variadic invoker factory for: - * {@snippet lang=c : - * int printf(const char *restrict, ...) - * } - */ - public static printf makeInvoker(MemoryLayout... layouts) { - FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); - Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); - var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); - var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new printf(mh$, desc$, spreader$); - } - - /** - * {@return the address} - */ - public static MemorySegment address() { - return ADDR; - } - - /** - * {@return the specialized method handle} - */ - public MethodHandle handle() { - return handle; - } - - /** - * {@return the specialized descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } - - public int apply(MemorySegment x0, Object... x1) { - try { - if (TRACE_DOWNCALLS) { - traceDowncall("printf", x0, x1); - } - return (int)spreader.invokeExact(x0, x1); - } catch(IllegalArgumentException | ClassCastException ex$) { - throw ex$; // rethrow IAE from passing wrong number/type of args - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - } - - private static class putc { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("putc"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int putc(int, FILE *) - * } - */ - public static FunctionDescriptor putc$descriptor() { - return putc.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int putc(int, FILE *) - * } - */ - public static MethodHandle putc$handle() { - return putc.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int putc(int, FILE *) - * } - */ - public static MemorySegment putc$address() { - return putc.ADDR; - } - - /** - * {@snippet lang=c : - * int putc(int, FILE *) - * } - */ - public static int putc(int x0, MemorySegment x1) { - var mh$ = putc.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("putc", x0, x1); - } - return (int)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class putchar { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_INT - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("putchar"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int putchar(int) - * } - */ - public static FunctionDescriptor putchar$descriptor() { - return putchar.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int putchar(int) - * } - */ - public static MethodHandle putchar$handle() { - return putchar.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int putchar(int) - * } - */ - public static MemorySegment putchar$address() { - return putchar.ADDR; - } - - /** - * {@snippet lang=c : - * int putchar(int) - * } - */ - public static int putchar(int x0) { - var mh$ = putchar.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("putchar", x0); - } - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class puts { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("puts"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int puts(const char *) - * } - */ - public static FunctionDescriptor puts$descriptor() { - return puts.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int puts(const char *) - * } - */ - public static MethodHandle puts$handle() { - return puts.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int puts(const char *) - * } - */ - public static MemorySegment puts$address() { - return puts.ADDR; - } - - /** - * {@snippet lang=c : - * int puts(const char *) - * } - */ - public static int puts(MemorySegment x0) { - var mh$ = puts.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("puts", x0); - } - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class remove { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("remove"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int remove(const char *) - * } - */ - public static FunctionDescriptor remove$descriptor() { - return remove.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int remove(const char *) - * } - */ - public static MethodHandle remove$handle() { - return remove.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int remove(const char *) - * } - */ - public static MemorySegment remove$address() { - return remove.ADDR; - } - - /** - * {@snippet lang=c : - * int remove(const char *) - * } - */ - public static int remove(MemorySegment x0) { - var mh$ = remove.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("remove", x0); - } - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class rename { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("rename"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int rename(const char *__old, const char *__new) - * } - */ - public static FunctionDescriptor rename$descriptor() { - return rename.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int rename(const char *__old, const char *__new) - * } - */ - public static MethodHandle rename$handle() { - return rename.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int rename(const char *__old, const char *__new) - * } - */ - public static MemorySegment rename$address() { - return rename.ADDR; - } - - /** - * {@snippet lang=c : - * int rename(const char *__old, const char *__new) - * } - */ - public static int rename(MemorySegment __old, MemorySegment __new) { - var mh$ = rename.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("rename", __old, __new); - } - return (int)mh$.invokeExact(__old, __new); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class rewind { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("rewind"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * void rewind(FILE *) - * } - */ - public static FunctionDescriptor rewind$descriptor() { - return rewind.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * void rewind(FILE *) - * } - */ - public static MethodHandle rewind$handle() { - return rewind.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * void rewind(FILE *) - * } - */ - public static MemorySegment rewind$address() { - return rewind.ADDR; - } - - /** - * {@snippet lang=c : - * void rewind(FILE *) - * } - */ - public static void rewind(MemorySegment x0) { - var mh$ = rewind.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("rewind", x0); - } - mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - /** - * Variadic invoker class for: - * {@snippet lang=c : - * int scanf(const char *restrict, ...) - * } - */ - public static class scanf { - private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER - ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("scanf"); - - private final MethodHandle handle; - private final FunctionDescriptor descriptor; - private final MethodHandle spreader; - - private scanf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { - this.handle = handle; - this.descriptor = descriptor; - this.spreader = spreader; - } - - /** - * Variadic invoker factory for: - * {@snippet lang=c : - * int scanf(const char *restrict, ...) - * } - */ - public static scanf makeInvoker(MemoryLayout... layouts) { - FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); - Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); - var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); - var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new scanf(mh$, desc$, spreader$); - } - - /** - * {@return the address} - */ - public static MemorySegment address() { - return ADDR; - } - - /** - * {@return the specialized method handle} - */ - public MethodHandle handle() { - return handle; - } - - /** - * {@return the specialized descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } - - public int apply(MemorySegment x0, Object... x1) { - try { - if (TRACE_DOWNCALLS) { - traceDowncall("scanf", x0, x1); - } - return (int)spreader.invokeExact(x0, x1); - } catch(IllegalArgumentException | ClassCastException ex$) { - throw ex$; // rethrow IAE from passing wrong number/type of args - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - } - - private static class setbuf { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("setbuf"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * void setbuf(FILE *restrict, char *restrict) - * } - */ - public static FunctionDescriptor setbuf$descriptor() { - return setbuf.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * void setbuf(FILE *restrict, char *restrict) - * } - */ - public static MethodHandle setbuf$handle() { - return setbuf.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * void setbuf(FILE *restrict, char *restrict) - * } - */ - public static MemorySegment setbuf$address() { - return setbuf.ADDR; - } - - /** - * {@snippet lang=c : - * void setbuf(FILE *restrict, char *restrict) - * } - */ - public static void setbuf(MemorySegment x0, MemorySegment x1) { - var mh$ = setbuf.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("setbuf", x0, x1); - } - mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class setvbuf { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_INT, - somelib_h.C_LONG - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("setvbuf"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int setvbuf(FILE *restrict, char *restrict, int, size_t) - * } - */ - public static FunctionDescriptor setvbuf$descriptor() { - return setvbuf.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int setvbuf(FILE *restrict, char *restrict, int, size_t) - * } - */ - public static MethodHandle setvbuf$handle() { - return setvbuf.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int setvbuf(FILE *restrict, char *restrict, int, size_t) - * } - */ - public static MemorySegment setvbuf$address() { - return setvbuf.ADDR; - } - - /** - * {@snippet lang=c : - * int setvbuf(FILE *restrict, char *restrict, int, size_t) - * } - */ - public static int setvbuf(MemorySegment x0, MemorySegment x1, int x2, long x3) { - var mh$ = setvbuf.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("setvbuf", x0, x1, x2, x3); - } - return (int)mh$.invokeExact(x0, x1, x2, x3); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - /** - * Variadic invoker class for: - * {@snippet lang=c : - * int sprintf(char *restrict, const char *restrict, ...) - * } - */ - public static class sprintf { - private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("sprintf"); - - private final MethodHandle handle; - private final FunctionDescriptor descriptor; - private final MethodHandle spreader; - - private sprintf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { - this.handle = handle; - this.descriptor = descriptor; - this.spreader = spreader; - } - - /** - * Variadic invoker factory for: - * {@snippet lang=c : - * int sprintf(char *restrict, const char *restrict, ...) - * } - */ - public static sprintf makeInvoker(MemoryLayout... layouts) { - FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); - Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); - var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); - var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new sprintf(mh$, desc$, spreader$); - } - - /** - * {@return the address} - */ - public static MemorySegment address() { - return ADDR; - } - - /** - * {@return the specialized method handle} - */ - public MethodHandle handle() { - return handle; - } - - /** - * {@return the specialized descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } - - public int apply(MemorySegment x0, MemorySegment x1, Object... x2) { - try { - if (TRACE_DOWNCALLS) { - traceDowncall("sprintf", x0, x1, x2); - } - return (int)spreader.invokeExact(x0, x1, x2); - } catch(IllegalArgumentException | ClassCastException ex$) { - throw ex$; // rethrow IAE from passing wrong number/type of args - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - } - - /** - * Variadic invoker class for: - * {@snippet lang=c : - * int sscanf(const char *restrict, const char *restrict, ...) - * } - */ - public static class sscanf { - private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("sscanf"); - - private final MethodHandle handle; - private final FunctionDescriptor descriptor; - private final MethodHandle spreader; - - private sscanf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { - this.handle = handle; - this.descriptor = descriptor; - this.spreader = spreader; - } - - /** - * Variadic invoker factory for: - * {@snippet lang=c : - * int sscanf(const char *restrict, const char *restrict, ...) - * } - */ - public static sscanf makeInvoker(MemoryLayout... layouts) { - FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); - Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); - var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); - var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new sscanf(mh$, desc$, spreader$); - } - - /** - * {@return the address} - */ - public static MemorySegment address() { - return ADDR; - } - - /** - * {@return the specialized method handle} - */ - public MethodHandle handle() { - return handle; - } - - /** - * {@return the specialized descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } - - public int apply(MemorySegment x0, MemorySegment x1, Object... x2) { - try { - if (TRACE_DOWNCALLS) { - traceDowncall("sscanf", x0, x1, x2); - } - return (int)spreader.invokeExact(x0, x1, x2); - } catch(IllegalArgumentException | ClassCastException ex$) { - throw ex$; // rethrow IAE from passing wrong number/type of args - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - } - - private static class tmpfile { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("tmpfile"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * FILE *tmpfile() - * } - */ - public static FunctionDescriptor tmpfile$descriptor() { - return tmpfile.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * FILE *tmpfile() - * } - */ - public static MethodHandle tmpfile$handle() { - return tmpfile.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * FILE *tmpfile() - * } - */ - public static MemorySegment tmpfile$address() { - return tmpfile.ADDR; - } - - /** - * {@snippet lang=c : - * FILE *tmpfile() - * } - */ - public static MemorySegment tmpfile() { - var mh$ = tmpfile.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("tmpfile"); - } - return (MemorySegment)mh$.invokeExact(); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class tmpnam { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("tmpnam"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * char *tmpnam(char *) - * } - */ - public static FunctionDescriptor tmpnam$descriptor() { - return tmpnam.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * char *tmpnam(char *) - * } - */ - public static MethodHandle tmpnam$handle() { - return tmpnam.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * char *tmpnam(char *) - * } - */ - public static MemorySegment tmpnam$address() { - return tmpnam.ADDR; - } - - /** - * {@snippet lang=c : - * char *tmpnam(char *) - * } - */ - public static MemorySegment tmpnam(MemorySegment x0) { - var mh$ = tmpnam.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("tmpnam", x0); - } - return (MemorySegment)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class ungetc { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("ungetc"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int ungetc(int, FILE *) - * } - */ - public static FunctionDescriptor ungetc$descriptor() { - return ungetc.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int ungetc(int, FILE *) - * } - */ - public static MethodHandle ungetc$handle() { - return ungetc.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int ungetc(int, FILE *) - * } - */ - public static MemorySegment ungetc$address() { - return ungetc.ADDR; - } - - /** - * {@snippet lang=c : - * int ungetc(int, FILE *) - * } - */ - public static int ungetc(int x0, MemorySegment x1) { - var mh$ = ungetc.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("ungetc", x0, x1); - } - return (int)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class vfprintf { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("vfprintf"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int vfprintf(FILE *restrict, const char *restrict, va_list) - * } - */ - public static FunctionDescriptor vfprintf$descriptor() { - return vfprintf.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int vfprintf(FILE *restrict, const char *restrict, va_list) - * } - */ - public static MethodHandle vfprintf$handle() { - return vfprintf.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int vfprintf(FILE *restrict, const char *restrict, va_list) - * } - */ - public static MemorySegment vfprintf$address() { - return vfprintf.ADDR; - } - - /** - * {@snippet lang=c : - * int vfprintf(FILE *restrict, const char *restrict, va_list) - * } - */ - public static int vfprintf(MemorySegment x0, MemorySegment x1, MemorySegment x2) { - var mh$ = vfprintf.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("vfprintf", x0, x1, x2); - } - return (int)mh$.invokeExact(x0, x1, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class vprintf { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("vprintf"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int vprintf(const char *restrict, va_list) - * } - */ - public static FunctionDescriptor vprintf$descriptor() { - return vprintf.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int vprintf(const char *restrict, va_list) - * } - */ - public static MethodHandle vprintf$handle() { - return vprintf.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int vprintf(const char *restrict, va_list) - * } - */ - public static MemorySegment vprintf$address() { - return vprintf.ADDR; - } - - /** - * {@snippet lang=c : - * int vprintf(const char *restrict, va_list) - * } - */ - public static int vprintf(MemorySegment x0, MemorySegment x1) { - var mh$ = vprintf.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("vprintf", x0, x1); - } - return (int)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class vsprintf { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("vsprintf"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int vsprintf(char *restrict, const char *restrict, va_list) - * } - */ - public static FunctionDescriptor vsprintf$descriptor() { - return vsprintf.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int vsprintf(char *restrict, const char *restrict, va_list) - * } - */ - public static MethodHandle vsprintf$handle() { - return vsprintf.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int vsprintf(char *restrict, const char *restrict, va_list) - * } - */ - public static MemorySegment vsprintf$address() { - return vsprintf.ADDR; - } - - /** - * {@snippet lang=c : - * int vsprintf(char *restrict, const char *restrict, va_list) - * } - */ - public static int vsprintf(MemorySegment x0, MemorySegment x1, MemorySegment x2) { - var mh$ = vsprintf.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("vsprintf", x0, x1, x2); - } - return (int)mh$.invokeExact(x0, x1, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class ctermid { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("ctermid"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * char *ctermid(char *) - * } - */ - public static FunctionDescriptor ctermid$descriptor() { - return ctermid.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * char *ctermid(char *) - * } - */ - public static MethodHandle ctermid$handle() { - return ctermid.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * char *ctermid(char *) - * } - */ - public static MemorySegment ctermid$address() { - return ctermid.ADDR; - } - - /** - * {@snippet lang=c : - * char *ctermid(char *) - * } - */ - public static MemorySegment ctermid(MemorySegment x0) { - var mh$ = ctermid.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("ctermid", x0); - } - return (MemorySegment)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class fdopen { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("fdopen"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * FILE *fdopen(int, const char *) - * } - */ - public static FunctionDescriptor fdopen$descriptor() { - return fdopen.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * FILE *fdopen(int, const char *) - * } - */ - public static MethodHandle fdopen$handle() { - return fdopen.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * FILE *fdopen(int, const char *) - * } - */ - public static MemorySegment fdopen$address() { - return fdopen.ADDR; - } - - /** - * {@snippet lang=c : - * FILE *fdopen(int, const char *) - * } - */ - public static MemorySegment fdopen(int x0, MemorySegment x1) { - var mh$ = fdopen.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("fdopen", x0, x1); - } - return (MemorySegment)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class fileno { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("fileno"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int fileno(FILE *) - * } - */ - public static FunctionDescriptor fileno$descriptor() { - return fileno.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int fileno(FILE *) - * } - */ - public static MethodHandle fileno$handle() { - return fileno.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int fileno(FILE *) - * } - */ - public static MemorySegment fileno$address() { - return fileno.ADDR; - } - - /** - * {@snippet lang=c : - * int fileno(FILE *) - * } - */ - public static int fileno(MemorySegment x0) { - var mh$ = fileno.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("fileno", x0); - } - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class pclose { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("pclose"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int pclose(FILE *) - * } - */ - public static FunctionDescriptor pclose$descriptor() { - return pclose.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int pclose(FILE *) - * } - */ - public static MethodHandle pclose$handle() { - return pclose.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int pclose(FILE *) - * } - */ - public static MemorySegment pclose$address() { - return pclose.ADDR; - } - - /** - * {@snippet lang=c : - * int pclose(FILE *) - * } - */ - public static int pclose(MemorySegment x0) { - var mh$ = pclose.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("pclose", x0); - } - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class popen { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("popen"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * FILE *popen(const char *, const char *) - * } - */ - public static FunctionDescriptor popen$descriptor() { - return popen.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * FILE *popen(const char *, const char *) - * } - */ - public static MethodHandle popen$handle() { - return popen.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * FILE *popen(const char *, const char *) - * } - */ - public static MemorySegment popen$address() { - return popen.ADDR; - } - - /** - * {@snippet lang=c : - * FILE *popen(const char *, const char *) - * } - */ - public static MemorySegment popen(MemorySegment x0, MemorySegment x1) { - var mh$ = popen.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("popen", x0, x1); - } - return (MemorySegment)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class __srget { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("__srget"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int __srget(FILE *) - * } - */ - public static FunctionDescriptor __srget$descriptor() { - return __srget.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int __srget(FILE *) - * } - */ - public static MethodHandle __srget$handle() { - return __srget.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int __srget(FILE *) - * } - */ - public static MemorySegment __srget$address() { - return __srget.ADDR; - } - - /** - * {@snippet lang=c : - * int __srget(FILE *) - * } - */ - public static int __srget(MemorySegment x0) { - var mh$ = __srget.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("__srget", x0); - } - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class __svfscanf { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("__svfscanf"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int __svfscanf(FILE *, const char *, va_list) - * } - */ - public static FunctionDescriptor __svfscanf$descriptor() { - return __svfscanf.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int __svfscanf(FILE *, const char *, va_list) - * } - */ - public static MethodHandle __svfscanf$handle() { - return __svfscanf.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int __svfscanf(FILE *, const char *, va_list) - * } - */ - public static MemorySegment __svfscanf$address() { - return __svfscanf.ADDR; - } - - /** - * {@snippet lang=c : - * int __svfscanf(FILE *, const char *, va_list) - * } - */ - public static int __svfscanf(MemorySegment x0, MemorySegment x1, MemorySegment x2) { - var mh$ = __svfscanf.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("__svfscanf", x0, x1, x2); - } - return (int)mh$.invokeExact(x0, x1, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class __swbuf { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("__swbuf"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int __swbuf(int, FILE *) - * } - */ - public static FunctionDescriptor __swbuf$descriptor() { - return __swbuf.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int __swbuf(int, FILE *) - * } - */ - public static MethodHandle __swbuf$handle() { - return __swbuf.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int __swbuf(int, FILE *) - * } - */ - public static MemorySegment __swbuf$address() { - return __swbuf.ADDR; - } - - /** - * {@snippet lang=c : - * int __swbuf(int, FILE *) - * } - */ - public static int __swbuf(int x0, MemorySegment x1) { - var mh$ = __swbuf.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("__swbuf", x0, x1); - } - return (int)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class flockfile { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("flockfile"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * void flockfile(FILE *) - * } - */ - public static FunctionDescriptor flockfile$descriptor() { - return flockfile.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * void flockfile(FILE *) - * } - */ - public static MethodHandle flockfile$handle() { - return flockfile.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * void flockfile(FILE *) - * } - */ - public static MemorySegment flockfile$address() { - return flockfile.ADDR; - } - - /** - * {@snippet lang=c : - * void flockfile(FILE *) - * } - */ - public static void flockfile(MemorySegment x0) { - var mh$ = flockfile.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("flockfile", x0); - } - mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class ftrylockfile { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("ftrylockfile"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int ftrylockfile(FILE *) - * } - */ - public static FunctionDescriptor ftrylockfile$descriptor() { - return ftrylockfile.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int ftrylockfile(FILE *) - * } - */ - public static MethodHandle ftrylockfile$handle() { - return ftrylockfile.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int ftrylockfile(FILE *) - * } - */ - public static MemorySegment ftrylockfile$address() { - return ftrylockfile.ADDR; - } - - /** - * {@snippet lang=c : - * int ftrylockfile(FILE *) - * } - */ - public static int ftrylockfile(MemorySegment x0) { - var mh$ = ftrylockfile.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("ftrylockfile", x0); - } - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class funlockfile { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("funlockfile"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * void funlockfile(FILE *) - * } - */ - public static FunctionDescriptor funlockfile$descriptor() { - return funlockfile.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * void funlockfile(FILE *) - * } - */ - public static MethodHandle funlockfile$handle() { - return funlockfile.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * void funlockfile(FILE *) - * } - */ - public static MemorySegment funlockfile$address() { - return funlockfile.ADDR; - } - - /** - * {@snippet lang=c : - * void funlockfile(FILE *) - * } - */ - public static void funlockfile(MemorySegment x0) { - var mh$ = funlockfile.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("funlockfile", x0); - } - mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class getc_unlocked { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("getc_unlocked"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int getc_unlocked(FILE *) - * } - */ - public static FunctionDescriptor getc_unlocked$descriptor() { - return getc_unlocked.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int getc_unlocked(FILE *) - * } - */ - public static MethodHandle getc_unlocked$handle() { - return getc_unlocked.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int getc_unlocked(FILE *) - * } - */ - public static MemorySegment getc_unlocked$address() { - return getc_unlocked.ADDR; - } - - /** - * {@snippet lang=c : - * int getc_unlocked(FILE *) - * } - */ - public static int getc_unlocked(MemorySegment x0) { - var mh$ = getc_unlocked.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("getc_unlocked", x0); - } - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class getchar_unlocked { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("getchar_unlocked"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int getchar_unlocked() - * } - */ - public static FunctionDescriptor getchar_unlocked$descriptor() { - return getchar_unlocked.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int getchar_unlocked() - * } - */ - public static MethodHandle getchar_unlocked$handle() { - return getchar_unlocked.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int getchar_unlocked() - * } - */ - public static MemorySegment getchar_unlocked$address() { - return getchar_unlocked.ADDR; - } - - /** - * {@snippet lang=c : - * int getchar_unlocked() - * } - */ - public static int getchar_unlocked() { - var mh$ = getchar_unlocked.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("getchar_unlocked"); - } - return (int)mh$.invokeExact(); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class putc_unlocked { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("putc_unlocked"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int putc_unlocked(int, FILE *) - * } - */ - public static FunctionDescriptor putc_unlocked$descriptor() { - return putc_unlocked.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int putc_unlocked(int, FILE *) - * } - */ - public static MethodHandle putc_unlocked$handle() { - return putc_unlocked.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int putc_unlocked(int, FILE *) - * } - */ - public static MemorySegment putc_unlocked$address() { - return putc_unlocked.ADDR; - } - - /** - * {@snippet lang=c : - * int putc_unlocked(int, FILE *) - * } - */ - public static int putc_unlocked(int x0, MemorySegment x1) { - var mh$ = putc_unlocked.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("putc_unlocked", x0, x1); - } - return (int)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class putchar_unlocked { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_INT - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("putchar_unlocked"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int putchar_unlocked(int) - * } - */ - public static FunctionDescriptor putchar_unlocked$descriptor() { - return putchar_unlocked.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int putchar_unlocked(int) - * } - */ - public static MethodHandle putchar_unlocked$handle() { - return putchar_unlocked.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int putchar_unlocked(int) - * } - */ - public static MemorySegment putchar_unlocked$address() { - return putchar_unlocked.ADDR; - } - - /** - * {@snippet lang=c : - * int putchar_unlocked(int) - * } - */ - public static int putchar_unlocked(int x0) { - var mh$ = putchar_unlocked.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("putchar_unlocked", x0); - } - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class getw { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("getw"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int getw(FILE *) - * } - */ - public static FunctionDescriptor getw$descriptor() { - return getw.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int getw(FILE *) - * } - */ - public static MethodHandle getw$handle() { - return getw.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int getw(FILE *) - * } - */ - public static MemorySegment getw$address() { - return getw.ADDR; - } - - /** - * {@snippet lang=c : - * int getw(FILE *) - * } - */ - public static int getw(MemorySegment x0) { - var mh$ = getw.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("getw", x0); - } - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class putw { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("putw"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int putw(int, FILE *) - * } - */ - public static FunctionDescriptor putw$descriptor() { - return putw.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int putw(int, FILE *) - * } - */ - public static MethodHandle putw$handle() { - return putw.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int putw(int, FILE *) - * } - */ - public static MemorySegment putw$address() { - return putw.ADDR; - } - - /** - * {@snippet lang=c : - * int putw(int, FILE *) - * } - */ - public static int putw(int x0, MemorySegment x1) { - var mh$ = putw.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("putw", x0, x1); - } - return (int)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class tempnam { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("tempnam"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * char *tempnam(const char *__dir, const char *__prefix) - * } - */ - public static FunctionDescriptor tempnam$descriptor() { - return tempnam.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * char *tempnam(const char *__dir, const char *__prefix) - * } - */ - public static MethodHandle tempnam$handle() { - return tempnam.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * char *tempnam(const char *__dir, const char *__prefix) - * } - */ - public static MemorySegment tempnam$address() { - return tempnam.ADDR; - } - - /** - * {@snippet lang=c : - * char *tempnam(const char *__dir, const char *__prefix) - * } - */ - public static MemorySegment tempnam(MemorySegment __dir, MemorySegment __prefix) { - var mh$ = tempnam.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("tempnam", __dir, __prefix); - } - return (MemorySegment)mh$.invokeExact(__dir, __prefix); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - /** - * {@snippet lang=c : - * typedef __darwin_off_t off_t - * } - */ - public static final OfLong off_t = somelib_h.C_LONG_LONG; - - private static class fseeko { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_LONG_LONG, - somelib_h.C_INT - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("fseeko"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int fseeko(FILE *__stream, off_t __offset, int __whence) - * } - */ - public static FunctionDescriptor fseeko$descriptor() { - return fseeko.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int fseeko(FILE *__stream, off_t __offset, int __whence) - * } - */ - public static MethodHandle fseeko$handle() { - return fseeko.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int fseeko(FILE *__stream, off_t __offset, int __whence) - * } - */ - public static MemorySegment fseeko$address() { - return fseeko.ADDR; - } - - /** - * {@snippet lang=c : - * int fseeko(FILE *__stream, off_t __offset, int __whence) - * } - */ - public static int fseeko(MemorySegment __stream, long __offset, int __whence) { - var mh$ = fseeko.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("fseeko", __stream, __offset, __whence); - } - return (int)mh$.invokeExact(__stream, __offset, __whence); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class ftello { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_LONG_LONG, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("ftello"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * off_t ftello(FILE *__stream) - * } - */ - public static FunctionDescriptor ftello$descriptor() { - return ftello.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * off_t ftello(FILE *__stream) - * } - */ - public static MethodHandle ftello$handle() { - return ftello.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * off_t ftello(FILE *__stream) - * } - */ - public static MemorySegment ftello$address() { - return ftello.ADDR; - } - - /** - * {@snippet lang=c : - * off_t ftello(FILE *__stream) - * } - */ - public static long ftello(MemorySegment __stream) { - var mh$ = ftello.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("ftello", __stream); - } - return (long)mh$.invokeExact(__stream); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - /** - * Variadic invoker class for: - * {@snippet lang=c : - * int snprintf(char *restrict __str, size_t __size, const char *restrict __format, ...) - * } - */ - public static class snprintf { - private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_LONG, - somelib_h.C_POINTER - ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("snprintf"); - - private final MethodHandle handle; - private final FunctionDescriptor descriptor; - private final MethodHandle spreader; - - private snprintf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { - this.handle = handle; - this.descriptor = descriptor; - this.spreader = spreader; - } - - /** - * Variadic invoker factory for: - * {@snippet lang=c : - * int snprintf(char *restrict __str, size_t __size, const char *restrict __format, ...) - * } - */ - public static snprintf makeInvoker(MemoryLayout... layouts) { - FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); - Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); - var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); - var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new snprintf(mh$, desc$, spreader$); - } - - /** - * {@return the address} - */ - public static MemorySegment address() { - return ADDR; - } - - /** - * {@return the specialized method handle} - */ - public MethodHandle handle() { - return handle; - } - - /** - * {@return the specialized descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } - - public int apply(MemorySegment __str, long __size, MemorySegment __format, Object... x3) { - try { - if (TRACE_DOWNCALLS) { - traceDowncall("snprintf", __str, __size, __format, x3); - } - return (int)spreader.invokeExact(__str, __size, __format, x3); - } catch(IllegalArgumentException | ClassCastException ex$) { - throw ex$; // rethrow IAE from passing wrong number/type of args - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - } - - private static class vfscanf { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("vfscanf"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int vfscanf(FILE *restrict __stream, const char *restrict __format, va_list) - * } - */ - public static FunctionDescriptor vfscanf$descriptor() { - return vfscanf.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int vfscanf(FILE *restrict __stream, const char *restrict __format, va_list) - * } - */ - public static MethodHandle vfscanf$handle() { - return vfscanf.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int vfscanf(FILE *restrict __stream, const char *restrict __format, va_list) - * } - */ - public static MemorySegment vfscanf$address() { - return vfscanf.ADDR; - } - - /** - * {@snippet lang=c : - * int vfscanf(FILE *restrict __stream, const char *restrict __format, va_list) - * } - */ - public static int vfscanf(MemorySegment __stream, MemorySegment __format, MemorySegment x2) { - var mh$ = vfscanf.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("vfscanf", __stream, __format, x2); - } - return (int)mh$.invokeExact(__stream, __format, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class vscanf { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("vscanf"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int vscanf(const char *restrict __format, va_list) - * } - */ - public static FunctionDescriptor vscanf$descriptor() { - return vscanf.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int vscanf(const char *restrict __format, va_list) - * } - */ - public static MethodHandle vscanf$handle() { - return vscanf.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int vscanf(const char *restrict __format, va_list) - * } - */ - public static MemorySegment vscanf$address() { - return vscanf.ADDR; - } - - /** - * {@snippet lang=c : - * int vscanf(const char *restrict __format, va_list) - * } - */ - public static int vscanf(MemorySegment __format, MemorySegment x1) { - var mh$ = vscanf.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("vscanf", __format, x1); - } - return (int)mh$.invokeExact(__format, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class vsnprintf { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_LONG, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("vsnprintf"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int vsnprintf(char *restrict __str, size_t __size, const char *restrict __format, va_list) - * } - */ - public static FunctionDescriptor vsnprintf$descriptor() { - return vsnprintf.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int vsnprintf(char *restrict __str, size_t __size, const char *restrict __format, va_list) - * } - */ - public static MethodHandle vsnprintf$handle() { - return vsnprintf.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int vsnprintf(char *restrict __str, size_t __size, const char *restrict __format, va_list) - * } - */ - public static MemorySegment vsnprintf$address() { - return vsnprintf.ADDR; - } - - /** - * {@snippet lang=c : - * int vsnprintf(char *restrict __str, size_t __size, const char *restrict __format, va_list) - * } - */ - public static int vsnprintf(MemorySegment __str, long __size, MemorySegment __format, MemorySegment x3) { - var mh$ = vsnprintf.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("vsnprintf", __str, __size, __format, x3); - } - return (int)mh$.invokeExact(__str, __size, __format, x3); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class vsscanf { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("vsscanf"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int vsscanf(const char *restrict __str, const char *restrict __format, va_list) - * } - */ - public static FunctionDescriptor vsscanf$descriptor() { - return vsscanf.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int vsscanf(const char *restrict __str, const char *restrict __format, va_list) - * } - */ - public static MethodHandle vsscanf$handle() { - return vsscanf.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int vsscanf(const char *restrict __str, const char *restrict __format, va_list) - * } - */ - public static MemorySegment vsscanf$address() { - return vsscanf.ADDR; - } - - /** - * {@snippet lang=c : - * int vsscanf(const char *restrict __str, const char *restrict __format, va_list) - * } - */ - public static int vsscanf(MemorySegment __str, MemorySegment __format, MemorySegment x2) { - var mh$ = vsscanf.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("vsscanf", __str, __format, x2); - } - return (int)mh$.invokeExact(__str, __format, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - /** - * {@snippet lang=c : - * typedef __darwin_ssize_t ssize_t - * } - */ - public static final OfLong ssize_t = somelib_h.C_LONG; - - /** - * Variadic invoker class for: - * {@snippet lang=c : - * int dprintf(int, const char *restrict, ...) - * } - */ - public static class dprintf { - private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_INT, - somelib_h.C_POINTER - ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("dprintf"); - - private final MethodHandle handle; - private final FunctionDescriptor descriptor; - private final MethodHandle spreader; - - private dprintf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { - this.handle = handle; - this.descriptor = descriptor; - this.spreader = spreader; - } - - /** - * Variadic invoker factory for: - * {@snippet lang=c : - * int dprintf(int, const char *restrict, ...) - * } - */ - public static dprintf makeInvoker(MemoryLayout... layouts) { - FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); - Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); - var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); - var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new dprintf(mh$, desc$, spreader$); - } - - /** - * {@return the address} - */ - public static MemorySegment address() { - return ADDR; - } - - /** - * {@return the specialized method handle} - */ - public MethodHandle handle() { - return handle; - } - - /** - * {@return the specialized descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } - - public int apply(int x0, MemorySegment x1, Object... x2) { - try { - if (TRACE_DOWNCALLS) { - traceDowncall("dprintf", x0, x1, x2); - } - return (int)spreader.invokeExact(x0, x1, x2); - } catch(IllegalArgumentException | ClassCastException ex$) { - throw ex$; // rethrow IAE from passing wrong number/type of args - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - } - - private static class vdprintf { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("vdprintf"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int vdprintf(int, const char *restrict, va_list) - * } - */ - public static FunctionDescriptor vdprintf$descriptor() { - return vdprintf.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int vdprintf(int, const char *restrict, va_list) - * } - */ - public static MethodHandle vdprintf$handle() { - return vdprintf.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int vdprintf(int, const char *restrict, va_list) - * } - */ - public static MemorySegment vdprintf$address() { - return vdprintf.ADDR; - } - - /** - * {@snippet lang=c : - * int vdprintf(int, const char *restrict, va_list) - * } - */ - public static int vdprintf(int x0, MemorySegment x1, MemorySegment x2) { - var mh$ = vdprintf.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("vdprintf", x0, x1, x2); - } - return (int)mh$.invokeExact(x0, x1, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class getdelim { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_LONG, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("getdelim"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * ssize_t getdelim(char **restrict __linep, size_t *restrict __linecapp, int __delimiter, FILE *restrict __stream) - * } - */ - public static FunctionDescriptor getdelim$descriptor() { - return getdelim.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * ssize_t getdelim(char **restrict __linep, size_t *restrict __linecapp, int __delimiter, FILE *restrict __stream) - * } - */ - public static MethodHandle getdelim$handle() { - return getdelim.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * ssize_t getdelim(char **restrict __linep, size_t *restrict __linecapp, int __delimiter, FILE *restrict __stream) - * } - */ - public static MemorySegment getdelim$address() { - return getdelim.ADDR; - } - - /** - * {@snippet lang=c : - * ssize_t getdelim(char **restrict __linep, size_t *restrict __linecapp, int __delimiter, FILE *restrict __stream) - * } - */ - public static long getdelim(MemorySegment __linep, MemorySegment __linecapp, int __delimiter, MemorySegment __stream) { - var mh$ = getdelim.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("getdelim", __linep, __linecapp, __delimiter, __stream); - } - return (long)mh$.invokeExact(__linep, __linecapp, __delimiter, __stream); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class getline { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_LONG, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("getline"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * ssize_t getline(char **restrict __linep, size_t *restrict __linecapp, FILE *restrict __stream) - * } - */ - public static FunctionDescriptor getline$descriptor() { - return getline.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * ssize_t getline(char **restrict __linep, size_t *restrict __linecapp, FILE *restrict __stream) - * } - */ - public static MethodHandle getline$handle() { - return getline.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * ssize_t getline(char **restrict __linep, size_t *restrict __linecapp, FILE *restrict __stream) - * } - */ - public static MemorySegment getline$address() { - return getline.ADDR; - } - - /** - * {@snippet lang=c : - * ssize_t getline(char **restrict __linep, size_t *restrict __linecapp, FILE *restrict __stream) - * } - */ - public static long getline(MemorySegment __linep, MemorySegment __linecapp, MemorySegment __stream) { - var mh$ = getline.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("getline", __linep, __linecapp, __stream); - } - return (long)mh$.invokeExact(__linep, __linecapp, __stream); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class fmemopen { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("fmemopen"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * FILE *fmemopen(void *restrict __buf, size_t __size, const char *restrict __mode) - * } - */ - public static FunctionDescriptor fmemopen$descriptor() { - return fmemopen.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * FILE *fmemopen(void *restrict __buf, size_t __size, const char *restrict __mode) - * } - */ - public static MethodHandle fmemopen$handle() { - return fmemopen.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * FILE *fmemopen(void *restrict __buf, size_t __size, const char *restrict __mode) - * } - */ - public static MemorySegment fmemopen$address() { - return fmemopen.ADDR; - } - - /** - * {@snippet lang=c : - * FILE *fmemopen(void *restrict __buf, size_t __size, const char *restrict __mode) - * } - */ - public static MemorySegment fmemopen(MemorySegment __buf, long __size, MemorySegment __mode) { - var mh$ = fmemopen.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("fmemopen", __buf, __size, __mode); - } - return (MemorySegment)mh$.invokeExact(__buf, __size, __mode); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class open_memstream { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("open_memstream"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * FILE *open_memstream(char **__bufp, size_t *__sizep) - * } - */ - public static FunctionDescriptor open_memstream$descriptor() { - return open_memstream.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * FILE *open_memstream(char **__bufp, size_t *__sizep) - * } - */ - public static MethodHandle open_memstream$handle() { - return open_memstream.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * FILE *open_memstream(char **__bufp, size_t *__sizep) - * } - */ - public static MemorySegment open_memstream$address() { - return open_memstream.ADDR; - } - - /** - * {@snippet lang=c : - * FILE *open_memstream(char **__bufp, size_t *__sizep) - * } - */ - public static MemorySegment open_memstream(MemorySegment __bufp, MemorySegment __sizep) { - var mh$ = open_memstream.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("open_memstream", __bufp, __sizep); - } - return (MemorySegment)mh$.invokeExact(__bufp, __sizep); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class sys_nerr$constants { - public static final OfInt LAYOUT = somelib_h.C_INT; - public static final MemorySegment SEGMENT = somelib_h.findOrThrow("sys_nerr").reinterpret(LAYOUT.byteSize()); - } - - /** - * Layout for variable: - * {@snippet lang=c : - * extern const int sys_nerr - * } - */ - public static OfInt sys_nerr$layout() { - return sys_nerr$constants.LAYOUT; - } - - /** - * Segment for variable: - * {@snippet lang=c : - * extern const int sys_nerr - * } - */ - public static MemorySegment sys_nerr$segment() { - return sys_nerr$constants.SEGMENT; - } - - /** - * Getter for variable: - * {@snippet lang=c : - * extern const int sys_nerr - * } - */ - public static int sys_nerr() { - return sys_nerr$constants.SEGMENT.get(sys_nerr$constants.LAYOUT, 0L); - } - - /** - * Setter for variable: - * {@snippet lang=c : - * extern const int sys_nerr - * } - */ - public static void sys_nerr(int varValue) { - sys_nerr$constants.SEGMENT.set(sys_nerr$constants.LAYOUT, 0L, varValue); - } - - private static class sys_errlist$constants { - public static final SequenceLayout LAYOUT = MemoryLayout.sequenceLayout(0, somelib_h.C_POINTER); - public static final MemorySegment SEGMENT = somelib_h.findOrThrow("sys_errlist").reinterpret(LAYOUT.byteSize()); - public static final VarHandle HANDLE = LAYOUT.varHandle(); - - public static final long[] DIMS = { }; - } - - /** - * Layout for variable: - * {@snippet lang=c : - * extern const char *const sys_errlist[] - * } - */ - public static SequenceLayout sys_errlist$layout() { - return sys_errlist$constants.LAYOUT; - } - - /** - * Dimensions for array variable: - * {@snippet lang=c : - * extern const char *const sys_errlist[] - * } - */ - public static long[] sys_errlist$dimensions() { - return sys_errlist$constants.DIMS; - } - - /** - * Getter for variable: - * {@snippet lang=c : - * extern const char *const sys_errlist[] - * } - */ - public static MemorySegment sys_errlist() { - return sys_errlist$constants.SEGMENT; - } - - /** - * Setter for variable: - * {@snippet lang=c : - * extern const char *const sys_errlist[] - * } - */ - public static void sys_errlist(MemorySegment varValue) { - MemorySegment.copy(varValue, 0L, sys_errlist$constants.SEGMENT, 0L, sys_errlist$constants.LAYOUT.byteSize()); - } - - /** - * Variadic invoker class for: - * {@snippet lang=c : - * int asprintf(char **restrict, const char *restrict, ...) - * } - */ - public static class asprintf { - private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("asprintf"); - - private final MethodHandle handle; - private final FunctionDescriptor descriptor; - private final MethodHandle spreader; - - private asprintf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { - this.handle = handle; - this.descriptor = descriptor; - this.spreader = spreader; - } - - /** - * Variadic invoker factory for: - * {@snippet lang=c : - * int asprintf(char **restrict, const char *restrict, ...) - * } - */ - public static asprintf makeInvoker(MemoryLayout... layouts) { - FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); - Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); - var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); - var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new asprintf(mh$, desc$, spreader$); - } - - /** - * {@return the address} - */ - public static MemorySegment address() { - return ADDR; - } - - /** - * {@return the specialized method handle} - */ - public MethodHandle handle() { - return handle; - } - - /** - * {@return the specialized descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } - - public int apply(MemorySegment x0, MemorySegment x1, Object... x2) { - try { - if (TRACE_DOWNCALLS) { - traceDowncall("asprintf", x0, x1, x2); - } - return (int)spreader.invokeExact(x0, x1, x2); - } catch(IllegalArgumentException | ClassCastException ex$) { - throw ex$; // rethrow IAE from passing wrong number/type of args - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - } - - private static class ctermid_r { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("ctermid_r"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * char *ctermid_r(char *) - * } - */ - public static FunctionDescriptor ctermid_r$descriptor() { - return ctermid_r.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * char *ctermid_r(char *) - * } - */ - public static MethodHandle ctermid_r$handle() { - return ctermid_r.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * char *ctermid_r(char *) - * } - */ - public static MemorySegment ctermid_r$address() { - return ctermid_r.ADDR; - } - - /** - * {@snippet lang=c : - * char *ctermid_r(char *) - * } - */ - public static MemorySegment ctermid_r(MemorySegment x0) { - var mh$ = ctermid_r.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("ctermid_r", x0); - } - return (MemorySegment)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class fgetln { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("fgetln"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * char *fgetln(FILE *, size_t *) - * } - */ - public static FunctionDescriptor fgetln$descriptor() { - return fgetln.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * char *fgetln(FILE *, size_t *) - * } - */ - public static MethodHandle fgetln$handle() { - return fgetln.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * char *fgetln(FILE *, size_t *) - * } - */ - public static MemorySegment fgetln$address() { - return fgetln.ADDR; - } - - /** - * {@snippet lang=c : - * char *fgetln(FILE *, size_t *) - * } - */ - public static MemorySegment fgetln(MemorySegment x0, MemorySegment x1) { - var mh$ = fgetln.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("fgetln", x0, x1); - } - return (MemorySegment)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class fmtcheck { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("fmtcheck"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * const char *fmtcheck(const char *, const char *) - * } - */ - public static FunctionDescriptor fmtcheck$descriptor() { - return fmtcheck.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * const char *fmtcheck(const char *, const char *) - * } - */ - public static MethodHandle fmtcheck$handle() { - return fmtcheck.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * const char *fmtcheck(const char *, const char *) - * } - */ - public static MemorySegment fmtcheck$address() { - return fmtcheck.ADDR; - } - - /** - * {@snippet lang=c : - * const char *fmtcheck(const char *, const char *) - * } - */ - public static MemorySegment fmtcheck(MemorySegment x0, MemorySegment x1) { - var mh$ = fmtcheck.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("fmtcheck", x0, x1); - } - return (MemorySegment)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class fpurge { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("fpurge"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int fpurge(FILE *) - * } - */ - public static FunctionDescriptor fpurge$descriptor() { - return fpurge.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int fpurge(FILE *) - * } - */ - public static MethodHandle fpurge$handle() { - return fpurge.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int fpurge(FILE *) - * } - */ - public static MemorySegment fpurge$address() { - return fpurge.ADDR; - } - - /** - * {@snippet lang=c : - * int fpurge(FILE *) - * } - */ - public static int fpurge(MemorySegment x0) { - var mh$ = fpurge.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("fpurge", x0); - } - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class setbuffer { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_INT - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("setbuffer"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * void setbuffer(FILE *, char *, int) - * } - */ - public static FunctionDescriptor setbuffer$descriptor() { - return setbuffer.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * void setbuffer(FILE *, char *, int) - * } - */ - public static MethodHandle setbuffer$handle() { - return setbuffer.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * void setbuffer(FILE *, char *, int) - * } - */ - public static MemorySegment setbuffer$address() { - return setbuffer.ADDR; - } - - /** - * {@snippet lang=c : - * void setbuffer(FILE *, char *, int) - * } - */ - public static void setbuffer(MemorySegment x0, MemorySegment x1, int x2) { - var mh$ = setbuffer.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("setbuffer", x0, x1, x2); - } - mh$.invokeExact(x0, x1, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class setlinebuf { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("setlinebuf"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int setlinebuf(FILE *) - * } - */ - public static FunctionDescriptor setlinebuf$descriptor() { - return setlinebuf.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int setlinebuf(FILE *) - * } - */ - public static MethodHandle setlinebuf$handle() { - return setlinebuf.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int setlinebuf(FILE *) - * } - */ - public static MemorySegment setlinebuf$address() { - return setlinebuf.ADDR; - } - - /** - * {@snippet lang=c : - * int setlinebuf(FILE *) - * } - */ - public static int setlinebuf(MemorySegment x0) { - var mh$ = setlinebuf.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("setlinebuf", x0); - } - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class vasprintf { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("vasprintf"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int vasprintf(char **restrict, const char *restrict, va_list) - * } - */ - public static FunctionDescriptor vasprintf$descriptor() { - return vasprintf.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int vasprintf(char **restrict, const char *restrict, va_list) - * } - */ - public static MethodHandle vasprintf$handle() { - return vasprintf.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int vasprintf(char **restrict, const char *restrict, va_list) - * } - */ - public static MemorySegment vasprintf$address() { - return vasprintf.ADDR; - } - - /** - * {@snippet lang=c : - * int vasprintf(char **restrict, const char *restrict, va_list) - * } - */ - public static int vasprintf(MemorySegment x0, MemorySegment x1, MemorySegment x2) { - var mh$ = vasprintf.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("vasprintf", x0, x1, x2); - } - return (int)mh$.invokeExact(x0, x1, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class funopen { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("funopen"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * FILE *funopen(const void *, int (* _Nullable)(void *, char *, int), int (* _Nullable)(void *, const char *, int), fpos_t (* _Nullable)(void *, fpos_t, int), int (* _Nullable)(void *)) - * } - */ - public static FunctionDescriptor funopen$descriptor() { - return funopen.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * FILE *funopen(const void *, int (* _Nullable)(void *, char *, int), int (* _Nullable)(void *, const char *, int), fpos_t (* _Nullable)(void *, fpos_t, int), int (* _Nullable)(void *)) - * } - */ - public static MethodHandle funopen$handle() { - return funopen.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * FILE *funopen(const void *, int (* _Nullable)(void *, char *, int), int (* _Nullable)(void *, const char *, int), fpos_t (* _Nullable)(void *, fpos_t, int), int (* _Nullable)(void *)) - * } - */ - public static MemorySegment funopen$address() { - return funopen.ADDR; - } - - /** - * {@snippet lang=c : - * FILE *funopen(const void *, int (* _Nullable)(void *, char *, int), int (* _Nullable)(void *, const char *, int), fpos_t (* _Nullable)(void *, fpos_t, int), int (* _Nullable)(void *)) - * } - */ - public static MemorySegment funopen(MemorySegment x0, MemorySegment x1, MemorySegment x2, MemorySegment x3, MemorySegment x4) { - var mh$ = funopen.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("funopen", x0, x1, x2, x3, x4); - } - return (MemorySegment)mh$.invokeExact(x0, x1, x2, x3, x4); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - /** - * Variadic invoker class for: - * {@snippet lang=c : - * extern int __sprintf_chk(char *restrict, int, size_t, const char *restrict, ...) - * } - */ - public static class __sprintf_chk { - private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_INT, - somelib_h.C_LONG, - somelib_h.C_POINTER - ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("__sprintf_chk"); - - private final MethodHandle handle; - private final FunctionDescriptor descriptor; - private final MethodHandle spreader; - - private __sprintf_chk(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { - this.handle = handle; - this.descriptor = descriptor; - this.spreader = spreader; - } - - /** - * Variadic invoker factory for: - * {@snippet lang=c : - * extern int __sprintf_chk(char *restrict, int, size_t, const char *restrict, ...) - * } - */ - public static __sprintf_chk makeInvoker(MemoryLayout... layouts) { - FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); - Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); - var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); - var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new __sprintf_chk(mh$, desc$, spreader$); - } - - /** - * {@return the address} - */ - public static MemorySegment address() { - return ADDR; - } - - /** - * {@return the specialized method handle} - */ - public MethodHandle handle() { - return handle; - } - - /** - * {@return the specialized descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } - - public int apply(MemorySegment x0, int x1, long x2, MemorySegment x3, Object... x4) { - try { - if (TRACE_DOWNCALLS) { - traceDowncall("__sprintf_chk", x0, x1, x2, x3, x4); - } - return (int)spreader.invokeExact(x0, x1, x2, x3, x4); - } catch(IllegalArgumentException | ClassCastException ex$) { - throw ex$; // rethrow IAE from passing wrong number/type of args - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - } - - /** - * Variadic invoker class for: - * {@snippet lang=c : - * extern int __snprintf_chk(char *restrict, size_t, int, size_t, const char *restrict, ...) - * } - */ - public static class __snprintf_chk { - private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_LONG, - somelib_h.C_INT, - somelib_h.C_LONG, - somelib_h.C_POINTER - ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("__snprintf_chk"); - - private final MethodHandle handle; - private final FunctionDescriptor descriptor; - private final MethodHandle spreader; - - private __snprintf_chk(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { - this.handle = handle; - this.descriptor = descriptor; - this.spreader = spreader; - } - - /** - * Variadic invoker factory for: - * {@snippet lang=c : - * extern int __snprintf_chk(char *restrict, size_t, int, size_t, const char *restrict, ...) - * } - */ - public static __snprintf_chk makeInvoker(MemoryLayout... layouts) { - FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); - Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); - var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); - var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new __snprintf_chk(mh$, desc$, spreader$); - } - - /** - * {@return the address} - */ - public static MemorySegment address() { - return ADDR; - } - - /** - * {@return the specialized method handle} - */ - public MethodHandle handle() { - return handle; - } - - /** - * {@return the specialized descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } - - public int apply(MemorySegment x0, long x1, int x2, long x3, MemorySegment x4, Object... x5) { - try { - if (TRACE_DOWNCALLS) { - traceDowncall("__snprintf_chk", x0, x1, x2, x3, x4, x5); - } - return (int)spreader.invokeExact(x0, x1, x2, x3, x4, x5); - } catch(IllegalArgumentException | ClassCastException ex$) { - throw ex$; // rethrow IAE from passing wrong number/type of args - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - } - - private static class __vsprintf_chk { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_INT, - somelib_h.C_LONG, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("__vsprintf_chk"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern int __vsprintf_chk(char *restrict, int, size_t, const char *restrict, va_list) - * } - */ - public static FunctionDescriptor __vsprintf_chk$descriptor() { - return __vsprintf_chk.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern int __vsprintf_chk(char *restrict, int, size_t, const char *restrict, va_list) - * } - */ - public static MethodHandle __vsprintf_chk$handle() { - return __vsprintf_chk.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern int __vsprintf_chk(char *restrict, int, size_t, const char *restrict, va_list) - * } - */ - public static MemorySegment __vsprintf_chk$address() { - return __vsprintf_chk.ADDR; - } - - /** - * {@snippet lang=c : - * extern int __vsprintf_chk(char *restrict, int, size_t, const char *restrict, va_list) - * } - */ - public static int __vsprintf_chk(MemorySegment x0, int x1, long x2, MemorySegment x3, MemorySegment x4) { - var mh$ = __vsprintf_chk.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("__vsprintf_chk", x0, x1, x2, x3, x4); - } - return (int)mh$.invokeExact(x0, x1, x2, x3, x4); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class __vsnprintf_chk { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_LONG, - somelib_h.C_INT, - somelib_h.C_LONG, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("__vsnprintf_chk"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern int __vsnprintf_chk(char *restrict, size_t, int, size_t, const char *restrict, va_list) - * } - */ - public static FunctionDescriptor __vsnprintf_chk$descriptor() { - return __vsnprintf_chk.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern int __vsnprintf_chk(char *restrict, size_t, int, size_t, const char *restrict, va_list) - * } - */ - public static MethodHandle __vsnprintf_chk$handle() { - return __vsnprintf_chk.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern int __vsnprintf_chk(char *restrict, size_t, int, size_t, const char *restrict, va_list) - * } - */ - public static MemorySegment __vsnprintf_chk$address() { - return __vsnprintf_chk.ADDR; - } - - /** - * {@snippet lang=c : - * extern int __vsnprintf_chk(char *restrict, size_t, int, size_t, const char *restrict, va_list) - * } - */ - public static int __vsnprintf_chk(MemorySegment x0, long x1, int x2, long x3, MemorySegment x4, MemorySegment x5) { - var mh$ = __vsnprintf_chk.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("__vsnprintf_chk", x0, x1, x2, x3, x4, x5); - } - return (int)mh$.invokeExact(x0, x1, x2, x3, x4, x5); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - /** - * {@snippet lang=c : - * typedef unsigned char uint8_t - * } - */ - public static final OfByte uint8_t = somelib_h.C_CHAR; - /** - * {@snippet lang=c : - * typedef unsigned short uint16_t - * } - */ - public static final OfShort uint16_t = somelib_h.C_SHORT; - /** - * {@snippet lang=c : - * typedef unsigned int uint32_t - * } - */ - public static final OfInt uint32_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef unsigned long long uint64_t - * } - */ - public static final OfLong uint64_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef int8_t int_least8_t - * } - */ - public static final OfByte int_least8_t = somelib_h.C_CHAR; - /** - * {@snippet lang=c : - * typedef int16_t int_least16_t - * } - */ - public static final OfShort int_least16_t = somelib_h.C_SHORT; - /** - * {@snippet lang=c : - * typedef int32_t int_least32_t - * } - */ - public static final OfInt int_least32_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef int64_t int_least64_t - * } - */ - public static final OfLong int_least64_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef uint8_t uint_least8_t - * } - */ - public static final OfByte uint_least8_t = somelib_h.C_CHAR; - /** - * {@snippet lang=c : - * typedef uint16_t uint_least16_t - * } - */ - public static final OfShort uint_least16_t = somelib_h.C_SHORT; - /** - * {@snippet lang=c : - * typedef uint32_t uint_least32_t - * } - */ - public static final OfInt uint_least32_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef uint64_t uint_least64_t - * } - */ - public static final OfLong uint_least64_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef int8_t int_fast8_t - * } - */ - public static final OfByte int_fast8_t = somelib_h.C_CHAR; - /** - * {@snippet lang=c : - * typedef int16_t int_fast16_t - * } - */ - public static final OfShort int_fast16_t = somelib_h.C_SHORT; - /** - * {@snippet lang=c : - * typedef int32_t int_fast32_t - * } - */ - public static final OfInt int_fast32_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef int64_t int_fast64_t - * } - */ - public static final OfLong int_fast64_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef uint8_t uint_fast8_t - * } - */ - public static final OfByte uint_fast8_t = somelib_h.C_CHAR; - /** - * {@snippet lang=c : - * typedef uint16_t uint_fast16_t - * } - */ - public static final OfShort uint_fast16_t = somelib_h.C_SHORT; - /** - * {@snippet lang=c : - * typedef uint32_t uint_fast32_t - * } - */ - public static final OfInt uint_fast32_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef uint64_t uint_fast64_t - * } - */ - public static final OfLong uint_fast64_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef long intmax_t - * } - */ - public static final OfLong intmax_t = somelib_h.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned long uintmax_t - * } - */ - public static final OfLong uintmax_t = somelib_h.C_LONG; - /** - * {@snippet lang=c : - * typedef long ptrdiff_t - * } - */ - public static final OfLong ptrdiff_t = somelib_h.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned long rsize_t - * } - */ - public static final OfLong rsize_t = somelib_h.C_LONG; - /** - * {@snippet lang=c : - * typedef int wchar_t - * } - */ - public static final OfInt wchar_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef unsigned char u_char - * } - */ - public static final OfByte u_char = somelib_h.C_CHAR; - /** - * {@snippet lang=c : - * typedef unsigned short u_short - * } - */ - public static final OfShort u_short = somelib_h.C_SHORT; - /** - * {@snippet lang=c : - * typedef unsigned int u_int - * } - */ - public static final OfInt u_int = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef unsigned long u_long - * } - */ - public static final OfLong u_long = somelib_h.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned short ushort - * } - */ - public static final OfShort ushort = somelib_h.C_SHORT; - /** - * {@snippet lang=c : - * typedef unsigned int uint - * } - */ - public static final OfInt uint = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef u_int64_t u_quad_t - * } - */ - public static final OfLong u_quad_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef int64_t quad_t - * } - */ - public static final OfLong quad_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef quad_t *qaddr_t - * } - */ - public static final AddressLayout qaddr_t = somelib_h.C_POINTER; - /** - * {@snippet lang=c : - * typedef char *caddr_t - * } - */ - public static final AddressLayout caddr_t = somelib_h.C_POINTER; - /** - * {@snippet lang=c : - * typedef int32_t daddr_t - * } - */ - public static final OfInt daddr_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef __darwin_dev_t dev_t - * } - */ - public static final OfInt dev_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef u_int32_t fixpt_t - * } - */ - public static final OfInt fixpt_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef __darwin_blkcnt_t blkcnt_t - * } - */ - public static final OfLong blkcnt_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef __darwin_blksize_t blksize_t - * } - */ - public static final OfInt blksize_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef __darwin_gid_t gid_t - * } - */ - public static final OfInt gid_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef __uint32_t in_addr_t - * } - */ - public static final OfInt in_addr_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef __uint16_t in_port_t - * } - */ - public static final OfShort in_port_t = somelib_h.C_SHORT; - /** - * {@snippet lang=c : - * typedef __darwin_ino_t ino_t - * } - */ - public static final OfLong ino_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef __darwin_ino64_t ino64_t - * } - */ - public static final OfLong ino64_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef __int32_t key_t - * } - */ - public static final OfInt key_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef __darwin_mode_t mode_t - * } - */ - public static final OfShort mode_t = somelib_h.C_SHORT; - /** - * {@snippet lang=c : - * typedef __uint16_t nlink_t - * } - */ - public static final OfShort nlink_t = somelib_h.C_SHORT; - /** - * {@snippet lang=c : - * typedef __darwin_id_t id_t - * } - */ - public static final OfInt id_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef __darwin_pid_t pid_t - * } - */ - public static final OfInt pid_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef int32_t segsz_t - * } - */ - public static final OfInt segsz_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef int32_t swblk_t - * } - */ - public static final OfInt swblk_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef __darwin_uid_t uid_t - * } - */ - public static final OfInt uid_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef __darwin_clock_t clock_t - * } - */ - public static final OfLong clock_t = somelib_h.C_LONG; - /** - * {@snippet lang=c : - * typedef __darwin_time_t time_t - * } - */ - public static final OfLong time_t = somelib_h.C_LONG; - /** - * {@snippet lang=c : - * typedef __darwin_useconds_t useconds_t - * } - */ - public static final OfInt useconds_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef __darwin_suseconds_t suseconds_t - * } - */ - public static final OfInt suseconds_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef int errno_t - * } - */ - public static final OfInt errno_t = somelib_h.C_INT; - - private static class __darwin_check_fd_set_overflow { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_INT - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("__darwin_check_fd_set_overflow"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * int __darwin_check_fd_set_overflow(int, const void *, int) - * } - */ - public static FunctionDescriptor __darwin_check_fd_set_overflow$descriptor() { - return __darwin_check_fd_set_overflow.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * int __darwin_check_fd_set_overflow(int, const void *, int) - * } - */ - public static MethodHandle __darwin_check_fd_set_overflow$handle() { - return __darwin_check_fd_set_overflow.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * int __darwin_check_fd_set_overflow(int, const void *, int) - * } - */ - public static MemorySegment __darwin_check_fd_set_overflow$address() { - return __darwin_check_fd_set_overflow.ADDR; - } - - /** - * {@snippet lang=c : - * int __darwin_check_fd_set_overflow(int, const void *, int) - * } - */ - public static int __darwin_check_fd_set_overflow(int x0, MemorySegment x1, int x2) { - var mh$ = __darwin_check_fd_set_overflow.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("__darwin_check_fd_set_overflow", x0, x1, x2); - } - return (int)mh$.invokeExact(x0, x1, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - /** - * {@snippet lang=c : - * typedef __int32_t fd_mask - * } - */ - public static final OfInt fd_mask = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef __darwin_pthread_t pthread_t - * } - */ - public static final AddressLayout pthread_t = somelib_h.C_POINTER; - /** - * {@snippet lang=c : - * typedef __darwin_pthread_key_t pthread_key_t - * } - */ - public static final OfLong pthread_key_t = somelib_h.C_LONG; - /** - * {@snippet lang=c : - * typedef __darwin_fsblkcnt_t fsblkcnt_t - * } - */ - public static final OfInt fsblkcnt_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef __darwin_fsfilcnt_t fsfilcnt_t - * } - */ - public static final OfInt fsfilcnt_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef uint16_t char16_t - * } - */ - public static final OfShort char16_t = somelib_h.C_SHORT; - /** - * {@snippet lang=c : - * typedef uint32_t char32_t - * } - */ - public static final OfInt char32_t = somelib_h.C_INT; - - private static class diplomat_simple_write { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - DiplomatWrite.layout(), - somelib_h.C_POINTER, - somelib_h.C_LONG - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_simple_write"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) - * } - */ - public static FunctionDescriptor diplomat_simple_write$descriptor() { - return diplomat_simple_write.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) - * } - */ - public static MethodHandle diplomat_simple_write$handle() { - return diplomat_simple_write.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) - * } - */ - public static MemorySegment diplomat_simple_write$address() { - return diplomat_simple_write.ADDR; - } - - /** - * {@snippet lang=c : - * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) - * } - */ - public static MemorySegment diplomat_simple_write(SegmentAllocator allocator, MemorySegment buf, long buf_size) { - var mh$ = diplomat_simple_write.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("diplomat_simple_write", allocator, buf, buf_size); - } - return (MemorySegment)mh$.invokeExact(allocator, buf, buf_size); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class diplomat_buffer_write_create { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_LONG - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_create"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * DiplomatWrite *diplomat_buffer_write_create(size_t cap) - * } - */ - public static FunctionDescriptor diplomat_buffer_write_create$descriptor() { - return diplomat_buffer_write_create.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * DiplomatWrite *diplomat_buffer_write_create(size_t cap) - * } - */ - public static MethodHandle diplomat_buffer_write_create$handle() { - return diplomat_buffer_write_create.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * DiplomatWrite *diplomat_buffer_write_create(size_t cap) - * } - */ - public static MemorySegment diplomat_buffer_write_create$address() { - return diplomat_buffer_write_create.ADDR; - } - - /** - * {@snippet lang=c : - * DiplomatWrite *diplomat_buffer_write_create(size_t cap) - * } - */ - public static MemorySegment diplomat_buffer_write_create(long cap) { - var mh$ = diplomat_buffer_write_create.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("diplomat_buffer_write_create", cap); - } - return (MemorySegment)mh$.invokeExact(cap); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class diplomat_buffer_write_get_bytes { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_get_bytes"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) - * } - */ - public static FunctionDescriptor diplomat_buffer_write_get_bytes$descriptor() { - return diplomat_buffer_write_get_bytes.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) - * } - */ - public static MethodHandle diplomat_buffer_write_get_bytes$handle() { - return diplomat_buffer_write_get_bytes.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) - * } - */ - public static MemorySegment diplomat_buffer_write_get_bytes$address() { - return diplomat_buffer_write_get_bytes.ADDR; - } - - /** - * {@snippet lang=c : - * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) - * } - */ - public static MemorySegment diplomat_buffer_write_get_bytes(MemorySegment t) { - var mh$ = diplomat_buffer_write_get_bytes.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("diplomat_buffer_write_get_bytes", t); - } - return (MemorySegment)mh$.invokeExact(t); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class diplomat_buffer_write_len { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_LONG, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_len"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * size_t diplomat_buffer_write_len(DiplomatWrite *t) - * } - */ - public static FunctionDescriptor diplomat_buffer_write_len$descriptor() { - return diplomat_buffer_write_len.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * size_t diplomat_buffer_write_len(DiplomatWrite *t) - * } - */ - public static MethodHandle diplomat_buffer_write_len$handle() { - return diplomat_buffer_write_len.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * size_t diplomat_buffer_write_len(DiplomatWrite *t) - * } - */ - public static MemorySegment diplomat_buffer_write_len$address() { - return diplomat_buffer_write_len.ADDR; - } - - /** - * {@snippet lang=c : - * size_t diplomat_buffer_write_len(DiplomatWrite *t) - * } - */ - public static long diplomat_buffer_write_len(MemorySegment t) { - var mh$ = diplomat_buffer_write_len.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("diplomat_buffer_write_len", t); - } - return (long)mh$.invokeExact(t); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class diplomat_buffer_write_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_destroy"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * void diplomat_buffer_write_destroy(DiplomatWrite *t) - * } - */ - public static FunctionDescriptor diplomat_buffer_write_destroy$descriptor() { - return diplomat_buffer_write_destroy.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * void diplomat_buffer_write_destroy(DiplomatWrite *t) - * } - */ - public static MethodHandle diplomat_buffer_write_destroy$handle() { - return diplomat_buffer_write_destroy.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * void diplomat_buffer_write_destroy(DiplomatWrite *t) - * } - */ - public static MemorySegment diplomat_buffer_write_destroy$address() { - return diplomat_buffer_write_destroy.ADDR; - } - - /** - * {@snippet lang=c : - * void diplomat_buffer_write_destroy(DiplomatWrite *t) - * } - */ - public static void diplomat_buffer_write_destroy(MemorySegment t) { - var mh$ = diplomat_buffer_write_destroy.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("diplomat_buffer_write_destroy", t); - } - mh$.invokeExact(t); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class diplomat_is_str { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_BOOL, - somelib_h.C_POINTER, - somelib_h.C_LONG - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_is_str"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * bool diplomat_is_str(const char *buf, size_t len) - * } - */ - public static FunctionDescriptor diplomat_is_str$descriptor() { - return diplomat_is_str.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * bool diplomat_is_str(const char *buf, size_t len) - * } - */ - public static MethodHandle diplomat_is_str$handle() { - return diplomat_is_str.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * bool diplomat_is_str(const char *buf, size_t len) - * } - */ - public static MemorySegment diplomat_is_str$address() { - return diplomat_is_str.ADDR; - } - - /** - * {@snippet lang=c : - * bool diplomat_is_str(const char *buf, size_t len) - * } - */ - public static boolean diplomat_is_str(MemorySegment buf, long len) { - var mh$ = diplomat_is_str.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("diplomat_is_str", buf, len); - } - return (boolean)mh$.invokeExact(buf, len); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - private static final int ICU4XFixedDecimalGroupingStrategy_Auto = (int)0L; - /** - * {@snippet lang=c : - * enum ICU4XFixedDecimalGroupingStrategy.ICU4XFixedDecimalGroupingStrategy_Auto = 0 - * } - */ - public static int ICU4XFixedDecimalGroupingStrategy_Auto() { - return ICU4XFixedDecimalGroupingStrategy_Auto; - } - private static final int ICU4XFixedDecimalGroupingStrategy_Never = (int)1L; - /** - * {@snippet lang=c : - * enum ICU4XFixedDecimalGroupingStrategy.ICU4XFixedDecimalGroupingStrategy_Never = 1 - * } - */ - public static int ICU4XFixedDecimalGroupingStrategy_Never() { - return ICU4XFixedDecimalGroupingStrategy_Never; - } - private static final int ICU4XFixedDecimalGroupingStrategy_Always = (int)2L; - /** - * {@snippet lang=c : - * enum ICU4XFixedDecimalGroupingStrategy.ICU4XFixedDecimalGroupingStrategy_Always = 2 - * } - */ - public static int ICU4XFixedDecimalGroupingStrategy_Always() { - return ICU4XFixedDecimalGroupingStrategy_Always; - } - private static final int ICU4XFixedDecimalGroupingStrategy_Min2 = (int)3L; - /** - * {@snippet lang=c : - * enum ICU4XFixedDecimalGroupingStrategy.ICU4XFixedDecimalGroupingStrategy_Min2 = 3 - * } - */ - public static int ICU4XFixedDecimalGroupingStrategy_Min2() { - return ICU4XFixedDecimalGroupingStrategy_Min2; - } - - /** - * Variadic invoker class for: - * {@snippet lang=c : - * ICU4XFixedDecimalFormatterOptions ICU4XFixedDecimalFormatterOptions_default() - * } - */ - public static class ICU4XFixedDecimalFormatterOptions_default { - private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - ICU4XFixedDecimalFormatterOptions.layout() ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("ICU4XFixedDecimalFormatterOptions_default"); - - private final MethodHandle handle; - private final FunctionDescriptor descriptor; - private final MethodHandle spreader; - - private ICU4XFixedDecimalFormatterOptions_default(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { - this.handle = handle; - this.descriptor = descriptor; - this.spreader = spreader; - } - - /** - * Variadic invoker factory for: - * {@snippet lang=c : - * ICU4XFixedDecimalFormatterOptions ICU4XFixedDecimalFormatterOptions_default() - * } - */ - public static ICU4XFixedDecimalFormatterOptions_default makeInvoker(MemoryLayout... layouts) { - FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); - Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); - var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); - var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new ICU4XFixedDecimalFormatterOptions_default(mh$, desc$, spreader$); - } - - /** - * {@return the address} - */ - public static MemorySegment address() { - return ADDR; - } - - /** - * {@return the specialized method handle} - */ - public MethodHandle handle() { - return handle; - } - - /** - * {@return the specialized descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } - - public MemorySegment apply(SegmentAllocator allocator, Object... x0) { - try { - if (TRACE_DOWNCALLS) { - traceDowncall("ICU4XFixedDecimalFormatterOptions_default", allocator, x0); - } - return (MemorySegment)spreader.invokeExact(allocator, x0); - } catch(IllegalArgumentException | ClassCastException ex$) { - throw ex$; // rethrow IAE from passing wrong number/type of args - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - } - - private static class ICU4XFixedDecimalFormatter_try_new { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - ICU4XFixedDecimalFormatter_try_new_result.layout(), - somelib_h.C_POINTER, - somelib_h.C_POINTER, - ICU4XFixedDecimalFormatterOptions.layout() - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("ICU4XFixedDecimalFormatter_try_new"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * struct ICU4XFixedDecimalFormatter_try_new_result ICU4XFixedDecimalFormatter_try_new(const ICU4XLocale *locale, const ICU4XDataProvider *provider, ICU4XFixedDecimalFormatterOptions options) - * } - */ - public static FunctionDescriptor ICU4XFixedDecimalFormatter_try_new$descriptor() { - return ICU4XFixedDecimalFormatter_try_new.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * struct ICU4XFixedDecimalFormatter_try_new_result ICU4XFixedDecimalFormatter_try_new(const ICU4XLocale *locale, const ICU4XDataProvider *provider, ICU4XFixedDecimalFormatterOptions options) - * } - */ - public static MethodHandle ICU4XFixedDecimalFormatter_try_new$handle() { - return ICU4XFixedDecimalFormatter_try_new.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * struct ICU4XFixedDecimalFormatter_try_new_result ICU4XFixedDecimalFormatter_try_new(const ICU4XLocale *locale, const ICU4XDataProvider *provider, ICU4XFixedDecimalFormatterOptions options) - * } - */ - public static MemorySegment ICU4XFixedDecimalFormatter_try_new$address() { - return ICU4XFixedDecimalFormatter_try_new.ADDR; - } - - /** - * {@snippet lang=c : - * struct ICU4XFixedDecimalFormatter_try_new_result ICU4XFixedDecimalFormatter_try_new(const ICU4XLocale *locale, const ICU4XDataProvider *provider, ICU4XFixedDecimalFormatterOptions options) - * } - */ - public static MemorySegment ICU4XFixedDecimalFormatter_try_new(SegmentAllocator allocator, MemorySegment locale, MemorySegment provider, MemorySegment options) { - var mh$ = ICU4XFixedDecimalFormatter_try_new.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("ICU4XFixedDecimalFormatter_try_new", allocator, locale, provider, options); - } - return (MemorySegment)mh$.invokeExact(allocator, locale, provider, options); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class ICU4XFixedDecimalFormatter_format_write { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("ICU4XFixedDecimalFormatter_format_write"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * void ICU4XFixedDecimalFormatter_format_write(const ICU4XFixedDecimalFormatter *self, const ICU4XFixedDecimal *value, DiplomatWrite *write) - * } - */ - public static FunctionDescriptor ICU4XFixedDecimalFormatter_format_write$descriptor() { - return ICU4XFixedDecimalFormatter_format_write.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * void ICU4XFixedDecimalFormatter_format_write(const ICU4XFixedDecimalFormatter *self, const ICU4XFixedDecimal *value, DiplomatWrite *write) - * } - */ - public static MethodHandle ICU4XFixedDecimalFormatter_format_write$handle() { - return ICU4XFixedDecimalFormatter_format_write.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * void ICU4XFixedDecimalFormatter_format_write(const ICU4XFixedDecimalFormatter *self, const ICU4XFixedDecimal *value, DiplomatWrite *write) - * } - */ - public static MemorySegment ICU4XFixedDecimalFormatter_format_write$address() { - return ICU4XFixedDecimalFormatter_format_write.ADDR; - } - - /** - * {@snippet lang=c : - * void ICU4XFixedDecimalFormatter_format_write(const ICU4XFixedDecimalFormatter *self, const ICU4XFixedDecimal *value, DiplomatWrite *write) - * } - */ - public static void ICU4XFixedDecimalFormatter_format_write(MemorySegment self, MemorySegment value, MemorySegment write) { - var mh$ = ICU4XFixedDecimalFormatter_format_write.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("ICU4XFixedDecimalFormatter_format_write", self, value, write); - } - mh$.invokeExact(self, value, write); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class ICU4XFixedDecimalFormatter_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("ICU4XFixedDecimalFormatter_destroy"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * void ICU4XFixedDecimalFormatter_destroy(ICU4XFixedDecimalFormatter *self) - * } - */ - public static FunctionDescriptor ICU4XFixedDecimalFormatter_destroy$descriptor() { - return ICU4XFixedDecimalFormatter_destroy.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * void ICU4XFixedDecimalFormatter_destroy(ICU4XFixedDecimalFormatter *self) - * } - */ - public static MethodHandle ICU4XFixedDecimalFormatter_destroy$handle() { - return ICU4XFixedDecimalFormatter_destroy.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * void ICU4XFixedDecimalFormatter_destroy(ICU4XFixedDecimalFormatter *self) - * } - */ - public static MemorySegment ICU4XFixedDecimalFormatter_destroy$address() { - return ICU4XFixedDecimalFormatter_destroy.ADDR; - } - - /** - * {@snippet lang=c : - * void ICU4XFixedDecimalFormatter_destroy(ICU4XFixedDecimalFormatter *self) - * } - */ - public static void ICU4XFixedDecimalFormatter_destroy(MemorySegment self) { - var mh$ = ICU4XFixedDecimalFormatter_destroy.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("ICU4XFixedDecimalFormatter_destroy", self); - } - mh$.invokeExact(self); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class ICU4XLocale_new { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_LONG - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("ICU4XLocale_new"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * ICU4XLocale *ICU4XLocale_new(const char *name_data, size_t name_len) - * } - */ - public static FunctionDescriptor ICU4XLocale_new$descriptor() { - return ICU4XLocale_new.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * ICU4XLocale *ICU4XLocale_new(const char *name_data, size_t name_len) - * } - */ - public static MethodHandle ICU4XLocale_new$handle() { - return ICU4XLocale_new.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * ICU4XLocale *ICU4XLocale_new(const char *name_data, size_t name_len) - * } - */ - public static MemorySegment ICU4XLocale_new$address() { - return ICU4XLocale_new.ADDR; - } - - /** - * {@snippet lang=c : - * ICU4XLocale *ICU4XLocale_new(const char *name_data, size_t name_len) - * } - */ - public static MemorySegment ICU4XLocale_new(MemorySegment name_data, long name_len) { - var mh$ = ICU4XLocale_new.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("ICU4XLocale_new", name_data, name_len); - } - return (MemorySegment)mh$.invokeExact(name_data, name_len); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class ICU4XLocale_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("ICU4XLocale_destroy"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * void ICU4XLocale_destroy(ICU4XLocale *self) - * } - */ - public static FunctionDescriptor ICU4XLocale_destroy$descriptor() { - return ICU4XLocale_destroy.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * void ICU4XLocale_destroy(ICU4XLocale *self) - * } - */ - public static MethodHandle ICU4XLocale_destroy$handle() { - return ICU4XLocale_destroy.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * void ICU4XLocale_destroy(ICU4XLocale *self) - * } - */ - public static MemorySegment ICU4XLocale_destroy$address() { - return ICU4XLocale_destroy.ADDR; - } - - /** - * {@snippet lang=c : - * void ICU4XLocale_destroy(ICU4XLocale *self) - * } - */ - public static void ICU4XLocale_destroy(MemorySegment self) { - var mh$ = ICU4XLocale_destroy.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("ICU4XLocale_destroy", self); - } - mh$.invokeExact(self); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - /** - * Variadic invoker class for: - * {@snippet lang=c : - * ICU4XDataProvider *ICU4XDataProvider_new_static() - * } - */ - public static class ICU4XDataProvider_new_static { - private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - somelib_h.C_POINTER ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("ICU4XDataProvider_new_static"); - - private final MethodHandle handle; - private final FunctionDescriptor descriptor; - private final MethodHandle spreader; - - private ICU4XDataProvider_new_static(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { - this.handle = handle; - this.descriptor = descriptor; - this.spreader = spreader; - } - - /** - * Variadic invoker factory for: - * {@snippet lang=c : - * ICU4XDataProvider *ICU4XDataProvider_new_static() - * } - */ - public static ICU4XDataProvider_new_static makeInvoker(MemoryLayout... layouts) { - FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); - Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); - var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); - var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new ICU4XDataProvider_new_static(mh$, desc$, spreader$); - } - - /** - * {@return the address} - */ - public static MemorySegment address() { - return ADDR; - } - - /** - * {@return the specialized method handle} - */ - public MethodHandle handle() { - return handle; - } - - /** - * {@return the specialized descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } - - public MemorySegment apply(Object... x0) { - try { - if (TRACE_DOWNCALLS) { - traceDowncall("ICU4XDataProvider_new_static", x0); - } - return (MemorySegment)spreader.invokeExact(x0); - } catch(IllegalArgumentException | ClassCastException ex$) { - throw ex$; // rethrow IAE from passing wrong number/type of args - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - } - - /** - * Variadic invoker class for: - * {@snippet lang=c : - * struct ICU4XDataProvider_returns_result_result ICU4XDataProvider_returns_result() - * } - */ - public static class ICU4XDataProvider_returns_result { - private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - ICU4XDataProvider_returns_result_result.layout() ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("ICU4XDataProvider_returns_result"); - - private final MethodHandle handle; - private final FunctionDescriptor descriptor; - private final MethodHandle spreader; - - private ICU4XDataProvider_returns_result(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { - this.handle = handle; - this.descriptor = descriptor; - this.spreader = spreader; - } - - /** - * Variadic invoker factory for: - * {@snippet lang=c : - * struct ICU4XDataProvider_returns_result_result ICU4XDataProvider_returns_result() - * } - */ - public static ICU4XDataProvider_returns_result makeInvoker(MemoryLayout... layouts) { - FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); - Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); - var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); - var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new ICU4XDataProvider_returns_result(mh$, desc$, spreader$); - } - - /** - * {@return the address} - */ - public static MemorySegment address() { - return ADDR; - } - - /** - * {@return the specialized method handle} - */ - public MethodHandle handle() { - return handle; - } - - /** - * {@return the specialized descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } - - public MemorySegment apply(SegmentAllocator allocator, Object... x0) { - try { - if (TRACE_DOWNCALLS) { - traceDowncall("ICU4XDataProvider_returns_result", allocator, x0); - } - return (MemorySegment)spreader.invokeExact(allocator, x0); - } catch(IllegalArgumentException | ClassCastException ex$) { - throw ex$; // rethrow IAE from passing wrong number/type of args - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - } - - private static class ICU4XDataProvider_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("ICU4XDataProvider_destroy"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * void ICU4XDataProvider_destroy(ICU4XDataProvider *self) - * } - */ - public static FunctionDescriptor ICU4XDataProvider_destroy$descriptor() { - return ICU4XDataProvider_destroy.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * void ICU4XDataProvider_destroy(ICU4XDataProvider *self) - * } - */ - public static MethodHandle ICU4XDataProvider_destroy$handle() { - return ICU4XDataProvider_destroy.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * void ICU4XDataProvider_destroy(ICU4XDataProvider *self) - * } - */ - public static MemorySegment ICU4XDataProvider_destroy$address() { - return ICU4XDataProvider_destroy.ADDR; - } - - /** - * {@snippet lang=c : - * void ICU4XDataProvider_destroy(ICU4XDataProvider *self) - * } - */ - public static void ICU4XDataProvider_destroy(MemorySegment self) { - var mh$ = ICU4XDataProvider_destroy.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("ICU4XDataProvider_destroy", self); - } - mh$.invokeExact(self); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class ICU4XFixedDecimal_new { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_INT - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("ICU4XFixedDecimal_new"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * ICU4XFixedDecimal *ICU4XFixedDecimal_new(int32_t v) - * } - */ - public static FunctionDescriptor ICU4XFixedDecimal_new$descriptor() { - return ICU4XFixedDecimal_new.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * ICU4XFixedDecimal *ICU4XFixedDecimal_new(int32_t v) - * } - */ - public static MethodHandle ICU4XFixedDecimal_new$handle() { - return ICU4XFixedDecimal_new.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * ICU4XFixedDecimal *ICU4XFixedDecimal_new(int32_t v) - * } - */ - public static MemorySegment ICU4XFixedDecimal_new$address() { - return ICU4XFixedDecimal_new.ADDR; - } - - /** - * {@snippet lang=c : - * ICU4XFixedDecimal *ICU4XFixedDecimal_new(int32_t v) - * } - */ - public static MemorySegment ICU4XFixedDecimal_new(int v) { - var mh$ = ICU4XFixedDecimal_new.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("ICU4XFixedDecimal_new", v); - } - return (MemorySegment)mh$.invokeExact(v); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class ICU4XFixedDecimal_multiply_pow10 { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER, - somelib_h.C_SHORT - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("ICU4XFixedDecimal_multiply_pow10"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * void ICU4XFixedDecimal_multiply_pow10(ICU4XFixedDecimal *self, int16_t power) - * } - */ - public static FunctionDescriptor ICU4XFixedDecimal_multiply_pow10$descriptor() { - return ICU4XFixedDecimal_multiply_pow10.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * void ICU4XFixedDecimal_multiply_pow10(ICU4XFixedDecimal *self, int16_t power) - * } - */ - public static MethodHandle ICU4XFixedDecimal_multiply_pow10$handle() { - return ICU4XFixedDecimal_multiply_pow10.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * void ICU4XFixedDecimal_multiply_pow10(ICU4XFixedDecimal *self, int16_t power) - * } - */ - public static MemorySegment ICU4XFixedDecimal_multiply_pow10$address() { - return ICU4XFixedDecimal_multiply_pow10.ADDR; - } - - /** - * {@snippet lang=c : - * void ICU4XFixedDecimal_multiply_pow10(ICU4XFixedDecimal *self, int16_t power) - * } - */ - public static void ICU4XFixedDecimal_multiply_pow10(MemorySegment self, short power) { - var mh$ = ICU4XFixedDecimal_multiply_pow10.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("ICU4XFixedDecimal_multiply_pow10", self, power); - } - mh$.invokeExact(self, power); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class ICU4XFixedDecimal_to_string { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - ICU4XFixedDecimal_to_string_result.layout(), - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("ICU4XFixedDecimal_to_string"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * struct ICU4XFixedDecimal_to_string_result ICU4XFixedDecimal_to_string(const ICU4XFixedDecimal *self, DiplomatWrite *write) - * } - */ - public static FunctionDescriptor ICU4XFixedDecimal_to_string$descriptor() { - return ICU4XFixedDecimal_to_string.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * struct ICU4XFixedDecimal_to_string_result ICU4XFixedDecimal_to_string(const ICU4XFixedDecimal *self, DiplomatWrite *write) - * } - */ - public static MethodHandle ICU4XFixedDecimal_to_string$handle() { - return ICU4XFixedDecimal_to_string.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * struct ICU4XFixedDecimal_to_string_result ICU4XFixedDecimal_to_string(const ICU4XFixedDecimal *self, DiplomatWrite *write) - * } - */ - public static MemorySegment ICU4XFixedDecimal_to_string$address() { - return ICU4XFixedDecimal_to_string.ADDR; - } - - /** - * {@snippet lang=c : - * struct ICU4XFixedDecimal_to_string_result ICU4XFixedDecimal_to_string(const ICU4XFixedDecimal *self, DiplomatWrite *write) - * } - */ - public static MemorySegment ICU4XFixedDecimal_to_string(SegmentAllocator allocator, MemorySegment self, MemorySegment write) { - var mh$ = ICU4XFixedDecimal_to_string.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("ICU4XFixedDecimal_to_string", allocator, self, write); - } - return (MemorySegment)mh$.invokeExact(allocator, self, write); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class ICU4XFixedDecimal_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("ICU4XFixedDecimal_destroy"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * void ICU4XFixedDecimal_destroy(ICU4XFixedDecimal *self) - * } - */ - public static FunctionDescriptor ICU4XFixedDecimal_destroy$descriptor() { - return ICU4XFixedDecimal_destroy.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * void ICU4XFixedDecimal_destroy(ICU4XFixedDecimal *self) - * } - */ - public static MethodHandle ICU4XFixedDecimal_destroy$handle() { - return ICU4XFixedDecimal_destroy.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * void ICU4XFixedDecimal_destroy(ICU4XFixedDecimal *self) - * } - */ - public static MemorySegment ICU4XFixedDecimal_destroy$address() { - return ICU4XFixedDecimal_destroy.ADDR; - } - - /** - * {@snippet lang=c : - * void ICU4XFixedDecimal_destroy(ICU4XFixedDecimal *self) - * } - */ - public static void ICU4XFixedDecimal_destroy(MemorySegment self) { - var mh$ = ICU4XFixedDecimal_destroy.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("ICU4XFixedDecimal_destroy", self); - } - mh$.invokeExact(self); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - /** - * {@snippet lang=c : - * #define __DARWIN_SUF_EXTSN "$DARWIN_EXTSN" - * } - */ - public static MemorySegment __DARWIN_SUF_EXTSN() { - class Holder { - static final MemorySegment __DARWIN_SUF_EXTSN - = somelib_h.LIBRARY_ARENA.allocateFrom("$DARWIN_EXTSN"); - } - return Holder.__DARWIN_SUF_EXTSN; - } - private static final long __DARWIN_C_ANSI = 4096L; - /** - * {@snippet lang=c : - * #define __DARWIN_C_ANSI 4096 - * } - */ - public static long __DARWIN_C_ANSI() { - return __DARWIN_C_ANSI; - } - private static final long __DARWIN_C_FULL = 900000L; - /** - * {@snippet lang=c : - * #define __DARWIN_C_FULL 900000 - * } - */ - public static long __DARWIN_C_FULL() { - return __DARWIN_C_FULL; - } - private static final long __DARWIN_C_LEVEL = 900000L; - /** - * {@snippet lang=c : - * #define __DARWIN_C_LEVEL 900000 - * } - */ - public static long __DARWIN_C_LEVEL() { - return __DARWIN_C_LEVEL; - } - private static final int MAC_OS_X_VERSION_10_0 = (int)1000L; - /** - * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_0 1000 - * } - */ - public static int MAC_OS_X_VERSION_10_0() { - return MAC_OS_X_VERSION_10_0; - } - private static final int MAC_OS_X_VERSION_10_1 = (int)1010L; - /** - * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_1 1010 - * } - */ - public static int MAC_OS_X_VERSION_10_1() { - return MAC_OS_X_VERSION_10_1; - } - private static final int MAC_OS_X_VERSION_10_2 = (int)1020L; - /** - * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_2 1020 - * } - */ - public static int MAC_OS_X_VERSION_10_2() { - return MAC_OS_X_VERSION_10_2; - } - private static final int MAC_OS_X_VERSION_10_3 = (int)1030L; - /** - * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_3 1030 - * } - */ - public static int MAC_OS_X_VERSION_10_3() { - return MAC_OS_X_VERSION_10_3; - } - private static final int MAC_OS_X_VERSION_10_4 = (int)1040L; - /** - * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_4 1040 - * } - */ - public static int MAC_OS_X_VERSION_10_4() { - return MAC_OS_X_VERSION_10_4; - } - private static final int MAC_OS_X_VERSION_10_5 = (int)1050L; - /** - * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_5 1050 - * } - */ - public static int MAC_OS_X_VERSION_10_5() { - return MAC_OS_X_VERSION_10_5; - } - private static final int MAC_OS_X_VERSION_10_6 = (int)1060L; - /** - * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_6 1060 - * } - */ - public static int MAC_OS_X_VERSION_10_6() { - return MAC_OS_X_VERSION_10_6; - } - private static final int MAC_OS_X_VERSION_10_7 = (int)1070L; - /** - * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_7 1070 - * } - */ - public static int MAC_OS_X_VERSION_10_7() { - return MAC_OS_X_VERSION_10_7; - } - private static final int MAC_OS_X_VERSION_10_8 = (int)1080L; - /** - * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_8 1080 - * } - */ - public static int MAC_OS_X_VERSION_10_8() { - return MAC_OS_X_VERSION_10_8; - } - private static final int MAC_OS_X_VERSION_10_9 = (int)1090L; - /** - * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_9 1090 - * } - */ - public static int MAC_OS_X_VERSION_10_9() { - return MAC_OS_X_VERSION_10_9; - } - private static final int MAC_OS_X_VERSION_10_10 = (int)101000L; - /** - * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_10 101000 - * } - */ - public static int MAC_OS_X_VERSION_10_10() { - return MAC_OS_X_VERSION_10_10; - } - private static final int MAC_OS_X_VERSION_10_10_2 = (int)101002L; - /** - * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_10_2 101002 - * } - */ - public static int MAC_OS_X_VERSION_10_10_2() { - return MAC_OS_X_VERSION_10_10_2; - } - private static final int MAC_OS_X_VERSION_10_10_3 = (int)101003L; - /** - * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_10_3 101003 - * } - */ - public static int MAC_OS_X_VERSION_10_10_3() { - return MAC_OS_X_VERSION_10_10_3; - } - private static final int MAC_OS_X_VERSION_10_11 = (int)101100L; - /** - * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_11 101100 - * } - */ - public static int MAC_OS_X_VERSION_10_11() { - return MAC_OS_X_VERSION_10_11; - } - private static final int MAC_OS_X_VERSION_10_11_2 = (int)101102L; - /** - * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_11_2 101102 - * } - */ - public static int MAC_OS_X_VERSION_10_11_2() { - return MAC_OS_X_VERSION_10_11_2; - } - private static final int MAC_OS_X_VERSION_10_11_3 = (int)101103L; - /** - * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_11_3 101103 - * } - */ - public static int MAC_OS_X_VERSION_10_11_3() { - return MAC_OS_X_VERSION_10_11_3; - } - private static final int MAC_OS_X_VERSION_10_11_4 = (int)101104L; - /** - * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_11_4 101104 - * } - */ - public static int MAC_OS_X_VERSION_10_11_4() { - return MAC_OS_X_VERSION_10_11_4; - } - private static final int MAC_OS_X_VERSION_10_12 = (int)101200L; - /** - * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_12 101200 - * } - */ - public static int MAC_OS_X_VERSION_10_12() { - return MAC_OS_X_VERSION_10_12; - } - private static final int MAC_OS_X_VERSION_10_12_1 = (int)101201L; - /** - * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_12_1 101201 - * } - */ - public static int MAC_OS_X_VERSION_10_12_1() { - return MAC_OS_X_VERSION_10_12_1; - } - private static final int MAC_OS_X_VERSION_10_12_2 = (int)101202L; - /** - * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_12_2 101202 - * } - */ - public static int MAC_OS_X_VERSION_10_12_2() { - return MAC_OS_X_VERSION_10_12_2; - } - private static final int MAC_OS_X_VERSION_10_12_4 = (int)101204L; - /** - * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_12_4 101204 - * } - */ - public static int MAC_OS_X_VERSION_10_12_4() { - return MAC_OS_X_VERSION_10_12_4; - } - private static final int MAC_OS_X_VERSION_10_13 = (int)101300L; - /** - * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_13 101300 - * } - */ - public static int MAC_OS_X_VERSION_10_13() { - return MAC_OS_X_VERSION_10_13; - } - private static final int MAC_OS_X_VERSION_10_13_1 = (int)101301L; - /** - * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_13_1 101301 - * } - */ - public static int MAC_OS_X_VERSION_10_13_1() { - return MAC_OS_X_VERSION_10_13_1; - } - private static final int MAC_OS_X_VERSION_10_13_2 = (int)101302L; - /** - * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_13_2 101302 - * } - */ - public static int MAC_OS_X_VERSION_10_13_2() { - return MAC_OS_X_VERSION_10_13_2; - } - private static final int MAC_OS_X_VERSION_10_13_4 = (int)101304L; - /** - * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_13_4 101304 - * } - */ - public static int MAC_OS_X_VERSION_10_13_4() { - return MAC_OS_X_VERSION_10_13_4; - } - private static final int MAC_OS_X_VERSION_10_14 = (int)101400L; - /** - * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_14 101400 - * } - */ - public static int MAC_OS_X_VERSION_10_14() { - return MAC_OS_X_VERSION_10_14; - } - private static final int MAC_OS_X_VERSION_10_14_1 = (int)101401L; - /** - * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_14_1 101401 - * } - */ - public static int MAC_OS_X_VERSION_10_14_1() { - return MAC_OS_X_VERSION_10_14_1; - } - private static final int MAC_OS_X_VERSION_10_14_4 = (int)101404L; - /** - * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_14_4 101404 - * } - */ - public static int MAC_OS_X_VERSION_10_14_4() { - return MAC_OS_X_VERSION_10_14_4; - } - private static final int MAC_OS_X_VERSION_10_14_5 = (int)101405L; - /** - * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_14_5 101405 - * } - */ - public static int MAC_OS_X_VERSION_10_14_5() { - return MAC_OS_X_VERSION_10_14_5; - } - private static final int MAC_OS_X_VERSION_10_14_6 = (int)101406L; - /** - * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_14_6 101406 - * } - */ - public static int MAC_OS_X_VERSION_10_14_6() { - return MAC_OS_X_VERSION_10_14_6; - } - private static final int MAC_OS_X_VERSION_10_15 = (int)101500L; - /** - * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_15 101500 - * } - */ - public static int MAC_OS_X_VERSION_10_15() { - return MAC_OS_X_VERSION_10_15; - } - private static final int MAC_OS_X_VERSION_10_15_1 = (int)101501L; - /** - * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_15_1 101501 - * } - */ - public static int MAC_OS_X_VERSION_10_15_1() { - return MAC_OS_X_VERSION_10_15_1; - } - private static final int MAC_OS_X_VERSION_10_15_4 = (int)101504L; - /** - * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_15_4 101504 - * } - */ - public static int MAC_OS_X_VERSION_10_15_4() { - return MAC_OS_X_VERSION_10_15_4; - } - private static final int MAC_OS_X_VERSION_10_16 = (int)101600L; - /** - * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_16 101600 - * } - */ - public static int MAC_OS_X_VERSION_10_16() { - return MAC_OS_X_VERSION_10_16; - } - private static final int MAC_OS_VERSION_11_0 = (int)110000L; - /** - * {@snippet lang=c : - * #define MAC_OS_VERSION_11_0 110000 - * } - */ - public static int MAC_OS_VERSION_11_0() { - return MAC_OS_VERSION_11_0; - } - private static final int MAC_OS_VERSION_11_1 = (int)110100L; - /** - * {@snippet lang=c : - * #define MAC_OS_VERSION_11_1 110100 - * } - */ - public static int MAC_OS_VERSION_11_1() { - return MAC_OS_VERSION_11_1; - } - private static final int MAC_OS_VERSION_11_3 = (int)110300L; - /** - * {@snippet lang=c : - * #define MAC_OS_VERSION_11_3 110300 - * } - */ - public static int MAC_OS_VERSION_11_3() { - return MAC_OS_VERSION_11_3; - } - private static final int MAC_OS_VERSION_11_4 = (int)110400L; - /** - * {@snippet lang=c : - * #define MAC_OS_VERSION_11_4 110400 - * } - */ - public static int MAC_OS_VERSION_11_4() { - return MAC_OS_VERSION_11_4; - } - private static final int MAC_OS_VERSION_11_5 = (int)110500L; - /** - * {@snippet lang=c : - * #define MAC_OS_VERSION_11_5 110500 - * } - */ - public static int MAC_OS_VERSION_11_5() { - return MAC_OS_VERSION_11_5; - } - private static final int MAC_OS_VERSION_11_6 = (int)110600L; - /** - * {@snippet lang=c : - * #define MAC_OS_VERSION_11_6 110600 - * } - */ - public static int MAC_OS_VERSION_11_6() { - return MAC_OS_VERSION_11_6; - } - private static final int MAC_OS_VERSION_12_0 = (int)120000L; - /** - * {@snippet lang=c : - * #define MAC_OS_VERSION_12_0 120000 - * } - */ - public static int MAC_OS_VERSION_12_0() { - return MAC_OS_VERSION_12_0; - } - private static final int MAC_OS_VERSION_12_1 = (int)120100L; - /** - * {@snippet lang=c : - * #define MAC_OS_VERSION_12_1 120100 - * } - */ - public static int MAC_OS_VERSION_12_1() { - return MAC_OS_VERSION_12_1; - } - private static final int MAC_OS_VERSION_12_2 = (int)120200L; - /** - * {@snippet lang=c : - * #define MAC_OS_VERSION_12_2 120200 - * } - */ - public static int MAC_OS_VERSION_12_2() { - return MAC_OS_VERSION_12_2; - } - private static final int MAC_OS_VERSION_12_3 = (int)120300L; - /** - * {@snippet lang=c : - * #define MAC_OS_VERSION_12_3 120300 - * } - */ - public static int MAC_OS_VERSION_12_3() { - return MAC_OS_VERSION_12_3; - } - private static final int MAC_OS_VERSION_12_4 = (int)120400L; - /** - * {@snippet lang=c : - * #define MAC_OS_VERSION_12_4 120400 - * } - */ - public static int MAC_OS_VERSION_12_4() { - return MAC_OS_VERSION_12_4; - } - private static final int MAC_OS_VERSION_12_5 = (int)120500L; - /** - * {@snippet lang=c : - * #define MAC_OS_VERSION_12_5 120500 - * } - */ - public static int MAC_OS_VERSION_12_5() { - return MAC_OS_VERSION_12_5; - } - private static final int MAC_OS_VERSION_12_6 = (int)120600L; - /** - * {@snippet lang=c : - * #define MAC_OS_VERSION_12_6 120600 - * } - */ - public static int MAC_OS_VERSION_12_6() { - return MAC_OS_VERSION_12_6; - } - private static final int MAC_OS_VERSION_12_7 = (int)120700L; - /** - * {@snippet lang=c : - * #define MAC_OS_VERSION_12_7 120700 - * } - */ - public static int MAC_OS_VERSION_12_7() { - return MAC_OS_VERSION_12_7; - } - private static final int MAC_OS_VERSION_13_0 = (int)130000L; - /** - * {@snippet lang=c : - * #define MAC_OS_VERSION_13_0 130000 - * } - */ - public static int MAC_OS_VERSION_13_0() { - return MAC_OS_VERSION_13_0; - } - private static final int MAC_OS_VERSION_13_1 = (int)130100L; - /** - * {@snippet lang=c : - * #define MAC_OS_VERSION_13_1 130100 - * } - */ - public static int MAC_OS_VERSION_13_1() { - return MAC_OS_VERSION_13_1; - } - private static final int MAC_OS_VERSION_13_2 = (int)130200L; - /** - * {@snippet lang=c : - * #define MAC_OS_VERSION_13_2 130200 - * } - */ - public static int MAC_OS_VERSION_13_2() { - return MAC_OS_VERSION_13_2; - } - private static final int MAC_OS_VERSION_13_3 = (int)130300L; - /** - * {@snippet lang=c : - * #define MAC_OS_VERSION_13_3 130300 - * } - */ - public static int MAC_OS_VERSION_13_3() { - return MAC_OS_VERSION_13_3; - } - private static final int MAC_OS_VERSION_13_4 = (int)130400L; - /** - * {@snippet lang=c : - * #define MAC_OS_VERSION_13_4 130400 - * } - */ - public static int MAC_OS_VERSION_13_4() { - return MAC_OS_VERSION_13_4; - } - private static final int MAC_OS_VERSION_13_5 = (int)130500L; - /** - * {@snippet lang=c : - * #define MAC_OS_VERSION_13_5 130500 - * } - */ - public static int MAC_OS_VERSION_13_5() { - return MAC_OS_VERSION_13_5; - } - private static final int MAC_OS_VERSION_13_6 = (int)130600L; - /** - * {@snippet lang=c : - * #define MAC_OS_VERSION_13_6 130600 - * } - */ - public static int MAC_OS_VERSION_13_6() { - return MAC_OS_VERSION_13_6; - } - private static final int MAC_OS_VERSION_14_0 = (int)140000L; - /** - * {@snippet lang=c : - * #define MAC_OS_VERSION_14_0 140000 - * } - */ - public static int MAC_OS_VERSION_14_0() { - return MAC_OS_VERSION_14_0; - } - private static final int MAC_OS_VERSION_14_1 = (int)140100L; - /** - * {@snippet lang=c : - * #define MAC_OS_VERSION_14_1 140100 - * } - */ - public static int MAC_OS_VERSION_14_1() { - return MAC_OS_VERSION_14_1; - } - private static final int MAC_OS_VERSION_14_2 = (int)140200L; - /** - * {@snippet lang=c : - * #define MAC_OS_VERSION_14_2 140200 - * } - */ - public static int MAC_OS_VERSION_14_2() { - return MAC_OS_VERSION_14_2; - } - private static final int MAC_OS_VERSION_14_3 = (int)140300L; - /** - * {@snippet lang=c : - * #define MAC_OS_VERSION_14_3 140300 - * } - */ - public static int MAC_OS_VERSION_14_3() { - return MAC_OS_VERSION_14_3; - } - private static final int MAC_OS_VERSION_14_4 = (int)140400L; - /** - * {@snippet lang=c : - * #define MAC_OS_VERSION_14_4 140400 - * } - */ - public static int MAC_OS_VERSION_14_4() { - return MAC_OS_VERSION_14_4; - } - private static final int MAC_OS_VERSION_14_5 = (int)140500L; - /** - * {@snippet lang=c : - * #define MAC_OS_VERSION_14_5 140500 - * } - */ - public static int MAC_OS_VERSION_14_5() { - return MAC_OS_VERSION_14_5; - } - private static final int __MAC_OS_X_VERSION_MAX_ALLOWED = (int)140500L; - /** - * {@snippet lang=c : - * #define __MAC_OS_X_VERSION_MAX_ALLOWED 140500 - * } - */ - public static int __MAC_OS_X_VERSION_MAX_ALLOWED() { - return __MAC_OS_X_VERSION_MAX_ALLOWED; - } - private static final MemorySegment __DARWIN_NULL = MemorySegment.ofAddress(0L); - /** - * {@snippet lang=c : - * #define __DARWIN_NULL (void*) 0 - * } - */ - public static MemorySegment __DARWIN_NULL() { - return __DARWIN_NULL; - } - private static final int __DARWIN_WCHAR_MAX = (int)2147483647L; - /** - * {@snippet lang=c : - * #define __DARWIN_WCHAR_MAX 2147483647 - * } - */ - public static int __DARWIN_WCHAR_MAX() { - return __DARWIN_WCHAR_MAX; - } - private static final int __DARWIN_WCHAR_MIN = (int)-2147483648L; - /** - * {@snippet lang=c : - * #define __DARWIN_WCHAR_MIN -2147483648 - * } - */ - public static int __DARWIN_WCHAR_MIN() { - return __DARWIN_WCHAR_MIN; - } - private static final int __DARWIN_WEOF = (int)-1L; - /** - * {@snippet lang=c : - * #define __DARWIN_WEOF -1 - * } - */ - public static int __DARWIN_WEOF() { - return __DARWIN_WEOF; - } - private static final long USER_ADDR_NULL = 0L; - /** - * {@snippet lang=c : - * #define USER_ADDR_NULL 0 - * } - */ - public static long USER_ADDR_NULL() { - return USER_ADDR_NULL; - } - private static final MemorySegment NULL = MemorySegment.ofAddress(0L); - /** - * {@snippet lang=c : - * #define NULL (void*) 0 - * } - */ - public static MemorySegment NULL() { - return NULL; - } - private static final int EOF = (int)-1L; - /** - * {@snippet lang=c : - * #define EOF -1 - * } - */ - public static int EOF() { - return EOF; - } - /** - * {@snippet lang=c : - * #define P_tmpdir "/var/tmp/" - * } - */ - public static MemorySegment P_tmpdir() { - class Holder { - static final MemorySegment P_tmpdir - = somelib_h.LIBRARY_ARENA.allocateFrom("/var/tmp/"); - } - return Holder.P_tmpdir; - } - private static final long INT64_MAX = 9223372036854775807L; - /** - * {@snippet lang=c : - * #define INT64_MAX 9223372036854775807 - * } - */ - public static long INT64_MAX() { - return INT64_MAX; - } - private static final int INT8_MIN = (int)-128L; - /** - * {@snippet lang=c : - * #define INT8_MIN -128 - * } - */ - public static int INT8_MIN() { - return INT8_MIN; - } - private static final int INT16_MIN = (int)-32768L; - /** - * {@snippet lang=c : - * #define INT16_MIN -32768 - * } - */ - public static int INT16_MIN() { - return INT16_MIN; - } - private static final int INT32_MIN = (int)-2147483648L; - /** - * {@snippet lang=c : - * #define INT32_MIN -2147483648 - * } - */ - public static int INT32_MIN() { - return INT32_MIN; - } - private static final long INT64_MIN = -9223372036854775808L; - /** - * {@snippet lang=c : - * #define INT64_MIN -9223372036854775808 - * } - */ - public static long INT64_MIN() { - return INT64_MIN; - } - private static final int UINT32_MAX = (int)4294967295L; - /** - * {@snippet lang=c : - * #define UINT32_MAX 4294967295 - * } - */ - public static int UINT32_MAX() { - return UINT32_MAX; - } - private static final long UINT64_MAX = -1L; - /** - * {@snippet lang=c : - * #define UINT64_MAX -1 - * } - */ - public static long UINT64_MAX() { - return UINT64_MAX; - } - private static final int INT_LEAST8_MIN = (int)-128L; - /** - * {@snippet lang=c : - * #define INT_LEAST8_MIN -128 - * } - */ - public static int INT_LEAST8_MIN() { - return INT_LEAST8_MIN; - } - private static final int INT_LEAST16_MIN = (int)-32768L; - /** - * {@snippet lang=c : - * #define INT_LEAST16_MIN -32768 - * } - */ - public static int INT_LEAST16_MIN() { - return INT_LEAST16_MIN; - } - private static final int INT_LEAST32_MIN = (int)-2147483648L; - /** - * {@snippet lang=c : - * #define INT_LEAST32_MIN -2147483648 - * } - */ - public static int INT_LEAST32_MIN() { - return INT_LEAST32_MIN; - } - private static final long INT_LEAST64_MIN = -9223372036854775808L; - /** - * {@snippet lang=c : - * #define INT_LEAST64_MIN -9223372036854775808 - * } - */ - public static long INT_LEAST64_MIN() { - return INT_LEAST64_MIN; - } - private static final int INT_LEAST8_MAX = (int)127L; - /** - * {@snippet lang=c : - * #define INT_LEAST8_MAX 127 - * } - */ - public static int INT_LEAST8_MAX() { - return INT_LEAST8_MAX; - } - private static final int INT_LEAST16_MAX = (int)32767L; - /** - * {@snippet lang=c : - * #define INT_LEAST16_MAX 32767 - * } - */ - public static int INT_LEAST16_MAX() { - return INT_LEAST16_MAX; - } - private static final int INT_LEAST32_MAX = (int)2147483647L; - /** - * {@snippet lang=c : - * #define INT_LEAST32_MAX 2147483647 - * } - */ - public static int INT_LEAST32_MAX() { - return INT_LEAST32_MAX; - } - private static final long INT_LEAST64_MAX = 9223372036854775807L; - /** - * {@snippet lang=c : - * #define INT_LEAST64_MAX 9223372036854775807 - * } - */ - public static long INT_LEAST64_MAX() { - return INT_LEAST64_MAX; - } - private static final int UINT_LEAST8_MAX = (int)255L; - /** - * {@snippet lang=c : - * #define UINT_LEAST8_MAX 255 - * } - */ - public static int UINT_LEAST8_MAX() { - return UINT_LEAST8_MAX; - } - private static final int UINT_LEAST16_MAX = (int)65535L; - /** - * {@snippet lang=c : - * #define UINT_LEAST16_MAX 65535 - * } - */ - public static int UINT_LEAST16_MAX() { - return UINT_LEAST16_MAX; - } - private static final int UINT_LEAST32_MAX = (int)4294967295L; - /** - * {@snippet lang=c : - * #define UINT_LEAST32_MAX 4294967295 - * } - */ - public static int UINT_LEAST32_MAX() { - return UINT_LEAST32_MAX; - } - private static final long UINT_LEAST64_MAX = -1L; - /** - * {@snippet lang=c : - * #define UINT_LEAST64_MAX -1 - * } - */ - public static long UINT_LEAST64_MAX() { - return UINT_LEAST64_MAX; - } - private static final int INT_FAST8_MIN = (int)-128L; - /** - * {@snippet lang=c : - * #define INT_FAST8_MIN -128 - * } - */ - public static int INT_FAST8_MIN() { - return INT_FAST8_MIN; - } - private static final int INT_FAST16_MIN = (int)-32768L; - /** - * {@snippet lang=c : - * #define INT_FAST16_MIN -32768 - * } - */ - public static int INT_FAST16_MIN() { - return INT_FAST16_MIN; - } - private static final int INT_FAST32_MIN = (int)-2147483648L; - /** - * {@snippet lang=c : - * #define INT_FAST32_MIN -2147483648 - * } - */ - public static int INT_FAST32_MIN() { - return INT_FAST32_MIN; - } - private static final long INT_FAST64_MIN = -9223372036854775808L; - /** - * {@snippet lang=c : - * #define INT_FAST64_MIN -9223372036854775808 - * } - */ - public static long INT_FAST64_MIN() { - return INT_FAST64_MIN; - } - private static final int INT_FAST8_MAX = (int)127L; - /** - * {@snippet lang=c : - * #define INT_FAST8_MAX 127 - * } - */ - public static int INT_FAST8_MAX() { - return INT_FAST8_MAX; - } - private static final int INT_FAST16_MAX = (int)32767L; - /** - * {@snippet lang=c : - * #define INT_FAST16_MAX 32767 - * } - */ - public static int INT_FAST16_MAX() { - return INT_FAST16_MAX; - } - private static final int INT_FAST32_MAX = (int)2147483647L; - /** - * {@snippet lang=c : - * #define INT_FAST32_MAX 2147483647 - * } - */ - public static int INT_FAST32_MAX() { - return INT_FAST32_MAX; - } - private static final long INT_FAST64_MAX = 9223372036854775807L; - /** - * {@snippet lang=c : - * #define INT_FAST64_MAX 9223372036854775807 - * } - */ - public static long INT_FAST64_MAX() { - return INT_FAST64_MAX; - } - private static final int UINT_FAST8_MAX = (int)255L; - /** - * {@snippet lang=c : - * #define UINT_FAST8_MAX 255 - * } - */ - public static int UINT_FAST8_MAX() { - return UINT_FAST8_MAX; - } - private static final int UINT_FAST16_MAX = (int)65535L; - /** - * {@snippet lang=c : - * #define UINT_FAST16_MAX 65535 - * } - */ - public static int UINT_FAST16_MAX() { - return UINT_FAST16_MAX; - } - private static final int UINT_FAST32_MAX = (int)4294967295L; - /** - * {@snippet lang=c : - * #define UINT_FAST32_MAX 4294967295 - * } - */ - public static int UINT_FAST32_MAX() { - return UINT_FAST32_MAX; - } - private static final long UINT_FAST64_MAX = -1L; - /** - * {@snippet lang=c : - * #define UINT_FAST64_MAX -1 - * } - */ - public static long UINT_FAST64_MAX() { - return UINT_FAST64_MAX; - } - private static final long INTPTR_MAX = 9223372036854775807L; - /** - * {@snippet lang=c : - * #define INTPTR_MAX 9223372036854775807 - * } - */ - public static long INTPTR_MAX() { - return INTPTR_MAX; - } - private static final long INTPTR_MIN = -9223372036854775808L; - /** - * {@snippet lang=c : - * #define INTPTR_MIN -9223372036854775808 - * } - */ - public static long INTPTR_MIN() { - return INTPTR_MIN; - } - private static final long UINTPTR_MAX = -1L; - /** - * {@snippet lang=c : - * #define UINTPTR_MAX -1 - * } - */ - public static long UINTPTR_MAX() { - return UINTPTR_MAX; - } - private static final long INTMAX_MAX = 9223372036854775807L; - /** - * {@snippet lang=c : - * #define INTMAX_MAX 9223372036854775807 - * } - */ - public static long INTMAX_MAX() { - return INTMAX_MAX; - } - private static final long UINTMAX_MAX = -1L; - /** - * {@snippet lang=c : - * #define UINTMAX_MAX -1 - * } - */ - public static long UINTMAX_MAX() { - return UINTMAX_MAX; - } - private static final long INTMAX_MIN = -9223372036854775808L; - /** - * {@snippet lang=c : - * #define INTMAX_MIN -9223372036854775808 - * } - */ - public static long INTMAX_MIN() { - return INTMAX_MIN; - } - private static final long PTRDIFF_MIN = -9223372036854775808L; - /** - * {@snippet lang=c : - * #define PTRDIFF_MIN -9223372036854775808 - * } - */ - public static long PTRDIFF_MIN() { - return PTRDIFF_MIN; - } - private static final long PTRDIFF_MAX = 9223372036854775807L; - /** - * {@snippet lang=c : - * #define PTRDIFF_MAX 9223372036854775807 - * } - */ - public static long PTRDIFF_MAX() { - return PTRDIFF_MAX; - } - private static final long SIZE_MAX = -1L; - /** - * {@snippet lang=c : - * #define SIZE_MAX -1 - * } - */ - public static long SIZE_MAX() { - return SIZE_MAX; - } - private static final long RSIZE_MAX = 9223372036854775807L; - /** - * {@snippet lang=c : - * #define RSIZE_MAX 9223372036854775807 - * } - */ - public static long RSIZE_MAX() { - return RSIZE_MAX; - } - private static final int WCHAR_MAX = (int)2147483647L; - /** - * {@snippet lang=c : - * #define WCHAR_MAX 2147483647 - * } - */ - public static int WCHAR_MAX() { - return WCHAR_MAX; - } - private static final int WCHAR_MIN = (int)-2147483648L; - /** - * {@snippet lang=c : - * #define WCHAR_MIN -2147483648 - * } - */ - public static int WCHAR_MIN() { - return WCHAR_MIN; - } - private static final int WINT_MIN = (int)-2147483648L; - /** - * {@snippet lang=c : - * #define WINT_MIN -2147483648 - * } - */ - public static int WINT_MIN() { - return WINT_MIN; - } - private static final int WINT_MAX = (int)2147483647L; - /** - * {@snippet lang=c : - * #define WINT_MAX 2147483647 - * } - */ - public static int WINT_MAX() { - return WINT_MAX; - } - private static final int SIG_ATOMIC_MIN = (int)-2147483648L; - /** - * {@snippet lang=c : - * #define SIG_ATOMIC_MIN -2147483648 - * } - */ - public static int SIG_ATOMIC_MIN() { - return SIG_ATOMIC_MIN; - } - private static final int SIG_ATOMIC_MAX = (int)2147483647L; - /** - * {@snippet lang=c : - * #define SIG_ATOMIC_MAX 2147483647 - * } - */ - public static int SIG_ATOMIC_MAX() { - return SIG_ATOMIC_MAX; - } - private static final int __DARWIN_BYTE_ORDER = (int)1234L; - /** - * {@snippet lang=c : - * #define __DARWIN_BYTE_ORDER 1234 - * } - */ - public static int __DARWIN_BYTE_ORDER() { - return __DARWIN_BYTE_ORDER; - } - private static final int LITTLE_ENDIAN = (int)1234L; - /** - * {@snippet lang=c : - * #define LITTLE_ENDIAN 1234 - * } - */ - public static int LITTLE_ENDIAN() { - return LITTLE_ENDIAN; - } - private static final int BIG_ENDIAN = (int)4321L; - /** - * {@snippet lang=c : - * #define BIG_ENDIAN 4321 - * } - */ - public static int BIG_ENDIAN() { - return BIG_ENDIAN; - } - private static final int PDP_ENDIAN = (int)3412L; - /** - * {@snippet lang=c : - * #define PDP_ENDIAN 3412 - * } - */ - public static int PDP_ENDIAN() { - return PDP_ENDIAN; - } - private static final int BYTE_ORDER = (int)1234L; - /** - * {@snippet lang=c : - * #define BYTE_ORDER 1234 - * } - */ - public static int BYTE_ORDER() { - return BYTE_ORDER; - } - private static final long __DARWIN_NFDBITS = 32L; - /** - * {@snippet lang=c : - * #define __DARWIN_NFDBITS 32 - * } - */ - public static long __DARWIN_NFDBITS() { - return __DARWIN_NFDBITS; - } - private static final int NBBY = (int)8L; - /** - * {@snippet lang=c : - * #define NBBY 8 - * } - */ - public static int NBBY() { - return NBBY; - } - private static final long NFDBITS = 32L; - /** - * {@snippet lang=c : - * #define NFDBITS 32 - * } - */ - public static long NFDBITS() { - return NFDBITS; - } - private static final int FD_SETSIZE = (int)1024L; - /** - * {@snippet lang=c : - * #define FD_SETSIZE 1024 - * } - */ - public static int FD_SETSIZE() { - return FD_SETSIZE; - } -} - diff --git a/tool/src/java/README.md b/tool/src/java/README.md deleted file mode 100644 index 6e0e3530b..000000000 --- a/tool/src/java/README.md +++ /dev/null @@ -1,37 +0,0 @@ -* slices appear to be passed as memory segments and lengths and not as slice structs -* structs and opaque are just memsegs which seem to be basically pointers -* some functions on Opaque types don't get generated call methods, only something to create an "invoker" -which must be called separately - - -## Invoker functions - -Only the following methods generate invokers. These are all of the zero argument functions. - -```rust -pub fn new_failing_foo() -> Result, ErrorEnum>; -pub fn new_failing_bar() -> Result, ErrorEnum>; -pub fn new_failing_unit() -> Result, ()>; -pub fn new_none() -> Option>; -pub fn returns() -> Option; -pub fn new_struct() -> OptionStruct; -pub fn new_struct_nones() -> OptionStruct; -pub fn new() -> MyStruct; -pub fn returns_zst_result() -> Result<(), MyZst>; -pub fn get_a() -> MyEnum; -pub fn new() -> Box; -pub fn returns_usize() -> usize; -pub fn returns_imported() -> ImportedStruct; -pub fn cmp() -> core::cmp::Ordering; -pub fn new() -> Box; -``` -for comparison the method -```rust -pub fn method(&self) -> u8; -``` -generates a method -```java -public static byte namespace_AttrOpaque1_method(MemorySegment self) { -``` - - From d6e61f9edf676c7dc2b5b11fc3a73ab38537fb58 Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Sun, 1 Sep 2024 15:46:15 +0200 Subject: [PATCH 53/69] panama-backend - add general gen-java step --- .github/workflows/ci.yml | 2 +- Makefile.toml | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1cac9d449..09866da4e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -234,4 +234,4 @@ jobs: - name: Add jextract to path run: echo "/opt/jextract-22/bin" >> $GITHUB_PATH - name: Run generated java - run: cargo make gen-java-feature + run: cargo make gen-java diff --git a/Makefile.toml b/Makefile.toml index 7061d50f8..0fe725183 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -378,6 +378,7 @@ dependencies = [ "gen-dart-feature", "gen-dart-example", ] + [tasks.gen-kotlin] category = "Code generation" dependencies = [ @@ -385,6 +386,12 @@ dependencies = [ "gen-kotlin-example", ] +[tasks.gen-java] +category = "Code generation" +dependencies = [ + "gen-java-feature", +] + From d8e75096847e5b33dbd236d36ccba1a60f2d7639 Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Sun, 1 Sep 2024 15:52:02 +0200 Subject: [PATCH 54/69] panama-backend - remove result types --- .../java/dev/diplomattest/somelib/Lib.java | 30 - .../diplomattest/somelib/ntv/somelib_h.java | 2962 ++++++++--------- tool/templates/java/Lib.java.jinja | 30 - 3 files changed, 1481 insertions(+), 1541 deletions(-) diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Lib.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Lib.java index e7ec440cf..956faa7dd 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Lib.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Lib.java @@ -11,36 +11,6 @@ import static java.lang.foreign.ValueLayout.*; public class Lib { - - public sealed interface Result { - boolean isOk = false; - } - public final class Ok implements Result { - boolean isOk = true; - T value; - public Ok(T value) { - value = value; - } - } - public final class Err implements Result { - boolean isOk = false; - E err; - public Err(E err) { - err = err; - } - } - - class ResBuilder { - ResBuilder() {} - Ok Ok(T value) { - return Ok(value); - } - Err Err(E err) { - return Err(err); - } - } - - class Unit {} static final Cleaner cleaner = Cleaner.create(); } diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java index 669f117d6..2f0ccdcaa 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java @@ -9954,18 +9954,15 @@ public static void RefList_destroy(MemorySegment self) { } } - private static class NestedBorrowedFields_from_bar_and_foo_and_strings { + private static class BorrowedFields_from_bar_and_strings { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - NestedBorrowedFields.layout(), - somelib_h.C_POINTER, + BorrowedFields.layout(), somelib_h.C_POINTER, DiplomatString16View.layout(), - DiplomatString16View.layout(), - DiplomatStringView.layout(), DiplomatStringView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("NestedBorrowedFields_from_bar_and_foo_and_strings"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("BorrowedFields_from_bar_and_strings"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -9973,117 +9970,109 @@ private static class NestedBorrowedFields_from_bar_and_foo_and_strings { /** * Function descriptor for: * {@snippet lang=c : - * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, DiplomatString16View dstr16_x, DiplomatString16View dstr16_z, DiplomatStringView utf8_str_y, DiplomatStringView utf8_str_z) + * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, DiplomatString16View dstr16, DiplomatStringView utf8_str) * } */ - public static FunctionDescriptor NestedBorrowedFields_from_bar_and_foo_and_strings$descriptor() { - return NestedBorrowedFields_from_bar_and_foo_and_strings.DESC; + public static FunctionDescriptor BorrowedFields_from_bar_and_strings$descriptor() { + return BorrowedFields_from_bar_and_strings.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, DiplomatString16View dstr16_x, DiplomatString16View dstr16_z, DiplomatStringView utf8_str_y, DiplomatStringView utf8_str_z) + * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, DiplomatString16View dstr16, DiplomatStringView utf8_str) * } */ - public static MethodHandle NestedBorrowedFields_from_bar_and_foo_and_strings$handle() { - return NestedBorrowedFields_from_bar_and_foo_and_strings.HANDLE; + public static MethodHandle BorrowedFields_from_bar_and_strings$handle() { + return BorrowedFields_from_bar_and_strings.HANDLE; } /** * Address for: * {@snippet lang=c : - * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, DiplomatString16View dstr16_x, DiplomatString16View dstr16_z, DiplomatStringView utf8_str_y, DiplomatStringView utf8_str_z) + * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, DiplomatString16View dstr16, DiplomatStringView utf8_str) * } */ - public static MemorySegment NestedBorrowedFields_from_bar_and_foo_and_strings$address() { - return NestedBorrowedFields_from_bar_and_foo_and_strings.ADDR; + public static MemorySegment BorrowedFields_from_bar_and_strings$address() { + return BorrowedFields_from_bar_and_strings.ADDR; } /** * {@snippet lang=c : - * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, DiplomatString16View dstr16_x, DiplomatString16View dstr16_z, DiplomatStringView utf8_str_y, DiplomatStringView utf8_str_z) + * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, DiplomatString16View dstr16, DiplomatStringView utf8_str) * } */ - public static MemorySegment NestedBorrowedFields_from_bar_and_foo_and_strings(SegmentAllocator allocator, MemorySegment bar, MemorySegment foo, MemorySegment dstr16_x, MemorySegment dstr16_z, MemorySegment utf8_str_y, MemorySegment utf8_str_z) { - var mh$ = NestedBorrowedFields_from_bar_and_foo_and_strings.HANDLE; + public static MemorySegment BorrowedFields_from_bar_and_strings(SegmentAllocator allocator, MemorySegment bar, MemorySegment dstr16, MemorySegment utf8_str) { + var mh$ = BorrowedFields_from_bar_and_strings.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("NestedBorrowedFields_from_bar_and_foo_and_strings", allocator, bar, foo, dstr16_x, dstr16_z, utf8_str_y, utf8_str_z); + traceDowncall("BorrowedFields_from_bar_and_strings", allocator, bar, dstr16, utf8_str); } - return (MemorySegment)mh$.invokeExact(allocator, bar, foo, dstr16_x, dstr16_z, utf8_str_y, utf8_str_z); + return (MemorySegment)mh$.invokeExact(allocator, bar, dstr16, utf8_str); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - - private static class One_transitivity { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_transitivity"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + private static final int MyEnum_A = (int)-2L; + /** + * {@snippet lang=c : + * enum MyEnum.MyEnum_A = -2 + * } + */ + public static int MyEnum_A() { + return MyEnum_A; } - + private static final int MyEnum_B = (int)-1L; /** - * Function descriptor for: * {@snippet lang=c : - * One *One_transitivity(const One *hold, const One *nohold) + * enum MyEnum.MyEnum_B = -1 * } */ - public static FunctionDescriptor One_transitivity$descriptor() { - return One_transitivity.DESC; + public static int MyEnum_B() { + return MyEnum_B; } - + private static final int MyEnum_C = (int)0L; /** - * Downcall method handle for: * {@snippet lang=c : - * One *One_transitivity(const One *hold, const One *nohold) + * enum MyEnum.MyEnum_C = 0 * } */ - public static MethodHandle One_transitivity$handle() { - return One_transitivity.HANDLE; + public static int MyEnum_C() { + return MyEnum_C; } - + private static final int MyEnum_D = (int)1L; /** - * Address for: * {@snippet lang=c : - * One *One_transitivity(const One *hold, const One *nohold) + * enum MyEnum.MyEnum_D = 1 * } */ - public static MemorySegment One_transitivity$address() { - return One_transitivity.ADDR; + public static int MyEnum_D() { + return MyEnum_D; } - + private static final int MyEnum_E = (int)2L; /** * {@snippet lang=c : - * One *One_transitivity(const One *hold, const One *nohold) + * enum MyEnum.MyEnum_E = 2 * } */ - public static MemorySegment One_transitivity(MemorySegment hold, MemorySegment nohold) { - var mh$ = One_transitivity.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("One_transitivity", hold, nohold); - } - return (MemorySegment)mh$.invokeExact(hold, nohold); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } + public static int MyEnum_E() { + return MyEnum_E; + } + private static final int MyEnum_F = (int)3L; + /** + * {@snippet lang=c : + * enum MyEnum.MyEnum_F = 3 + * } + */ + public static int MyEnum_F() { + return MyEnum_F; } - private static class One_cycle { + private static class MyStruct_new { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); + MyStruct.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_cycle"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyStruct_new"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10091,61 +10080,57 @@ private static class One_cycle { /** * Function descriptor for: * {@snippet lang=c : - * One *One_cycle(const Two *hold, const One *nohold) + * MyStruct MyStruct_new() * } */ - public static FunctionDescriptor One_cycle$descriptor() { - return One_cycle.DESC; + public static FunctionDescriptor MyStruct_new$descriptor() { + return MyStruct_new.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_cycle(const Two *hold, const One *nohold) + * MyStruct MyStruct_new() * } */ - public static MethodHandle One_cycle$handle() { - return One_cycle.HANDLE; + public static MethodHandle MyStruct_new$handle() { + return MyStruct_new.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_cycle(const Two *hold, const One *nohold) + * MyStruct MyStruct_new() * } */ - public static MemorySegment One_cycle$address() { - return One_cycle.ADDR; + public static MemorySegment MyStruct_new$address() { + return MyStruct_new.ADDR; } /** * {@snippet lang=c : - * One *One_cycle(const Two *hold, const One *nohold) + * MyStruct MyStruct_new() * } */ - public static MemorySegment One_cycle(MemorySegment hold, MemorySegment nohold) { - var mh$ = One_cycle.HANDLE; + public static MemorySegment MyStruct_new(SegmentAllocator allocator) { + var mh$ = MyStruct_new.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_cycle", hold, nohold); + traceDowncall("MyStruct_new", allocator); } - return (MemorySegment)mh$.invokeExact(hold, nohold); + return (MemorySegment)mh$.invokeExact(allocator); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_many_dependents { + private static class MyStruct_into_a { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER + somelib_h.C_CHAR, + MyStruct.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_many_dependents"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyStruct_into_a"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10153,58 +10138,55 @@ private static class One_many_dependents { /** * Function descriptor for: * {@snippet lang=c : - * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) + * uint8_t MyStruct_into_a(MyStruct self) * } */ - public static FunctionDescriptor One_many_dependents$descriptor() { - return One_many_dependents.DESC; + public static FunctionDescriptor MyStruct_into_a$descriptor() { + return MyStruct_into_a.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) + * uint8_t MyStruct_into_a(MyStruct self) * } */ - public static MethodHandle One_many_dependents$handle() { - return One_many_dependents.HANDLE; + public static MethodHandle MyStruct_into_a$handle() { + return MyStruct_into_a.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) + * uint8_t MyStruct_into_a(MyStruct self) * } */ - public static MemorySegment One_many_dependents$address() { - return One_many_dependents.ADDR; + public static MemorySegment MyStruct_into_a$address() { + return MyStruct_into_a.ADDR; } /** * {@snippet lang=c : - * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) + * uint8_t MyStruct_into_a(MyStruct self) * } */ - public static MemorySegment One_many_dependents(MemorySegment a, MemorySegment b, MemorySegment c, MemorySegment d, MemorySegment nohold) { - var mh$ = One_many_dependents.HANDLE; + public static byte MyStruct_into_a(MemorySegment self) { + var mh$ = MyStruct_into_a.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_many_dependents", a, b, c, d, nohold); + traceDowncall("MyStruct_into_a", self); } - return (MemorySegment)mh$.invokeExact(a, b, c, d, nohold); + return (byte)mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_return_outlives_param { + private static class CyclicStructB_get_a { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); + CyclicStructA.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_return_outlives_param"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("CyclicStructB_get_a"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10212,60 +10194,74 @@ private static class One_return_outlives_param { /** * Function descriptor for: * {@snippet lang=c : - * One *One_return_outlives_param(const Two *hold, const One *nohold) + * CyclicStructA CyclicStructB_get_a() * } */ - public static FunctionDescriptor One_return_outlives_param$descriptor() { - return One_return_outlives_param.DESC; + public static FunctionDescriptor CyclicStructB_get_a$descriptor() { + return CyclicStructB_get_a.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_return_outlives_param(const Two *hold, const One *nohold) + * CyclicStructA CyclicStructB_get_a() * } */ - public static MethodHandle One_return_outlives_param$handle() { - return One_return_outlives_param.HANDLE; + public static MethodHandle CyclicStructB_get_a$handle() { + return CyclicStructB_get_a.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_return_outlives_param(const Two *hold, const One *nohold) + * CyclicStructA CyclicStructB_get_a() * } */ - public static MemorySegment One_return_outlives_param$address() { - return One_return_outlives_param.ADDR; + public static MemorySegment CyclicStructB_get_a$address() { + return CyclicStructB_get_a.ADDR; } /** * {@snippet lang=c : - * One *One_return_outlives_param(const Two *hold, const One *nohold) + * CyclicStructA CyclicStructB_get_a() * } */ - public static MemorySegment One_return_outlives_param(MemorySegment hold, MemorySegment nohold) { - var mh$ = One_return_outlives_param.HANDLE; + public static MemorySegment CyclicStructB_get_a(SegmentAllocator allocator) { + var mh$ = CyclicStructB_get_a.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_return_outlives_param", hold, nohold); + traceDowncall("CyclicStructB_get_a", allocator); } - return (MemorySegment)mh$.invokeExact(hold, nohold); + return (MemorySegment)mh$.invokeExact(allocator); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } + private static final int ErrorEnum_Foo = (int)0L; + /** + * {@snippet lang=c : + * enum ErrorEnum.ErrorEnum_Foo = 0 + * } + */ + public static int ErrorEnum_Foo() { + return ErrorEnum_Foo; + } + private static final int ErrorEnum_Bar = (int)1L; + /** + * {@snippet lang=c : + * enum ErrorEnum.ErrorEnum_Bar = 1 + * } + */ + public static int ErrorEnum_Bar() { + return ErrorEnum_Bar; + } - private static class One_diamond_top { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, + private static class RefListParameter_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_top"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("RefListParameter_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10273,60 +10269,82 @@ private static class One_diamond_top { /** * Function descriptor for: * {@snippet lang=c : - * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) + * void RefListParameter_destroy(RefListParameter *self) * } */ - public static FunctionDescriptor One_diamond_top$descriptor() { - return One_diamond_top.DESC; + public static FunctionDescriptor RefListParameter_destroy$descriptor() { + return RefListParameter_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) + * void RefListParameter_destroy(RefListParameter *self) * } */ - public static MethodHandle One_diamond_top$handle() { - return One_diamond_top.HANDLE; + public static MethodHandle RefListParameter_destroy$handle() { + return RefListParameter_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) + * void RefListParameter_destroy(RefListParameter *self) * } */ - public static MemorySegment One_diamond_top$address() { - return One_diamond_top.ADDR; + public static MemorySegment RefListParameter_destroy$address() { + return RefListParameter_destroy.ADDR; } /** * {@snippet lang=c : - * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) + * void RefListParameter_destroy(RefListParameter *self) * } */ - public static MemorySegment One_diamond_top(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { - var mh$ = One_diamond_top.HANDLE; + public static void RefListParameter_destroy(MemorySegment self) { + var mh$ = RefListParameter_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_diamond_top", top, left, right, bottom); + traceDowncall("RefListParameter_destroy", self); } - return (MemorySegment)mh$.invokeExact(top, left, right, bottom); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } + private static final int UnimportedEnum_A = (int)0L; + /** + * {@snippet lang=c : + * enum UnimportedEnum.UnimportedEnum_A = 0 + * } + */ + public static int UnimportedEnum_A() { + return UnimportedEnum_A; + } + private static final int UnimportedEnum_B = (int)1L; + /** + * {@snippet lang=c : + * enum UnimportedEnum.UnimportedEnum_B = 1 + * } + */ + public static int UnimportedEnum_B() { + return UnimportedEnum_B; + } + private static final int UnimportedEnum_C = (int)2L; + /** + * {@snippet lang=c : + * enum UnimportedEnum.UnimportedEnum_C = 2 + * } + */ + public static int UnimportedEnum_C() { + return UnimportedEnum_C; + } - private static class One_diamond_left { + private static class Opaque_new { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_left"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_new"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10334,60 +10352,57 @@ private static class One_diamond_left { /** * Function descriptor for: * {@snippet lang=c : - * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) + * Opaque *Opaque_new() * } */ - public static FunctionDescriptor One_diamond_left$descriptor() { - return One_diamond_left.DESC; + public static FunctionDescriptor Opaque_new$descriptor() { + return Opaque_new.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) + * Opaque *Opaque_new() * } */ - public static MethodHandle One_diamond_left$handle() { - return One_diamond_left.HANDLE; + public static MethodHandle Opaque_new$handle() { + return Opaque_new.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) + * Opaque *Opaque_new() * } */ - public static MemorySegment One_diamond_left$address() { - return One_diamond_left.ADDR; + public static MemorySegment Opaque_new$address() { + return Opaque_new.ADDR; } /** * {@snippet lang=c : - * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) + * Opaque *Opaque_new() * } */ - public static MemorySegment One_diamond_left(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { - var mh$ = One_diamond_left.HANDLE; + public static MemorySegment Opaque_new() { + var mh$ = Opaque_new.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_diamond_left", top, left, right, bottom); + traceDowncall("Opaque_new"); } - return (MemorySegment)mh$.invokeExact(top, left, right, bottom); + return (MemorySegment)mh$.invokeExact(); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_diamond_right { + private static class Opaque_from_str { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER + DiplomatStringView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_right"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_from_str"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10395,60 +10410,57 @@ private static class One_diamond_right { /** * Function descriptor for: * {@snippet lang=c : - * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) + * Opaque *Opaque_from_str(DiplomatStringView input) * } */ - public static FunctionDescriptor One_diamond_right$descriptor() { - return One_diamond_right.DESC; + public static FunctionDescriptor Opaque_from_str$descriptor() { + return Opaque_from_str.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) + * Opaque *Opaque_from_str(DiplomatStringView input) * } */ - public static MethodHandle One_diamond_right$handle() { - return One_diamond_right.HANDLE; + public static MethodHandle Opaque_from_str$handle() { + return Opaque_from_str.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) + * Opaque *Opaque_from_str(DiplomatStringView input) * } */ - public static MemorySegment One_diamond_right$address() { - return One_diamond_right.ADDR; + public static MemorySegment Opaque_from_str$address() { + return Opaque_from_str.ADDR; } /** * {@snippet lang=c : - * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) + * Opaque *Opaque_from_str(DiplomatStringView input) * } */ - public static MemorySegment One_diamond_right(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { - var mh$ = One_diamond_right.HANDLE; + public static MemorySegment Opaque_from_str(MemorySegment input) { + var mh$ = Opaque_from_str.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_diamond_right", top, left, right, bottom); + traceDowncall("Opaque_from_str", input); } - return (MemorySegment)mh$.invokeExact(top, left, right, bottom); + return (MemorySegment)mh$.invokeExact(input); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_diamond_bottom { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, + private static class Opaque_get_debug_str { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_bottom"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_get_debug_str"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10456,61 +10468,57 @@ private static class One_diamond_bottom { /** * Function descriptor for: * {@snippet lang=c : - * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) + * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) * } */ - public static FunctionDescriptor One_diamond_bottom$descriptor() { - return One_diamond_bottom.DESC; + public static FunctionDescriptor Opaque_get_debug_str$descriptor() { + return Opaque_get_debug_str.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) + * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) * } */ - public static MethodHandle One_diamond_bottom$handle() { - return One_diamond_bottom.HANDLE; + public static MethodHandle Opaque_get_debug_str$handle() { + return Opaque_get_debug_str.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) + * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) * } */ - public static MemorySegment One_diamond_bottom$address() { - return One_diamond_bottom.ADDR; + public static MemorySegment Opaque_get_debug_str$address() { + return Opaque_get_debug_str.ADDR; } /** * {@snippet lang=c : - * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) + * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) * } */ - public static MemorySegment One_diamond_bottom(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { - var mh$ = One_diamond_bottom.HANDLE; + public static void Opaque_get_debug_str(MemorySegment self, MemorySegment write) { + var mh$ = Opaque_get_debug_str.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_diamond_bottom", top, left, right, bottom); + traceDowncall("Opaque_get_debug_str", self, write); } - return (MemorySegment)mh$.invokeExact(top, left, right, bottom); + mh$.invokeExact(self, write); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_diamond_and_nested_types { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, + private static class Opaque_assert_struct { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER, - somelib_h.C_POINTER + MyStruct.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_and_nested_types"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_assert_struct"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10518,59 +10526,55 @@ private static class One_diamond_and_nested_types { /** * Function descriptor for: * {@snippet lang=c : - * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) + * void Opaque_assert_struct(const Opaque *self, MyStruct s) * } */ - public static FunctionDescriptor One_diamond_and_nested_types$descriptor() { - return One_diamond_and_nested_types.DESC; + public static FunctionDescriptor Opaque_assert_struct$descriptor() { + return Opaque_assert_struct.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) + * void Opaque_assert_struct(const Opaque *self, MyStruct s) * } */ - public static MethodHandle One_diamond_and_nested_types$handle() { - return One_diamond_and_nested_types.HANDLE; + public static MethodHandle Opaque_assert_struct$handle() { + return Opaque_assert_struct.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) + * void Opaque_assert_struct(const Opaque *self, MyStruct s) * } */ - public static MemorySegment One_diamond_and_nested_types$address() { - return One_diamond_and_nested_types.ADDR; + public static MemorySegment Opaque_assert_struct$address() { + return Opaque_assert_struct.ADDR; } /** * {@snippet lang=c : - * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) + * void Opaque_assert_struct(const Opaque *self, MyStruct s) * } */ - public static MemorySegment One_diamond_and_nested_types(MemorySegment a, MemorySegment b, MemorySegment c, MemorySegment d, MemorySegment nohold) { - var mh$ = One_diamond_and_nested_types.HANDLE; + public static void Opaque_assert_struct(MemorySegment self, MemorySegment s) { + var mh$ = Opaque_assert_struct.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_diamond_and_nested_types", a, b, c, d, nohold); + traceDowncall("Opaque_assert_struct", self, s); } - return (MemorySegment)mh$.invokeExact(a, b, c, d, nohold); + mh$.invokeExact(self, s); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_implicit_bounds { + private static class Opaque_returns_usize { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_implicit_bounds"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_returns_usize"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10578,60 +10582,57 @@ private static class One_implicit_bounds { /** * Function descriptor for: * {@snippet lang=c : - * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) + * size_t Opaque_returns_usize() * } */ - public static FunctionDescriptor One_implicit_bounds$descriptor() { - return One_implicit_bounds.DESC; + public static FunctionDescriptor Opaque_returns_usize$descriptor() { + return Opaque_returns_usize.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) + * size_t Opaque_returns_usize() * } */ - public static MethodHandle One_implicit_bounds$handle() { - return One_implicit_bounds.HANDLE; + public static MethodHandle Opaque_returns_usize$handle() { + return Opaque_returns_usize.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) + * size_t Opaque_returns_usize() * } */ - public static MemorySegment One_implicit_bounds$address() { - return One_implicit_bounds.ADDR; + public static MemorySegment Opaque_returns_usize$address() { + return Opaque_returns_usize.ADDR; } /** * {@snippet lang=c : - * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) + * size_t Opaque_returns_usize() * } */ - public static MemorySegment One_implicit_bounds(MemorySegment explicit_hold, MemorySegment implicit_hold, MemorySegment nohold) { - var mh$ = One_implicit_bounds.HANDLE; + public static long Opaque_returns_usize() { + var mh$ = Opaque_returns_usize.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_implicit_bounds", explicit_hold, implicit_hold, nohold); + traceDowncall("Opaque_returns_usize"); } - return (MemorySegment)mh$.invokeExact(explicit_hold, implicit_hold, nohold); + return (long)mh$.invokeExact(); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_implicit_bounds_deep { + private static class Opaque_internal_len { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, + somelib_h.C_LONG, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_implicit_bounds_deep"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_internal_len"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10639,56 +10640,55 @@ private static class One_implicit_bounds_deep { /** * Function descriptor for: * {@snippet lang=c : - * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) + * size_t Opaque_internal_len(const Opaque *self) * } */ - public static FunctionDescriptor One_implicit_bounds_deep$descriptor() { - return One_implicit_bounds_deep.DESC; + public static FunctionDescriptor Opaque_internal_len$descriptor() { + return Opaque_internal_len.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) + * size_t Opaque_internal_len(const Opaque *self) * } */ - public static MethodHandle One_implicit_bounds_deep$handle() { - return One_implicit_bounds_deep.HANDLE; + public static MethodHandle Opaque_internal_len$handle() { + return Opaque_internal_len.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) + * size_t Opaque_internal_len(const Opaque *self) * } */ - public static MemorySegment One_implicit_bounds_deep$address() { - return One_implicit_bounds_deep.ADDR; + public static MemorySegment Opaque_internal_len$address() { + return Opaque_internal_len.ADDR; } /** * {@snippet lang=c : - * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) + * size_t Opaque_internal_len(const Opaque *self) * } */ - public static MemorySegment One_implicit_bounds_deep(MemorySegment explicit_, MemorySegment implicit_1, MemorySegment implicit_2, MemorySegment nohold) { - var mh$ = One_implicit_bounds_deep.HANDLE; + public static long Opaque_internal_len(MemorySegment self) { + var mh$ = Opaque_internal_len.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_implicit_bounds_deep", explicit_, implicit_1, implicit_2, nohold); + traceDowncall("Opaque_internal_len", self); } - return (MemorySegment)mh$.invokeExact(explicit_, implicit_1, implicit_2, nohold); + return (long)mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER - ); + private static class Opaque_returns_imported { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + ImportedStruct.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_returns_imported"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10696,57 +10696,55 @@ private static class One_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void One_destroy(One *self) + * ImportedStruct Opaque_returns_imported() * } */ - public static FunctionDescriptor One_destroy$descriptor() { - return One_destroy.DESC; + public static FunctionDescriptor Opaque_returns_imported$descriptor() { + return Opaque_returns_imported.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void One_destroy(One *self) + * ImportedStruct Opaque_returns_imported() * } */ - public static MethodHandle One_destroy$handle() { - return One_destroy.HANDLE; + public static MethodHandle Opaque_returns_imported$handle() { + return Opaque_returns_imported.HANDLE; } /** * Address for: * {@snippet lang=c : - * void One_destroy(One *self) + * ImportedStruct Opaque_returns_imported() * } */ - public static MemorySegment One_destroy$address() { - return One_destroy.ADDR; + public static MemorySegment Opaque_returns_imported$address() { + return Opaque_returns_imported.ADDR; } /** * {@snippet lang=c : - * void One_destroy(One *self) + * ImportedStruct Opaque_returns_imported() * } */ - public static void One_destroy(MemorySegment self) { - var mh$ = One_destroy.HANDLE; + public static MemorySegment Opaque_returns_imported(SegmentAllocator allocator) { + var mh$ = Opaque_returns_imported.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_destroy", self); + traceDowncall("Opaque_returns_imported", allocator); } - mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(allocator); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Bar_foo { + private static class Opaque_cmp { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); + somelib_h.C_CHAR ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Bar_foo"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_cmp"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10754,56 +10752,56 @@ private static class Bar_foo { /** * Function descriptor for: * {@snippet lang=c : - * const Foo *Bar_foo(const Bar *self) + * int8_t Opaque_cmp() * } */ - public static FunctionDescriptor Bar_foo$descriptor() { - return Bar_foo.DESC; + public static FunctionDescriptor Opaque_cmp$descriptor() { + return Opaque_cmp.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * const Foo *Bar_foo(const Bar *self) + * int8_t Opaque_cmp() * } */ - public static MethodHandle Bar_foo$handle() { - return Bar_foo.HANDLE; + public static MethodHandle Opaque_cmp$handle() { + return Opaque_cmp.HANDLE; } /** * Address for: * {@snippet lang=c : - * const Foo *Bar_foo(const Bar *self) + * int8_t Opaque_cmp() * } */ - public static MemorySegment Bar_foo$address() { - return Bar_foo.ADDR; + public static MemorySegment Opaque_cmp$address() { + return Opaque_cmp.ADDR; } /** * {@snippet lang=c : - * const Foo *Bar_foo(const Bar *self) + * int8_t Opaque_cmp() * } */ - public static MemorySegment Bar_foo(MemorySegment self) { - var mh$ = Bar_foo.HANDLE; + public static byte Opaque_cmp() { + var mh$ = Opaque_cmp.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Bar_foo", self); + traceDowncall("Opaque_cmp"); } - return (MemorySegment)mh$.invokeExact(self); + return (byte)mh$.invokeExact(); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Bar_destroy { + private static class Opaque_destroy { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Bar_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10811,77 +10809,62 @@ private static class Bar_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void Bar_destroy(Bar *self) + * void Opaque_destroy(Opaque *self) * } */ - public static FunctionDescriptor Bar_destroy$descriptor() { - return Bar_destroy.DESC; + public static FunctionDescriptor Opaque_destroy$descriptor() { + return Opaque_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Bar_destroy(Bar *self) + * void Opaque_destroy(Opaque *self) * } */ - public static MethodHandle Bar_destroy$handle() { - return Bar_destroy.HANDLE; + public static MethodHandle Opaque_destroy$handle() { + return Opaque_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Bar_destroy(Bar *self) + * void Opaque_destroy(Opaque *self) * } */ - public static MemorySegment Bar_destroy$address() { - return Bar_destroy.ADDR; + public static MemorySegment Opaque_destroy$address() { + return Opaque_destroy.ADDR; } /** * {@snippet lang=c : - * void Bar_destroy(Bar *self) - * } - */ - public static void Bar_destroy(MemorySegment self) { - var mh$ = Bar_destroy.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("Bar_destroy", self); - } - mh$.invokeExact(self); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - private static final int ErrorEnum_Foo = (int)0L; - /** - * {@snippet lang=c : - * enum ErrorEnum.ErrorEnum_Foo = 0 - * } - */ - public static int ErrorEnum_Foo() { - return ErrorEnum_Foo; - } - private static final int ErrorEnum_Bar = (int)1L; - /** - * {@snippet lang=c : - * enum ErrorEnum.ErrorEnum_Bar = 1 + * void Opaque_destroy(Opaque *self) * } */ - public static int ErrorEnum_Bar() { - return ErrorEnum_Bar; + public static void Opaque_destroy(MemorySegment self) { + var mh$ = Opaque_destroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Opaque_destroy", self); + } + mh$.invokeExact(self); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } } - private static class BorrowedFieldsWithBounds_from_foo_and_strings { + private static class NestedBorrowedFields_from_bar_and_foo_and_strings { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - BorrowedFieldsWithBounds.layout(), + NestedBorrowedFields.layout(), somelib_h.C_POINTER, + somelib_h.C_POINTER, + DiplomatString16View.layout(), DiplomatString16View.layout(), + DiplomatStringView.layout(), DiplomatStringView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("BorrowedFieldsWithBounds_from_foo_and_strings"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("NestedBorrowedFields_from_bar_and_foo_and_strings"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10889,120 +10872,115 @@ private static class BorrowedFieldsWithBounds_from_foo_and_strings { /** * Function descriptor for: * {@snippet lang=c : - * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, DiplomatString16View dstr16_x, DiplomatStringView utf8_str_z) + * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, DiplomatString16View dstr16_x, DiplomatString16View dstr16_z, DiplomatStringView utf8_str_y, DiplomatStringView utf8_str_z) * } */ - public static FunctionDescriptor BorrowedFieldsWithBounds_from_foo_and_strings$descriptor() { - return BorrowedFieldsWithBounds_from_foo_and_strings.DESC; + public static FunctionDescriptor NestedBorrowedFields_from_bar_and_foo_and_strings$descriptor() { + return NestedBorrowedFields_from_bar_and_foo_and_strings.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, DiplomatString16View dstr16_x, DiplomatStringView utf8_str_z) + * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, DiplomatString16View dstr16_x, DiplomatString16View dstr16_z, DiplomatStringView utf8_str_y, DiplomatStringView utf8_str_z) * } */ - public static MethodHandle BorrowedFieldsWithBounds_from_foo_and_strings$handle() { - return BorrowedFieldsWithBounds_from_foo_and_strings.HANDLE; + public static MethodHandle NestedBorrowedFields_from_bar_and_foo_and_strings$handle() { + return NestedBorrowedFields_from_bar_and_foo_and_strings.HANDLE; } /** * Address for: * {@snippet lang=c : - * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, DiplomatString16View dstr16_x, DiplomatStringView utf8_str_z) + * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, DiplomatString16View dstr16_x, DiplomatString16View dstr16_z, DiplomatStringView utf8_str_y, DiplomatStringView utf8_str_z) * } */ - public static MemorySegment BorrowedFieldsWithBounds_from_foo_and_strings$address() { - return BorrowedFieldsWithBounds_from_foo_and_strings.ADDR; + public static MemorySegment NestedBorrowedFields_from_bar_and_foo_and_strings$address() { + return NestedBorrowedFields_from_bar_and_foo_and_strings.ADDR; } /** * {@snippet lang=c : - * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, DiplomatString16View dstr16_x, DiplomatStringView utf8_str_z) + * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, DiplomatString16View dstr16_x, DiplomatString16View dstr16_z, DiplomatStringView utf8_str_y, DiplomatStringView utf8_str_z) * } */ - public static MemorySegment BorrowedFieldsWithBounds_from_foo_and_strings(SegmentAllocator allocator, MemorySegment foo, MemorySegment dstr16_x, MemorySegment utf8_str_z) { - var mh$ = BorrowedFieldsWithBounds_from_foo_and_strings.HANDLE; + public static MemorySegment NestedBorrowedFields_from_bar_and_foo_and_strings(SegmentAllocator allocator, MemorySegment bar, MemorySegment foo, MemorySegment dstr16_x, MemorySegment dstr16_z, MemorySegment utf8_str_y, MemorySegment utf8_str_z) { + var mh$ = NestedBorrowedFields_from_bar_and_foo_and_strings.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("BorrowedFieldsWithBounds_from_foo_and_strings", allocator, foo, dstr16_x, utf8_str_z); + traceDowncall("NestedBorrowedFields_from_bar_and_foo_and_strings", allocator, bar, foo, dstr16_x, dstr16_z, utf8_str_y, utf8_str_z); } - return (MemorySegment)mh$.invokeExact(allocator, foo, dstr16_x, utf8_str_z); + return (MemorySegment)mh$.invokeExact(allocator, bar, foo, dstr16_x, dstr16_z, utf8_str_y, utf8_str_z); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static final int ContiguousEnum_C = (int)0L; - /** - * {@snippet lang=c : - * enum ContiguousEnum.ContiguousEnum_C = 0 - * } - */ - public static int ContiguousEnum_C() { - return ContiguousEnum_C; - } - private static final int ContiguousEnum_D = (int)1L; - /** - * {@snippet lang=c : - * enum ContiguousEnum.ContiguousEnum_D = 1 - * } - */ - public static int ContiguousEnum_D() { - return ContiguousEnum_D; - } - private static final int ContiguousEnum_E = (int)2L; - /** - * {@snippet lang=c : - * enum ContiguousEnum.ContiguousEnum_E = 2 - * } - */ - public static int ContiguousEnum_E() { - return ContiguousEnum_E; + + private static class MyString_new { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + DiplomatStringView.layout() + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } - private static final int ContiguousEnum_F = (int)3L; + /** + * Function descriptor for: * {@snippet lang=c : - * enum ContiguousEnum.ContiguousEnum_F = 3 + * MyString *MyString_new(DiplomatStringView v) * } */ - public static int ContiguousEnum_F() { - return ContiguousEnum_F; + public static FunctionDescriptor MyString_new$descriptor() { + return MyString_new.DESC; } - private static final int UnimportedEnum_A = (int)0L; + /** + * Downcall method handle for: * {@snippet lang=c : - * enum UnimportedEnum.UnimportedEnum_A = 0 + * MyString *MyString_new(DiplomatStringView v) * } */ - public static int UnimportedEnum_A() { - return UnimportedEnum_A; + public static MethodHandle MyString_new$handle() { + return MyString_new.HANDLE; } - private static final int UnimportedEnum_B = (int)1L; + /** + * Address for: * {@snippet lang=c : - * enum UnimportedEnum.UnimportedEnum_B = 1 + * MyString *MyString_new(DiplomatStringView v) * } */ - public static int UnimportedEnum_B() { - return UnimportedEnum_B; + public static MemorySegment MyString_new$address() { + return MyString_new.ADDR; } - private static final int UnimportedEnum_C = (int)2L; + /** * {@snippet lang=c : - * enum UnimportedEnum.UnimportedEnum_C = 2 + * MyString *MyString_new(DiplomatStringView v) * } */ - public static int UnimportedEnum_C() { - return UnimportedEnum_C; + public static MemorySegment MyString_new(MemorySegment v) { + var mh$ = MyString_new.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("MyString_new", v); + } + return (MemorySegment)mh$.invokeExact(v); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } } - private static class Float64Vec_new_bool { + private static class MyString_new_unsafe { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - DiplomatBoolView.layout() + DiplomatStringView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_bool"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new_unsafe"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11010,43 +10988,43 @@ private static class Float64Vec_new_bool { /** * Function descriptor for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_bool(DiplomatBoolView v) + * MyString *MyString_new_unsafe(DiplomatStringView v) * } */ - public static FunctionDescriptor Float64Vec_new_bool$descriptor() { - return Float64Vec_new_bool.DESC; + public static FunctionDescriptor MyString_new_unsafe$descriptor() { + return MyString_new_unsafe.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_bool(DiplomatBoolView v) + * MyString *MyString_new_unsafe(DiplomatStringView v) * } */ - public static MethodHandle Float64Vec_new_bool$handle() { - return Float64Vec_new_bool.HANDLE; + public static MethodHandle MyString_new_unsafe$handle() { + return MyString_new_unsafe.HANDLE; } /** * Address for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_bool(DiplomatBoolView v) + * MyString *MyString_new_unsafe(DiplomatStringView v) * } */ - public static MemorySegment Float64Vec_new_bool$address() { - return Float64Vec_new_bool.ADDR; + public static MemorySegment MyString_new_unsafe$address() { + return MyString_new_unsafe.ADDR; } /** * {@snippet lang=c : - * Float64Vec *Float64Vec_new_bool(DiplomatBoolView v) + * MyString *MyString_new_unsafe(DiplomatStringView v) * } */ - public static MemorySegment Float64Vec_new_bool(MemorySegment v) { - var mh$ = Float64Vec_new_bool.HANDLE; + public static MemorySegment MyString_new_unsafe(MemorySegment v) { + var mh$ = MyString_new_unsafe.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_new_bool", v); + traceDowncall("MyString_new_unsafe", v); } return (MemorySegment)mh$.invokeExact(v); } catch (Throwable ex$) { @@ -11054,13 +11032,13 @@ public static MemorySegment Float64Vec_new_bool(MemorySegment v) { } } - private static class Float64Vec_new_i16 { + private static class MyString_new_owned { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - DiplomatI16View.layout() + DiplomatStringView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_i16"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new_owned"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11068,43 +11046,43 @@ private static class Float64Vec_new_i16 { /** * Function descriptor for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_i16(DiplomatI16View v) + * MyString *MyString_new_owned(DiplomatStringView v) * } */ - public static FunctionDescriptor Float64Vec_new_i16$descriptor() { - return Float64Vec_new_i16.DESC; + public static FunctionDescriptor MyString_new_owned$descriptor() { + return MyString_new_owned.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_i16(DiplomatI16View v) + * MyString *MyString_new_owned(DiplomatStringView v) * } */ - public static MethodHandle Float64Vec_new_i16$handle() { - return Float64Vec_new_i16.HANDLE; + public static MethodHandle MyString_new_owned$handle() { + return MyString_new_owned.HANDLE; } /** * Address for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_i16(DiplomatI16View v) + * MyString *MyString_new_owned(DiplomatStringView v) * } */ - public static MemorySegment Float64Vec_new_i16$address() { - return Float64Vec_new_i16.ADDR; + public static MemorySegment MyString_new_owned$address() { + return MyString_new_owned.ADDR; } /** * {@snippet lang=c : - * Float64Vec *Float64Vec_new_i16(DiplomatI16View v) + * MyString *MyString_new_owned(DiplomatStringView v) * } */ - public static MemorySegment Float64Vec_new_i16(MemorySegment v) { - var mh$ = Float64Vec_new_i16.HANDLE; + public static MemorySegment MyString_new_owned(MemorySegment v) { + var mh$ = MyString_new_owned.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_new_i16", v); + traceDowncall("MyString_new_owned", v); } return (MemorySegment)mh$.invokeExact(v); } catch (Throwable ex$) { @@ -11112,13 +11090,13 @@ public static MemorySegment Float64Vec_new_i16(MemorySegment v) { } } - private static class Float64Vec_new_u16 { + private static class MyString_new_from_first { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - DiplomatU16View.layout() + DiplomatStringsView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_u16"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new_from_first"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11126,43 +11104,43 @@ private static class Float64Vec_new_u16 { /** * Function descriptor for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_u16(DiplomatU16View v) + * MyString *MyString_new_from_first(DiplomatStringsView v) * } */ - public static FunctionDescriptor Float64Vec_new_u16$descriptor() { - return Float64Vec_new_u16.DESC; + public static FunctionDescriptor MyString_new_from_first$descriptor() { + return MyString_new_from_first.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_u16(DiplomatU16View v) + * MyString *MyString_new_from_first(DiplomatStringsView v) * } */ - public static MethodHandle Float64Vec_new_u16$handle() { - return Float64Vec_new_u16.HANDLE; + public static MethodHandle MyString_new_from_first$handle() { + return MyString_new_from_first.HANDLE; } /** * Address for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_u16(DiplomatU16View v) + * MyString *MyString_new_from_first(DiplomatStringsView v) * } */ - public static MemorySegment Float64Vec_new_u16$address() { - return Float64Vec_new_u16.ADDR; + public static MemorySegment MyString_new_from_first$address() { + return MyString_new_from_first.ADDR; } /** * {@snippet lang=c : - * Float64Vec *Float64Vec_new_u16(DiplomatU16View v) + * MyString *MyString_new_from_first(DiplomatStringsView v) * } */ - public static MemorySegment Float64Vec_new_u16(MemorySegment v) { - var mh$ = Float64Vec_new_u16.HANDLE; + public static MemorySegment MyString_new_from_first(MemorySegment v) { + var mh$ = MyString_new_from_first.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_new_u16", v); + traceDowncall("MyString_new_from_first", v); } return (MemorySegment)mh$.invokeExact(v); } catch (Throwable ex$) { @@ -11170,13 +11148,13 @@ public static MemorySegment Float64Vec_new_u16(MemorySegment v) { } } - private static class Float64Vec_new_isize { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( + private static class MyString_set_str { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER, - DiplomatIsizeView.layout() + DiplomatStringView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_isize"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_set_str"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11184,57 +11162,57 @@ private static class Float64Vec_new_isize { /** * Function descriptor for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_isize(DiplomatIsizeView v) + * void MyString_set_str(MyString *self, DiplomatStringView new_str) * } */ - public static FunctionDescriptor Float64Vec_new_isize$descriptor() { - return Float64Vec_new_isize.DESC; + public static FunctionDescriptor MyString_set_str$descriptor() { + return MyString_set_str.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_isize(DiplomatIsizeView v) + * void MyString_set_str(MyString *self, DiplomatStringView new_str) * } */ - public static MethodHandle Float64Vec_new_isize$handle() { - return Float64Vec_new_isize.HANDLE; + public static MethodHandle MyString_set_str$handle() { + return MyString_set_str.HANDLE; } /** * Address for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_isize(DiplomatIsizeView v) + * void MyString_set_str(MyString *self, DiplomatStringView new_str) * } */ - public static MemorySegment Float64Vec_new_isize$address() { - return Float64Vec_new_isize.ADDR; + public static MemorySegment MyString_set_str$address() { + return MyString_set_str.ADDR; } /** * {@snippet lang=c : - * Float64Vec *Float64Vec_new_isize(DiplomatIsizeView v) + * void MyString_set_str(MyString *self, DiplomatStringView new_str) * } */ - public static MemorySegment Float64Vec_new_isize(MemorySegment v) { - var mh$ = Float64Vec_new_isize.HANDLE; + public static void MyString_set_str(MemorySegment self, MemorySegment new_str) { + var mh$ = MyString_set_str.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_new_isize", v); + traceDowncall("MyString_set_str", self, new_str); } - return (MemorySegment)mh$.invokeExact(v); + mh$.invokeExact(self, new_str); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_new_usize { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( + private static class MyString_get_str { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER, - DiplomatUsizeView.layout() + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_usize"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_get_str"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11242,57 +11220,57 @@ private static class Float64Vec_new_usize { /** * Function descriptor for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_usize(DiplomatUsizeView v) + * void MyString_get_str(const MyString *self, DiplomatWrite *write) * } */ - public static FunctionDescriptor Float64Vec_new_usize$descriptor() { - return Float64Vec_new_usize.DESC; + public static FunctionDescriptor MyString_get_str$descriptor() { + return MyString_get_str.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_usize(DiplomatUsizeView v) + * void MyString_get_str(const MyString *self, DiplomatWrite *write) * } */ - public static MethodHandle Float64Vec_new_usize$handle() { - return Float64Vec_new_usize.HANDLE; + public static MethodHandle MyString_get_str$handle() { + return MyString_get_str.HANDLE; } /** * Address for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_usize(DiplomatUsizeView v) + * void MyString_get_str(const MyString *self, DiplomatWrite *write) * } */ - public static MemorySegment Float64Vec_new_usize$address() { - return Float64Vec_new_usize.ADDR; + public static MemorySegment MyString_get_str$address() { + return MyString_get_str.ADDR; } /** * {@snippet lang=c : - * Float64Vec *Float64Vec_new_usize(DiplomatUsizeView v) + * void MyString_get_str(const MyString *self, DiplomatWrite *write) * } */ - public static MemorySegment Float64Vec_new_usize(MemorySegment v) { - var mh$ = Float64Vec_new_usize.HANDLE; + public static void MyString_get_str(MemorySegment self, MemorySegment write) { + var mh$ = MyString_get_str.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_new_usize", v); + traceDowncall("MyString_get_str", self, write); } - return (MemorySegment)mh$.invokeExact(v); + mh$.invokeExact(self, write); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_new_f64_be_bytes { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - DiplomatU8View.layout() + private static class MyString_string_transform { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + DiplomatStringView.layout(), + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_f64_be_bytes"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_string_transform"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11300,57 +11278,56 @@ private static class Float64Vec_new_f64_be_bytes { /** * Function descriptor for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_f64_be_bytes(DiplomatU8View v) + * void MyString_string_transform(DiplomatStringView foo, DiplomatWrite *write) * } */ - public static FunctionDescriptor Float64Vec_new_f64_be_bytes$descriptor() { - return Float64Vec_new_f64_be_bytes.DESC; + public static FunctionDescriptor MyString_string_transform$descriptor() { + return MyString_string_transform.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_f64_be_bytes(DiplomatU8View v) + * void MyString_string_transform(DiplomatStringView foo, DiplomatWrite *write) * } */ - public static MethodHandle Float64Vec_new_f64_be_bytes$handle() { - return Float64Vec_new_f64_be_bytes.HANDLE; + public static MethodHandle MyString_string_transform$handle() { + return MyString_string_transform.HANDLE; } /** * Address for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_f64_be_bytes(DiplomatU8View v) + * void MyString_string_transform(DiplomatStringView foo, DiplomatWrite *write) * } */ - public static MemorySegment Float64Vec_new_f64_be_bytes$address() { - return Float64Vec_new_f64_be_bytes.ADDR; + public static MemorySegment MyString_string_transform$address() { + return MyString_string_transform.ADDR; } /** * {@snippet lang=c : - * Float64Vec *Float64Vec_new_f64_be_bytes(DiplomatU8View v) + * void MyString_string_transform(DiplomatStringView foo, DiplomatWrite *write) * } */ - public static MemorySegment Float64Vec_new_f64_be_bytes(MemorySegment v) { - var mh$ = Float64Vec_new_f64_be_bytes.HANDLE; + public static void MyString_string_transform(MemorySegment foo, MemorySegment write) { + var mh$ = MyString_string_transform.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_new_f64_be_bytes", v); + traceDowncall("MyString_string_transform", foo, write); } - return (MemorySegment)mh$.invokeExact(v); + mh$.invokeExact(foo, write); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_new_from_owned { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - DiplomatF64ViewMut.layout() + private static class MyString_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_from_owned"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11358,57 +11335,59 @@ private static class Float64Vec_new_from_owned { /** * Function descriptor for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_from_owned(DiplomatF64ViewMut v) + * void MyString_destroy(MyString *self) * } */ - public static FunctionDescriptor Float64Vec_new_from_owned$descriptor() { - return Float64Vec_new_from_owned.DESC; + public static FunctionDescriptor MyString_destroy$descriptor() { + return MyString_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_from_owned(DiplomatF64ViewMut v) + * void MyString_destroy(MyString *self) * } */ - public static MethodHandle Float64Vec_new_from_owned$handle() { - return Float64Vec_new_from_owned.HANDLE; + public static MethodHandle MyString_destroy$handle() { + return MyString_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_from_owned(DiplomatF64ViewMut v) + * void MyString_destroy(MyString *self) * } */ - public static MemorySegment Float64Vec_new_from_owned$address() { - return Float64Vec_new_from_owned.ADDR; + public static MemorySegment MyString_destroy$address() { + return MyString_destroy.ADDR; } /** * {@snippet lang=c : - * Float64Vec *Float64Vec_new_from_owned(DiplomatF64ViewMut v) + * void MyString_destroy(MyString *self) * } */ - public static MemorySegment Float64Vec_new_from_owned(MemorySegment v) { - var mh$ = Float64Vec_new_from_owned.HANDLE; + public static void MyString_destroy(MemorySegment self) { + var mh$ = MyString_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_new_from_owned", v); + traceDowncall("MyString_destroy", self); } - return (MemorySegment)mh$.invokeExact(v); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_as_slice { + private static class BorrowedFieldsWithBounds_from_foo_and_strings { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - DiplomatF64View.layout(), - somelib_h.C_POINTER + BorrowedFieldsWithBounds.layout(), + somelib_h.C_POINTER, + DiplomatString16View.layout(), + DiplomatStringView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_as_slice"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("BorrowedFieldsWithBounds_from_foo_and_strings"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11416,57 +11395,57 @@ private static class Float64Vec_as_slice { /** * Function descriptor for: * {@snippet lang=c : - * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) + * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, DiplomatString16View dstr16_x, DiplomatStringView utf8_str_z) * } */ - public static FunctionDescriptor Float64Vec_as_slice$descriptor() { - return Float64Vec_as_slice.DESC; + public static FunctionDescriptor BorrowedFieldsWithBounds_from_foo_and_strings$descriptor() { + return BorrowedFieldsWithBounds_from_foo_and_strings.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) + * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, DiplomatString16View dstr16_x, DiplomatStringView utf8_str_z) * } */ - public static MethodHandle Float64Vec_as_slice$handle() { - return Float64Vec_as_slice.HANDLE; + public static MethodHandle BorrowedFieldsWithBounds_from_foo_and_strings$handle() { + return BorrowedFieldsWithBounds_from_foo_and_strings.HANDLE; } /** * Address for: * {@snippet lang=c : - * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) + * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, DiplomatString16View dstr16_x, DiplomatStringView utf8_str_z) * } */ - public static MemorySegment Float64Vec_as_slice$address() { - return Float64Vec_as_slice.ADDR; + public static MemorySegment BorrowedFieldsWithBounds_from_foo_and_strings$address() { + return BorrowedFieldsWithBounds_from_foo_and_strings.ADDR; } /** * {@snippet lang=c : - * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) + * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, DiplomatString16View dstr16_x, DiplomatStringView utf8_str_z) * } */ - public static MemorySegment Float64Vec_as_slice(SegmentAllocator allocator, MemorySegment self) { - var mh$ = Float64Vec_as_slice.HANDLE; + public static MemorySegment BorrowedFieldsWithBounds_from_foo_and_strings(SegmentAllocator allocator, MemorySegment foo, MemorySegment dstr16_x, MemorySegment utf8_str_z) { + var mh$ = BorrowedFieldsWithBounds_from_foo_and_strings.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_as_slice", allocator, self); + traceDowncall("BorrowedFieldsWithBounds_from_foo_and_strings", allocator, foo, dstr16_x, utf8_str_z); } - return (MemorySegment)mh$.invokeExact(allocator, self); + return (MemorySegment)mh$.invokeExact(allocator, foo, dstr16_x, utf8_str_z); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_fill_slice { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class OpaqueMutexedString_from_usize { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - DiplomatF64ViewMut.layout() + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_fill_slice"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_from_usize"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11474,57 +11453,57 @@ private static class Float64Vec_fill_slice { /** * Function descriptor for: * {@snippet lang=c : - * void Float64Vec_fill_slice(const Float64Vec *self, DiplomatF64ViewMut v) + * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) * } */ - public static FunctionDescriptor Float64Vec_fill_slice$descriptor() { - return Float64Vec_fill_slice.DESC; + public static FunctionDescriptor OpaqueMutexedString_from_usize$descriptor() { + return OpaqueMutexedString_from_usize.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Float64Vec_fill_slice(const Float64Vec *self, DiplomatF64ViewMut v) + * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) * } */ - public static MethodHandle Float64Vec_fill_slice$handle() { - return Float64Vec_fill_slice.HANDLE; + public static MethodHandle OpaqueMutexedString_from_usize$handle() { + return OpaqueMutexedString_from_usize.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Float64Vec_fill_slice(const Float64Vec *self, DiplomatF64ViewMut v) + * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) * } */ - public static MemorySegment Float64Vec_fill_slice$address() { - return Float64Vec_fill_slice.ADDR; + public static MemorySegment OpaqueMutexedString_from_usize$address() { + return OpaqueMutexedString_from_usize.ADDR; } /** * {@snippet lang=c : - * void Float64Vec_fill_slice(const Float64Vec *self, DiplomatF64ViewMut v) + * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) * } */ - public static void Float64Vec_fill_slice(MemorySegment self, MemorySegment v) { - var mh$ = Float64Vec_fill_slice.HANDLE; + public static MemorySegment OpaqueMutexedString_from_usize(long number) { + var mh$ = OpaqueMutexedString_from_usize.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_fill_slice", self, v); + traceDowncall("OpaqueMutexedString_from_usize", number); } - mh$.invokeExact(self, v); + return (MemorySegment)mh$.invokeExact(number); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_set_value { + private static class OpaqueMutexedString_change { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER, - DiplomatF64View.layout() + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_set_value"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_change"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11532,57 +11511,57 @@ private static class Float64Vec_set_value { /** * Function descriptor for: * {@snippet lang=c : - * void Float64Vec_set_value(Float64Vec *self, DiplomatF64View new_slice) + * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) * } */ - public static FunctionDescriptor Float64Vec_set_value$descriptor() { - return Float64Vec_set_value.DESC; + public static FunctionDescriptor OpaqueMutexedString_change$descriptor() { + return OpaqueMutexedString_change.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Float64Vec_set_value(Float64Vec *self, DiplomatF64View new_slice) + * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) * } */ - public static MethodHandle Float64Vec_set_value$handle() { - return Float64Vec_set_value.HANDLE; + public static MethodHandle OpaqueMutexedString_change$handle() { + return OpaqueMutexedString_change.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Float64Vec_set_value(Float64Vec *self, DiplomatF64View new_slice) + * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) * } */ - public static MemorySegment Float64Vec_set_value$address() { - return Float64Vec_set_value.ADDR; + public static MemorySegment OpaqueMutexedString_change$address() { + return OpaqueMutexedString_change.ADDR; } /** * {@snippet lang=c : - * void Float64Vec_set_value(Float64Vec *self, DiplomatF64View new_slice) + * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) * } */ - public static void Float64Vec_set_value(MemorySegment self, MemorySegment new_slice) { - var mh$ = Float64Vec_set_value.HANDLE; + public static void OpaqueMutexedString_change(MemorySegment self, long number) { + var mh$ = OpaqueMutexedString_change.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_set_value", self, new_slice); + traceDowncall("OpaqueMutexedString_change", self, number); } - mh$.invokeExact(self, new_slice); + mh$.invokeExact(self, number); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_to_string { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class OpaqueMutexedString_borrow { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_to_string"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_borrow"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11590,57 +11569,57 @@ private static class Float64Vec_to_string { /** * Function descriptor for: * {@snippet lang=c : - * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) + * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) * } */ - public static FunctionDescriptor Float64Vec_to_string$descriptor() { - return Float64Vec_to_string.DESC; + public static FunctionDescriptor OpaqueMutexedString_borrow$descriptor() { + return OpaqueMutexedString_borrow.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) + * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) * } */ - public static MethodHandle Float64Vec_to_string$handle() { - return Float64Vec_to_string.HANDLE; + public static MethodHandle OpaqueMutexedString_borrow$handle() { + return OpaqueMutexedString_borrow.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) + * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) * } */ - public static MemorySegment Float64Vec_to_string$address() { - return Float64Vec_to_string.ADDR; + public static MemorySegment OpaqueMutexedString_borrow$address() { + return OpaqueMutexedString_borrow.ADDR; } /** * {@snippet lang=c : - * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) + * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) * } */ - public static void Float64Vec_to_string(MemorySegment self, MemorySegment write) { - var mh$ = Float64Vec_to_string.HANDLE; + public static MemorySegment OpaqueMutexedString_borrow(MemorySegment self) { + var mh$ = OpaqueMutexedString_borrow.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_to_string", self, write); + traceDowncall("OpaqueMutexedString_borrow", self); } - mh$.invokeExact(self, write); + return (MemorySegment)mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_borrow { + private static class OpaqueMutexedString_borrow_other { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - DiplomatF64View.layout(), + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_borrow"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_borrow_other"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11648,56 +11627,58 @@ private static class Float64Vec_borrow { /** * Function descriptor for: * {@snippet lang=c : - * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) + * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) * } */ - public static FunctionDescriptor Float64Vec_borrow$descriptor() { - return Float64Vec_borrow.DESC; + public static FunctionDescriptor OpaqueMutexedString_borrow_other$descriptor() { + return OpaqueMutexedString_borrow_other.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) + * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) * } */ - public static MethodHandle Float64Vec_borrow$handle() { - return Float64Vec_borrow.HANDLE; + public static MethodHandle OpaqueMutexedString_borrow_other$handle() { + return OpaqueMutexedString_borrow_other.HANDLE; } /** * Address for: * {@snippet lang=c : - * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) + * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) * } */ - public static MemorySegment Float64Vec_borrow$address() { - return Float64Vec_borrow.ADDR; + public static MemorySegment OpaqueMutexedString_borrow_other$address() { + return OpaqueMutexedString_borrow_other.ADDR; } /** * {@snippet lang=c : - * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) + * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) * } */ - public static MemorySegment Float64Vec_borrow(SegmentAllocator allocator, MemorySegment self) { - var mh$ = Float64Vec_borrow.HANDLE; + public static MemorySegment OpaqueMutexedString_borrow_other(MemorySegment other) { + var mh$ = OpaqueMutexedString_borrow_other.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_borrow", allocator, self); + traceDowncall("OpaqueMutexedString_borrow_other", other); } - return (MemorySegment)mh$.invokeExact(allocator, self); + return (MemorySegment)mh$.invokeExact(other); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class OpaqueMutexedString_borrow_self_or_other { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_borrow_self_or_other"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11705,109 +11686,116 @@ private static class Float64Vec_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void Float64Vec_destroy(Float64Vec *self) + * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) * } */ - public static FunctionDescriptor Float64Vec_destroy$descriptor() { - return Float64Vec_destroy.DESC; + public static FunctionDescriptor OpaqueMutexedString_borrow_self_or_other$descriptor() { + return OpaqueMutexedString_borrow_self_or_other.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Float64Vec_destroy(Float64Vec *self) + * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) * } */ - public static MethodHandle Float64Vec_destroy$handle() { - return Float64Vec_destroy.HANDLE; + public static MethodHandle OpaqueMutexedString_borrow_self_or_other$handle() { + return OpaqueMutexedString_borrow_self_or_other.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Float64Vec_destroy(Float64Vec *self) + * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) * } */ - public static MemorySegment Float64Vec_destroy$address() { - return Float64Vec_destroy.ADDR; + public static MemorySegment OpaqueMutexedString_borrow_self_or_other$address() { + return OpaqueMutexedString_borrow_self_or_other.ADDR; } /** * {@snippet lang=c : - * void Float64Vec_destroy(Float64Vec *self) + * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) * } */ - public static void Float64Vec_destroy(MemorySegment self) { - var mh$ = Float64Vec_destroy.HANDLE; + public static MemorySegment OpaqueMutexedString_borrow_self_or_other(MemorySegment self, MemorySegment other) { + var mh$ = OpaqueMutexedString_borrow_self_or_other.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_destroy", self); + traceDowncall("OpaqueMutexedString_borrow_self_or_other", self, other); } - mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(self, other); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static final int MyEnum_A = (int)-2L; - /** - * {@snippet lang=c : - * enum MyEnum.MyEnum_A = -2 - * } - */ - public static int MyEnum_A() { - return MyEnum_A; - } - private static final int MyEnum_B = (int)-1L; - /** - * {@snippet lang=c : - * enum MyEnum.MyEnum_B = -1 - * } - */ - public static int MyEnum_B() { - return MyEnum_B; + + private static class OpaqueMutexedString_get_len_and_add { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_LONG, + somelib_h.C_POINTER, + somelib_h.C_LONG + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_get_len_and_add"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } - private static final int MyEnum_C = (int)0L; + /** + * Function descriptor for: * {@snippet lang=c : - * enum MyEnum.MyEnum_C = 0 + * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) * } */ - public static int MyEnum_C() { - return MyEnum_C; + public static FunctionDescriptor OpaqueMutexedString_get_len_and_add$descriptor() { + return OpaqueMutexedString_get_len_and_add.DESC; } - private static final int MyEnum_D = (int)1L; + /** + * Downcall method handle for: * {@snippet lang=c : - * enum MyEnum.MyEnum_D = 1 + * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) * } */ - public static int MyEnum_D() { - return MyEnum_D; + public static MethodHandle OpaqueMutexedString_get_len_and_add$handle() { + return OpaqueMutexedString_get_len_and_add.HANDLE; } - private static final int MyEnum_E = (int)2L; + /** + * Address for: * {@snippet lang=c : - * enum MyEnum.MyEnum_E = 2 + * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) * } */ - public static int MyEnum_E() { - return MyEnum_E; + public static MemorySegment OpaqueMutexedString_get_len_and_add$address() { + return OpaqueMutexedString_get_len_and_add.ADDR; } - private static final int MyEnum_F = (int)3L; + /** * {@snippet lang=c : - * enum MyEnum.MyEnum_F = 3 + * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) * } */ - public static int MyEnum_F() { - return MyEnum_F; + public static long OpaqueMutexedString_get_len_and_add(MemorySegment self, long other) { + var mh$ = OpaqueMutexedString_get_len_and_add.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("OpaqueMutexedString_get_len_and_add", self, other); + } + return (long)mh$.invokeExact(self, other); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } } - private static class MyStruct_new { + private static class OpaqueMutexedString_dummy_str { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - MyStruct.layout() ); + DiplomatStringView.layout(), + somelib_h.C_POINTER + ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyStruct_new"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_dummy_str"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11815,57 +11803,57 @@ private static class MyStruct_new { /** * Function descriptor for: * {@snippet lang=c : - * MyStruct MyStruct_new() + * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) * } */ - public static FunctionDescriptor MyStruct_new$descriptor() { - return MyStruct_new.DESC; + public static FunctionDescriptor OpaqueMutexedString_dummy_str$descriptor() { + return OpaqueMutexedString_dummy_str.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * MyStruct MyStruct_new() + * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) * } */ - public static MethodHandle MyStruct_new$handle() { - return MyStruct_new.HANDLE; + public static MethodHandle OpaqueMutexedString_dummy_str$handle() { + return OpaqueMutexedString_dummy_str.HANDLE; } /** * Address for: * {@snippet lang=c : - * MyStruct MyStruct_new() + * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) * } */ - public static MemorySegment MyStruct_new$address() { - return MyStruct_new.ADDR; + public static MemorySegment OpaqueMutexedString_dummy_str$address() { + return OpaqueMutexedString_dummy_str.ADDR; } /** * {@snippet lang=c : - * MyStruct MyStruct_new() + * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) * } */ - public static MemorySegment MyStruct_new(SegmentAllocator allocator) { - var mh$ = MyStruct_new.HANDLE; + public static MemorySegment OpaqueMutexedString_dummy_str(SegmentAllocator allocator, MemorySegment self) { + var mh$ = OpaqueMutexedString_dummy_str.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyStruct_new", allocator); + traceDowncall("OpaqueMutexedString_dummy_str", allocator, self); } - return (MemorySegment)mh$.invokeExact(allocator); + return (MemorySegment)mh$.invokeExact(allocator, self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyStruct_into_a { + private static class OpaqueMutexedString_wrapper { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_CHAR, - MyStruct.layout() + somelib_h.C_POINTER, + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyStruct_into_a"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_wrapper"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11873,57 +11861,56 @@ private static class MyStruct_into_a { /** * Function descriptor for: * {@snippet lang=c : - * uint8_t MyStruct_into_a(MyStruct self) + * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) * } */ - public static FunctionDescriptor MyStruct_into_a$descriptor() { - return MyStruct_into_a.DESC; + public static FunctionDescriptor OpaqueMutexedString_wrapper$descriptor() { + return OpaqueMutexedString_wrapper.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * uint8_t MyStruct_into_a(MyStruct self) + * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) * } */ - public static MethodHandle MyStruct_into_a$handle() { - return MyStruct_into_a.HANDLE; + public static MethodHandle OpaqueMutexedString_wrapper$handle() { + return OpaqueMutexedString_wrapper.HANDLE; } /** * Address for: * {@snippet lang=c : - * uint8_t MyStruct_into_a(MyStruct self) + * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) * } */ - public static MemorySegment MyStruct_into_a$address() { - return MyStruct_into_a.ADDR; + public static MemorySegment OpaqueMutexedString_wrapper$address() { + return OpaqueMutexedString_wrapper.ADDR; } /** * {@snippet lang=c : - * uint8_t MyStruct_into_a(MyStruct self) + * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) * } */ - public static byte MyStruct_into_a(MemorySegment self) { - var mh$ = MyStruct_into_a.HANDLE; + public static MemorySegment OpaqueMutexedString_wrapper(MemorySegment self) { + var mh$ = OpaqueMutexedString_wrapper.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyStruct_into_a", self); + traceDowncall("OpaqueMutexedString_wrapper", self); } - return (byte)mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OpaqueMutexedString_from_usize { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_LONG + private static class OpaqueMutexedString_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_from_usize"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11931,57 +11918,57 @@ private static class OpaqueMutexedString_from_usize { /** * Function descriptor for: * {@snippet lang=c : - * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) + * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) * } */ - public static FunctionDescriptor OpaqueMutexedString_from_usize$descriptor() { - return OpaqueMutexedString_from_usize.DESC; + public static FunctionDescriptor OpaqueMutexedString_destroy$descriptor() { + return OpaqueMutexedString_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) + * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) * } */ - public static MethodHandle OpaqueMutexedString_from_usize$handle() { - return OpaqueMutexedString_from_usize.HANDLE; + public static MethodHandle OpaqueMutexedString_destroy$handle() { + return OpaqueMutexedString_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) + * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) * } */ - public static MemorySegment OpaqueMutexedString_from_usize$address() { - return OpaqueMutexedString_from_usize.ADDR; + public static MemorySegment OpaqueMutexedString_destroy$address() { + return OpaqueMutexedString_destroy.ADDR; } /** * {@snippet lang=c : - * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) + * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) * } */ - public static MemorySegment OpaqueMutexedString_from_usize(long number) { - var mh$ = OpaqueMutexedString_from_usize.HANDLE; + public static void OpaqueMutexedString_destroy(MemorySegment self) { + var mh$ = OpaqueMutexedString_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_from_usize", number); + traceDowncall("OpaqueMutexedString_destroy", self); } - return (MemorySegment)mh$.invokeExact(number); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OpaqueMutexedString_change { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class Bar_foo { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_change"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Bar_foo"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11989,57 +11976,56 @@ private static class OpaqueMutexedString_change { /** * Function descriptor for: * {@snippet lang=c : - * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) + * const Foo *Bar_foo(const Bar *self) * } */ - public static FunctionDescriptor OpaqueMutexedString_change$descriptor() { - return OpaqueMutexedString_change.DESC; + public static FunctionDescriptor Bar_foo$descriptor() { + return Bar_foo.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) + * const Foo *Bar_foo(const Bar *self) * } */ - public static MethodHandle OpaqueMutexedString_change$handle() { - return OpaqueMutexedString_change.HANDLE; + public static MethodHandle Bar_foo$handle() { + return Bar_foo.HANDLE; } /** * Address for: * {@snippet lang=c : - * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) + * const Foo *Bar_foo(const Bar *self) * } */ - public static MemorySegment OpaqueMutexedString_change$address() { - return OpaqueMutexedString_change.ADDR; + public static MemorySegment Bar_foo$address() { + return Bar_foo.ADDR; } /** * {@snippet lang=c : - * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) + * const Foo *Bar_foo(const Bar *self) * } */ - public static void OpaqueMutexedString_change(MemorySegment self, long number) { - var mh$ = OpaqueMutexedString_change.HANDLE; + public static MemorySegment Bar_foo(MemorySegment self) { + var mh$ = Bar_foo.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_change", self, number); + traceDowncall("Bar_foo", self); } - mh$.invokeExact(self, number); + return (MemorySegment)mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OpaqueMutexedString_borrow { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, + private static class Bar_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_borrow"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Bar_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12047,57 +12033,55 @@ private static class OpaqueMutexedString_borrow { /** * Function descriptor for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) + * void Bar_destroy(Bar *self) * } */ - public static FunctionDescriptor OpaqueMutexedString_borrow$descriptor() { - return OpaqueMutexedString_borrow.DESC; + public static FunctionDescriptor Bar_destroy$descriptor() { + return Bar_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) + * void Bar_destroy(Bar *self) * } */ - public static MethodHandle OpaqueMutexedString_borrow$handle() { - return OpaqueMutexedString_borrow.HANDLE; + public static MethodHandle Bar_destroy$handle() { + return Bar_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) + * void Bar_destroy(Bar *self) * } */ - public static MemorySegment OpaqueMutexedString_borrow$address() { - return OpaqueMutexedString_borrow.ADDR; + public static MemorySegment Bar_destroy$address() { + return Bar_destroy.ADDR; } /** * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) + * void Bar_destroy(Bar *self) * } */ - public static MemorySegment OpaqueMutexedString_borrow(MemorySegment self) { - var mh$ = OpaqueMutexedString_borrow.HANDLE; + public static void Bar_destroy(MemorySegment self) { + var mh$ = Bar_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_borrow", self); + traceDowncall("Bar_destroy", self); } - return (MemorySegment)mh$.invokeExact(self); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OpaqueMutexedString_borrow_other { + private static class CyclicStructA_get_b { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); + CyclicStructB.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_borrow_other"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("CyclicStructA_get_b"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12105,58 +12089,56 @@ private static class OpaqueMutexedString_borrow_other { /** * Function descriptor for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) + * CyclicStructB CyclicStructA_get_b() * } */ - public static FunctionDescriptor OpaqueMutexedString_borrow_other$descriptor() { - return OpaqueMutexedString_borrow_other.DESC; + public static FunctionDescriptor CyclicStructA_get_b$descriptor() { + return CyclicStructA_get_b.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) + * CyclicStructB CyclicStructA_get_b() * } */ - public static MethodHandle OpaqueMutexedString_borrow_other$handle() { - return OpaqueMutexedString_borrow_other.HANDLE; + public static MethodHandle CyclicStructA_get_b$handle() { + return CyclicStructA_get_b.HANDLE; } /** * Address for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) + * CyclicStructB CyclicStructA_get_b() * } */ - public static MemorySegment OpaqueMutexedString_borrow_other$address() { - return OpaqueMutexedString_borrow_other.ADDR; + public static MemorySegment CyclicStructA_get_b$address() { + return CyclicStructA_get_b.ADDR; } /** * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) + * CyclicStructB CyclicStructA_get_b() * } */ - public static MemorySegment OpaqueMutexedString_borrow_other(MemorySegment other) { - var mh$ = OpaqueMutexedString_borrow_other.HANDLE; + public static MemorySegment CyclicStructA_get_b(SegmentAllocator allocator) { + var mh$ = CyclicStructA_get_b.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_borrow_other", other); + traceDowncall("CyclicStructA_get_b", allocator); } - return (MemorySegment)mh$.invokeExact(other); + return (MemorySegment)mh$.invokeExact(allocator); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OpaqueMutexedString_borrow_self_or_other { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, + private static class Two_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_borrow_self_or_other"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Two_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12164,58 +12146,58 @@ private static class OpaqueMutexedString_borrow_self_or_other { /** * Function descriptor for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) + * void Two_destroy(Two *self) * } */ - public static FunctionDescriptor OpaqueMutexedString_borrow_self_or_other$descriptor() { - return OpaqueMutexedString_borrow_self_or_other.DESC; + public static FunctionDescriptor Two_destroy$descriptor() { + return Two_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) + * void Two_destroy(Two *self) * } */ - public static MethodHandle OpaqueMutexedString_borrow_self_or_other$handle() { - return OpaqueMutexedString_borrow_self_or_other.HANDLE; + public static MethodHandle Two_destroy$handle() { + return Two_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) + * void Two_destroy(Two *self) * } */ - public static MemorySegment OpaqueMutexedString_borrow_self_or_other$address() { - return OpaqueMutexedString_borrow_self_or_other.ADDR; + public static MemorySegment Two_destroy$address() { + return Two_destroy.ADDR; } /** * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) + * void Two_destroy(Two *self) * } */ - public static MemorySegment OpaqueMutexedString_borrow_self_or_other(MemorySegment self, MemorySegment other) { - var mh$ = OpaqueMutexedString_borrow_self_or_other.HANDLE; + public static void Two_destroy(MemorySegment self) { + var mh$ = Two_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_borrow_self_or_other", self, other); + traceDowncall("Two_destroy", self); } - return (MemorySegment)mh$.invokeExact(self, other); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OpaqueMutexedString_get_len_and_add { + private static class One_transitivity { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_LONG, somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_POINTER, + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_get_len_and_add"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_transitivity"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12223,57 +12205,58 @@ private static class OpaqueMutexedString_get_len_and_add { /** * Function descriptor for: * {@snippet lang=c : - * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) + * One *One_transitivity(const One *hold, const One *nohold) * } */ - public static FunctionDescriptor OpaqueMutexedString_get_len_and_add$descriptor() { - return OpaqueMutexedString_get_len_and_add.DESC; + public static FunctionDescriptor One_transitivity$descriptor() { + return One_transitivity.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) + * One *One_transitivity(const One *hold, const One *nohold) * } */ - public static MethodHandle OpaqueMutexedString_get_len_and_add$handle() { - return OpaqueMutexedString_get_len_and_add.HANDLE; + public static MethodHandle One_transitivity$handle() { + return One_transitivity.HANDLE; } /** * Address for: * {@snippet lang=c : - * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) + * One *One_transitivity(const One *hold, const One *nohold) * } */ - public static MemorySegment OpaqueMutexedString_get_len_and_add$address() { - return OpaqueMutexedString_get_len_and_add.ADDR; + public static MemorySegment One_transitivity$address() { + return One_transitivity.ADDR; } /** * {@snippet lang=c : - * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) + * One *One_transitivity(const One *hold, const One *nohold) * } */ - public static long OpaqueMutexedString_get_len_and_add(MemorySegment self, long other) { - var mh$ = OpaqueMutexedString_get_len_and_add.HANDLE; + public static MemorySegment One_transitivity(MemorySegment hold, MemorySegment nohold) { + var mh$ = One_transitivity.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_get_len_and_add", self, other); + traceDowncall("One_transitivity", hold, nohold); } - return (long)mh$.invokeExact(self, other); + return (MemorySegment)mh$.invokeExact(hold, nohold); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OpaqueMutexedString_dummy_str { + private static class One_cycle { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - DiplomatStringView.layout(), + somelib_h.C_POINTER, + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_dummy_str"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_cycle"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12281,57 +12264,61 @@ private static class OpaqueMutexedString_dummy_str { /** * Function descriptor for: * {@snippet lang=c : - * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) + * One *One_cycle(const Two *hold, const One *nohold) * } */ - public static FunctionDescriptor OpaqueMutexedString_dummy_str$descriptor() { - return OpaqueMutexedString_dummy_str.DESC; + public static FunctionDescriptor One_cycle$descriptor() { + return One_cycle.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) + * One *One_cycle(const Two *hold, const One *nohold) * } */ - public static MethodHandle OpaqueMutexedString_dummy_str$handle() { - return OpaqueMutexedString_dummy_str.HANDLE; + public static MethodHandle One_cycle$handle() { + return One_cycle.HANDLE; } /** * Address for: * {@snippet lang=c : - * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) + * One *One_cycle(const Two *hold, const One *nohold) * } */ - public static MemorySegment OpaqueMutexedString_dummy_str$address() { - return OpaqueMutexedString_dummy_str.ADDR; + public static MemorySegment One_cycle$address() { + return One_cycle.ADDR; } /** * {@snippet lang=c : - * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) + * One *One_cycle(const Two *hold, const One *nohold) * } */ - public static MemorySegment OpaqueMutexedString_dummy_str(SegmentAllocator allocator, MemorySegment self) { - var mh$ = OpaqueMutexedString_dummy_str.HANDLE; + public static MemorySegment One_cycle(MemorySegment hold, MemorySegment nohold) { + var mh$ = One_cycle.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_dummy_str", allocator, self); + traceDowncall("One_cycle", hold, nohold); } - return (MemorySegment)mh$.invokeExact(allocator, self); + return (MemorySegment)mh$.invokeExact(hold, nohold); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OpaqueMutexedString_wrapper { + private static class One_many_dependents { public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_wrapper"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_many_dependents"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12339,56 +12326,58 @@ private static class OpaqueMutexedString_wrapper { /** * Function descriptor for: * {@snippet lang=c : - * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) + * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) * } */ - public static FunctionDescriptor OpaqueMutexedString_wrapper$descriptor() { - return OpaqueMutexedString_wrapper.DESC; + public static FunctionDescriptor One_many_dependents$descriptor() { + return One_many_dependents.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) + * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) * } */ - public static MethodHandle OpaqueMutexedString_wrapper$handle() { - return OpaqueMutexedString_wrapper.HANDLE; + public static MethodHandle One_many_dependents$handle() { + return One_many_dependents.HANDLE; } /** * Address for: * {@snippet lang=c : - * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) + * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) * } */ - public static MemorySegment OpaqueMutexedString_wrapper$address() { - return OpaqueMutexedString_wrapper.ADDR; + public static MemorySegment One_many_dependents$address() { + return One_many_dependents.ADDR; } /** * {@snippet lang=c : - * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) + * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) * } */ - public static MemorySegment OpaqueMutexedString_wrapper(MemorySegment self) { - var mh$ = OpaqueMutexedString_wrapper.HANDLE; + public static MemorySegment One_many_dependents(MemorySegment a, MemorySegment b, MemorySegment c, MemorySegment d, MemorySegment nohold) { + var mh$ = One_many_dependents.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_wrapper", self); + traceDowncall("One_many_dependents", a, b, c, d, nohold); } - return (MemorySegment)mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(a, b, c, d, nohold); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OpaqueMutexedString_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class One_return_outlives_param { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_return_outlives_param"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12396,56 +12385,60 @@ private static class OpaqueMutexedString_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) + * One *One_return_outlives_param(const Two *hold, const One *nohold) * } */ - public static FunctionDescriptor OpaqueMutexedString_destroy$descriptor() { - return OpaqueMutexedString_destroy.DESC; + public static FunctionDescriptor One_return_outlives_param$descriptor() { + return One_return_outlives_param.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) + * One *One_return_outlives_param(const Two *hold, const One *nohold) * } */ - public static MethodHandle OpaqueMutexedString_destroy$handle() { - return OpaqueMutexedString_destroy.HANDLE; + public static MethodHandle One_return_outlives_param$handle() { + return One_return_outlives_param.HANDLE; } /** * Address for: * {@snippet lang=c : - * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) + * One *One_return_outlives_param(const Two *hold, const One *nohold) * } */ - public static MemorySegment OpaqueMutexedString_destroy$address() { - return OpaqueMutexedString_destroy.ADDR; + public static MemorySegment One_return_outlives_param$address() { + return One_return_outlives_param.ADDR; } /** * {@snippet lang=c : - * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) + * One *One_return_outlives_param(const Two *hold, const One *nohold) * } */ - public static void OpaqueMutexedString_destroy(MemorySegment self) { - var mh$ = OpaqueMutexedString_destroy.HANDLE; + public static MemorySegment One_return_outlives_param(MemorySegment hold, MemorySegment nohold) { + var mh$ = One_return_outlives_param.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_destroy", self); + traceDowncall("One_return_outlives_param", hold, nohold); } - mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(hold, nohold); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class RefListParameter_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class One_diamond_top { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("RefListParameter_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_top"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12453,57 +12446,60 @@ private static class RefListParameter_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void RefListParameter_destroy(RefListParameter *self) + * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static FunctionDescriptor RefListParameter_destroy$descriptor() { - return RefListParameter_destroy.DESC; + public static FunctionDescriptor One_diamond_top$descriptor() { + return One_diamond_top.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void RefListParameter_destroy(RefListParameter *self) + * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MethodHandle RefListParameter_destroy$handle() { - return RefListParameter_destroy.HANDLE; + public static MethodHandle One_diamond_top$handle() { + return One_diamond_top.HANDLE; } /** * Address for: * {@snippet lang=c : - * void RefListParameter_destroy(RefListParameter *self) + * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MemorySegment RefListParameter_destroy$address() { - return RefListParameter_destroy.ADDR; + public static MemorySegment One_diamond_top$address() { + return One_diamond_top.ADDR; } /** * {@snippet lang=c : - * void RefListParameter_destroy(RefListParameter *self) + * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static void RefListParameter_destroy(MemorySegment self) { - var mh$ = RefListParameter_destroy.HANDLE; + public static MemorySegment One_diamond_top(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { + var mh$ = One_diamond_top.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("RefListParameter_destroy", self); + traceDowncall("One_diamond_top", top, left, right, bottom); } - mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(top, left, right, bottom); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyEnum_into_value { + private static class One_diamond_left { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_CHAR, - somelib_h.C_INT + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyEnum_into_value"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_left"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12511,55 +12507,60 @@ private static class MyEnum_into_value { /** * Function descriptor for: * {@snippet lang=c : - * int8_t MyEnum_into_value(MyEnum self) + * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static FunctionDescriptor MyEnum_into_value$descriptor() { - return MyEnum_into_value.DESC; + public static FunctionDescriptor One_diamond_left$descriptor() { + return One_diamond_left.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int8_t MyEnum_into_value(MyEnum self) + * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MethodHandle MyEnum_into_value$handle() { - return MyEnum_into_value.HANDLE; + public static MethodHandle One_diamond_left$handle() { + return One_diamond_left.HANDLE; } /** * Address for: * {@snippet lang=c : - * int8_t MyEnum_into_value(MyEnum self) + * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MemorySegment MyEnum_into_value$address() { - return MyEnum_into_value.ADDR; + public static MemorySegment One_diamond_left$address() { + return One_diamond_left.ADDR; } /** * {@snippet lang=c : - * int8_t MyEnum_into_value(MyEnum self) + * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static byte MyEnum_into_value(int self) { - var mh$ = MyEnum_into_value.HANDLE; + public static MemorySegment One_diamond_left(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { + var mh$ = One_diamond_left.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyEnum_into_value", self); + traceDowncall("One_diamond_left", top, left, right, bottom); } - return (byte)mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(top, left, right, bottom); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyEnum_get_a { + private static class One_diamond_right { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT ); + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyEnum_get_a"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_right"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12567,57 +12568,60 @@ private static class MyEnum_get_a { /** * Function descriptor for: * {@snippet lang=c : - * MyEnum MyEnum_get_a() + * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static FunctionDescriptor MyEnum_get_a$descriptor() { - return MyEnum_get_a.DESC; + public static FunctionDescriptor One_diamond_right$descriptor() { + return One_diamond_right.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * MyEnum MyEnum_get_a() + * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MethodHandle MyEnum_get_a$handle() { - return MyEnum_get_a.HANDLE; + public static MethodHandle One_diamond_right$handle() { + return One_diamond_right.HANDLE; } /** * Address for: * {@snippet lang=c : - * MyEnum MyEnum_get_a() + * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MemorySegment MyEnum_get_a$address() { - return MyEnum_get_a.ADDR; + public static MemorySegment One_diamond_right$address() { + return One_diamond_right.ADDR; } /** * {@snippet lang=c : - * MyEnum MyEnum_get_a() + * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static int MyEnum_get_a() { - var mh$ = MyEnum_get_a.HANDLE; + public static MemorySegment One_diamond_right(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { + var mh$ = One_diamond_right.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyEnum_get_a"); + traceDowncall("One_diamond_right", top, left, right, bottom); } - return (int)mh$.invokeExact(); + return (MemorySegment)mh$.invokeExact(top, left, right, bottom); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyString_new { + private static class One_diamond_bottom { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - DiplomatStringView.layout() + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_bottom"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12625,57 +12629,61 @@ private static class MyString_new { /** * Function descriptor for: * {@snippet lang=c : - * MyString *MyString_new(DiplomatStringView v) + * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static FunctionDescriptor MyString_new$descriptor() { - return MyString_new.DESC; + public static FunctionDescriptor One_diamond_bottom$descriptor() { + return One_diamond_bottom.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * MyString *MyString_new(DiplomatStringView v) + * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MethodHandle MyString_new$handle() { - return MyString_new.HANDLE; + public static MethodHandle One_diamond_bottom$handle() { + return One_diamond_bottom.HANDLE; } /** * Address for: * {@snippet lang=c : - * MyString *MyString_new(DiplomatStringView v) + * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MemorySegment MyString_new$address() { - return MyString_new.ADDR; + public static MemorySegment One_diamond_bottom$address() { + return One_diamond_bottom.ADDR; } /** * {@snippet lang=c : - * MyString *MyString_new(DiplomatStringView v) + * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MemorySegment MyString_new(MemorySegment v) { - var mh$ = MyString_new.HANDLE; + public static MemorySegment One_diamond_bottom(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { + var mh$ = One_diamond_bottom.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyString_new", v); + traceDowncall("One_diamond_bottom", top, left, right, bottom); } - return (MemorySegment)mh$.invokeExact(v); + return (MemorySegment)mh$.invokeExact(top, left, right, bottom); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyString_new_unsafe { + private static class One_diamond_and_nested_types { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - DiplomatStringView.layout() + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new_unsafe"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_and_nested_types"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12683,57 +12691,59 @@ private static class MyString_new_unsafe { /** * Function descriptor for: * {@snippet lang=c : - * MyString *MyString_new_unsafe(DiplomatStringView v) + * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) * } */ - public static FunctionDescriptor MyString_new_unsafe$descriptor() { - return MyString_new_unsafe.DESC; + public static FunctionDescriptor One_diamond_and_nested_types$descriptor() { + return One_diamond_and_nested_types.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * MyString *MyString_new_unsafe(DiplomatStringView v) + * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) * } */ - public static MethodHandle MyString_new_unsafe$handle() { - return MyString_new_unsafe.HANDLE; + public static MethodHandle One_diamond_and_nested_types$handle() { + return One_diamond_and_nested_types.HANDLE; } /** * Address for: * {@snippet lang=c : - * MyString *MyString_new_unsafe(DiplomatStringView v) + * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) * } */ - public static MemorySegment MyString_new_unsafe$address() { - return MyString_new_unsafe.ADDR; + public static MemorySegment One_diamond_and_nested_types$address() { + return One_diamond_and_nested_types.ADDR; } /** * {@snippet lang=c : - * MyString *MyString_new_unsafe(DiplomatStringView v) + * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) * } */ - public static MemorySegment MyString_new_unsafe(MemorySegment v) { - var mh$ = MyString_new_unsafe.HANDLE; + public static MemorySegment One_diamond_and_nested_types(MemorySegment a, MemorySegment b, MemorySegment c, MemorySegment d, MemorySegment nohold) { + var mh$ = One_diamond_and_nested_types.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyString_new_unsafe", v); + traceDowncall("One_diamond_and_nested_types", a, b, c, d, nohold); } - return (MemorySegment)mh$.invokeExact(v); + return (MemorySegment)mh$.invokeExact(a, b, c, d, nohold); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyString_new_owned { + private static class One_implicit_bounds { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - DiplomatStringView.layout() + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new_owned"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_implicit_bounds"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12741,57 +12751,60 @@ private static class MyString_new_owned { /** * Function descriptor for: * {@snippet lang=c : - * MyString *MyString_new_owned(DiplomatStringView v) + * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) * } */ - public static FunctionDescriptor MyString_new_owned$descriptor() { - return MyString_new_owned.DESC; + public static FunctionDescriptor One_implicit_bounds$descriptor() { + return One_implicit_bounds.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * MyString *MyString_new_owned(DiplomatStringView v) + * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) * } */ - public static MethodHandle MyString_new_owned$handle() { - return MyString_new_owned.HANDLE; + public static MethodHandle One_implicit_bounds$handle() { + return One_implicit_bounds.HANDLE; } /** * Address for: * {@snippet lang=c : - * MyString *MyString_new_owned(DiplomatStringView v) + * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) * } */ - public static MemorySegment MyString_new_owned$address() { - return MyString_new_owned.ADDR; + public static MemorySegment One_implicit_bounds$address() { + return One_implicit_bounds.ADDR; } /** * {@snippet lang=c : - * MyString *MyString_new_owned(DiplomatStringView v) + * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) * } */ - public static MemorySegment MyString_new_owned(MemorySegment v) { - var mh$ = MyString_new_owned.HANDLE; + public static MemorySegment One_implicit_bounds(MemorySegment explicit_hold, MemorySegment implicit_hold, MemorySegment nohold) { + var mh$ = One_implicit_bounds.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyString_new_owned", v); + traceDowncall("One_implicit_bounds", explicit_hold, implicit_hold, nohold); } - return (MemorySegment)mh$.invokeExact(v); + return (MemorySegment)mh$.invokeExact(explicit_hold, implicit_hold, nohold); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyString_new_from_first { + private static class One_implicit_bounds_deep { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - DiplomatStringsView.layout() + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new_from_first"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_implicit_bounds_deep"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12799,57 +12812,56 @@ private static class MyString_new_from_first { /** * Function descriptor for: * {@snippet lang=c : - * MyString *MyString_new_from_first(DiplomatStringsView v) + * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) * } */ - public static FunctionDescriptor MyString_new_from_first$descriptor() { - return MyString_new_from_first.DESC; + public static FunctionDescriptor One_implicit_bounds_deep$descriptor() { + return One_implicit_bounds_deep.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * MyString *MyString_new_from_first(DiplomatStringsView v) + * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) * } */ - public static MethodHandle MyString_new_from_first$handle() { - return MyString_new_from_first.HANDLE; + public static MethodHandle One_implicit_bounds_deep$handle() { + return One_implicit_bounds_deep.HANDLE; } /** * Address for: * {@snippet lang=c : - * MyString *MyString_new_from_first(DiplomatStringsView v) + * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) * } */ - public static MemorySegment MyString_new_from_first$address() { - return MyString_new_from_first.ADDR; + public static MemorySegment One_implicit_bounds_deep$address() { + return One_implicit_bounds_deep.ADDR; } /** * {@snippet lang=c : - * MyString *MyString_new_from_first(DiplomatStringsView v) + * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) * } */ - public static MemorySegment MyString_new_from_first(MemorySegment v) { - var mh$ = MyString_new_from_first.HANDLE; + public static MemorySegment One_implicit_bounds_deep(MemorySegment explicit_, MemorySegment implicit_1, MemorySegment implicit_2, MemorySegment nohold) { + var mh$ = One_implicit_bounds_deep.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyString_new_from_first", v); + traceDowncall("One_implicit_bounds_deep", explicit_, implicit_1, implicit_2, nohold); } - return (MemorySegment)mh$.invokeExact(v); + return (MemorySegment)mh$.invokeExact(explicit_, implicit_1, implicit_2, nohold); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyString_set_str { + private static class One_destroy { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER, - DiplomatStringView.layout() + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_set_str"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12857,57 +12869,57 @@ private static class MyString_set_str { /** * Function descriptor for: * {@snippet lang=c : - * void MyString_set_str(MyString *self, DiplomatStringView new_str) + * void One_destroy(One *self) * } */ - public static FunctionDescriptor MyString_set_str$descriptor() { - return MyString_set_str.DESC; + public static FunctionDescriptor One_destroy$descriptor() { + return One_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void MyString_set_str(MyString *self, DiplomatStringView new_str) + * void One_destroy(One *self) * } */ - public static MethodHandle MyString_set_str$handle() { - return MyString_set_str.HANDLE; + public static MethodHandle One_destroy$handle() { + return One_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * void MyString_set_str(MyString *self, DiplomatStringView new_str) + * void One_destroy(One *self) * } */ - public static MemorySegment MyString_set_str$address() { - return MyString_set_str.ADDR; + public static MemorySegment One_destroy$address() { + return One_destroy.ADDR; } /** * {@snippet lang=c : - * void MyString_set_str(MyString *self, DiplomatStringView new_str) + * void One_destroy(One *self) * } */ - public static void MyString_set_str(MemorySegment self, MemorySegment new_str) { - var mh$ = MyString_set_str.HANDLE; + public static void One_destroy(MemorySegment self) { + var mh$ = One_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyString_set_str", self, new_str); + traceDowncall("One_destroy", self); } - mh$.invokeExact(self, new_str); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyString_get_str { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class Float64Vec_new_bool { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - somelib_h.C_POINTER + DiplomatBoolView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_get_str"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_bool"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12915,57 +12927,57 @@ private static class MyString_get_str { /** * Function descriptor for: * {@snippet lang=c : - * void MyString_get_str(const MyString *self, DiplomatWrite *write) + * Float64Vec *Float64Vec_new_bool(DiplomatBoolView v) * } */ - public static FunctionDescriptor MyString_get_str$descriptor() { - return MyString_get_str.DESC; + public static FunctionDescriptor Float64Vec_new_bool$descriptor() { + return Float64Vec_new_bool.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void MyString_get_str(const MyString *self, DiplomatWrite *write) + * Float64Vec *Float64Vec_new_bool(DiplomatBoolView v) * } */ - public static MethodHandle MyString_get_str$handle() { - return MyString_get_str.HANDLE; + public static MethodHandle Float64Vec_new_bool$handle() { + return Float64Vec_new_bool.HANDLE; } /** * Address for: * {@snippet lang=c : - * void MyString_get_str(const MyString *self, DiplomatWrite *write) + * Float64Vec *Float64Vec_new_bool(DiplomatBoolView v) * } */ - public static MemorySegment MyString_get_str$address() { - return MyString_get_str.ADDR; + public static MemorySegment Float64Vec_new_bool$address() { + return Float64Vec_new_bool.ADDR; } /** * {@snippet lang=c : - * void MyString_get_str(const MyString *self, DiplomatWrite *write) + * Float64Vec *Float64Vec_new_bool(DiplomatBoolView v) * } */ - public static void MyString_get_str(MemorySegment self, MemorySegment write) { - var mh$ = MyString_get_str.HANDLE; + public static MemorySegment Float64Vec_new_bool(MemorySegment v) { + var mh$ = Float64Vec_new_bool.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyString_get_str", self, write); + traceDowncall("Float64Vec_new_bool", v); } - mh$.invokeExact(self, write); + return (MemorySegment)mh$.invokeExact(v); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyString_string_transform { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - DiplomatStringView.layout(), - somelib_h.C_POINTER + private static class Float64Vec_new_i16 { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + DiplomatI16View.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_string_transform"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_i16"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12973,56 +12985,57 @@ private static class MyString_string_transform { /** * Function descriptor for: * {@snippet lang=c : - * void MyString_string_transform(DiplomatStringView foo, DiplomatWrite *write) + * Float64Vec *Float64Vec_new_i16(DiplomatI16View v) * } */ - public static FunctionDescriptor MyString_string_transform$descriptor() { - return MyString_string_transform.DESC; + public static FunctionDescriptor Float64Vec_new_i16$descriptor() { + return Float64Vec_new_i16.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void MyString_string_transform(DiplomatStringView foo, DiplomatWrite *write) + * Float64Vec *Float64Vec_new_i16(DiplomatI16View v) * } */ - public static MethodHandle MyString_string_transform$handle() { - return MyString_string_transform.HANDLE; + public static MethodHandle Float64Vec_new_i16$handle() { + return Float64Vec_new_i16.HANDLE; } /** * Address for: * {@snippet lang=c : - * void MyString_string_transform(DiplomatStringView foo, DiplomatWrite *write) + * Float64Vec *Float64Vec_new_i16(DiplomatI16View v) * } */ - public static MemorySegment MyString_string_transform$address() { - return MyString_string_transform.ADDR; + public static MemorySegment Float64Vec_new_i16$address() { + return Float64Vec_new_i16.ADDR; } /** * {@snippet lang=c : - * void MyString_string_transform(DiplomatStringView foo, DiplomatWrite *write) + * Float64Vec *Float64Vec_new_i16(DiplomatI16View v) * } */ - public static void MyString_string_transform(MemorySegment foo, MemorySegment write) { - var mh$ = MyString_string_transform.HANDLE; + public static MemorySegment Float64Vec_new_i16(MemorySegment v) { + var mh$ = Float64Vec_new_i16.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyString_string_transform", foo, write); + traceDowncall("Float64Vec_new_i16", v); } - mh$.invokeExact(foo, write); + return (MemorySegment)mh$.invokeExact(v); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyString_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER + private static class Float64Vec_new_u16 { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + DiplomatU16View.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_u16"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13030,57 +13043,57 @@ private static class MyString_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void MyString_destroy(MyString *self) + * Float64Vec *Float64Vec_new_u16(DiplomatU16View v) * } */ - public static FunctionDescriptor MyString_destroy$descriptor() { - return MyString_destroy.DESC; + public static FunctionDescriptor Float64Vec_new_u16$descriptor() { + return Float64Vec_new_u16.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void MyString_destroy(MyString *self) + * Float64Vec *Float64Vec_new_u16(DiplomatU16View v) * } */ - public static MethodHandle MyString_destroy$handle() { - return MyString_destroy.HANDLE; + public static MethodHandle Float64Vec_new_u16$handle() { + return Float64Vec_new_u16.HANDLE; } /** * Address for: * {@snippet lang=c : - * void MyString_destroy(MyString *self) + * Float64Vec *Float64Vec_new_u16(DiplomatU16View v) * } */ - public static MemorySegment MyString_destroy$address() { - return MyString_destroy.ADDR; + public static MemorySegment Float64Vec_new_u16$address() { + return Float64Vec_new_u16.ADDR; } /** * {@snippet lang=c : - * void MyString_destroy(MyString *self) + * Float64Vec *Float64Vec_new_u16(DiplomatU16View v) * } */ - public static void MyString_destroy(MemorySegment self) { - var mh$ = MyString_destroy.HANDLE; + public static MemorySegment Float64Vec_new_u16(MemorySegment v) { + var mh$ = Float64Vec_new_u16.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyString_destroy", self); + traceDowncall("Float64Vec_new_u16", v); } - mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(v); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Utf16Wrap_from_utf16 { + private static class Float64Vec_new_isize { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - DiplomatString16View.layout() + DiplomatIsizeView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_from_utf16"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_isize"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13088,57 +13101,57 @@ private static class Utf16Wrap_from_utf16 { /** * Function descriptor for: * {@snippet lang=c : - * Utf16Wrap *Utf16Wrap_from_utf16(DiplomatString16View input) + * Float64Vec *Float64Vec_new_isize(DiplomatIsizeView v) * } */ - public static FunctionDescriptor Utf16Wrap_from_utf16$descriptor() { - return Utf16Wrap_from_utf16.DESC; + public static FunctionDescriptor Float64Vec_new_isize$descriptor() { + return Float64Vec_new_isize.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Utf16Wrap *Utf16Wrap_from_utf16(DiplomatString16View input) + * Float64Vec *Float64Vec_new_isize(DiplomatIsizeView v) * } */ - public static MethodHandle Utf16Wrap_from_utf16$handle() { - return Utf16Wrap_from_utf16.HANDLE; + public static MethodHandle Float64Vec_new_isize$handle() { + return Float64Vec_new_isize.HANDLE; } /** * Address for: * {@snippet lang=c : - * Utf16Wrap *Utf16Wrap_from_utf16(DiplomatString16View input) + * Float64Vec *Float64Vec_new_isize(DiplomatIsizeView v) * } */ - public static MemorySegment Utf16Wrap_from_utf16$address() { - return Utf16Wrap_from_utf16.ADDR; + public static MemorySegment Float64Vec_new_isize$address() { + return Float64Vec_new_isize.ADDR; } /** * {@snippet lang=c : - * Utf16Wrap *Utf16Wrap_from_utf16(DiplomatString16View input) + * Float64Vec *Float64Vec_new_isize(DiplomatIsizeView v) * } */ - public static MemorySegment Utf16Wrap_from_utf16(MemorySegment input) { - var mh$ = Utf16Wrap_from_utf16.HANDLE; + public static MemorySegment Float64Vec_new_isize(MemorySegment v) { + var mh$ = Float64Vec_new_isize.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Utf16Wrap_from_utf16", input); + traceDowncall("Float64Vec_new_isize", v); } - return (MemorySegment)mh$.invokeExact(input); + return (MemorySegment)mh$.invokeExact(v); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Utf16Wrap_get_debug_str { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class Float64Vec_new_usize { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - somelib_h.C_POINTER + DiplomatUsizeView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_get_debug_str"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_usize"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13146,57 +13159,57 @@ private static class Utf16Wrap_get_debug_str { /** * Function descriptor for: * {@snippet lang=c : - * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) + * Float64Vec *Float64Vec_new_usize(DiplomatUsizeView v) * } */ - public static FunctionDescriptor Utf16Wrap_get_debug_str$descriptor() { - return Utf16Wrap_get_debug_str.DESC; + public static FunctionDescriptor Float64Vec_new_usize$descriptor() { + return Float64Vec_new_usize.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) + * Float64Vec *Float64Vec_new_usize(DiplomatUsizeView v) * } */ - public static MethodHandle Utf16Wrap_get_debug_str$handle() { - return Utf16Wrap_get_debug_str.HANDLE; + public static MethodHandle Float64Vec_new_usize$handle() { + return Float64Vec_new_usize.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) + * Float64Vec *Float64Vec_new_usize(DiplomatUsizeView v) * } */ - public static MemorySegment Utf16Wrap_get_debug_str$address() { - return Utf16Wrap_get_debug_str.ADDR; + public static MemorySegment Float64Vec_new_usize$address() { + return Float64Vec_new_usize.ADDR; } /** * {@snippet lang=c : - * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) + * Float64Vec *Float64Vec_new_usize(DiplomatUsizeView v) * } */ - public static void Utf16Wrap_get_debug_str(MemorySegment self, MemorySegment write) { - var mh$ = Utf16Wrap_get_debug_str.HANDLE; + public static MemorySegment Float64Vec_new_usize(MemorySegment v) { + var mh$ = Float64Vec_new_usize.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Utf16Wrap_get_debug_str", self, write); + traceDowncall("Float64Vec_new_usize", v); } - mh$.invokeExact(self, write); + return (MemorySegment)mh$.invokeExact(v); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Utf16Wrap_borrow_cont { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - DiplomatString16View.layout(), - somelib_h.C_POINTER + private static class Float64Vec_new_f64_be_bytes { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + DiplomatU8View.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_borrow_cont"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_f64_be_bytes"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13204,56 +13217,57 @@ private static class Utf16Wrap_borrow_cont { /** * Function descriptor for: * {@snippet lang=c : - * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) + * Float64Vec *Float64Vec_new_f64_be_bytes(DiplomatU8View v) * } */ - public static FunctionDescriptor Utf16Wrap_borrow_cont$descriptor() { - return Utf16Wrap_borrow_cont.DESC; + public static FunctionDescriptor Float64Vec_new_f64_be_bytes$descriptor() { + return Float64Vec_new_f64_be_bytes.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) + * Float64Vec *Float64Vec_new_f64_be_bytes(DiplomatU8View v) * } */ - public static MethodHandle Utf16Wrap_borrow_cont$handle() { - return Utf16Wrap_borrow_cont.HANDLE; + public static MethodHandle Float64Vec_new_f64_be_bytes$handle() { + return Float64Vec_new_f64_be_bytes.HANDLE; } /** * Address for: * {@snippet lang=c : - * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) + * Float64Vec *Float64Vec_new_f64_be_bytes(DiplomatU8View v) * } */ - public static MemorySegment Utf16Wrap_borrow_cont$address() { - return Utf16Wrap_borrow_cont.ADDR; + public static MemorySegment Float64Vec_new_f64_be_bytes$address() { + return Float64Vec_new_f64_be_bytes.ADDR; } /** * {@snippet lang=c : - * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) + * Float64Vec *Float64Vec_new_f64_be_bytes(DiplomatU8View v) * } */ - public static MemorySegment Utf16Wrap_borrow_cont(SegmentAllocator allocator, MemorySegment self) { - var mh$ = Utf16Wrap_borrow_cont.HANDLE; + public static MemorySegment Float64Vec_new_f64_be_bytes(MemorySegment v) { + var mh$ = Float64Vec_new_f64_be_bytes.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Utf16Wrap_borrow_cont", allocator, self); + traceDowncall("Float64Vec_new_f64_be_bytes", v); } - return (MemorySegment)mh$.invokeExact(allocator, self); + return (MemorySegment)mh$.invokeExact(v); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Utf16Wrap_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER + private static class Float64Vec_new_from_owned { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + DiplomatF64ViewMut.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_from_owned"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13261,56 +13275,57 @@ private static class Utf16Wrap_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void Utf16Wrap_destroy(Utf16Wrap *self) + * Float64Vec *Float64Vec_new_from_owned(DiplomatF64ViewMut v) * } */ - public static FunctionDescriptor Utf16Wrap_destroy$descriptor() { - return Utf16Wrap_destroy.DESC; + public static FunctionDescriptor Float64Vec_new_from_owned$descriptor() { + return Float64Vec_new_from_owned.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Utf16Wrap_destroy(Utf16Wrap *self) + * Float64Vec *Float64Vec_new_from_owned(DiplomatF64ViewMut v) * } */ - public static MethodHandle Utf16Wrap_destroy$handle() { - return Utf16Wrap_destroy.HANDLE; + public static MethodHandle Float64Vec_new_from_owned$handle() { + return Float64Vec_new_from_owned.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Utf16Wrap_destroy(Utf16Wrap *self) + * Float64Vec *Float64Vec_new_from_owned(DiplomatF64ViewMut v) * } */ - public static MemorySegment Utf16Wrap_destroy$address() { - return Utf16Wrap_destroy.ADDR; + public static MemorySegment Float64Vec_new_from_owned$address() { + return Float64Vec_new_from_owned.ADDR; } /** * {@snippet lang=c : - * void Utf16Wrap_destroy(Utf16Wrap *self) + * Float64Vec *Float64Vec_new_from_owned(DiplomatF64ViewMut v) * } */ - public static void Utf16Wrap_destroy(MemorySegment self) { - var mh$ = Utf16Wrap_destroy.HANDLE; + public static MemorySegment Float64Vec_new_from_owned(MemorySegment v) { + var mh$ = Float64Vec_new_from_owned.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Utf16Wrap_destroy", self); + traceDowncall("Float64Vec_new_from_owned", v); } - mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(v); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Two_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class Float64Vec_as_slice { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + DiplomatF64View.layout(), somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Two_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_as_slice"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13318,55 +13333,57 @@ private static class Two_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void Two_destroy(Two *self) + * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) * } */ - public static FunctionDescriptor Two_destroy$descriptor() { - return Two_destroy.DESC; + public static FunctionDescriptor Float64Vec_as_slice$descriptor() { + return Float64Vec_as_slice.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Two_destroy(Two *self) + * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) * } */ - public static MethodHandle Two_destroy$handle() { - return Two_destroy.HANDLE; + public static MethodHandle Float64Vec_as_slice$handle() { + return Float64Vec_as_slice.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Two_destroy(Two *self) + * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) * } */ - public static MemorySegment Two_destroy$address() { - return Two_destroy.ADDR; + public static MemorySegment Float64Vec_as_slice$address() { + return Float64Vec_as_slice.ADDR; } /** * {@snippet lang=c : - * void Two_destroy(Two *self) + * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) * } */ - public static void Two_destroy(MemorySegment self) { - var mh$ = Two_destroy.HANDLE; + public static MemorySegment Float64Vec_as_slice(SegmentAllocator allocator, MemorySegment self) { + var mh$ = Float64Vec_as_slice.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Two_destroy", self); + traceDowncall("Float64Vec_as_slice", allocator, self); } - mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(allocator, self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class CyclicStructA_get_b { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - CyclicStructB.layout() ); + private static class Float64Vec_fill_slice { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, + DiplomatF64ViewMut.layout() + ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("CyclicStructA_get_b"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_fill_slice"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13374,55 +13391,57 @@ private static class CyclicStructA_get_b { /** * Function descriptor for: * {@snippet lang=c : - * CyclicStructB CyclicStructA_get_b() + * void Float64Vec_fill_slice(const Float64Vec *self, DiplomatF64ViewMut v) * } */ - public static FunctionDescriptor CyclicStructA_get_b$descriptor() { - return CyclicStructA_get_b.DESC; + public static FunctionDescriptor Float64Vec_fill_slice$descriptor() { + return Float64Vec_fill_slice.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * CyclicStructB CyclicStructA_get_b() + * void Float64Vec_fill_slice(const Float64Vec *self, DiplomatF64ViewMut v) * } */ - public static MethodHandle CyclicStructA_get_b$handle() { - return CyclicStructA_get_b.HANDLE; + public static MethodHandle Float64Vec_fill_slice$handle() { + return Float64Vec_fill_slice.HANDLE; } /** * Address for: * {@snippet lang=c : - * CyclicStructB CyclicStructA_get_b() + * void Float64Vec_fill_slice(const Float64Vec *self, DiplomatF64ViewMut v) * } */ - public static MemorySegment CyclicStructA_get_b$address() { - return CyclicStructA_get_b.ADDR; + public static MemorySegment Float64Vec_fill_slice$address() { + return Float64Vec_fill_slice.ADDR; } /** * {@snippet lang=c : - * CyclicStructB CyclicStructA_get_b() + * void Float64Vec_fill_slice(const Float64Vec *self, DiplomatF64ViewMut v) * } */ - public static MemorySegment CyclicStructA_get_b(SegmentAllocator allocator) { - var mh$ = CyclicStructA_get_b.HANDLE; + public static void Float64Vec_fill_slice(MemorySegment self, MemorySegment v) { + var mh$ = Float64Vec_fill_slice.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("CyclicStructA_get_b", allocator); + traceDowncall("Float64Vec_fill_slice", self, v); } - return (MemorySegment)mh$.invokeExact(allocator); + mh$.invokeExact(self, v); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class CyclicStructB_get_a { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - CyclicStructA.layout() ); + private static class Float64Vec_set_value { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, + DiplomatF64View.layout() + ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("CyclicStructB_get_a"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_set_value"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13430,57 +13449,57 @@ private static class CyclicStructB_get_a { /** * Function descriptor for: * {@snippet lang=c : - * CyclicStructA CyclicStructB_get_a() + * void Float64Vec_set_value(Float64Vec *self, DiplomatF64View new_slice) * } */ - public static FunctionDescriptor CyclicStructB_get_a$descriptor() { - return CyclicStructB_get_a.DESC; + public static FunctionDescriptor Float64Vec_set_value$descriptor() { + return Float64Vec_set_value.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * CyclicStructA CyclicStructB_get_a() + * void Float64Vec_set_value(Float64Vec *self, DiplomatF64View new_slice) * } */ - public static MethodHandle CyclicStructB_get_a$handle() { - return CyclicStructB_get_a.HANDLE; + public static MethodHandle Float64Vec_set_value$handle() { + return Float64Vec_set_value.HANDLE; } /** * Address for: * {@snippet lang=c : - * CyclicStructA CyclicStructB_get_a() + * void Float64Vec_set_value(Float64Vec *self, DiplomatF64View new_slice) * } */ - public static MemorySegment CyclicStructB_get_a$address() { - return CyclicStructB_get_a.ADDR; + public static MemorySegment Float64Vec_set_value$address() { + return Float64Vec_set_value.ADDR; } /** * {@snippet lang=c : - * CyclicStructA CyclicStructB_get_a() + * void Float64Vec_set_value(Float64Vec *self, DiplomatF64View new_slice) * } */ - public static MemorySegment CyclicStructB_get_a(SegmentAllocator allocator) { - var mh$ = CyclicStructB_get_a.HANDLE; + public static void Float64Vec_set_value(MemorySegment self, MemorySegment new_slice) { + var mh$ = Float64Vec_set_value.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("CyclicStructB_get_a", allocator); + traceDowncall("Float64Vec_set_value", self, new_slice); } - return (MemorySegment)mh$.invokeExact(allocator); + mh$.invokeExact(self, new_slice); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Foo_new { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( + private static class Float64Vec_to_string { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER, - DiplomatStringView.layout() + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_new"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_to_string"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13488,57 +13507,57 @@ private static class Foo_new { /** * Function descriptor for: * {@snippet lang=c : - * Foo *Foo_new(DiplomatStringView x) + * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) * } */ - public static FunctionDescriptor Foo_new$descriptor() { - return Foo_new.DESC; + public static FunctionDescriptor Float64Vec_to_string$descriptor() { + return Float64Vec_to_string.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Foo *Foo_new(DiplomatStringView x) + * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) * } */ - public static MethodHandle Foo_new$handle() { - return Foo_new.HANDLE; + public static MethodHandle Float64Vec_to_string$handle() { + return Float64Vec_to_string.HANDLE; } /** * Address for: * {@snippet lang=c : - * Foo *Foo_new(DiplomatStringView x) + * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) * } */ - public static MemorySegment Foo_new$address() { - return Foo_new.ADDR; + public static MemorySegment Float64Vec_to_string$address() { + return Float64Vec_to_string.ADDR; } /** * {@snippet lang=c : - * Foo *Foo_new(DiplomatStringView x) + * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) * } */ - public static MemorySegment Foo_new(MemorySegment x) { - var mh$ = Foo_new.HANDLE; + public static void Float64Vec_to_string(MemorySegment self, MemorySegment write) { + var mh$ = Float64Vec_to_string.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Foo_new", x); + traceDowncall("Float64Vec_to_string", self, write); } - return (MemorySegment)mh$.invokeExact(x); + mh$.invokeExact(self, write); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Foo_get_bar { + private static class Float64Vec_borrow { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, + DiplomatF64View.layout(), somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_get_bar"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_borrow"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13546,57 +13565,56 @@ private static class Foo_get_bar { /** * Function descriptor for: * {@snippet lang=c : - * Bar *Foo_get_bar(const Foo *self) + * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) * } */ - public static FunctionDescriptor Foo_get_bar$descriptor() { - return Foo_get_bar.DESC; + public static FunctionDescriptor Float64Vec_borrow$descriptor() { + return Float64Vec_borrow.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Bar *Foo_get_bar(const Foo *self) + * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) * } */ - public static MethodHandle Foo_get_bar$handle() { - return Foo_get_bar.HANDLE; + public static MethodHandle Float64Vec_borrow$handle() { + return Float64Vec_borrow.HANDLE; } /** * Address for: * {@snippet lang=c : - * Bar *Foo_get_bar(const Foo *self) + * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) * } */ - public static MemorySegment Foo_get_bar$address() { - return Foo_get_bar.ADDR; + public static MemorySegment Float64Vec_borrow$address() { + return Float64Vec_borrow.ADDR; } /** * {@snippet lang=c : - * Bar *Foo_get_bar(const Foo *self) + * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) * } */ - public static MemorySegment Foo_get_bar(MemorySegment self) { - var mh$ = Foo_get_bar.HANDLE; + public static MemorySegment Float64Vec_borrow(SegmentAllocator allocator, MemorySegment self) { + var mh$ = Float64Vec_borrow.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Foo_get_bar", self); + traceDowncall("Float64Vec_borrow", allocator, self); } - return (MemorySegment)mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(allocator, self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Foo_as_returning { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - BorrowedFieldsReturning.layout(), + private static class Float64Vec_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_as_returning"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13604,116 +13622,93 @@ private static class Foo_as_returning { /** * Function descriptor for: * {@snippet lang=c : - * BorrowedFieldsReturning Foo_as_returning(const Foo *self) + * void Float64Vec_destroy(Float64Vec *self) * } */ - public static FunctionDescriptor Foo_as_returning$descriptor() { - return Foo_as_returning.DESC; + public static FunctionDescriptor Float64Vec_destroy$descriptor() { + return Float64Vec_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * BorrowedFieldsReturning Foo_as_returning(const Foo *self) + * void Float64Vec_destroy(Float64Vec *self) * } */ - public static MethodHandle Foo_as_returning$handle() { - return Foo_as_returning.HANDLE; + public static MethodHandle Float64Vec_destroy$handle() { + return Float64Vec_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * BorrowedFieldsReturning Foo_as_returning(const Foo *self) + * void Float64Vec_destroy(Float64Vec *self) * } */ - public static MemorySegment Foo_as_returning$address() { - return Foo_as_returning.ADDR; + public static MemorySegment Float64Vec_destroy$address() { + return Float64Vec_destroy.ADDR; } /** * {@snippet lang=c : - * BorrowedFieldsReturning Foo_as_returning(const Foo *self) + * void Float64Vec_destroy(Float64Vec *self) * } */ - public static MemorySegment Foo_as_returning(SegmentAllocator allocator, MemorySegment self) { - var mh$ = Foo_as_returning.HANDLE; + public static void Float64Vec_destroy(MemorySegment self) { + var mh$ = Float64Vec_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Foo_as_returning", allocator, self); + traceDowncall("Float64Vec_destroy", self); } - return (MemorySegment)mh$.invokeExact(allocator, self); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - - private static class Foo_extract_from_fields { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - BorrowedFields.layout() - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_extract_from_fields"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - + private static final int ContiguousEnum_C = (int)0L; /** - * Function descriptor for: * {@snippet lang=c : - * Foo *Foo_extract_from_fields(BorrowedFields fields) + * enum ContiguousEnum.ContiguousEnum_C = 0 * } */ - public static FunctionDescriptor Foo_extract_from_fields$descriptor() { - return Foo_extract_from_fields.DESC; + public static int ContiguousEnum_C() { + return ContiguousEnum_C; } - + private static final int ContiguousEnum_D = (int)1L; /** - * Downcall method handle for: * {@snippet lang=c : - * Foo *Foo_extract_from_fields(BorrowedFields fields) + * enum ContiguousEnum.ContiguousEnum_D = 1 * } */ - public static MethodHandle Foo_extract_from_fields$handle() { - return Foo_extract_from_fields.HANDLE; + public static int ContiguousEnum_D() { + return ContiguousEnum_D; } - + private static final int ContiguousEnum_E = (int)2L; /** - * Address for: * {@snippet lang=c : - * Foo *Foo_extract_from_fields(BorrowedFields fields) + * enum ContiguousEnum.ContiguousEnum_E = 2 * } */ - public static MemorySegment Foo_extract_from_fields$address() { - return Foo_extract_from_fields.ADDR; + public static int ContiguousEnum_E() { + return ContiguousEnum_E; } - + private static final int ContiguousEnum_F = (int)3L; /** * {@snippet lang=c : - * Foo *Foo_extract_from_fields(BorrowedFields fields) + * enum ContiguousEnum.ContiguousEnum_F = 3 * } */ - public static MemorySegment Foo_extract_from_fields(MemorySegment fields) { - var mh$ = Foo_extract_from_fields.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("Foo_extract_from_fields", fields); - } - return (MemorySegment)mh$.invokeExact(fields); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } + public static int ContiguousEnum_F() { + return ContiguousEnum_F; } - private static class Foo_extract_from_bounds { + private static class Utf16Wrap_from_utf16 { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - BorrowedFieldsWithBounds.layout(), - DiplomatStringView.layout() + DiplomatString16View.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_extract_from_bounds"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_from_utf16"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13721,56 +13716,57 @@ private static class Foo_extract_from_bounds { /** * Function descriptor for: * {@snippet lang=c : - * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, DiplomatStringView another_string) + * Utf16Wrap *Utf16Wrap_from_utf16(DiplomatString16View input) * } */ - public static FunctionDescriptor Foo_extract_from_bounds$descriptor() { - return Foo_extract_from_bounds.DESC; + public static FunctionDescriptor Utf16Wrap_from_utf16$descriptor() { + return Utf16Wrap_from_utf16.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, DiplomatStringView another_string) + * Utf16Wrap *Utf16Wrap_from_utf16(DiplomatString16View input) * } */ - public static MethodHandle Foo_extract_from_bounds$handle() { - return Foo_extract_from_bounds.HANDLE; + public static MethodHandle Utf16Wrap_from_utf16$handle() { + return Utf16Wrap_from_utf16.HANDLE; } /** * Address for: * {@snippet lang=c : - * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, DiplomatStringView another_string) + * Utf16Wrap *Utf16Wrap_from_utf16(DiplomatString16View input) * } */ - public static MemorySegment Foo_extract_from_bounds$address() { - return Foo_extract_from_bounds.ADDR; + public static MemorySegment Utf16Wrap_from_utf16$address() { + return Utf16Wrap_from_utf16.ADDR; } /** * {@snippet lang=c : - * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, DiplomatStringView another_string) + * Utf16Wrap *Utf16Wrap_from_utf16(DiplomatString16View input) * } */ - public static MemorySegment Foo_extract_from_bounds(MemorySegment bounds, MemorySegment another_string) { - var mh$ = Foo_extract_from_bounds.HANDLE; + public static MemorySegment Utf16Wrap_from_utf16(MemorySegment input) { + var mh$ = Utf16Wrap_from_utf16.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Foo_extract_from_bounds", bounds, another_string); + traceDowncall("Utf16Wrap_from_utf16", input); } - return (MemorySegment)mh$.invokeExact(bounds, another_string); + return (MemorySegment)mh$.invokeExact(input); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Foo_destroy { + private static class Utf16Wrap_get_debug_str { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_get_debug_str"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13778,59 +13774,57 @@ private static class Foo_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void Foo_destroy(Foo *self) + * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) * } */ - public static FunctionDescriptor Foo_destroy$descriptor() { - return Foo_destroy.DESC; + public static FunctionDescriptor Utf16Wrap_get_debug_str$descriptor() { + return Utf16Wrap_get_debug_str.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Foo_destroy(Foo *self) + * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) * } */ - public static MethodHandle Foo_destroy$handle() { - return Foo_destroy.HANDLE; + public static MethodHandle Utf16Wrap_get_debug_str$handle() { + return Utf16Wrap_get_debug_str.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Foo_destroy(Foo *self) + * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) * } */ - public static MemorySegment Foo_destroy$address() { - return Foo_destroy.ADDR; + public static MemorySegment Utf16Wrap_get_debug_str$address() { + return Utf16Wrap_get_debug_str.ADDR; } /** * {@snippet lang=c : - * void Foo_destroy(Foo *self) + * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) * } */ - public static void Foo_destroy(MemorySegment self) { - var mh$ = Foo_destroy.HANDLE; + public static void Utf16Wrap_get_debug_str(MemorySegment self, MemorySegment write) { + var mh$ = Utf16Wrap_get_debug_str.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Foo_destroy", self); + traceDowncall("Utf16Wrap_get_debug_str", self, write); } - mh$.invokeExact(self); + mh$.invokeExact(self, write); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class BorrowedFields_from_bar_and_strings { + private static class Utf16Wrap_borrow_cont { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - BorrowedFields.layout(), - somelib_h.C_POINTER, DiplomatString16View.layout(), - DiplomatStringView.layout() + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("BorrowedFields_from_bar_and_strings"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_borrow_cont"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13838,55 +13832,56 @@ private static class BorrowedFields_from_bar_and_strings { /** * Function descriptor for: * {@snippet lang=c : - * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, DiplomatString16View dstr16, DiplomatStringView utf8_str) + * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) * } */ - public static FunctionDescriptor BorrowedFields_from_bar_and_strings$descriptor() { - return BorrowedFields_from_bar_and_strings.DESC; + public static FunctionDescriptor Utf16Wrap_borrow_cont$descriptor() { + return Utf16Wrap_borrow_cont.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, DiplomatString16View dstr16, DiplomatStringView utf8_str) + * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) * } */ - public static MethodHandle BorrowedFields_from_bar_and_strings$handle() { - return BorrowedFields_from_bar_and_strings.HANDLE; + public static MethodHandle Utf16Wrap_borrow_cont$handle() { + return Utf16Wrap_borrow_cont.HANDLE; } /** * Address for: * {@snippet lang=c : - * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, DiplomatString16View dstr16, DiplomatStringView utf8_str) + * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) * } */ - public static MemorySegment BorrowedFields_from_bar_and_strings$address() { - return BorrowedFields_from_bar_and_strings.ADDR; + public static MemorySegment Utf16Wrap_borrow_cont$address() { + return Utf16Wrap_borrow_cont.ADDR; } /** * {@snippet lang=c : - * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, DiplomatString16View dstr16, DiplomatStringView utf8_str) + * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) * } */ - public static MemorySegment BorrowedFields_from_bar_and_strings(SegmentAllocator allocator, MemorySegment bar, MemorySegment dstr16, MemorySegment utf8_str) { - var mh$ = BorrowedFields_from_bar_and_strings.HANDLE; + public static MemorySegment Utf16Wrap_borrow_cont(SegmentAllocator allocator, MemorySegment self) { + var mh$ = Utf16Wrap_borrow_cont.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("BorrowedFields_from_bar_and_strings", allocator, bar, dstr16, utf8_str); + traceDowncall("Utf16Wrap_borrow_cont", allocator, self); } - return (MemorySegment)mh$.invokeExact(allocator, bar, dstr16, utf8_str); + return (MemorySegment)mh$.invokeExact(allocator, self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Opaque_new { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER ); + private static class Utf16Wrap_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_new"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13894,57 +13889,57 @@ private static class Opaque_new { /** * Function descriptor for: * {@snippet lang=c : - * Opaque *Opaque_new() + * void Utf16Wrap_destroy(Utf16Wrap *self) * } */ - public static FunctionDescriptor Opaque_new$descriptor() { - return Opaque_new.DESC; + public static FunctionDescriptor Utf16Wrap_destroy$descriptor() { + return Utf16Wrap_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Opaque *Opaque_new() + * void Utf16Wrap_destroy(Utf16Wrap *self) * } */ - public static MethodHandle Opaque_new$handle() { - return Opaque_new.HANDLE; + public static MethodHandle Utf16Wrap_destroy$handle() { + return Utf16Wrap_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * Opaque *Opaque_new() + * void Utf16Wrap_destroy(Utf16Wrap *self) * } */ - public static MemorySegment Opaque_new$address() { - return Opaque_new.ADDR; + public static MemorySegment Utf16Wrap_destroy$address() { + return Utf16Wrap_destroy.ADDR; } /** * {@snippet lang=c : - * Opaque *Opaque_new() + * void Utf16Wrap_destroy(Utf16Wrap *self) * } */ - public static MemorySegment Opaque_new() { - var mh$ = Opaque_new.HANDLE; + public static void Utf16Wrap_destroy(MemorySegment self) { + var mh$ = Utf16Wrap_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_new"); + traceDowncall("Utf16Wrap_destroy", self); } - return (MemorySegment)mh$.invokeExact(); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Opaque_from_str { + private static class Foo_new { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, DiplomatStringView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_from_str"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_new"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13952,57 +13947,57 @@ private static class Opaque_from_str { /** * Function descriptor for: * {@snippet lang=c : - * Opaque *Opaque_from_str(DiplomatStringView input) + * Foo *Foo_new(DiplomatStringView x) * } */ - public static FunctionDescriptor Opaque_from_str$descriptor() { - return Opaque_from_str.DESC; + public static FunctionDescriptor Foo_new$descriptor() { + return Foo_new.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Opaque *Opaque_from_str(DiplomatStringView input) + * Foo *Foo_new(DiplomatStringView x) * } */ - public static MethodHandle Opaque_from_str$handle() { - return Opaque_from_str.HANDLE; + public static MethodHandle Foo_new$handle() { + return Foo_new.HANDLE; } /** * Address for: * {@snippet lang=c : - * Opaque *Opaque_from_str(DiplomatStringView input) + * Foo *Foo_new(DiplomatStringView x) * } */ - public static MemorySegment Opaque_from_str$address() { - return Opaque_from_str.ADDR; + public static MemorySegment Foo_new$address() { + return Foo_new.ADDR; } /** * {@snippet lang=c : - * Opaque *Opaque_from_str(DiplomatStringView input) + * Foo *Foo_new(DiplomatStringView x) * } */ - public static MemorySegment Opaque_from_str(MemorySegment input) { - var mh$ = Opaque_from_str.HANDLE; + public static MemorySegment Foo_new(MemorySegment x) { + var mh$ = Foo_new.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_from_str", input); + traceDowncall("Foo_new", x); } - return (MemorySegment)mh$.invokeExact(input); + return (MemorySegment)mh$.invokeExact(x); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Opaque_get_debug_str { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class Foo_get_bar { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_get_debug_str"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_get_bar"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14010,57 +14005,57 @@ private static class Opaque_get_debug_str { /** * Function descriptor for: * {@snippet lang=c : - * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) + * Bar *Foo_get_bar(const Foo *self) * } */ - public static FunctionDescriptor Opaque_get_debug_str$descriptor() { - return Opaque_get_debug_str.DESC; + public static FunctionDescriptor Foo_get_bar$descriptor() { + return Foo_get_bar.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) + * Bar *Foo_get_bar(const Foo *self) * } */ - public static MethodHandle Opaque_get_debug_str$handle() { - return Opaque_get_debug_str.HANDLE; + public static MethodHandle Foo_get_bar$handle() { + return Foo_get_bar.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) + * Bar *Foo_get_bar(const Foo *self) * } */ - public static MemorySegment Opaque_get_debug_str$address() { - return Opaque_get_debug_str.ADDR; + public static MemorySegment Foo_get_bar$address() { + return Foo_get_bar.ADDR; } /** * {@snippet lang=c : - * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) + * Bar *Foo_get_bar(const Foo *self) * } */ - public static void Opaque_get_debug_str(MemorySegment self, MemorySegment write) { - var mh$ = Opaque_get_debug_str.HANDLE; + public static MemorySegment Foo_get_bar(MemorySegment self) { + var mh$ = Foo_get_bar.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_get_debug_str", self, write); + traceDowncall("Foo_get_bar", self); } - mh$.invokeExact(self, write); + return (MemorySegment)mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Opaque_assert_struct { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER, - MyStruct.layout() + private static class Foo_as_returning { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + BorrowedFieldsReturning.layout(), + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_assert_struct"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_as_returning"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14068,55 +14063,57 @@ private static class Opaque_assert_struct { /** * Function descriptor for: * {@snippet lang=c : - * void Opaque_assert_struct(const Opaque *self, MyStruct s) + * BorrowedFieldsReturning Foo_as_returning(const Foo *self) * } */ - public static FunctionDescriptor Opaque_assert_struct$descriptor() { - return Opaque_assert_struct.DESC; + public static FunctionDescriptor Foo_as_returning$descriptor() { + return Foo_as_returning.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Opaque_assert_struct(const Opaque *self, MyStruct s) + * BorrowedFieldsReturning Foo_as_returning(const Foo *self) * } */ - public static MethodHandle Opaque_assert_struct$handle() { - return Opaque_assert_struct.HANDLE; + public static MethodHandle Foo_as_returning$handle() { + return Foo_as_returning.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Opaque_assert_struct(const Opaque *self, MyStruct s) + * BorrowedFieldsReturning Foo_as_returning(const Foo *self) * } */ - public static MemorySegment Opaque_assert_struct$address() { - return Opaque_assert_struct.ADDR; + public static MemorySegment Foo_as_returning$address() { + return Foo_as_returning.ADDR; } /** * {@snippet lang=c : - * void Opaque_assert_struct(const Opaque *self, MyStruct s) + * BorrowedFieldsReturning Foo_as_returning(const Foo *self) * } */ - public static void Opaque_assert_struct(MemorySegment self, MemorySegment s) { - var mh$ = Opaque_assert_struct.HANDLE; + public static MemorySegment Foo_as_returning(SegmentAllocator allocator, MemorySegment self) { + var mh$ = Foo_as_returning.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_assert_struct", self, s); + traceDowncall("Foo_as_returning", allocator, self); } - mh$.invokeExact(self, s); + return (MemorySegment)mh$.invokeExact(allocator, self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Opaque_returns_usize { + private static class Foo_extract_from_fields { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_LONG ); + somelib_h.C_POINTER, + BorrowedFields.layout() + ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_returns_usize"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_extract_from_fields"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14124,57 +14121,58 @@ private static class Opaque_returns_usize { /** * Function descriptor for: * {@snippet lang=c : - * size_t Opaque_returns_usize() + * Foo *Foo_extract_from_fields(BorrowedFields fields) * } */ - public static FunctionDescriptor Opaque_returns_usize$descriptor() { - return Opaque_returns_usize.DESC; + public static FunctionDescriptor Foo_extract_from_fields$descriptor() { + return Foo_extract_from_fields.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * size_t Opaque_returns_usize() + * Foo *Foo_extract_from_fields(BorrowedFields fields) * } */ - public static MethodHandle Opaque_returns_usize$handle() { - return Opaque_returns_usize.HANDLE; + public static MethodHandle Foo_extract_from_fields$handle() { + return Foo_extract_from_fields.HANDLE; } /** * Address for: * {@snippet lang=c : - * size_t Opaque_returns_usize() + * Foo *Foo_extract_from_fields(BorrowedFields fields) * } */ - public static MemorySegment Opaque_returns_usize$address() { - return Opaque_returns_usize.ADDR; + public static MemorySegment Foo_extract_from_fields$address() { + return Foo_extract_from_fields.ADDR; } /** * {@snippet lang=c : - * size_t Opaque_returns_usize() + * Foo *Foo_extract_from_fields(BorrowedFields fields) * } */ - public static long Opaque_returns_usize() { - var mh$ = Opaque_returns_usize.HANDLE; + public static MemorySegment Foo_extract_from_fields(MemorySegment fields) { + var mh$ = Foo_extract_from_fields.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_returns_usize"); + traceDowncall("Foo_extract_from_fields", fields); } - return (long)mh$.invokeExact(); + return (MemorySegment)mh$.invokeExact(fields); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Opaque_internal_len { + private static class Foo_extract_from_bounds { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_LONG, - somelib_h.C_POINTER + somelib_h.C_POINTER, + BorrowedFieldsWithBounds.layout(), + DiplomatStringView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_internal_len"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_extract_from_bounds"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14182,55 +14180,56 @@ private static class Opaque_internal_len { /** * Function descriptor for: * {@snippet lang=c : - * size_t Opaque_internal_len(const Opaque *self) + * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, DiplomatStringView another_string) * } */ - public static FunctionDescriptor Opaque_internal_len$descriptor() { - return Opaque_internal_len.DESC; + public static FunctionDescriptor Foo_extract_from_bounds$descriptor() { + return Foo_extract_from_bounds.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * size_t Opaque_internal_len(const Opaque *self) + * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, DiplomatStringView another_string) * } */ - public static MethodHandle Opaque_internal_len$handle() { - return Opaque_internal_len.HANDLE; + public static MethodHandle Foo_extract_from_bounds$handle() { + return Foo_extract_from_bounds.HANDLE; } /** * Address for: * {@snippet lang=c : - * size_t Opaque_internal_len(const Opaque *self) + * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, DiplomatStringView another_string) * } */ - public static MemorySegment Opaque_internal_len$address() { - return Opaque_internal_len.ADDR; + public static MemorySegment Foo_extract_from_bounds$address() { + return Foo_extract_from_bounds.ADDR; } /** * {@snippet lang=c : - * size_t Opaque_internal_len(const Opaque *self) + * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, DiplomatStringView another_string) * } */ - public static long Opaque_internal_len(MemorySegment self) { - var mh$ = Opaque_internal_len.HANDLE; + public static MemorySegment Foo_extract_from_bounds(MemorySegment bounds, MemorySegment another_string) { + var mh$ = Foo_extract_from_bounds.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_internal_len", self); + traceDowncall("Foo_extract_from_bounds", bounds, another_string); } - return (long)mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(bounds, another_string); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Opaque_returns_imported { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - ImportedStruct.layout() ); + private static class Foo_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_returns_imported"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14238,55 +14237,57 @@ private static class Opaque_returns_imported { /** * Function descriptor for: * {@snippet lang=c : - * ImportedStruct Opaque_returns_imported() + * void Foo_destroy(Foo *self) * } */ - public static FunctionDescriptor Opaque_returns_imported$descriptor() { - return Opaque_returns_imported.DESC; + public static FunctionDescriptor Foo_destroy$descriptor() { + return Foo_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * ImportedStruct Opaque_returns_imported() + * void Foo_destroy(Foo *self) * } */ - public static MethodHandle Opaque_returns_imported$handle() { - return Opaque_returns_imported.HANDLE; + public static MethodHandle Foo_destroy$handle() { + return Foo_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * ImportedStruct Opaque_returns_imported() + * void Foo_destroy(Foo *self) * } */ - public static MemorySegment Opaque_returns_imported$address() { - return Opaque_returns_imported.ADDR; + public static MemorySegment Foo_destroy$address() { + return Foo_destroy.ADDR; } /** * {@snippet lang=c : - * ImportedStruct Opaque_returns_imported() + * void Foo_destroy(Foo *self) * } */ - public static MemorySegment Opaque_returns_imported(SegmentAllocator allocator) { - var mh$ = Opaque_returns_imported.HANDLE; + public static void Foo_destroy(MemorySegment self) { + var mh$ = Foo_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_returns_imported", allocator); + traceDowncall("Foo_destroy", self); } - return (MemorySegment)mh$.invokeExact(allocator); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Opaque_cmp { + private static class MyEnum_into_value { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_CHAR ); + somelib_h.C_CHAR, + somelib_h.C_INT + ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_cmp"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyEnum_into_value"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14294,56 +14295,55 @@ private static class Opaque_cmp { /** * Function descriptor for: * {@snippet lang=c : - * int8_t Opaque_cmp() + * int8_t MyEnum_into_value(MyEnum self) * } */ - public static FunctionDescriptor Opaque_cmp$descriptor() { - return Opaque_cmp.DESC; + public static FunctionDescriptor MyEnum_into_value$descriptor() { + return MyEnum_into_value.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int8_t Opaque_cmp() + * int8_t MyEnum_into_value(MyEnum self) * } */ - public static MethodHandle Opaque_cmp$handle() { - return Opaque_cmp.HANDLE; + public static MethodHandle MyEnum_into_value$handle() { + return MyEnum_into_value.HANDLE; } /** * Address for: * {@snippet lang=c : - * int8_t Opaque_cmp() + * int8_t MyEnum_into_value(MyEnum self) * } */ - public static MemorySegment Opaque_cmp$address() { - return Opaque_cmp.ADDR; + public static MemorySegment MyEnum_into_value$address() { + return MyEnum_into_value.ADDR; } /** * {@snippet lang=c : - * int8_t Opaque_cmp() + * int8_t MyEnum_into_value(MyEnum self) * } */ - public static byte Opaque_cmp() { - var mh$ = Opaque_cmp.HANDLE; + public static byte MyEnum_into_value(int self) { + var mh$ = MyEnum_into_value.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_cmp"); + traceDowncall("MyEnum_into_value", self); } - return (byte)mh$.invokeExact(); + return (byte)mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Opaque_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER - ); + private static class MyEnum_get_a { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyEnum_get_a"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14351,45 +14351,45 @@ private static class Opaque_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void Opaque_destroy(Opaque *self) + * MyEnum MyEnum_get_a() * } */ - public static FunctionDescriptor Opaque_destroy$descriptor() { - return Opaque_destroy.DESC; + public static FunctionDescriptor MyEnum_get_a$descriptor() { + return MyEnum_get_a.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Opaque_destroy(Opaque *self) + * MyEnum MyEnum_get_a() * } */ - public static MethodHandle Opaque_destroy$handle() { - return Opaque_destroy.HANDLE; + public static MethodHandle MyEnum_get_a$handle() { + return MyEnum_get_a.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Opaque_destroy(Opaque *self) + * MyEnum MyEnum_get_a() * } */ - public static MemorySegment Opaque_destroy$address() { - return Opaque_destroy.ADDR; + public static MemorySegment MyEnum_get_a$address() { + return MyEnum_get_a.ADDR; } /** * {@snippet lang=c : - * void Opaque_destroy(Opaque *self) + * MyEnum MyEnum_get_a() * } */ - public static void Opaque_destroy(MemorySegment self) { - var mh$ = Opaque_destroy.HANDLE; + public static int MyEnum_get_a() { + var mh$ = MyEnum_get_a.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_destroy", self); + traceDowncall("MyEnum_get_a"); } - mh$.invokeExact(self); + return (int)mh$.invokeExact(); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -15491,13 +15491,13 @@ public static int SIG_ATOMIC_MAX() { } /** * {@snippet lang=c : - * #define __ASSERT_FILE_NAME "jextract$11772684471921758602.h" + * #define __ASSERT_FILE_NAME "jextract$14714335586850159878.h" * } */ public static MemorySegment __ASSERT_FILE_NAME() { class Holder { static final MemorySegment __ASSERT_FILE_NAME - = somelib_h.LIBRARY_ARENA.allocateFrom("jextract$11772684471921758602.h"); + = somelib_h.LIBRARY_ARENA.allocateFrom("jextract$14714335586850159878.h"); } return Holder.__ASSERT_FILE_NAME; } diff --git a/tool/templates/java/Lib.java.jinja b/tool/templates/java/Lib.java.jinja index ab5eca85e..bcaa02151 100644 --- a/tool/templates/java/Lib.java.jinja +++ b/tool/templates/java/Lib.java.jinja @@ -11,36 +11,6 @@ import java.util.Arrays; import static java.lang.foreign.ValueLayout.*; public class Lib { - - public sealed interface Result { - boolean isOk = false; - } - public final class Ok implements Result { - boolean isOk = true; - T value; - public Ok(T value) { - value = value; - } - } - public final class Err implements Result { - boolean isOk = false; - E err; - public Err(E err) { - err = err; - } - } - - class ResBuilder { - ResBuilder() {} - Ok Ok(T value) { - return Ok(value); - } - Err Err(E err) { - return Err(err); - } - } - - class Unit {} static final Cleaner cleaner = Cleaner.create(); } From 41becfa7d021be0b68147eeb1d24fa26be254164 Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Sat, 7 Sep 2024 13:46:48 +0200 Subject: [PATCH 55/69] panama-backend - only generate code for attr enabled files / use arenas to convert structs to native --- .../diplomattest/somelib/BorrowedFields.java | 13 +- .../somelib/BorrowedFieldsReturning.java | 11 +- .../somelib/BorrowedFieldsWithBounds.java | 13 +- .../diplomattest/somelib/CyclicStructA.java | 11 +- .../diplomattest/somelib/CyclicStructB.java | 11 +- .../dev/diplomattest/somelib/ErrorStruct.java | 12 +- .../java/dev/diplomattest/somelib/Foo.java | 4 +- .../diplomattest/somelib/ImportedStruct.java | 12 +- .../java/dev/diplomattest/somelib/Lib.java | 17 + .../dev/diplomattest/somelib/MyStruct.java | 17 +- .../java/dev/diplomattest/somelib/MyZst.java | 2 +- .../somelib/NestedBorrowedFields.java | 13 +- .../java/dev/diplomattest/somelib/Opaque.java | 10 +- .../diplomattest/somelib/ntv/somelib_h.java | 6210 ++++++++--------- tool/src/c/mod.rs | 8 +- tool/src/java/mod.rs | 299 +- tool/templates/java/Lib.java.jinja | 17 + tool/templates/java/Struct.java.jinja | 16 +- 18 files changed, 3449 insertions(+), 3247 deletions(-) diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/BorrowedFields.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/BorrowedFields.java index 533d6a40b..f7a9a605d 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/BorrowedFields.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/BorrowedFields.java @@ -17,7 +17,6 @@ public class BorrowedFields { String c; - MemorySegment internal; SegmentAllocator arena; List selfEdges = List.of(); List aEdges = List.of(); @@ -38,6 +37,18 @@ private BorrowedFields(SegmentAllocator arena) { this.c = SliceUtils.readUtf8(dev.diplomattest.somelib.ntv.BorrowedFields.c(structSegment)); + } + + MemorySegment toNative(SegmentAllocator arena) { + var returnVal = dev.diplomattest.somelib.ntv.BorrowedFields.allocate(arena); + + dev.diplomattest.somelib.ntv.BorrowedFields.a(returnVal, SliceUtils.strToUtf16Slice(arena, this.a)); + dev.diplomattest.somelib.ntv.BorrowedFields.b(returnVal, SliceUtils.strToUtf8Slice(arena, this.b)); + dev.diplomattest.somelib.ntv.BorrowedFields.c(returnVal, SliceUtils.strToUtf8Slice(arena, this.c)); + + + return returnVal; + } public static BorrowedFields fromBarAndStrings(Bar bar,String dstr16,String utf8Str) { diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/BorrowedFieldsReturning.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/BorrowedFieldsReturning.java index e450e9f50..e3f1a1a8a 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/BorrowedFieldsReturning.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/BorrowedFieldsReturning.java @@ -15,7 +15,6 @@ public class BorrowedFieldsReturning { String bytes; - MemorySegment internal; SegmentAllocator arena; List selfEdges = List.of(); List aEdges = List.of(); @@ -35,6 +34,16 @@ private BorrowedFieldsReturning(SegmentAllocator arena) { } + + MemorySegment toNative(SegmentAllocator arena) { + var returnVal = dev.diplomattest.somelib.ntv.BorrowedFieldsReturning.allocate(arena); + + dev.diplomattest.somelib.ntv.BorrowedFieldsReturning.bytes(returnVal, SliceUtils.strToUtf8Slice(arena, this.bytes)); + + + return returnVal; + + } } diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/BorrowedFieldsWithBounds.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/BorrowedFieldsWithBounds.java index f2452911f..7965fe669 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/BorrowedFieldsWithBounds.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/BorrowedFieldsWithBounds.java @@ -17,7 +17,6 @@ public class BorrowedFieldsWithBounds { String fieldC; - MemorySegment internal; SegmentAllocator arena; List selfEdges = List.of(); List aEdges = List.of(); @@ -42,6 +41,18 @@ private BorrowedFieldsWithBounds(SegmentAllocator arena) { this.fieldC = SliceUtils.readUtf8(dev.diplomattest.somelib.ntv.BorrowedFieldsWithBounds.field_c(structSegment)); + } + + MemorySegment toNative(SegmentAllocator arena) { + var returnVal = dev.diplomattest.somelib.ntv.BorrowedFieldsWithBounds.allocate(arena); + + dev.diplomattest.somelib.ntv.BorrowedFieldsWithBounds.field_a(returnVal, SliceUtils.strToUtf16Slice(arena, this.fieldA)); + dev.diplomattest.somelib.ntv.BorrowedFieldsWithBounds.field_b(returnVal, SliceUtils.strToUtf8Slice(arena, this.fieldB)); + dev.diplomattest.somelib.ntv.BorrowedFieldsWithBounds.field_c(returnVal, SliceUtils.strToUtf8Slice(arena, this.fieldC)); + + + return returnVal; + } public static BorrowedFieldsWithBounds fromFooAndStrings(Foo foo,String dstr16X,String utf8StrZ) { diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/CyclicStructA.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/CyclicStructA.java index 27c1534c4..8e945e449 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/CyclicStructA.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/CyclicStructA.java @@ -15,7 +15,6 @@ public class CyclicStructA { CyclicStructB a; - MemorySegment internal; SegmentAllocator arena; List selfEdges = List.of(); @@ -32,6 +31,16 @@ private CyclicStructA(SegmentAllocator arena) { this.a = new CyclicStructB(arena, dev.diplomattest.somelib.ntv.CyclicStructA.a(structSegment)); + } + + MemorySegment toNative(SegmentAllocator arena) { + var returnVal = dev.diplomattest.somelib.ntv.CyclicStructA.allocate(arena); + + dev.diplomattest.somelib.ntv.CyclicStructA.a(returnVal, this.a.toNative(arena)); + + + return returnVal; + } public static CyclicStructB getB() { diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/CyclicStructB.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/CyclicStructB.java index 5cb1da065..6aeb1456a 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/CyclicStructB.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/CyclicStructB.java @@ -15,7 +15,6 @@ public class CyclicStructB { byte field; - MemorySegment internal; SegmentAllocator arena; List selfEdges = List.of(); @@ -32,6 +31,16 @@ private CyclicStructB(SegmentAllocator arena) { this.field = dev.diplomattest.somelib.ntv.CyclicStructB.field(structSegment); + } + + MemorySegment toNative(SegmentAllocator arena) { + var returnVal = dev.diplomattest.somelib.ntv.CyclicStructB.allocate(arena); + + dev.diplomattest.somelib.ntv.CyclicStructB.field(returnVal, this.field); + + + return returnVal; + } public static CyclicStructA getA() { diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ErrorStruct.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ErrorStruct.java index 1996f9052..5cda7bb6e 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ErrorStruct.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ErrorStruct.java @@ -16,7 +16,6 @@ public class ErrorStruct { int j; - MemorySegment internal; SegmentAllocator arena; List selfEdges = List.of(); @@ -35,6 +34,17 @@ private ErrorStruct(SegmentAllocator arena) { } + + MemorySegment toNative(SegmentAllocator arena) { + var returnVal = dev.diplomattest.somelib.ntv.ErrorStruct.allocate(arena); + + dev.diplomattest.somelib.ntv.ErrorStruct.i(returnVal, this.i); + dev.diplomattest.somelib.ntv.ErrorStruct.j(returnVal, this.j); + + + return returnVal; + + } } diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Foo.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Foo.java index 8f5e3ae19..69b46bc64 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Foo.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Foo.java @@ -65,7 +65,7 @@ public static Foo new_(String x) { public static Foo extractFromFields(BorrowedFields fields) { - var fieldsNative = fields.internal; + var fieldsNative = fields.toNative(fields.arena); var nativeVal = somelib_h.Foo_extract_from_fields(fieldsNative); List selfEdges = List.of(); @@ -81,7 +81,7 @@ public static Foo extractFromFields(BorrowedFields fields) { public static Foo extractFromBounds(BorrowedFieldsWithBounds bounds,String anotherString) { try (var arena = Arena.ofConfined()) { - var boundsNative = bounds.internal; + var boundsNative = bounds.toNative(bounds.arena); var anotherStringData= arena.allocateFrom(anotherString, StandardCharsets.UTF_8); var anotherStringLen = anotherStringData.byteSize() - 1; var anotherStringView = DiplomatStringView.allocate(arena); diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ImportedStruct.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ImportedStruct.java index 031748b33..ca15b2fd6 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ImportedStruct.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ImportedStruct.java @@ -16,7 +16,6 @@ public class ImportedStruct { byte count; - MemorySegment internal; SegmentAllocator arena; List selfEdges = List.of(); @@ -35,6 +34,17 @@ private ImportedStruct(SegmentAllocator arena) { } + + MemorySegment toNative(SegmentAllocator arena) { + var returnVal = dev.diplomattest.somelib.ntv.ImportedStruct.allocate(arena); + + dev.diplomattest.somelib.ntv.ImportedStruct.foo(returnVal, this.foo.toInt()); + dev.diplomattest.somelib.ntv.ImportedStruct.count(returnVal, this.count); + + + return returnVal; + + } } diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Lib.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Lib.java index 956faa7dd..77d56cc02 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Lib.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Lib.java @@ -133,6 +133,23 @@ static String readUtf16(MemorySegment segment) { return string; } // for parameter conversion + static MemorySegment strToUtf8Slice(SegmentAllocator arena, String str) { + var vData = arena.allocateFrom(str, StandardCharsets.UTF_8); + var vLen = vData.byteSize() - 1; + var vView = DiplomatStringView.allocate(arena); + DiplomatStringView.len(vView, vLen); + DiplomatStringView.data(vView, vData); + return vData; + } + + static MemorySegment strToUtf16Slice(SegmentAllocator arena, String str) { + var vData = arena.allocateFrom(str, StandardCharsets.UTF_16); + var vLen = vData.byteSize() - 1; + var vView = DiplomatStringView.allocate(arena); + DiplomatStringView.len(vView, vLen); + DiplomatStringView.data(vView, vData); + return vData; + } static MemorySegment strs16(SegmentAllocator arena, String [] strings) { var diplomatStrsData = DiplomatStringView.allocateArray(strings.length, arena); var layout = DiplomatStringView.layout(); diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyStruct.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyStruct.java index 0bb5edeeb..013b19eb1 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyStruct.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyStruct.java @@ -21,7 +21,6 @@ public class MyStruct { MyEnum g; - MemorySegment internal; SegmentAllocator arena; List selfEdges = List.of(); @@ -44,6 +43,22 @@ private MyStruct(SegmentAllocator arena) { this.g = MyEnum.fromInt(dev.diplomattest.somelib.ntv.MyStruct.g(structSegment)); + } + + MemorySegment toNative(SegmentAllocator arena) { + var returnVal = dev.diplomattest.somelib.ntv.MyStruct.allocate(arena); + + dev.diplomattest.somelib.ntv.MyStruct.a(returnVal, this.a); + dev.diplomattest.somelib.ntv.MyStruct.b(returnVal, this.b); + dev.diplomattest.somelib.ntv.MyStruct.c(returnVal, this.c); + dev.diplomattest.somelib.ntv.MyStruct.d(returnVal, this.d); + dev.diplomattest.somelib.ntv.MyStruct.e(returnVal, this.e); + dev.diplomattest.somelib.ntv.MyStruct.f(returnVal, this.f); + dev.diplomattest.somelib.ntv.MyStruct.g(returnVal, this.g.toInt()); + + + return returnVal; + } public static MyStruct new_() { diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyZst.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyZst.java index 43354bca5..7e66016e4 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyZst.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyZst.java @@ -14,7 +14,6 @@ public class MyZst { - MemorySegment internal; SegmentAllocator arena; List selfEdges = List.of(); @@ -31,6 +30,7 @@ private MyZst(SegmentAllocator arena) { } + } diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/NestedBorrowedFields.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/NestedBorrowedFields.java index e52ab798b..438eeba50 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/NestedBorrowedFields.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/NestedBorrowedFields.java @@ -17,7 +17,6 @@ public class NestedBorrowedFields { BorrowedFieldsWithBounds bounds2; - MemorySegment internal; SegmentAllocator arena; List selfEdges = List.of(); List xEdges = List.of(); @@ -42,6 +41,18 @@ private NestedBorrowedFields(SegmentAllocator arena) { this.bounds2 = new BorrowedFieldsWithBounds(arena, dev.diplomattest.somelib.ntv.NestedBorrowedFields.bounds2(structSegment), zEdges, zEdges, zEdges); + } + + MemorySegment toNative(SegmentAllocator arena) { + var returnVal = dev.diplomattest.somelib.ntv.NestedBorrowedFields.allocate(arena); + + dev.diplomattest.somelib.ntv.NestedBorrowedFields.fields(returnVal, this.fields.toNative(arena)); + dev.diplomattest.somelib.ntv.NestedBorrowedFields.bounds(returnVal, this.bounds.toNative(arena)); + dev.diplomattest.somelib.ntv.NestedBorrowedFields.bounds2(returnVal, this.bounds2.toNative(arena)); + + + return returnVal; + } public static NestedBorrowedFields fromBarAndFooAndStrings(Bar bar,Foo foo,String dstr16X,String dstr16Z,String utf8StrY,String utf8StrZ) { diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Opaque.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Opaque.java index 2e492379b..e2024deaa 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Opaque.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Opaque.java @@ -108,10 +108,12 @@ public String getDebugStr() { public void assertStruct(MyStruct s) { - - var sNative = s.internal; - somelib_h.Opaque_assert_struct(internal, sNative); - + try (var arena = Arena.ofConfined()) { + + var sNative = s.toNative(arena); + somelib_h.Opaque_assert_struct(internal, sNative); + + } } public long internalLen() { diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java index 2f0ccdcaa..73c2bd620 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java @@ -213,6 +213,168 @@ public static int _DARWIN_FEATURE_UNIX_CONFORMANCE() { public static int __has_ptrcheck() { return __has_ptrcheck; } + private static final int true_ = (int)1L; + /** + * {@snippet lang=c : + * #define true 1 + * } + */ + public static int true_() { + return true_; + } + private static final int false_ = (int)0L; + /** + * {@snippet lang=c : + * #define false 0 + * } + */ + public static int false_() { + return false_; + } + private static final int __bool_true_false_are_defined = (int)1L; + /** + * {@snippet lang=c : + * #define __bool_true_false_are_defined 1 + * } + */ + public static int __bool_true_false_are_defined() { + return __bool_true_false_are_defined; + } + private static final int __WORDSIZE = (int)64L; + /** + * {@snippet lang=c : + * #define __WORDSIZE 64 + * } + */ + public static int __WORDSIZE() { + return __WORDSIZE; + } + private static final int __PTHREAD_SIZE__ = (int)8176L; + /** + * {@snippet lang=c : + * #define __PTHREAD_SIZE__ 8176 + * } + */ + public static int __PTHREAD_SIZE__() { + return __PTHREAD_SIZE__; + } + private static final int __PTHREAD_ATTR_SIZE__ = (int)56L; + /** + * {@snippet lang=c : + * #define __PTHREAD_ATTR_SIZE__ 56 + * } + */ + public static int __PTHREAD_ATTR_SIZE__() { + return __PTHREAD_ATTR_SIZE__; + } + private static final int __PTHREAD_MUTEXATTR_SIZE__ = (int)8L; + /** + * {@snippet lang=c : + * #define __PTHREAD_MUTEXATTR_SIZE__ 8 + * } + */ + public static int __PTHREAD_MUTEXATTR_SIZE__() { + return __PTHREAD_MUTEXATTR_SIZE__; + } + private static final int __PTHREAD_MUTEX_SIZE__ = (int)56L; + /** + * {@snippet lang=c : + * #define __PTHREAD_MUTEX_SIZE__ 56 + * } + */ + public static int __PTHREAD_MUTEX_SIZE__() { + return __PTHREAD_MUTEX_SIZE__; + } + private static final int __PTHREAD_CONDATTR_SIZE__ = (int)8L; + /** + * {@snippet lang=c : + * #define __PTHREAD_CONDATTR_SIZE__ 8 + * } + */ + public static int __PTHREAD_CONDATTR_SIZE__() { + return __PTHREAD_CONDATTR_SIZE__; + } + private static final int __PTHREAD_COND_SIZE__ = (int)40L; + /** + * {@snippet lang=c : + * #define __PTHREAD_COND_SIZE__ 40 + * } + */ + public static int __PTHREAD_COND_SIZE__() { + return __PTHREAD_COND_SIZE__; + } + private static final int __PTHREAD_ONCE_SIZE__ = (int)8L; + /** + * {@snippet lang=c : + * #define __PTHREAD_ONCE_SIZE__ 8 + * } + */ + public static int __PTHREAD_ONCE_SIZE__() { + return __PTHREAD_ONCE_SIZE__; + } + private static final int __PTHREAD_RWLOCK_SIZE__ = (int)192L; + /** + * {@snippet lang=c : + * #define __PTHREAD_RWLOCK_SIZE__ 192 + * } + */ + public static int __PTHREAD_RWLOCK_SIZE__() { + return __PTHREAD_RWLOCK_SIZE__; + } + private static final int __PTHREAD_RWLOCKATTR_SIZE__ = (int)16L; + /** + * {@snippet lang=c : + * #define __PTHREAD_RWLOCKATTR_SIZE__ 16 + * } + */ + public static int __PTHREAD_RWLOCKATTR_SIZE__() { + return __PTHREAD_RWLOCKATTR_SIZE__; + } + private static final int INT8_MAX = (int)127L; + /** + * {@snippet lang=c : + * #define INT8_MAX 127 + * } + */ + public static int INT8_MAX() { + return INT8_MAX; + } + private static final int INT16_MAX = (int)32767L; + /** + * {@snippet lang=c : + * #define INT16_MAX 32767 + * } + */ + public static int INT16_MAX() { + return INT16_MAX; + } + private static final int INT32_MAX = (int)2147483647L; + /** + * {@snippet lang=c : + * #define INT32_MAX 2147483647 + * } + */ + public static int INT32_MAX() { + return INT32_MAX; + } + private static final int UINT8_MAX = (int)255L; + /** + * {@snippet lang=c : + * #define UINT8_MAX 255 + * } + */ + public static int UINT8_MAX() { + return UINT8_MAX; + } + private static final int UINT16_MAX = (int)65535L; + /** + * {@snippet lang=c : + * #define UINT16_MAX 65535 + * } + */ + public static int UINT16_MAX() { + return UINT16_MAX; + } private static final int __API_TO_BE_DEPRECATED = (int)100000L; /** * {@snippet lang=c : @@ -2787,87 +2949,6 @@ public static int __VISIONOS_1_2() { public static int __ENABLE_LEGACY_MAC_AVAILABILITY() { return __ENABLE_LEGACY_MAC_AVAILABILITY; } - private static final int __PTHREAD_SIZE__ = (int)8176L; - /** - * {@snippet lang=c : - * #define __PTHREAD_SIZE__ 8176 - * } - */ - public static int __PTHREAD_SIZE__() { - return __PTHREAD_SIZE__; - } - private static final int __PTHREAD_ATTR_SIZE__ = (int)56L; - /** - * {@snippet lang=c : - * #define __PTHREAD_ATTR_SIZE__ 56 - * } - */ - public static int __PTHREAD_ATTR_SIZE__() { - return __PTHREAD_ATTR_SIZE__; - } - private static final int __PTHREAD_MUTEXATTR_SIZE__ = (int)8L; - /** - * {@snippet lang=c : - * #define __PTHREAD_MUTEXATTR_SIZE__ 8 - * } - */ - public static int __PTHREAD_MUTEXATTR_SIZE__() { - return __PTHREAD_MUTEXATTR_SIZE__; - } - private static final int __PTHREAD_MUTEX_SIZE__ = (int)56L; - /** - * {@snippet lang=c : - * #define __PTHREAD_MUTEX_SIZE__ 56 - * } - */ - public static int __PTHREAD_MUTEX_SIZE__() { - return __PTHREAD_MUTEX_SIZE__; - } - private static final int __PTHREAD_CONDATTR_SIZE__ = (int)8L; - /** - * {@snippet lang=c : - * #define __PTHREAD_CONDATTR_SIZE__ 8 - * } - */ - public static int __PTHREAD_CONDATTR_SIZE__() { - return __PTHREAD_CONDATTR_SIZE__; - } - private static final int __PTHREAD_COND_SIZE__ = (int)40L; - /** - * {@snippet lang=c : - * #define __PTHREAD_COND_SIZE__ 40 - * } - */ - public static int __PTHREAD_COND_SIZE__() { - return __PTHREAD_COND_SIZE__; - } - private static final int __PTHREAD_ONCE_SIZE__ = (int)8L; - /** - * {@snippet lang=c : - * #define __PTHREAD_ONCE_SIZE__ 8 - * } - */ - public static int __PTHREAD_ONCE_SIZE__() { - return __PTHREAD_ONCE_SIZE__; - } - private static final int __PTHREAD_RWLOCK_SIZE__ = (int)192L; - /** - * {@snippet lang=c : - * #define __PTHREAD_RWLOCK_SIZE__ 192 - * } - */ - public static int __PTHREAD_RWLOCK_SIZE__() { - return __PTHREAD_RWLOCK_SIZE__; - } - private static final int __PTHREAD_RWLOCKATTR_SIZE__ = (int)16L; - /** - * {@snippet lang=c : - * #define __PTHREAD_RWLOCKATTR_SIZE__ 16 - * } - */ - public static int __PTHREAD_RWLOCKATTR_SIZE__() { - return __PTHREAD_RWLOCKATTR_SIZE__; - } private static final int _FORTIFY_SOURCE = (int)2L; /** * {@snippet lang=c : @@ -3201,87 +3282,234 @@ public static int L_ctermid() { public static int _USE_FORTIFY_LEVEL() { return _USE_FORTIFY_LEVEL; } - private static final int __WORDSIZE = (int)64L; - /** - * {@snippet lang=c : - * #define __WORDSIZE 64 - * } - */ - public static int __WORDSIZE() { - return __WORDSIZE; - } - private static final int INT8_MAX = (int)127L; - /** - * {@snippet lang=c : - * #define INT8_MAX 127 + + private static class __assert_rtn { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("__assert_rtn"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void __assert_rtn(const char *, const char *, int, const char *) * } */ - public static int INT8_MAX() { - return INT8_MAX; + public static FunctionDescriptor __assert_rtn$descriptor() { + return __assert_rtn.DESC; } - private static final int INT16_MAX = (int)32767L; + /** + * Downcall method handle for: * {@snippet lang=c : - * #define INT16_MAX 32767 + * void __assert_rtn(const char *, const char *, int, const char *) * } */ - public static int INT16_MAX() { - return INT16_MAX; + public static MethodHandle __assert_rtn$handle() { + return __assert_rtn.HANDLE; } - private static final int INT32_MAX = (int)2147483647L; + /** + * Address for: * {@snippet lang=c : - * #define INT32_MAX 2147483647 + * void __assert_rtn(const char *, const char *, int, const char *) * } */ - public static int INT32_MAX() { - return INT32_MAX; + public static MemorySegment __assert_rtn$address() { + return __assert_rtn.ADDR; } - private static final int UINT8_MAX = (int)255L; + /** * {@snippet lang=c : - * #define UINT8_MAX 255 + * void __assert_rtn(const char *, const char *, int, const char *) * } */ - public static int UINT8_MAX() { - return UINT8_MAX; + public static void __assert_rtn(MemorySegment x0, MemorySegment x1, int x2, MemorySegment x3) { + var mh$ = __assert_rtn.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("__assert_rtn", x0, x1, x2, x3); + } + mh$.invokeExact(x0, x1, x2, x3); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } } - private static final int UINT16_MAX = (int)65535L; /** * {@snippet lang=c : - * #define UINT16_MAX 65535 + * typedef long ptrdiff_t * } */ - public static int UINT16_MAX() { - return UINT16_MAX; - } - private static final int true_ = (int)1L; + public static final OfLong ptrdiff_t = somelib_h.C_LONG; /** * {@snippet lang=c : - * #define true 1 + * typedef unsigned long size_t * } */ - public static int true_() { - return true_; - } - private static final int false_ = (int)0L; + public static final OfLong size_t = somelib_h.C_LONG; /** * {@snippet lang=c : - * #define false 0 + * typedef unsigned long rsize_t * } */ - public static int false_() { - return false_; - } - private static final int __bool_true_false_are_defined = (int)1L; + public static final OfLong rsize_t = somelib_h.C_LONG; /** * {@snippet lang=c : - * #define __bool_true_false_are_defined 1 + * typedef int wchar_t * } */ - public static int __bool_true_false_are_defined() { - return __bool_true_false_are_defined; - } + public static final OfInt wchar_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef signed char int8_t + * } + */ + public static final OfByte int8_t = somelib_h.C_CHAR; + /** + * {@snippet lang=c : + * typedef short int16_t + * } + */ + public static final OfShort int16_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef int int32_t + * } + */ + public static final OfInt int32_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef long long int64_t + * } + */ + public static final OfLong int64_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef unsigned char uint8_t + * } + */ + public static final OfByte uint8_t = somelib_h.C_CHAR; + /** + * {@snippet lang=c : + * typedef unsigned short uint16_t + * } + */ + public static final OfShort uint16_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef unsigned int uint32_t + * } + */ + public static final OfInt uint32_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef unsigned long long uint64_t + * } + */ + public static final OfLong uint64_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef int8_t int_least8_t + * } + */ + public static final OfByte int_least8_t = somelib_h.C_CHAR; + /** + * {@snippet lang=c : + * typedef int16_t int_least16_t + * } + */ + public static final OfShort int_least16_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef int32_t int_least32_t + * } + */ + public static final OfInt int_least32_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef int64_t int_least64_t + * } + */ + public static final OfLong int_least64_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef uint8_t uint_least8_t + * } + */ + public static final OfByte uint_least8_t = somelib_h.C_CHAR; + /** + * {@snippet lang=c : + * typedef uint16_t uint_least16_t + * } + */ + public static final OfShort uint_least16_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef uint32_t uint_least32_t + * } + */ + public static final OfInt uint_least32_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef uint64_t uint_least64_t + * } + */ + public static final OfLong uint_least64_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef int8_t int_fast8_t + * } + */ + public static final OfByte int_fast8_t = somelib_h.C_CHAR; + /** + * {@snippet lang=c : + * typedef int16_t int_fast16_t + * } + */ + public static final OfShort int_fast16_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef int32_t int_fast32_t + * } + */ + public static final OfInt int_fast32_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef int64_t int_fast64_t + * } + */ + public static final OfLong int_fast64_t = somelib_h.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef uint8_t uint_fast8_t + * } + */ + public static final OfByte uint_fast8_t = somelib_h.C_CHAR; + /** + * {@snippet lang=c : + * typedef uint16_t uint_fast16_t + * } + */ + public static final OfShort uint_fast16_t = somelib_h.C_SHORT; + /** + * {@snippet lang=c : + * typedef uint32_t uint_fast32_t + * } + */ + public static final OfInt uint_fast32_t = somelib_h.C_INT; + /** + * {@snippet lang=c : + * typedef uint64_t uint_fast64_t + * } + */ + public static final OfLong uint_fast64_t = somelib_h.C_LONG_LONG; /** * {@snippet lang=c : * typedef signed char __int8_t @@ -3534,159 +3762,186 @@ public static int __bool_true_false_are_defined() { public static final AddressLayout __darwin_pthread_t = somelib_h.C_POINTER; /** * {@snippet lang=c : - * typedef int __darwin_nl_item + * typedef unsigned char u_int8_t * } */ - public static final OfInt __darwin_nl_item = somelib_h.C_INT; + public static final OfByte u_int8_t = somelib_h.C_CHAR; /** * {@snippet lang=c : - * typedef int __darwin_wctrans_t + * typedef unsigned short u_int16_t * } */ - public static final OfInt __darwin_wctrans_t = somelib_h.C_INT; + public static final OfShort u_int16_t = somelib_h.C_SHORT; /** * {@snippet lang=c : - * typedef __uint32_t __darwin_wctype_t + * typedef unsigned int u_int32_t * } */ - public static final OfInt __darwin_wctype_t = somelib_h.C_INT; + public static final OfInt u_int32_t = somelib_h.C_INT; /** * {@snippet lang=c : - * typedef signed char int8_t + * typedef unsigned long long u_int64_t * } */ - public static final OfByte int8_t = somelib_h.C_CHAR; + public static final OfLong u_int64_t = somelib_h.C_LONG_LONG; /** * {@snippet lang=c : - * typedef short int16_t + * typedef int64_t register_t * } */ - public static final OfShort int16_t = somelib_h.C_SHORT; + public static final OfLong register_t = somelib_h.C_LONG_LONG; /** * {@snippet lang=c : - * typedef int int32_t + * typedef unsigned long uintptr_t * } */ - public static final OfInt int32_t = somelib_h.C_INT; + public static final OfLong uintptr_t = somelib_h.C_LONG; /** * {@snippet lang=c : - * typedef long long int64_t + * typedef u_int64_t user_addr_t * } */ - public static final OfLong int64_t = somelib_h.C_LONG_LONG; + public static final OfLong user_addr_t = somelib_h.C_LONG_LONG; /** * {@snippet lang=c : - * typedef unsigned char u_int8_t - * } - */ - public static final OfByte u_int8_t = somelib_h.C_CHAR; - /** - * {@snippet lang=c : - * typedef unsigned short u_int16_t + * typedef u_int64_t user_size_t * } */ - public static final OfShort u_int16_t = somelib_h.C_SHORT; + public static final OfLong user_size_t = somelib_h.C_LONG_LONG; /** * {@snippet lang=c : - * typedef unsigned int u_int32_t + * typedef int64_t user_ssize_t * } */ - public static final OfInt u_int32_t = somelib_h.C_INT; + public static final OfLong user_ssize_t = somelib_h.C_LONG_LONG; /** * {@snippet lang=c : - * typedef unsigned long long u_int64_t + * typedef int64_t user_long_t * } */ - public static final OfLong u_int64_t = somelib_h.C_LONG_LONG; + public static final OfLong user_long_t = somelib_h.C_LONG_LONG; /** * {@snippet lang=c : - * typedef int64_t register_t + * typedef u_int64_t user_ulong_t * } */ - public static final OfLong register_t = somelib_h.C_LONG_LONG; + public static final OfLong user_ulong_t = somelib_h.C_LONG_LONG; /** * {@snippet lang=c : - * typedef __darwin_intptr_t intptr_t + * typedef int64_t user_time_t * } */ - public static final OfLong intptr_t = somelib_h.C_LONG; + public static final OfLong user_time_t = somelib_h.C_LONG_LONG; /** * {@snippet lang=c : - * typedef unsigned long uintptr_t + * typedef int64_t user_off_t * } */ - public static final OfLong uintptr_t = somelib_h.C_LONG; + public static final OfLong user_off_t = somelib_h.C_LONG_LONG; /** * {@snippet lang=c : - * typedef u_int64_t user_addr_t + * typedef u_int64_t syscall_arg_t * } */ - public static final OfLong user_addr_t = somelib_h.C_LONG_LONG; + public static final OfLong syscall_arg_t = somelib_h.C_LONG_LONG; /** * {@snippet lang=c : - * typedef u_int64_t user_size_t + * typedef __darwin_intptr_t intptr_t * } */ - public static final OfLong user_size_t = somelib_h.C_LONG_LONG; + public static final OfLong intptr_t = somelib_h.C_LONG; /** * {@snippet lang=c : - * typedef int64_t user_ssize_t + * typedef long intmax_t * } */ - public static final OfLong user_ssize_t = somelib_h.C_LONG_LONG; + public static final OfLong intmax_t = somelib_h.C_LONG; /** * {@snippet lang=c : - * typedef int64_t user_long_t + * typedef unsigned long uintmax_t * } */ - public static final OfLong user_long_t = somelib_h.C_LONG_LONG; + public static final OfLong uintmax_t = somelib_h.C_LONG; /** * {@snippet lang=c : - * typedef u_int64_t user_ulong_t + * typedef uint_least16_t char16_t * } */ - public static final OfLong user_ulong_t = somelib_h.C_LONG_LONG; + public static final OfShort char16_t = somelib_h.C_SHORT; /** * {@snippet lang=c : - * typedef int64_t user_time_t + * typedef uint_least32_t char32_t * } */ - public static final OfLong user_time_t = somelib_h.C_LONG_LONG; + public static final OfInt char32_t = somelib_h.C_INT; + + private static class diplomat_is_str { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_BOOL, + somelib_h.C_POINTER, + somelib_h.C_LONG + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_is_str"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + /** + * Function descriptor for: * {@snippet lang=c : - * typedef int64_t user_off_t + * bool diplomat_is_str(const char *buf, size_t len) * } */ - public static final OfLong user_off_t = somelib_h.C_LONG_LONG; + public static FunctionDescriptor diplomat_is_str$descriptor() { + return diplomat_is_str.DESC; + } + /** + * Downcall method handle for: * {@snippet lang=c : - * typedef u_int64_t syscall_arg_t + * bool diplomat_is_str(const char *buf, size_t len) * } */ - public static final OfLong syscall_arg_t = somelib_h.C_LONG_LONG; + public static MethodHandle diplomat_is_str$handle() { + return diplomat_is_str.HANDLE; + } + /** + * Address for: * {@snippet lang=c : - * typedef __darwin_va_list va_list + * bool diplomat_is_str(const char *buf, size_t len) * } */ - public static final AddressLayout va_list = somelib_h.C_POINTER; + public static MemorySegment diplomat_is_str$address() { + return diplomat_is_str.ADDR; + } + /** * {@snippet lang=c : - * typedef __darwin_size_t size_t + * bool diplomat_is_str(const char *buf, size_t len) * } */ - public static final OfLong size_t = somelib_h.C_LONG; + public static boolean diplomat_is_str(MemorySegment buf, long len) { + var mh$ = diplomat_is_str.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("diplomat_is_str", buf, len); + } + return (boolean)mh$.invokeExact(buf, len); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } - private static class renameat { + private static class diplomat_simple_write { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_INT, + DiplomatWrite.layout(), somelib_h.C_POINTER, - somelib_h.C_INT, - somelib_h.C_POINTER + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("renameat"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_simple_write"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -3694,59 +3949,57 @@ private static class renameat { /** * Function descriptor for: * {@snippet lang=c : - * int renameat(int, const char *, int, const char *) + * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) * } */ - public static FunctionDescriptor renameat$descriptor() { - return renameat.DESC; + public static FunctionDescriptor diplomat_simple_write$descriptor() { + return diplomat_simple_write.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int renameat(int, const char *, int, const char *) + * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) * } */ - public static MethodHandle renameat$handle() { - return renameat.HANDLE; + public static MethodHandle diplomat_simple_write$handle() { + return diplomat_simple_write.HANDLE; } /** * Address for: * {@snippet lang=c : - * int renameat(int, const char *, int, const char *) + * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) * } */ - public static MemorySegment renameat$address() { - return renameat.ADDR; + public static MemorySegment diplomat_simple_write$address() { + return diplomat_simple_write.ADDR; } /** * {@snippet lang=c : - * int renameat(int, const char *, int, const char *) + * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) * } */ - public static int renameat(int x0, MemorySegment x1, int x2, MemorySegment x3) { - var mh$ = renameat.HANDLE; + public static MemorySegment diplomat_simple_write(SegmentAllocator allocator, MemorySegment buf, long buf_size) { + var mh$ = diplomat_simple_write.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("renameat", x0, x1, x2, x3); + traceDowncall("diplomat_simple_write", allocator, buf, buf_size); } - return (int)mh$.invokeExact(x0, x1, x2, x3); + return (MemorySegment)mh$.invokeExact(allocator, buf, buf_size); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class renamex_np { + private static class diplomat_buffer_write_create { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_INT + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("renamex_np"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_create"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -3754,61 +4007,57 @@ private static class renamex_np { /** * Function descriptor for: * {@snippet lang=c : - * int renamex_np(const char *, const char *, unsigned int) + * DiplomatWrite *diplomat_buffer_write_create(size_t cap) * } */ - public static FunctionDescriptor renamex_np$descriptor() { - return renamex_np.DESC; + public static FunctionDescriptor diplomat_buffer_write_create$descriptor() { + return diplomat_buffer_write_create.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int renamex_np(const char *, const char *, unsigned int) + * DiplomatWrite *diplomat_buffer_write_create(size_t cap) * } */ - public static MethodHandle renamex_np$handle() { - return renamex_np.HANDLE; + public static MethodHandle diplomat_buffer_write_create$handle() { + return diplomat_buffer_write_create.HANDLE; } /** * Address for: * {@snippet lang=c : - * int renamex_np(const char *, const char *, unsigned int) + * DiplomatWrite *diplomat_buffer_write_create(size_t cap) * } */ - public static MemorySegment renamex_np$address() { - return renamex_np.ADDR; + public static MemorySegment diplomat_buffer_write_create$address() { + return diplomat_buffer_write_create.ADDR; } /** * {@snippet lang=c : - * int renamex_np(const char *, const char *, unsigned int) + * DiplomatWrite *diplomat_buffer_write_create(size_t cap) * } */ - public static int renamex_np(MemorySegment x0, MemorySegment x1, int x2) { - var mh$ = renamex_np.HANDLE; + public static MemorySegment diplomat_buffer_write_create(long cap) { + var mh$ = diplomat_buffer_write_create.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("renamex_np", x0, x1, x2); + traceDowncall("diplomat_buffer_write_create", cap); } - return (int)mh$.invokeExact(x0, x1, x2); + return (MemorySegment)mh$.invokeExact(cap); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class renameatx_np { + private static class diplomat_buffer_write_get_bytes { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_INT, somelib_h.C_POINTER, - somelib_h.C_INT + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("renameatx_np"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_get_bytes"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -3816,197 +4065,199 @@ private static class renameatx_np { /** * Function descriptor for: * {@snippet lang=c : - * int renameatx_np(int, const char *, int, const char *, unsigned int) + * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) * } */ - public static FunctionDescriptor renameatx_np$descriptor() { - return renameatx_np.DESC; + public static FunctionDescriptor diplomat_buffer_write_get_bytes$descriptor() { + return diplomat_buffer_write_get_bytes.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int renameatx_np(int, const char *, int, const char *, unsigned int) + * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) * } */ - public static MethodHandle renameatx_np$handle() { - return renameatx_np.HANDLE; + public static MethodHandle diplomat_buffer_write_get_bytes$handle() { + return diplomat_buffer_write_get_bytes.HANDLE; } /** * Address for: * {@snippet lang=c : - * int renameatx_np(int, const char *, int, const char *, unsigned int) + * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) * } */ - public static MemorySegment renameatx_np$address() { - return renameatx_np.ADDR; + public static MemorySegment diplomat_buffer_write_get_bytes$address() { + return diplomat_buffer_write_get_bytes.ADDR; } /** * {@snippet lang=c : - * int renameatx_np(int, const char *, int, const char *, unsigned int) + * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) * } */ - public static int renameatx_np(int x0, MemorySegment x1, int x2, MemorySegment x3, int x4) { - var mh$ = renameatx_np.HANDLE; + public static MemorySegment diplomat_buffer_write_get_bytes(MemorySegment t) { + var mh$ = diplomat_buffer_write_get_bytes.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("renameatx_np", x0, x1, x2, x3, x4); + traceDowncall("diplomat_buffer_write_get_bytes", t); } - return (int)mh$.invokeExact(x0, x1, x2, x3, x4); + return (MemorySegment)mh$.invokeExact(t); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } + + private static class diplomat_buffer_write_len { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_LONG, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_len"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + /** + * Function descriptor for: * {@snippet lang=c : - * typedef __darwin_off_t fpos_t + * size_t diplomat_buffer_write_len(DiplomatWrite *t) * } */ - public static final OfLong fpos_t = somelib_h.C_LONG_LONG; - - private static class __stdinp$constants { - public static final AddressLayout LAYOUT = somelib_h.C_POINTER; - public static final MemorySegment SEGMENT = somelib_h.findOrThrow("__stdinp").reinterpret(LAYOUT.byteSize()); + public static FunctionDescriptor diplomat_buffer_write_len$descriptor() { + return diplomat_buffer_write_len.DESC; } /** - * Layout for variable: + * Downcall method handle for: * {@snippet lang=c : - * extern FILE *__stdinp + * size_t diplomat_buffer_write_len(DiplomatWrite *t) * } */ - public static AddressLayout __stdinp$layout() { - return __stdinp$constants.LAYOUT; + public static MethodHandle diplomat_buffer_write_len$handle() { + return diplomat_buffer_write_len.HANDLE; } /** - * Segment for variable: + * Address for: * {@snippet lang=c : - * extern FILE *__stdinp + * size_t diplomat_buffer_write_len(DiplomatWrite *t) * } */ - public static MemorySegment __stdinp$segment() { - return __stdinp$constants.SEGMENT; + public static MemorySegment diplomat_buffer_write_len$address() { + return diplomat_buffer_write_len.ADDR; } /** - * Getter for variable: * {@snippet lang=c : - * extern FILE *__stdinp + * size_t diplomat_buffer_write_len(DiplomatWrite *t) * } */ - public static MemorySegment __stdinp() { - return __stdinp$constants.SEGMENT.get(__stdinp$constants.LAYOUT, 0L); + public static long diplomat_buffer_write_len(MemorySegment t) { + var mh$ = diplomat_buffer_write_len.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("diplomat_buffer_write_len", t); + } + return (long)mh$.invokeExact(t); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } } - /** - * Setter for variable: - * {@snippet lang=c : - * extern FILE *__stdinp - * } - */ - public static void __stdinp(MemorySegment varValue) { - __stdinp$constants.SEGMENT.set(__stdinp$constants.LAYOUT, 0L, varValue); - } + private static class diplomat_buffer_write_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER + ); - private static class __stdoutp$constants { - public static final AddressLayout LAYOUT = somelib_h.C_POINTER; - public static final MemorySegment SEGMENT = somelib_h.findOrThrow("__stdoutp").reinterpret(LAYOUT.byteSize()); + public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_destroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } /** - * Layout for variable: + * Function descriptor for: * {@snippet lang=c : - * extern FILE *__stdoutp + * void diplomat_buffer_write_destroy(DiplomatWrite *t) * } */ - public static AddressLayout __stdoutp$layout() { - return __stdoutp$constants.LAYOUT; + public static FunctionDescriptor diplomat_buffer_write_destroy$descriptor() { + return diplomat_buffer_write_destroy.DESC; } /** - * Segment for variable: + * Downcall method handle for: * {@snippet lang=c : - * extern FILE *__stdoutp + * void diplomat_buffer_write_destroy(DiplomatWrite *t) * } */ - public static MemorySegment __stdoutp$segment() { - return __stdoutp$constants.SEGMENT; + public static MethodHandle diplomat_buffer_write_destroy$handle() { + return diplomat_buffer_write_destroy.HANDLE; } /** - * Getter for variable: + * Address for: * {@snippet lang=c : - * extern FILE *__stdoutp + * void diplomat_buffer_write_destroy(DiplomatWrite *t) * } */ - public static MemorySegment __stdoutp() { - return __stdoutp$constants.SEGMENT.get(__stdoutp$constants.LAYOUT, 0L); + public static MemorySegment diplomat_buffer_write_destroy$address() { + return diplomat_buffer_write_destroy.ADDR; } /** - * Setter for variable: * {@snippet lang=c : - * extern FILE *__stdoutp + * void diplomat_buffer_write_destroy(DiplomatWrite *t) * } */ - public static void __stdoutp(MemorySegment varValue) { - __stdoutp$constants.SEGMENT.set(__stdoutp$constants.LAYOUT, 0L, varValue); - } - - private static class __stderrp$constants { - public static final AddressLayout LAYOUT = somelib_h.C_POINTER; - public static final MemorySegment SEGMENT = somelib_h.findOrThrow("__stderrp").reinterpret(LAYOUT.byteSize()); + public static void diplomat_buffer_write_destroy(MemorySegment t) { + var mh$ = diplomat_buffer_write_destroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("diplomat_buffer_write_destroy", t); + } + mh$.invokeExact(t); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } } - /** - * Layout for variable: * {@snippet lang=c : - * extern FILE *__stderrp + * typedef int __darwin_nl_item * } */ - public static AddressLayout __stderrp$layout() { - return __stderrp$constants.LAYOUT; - } - + public static final OfInt __darwin_nl_item = somelib_h.C_INT; /** - * Segment for variable: * {@snippet lang=c : - * extern FILE *__stderrp + * typedef int __darwin_wctrans_t * } */ - public static MemorySegment __stderrp$segment() { - return __stderrp$constants.SEGMENT; - } - + public static final OfInt __darwin_wctrans_t = somelib_h.C_INT; /** - * Getter for variable: * {@snippet lang=c : - * extern FILE *__stderrp + * typedef __uint32_t __darwin_wctype_t * } */ - public static MemorySegment __stderrp() { - return __stderrp$constants.SEGMENT.get(__stderrp$constants.LAYOUT, 0L); - } - + public static final OfInt __darwin_wctype_t = somelib_h.C_INT; /** - * Setter for variable: * {@snippet lang=c : - * extern FILE *__stderrp + * typedef __darwin_va_list va_list * } */ - public static void __stderrp(MemorySegment varValue) { - __stderrp$constants.SEGMENT.set(__stderrp$constants.LAYOUT, 0L, varValue); - } + public static final AddressLayout va_list = somelib_h.C_POINTER; - private static class clearerr { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class renameat { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_INT, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("clearerr"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("renameat"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4014,57 +4265,59 @@ private static class clearerr { /** * Function descriptor for: * {@snippet lang=c : - * void clearerr(FILE *) + * int renameat(int, const char *, int, const char *) * } */ - public static FunctionDescriptor clearerr$descriptor() { - return clearerr.DESC; + public static FunctionDescriptor renameat$descriptor() { + return renameat.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void clearerr(FILE *) + * int renameat(int, const char *, int, const char *) * } */ - public static MethodHandle clearerr$handle() { - return clearerr.HANDLE; + public static MethodHandle renameat$handle() { + return renameat.HANDLE; } /** * Address for: * {@snippet lang=c : - * void clearerr(FILE *) + * int renameat(int, const char *, int, const char *) * } */ - public static MemorySegment clearerr$address() { - return clearerr.ADDR; + public static MemorySegment renameat$address() { + return renameat.ADDR; } /** * {@snippet lang=c : - * void clearerr(FILE *) + * int renameat(int, const char *, int, const char *) * } */ - public static void clearerr(MemorySegment x0) { - var mh$ = clearerr.HANDLE; + public static int renameat(int x0, MemorySegment x1, int x2, MemorySegment x3) { + var mh$ = renameat.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("clearerr", x0); + traceDowncall("renameat", x0, x1, x2, x3); } - mh$.invokeExact(x0); + return (int)mh$.invokeExact(x0, x1, x2, x3); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class fclose { + private static class renamex_np { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_INT, - somelib_h.C_POINTER + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_INT ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("fclose"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("renamex_np"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4072,57 +4325,61 @@ private static class fclose { /** * Function descriptor for: * {@snippet lang=c : - * int fclose(FILE *) + * int renamex_np(const char *, const char *, unsigned int) * } */ - public static FunctionDescriptor fclose$descriptor() { - return fclose.DESC; + public static FunctionDescriptor renamex_np$descriptor() { + return renamex_np.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int fclose(FILE *) + * int renamex_np(const char *, const char *, unsigned int) * } */ - public static MethodHandle fclose$handle() { - return fclose.HANDLE; + public static MethodHandle renamex_np$handle() { + return renamex_np.HANDLE; } /** * Address for: * {@snippet lang=c : - * int fclose(FILE *) + * int renamex_np(const char *, const char *, unsigned int) * } */ - public static MemorySegment fclose$address() { - return fclose.ADDR; + public static MemorySegment renamex_np$address() { + return renamex_np.ADDR; } /** * {@snippet lang=c : - * int fclose(FILE *) + * int renamex_np(const char *, const char *, unsigned int) * } */ - public static int fclose(MemorySegment x0) { - var mh$ = fclose.HANDLE; + public static int renamex_np(MemorySegment x0, MemorySegment x1, int x2) { + var mh$ = renamex_np.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("fclose", x0); + traceDowncall("renamex_np", x0, x1, x2); } - return (int)mh$.invokeExact(x0); + return (int)mh$.invokeExact(x0, x1, x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class feof { + private static class renameatx_np { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_INT, - somelib_h.C_POINTER + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_INT ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("feof"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("renameatx_np"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4130,173 +4387,197 @@ private static class feof { /** * Function descriptor for: * {@snippet lang=c : - * int feof(FILE *) + * int renameatx_np(int, const char *, int, const char *, unsigned int) * } */ - public static FunctionDescriptor feof$descriptor() { - return feof.DESC; + public static FunctionDescriptor renameatx_np$descriptor() { + return renameatx_np.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int feof(FILE *) + * int renameatx_np(int, const char *, int, const char *, unsigned int) * } */ - public static MethodHandle feof$handle() { - return feof.HANDLE; + public static MethodHandle renameatx_np$handle() { + return renameatx_np.HANDLE; } /** * Address for: * {@snippet lang=c : - * int feof(FILE *) + * int renameatx_np(int, const char *, int, const char *, unsigned int) * } */ - public static MemorySegment feof$address() { - return feof.ADDR; + public static MemorySegment renameatx_np$address() { + return renameatx_np.ADDR; } /** * {@snippet lang=c : - * int feof(FILE *) + * int renameatx_np(int, const char *, int, const char *, unsigned int) * } */ - public static int feof(MemorySegment x0) { - var mh$ = feof.HANDLE; + public static int renameatx_np(int x0, MemorySegment x1, int x2, MemorySegment x3, int x4) { + var mh$ = renameatx_np.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("feof", x0); + traceDowncall("renameatx_np", x0, x1, x2, x3, x4); } - return (int)mh$.invokeExact(x0); + return (int)mh$.invokeExact(x0, x1, x2, x3, x4); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } + /** + * {@snippet lang=c : + * typedef __darwin_off_t fpos_t + * } + */ + public static final OfLong fpos_t = somelib_h.C_LONG_LONG; - private static class ferror { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("ferror"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + private static class __stdinp$constants { + public static final AddressLayout LAYOUT = somelib_h.C_POINTER; + public static final MemorySegment SEGMENT = somelib_h.findOrThrow("__stdinp").reinterpret(LAYOUT.byteSize()); } /** - * Function descriptor for: + * Layout for variable: * {@snippet lang=c : - * int ferror(FILE *) + * extern FILE *__stdinp * } */ - public static FunctionDescriptor ferror$descriptor() { - return ferror.DESC; + public static AddressLayout __stdinp$layout() { + return __stdinp$constants.LAYOUT; } /** - * Downcall method handle for: + * Segment for variable: * {@snippet lang=c : - * int ferror(FILE *) + * extern FILE *__stdinp * } */ - public static MethodHandle ferror$handle() { - return ferror.HANDLE; + public static MemorySegment __stdinp$segment() { + return __stdinp$constants.SEGMENT; } /** - * Address for: + * Getter for variable: * {@snippet lang=c : - * int ferror(FILE *) + * extern FILE *__stdinp * } */ - public static MemorySegment ferror$address() { - return ferror.ADDR; + public static MemorySegment __stdinp() { + return __stdinp$constants.SEGMENT.get(__stdinp$constants.LAYOUT, 0L); } /** + * Setter for variable: * {@snippet lang=c : - * int ferror(FILE *) + * extern FILE *__stdinp * } */ - public static int ferror(MemorySegment x0) { - var mh$ = ferror.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("ferror", x0); - } - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } + public static void __stdinp(MemorySegment varValue) { + __stdinp$constants.SEGMENT.set(__stdinp$constants.LAYOUT, 0L, varValue); } - private static class fflush { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER - ); + private static class __stdoutp$constants { + public static final AddressLayout LAYOUT = somelib_h.C_POINTER; + public static final MemorySegment SEGMENT = somelib_h.findOrThrow("__stdoutp").reinterpret(LAYOUT.byteSize()); + } - public static final MemorySegment ADDR = somelib_h.findOrThrow("fflush"); + /** + * Layout for variable: + * {@snippet lang=c : + * extern FILE *__stdoutp + * } + */ + public static AddressLayout __stdoutp$layout() { + return __stdoutp$constants.LAYOUT; + } - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + /** + * Segment for variable: + * {@snippet lang=c : + * extern FILE *__stdoutp + * } + */ + public static MemorySegment __stdoutp$segment() { + return __stdoutp$constants.SEGMENT; } /** - * Function descriptor for: + * Getter for variable: * {@snippet lang=c : - * int fflush(FILE *) + * extern FILE *__stdoutp * } */ - public static FunctionDescriptor fflush$descriptor() { - return fflush.DESC; + public static MemorySegment __stdoutp() { + return __stdoutp$constants.SEGMENT.get(__stdoutp$constants.LAYOUT, 0L); } /** - * Downcall method handle for: + * Setter for variable: * {@snippet lang=c : - * int fflush(FILE *) + * extern FILE *__stdoutp * } */ - public static MethodHandle fflush$handle() { - return fflush.HANDLE; + public static void __stdoutp(MemorySegment varValue) { + __stdoutp$constants.SEGMENT.set(__stdoutp$constants.LAYOUT, 0L, varValue); + } + + private static class __stderrp$constants { + public static final AddressLayout LAYOUT = somelib_h.C_POINTER; + public static final MemorySegment SEGMENT = somelib_h.findOrThrow("__stderrp").reinterpret(LAYOUT.byteSize()); } /** - * Address for: + * Layout for variable: * {@snippet lang=c : - * int fflush(FILE *) + * extern FILE *__stderrp * } */ - public static MemorySegment fflush$address() { - return fflush.ADDR; + public static AddressLayout __stderrp$layout() { + return __stderrp$constants.LAYOUT; } /** + * Segment for variable: * {@snippet lang=c : - * int fflush(FILE *) + * extern FILE *__stderrp * } */ - public static int fflush(MemorySegment x0) { - var mh$ = fflush.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("fflush", x0); - } - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } + public static MemorySegment __stderrp$segment() { + return __stderrp$constants.SEGMENT; } - private static class fgetc { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, + /** + * Getter for variable: + * {@snippet lang=c : + * extern FILE *__stderrp + * } + */ + public static MemorySegment __stderrp() { + return __stderrp$constants.SEGMENT.get(__stderrp$constants.LAYOUT, 0L); + } + + /** + * Setter for variable: + * {@snippet lang=c : + * extern FILE *__stderrp + * } + */ + public static void __stderrp(MemorySegment varValue) { + __stderrp$constants.SEGMENT.set(__stderrp$constants.LAYOUT, 0L, varValue); + } + + private static class clearerr { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("fgetc"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("clearerr"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4304,58 +4585,57 @@ private static class fgetc { /** * Function descriptor for: * {@snippet lang=c : - * int fgetc(FILE *) + * void clearerr(FILE *) * } */ - public static FunctionDescriptor fgetc$descriptor() { - return fgetc.DESC; + public static FunctionDescriptor clearerr$descriptor() { + return clearerr.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int fgetc(FILE *) + * void clearerr(FILE *) * } */ - public static MethodHandle fgetc$handle() { - return fgetc.HANDLE; + public static MethodHandle clearerr$handle() { + return clearerr.HANDLE; } /** * Address for: * {@snippet lang=c : - * int fgetc(FILE *) + * void clearerr(FILE *) * } */ - public static MemorySegment fgetc$address() { - return fgetc.ADDR; + public static MemorySegment clearerr$address() { + return clearerr.ADDR; } /** * {@snippet lang=c : - * int fgetc(FILE *) + * void clearerr(FILE *) * } */ - public static int fgetc(MemorySegment x0) { - var mh$ = fgetc.HANDLE; + public static void clearerr(MemorySegment x0) { + var mh$ = clearerr.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("fgetc", x0); + traceDowncall("clearerr", x0); } - return (int)mh$.invokeExact(x0); + mh$.invokeExact(x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class fgetpos { + private static class fclose { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_INT, - somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("fgetpos"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fclose"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4363,59 +4643,57 @@ private static class fgetpos { /** * Function descriptor for: * {@snippet lang=c : - * int fgetpos(FILE *restrict, fpos_t *) + * int fclose(FILE *) * } */ - public static FunctionDescriptor fgetpos$descriptor() { - return fgetpos.DESC; + public static FunctionDescriptor fclose$descriptor() { + return fclose.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int fgetpos(FILE *restrict, fpos_t *) + * int fclose(FILE *) * } */ - public static MethodHandle fgetpos$handle() { - return fgetpos.HANDLE; + public static MethodHandle fclose$handle() { + return fclose.HANDLE; } /** * Address for: * {@snippet lang=c : - * int fgetpos(FILE *restrict, fpos_t *) + * int fclose(FILE *) * } */ - public static MemorySegment fgetpos$address() { - return fgetpos.ADDR; + public static MemorySegment fclose$address() { + return fclose.ADDR; } /** * {@snippet lang=c : - * int fgetpos(FILE *restrict, fpos_t *) + * int fclose(FILE *) * } */ - public static int fgetpos(MemorySegment x0, MemorySegment x1) { - var mh$ = fgetpos.HANDLE; + public static int fclose(MemorySegment x0) { + var mh$ = fclose.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("fgetpos", x0, x1); + traceDowncall("fclose", x0); } - return (int)mh$.invokeExact(x0, x1); + return (int)mh$.invokeExact(x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class fgets { + private static class feof { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, somelib_h.C_INT, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("fgets"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("feof"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4423,58 +4701,57 @@ private static class fgets { /** * Function descriptor for: * {@snippet lang=c : - * char *fgets(char *restrict, int, FILE *) + * int feof(FILE *) * } */ - public static FunctionDescriptor fgets$descriptor() { - return fgets.DESC; + public static FunctionDescriptor feof$descriptor() { + return feof.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * char *fgets(char *restrict, int, FILE *) + * int feof(FILE *) * } */ - public static MethodHandle fgets$handle() { - return fgets.HANDLE; + public static MethodHandle feof$handle() { + return feof.HANDLE; } /** * Address for: * {@snippet lang=c : - * char *fgets(char *restrict, int, FILE *) + * int feof(FILE *) * } */ - public static MemorySegment fgets$address() { - return fgets.ADDR; + public static MemorySegment feof$address() { + return feof.ADDR; } /** * {@snippet lang=c : - * char *fgets(char *restrict, int, FILE *) + * int feof(FILE *) * } */ - public static MemorySegment fgets(MemorySegment x0, int x1, MemorySegment x2) { - var mh$ = fgets.HANDLE; + public static int feof(MemorySegment x0) { + var mh$ = feof.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("fgets", x0, x1, x2); + traceDowncall("feof", x0); } - return (MemorySegment)mh$.invokeExact(x0, x1, x2); + return (int)mh$.invokeExact(x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class fopen { + private static class ferror { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, + somelib_h.C_INT, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("fopen"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("ferror"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4482,131 +4759,115 @@ private static class fopen { /** * Function descriptor for: * {@snippet lang=c : - * FILE *fopen(const char *restrict __filename, const char *restrict __mode) + * int ferror(FILE *) * } */ - public static FunctionDescriptor fopen$descriptor() { - return fopen.DESC; + public static FunctionDescriptor ferror$descriptor() { + return ferror.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * FILE *fopen(const char *restrict __filename, const char *restrict __mode) + * int ferror(FILE *) * } */ - public static MethodHandle fopen$handle() { - return fopen.HANDLE; + public static MethodHandle ferror$handle() { + return ferror.HANDLE; } /** * Address for: * {@snippet lang=c : - * FILE *fopen(const char *restrict __filename, const char *restrict __mode) + * int ferror(FILE *) * } */ - public static MemorySegment fopen$address() { - return fopen.ADDR; + public static MemorySegment ferror$address() { + return ferror.ADDR; } /** * {@snippet lang=c : - * FILE *fopen(const char *restrict __filename, const char *restrict __mode) + * int ferror(FILE *) * } */ - public static MemorySegment fopen(MemorySegment __filename, MemorySegment __mode) { - var mh$ = fopen.HANDLE; + public static int ferror(MemorySegment x0) { + var mh$ = ferror.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("fopen", __filename, __mode); + traceDowncall("ferror", x0); } - return (MemorySegment)mh$.invokeExact(__filename, __mode); + return (int)mh$.invokeExact(x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - /** - * Variadic invoker class for: - * {@snippet lang=c : - * int fprintf(FILE *restrict, const char *restrict, ...) - * } - */ - public static class fprintf { - private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("fprintf"); - - private final MethodHandle handle; - private final FunctionDescriptor descriptor; - private final MethodHandle spreader; + private static class fflush { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER + ); - private fprintf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { - this.handle = handle; - this.descriptor = descriptor; - this.spreader = spreader; - } + public static final MemorySegment ADDR = somelib_h.findOrThrow("fflush"); - /** - * Variadic invoker factory for: - * {@snippet lang=c : - * int fprintf(FILE *restrict, const char *restrict, ...) - * } - */ - public static fprintf makeInvoker(MemoryLayout... layouts) { - FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); - Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); - var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); - var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new fprintf(mh$, desc$, spreader$); - } + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } - /** - * {@return the address} - */ - public static MemorySegment address() { - return ADDR; - } + /** + * Function descriptor for: + * {@snippet lang=c : + * int fflush(FILE *) + * } + */ + public static FunctionDescriptor fflush$descriptor() { + return fflush.DESC; + } - /** - * {@return the specialized method handle} - */ - public MethodHandle handle() { - return handle; - } + /** + * Downcall method handle for: + * {@snippet lang=c : + * int fflush(FILE *) + * } + */ + public static MethodHandle fflush$handle() { + return fflush.HANDLE; + } - /** - * {@return the specialized descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } + /** + * Address for: + * {@snippet lang=c : + * int fflush(FILE *) + * } + */ + public static MemorySegment fflush$address() { + return fflush.ADDR; + } - public int apply(MemorySegment x0, MemorySegment x1, Object... x2) { - try { - if (TRACE_DOWNCALLS) { - traceDowncall("fprintf", x0, x1, x2); - } - return (int)spreader.invokeExact(x0, x1, x2); - } catch(IllegalArgumentException | ClassCastException ex$) { - throw ex$; // rethrow IAE from passing wrong number/type of args - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); + /** + * {@snippet lang=c : + * int fflush(FILE *) + * } + */ + public static int fflush(MemorySegment x0) { + var mh$ = fflush.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fflush", x0); } + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); } } - private static class fputc { + private static class fgetc { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT, somelib_h.C_INT, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("fputc"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fgetc"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4614,58 +4875,58 @@ private static class fputc { /** * Function descriptor for: * {@snippet lang=c : - * int fputc(int, FILE *) + * int fgetc(FILE *) * } */ - public static FunctionDescriptor fputc$descriptor() { - return fputc.DESC; + public static FunctionDescriptor fgetc$descriptor() { + return fgetc.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int fputc(int, FILE *) + * int fgetc(FILE *) * } */ - public static MethodHandle fputc$handle() { - return fputc.HANDLE; + public static MethodHandle fgetc$handle() { + return fgetc.HANDLE; } /** * Address for: * {@snippet lang=c : - * int fputc(int, FILE *) + * int fgetc(FILE *) * } */ - public static MemorySegment fputc$address() { - return fputc.ADDR; + public static MemorySegment fgetc$address() { + return fgetc.ADDR; } /** * {@snippet lang=c : - * int fputc(int, FILE *) + * int fgetc(FILE *) * } */ - public static int fputc(int x0, MemorySegment x1) { - var mh$ = fputc.HANDLE; + public static int fgetc(MemorySegment x0) { + var mh$ = fgetc.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("fputc", x0, x1); + traceDowncall("fgetc", x0); } - return (int)mh$.invokeExact(x0, x1); + return (int)mh$.invokeExact(x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class fputs { + private static class fgetpos { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_INT, somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("fputs"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fgetpos"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4673,43 +4934,43 @@ private static class fputs { /** * Function descriptor for: * {@snippet lang=c : - * int fputs(const char *restrict, FILE *restrict) + * int fgetpos(FILE *restrict, fpos_t *) * } */ - public static FunctionDescriptor fputs$descriptor() { - return fputs.DESC; + public static FunctionDescriptor fgetpos$descriptor() { + return fgetpos.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int fputs(const char *restrict, FILE *restrict) + * int fgetpos(FILE *restrict, fpos_t *) * } */ - public static MethodHandle fputs$handle() { - return fputs.HANDLE; + public static MethodHandle fgetpos$handle() { + return fgetpos.HANDLE; } /** * Address for: * {@snippet lang=c : - * int fputs(const char *restrict, FILE *restrict) + * int fgetpos(FILE *restrict, fpos_t *) * } */ - public static MemorySegment fputs$address() { - return fputs.ADDR; + public static MemorySegment fgetpos$address() { + return fgetpos.ADDR; } /** * {@snippet lang=c : - * int fputs(const char *restrict, FILE *restrict) + * int fgetpos(FILE *restrict, fpos_t *) * } */ - public static int fputs(MemorySegment x0, MemorySegment x1) { - var mh$ = fputs.HANDLE; + public static int fgetpos(MemorySegment x0, MemorySegment x1) { + var mh$ = fgetpos.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("fputs", x0, x1); + traceDowncall("fgetpos", x0, x1); } return (int)mh$.invokeExact(x0, x1); } catch (Throwable ex$) { @@ -4717,16 +4978,15 @@ public static int fputs(MemorySegment x0, MemorySegment x1) { } } - private static class fread { + private static class fgets { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_LONG, somelib_h.C_POINTER, - somelib_h.C_LONG, - somelib_h.C_LONG, + somelib_h.C_POINTER, + somelib_h.C_INT, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("fread"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fgets"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4734,59 +4994,58 @@ private static class fread { /** * Function descriptor for: * {@snippet lang=c : - * unsigned long fread(void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) + * char *fgets(char *restrict, int, FILE *) * } */ - public static FunctionDescriptor fread$descriptor() { - return fread.DESC; + public static FunctionDescriptor fgets$descriptor() { + return fgets.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * unsigned long fread(void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) + * char *fgets(char *restrict, int, FILE *) * } */ - public static MethodHandle fread$handle() { - return fread.HANDLE; + public static MethodHandle fgets$handle() { + return fgets.HANDLE; } /** * Address for: * {@snippet lang=c : - * unsigned long fread(void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) + * char *fgets(char *restrict, int, FILE *) * } */ - public static MemorySegment fread$address() { - return fread.ADDR; + public static MemorySegment fgets$address() { + return fgets.ADDR; } /** * {@snippet lang=c : - * unsigned long fread(void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) + * char *fgets(char *restrict, int, FILE *) * } */ - public static long fread(MemorySegment __ptr, long __size, long __nitems, MemorySegment __stream) { - var mh$ = fread.HANDLE; + public static MemorySegment fgets(MemorySegment x0, int x1, MemorySegment x2) { + var mh$ = fgets.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("fread", __ptr, __size, __nitems, __stream); + traceDowncall("fgets", x0, x1, x2); } - return (long)mh$.invokeExact(__ptr, __size, __nitems, __stream); + return (MemorySegment)mh$.invokeExact(x0, x1, x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class freopen { + private static class fopen { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("freopen"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fopen"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4794,45 +5053,45 @@ private static class freopen { /** * Function descriptor for: * {@snippet lang=c : - * FILE *freopen(const char *restrict, const char *restrict, FILE *restrict) + * FILE *fopen(const char *restrict __filename, const char *restrict __mode) * } */ - public static FunctionDescriptor freopen$descriptor() { - return freopen.DESC; + public static FunctionDescriptor fopen$descriptor() { + return fopen.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * FILE *freopen(const char *restrict, const char *restrict, FILE *restrict) + * FILE *fopen(const char *restrict __filename, const char *restrict __mode) * } */ - public static MethodHandle freopen$handle() { - return freopen.HANDLE; + public static MethodHandle fopen$handle() { + return fopen.HANDLE; } /** * Address for: * {@snippet lang=c : - * FILE *freopen(const char *restrict, const char *restrict, FILE *restrict) + * FILE *fopen(const char *restrict __filename, const char *restrict __mode) * } */ - public static MemorySegment freopen$address() { - return freopen.ADDR; + public static MemorySegment fopen$address() { + return fopen.ADDR; } /** * {@snippet lang=c : - * FILE *freopen(const char *restrict, const char *restrict, FILE *restrict) + * FILE *fopen(const char *restrict __filename, const char *restrict __mode) * } */ - public static MemorySegment freopen(MemorySegment x0, MemorySegment x1, MemorySegment x2) { - var mh$ = freopen.HANDLE; + public static MemorySegment fopen(MemorySegment __filename, MemorySegment __mode) { + var mh$ = fopen.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("freopen", x0, x1, x2); + traceDowncall("fopen", __filename, __mode); } - return (MemorySegment)mh$.invokeExact(x0, x1, x2); + return (MemorySegment)mh$.invokeExact(__filename, __mode); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -4841,22 +5100,22 @@ public static MemorySegment freopen(MemorySegment x0, MemorySegment x1, MemorySe /** * Variadic invoker class for: * {@snippet lang=c : - * int fscanf(FILE *restrict, const char *restrict, ...) + * int fprintf(FILE *restrict, const char *restrict, ...) * } */ - public static class fscanf { + public static class fprintf { private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( somelib_h.C_INT, somelib_h.C_POINTER, somelib_h.C_POINTER ); - private static final MemorySegment ADDR = somelib_h.findOrThrow("fscanf"); + private static final MemorySegment ADDR = somelib_h.findOrThrow("fprintf"); private final MethodHandle handle; private final FunctionDescriptor descriptor; private final MethodHandle spreader; - private fscanf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + private fprintf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { this.handle = handle; this.descriptor = descriptor; this.spreader = spreader; @@ -4865,15 +5124,15 @@ private fscanf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle /** * Variadic invoker factory for: * {@snippet lang=c : - * int fscanf(FILE *restrict, const char *restrict, ...) + * int fprintf(FILE *restrict, const char *restrict, ...) * } */ - public static fscanf makeInvoker(MemoryLayout... layouts) { + public static fprintf makeInvoker(MemoryLayout... layouts) { FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new fscanf(mh$, desc$, spreader$); + return new fprintf(mh$, desc$, spreader$); } /** @@ -4900,7 +5159,7 @@ public FunctionDescriptor descriptor() { public int apply(MemorySegment x0, MemorySegment x1, Object... x2) { try { if (TRACE_DOWNCALLS) { - traceDowncall("fscanf", x0, x1, x2); + traceDowncall("fprintf", x0, x1, x2); } return (int)spreader.invokeExact(x0, x1, x2); } catch(IllegalArgumentException | ClassCastException ex$) { @@ -4911,15 +5170,14 @@ public int apply(MemorySegment x0, MemorySegment x1, Object... x2) { } } - private static class fseek { + private static class fputc { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_INT, - somelib_h.C_POINTER, - somelib_h.C_LONG, - somelib_h.C_INT + somelib_h.C_INT, + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("fseek"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fputc"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4927,58 +5185,58 @@ private static class fseek { /** * Function descriptor for: * {@snippet lang=c : - * int fseek(FILE *, long, int) + * int fputc(int, FILE *) * } */ - public static FunctionDescriptor fseek$descriptor() { - return fseek.DESC; + public static FunctionDescriptor fputc$descriptor() { + return fputc.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int fseek(FILE *, long, int) + * int fputc(int, FILE *) * } */ - public static MethodHandle fseek$handle() { - return fseek.HANDLE; + public static MethodHandle fputc$handle() { + return fputc.HANDLE; } /** * Address for: * {@snippet lang=c : - * int fseek(FILE *, long, int) + * int fputc(int, FILE *) * } */ - public static MemorySegment fseek$address() { - return fseek.ADDR; + public static MemorySegment fputc$address() { + return fputc.ADDR; } /** * {@snippet lang=c : - * int fseek(FILE *, long, int) + * int fputc(int, FILE *) * } */ - public static int fseek(MemorySegment x0, long x1, int x2) { - var mh$ = fseek.HANDLE; + public static int fputc(int x0, MemorySegment x1) { + var mh$ = fputc.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("fseek", x0, x1, x2); + traceDowncall("fputc", x0, x1); } - return (int)mh$.invokeExact(x0, x1, x2); + return (int)mh$.invokeExact(x0, x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class fsetpos { + private static class fputs { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_INT, somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("fsetpos"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fputs"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -4986,43 +5244,43 @@ private static class fsetpos { /** * Function descriptor for: * {@snippet lang=c : - * int fsetpos(FILE *, const fpos_t *) + * int fputs(const char *restrict, FILE *restrict) * } */ - public static FunctionDescriptor fsetpos$descriptor() { - return fsetpos.DESC; + public static FunctionDescriptor fputs$descriptor() { + return fputs.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int fsetpos(FILE *, const fpos_t *) + * int fputs(const char *restrict, FILE *restrict) * } */ - public static MethodHandle fsetpos$handle() { - return fsetpos.HANDLE; + public static MethodHandle fputs$handle() { + return fputs.HANDLE; } /** * Address for: * {@snippet lang=c : - * int fsetpos(FILE *, const fpos_t *) + * int fputs(const char *restrict, FILE *restrict) * } */ - public static MemorySegment fsetpos$address() { - return fsetpos.ADDR; + public static MemorySegment fputs$address() { + return fputs.ADDR; } /** * {@snippet lang=c : - * int fsetpos(FILE *, const fpos_t *) + * int fputs(const char *restrict, FILE *restrict) * } */ - public static int fsetpos(MemorySegment x0, MemorySegment x1) { - var mh$ = fsetpos.HANDLE; + public static int fputs(MemorySegment x0, MemorySegment x1) { + var mh$ = fputs.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("fsetpos", x0, x1); + traceDowncall("fputs", x0, x1); } return (int)mh$.invokeExact(x0, x1); } catch (Throwable ex$) { @@ -5030,13 +5288,16 @@ public static int fsetpos(MemorySegment x0, MemorySegment x1) { } } - private static class ftell { + private static class fread { public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_LONG, + somelib_h.C_POINTER, + somelib_h.C_LONG, somelib_h.C_LONG, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("ftell"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fread"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -5044,60 +5305,59 @@ private static class ftell { /** * Function descriptor for: * {@snippet lang=c : - * long ftell(FILE *) + * unsigned long fread(void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) * } */ - public static FunctionDescriptor ftell$descriptor() { - return ftell.DESC; + public static FunctionDescriptor fread$descriptor() { + return fread.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * long ftell(FILE *) + * unsigned long fread(void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) * } */ - public static MethodHandle ftell$handle() { - return ftell.HANDLE; + public static MethodHandle fread$handle() { + return fread.HANDLE; } /** * Address for: * {@snippet lang=c : - * long ftell(FILE *) + * unsigned long fread(void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) * } */ - public static MemorySegment ftell$address() { - return ftell.ADDR; + public static MemorySegment fread$address() { + return fread.ADDR; } /** * {@snippet lang=c : - * long ftell(FILE *) + * unsigned long fread(void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) * } */ - public static long ftell(MemorySegment x0) { - var mh$ = ftell.HANDLE; + public static long fread(MemorySegment __ptr, long __size, long __nitems, MemorySegment __stream) { + var mh$ = fread.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("ftell", x0); + traceDowncall("fread", __ptr, __size, __nitems, __stream); } - return (long)mh$.invokeExact(x0); + return (long)mh$.invokeExact(__ptr, __size, __nitems, __stream); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class fwrite { + private static class freopen { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_LONG, somelib_h.C_POINTER, - somelib_h.C_LONG, - somelib_h.C_LONG, + somelib_h.C_POINTER, + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("fwrite"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("freopen"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -5105,57 +5365,132 @@ private static class fwrite { /** * Function descriptor for: * {@snippet lang=c : - * unsigned long fwrite(const void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) + * FILE *freopen(const char *restrict, const char *restrict, FILE *restrict) * } */ - public static FunctionDescriptor fwrite$descriptor() { - return fwrite.DESC; + public static FunctionDescriptor freopen$descriptor() { + return freopen.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * unsigned long fwrite(const void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) + * FILE *freopen(const char *restrict, const char *restrict, FILE *restrict) * } */ - public static MethodHandle fwrite$handle() { - return fwrite.HANDLE; + public static MethodHandle freopen$handle() { + return freopen.HANDLE; } /** * Address for: * {@snippet lang=c : - * unsigned long fwrite(const void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) + * FILE *freopen(const char *restrict, const char *restrict, FILE *restrict) * } */ - public static MemorySegment fwrite$address() { - return fwrite.ADDR; + public static MemorySegment freopen$address() { + return freopen.ADDR; } /** * {@snippet lang=c : - * unsigned long fwrite(const void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) + * FILE *freopen(const char *restrict, const char *restrict, FILE *restrict) * } */ - public static long fwrite(MemorySegment __ptr, long __size, long __nitems, MemorySegment __stream) { - var mh$ = fwrite.HANDLE; + public static MemorySegment freopen(MemorySegment x0, MemorySegment x1, MemorySegment x2) { + var mh$ = freopen.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("fwrite", __ptr, __size, __nitems, __stream); + traceDowncall("freopen", x0, x1, x2); } - return (long)mh$.invokeExact(__ptr, __size, __nitems, __stream); + return (MemorySegment)mh$.invokeExact(x0, x1, x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class getc { + /** + * Variadic invoker class for: + * {@snippet lang=c : + * int fscanf(FILE *restrict, const char *restrict, ...) + * } + */ + public static class fscanf { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); + private static final MemorySegment ADDR = somelib_h.findOrThrow("fscanf"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private fscanf(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * int fscanf(FILE *restrict, const char *restrict, ...) + * } + */ + public static fscanf makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new fscanf(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public int apply(MemorySegment x0, MemorySegment x1, Object... x2) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fscanf", x0, x1, x2); + } + return (int)spreader.invokeExact(x0, x1, x2); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static class fseek { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_INT, - somelib_h.C_POINTER + somelib_h.C_POINTER, + somelib_h.C_LONG, + somelib_h.C_INT ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("getc"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fseek"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -5163,55 +5498,58 @@ private static class getc { /** * Function descriptor for: * {@snippet lang=c : - * int getc(FILE *) + * int fseek(FILE *, long, int) * } */ - public static FunctionDescriptor getc$descriptor() { - return getc.DESC; + public static FunctionDescriptor fseek$descriptor() { + return fseek.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int getc(FILE *) + * int fseek(FILE *, long, int) * } */ - public static MethodHandle getc$handle() { - return getc.HANDLE; + public static MethodHandle fseek$handle() { + return fseek.HANDLE; } /** * Address for: * {@snippet lang=c : - * int getc(FILE *) + * int fseek(FILE *, long, int) * } */ - public static MemorySegment getc$address() { - return getc.ADDR; + public static MemorySegment fseek$address() { + return fseek.ADDR; } /** * {@snippet lang=c : - * int getc(FILE *) + * int fseek(FILE *, long, int) * } */ - public static int getc(MemorySegment x0) { - var mh$ = getc.HANDLE; + public static int fseek(MemorySegment x0, long x1, int x2) { + var mh$ = fseek.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("getc", x0); + traceDowncall("fseek", x0, x1, x2); } - return (int)mh$.invokeExact(x0); + return (int)mh$.invokeExact(x0, x1, x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class getchar { + private static class fsetpos { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_INT ); + somelib_h.C_INT, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("getchar"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("fsetpos"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -5219,7 +5557,240 @@ private static class getchar { /** * Function descriptor for: * {@snippet lang=c : - * int getchar() + * int fsetpos(FILE *, const fpos_t *) + * } + */ + public static FunctionDescriptor fsetpos$descriptor() { + return fsetpos.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int fsetpos(FILE *, const fpos_t *) + * } + */ + public static MethodHandle fsetpos$handle() { + return fsetpos.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int fsetpos(FILE *, const fpos_t *) + * } + */ + public static MemorySegment fsetpos$address() { + return fsetpos.ADDR; + } + + /** + * {@snippet lang=c : + * int fsetpos(FILE *, const fpos_t *) + * } + */ + public static int fsetpos(MemorySegment x0, MemorySegment x1) { + var mh$ = fsetpos.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fsetpos", x0, x1); + } + return (int)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class ftell { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_LONG, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("ftell"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * long ftell(FILE *) + * } + */ + public static FunctionDescriptor ftell$descriptor() { + return ftell.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * long ftell(FILE *) + * } + */ + public static MethodHandle ftell$handle() { + return ftell.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * long ftell(FILE *) + * } + */ + public static MemorySegment ftell$address() { + return ftell.ADDR; + } + + /** + * {@snippet lang=c : + * long ftell(FILE *) + * } + */ + public static long ftell(MemorySegment x0) { + var mh$ = ftell.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("ftell", x0); + } + return (long)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class fwrite { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_LONG, + somelib_h.C_POINTER, + somelib_h.C_LONG, + somelib_h.C_LONG, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("fwrite"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * unsigned long fwrite(const void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) + * } + */ + public static FunctionDescriptor fwrite$descriptor() { + return fwrite.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * unsigned long fwrite(const void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) + * } + */ + public static MethodHandle fwrite$handle() { + return fwrite.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * unsigned long fwrite(const void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) + * } + */ + public static MemorySegment fwrite$address() { + return fwrite.ADDR; + } + + /** + * {@snippet lang=c : + * unsigned long fwrite(const void *restrict __ptr, size_t __size, size_t __nitems, FILE *restrict __stream) + * } + */ + public static long fwrite(MemorySegment __ptr, long __size, long __nitems, MemorySegment __stream) { + var mh$ = fwrite.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("fwrite", __ptr, __size, __nitems, __stream); + } + return (long)mh$.invokeExact(__ptr, __size, __nitems, __stream); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class getc { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT, + somelib_h.C_POINTER + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("getc"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int getc(FILE *) + * } + */ + public static FunctionDescriptor getc$descriptor() { + return getc.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * int getc(FILE *) + * } + */ + public static MethodHandle getc$handle() { + return getc.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * int getc(FILE *) + * } + */ + public static MemorySegment getc$address() { + return getc.ADDR; + } + + /** + * {@snippet lang=c : + * int getc(FILE *) + * } + */ + public static int getc(MemorySegment x0) { + var mh$ = getc.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("getc", x0); + } + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class getchar { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_INT ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("getchar"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * int getchar() * } */ public static FunctionDescriptor getchar$descriptor() { @@ -9267,354 +9838,43 @@ public static int __vsnprintf_chk(MemorySegment x0, long x1, int x2, long x3, Me throw new AssertionError("should not reach here", ex$); } } + private static final int UnimportedEnum_A = (int)0L; /** * {@snippet lang=c : - * typedef unsigned char uint8_t - * } - */ - public static final OfByte uint8_t = somelib_h.C_CHAR; - /** - * {@snippet lang=c : - * typedef unsigned short uint16_t + * enum UnimportedEnum.UnimportedEnum_A = 0 * } */ - public static final OfShort uint16_t = somelib_h.C_SHORT; + public static int UnimportedEnum_A() { + return UnimportedEnum_A; + } + private static final int UnimportedEnum_B = (int)1L; /** * {@snippet lang=c : - * typedef unsigned int uint32_t + * enum UnimportedEnum.UnimportedEnum_B = 1 * } */ - public static final OfInt uint32_t = somelib_h.C_INT; + public static int UnimportedEnum_B() { + return UnimportedEnum_B; + } + private static final int UnimportedEnum_C = (int)2L; /** * {@snippet lang=c : - * typedef unsigned long long uint64_t + * enum UnimportedEnum.UnimportedEnum_C = 2 * } */ - public static final OfLong uint64_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef int8_t int_least8_t - * } - */ - public static final OfByte int_least8_t = somelib_h.C_CHAR; - /** - * {@snippet lang=c : - * typedef int16_t int_least16_t - * } - */ - public static final OfShort int_least16_t = somelib_h.C_SHORT; - /** - * {@snippet lang=c : - * typedef int32_t int_least32_t - * } - */ - public static final OfInt int_least32_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef int64_t int_least64_t - * } - */ - public static final OfLong int_least64_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef uint8_t uint_least8_t - * } - */ - public static final OfByte uint_least8_t = somelib_h.C_CHAR; - /** - * {@snippet lang=c : - * typedef uint16_t uint_least16_t - * } - */ - public static final OfShort uint_least16_t = somelib_h.C_SHORT; - /** - * {@snippet lang=c : - * typedef uint32_t uint_least32_t - * } - */ - public static final OfInt uint_least32_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef uint64_t uint_least64_t - * } - */ - public static final OfLong uint_least64_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef int8_t int_fast8_t - * } - */ - public static final OfByte int_fast8_t = somelib_h.C_CHAR; - /** - * {@snippet lang=c : - * typedef int16_t int_fast16_t - * } - */ - public static final OfShort int_fast16_t = somelib_h.C_SHORT; - /** - * {@snippet lang=c : - * typedef int32_t int_fast32_t - * } - */ - public static final OfInt int_fast32_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef int64_t int_fast64_t - * } - */ - public static final OfLong int_fast64_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef uint8_t uint_fast8_t - * } - */ - public static final OfByte uint_fast8_t = somelib_h.C_CHAR; - /** - * {@snippet lang=c : - * typedef uint16_t uint_fast16_t - * } - */ - public static final OfShort uint_fast16_t = somelib_h.C_SHORT; - /** - * {@snippet lang=c : - * typedef uint32_t uint_fast32_t - * } - */ - public static final OfInt uint_fast32_t = somelib_h.C_INT; - /** - * {@snippet lang=c : - * typedef uint64_t uint_fast64_t - * } - */ - public static final OfLong uint_fast64_t = somelib_h.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef long intmax_t - * } - */ - public static final OfLong intmax_t = somelib_h.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned long uintmax_t - * } - */ - public static final OfLong uintmax_t = somelib_h.C_LONG; - /** - * {@snippet lang=c : - * typedef long ptrdiff_t - * } - */ - public static final OfLong ptrdiff_t = somelib_h.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned long rsize_t - * } - */ - public static final OfLong rsize_t = somelib_h.C_LONG; - /** - * {@snippet lang=c : - * typedef int wchar_t - * } - */ - public static final OfInt wchar_t = somelib_h.C_INT; - - private static class __assert_rtn { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_INT, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("__assert_rtn"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * void __assert_rtn(const char *, const char *, int, const char *) - * } - */ - public static FunctionDescriptor __assert_rtn$descriptor() { - return __assert_rtn.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * void __assert_rtn(const char *, const char *, int, const char *) - * } - */ - public static MethodHandle __assert_rtn$handle() { - return __assert_rtn.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * void __assert_rtn(const char *, const char *, int, const char *) - * } - */ - public static MemorySegment __assert_rtn$address() { - return __assert_rtn.ADDR; - } - - /** - * {@snippet lang=c : - * void __assert_rtn(const char *, const char *, int, const char *) - * } - */ - public static void __assert_rtn(MemorySegment x0, MemorySegment x1, int x2, MemorySegment x3) { - var mh$ = __assert_rtn.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("__assert_rtn", x0, x1, x2, x3); - } - mh$.invokeExact(x0, x1, x2, x3); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - /** - * {@snippet lang=c : - * typedef uint_least16_t char16_t - * } - */ - public static final OfShort char16_t = somelib_h.C_SHORT; - /** - * {@snippet lang=c : - * typedef uint_least32_t char32_t - * } - */ - public static final OfInt char32_t = somelib_h.C_INT; - - private static class diplomat_is_str { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_BOOL, - somelib_h.C_POINTER, - somelib_h.C_LONG - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_is_str"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * bool diplomat_is_str(const char *buf, size_t len) - * } - */ - public static FunctionDescriptor diplomat_is_str$descriptor() { - return diplomat_is_str.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * bool diplomat_is_str(const char *buf, size_t len) - * } - */ - public static MethodHandle diplomat_is_str$handle() { - return diplomat_is_str.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * bool diplomat_is_str(const char *buf, size_t len) - * } - */ - public static MemorySegment diplomat_is_str$address() { - return diplomat_is_str.ADDR; - } - - /** - * {@snippet lang=c : - * bool diplomat_is_str(const char *buf, size_t len) - * } - */ - public static boolean diplomat_is_str(MemorySegment buf, long len) { - var mh$ = diplomat_is_str.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("diplomat_is_str", buf, len); - } - return (boolean)mh$.invokeExact(buf, len); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class diplomat_simple_write { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - DiplomatWrite.layout(), - somelib_h.C_POINTER, - somelib_h.C_LONG - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_simple_write"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) - * } - */ - public static FunctionDescriptor diplomat_simple_write$descriptor() { - return diplomat_simple_write.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) - * } - */ - public static MethodHandle diplomat_simple_write$handle() { - return diplomat_simple_write.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) - * } - */ - public static MemorySegment diplomat_simple_write$address() { - return diplomat_simple_write.ADDR; - } - - /** - * {@snippet lang=c : - * DiplomatWrite diplomat_simple_write(char *buf, size_t buf_size) - * } - */ - public static MemorySegment diplomat_simple_write(SegmentAllocator allocator, MemorySegment buf, long buf_size) { - var mh$ = diplomat_simple_write.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("diplomat_simple_write", allocator, buf, buf_size); - } - return (MemorySegment)mh$.invokeExact(allocator, buf, buf_size); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } + public static int UnimportedEnum_C() { + return UnimportedEnum_C; } - private static class diplomat_buffer_write_create { + private static class BorrowedFields_from_bar_and_strings { public static final FunctionDescriptor DESC = FunctionDescriptor.of( + BorrowedFields.layout(), somelib_h.C_POINTER, - somelib_h.C_LONG + DiplomatString16View.layout(), + DiplomatStringView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_create"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("BorrowedFields_from_bar_and_strings"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -9622,172 +9882,59 @@ private static class diplomat_buffer_write_create { /** * Function descriptor for: * {@snippet lang=c : - * DiplomatWrite *diplomat_buffer_write_create(size_t cap) + * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, DiplomatString16View dstr16, DiplomatStringView utf8_str) * } */ - public static FunctionDescriptor diplomat_buffer_write_create$descriptor() { - return diplomat_buffer_write_create.DESC; + public static FunctionDescriptor BorrowedFields_from_bar_and_strings$descriptor() { + return BorrowedFields_from_bar_and_strings.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * DiplomatWrite *diplomat_buffer_write_create(size_t cap) + * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, DiplomatString16View dstr16, DiplomatStringView utf8_str) * } */ - public static MethodHandle diplomat_buffer_write_create$handle() { - return diplomat_buffer_write_create.HANDLE; + public static MethodHandle BorrowedFields_from_bar_and_strings$handle() { + return BorrowedFields_from_bar_and_strings.HANDLE; } /** * Address for: * {@snippet lang=c : - * DiplomatWrite *diplomat_buffer_write_create(size_t cap) + * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, DiplomatString16View dstr16, DiplomatStringView utf8_str) * } */ - public static MemorySegment diplomat_buffer_write_create$address() { - return diplomat_buffer_write_create.ADDR; + public static MemorySegment BorrowedFields_from_bar_and_strings$address() { + return BorrowedFields_from_bar_and_strings.ADDR; } /** * {@snippet lang=c : - * DiplomatWrite *diplomat_buffer_write_create(size_t cap) + * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, DiplomatString16View dstr16, DiplomatStringView utf8_str) * } */ - public static MemorySegment diplomat_buffer_write_create(long cap) { - var mh$ = diplomat_buffer_write_create.HANDLE; + public static MemorySegment BorrowedFields_from_bar_and_strings(SegmentAllocator allocator, MemorySegment bar, MemorySegment dstr16, MemorySegment utf8_str) { + var mh$ = BorrowedFields_from_bar_and_strings.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("diplomat_buffer_write_create", cap); + traceDowncall("BorrowedFields_from_bar_and_strings", allocator, bar, dstr16, utf8_str); } - return (MemorySegment)mh$.invokeExact(cap); + return (MemorySegment)mh$.invokeExact(allocator, bar, dstr16, utf8_str); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class diplomat_buffer_write_get_bytes { + private static class BorrowedFieldsWithBounds_from_foo_and_strings { public static final FunctionDescriptor DESC = FunctionDescriptor.of( + BorrowedFieldsWithBounds.layout(), somelib_h.C_POINTER, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_get_bytes"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) - * } - */ - public static FunctionDescriptor diplomat_buffer_write_get_bytes$descriptor() { - return diplomat_buffer_write_get_bytes.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) - * } - */ - public static MethodHandle diplomat_buffer_write_get_bytes$handle() { - return diplomat_buffer_write_get_bytes.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) - * } - */ - public static MemorySegment diplomat_buffer_write_get_bytes$address() { - return diplomat_buffer_write_get_bytes.ADDR; - } - - /** - * {@snippet lang=c : - * char *diplomat_buffer_write_get_bytes(DiplomatWrite *t) - * } - */ - public static MemorySegment diplomat_buffer_write_get_bytes(MemorySegment t) { - var mh$ = diplomat_buffer_write_get_bytes.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("diplomat_buffer_write_get_bytes", t); - } - return (MemorySegment)mh$.invokeExact(t); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class diplomat_buffer_write_len { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_LONG, - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_len"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * size_t diplomat_buffer_write_len(DiplomatWrite *t) - * } - */ - public static FunctionDescriptor diplomat_buffer_write_len$descriptor() { - return diplomat_buffer_write_len.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * size_t diplomat_buffer_write_len(DiplomatWrite *t) - * } - */ - public static MethodHandle diplomat_buffer_write_len$handle() { - return diplomat_buffer_write_len.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * size_t diplomat_buffer_write_len(DiplomatWrite *t) - * } - */ - public static MemorySegment diplomat_buffer_write_len$address() { - return diplomat_buffer_write_len.ADDR; - } - - /** - * {@snippet lang=c : - * size_t diplomat_buffer_write_len(DiplomatWrite *t) - * } - */ - public static long diplomat_buffer_write_len(MemorySegment t) { - var mh$ = diplomat_buffer_write_len.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("diplomat_buffer_write_len", t); - } - return (long)mh$.invokeExact(t); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class diplomat_buffer_write_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER + DiplomatString16View.layout(), + DiplomatStringView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("diplomat_buffer_write_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("BorrowedFieldsWithBounds_from_foo_and_strings"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -9795,57 +9942,62 @@ private static class diplomat_buffer_write_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void diplomat_buffer_write_destroy(DiplomatWrite *t) + * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, DiplomatString16View dstr16_x, DiplomatStringView utf8_str_z) * } */ - public static FunctionDescriptor diplomat_buffer_write_destroy$descriptor() { - return diplomat_buffer_write_destroy.DESC; + public static FunctionDescriptor BorrowedFieldsWithBounds_from_foo_and_strings$descriptor() { + return BorrowedFieldsWithBounds_from_foo_and_strings.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void diplomat_buffer_write_destroy(DiplomatWrite *t) + * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, DiplomatString16View dstr16_x, DiplomatStringView utf8_str_z) * } */ - public static MethodHandle diplomat_buffer_write_destroy$handle() { - return diplomat_buffer_write_destroy.HANDLE; + public static MethodHandle BorrowedFieldsWithBounds_from_foo_and_strings$handle() { + return BorrowedFieldsWithBounds_from_foo_and_strings.HANDLE; } /** * Address for: * {@snippet lang=c : - * void diplomat_buffer_write_destroy(DiplomatWrite *t) + * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, DiplomatString16View dstr16_x, DiplomatStringView utf8_str_z) * } */ - public static MemorySegment diplomat_buffer_write_destroy$address() { - return diplomat_buffer_write_destroy.ADDR; + public static MemorySegment BorrowedFieldsWithBounds_from_foo_and_strings$address() { + return BorrowedFieldsWithBounds_from_foo_and_strings.ADDR; } /** * {@snippet lang=c : - * void diplomat_buffer_write_destroy(DiplomatWrite *t) + * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, DiplomatString16View dstr16_x, DiplomatStringView utf8_str_z) * } */ - public static void diplomat_buffer_write_destroy(MemorySegment t) { - var mh$ = diplomat_buffer_write_destroy.HANDLE; + public static MemorySegment BorrowedFieldsWithBounds_from_foo_and_strings(SegmentAllocator allocator, MemorySegment foo, MemorySegment dstr16_x, MemorySegment utf8_str_z) { + var mh$ = BorrowedFieldsWithBounds_from_foo_and_strings.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("diplomat_buffer_write_destroy", t); + traceDowncall("BorrowedFieldsWithBounds_from_foo_and_strings", allocator, foo, dstr16_x, utf8_str_z); } - mh$.invokeExact(t); + return (MemorySegment)mh$.invokeExact(allocator, foo, dstr16_x, utf8_str_z); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class RefList_node { + private static class NestedBorrowedFields_from_bar_and_foo_and_strings { public static final FunctionDescriptor DESC = FunctionDescriptor.of( + NestedBorrowedFields.layout(), somelib_h.C_POINTER, - somelib_h.C_POINTER + somelib_h.C_POINTER, + DiplomatString16View.layout(), + DiplomatString16View.layout(), + DiplomatStringView.layout(), + DiplomatStringView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("RefList_node"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("NestedBorrowedFields_from_bar_and_foo_and_strings"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -9853,56 +10005,55 @@ private static class RefList_node { /** * Function descriptor for: * {@snippet lang=c : - * RefList *RefList_node(const RefListParameter *data) + * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, DiplomatString16View dstr16_x, DiplomatString16View dstr16_z, DiplomatStringView utf8_str_y, DiplomatStringView utf8_str_z) * } */ - public static FunctionDescriptor RefList_node$descriptor() { - return RefList_node.DESC; + public static FunctionDescriptor NestedBorrowedFields_from_bar_and_foo_and_strings$descriptor() { + return NestedBorrowedFields_from_bar_and_foo_and_strings.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * RefList *RefList_node(const RefListParameter *data) + * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, DiplomatString16View dstr16_x, DiplomatString16View dstr16_z, DiplomatStringView utf8_str_y, DiplomatStringView utf8_str_z) * } */ - public static MethodHandle RefList_node$handle() { - return RefList_node.HANDLE; + public static MethodHandle NestedBorrowedFields_from_bar_and_foo_and_strings$handle() { + return NestedBorrowedFields_from_bar_and_foo_and_strings.HANDLE; } /** * Address for: * {@snippet lang=c : - * RefList *RefList_node(const RefListParameter *data) + * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, DiplomatString16View dstr16_x, DiplomatString16View dstr16_z, DiplomatStringView utf8_str_y, DiplomatStringView utf8_str_z) * } */ - public static MemorySegment RefList_node$address() { - return RefList_node.ADDR; + public static MemorySegment NestedBorrowedFields_from_bar_and_foo_and_strings$address() { + return NestedBorrowedFields_from_bar_and_foo_and_strings.ADDR; } /** * {@snippet lang=c : - * RefList *RefList_node(const RefListParameter *data) + * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, DiplomatString16View dstr16_x, DiplomatString16View dstr16_z, DiplomatStringView utf8_str_y, DiplomatStringView utf8_str_z) * } */ - public static MemorySegment RefList_node(MemorySegment data) { - var mh$ = RefList_node.HANDLE; + public static MemorySegment NestedBorrowedFields_from_bar_and_foo_and_strings(SegmentAllocator allocator, MemorySegment bar, MemorySegment foo, MemorySegment dstr16_x, MemorySegment dstr16_z, MemorySegment utf8_str_y, MemorySegment utf8_str_z) { + var mh$ = NestedBorrowedFields_from_bar_and_foo_and_strings.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("RefList_node", data); + traceDowncall("NestedBorrowedFields_from_bar_and_foo_and_strings", allocator, bar, foo, dstr16_x, dstr16_z, utf8_str_y, utf8_str_z); } - return (MemorySegment)mh$.invokeExact(data); + return (MemorySegment)mh$.invokeExact(allocator, bar, foo, dstr16_x, dstr16_z, utf8_str_y, utf8_str_z); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class RefList_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER - ); + private static class CyclicStructA_get_b { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + CyclicStructB.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("RefList_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("CyclicStructA_get_b"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -9910,59 +10061,55 @@ private static class RefList_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void RefList_destroy(RefList *self) + * CyclicStructB CyclicStructA_get_b() * } */ - public static FunctionDescriptor RefList_destroy$descriptor() { - return RefList_destroy.DESC; + public static FunctionDescriptor CyclicStructA_get_b$descriptor() { + return CyclicStructA_get_b.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void RefList_destroy(RefList *self) + * CyclicStructB CyclicStructA_get_b() * } */ - public static MethodHandle RefList_destroy$handle() { - return RefList_destroy.HANDLE; + public static MethodHandle CyclicStructA_get_b$handle() { + return CyclicStructA_get_b.HANDLE; } /** * Address for: * {@snippet lang=c : - * void RefList_destroy(RefList *self) + * CyclicStructB CyclicStructA_get_b() * } */ - public static MemorySegment RefList_destroy$address() { - return RefList_destroy.ADDR; + public static MemorySegment CyclicStructA_get_b$address() { + return CyclicStructA_get_b.ADDR; } /** * {@snippet lang=c : - * void RefList_destroy(RefList *self) + * CyclicStructB CyclicStructA_get_b() * } */ - public static void RefList_destroy(MemorySegment self) { - var mh$ = RefList_destroy.HANDLE; + public static MemorySegment CyclicStructA_get_b(SegmentAllocator allocator) { + var mh$ = CyclicStructA_get_b.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("RefList_destroy", self); + traceDowncall("CyclicStructA_get_b", allocator); } - mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(allocator); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class BorrowedFields_from_bar_and_strings { + private static class CyclicStructB_get_a { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - BorrowedFields.layout(), - somelib_h.C_POINTER, - DiplomatString16View.layout(), - DiplomatStringView.layout() - ); + CyclicStructA.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("BorrowedFields_from_bar_and_strings"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("CyclicStructB_get_a"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -9970,45 +10117,45 @@ private static class BorrowedFields_from_bar_and_strings { /** * Function descriptor for: * {@snippet lang=c : - * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, DiplomatString16View dstr16, DiplomatStringView utf8_str) + * CyclicStructA CyclicStructB_get_a() * } */ - public static FunctionDescriptor BorrowedFields_from_bar_and_strings$descriptor() { - return BorrowedFields_from_bar_and_strings.DESC; + public static FunctionDescriptor CyclicStructB_get_a$descriptor() { + return CyclicStructB_get_a.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, DiplomatString16View dstr16, DiplomatStringView utf8_str) + * CyclicStructA CyclicStructB_get_a() * } */ - public static MethodHandle BorrowedFields_from_bar_and_strings$handle() { - return BorrowedFields_from_bar_and_strings.HANDLE; + public static MethodHandle CyclicStructB_get_a$handle() { + return CyclicStructB_get_a.HANDLE; } /** * Address for: * {@snippet lang=c : - * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, DiplomatString16View dstr16, DiplomatStringView utf8_str) + * CyclicStructA CyclicStructB_get_a() * } */ - public static MemorySegment BorrowedFields_from_bar_and_strings$address() { - return BorrowedFields_from_bar_and_strings.ADDR; + public static MemorySegment CyclicStructB_get_a$address() { + return CyclicStructB_get_a.ADDR; } /** * {@snippet lang=c : - * BorrowedFields BorrowedFields_from_bar_and_strings(const Bar *bar, DiplomatString16View dstr16, DiplomatStringView utf8_str) + * CyclicStructA CyclicStructB_get_a() * } */ - public static MemorySegment BorrowedFields_from_bar_and_strings(SegmentAllocator allocator, MemorySegment bar, MemorySegment dstr16, MemorySegment utf8_str) { - var mh$ = BorrowedFields_from_bar_and_strings.HANDLE; + public static MemorySegment CyclicStructB_get_a(SegmentAllocator allocator) { + var mh$ = CyclicStructB_get_a.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("BorrowedFields_from_bar_and_strings", allocator, bar, dstr16, utf8_str); + traceDowncall("CyclicStructB_get_a", allocator); } - return (MemorySegment)mh$.invokeExact(allocator, bar, dstr16, utf8_str); + return (MemorySegment)mh$.invokeExact(allocator); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -10182,11 +10329,13 @@ public static byte MyStruct_into_a(MemorySegment self) { } } - private static class CyclicStructB_get_a { + private static class Bar_foo { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - CyclicStructA.layout() ); + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("CyclicStructB_get_a"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Bar_foo"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10194,74 +10343,56 @@ private static class CyclicStructB_get_a { /** * Function descriptor for: * {@snippet lang=c : - * CyclicStructA CyclicStructB_get_a() + * const Foo *Bar_foo(const Bar *self) * } */ - public static FunctionDescriptor CyclicStructB_get_a$descriptor() { - return CyclicStructB_get_a.DESC; + public static FunctionDescriptor Bar_foo$descriptor() { + return Bar_foo.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * CyclicStructA CyclicStructB_get_a() + * const Foo *Bar_foo(const Bar *self) * } */ - public static MethodHandle CyclicStructB_get_a$handle() { - return CyclicStructB_get_a.HANDLE; + public static MethodHandle Bar_foo$handle() { + return Bar_foo.HANDLE; } /** * Address for: * {@snippet lang=c : - * CyclicStructA CyclicStructB_get_a() + * const Foo *Bar_foo(const Bar *self) * } */ - public static MemorySegment CyclicStructB_get_a$address() { - return CyclicStructB_get_a.ADDR; + public static MemorySegment Bar_foo$address() { + return Bar_foo.ADDR; } /** * {@snippet lang=c : - * CyclicStructA CyclicStructB_get_a() + * const Foo *Bar_foo(const Bar *self) * } */ - public static MemorySegment CyclicStructB_get_a(SegmentAllocator allocator) { - var mh$ = CyclicStructB_get_a.HANDLE; + public static MemorySegment Bar_foo(MemorySegment self) { + var mh$ = Bar_foo.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("CyclicStructB_get_a", allocator); + traceDowncall("Bar_foo", self); } - return (MemorySegment)mh$.invokeExact(allocator); + return (MemorySegment)mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static final int ErrorEnum_Foo = (int)0L; - /** - * {@snippet lang=c : - * enum ErrorEnum.ErrorEnum_Foo = 0 - * } - */ - public static int ErrorEnum_Foo() { - return ErrorEnum_Foo; - } - private static final int ErrorEnum_Bar = (int)1L; - /** - * {@snippet lang=c : - * enum ErrorEnum.ErrorEnum_Bar = 1 - * } - */ - public static int ErrorEnum_Bar() { - return ErrorEnum_Bar; - } - private static class RefListParameter_destroy { + private static class Bar_destroy { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("RefListParameter_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Bar_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10269,82 +10400,57 @@ private static class RefListParameter_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void RefListParameter_destroy(RefListParameter *self) + * void Bar_destroy(Bar *self) * } */ - public static FunctionDescriptor RefListParameter_destroy$descriptor() { - return RefListParameter_destroy.DESC; + public static FunctionDescriptor Bar_destroy$descriptor() { + return Bar_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void RefListParameter_destroy(RefListParameter *self) + * void Bar_destroy(Bar *self) * } */ - public static MethodHandle RefListParameter_destroy$handle() { - return RefListParameter_destroy.HANDLE; + public static MethodHandle Bar_destroy$handle() { + return Bar_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * void RefListParameter_destroy(RefListParameter *self) + * void Bar_destroy(Bar *self) * } */ - public static MemorySegment RefListParameter_destroy$address() { - return RefListParameter_destroy.ADDR; + public static MemorySegment Bar_destroy$address() { + return Bar_destroy.ADDR; } /** * {@snippet lang=c : - * void RefListParameter_destroy(RefListParameter *self) + * void Bar_destroy(Bar *self) * } */ - public static void RefListParameter_destroy(MemorySegment self) { - var mh$ = RefListParameter_destroy.HANDLE; + public static void Bar_destroy(MemorySegment self) { + var mh$ = Bar_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("RefListParameter_destroy", self); + traceDowncall("Bar_destroy", self); } mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static final int UnimportedEnum_A = (int)0L; - /** - * {@snippet lang=c : - * enum UnimportedEnum.UnimportedEnum_A = 0 - * } - */ - public static int UnimportedEnum_A() { - return UnimportedEnum_A; - } - private static final int UnimportedEnum_B = (int)1L; - /** - * {@snippet lang=c : - * enum UnimportedEnum.UnimportedEnum_B = 1 - * } - */ - public static int UnimportedEnum_B() { - return UnimportedEnum_B; - } - private static final int UnimportedEnum_C = (int)2L; - /** - * {@snippet lang=c : - * enum UnimportedEnum.UnimportedEnum_C = 2 - * } - */ - public static int UnimportedEnum_C() { - return UnimportedEnum_C; - } - private static class Opaque_new { + private static class Foo_new { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER ); + somelib_h.C_POINTER, + DiplomatStringView.layout() + ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_new"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_new"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10352,57 +10458,57 @@ private static class Opaque_new { /** * Function descriptor for: * {@snippet lang=c : - * Opaque *Opaque_new() + * Foo *Foo_new(DiplomatStringView x) * } */ - public static FunctionDescriptor Opaque_new$descriptor() { - return Opaque_new.DESC; + public static FunctionDescriptor Foo_new$descriptor() { + return Foo_new.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Opaque *Opaque_new() + * Foo *Foo_new(DiplomatStringView x) * } */ - public static MethodHandle Opaque_new$handle() { - return Opaque_new.HANDLE; + public static MethodHandle Foo_new$handle() { + return Foo_new.HANDLE; } /** * Address for: * {@snippet lang=c : - * Opaque *Opaque_new() + * Foo *Foo_new(DiplomatStringView x) * } */ - public static MemorySegment Opaque_new$address() { - return Opaque_new.ADDR; + public static MemorySegment Foo_new$address() { + return Foo_new.ADDR; } /** * {@snippet lang=c : - * Opaque *Opaque_new() + * Foo *Foo_new(DiplomatStringView x) * } */ - public static MemorySegment Opaque_new() { - var mh$ = Opaque_new.HANDLE; + public static MemorySegment Foo_new(MemorySegment x) { + var mh$ = Foo_new.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_new"); + traceDowncall("Foo_new", x); } - return (MemorySegment)mh$.invokeExact(); + return (MemorySegment)mh$.invokeExact(x); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Opaque_from_str { + private static class Foo_get_bar { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - DiplomatStringView.layout() + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_from_str"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_get_bar"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10410,57 +10516,57 @@ private static class Opaque_from_str { /** * Function descriptor for: * {@snippet lang=c : - * Opaque *Opaque_from_str(DiplomatStringView input) + * Bar *Foo_get_bar(const Foo *self) * } */ - public static FunctionDescriptor Opaque_from_str$descriptor() { - return Opaque_from_str.DESC; + public static FunctionDescriptor Foo_get_bar$descriptor() { + return Foo_get_bar.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Opaque *Opaque_from_str(DiplomatStringView input) + * Bar *Foo_get_bar(const Foo *self) * } */ - public static MethodHandle Opaque_from_str$handle() { - return Opaque_from_str.HANDLE; + public static MethodHandle Foo_get_bar$handle() { + return Foo_get_bar.HANDLE; } /** * Address for: * {@snippet lang=c : - * Opaque *Opaque_from_str(DiplomatStringView input) + * Bar *Foo_get_bar(const Foo *self) * } */ - public static MemorySegment Opaque_from_str$address() { - return Opaque_from_str.ADDR; + public static MemorySegment Foo_get_bar$address() { + return Foo_get_bar.ADDR; } /** * {@snippet lang=c : - * Opaque *Opaque_from_str(DiplomatStringView input) + * Bar *Foo_get_bar(const Foo *self) * } */ - public static MemorySegment Opaque_from_str(MemorySegment input) { - var mh$ = Opaque_from_str.HANDLE; + public static MemorySegment Foo_get_bar(MemorySegment self) { + var mh$ = Foo_get_bar.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_from_str", input); + traceDowncall("Foo_get_bar", self); } - return (MemorySegment)mh$.invokeExact(input); + return (MemorySegment)mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Opaque_get_debug_str { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER, + private static class Foo_as_returning { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + BorrowedFieldsReturning.layout(), somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_get_debug_str"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_as_returning"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10468,57 +10574,57 @@ private static class Opaque_get_debug_str { /** * Function descriptor for: * {@snippet lang=c : - * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) + * BorrowedFieldsReturning Foo_as_returning(const Foo *self) * } */ - public static FunctionDescriptor Opaque_get_debug_str$descriptor() { - return Opaque_get_debug_str.DESC; + public static FunctionDescriptor Foo_as_returning$descriptor() { + return Foo_as_returning.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) + * BorrowedFieldsReturning Foo_as_returning(const Foo *self) * } */ - public static MethodHandle Opaque_get_debug_str$handle() { - return Opaque_get_debug_str.HANDLE; + public static MethodHandle Foo_as_returning$handle() { + return Foo_as_returning.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) + * BorrowedFieldsReturning Foo_as_returning(const Foo *self) * } */ - public static MemorySegment Opaque_get_debug_str$address() { - return Opaque_get_debug_str.ADDR; + public static MemorySegment Foo_as_returning$address() { + return Foo_as_returning.ADDR; } /** * {@snippet lang=c : - * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) + * BorrowedFieldsReturning Foo_as_returning(const Foo *self) * } */ - public static void Opaque_get_debug_str(MemorySegment self, MemorySegment write) { - var mh$ = Opaque_get_debug_str.HANDLE; + public static MemorySegment Foo_as_returning(SegmentAllocator allocator, MemorySegment self) { + var mh$ = Foo_as_returning.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_get_debug_str", self, write); + traceDowncall("Foo_as_returning", allocator, self); } - mh$.invokeExact(self, write); + return (MemorySegment)mh$.invokeExact(allocator, self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Opaque_assert_struct { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class Foo_extract_from_fields { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - MyStruct.layout() + BorrowedFields.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_assert_struct"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_extract_from_fields"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10526,55 +10632,58 @@ private static class Opaque_assert_struct { /** * Function descriptor for: * {@snippet lang=c : - * void Opaque_assert_struct(const Opaque *self, MyStruct s) + * Foo *Foo_extract_from_fields(BorrowedFields fields) * } */ - public static FunctionDescriptor Opaque_assert_struct$descriptor() { - return Opaque_assert_struct.DESC; + public static FunctionDescriptor Foo_extract_from_fields$descriptor() { + return Foo_extract_from_fields.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Opaque_assert_struct(const Opaque *self, MyStruct s) + * Foo *Foo_extract_from_fields(BorrowedFields fields) * } */ - public static MethodHandle Opaque_assert_struct$handle() { - return Opaque_assert_struct.HANDLE; + public static MethodHandle Foo_extract_from_fields$handle() { + return Foo_extract_from_fields.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Opaque_assert_struct(const Opaque *self, MyStruct s) + * Foo *Foo_extract_from_fields(BorrowedFields fields) * } */ - public static MemorySegment Opaque_assert_struct$address() { - return Opaque_assert_struct.ADDR; + public static MemorySegment Foo_extract_from_fields$address() { + return Foo_extract_from_fields.ADDR; } /** * {@snippet lang=c : - * void Opaque_assert_struct(const Opaque *self, MyStruct s) + * Foo *Foo_extract_from_fields(BorrowedFields fields) * } */ - public static void Opaque_assert_struct(MemorySegment self, MemorySegment s) { - var mh$ = Opaque_assert_struct.HANDLE; + public static MemorySegment Foo_extract_from_fields(MemorySegment fields) { + var mh$ = Foo_extract_from_fields.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_assert_struct", self, s); + traceDowncall("Foo_extract_from_fields", fields); } - mh$.invokeExact(self, s); + return (MemorySegment)mh$.invokeExact(fields); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Opaque_returns_usize { + private static class Foo_extract_from_bounds { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_LONG ); + somelib_h.C_POINTER, + BorrowedFieldsWithBounds.layout(), + DiplomatStringView.layout() + ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_returns_usize"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_extract_from_bounds"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10582,57 +10691,56 @@ private static class Opaque_returns_usize { /** * Function descriptor for: * {@snippet lang=c : - * size_t Opaque_returns_usize() + * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, DiplomatStringView another_string) * } */ - public static FunctionDescriptor Opaque_returns_usize$descriptor() { - return Opaque_returns_usize.DESC; + public static FunctionDescriptor Foo_extract_from_bounds$descriptor() { + return Foo_extract_from_bounds.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * size_t Opaque_returns_usize() + * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, DiplomatStringView another_string) * } */ - public static MethodHandle Opaque_returns_usize$handle() { - return Opaque_returns_usize.HANDLE; + public static MethodHandle Foo_extract_from_bounds$handle() { + return Foo_extract_from_bounds.HANDLE; } /** * Address for: * {@snippet lang=c : - * size_t Opaque_returns_usize() + * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, DiplomatStringView another_string) * } */ - public static MemorySegment Opaque_returns_usize$address() { - return Opaque_returns_usize.ADDR; + public static MemorySegment Foo_extract_from_bounds$address() { + return Foo_extract_from_bounds.ADDR; } /** * {@snippet lang=c : - * size_t Opaque_returns_usize() + * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, DiplomatStringView another_string) * } */ - public static long Opaque_returns_usize() { - var mh$ = Opaque_returns_usize.HANDLE; + public static MemorySegment Foo_extract_from_bounds(MemorySegment bounds, MemorySegment another_string) { + var mh$ = Foo_extract_from_bounds.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_returns_usize"); + traceDowncall("Foo_extract_from_bounds", bounds, another_string); } - return (long)mh$.invokeExact(); + return (MemorySegment)mh$.invokeExact(bounds, another_string); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Opaque_internal_len { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_LONG, + private static class Foo_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_internal_len"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10640,55 +10748,58 @@ private static class Opaque_internal_len { /** * Function descriptor for: * {@snippet lang=c : - * size_t Opaque_internal_len(const Opaque *self) + * void Foo_destroy(Foo *self) * } */ - public static FunctionDescriptor Opaque_internal_len$descriptor() { - return Opaque_internal_len.DESC; + public static FunctionDescriptor Foo_destroy$descriptor() { + return Foo_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * size_t Opaque_internal_len(const Opaque *self) + * void Foo_destroy(Foo *self) * } */ - public static MethodHandle Opaque_internal_len$handle() { - return Opaque_internal_len.HANDLE; + public static MethodHandle Foo_destroy$handle() { + return Foo_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * size_t Opaque_internal_len(const Opaque *self) + * void Foo_destroy(Foo *self) * } */ - public static MemorySegment Opaque_internal_len$address() { - return Opaque_internal_len.ADDR; + public static MemorySegment Foo_destroy$address() { + return Foo_destroy.ADDR; } /** * {@snippet lang=c : - * size_t Opaque_internal_len(const Opaque *self) + * void Foo_destroy(Foo *self) * } */ - public static long Opaque_internal_len(MemorySegment self) { - var mh$ = Opaque_internal_len.HANDLE; + public static void Foo_destroy(MemorySegment self) { + var mh$ = Foo_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_internal_len", self); + traceDowncall("Foo_destroy", self); } - return (long)mh$.invokeExact(self); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Opaque_returns_imported { + private static class One_transitivity { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - ImportedStruct.layout() ); + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_returns_imported"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_transitivity"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10696,55 +10807,58 @@ private static class Opaque_returns_imported { /** * Function descriptor for: * {@snippet lang=c : - * ImportedStruct Opaque_returns_imported() + * One *One_transitivity(const One *hold, const One *nohold) * } */ - public static FunctionDescriptor Opaque_returns_imported$descriptor() { - return Opaque_returns_imported.DESC; + public static FunctionDescriptor One_transitivity$descriptor() { + return One_transitivity.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * ImportedStruct Opaque_returns_imported() + * One *One_transitivity(const One *hold, const One *nohold) * } */ - public static MethodHandle Opaque_returns_imported$handle() { - return Opaque_returns_imported.HANDLE; + public static MethodHandle One_transitivity$handle() { + return One_transitivity.HANDLE; } /** * Address for: * {@snippet lang=c : - * ImportedStruct Opaque_returns_imported() + * One *One_transitivity(const One *hold, const One *nohold) * } */ - public static MemorySegment Opaque_returns_imported$address() { - return Opaque_returns_imported.ADDR; + public static MemorySegment One_transitivity$address() { + return One_transitivity.ADDR; } /** * {@snippet lang=c : - * ImportedStruct Opaque_returns_imported() + * One *One_transitivity(const One *hold, const One *nohold) * } */ - public static MemorySegment Opaque_returns_imported(SegmentAllocator allocator) { - var mh$ = Opaque_returns_imported.HANDLE; + public static MemorySegment One_transitivity(MemorySegment hold, MemorySegment nohold) { + var mh$ = One_transitivity.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_returns_imported", allocator); + traceDowncall("One_transitivity", hold, nohold); } - return (MemorySegment)mh$.invokeExact(allocator); + return (MemorySegment)mh$.invokeExact(hold, nohold); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Opaque_cmp { + private static class One_cycle { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_CHAR ); + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER + ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_cmp"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_cycle"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10752,56 +10866,61 @@ private static class Opaque_cmp { /** * Function descriptor for: * {@snippet lang=c : - * int8_t Opaque_cmp() + * One *One_cycle(const Two *hold, const One *nohold) * } */ - public static FunctionDescriptor Opaque_cmp$descriptor() { - return Opaque_cmp.DESC; + public static FunctionDescriptor One_cycle$descriptor() { + return One_cycle.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * int8_t Opaque_cmp() + * One *One_cycle(const Two *hold, const One *nohold) * } */ - public static MethodHandle Opaque_cmp$handle() { - return Opaque_cmp.HANDLE; + public static MethodHandle One_cycle$handle() { + return One_cycle.HANDLE; } /** * Address for: * {@snippet lang=c : - * int8_t Opaque_cmp() + * One *One_cycle(const Two *hold, const One *nohold) * } */ - public static MemorySegment Opaque_cmp$address() { - return Opaque_cmp.ADDR; + public static MemorySegment One_cycle$address() { + return One_cycle.ADDR; } /** * {@snippet lang=c : - * int8_t Opaque_cmp() + * One *One_cycle(const Two *hold, const One *nohold) * } */ - public static byte Opaque_cmp() { - var mh$ = Opaque_cmp.HANDLE; + public static MemorySegment One_cycle(MemorySegment hold, MemorySegment nohold) { + var mh$ = One_cycle.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_cmp"); + traceDowncall("One_cycle", hold, nohold); } - return (byte)mh$.invokeExact(); + return (MemorySegment)mh$.invokeExact(hold, nohold); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Opaque_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class One_many_dependents { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_many_dependents"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10809,62 +10928,58 @@ private static class Opaque_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void Opaque_destroy(Opaque *self) + * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) * } */ - public static FunctionDescriptor Opaque_destroy$descriptor() { - return Opaque_destroy.DESC; + public static FunctionDescriptor One_many_dependents$descriptor() { + return One_many_dependents.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Opaque_destroy(Opaque *self) + * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) * } */ - public static MethodHandle Opaque_destroy$handle() { - return Opaque_destroy.HANDLE; + public static MethodHandle One_many_dependents$handle() { + return One_many_dependents.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Opaque_destroy(Opaque *self) + * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) * } */ - public static MemorySegment Opaque_destroy$address() { - return Opaque_destroy.ADDR; + public static MemorySegment One_many_dependents$address() { + return One_many_dependents.ADDR; } /** * {@snippet lang=c : - * void Opaque_destroy(Opaque *self) + * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) * } */ - public static void Opaque_destroy(MemorySegment self) { - var mh$ = Opaque_destroy.HANDLE; + public static MemorySegment One_many_dependents(MemorySegment a, MemorySegment b, MemorySegment c, MemorySegment d, MemorySegment nohold) { + var mh$ = One_many_dependents.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Opaque_destroy", self); + traceDowncall("One_many_dependents", a, b, c, d, nohold); } - mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(a, b, c, d, nohold); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class NestedBorrowedFields_from_bar_and_foo_and_strings { + private static class One_return_outlives_param { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - NestedBorrowedFields.layout(), somelib_h.C_POINTER, somelib_h.C_POINTER, - DiplomatString16View.layout(), - DiplomatString16View.layout(), - DiplomatStringView.layout(), - DiplomatStringView.layout() + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("NestedBorrowedFields_from_bar_and_foo_and_strings"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_return_outlives_param"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10872,57 +10987,60 @@ private static class NestedBorrowedFields_from_bar_and_foo_and_strings { /** * Function descriptor for: * {@snippet lang=c : - * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, DiplomatString16View dstr16_x, DiplomatString16View dstr16_z, DiplomatStringView utf8_str_y, DiplomatStringView utf8_str_z) + * One *One_return_outlives_param(const Two *hold, const One *nohold) * } */ - public static FunctionDescriptor NestedBorrowedFields_from_bar_and_foo_and_strings$descriptor() { - return NestedBorrowedFields_from_bar_and_foo_and_strings.DESC; + public static FunctionDescriptor One_return_outlives_param$descriptor() { + return One_return_outlives_param.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, DiplomatString16View dstr16_x, DiplomatString16View dstr16_z, DiplomatStringView utf8_str_y, DiplomatStringView utf8_str_z) + * One *One_return_outlives_param(const Two *hold, const One *nohold) * } */ - public static MethodHandle NestedBorrowedFields_from_bar_and_foo_and_strings$handle() { - return NestedBorrowedFields_from_bar_and_foo_and_strings.HANDLE; + public static MethodHandle One_return_outlives_param$handle() { + return One_return_outlives_param.HANDLE; } /** * Address for: * {@snippet lang=c : - * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, DiplomatString16View dstr16_x, DiplomatString16View dstr16_z, DiplomatStringView utf8_str_y, DiplomatStringView utf8_str_z) + * One *One_return_outlives_param(const Two *hold, const One *nohold) * } */ - public static MemorySegment NestedBorrowedFields_from_bar_and_foo_and_strings$address() { - return NestedBorrowedFields_from_bar_and_foo_and_strings.ADDR; + public static MemorySegment One_return_outlives_param$address() { + return One_return_outlives_param.ADDR; } /** * {@snippet lang=c : - * NestedBorrowedFields NestedBorrowedFields_from_bar_and_foo_and_strings(const Bar *bar, const Foo *foo, DiplomatString16View dstr16_x, DiplomatString16View dstr16_z, DiplomatStringView utf8_str_y, DiplomatStringView utf8_str_z) + * One *One_return_outlives_param(const Two *hold, const One *nohold) * } */ - public static MemorySegment NestedBorrowedFields_from_bar_and_foo_and_strings(SegmentAllocator allocator, MemorySegment bar, MemorySegment foo, MemorySegment dstr16_x, MemorySegment dstr16_z, MemorySegment utf8_str_y, MemorySegment utf8_str_z) { - var mh$ = NestedBorrowedFields_from_bar_and_foo_and_strings.HANDLE; + public static MemorySegment One_return_outlives_param(MemorySegment hold, MemorySegment nohold) { + var mh$ = One_return_outlives_param.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("NestedBorrowedFields_from_bar_and_foo_and_strings", allocator, bar, foo, dstr16_x, dstr16_z, utf8_str_y, utf8_str_z); + traceDowncall("One_return_outlives_param", hold, nohold); } - return (MemorySegment)mh$.invokeExact(allocator, bar, foo, dstr16_x, dstr16_z, utf8_str_y, utf8_str_z); + return (MemorySegment)mh$.invokeExact(hold, nohold); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyString_new { + private static class One_diamond_top { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - DiplomatStringView.layout() + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_top"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10930,57 +11048,60 @@ private static class MyString_new { /** * Function descriptor for: * {@snippet lang=c : - * MyString *MyString_new(DiplomatStringView v) + * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static FunctionDescriptor MyString_new$descriptor() { - return MyString_new.DESC; + public static FunctionDescriptor One_diamond_top$descriptor() { + return One_diamond_top.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * MyString *MyString_new(DiplomatStringView v) + * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MethodHandle MyString_new$handle() { - return MyString_new.HANDLE; + public static MethodHandle One_diamond_top$handle() { + return One_diamond_top.HANDLE; } /** * Address for: * {@snippet lang=c : - * MyString *MyString_new(DiplomatStringView v) + * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MemorySegment MyString_new$address() { - return MyString_new.ADDR; + public static MemorySegment One_diamond_top$address() { + return One_diamond_top.ADDR; } /** * {@snippet lang=c : - * MyString *MyString_new(DiplomatStringView v) + * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MemorySegment MyString_new(MemorySegment v) { - var mh$ = MyString_new.HANDLE; + public static MemorySegment One_diamond_top(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { + var mh$ = One_diamond_top.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyString_new", v); + traceDowncall("One_diamond_top", top, left, right, bottom); } - return (MemorySegment)mh$.invokeExact(v); + return (MemorySegment)mh$.invokeExact(top, left, right, bottom); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyString_new_unsafe { + private static class One_diamond_left { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - DiplomatStringView.layout() + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new_unsafe"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_left"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -10988,57 +11109,60 @@ private static class MyString_new_unsafe { /** * Function descriptor for: * {@snippet lang=c : - * MyString *MyString_new_unsafe(DiplomatStringView v) + * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static FunctionDescriptor MyString_new_unsafe$descriptor() { - return MyString_new_unsafe.DESC; + public static FunctionDescriptor One_diamond_left$descriptor() { + return One_diamond_left.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * MyString *MyString_new_unsafe(DiplomatStringView v) + * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MethodHandle MyString_new_unsafe$handle() { - return MyString_new_unsafe.HANDLE; + public static MethodHandle One_diamond_left$handle() { + return One_diamond_left.HANDLE; } /** * Address for: * {@snippet lang=c : - * MyString *MyString_new_unsafe(DiplomatStringView v) + * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MemorySegment MyString_new_unsafe$address() { - return MyString_new_unsafe.ADDR; + public static MemorySegment One_diamond_left$address() { + return One_diamond_left.ADDR; } /** * {@snippet lang=c : - * MyString *MyString_new_unsafe(DiplomatStringView v) + * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MemorySegment MyString_new_unsafe(MemorySegment v) { - var mh$ = MyString_new_unsafe.HANDLE; + public static MemorySegment One_diamond_left(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { + var mh$ = One_diamond_left.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyString_new_unsafe", v); + traceDowncall("One_diamond_left", top, left, right, bottom); } - return (MemorySegment)mh$.invokeExact(v); + return (MemorySegment)mh$.invokeExact(top, left, right, bottom); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyString_new_owned { + private static class One_diamond_right { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - DiplomatStringView.layout() + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new_owned"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_right"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11046,57 +11170,60 @@ private static class MyString_new_owned { /** * Function descriptor for: * {@snippet lang=c : - * MyString *MyString_new_owned(DiplomatStringView v) + * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static FunctionDescriptor MyString_new_owned$descriptor() { - return MyString_new_owned.DESC; + public static FunctionDescriptor One_diamond_right$descriptor() { + return One_diamond_right.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * MyString *MyString_new_owned(DiplomatStringView v) + * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MethodHandle MyString_new_owned$handle() { - return MyString_new_owned.HANDLE; + public static MethodHandle One_diamond_right$handle() { + return One_diamond_right.HANDLE; } /** * Address for: * {@snippet lang=c : - * MyString *MyString_new_owned(DiplomatStringView v) + * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MemorySegment MyString_new_owned$address() { - return MyString_new_owned.ADDR; + public static MemorySegment One_diamond_right$address() { + return One_diamond_right.ADDR; } /** * {@snippet lang=c : - * MyString *MyString_new_owned(DiplomatStringView v) + * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MemorySegment MyString_new_owned(MemorySegment v) { - var mh$ = MyString_new_owned.HANDLE; + public static MemorySegment One_diamond_right(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { + var mh$ = One_diamond_right.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyString_new_owned", v); + traceDowncall("One_diamond_right", top, left, right, bottom); } - return (MemorySegment)mh$.invokeExact(v); + return (MemorySegment)mh$.invokeExact(top, left, right, bottom); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyString_new_from_first { + private static class One_diamond_bottom { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - DiplomatStringsView.layout() + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new_from_first"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_bottom"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11104,57 +11231,61 @@ private static class MyString_new_from_first { /** * Function descriptor for: * {@snippet lang=c : - * MyString *MyString_new_from_first(DiplomatStringsView v) + * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static FunctionDescriptor MyString_new_from_first$descriptor() { - return MyString_new_from_first.DESC; + public static FunctionDescriptor One_diamond_bottom$descriptor() { + return One_diamond_bottom.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * MyString *MyString_new_from_first(DiplomatStringsView v) + * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MethodHandle MyString_new_from_first$handle() { - return MyString_new_from_first.HANDLE; + public static MethodHandle One_diamond_bottom$handle() { + return One_diamond_bottom.HANDLE; } /** * Address for: * {@snippet lang=c : - * MyString *MyString_new_from_first(DiplomatStringsView v) + * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MemorySegment MyString_new_from_first$address() { - return MyString_new_from_first.ADDR; + public static MemorySegment One_diamond_bottom$address() { + return One_diamond_bottom.ADDR; } /** * {@snippet lang=c : - * MyString *MyString_new_from_first(DiplomatStringsView v) + * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) * } */ - public static MemorySegment MyString_new_from_first(MemorySegment v) { - var mh$ = MyString_new_from_first.HANDLE; + public static MemorySegment One_diamond_bottom(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { + var mh$ = One_diamond_bottom.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyString_new_from_first", v); + traceDowncall("One_diamond_bottom", top, left, right, bottom); } - return (MemorySegment)mh$.invokeExact(v); + return (MemorySegment)mh$.invokeExact(top, left, right, bottom); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyString_set_str { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class One_diamond_and_nested_types { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - DiplomatStringView.layout() + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_set_str"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_and_nested_types"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11162,57 +11293,59 @@ private static class MyString_set_str { /** * Function descriptor for: * {@snippet lang=c : - * void MyString_set_str(MyString *self, DiplomatStringView new_str) + * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) * } */ - public static FunctionDescriptor MyString_set_str$descriptor() { - return MyString_set_str.DESC; + public static FunctionDescriptor One_diamond_and_nested_types$descriptor() { + return One_diamond_and_nested_types.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void MyString_set_str(MyString *self, DiplomatStringView new_str) + * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) * } */ - public static MethodHandle MyString_set_str$handle() { - return MyString_set_str.HANDLE; + public static MethodHandle One_diamond_and_nested_types$handle() { + return One_diamond_and_nested_types.HANDLE; } /** * Address for: * {@snippet lang=c : - * void MyString_set_str(MyString *self, DiplomatStringView new_str) + * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) * } */ - public static MemorySegment MyString_set_str$address() { - return MyString_set_str.ADDR; + public static MemorySegment One_diamond_and_nested_types$address() { + return One_diamond_and_nested_types.ADDR; } /** * {@snippet lang=c : - * void MyString_set_str(MyString *self, DiplomatStringView new_str) + * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) * } */ - public static void MyString_set_str(MemorySegment self, MemorySegment new_str) { - var mh$ = MyString_set_str.HANDLE; + public static MemorySegment One_diamond_and_nested_types(MemorySegment a, MemorySegment b, MemorySegment c, MemorySegment d, MemorySegment nohold) { + var mh$ = One_diamond_and_nested_types.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyString_set_str", self, new_str); + traceDowncall("One_diamond_and_nested_types", a, b, c, d, nohold); } - mh$.invokeExact(self, new_str); + return (MemorySegment)mh$.invokeExact(a, b, c, d, nohold); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyString_get_str { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class One_implicit_bounds { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_get_str"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_implicit_bounds"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11220,57 +11353,60 @@ private static class MyString_get_str { /** * Function descriptor for: * {@snippet lang=c : - * void MyString_get_str(const MyString *self, DiplomatWrite *write) + * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) * } */ - public static FunctionDescriptor MyString_get_str$descriptor() { - return MyString_get_str.DESC; + public static FunctionDescriptor One_implicit_bounds$descriptor() { + return One_implicit_bounds.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void MyString_get_str(const MyString *self, DiplomatWrite *write) + * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) * } */ - public static MethodHandle MyString_get_str$handle() { - return MyString_get_str.HANDLE; + public static MethodHandle One_implicit_bounds$handle() { + return One_implicit_bounds.HANDLE; } /** * Address for: * {@snippet lang=c : - * void MyString_get_str(const MyString *self, DiplomatWrite *write) + * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) * } */ - public static MemorySegment MyString_get_str$address() { - return MyString_get_str.ADDR; + public static MemorySegment One_implicit_bounds$address() { + return One_implicit_bounds.ADDR; } /** * {@snippet lang=c : - * void MyString_get_str(const MyString *self, DiplomatWrite *write) + * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) * } */ - public static void MyString_get_str(MemorySegment self, MemorySegment write) { - var mh$ = MyString_get_str.HANDLE; + public static MemorySegment One_implicit_bounds(MemorySegment explicit_hold, MemorySegment implicit_hold, MemorySegment nohold) { + var mh$ = One_implicit_bounds.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyString_get_str", self, write); + traceDowncall("One_implicit_bounds", explicit_hold, implicit_hold, nohold); } - mh$.invokeExact(self, write); + return (MemorySegment)mh$.invokeExact(explicit_hold, implicit_hold, nohold); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyString_string_transform { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - DiplomatStringView.layout(), + private static class One_implicit_bounds_deep { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_string_transform"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_implicit_bounds_deep"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11278,56 +11414,56 @@ private static class MyString_string_transform { /** * Function descriptor for: * {@snippet lang=c : - * void MyString_string_transform(DiplomatStringView foo, DiplomatWrite *write) + * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) * } */ - public static FunctionDescriptor MyString_string_transform$descriptor() { - return MyString_string_transform.DESC; + public static FunctionDescriptor One_implicit_bounds_deep$descriptor() { + return One_implicit_bounds_deep.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void MyString_string_transform(DiplomatStringView foo, DiplomatWrite *write) + * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) * } */ - public static MethodHandle MyString_string_transform$handle() { - return MyString_string_transform.HANDLE; + public static MethodHandle One_implicit_bounds_deep$handle() { + return One_implicit_bounds_deep.HANDLE; } /** * Address for: * {@snippet lang=c : - * void MyString_string_transform(DiplomatStringView foo, DiplomatWrite *write) + * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) * } */ - public static MemorySegment MyString_string_transform$address() { - return MyString_string_transform.ADDR; + public static MemorySegment One_implicit_bounds_deep$address() { + return One_implicit_bounds_deep.ADDR; } /** * {@snippet lang=c : - * void MyString_string_transform(DiplomatStringView foo, DiplomatWrite *write) + * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) * } */ - public static void MyString_string_transform(MemorySegment foo, MemorySegment write) { - var mh$ = MyString_string_transform.HANDLE; + public static MemorySegment One_implicit_bounds_deep(MemorySegment explicit_, MemorySegment implicit_1, MemorySegment implicit_2, MemorySegment nohold) { + var mh$ = One_implicit_bounds_deep.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyString_string_transform", foo, write); + traceDowncall("One_implicit_bounds_deep", explicit_, implicit_1, implicit_2, nohold); } - mh$.invokeExact(foo, write); + return (MemorySegment)mh$.invokeExact(explicit_, implicit_1, implicit_2, nohold); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class MyString_destroy { + private static class One_destroy { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("One_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11335,43 +11471,43 @@ private static class MyString_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void MyString_destroy(MyString *self) + * void One_destroy(One *self) * } */ - public static FunctionDescriptor MyString_destroy$descriptor() { - return MyString_destroy.DESC; + public static FunctionDescriptor One_destroy$descriptor() { + return One_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void MyString_destroy(MyString *self) + * void One_destroy(One *self) * } */ - public static MethodHandle MyString_destroy$handle() { - return MyString_destroy.HANDLE; + public static MethodHandle One_destroy$handle() { + return One_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * void MyString_destroy(MyString *self) + * void One_destroy(One *self) * } */ - public static MemorySegment MyString_destroy$address() { - return MyString_destroy.ADDR; + public static MemorySegment One_destroy$address() { + return One_destroy.ADDR; } /** * {@snippet lang=c : - * void MyString_destroy(MyString *self) + * void One_destroy(One *self) * } */ - public static void MyString_destroy(MemorySegment self) { - var mh$ = MyString_destroy.HANDLE; + public static void One_destroy(MemorySegment self) { + var mh$ = One_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("MyString_destroy", self); + traceDowncall("One_destroy", self); } mh$.invokeExact(self); } catch (Throwable ex$) { @@ -11379,15 +11515,12 @@ public static void MyString_destroy(MemorySegment self) { } } - private static class BorrowedFieldsWithBounds_from_foo_and_strings { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - BorrowedFieldsWithBounds.layout(), - somelib_h.C_POINTER, - DiplomatString16View.layout(), - DiplomatStringView.layout() + private static class Two_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("BorrowedFieldsWithBounds_from_foo_and_strings"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Two_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11395,57 +11528,57 @@ private static class BorrowedFieldsWithBounds_from_foo_and_strings { /** * Function descriptor for: * {@snippet lang=c : - * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, DiplomatString16View dstr16_x, DiplomatStringView utf8_str_z) + * void Two_destroy(Two *self) * } */ - public static FunctionDescriptor BorrowedFieldsWithBounds_from_foo_and_strings$descriptor() { - return BorrowedFieldsWithBounds_from_foo_and_strings.DESC; + public static FunctionDescriptor Two_destroy$descriptor() { + return Two_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, DiplomatString16View dstr16_x, DiplomatStringView utf8_str_z) + * void Two_destroy(Two *self) * } */ - public static MethodHandle BorrowedFieldsWithBounds_from_foo_and_strings$handle() { - return BorrowedFieldsWithBounds_from_foo_and_strings.HANDLE; + public static MethodHandle Two_destroy$handle() { + return Two_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, DiplomatString16View dstr16_x, DiplomatStringView utf8_str_z) + * void Two_destroy(Two *self) * } */ - public static MemorySegment BorrowedFieldsWithBounds_from_foo_and_strings$address() { - return BorrowedFieldsWithBounds_from_foo_and_strings.ADDR; + public static MemorySegment Two_destroy$address() { + return Two_destroy.ADDR; } /** * {@snippet lang=c : - * BorrowedFieldsWithBounds BorrowedFieldsWithBounds_from_foo_and_strings(const Foo *foo, DiplomatString16View dstr16_x, DiplomatStringView utf8_str_z) + * void Two_destroy(Two *self) * } */ - public static MemorySegment BorrowedFieldsWithBounds_from_foo_and_strings(SegmentAllocator allocator, MemorySegment foo, MemorySegment dstr16_x, MemorySegment utf8_str_z) { - var mh$ = BorrowedFieldsWithBounds_from_foo_and_strings.HANDLE; + public static void Two_destroy(MemorySegment self) { + var mh$ = Two_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("BorrowedFieldsWithBounds_from_foo_and_strings", allocator, foo, dstr16_x, utf8_str_z); + traceDowncall("Two_destroy", self); } - return (MemorySegment)mh$.invokeExact(allocator, foo, dstr16_x, utf8_str_z); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OpaqueMutexedString_from_usize { + private static class RefList_node { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_from_usize"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("RefList_node"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11453,57 +11586,56 @@ private static class OpaqueMutexedString_from_usize { /** * Function descriptor for: * {@snippet lang=c : - * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) + * RefList *RefList_node(const RefListParameter *data) * } */ - public static FunctionDescriptor OpaqueMutexedString_from_usize$descriptor() { - return OpaqueMutexedString_from_usize.DESC; + public static FunctionDescriptor RefList_node$descriptor() { + return RefList_node.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) + * RefList *RefList_node(const RefListParameter *data) * } */ - public static MethodHandle OpaqueMutexedString_from_usize$handle() { - return OpaqueMutexedString_from_usize.HANDLE; + public static MethodHandle RefList_node$handle() { + return RefList_node.HANDLE; } /** * Address for: * {@snippet lang=c : - * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) + * RefList *RefList_node(const RefListParameter *data) * } */ - public static MemorySegment OpaqueMutexedString_from_usize$address() { - return OpaqueMutexedString_from_usize.ADDR; + public static MemorySegment RefList_node$address() { + return RefList_node.ADDR; } /** * {@snippet lang=c : - * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) + * RefList *RefList_node(const RefListParameter *data) * } */ - public static MemorySegment OpaqueMutexedString_from_usize(long number) { - var mh$ = OpaqueMutexedString_from_usize.HANDLE; + public static MemorySegment RefList_node(MemorySegment data) { + var mh$ = RefList_node.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_from_usize", number); + traceDowncall("RefList_node", data); } - return (MemorySegment)mh$.invokeExact(number); + return (MemorySegment)mh$.invokeExact(data); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OpaqueMutexedString_change { + private static class RefList_destroy { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER, - somelib_h.C_LONG + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_change"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("RefList_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11511,57 +11643,56 @@ private static class OpaqueMutexedString_change { /** * Function descriptor for: * {@snippet lang=c : - * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) + * void RefList_destroy(RefList *self) * } */ - public static FunctionDescriptor OpaqueMutexedString_change$descriptor() { - return OpaqueMutexedString_change.DESC; + public static FunctionDescriptor RefList_destroy$descriptor() { + return RefList_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) + * void RefList_destroy(RefList *self) * } */ - public static MethodHandle OpaqueMutexedString_change$handle() { - return OpaqueMutexedString_change.HANDLE; + public static MethodHandle RefList_destroy$handle() { + return RefList_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) + * void RefList_destroy(RefList *self) * } */ - public static MemorySegment OpaqueMutexedString_change$address() { - return OpaqueMutexedString_change.ADDR; + public static MemorySegment RefList_destroy$address() { + return RefList_destroy.ADDR; } /** * {@snippet lang=c : - * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) + * void RefList_destroy(RefList *self) * } */ - public static void OpaqueMutexedString_change(MemorySegment self, long number) { - var mh$ = OpaqueMutexedString_change.HANDLE; + public static void RefList_destroy(MemorySegment self) { + var mh$ = RefList_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_change", self, number); + traceDowncall("RefList_destroy", self); } - mh$.invokeExact(self, number); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OpaqueMutexedString_borrow { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, + private static class RefListParameter_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_borrow"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("RefListParameter_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11569,57 +11700,57 @@ private static class OpaqueMutexedString_borrow { /** * Function descriptor for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) + * void RefListParameter_destroy(RefListParameter *self) * } */ - public static FunctionDescriptor OpaqueMutexedString_borrow$descriptor() { - return OpaqueMutexedString_borrow.DESC; + public static FunctionDescriptor RefListParameter_destroy$descriptor() { + return RefListParameter_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) + * void RefListParameter_destroy(RefListParameter *self) * } */ - public static MethodHandle OpaqueMutexedString_borrow$handle() { - return OpaqueMutexedString_borrow.HANDLE; + public static MethodHandle RefListParameter_destroy$handle() { + return RefListParameter_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) + * void RefListParameter_destroy(RefListParameter *self) * } */ - public static MemorySegment OpaqueMutexedString_borrow$address() { - return OpaqueMutexedString_borrow.ADDR; + public static MemorySegment RefListParameter_destroy$address() { + return RefListParameter_destroy.ADDR; } /** * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) + * void RefListParameter_destroy(RefListParameter *self) * } */ - public static MemorySegment OpaqueMutexedString_borrow(MemorySegment self) { - var mh$ = OpaqueMutexedString_borrow.HANDLE; + public static void RefListParameter_destroy(MemorySegment self) { + var mh$ = RefListParameter_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_borrow", self); + traceDowncall("RefListParameter_destroy", self); } - return (MemorySegment)mh$.invokeExact(self); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OpaqueMutexedString_borrow_other { + private static class Float64Vec_new_bool { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - somelib_h.C_POINTER + DiplomatBoolView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_borrow_other"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_bool"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11627,58 +11758,57 @@ private static class OpaqueMutexedString_borrow_other { /** * Function descriptor for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) + * Float64Vec *Float64Vec_new_bool(DiplomatBoolView v) * } */ - public static FunctionDescriptor OpaqueMutexedString_borrow_other$descriptor() { - return OpaqueMutexedString_borrow_other.DESC; + public static FunctionDescriptor Float64Vec_new_bool$descriptor() { + return Float64Vec_new_bool.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) + * Float64Vec *Float64Vec_new_bool(DiplomatBoolView v) * } */ - public static MethodHandle OpaqueMutexedString_borrow_other$handle() { - return OpaqueMutexedString_borrow_other.HANDLE; + public static MethodHandle Float64Vec_new_bool$handle() { + return Float64Vec_new_bool.HANDLE; } /** * Address for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) + * Float64Vec *Float64Vec_new_bool(DiplomatBoolView v) * } */ - public static MemorySegment OpaqueMutexedString_borrow_other$address() { - return OpaqueMutexedString_borrow_other.ADDR; + public static MemorySegment Float64Vec_new_bool$address() { + return Float64Vec_new_bool.ADDR; } /** * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) + * Float64Vec *Float64Vec_new_bool(DiplomatBoolView v) * } */ - public static MemorySegment OpaqueMutexedString_borrow_other(MemorySegment other) { - var mh$ = OpaqueMutexedString_borrow_other.HANDLE; + public static MemorySegment Float64Vec_new_bool(MemorySegment v) { + var mh$ = Float64Vec_new_bool.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_borrow_other", other); + traceDowncall("Float64Vec_new_bool", v); } - return (MemorySegment)mh$.invokeExact(other); + return (MemorySegment)mh$.invokeExact(v); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OpaqueMutexedString_borrow_self_or_other { + private static class Float64Vec_new_i16 { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER + DiplomatI16View.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_borrow_self_or_other"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_i16"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11686,58 +11816,57 @@ private static class OpaqueMutexedString_borrow_self_or_other { /** * Function descriptor for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) + * Float64Vec *Float64Vec_new_i16(DiplomatI16View v) * } */ - public static FunctionDescriptor OpaqueMutexedString_borrow_self_or_other$descriptor() { - return OpaqueMutexedString_borrow_self_or_other.DESC; + public static FunctionDescriptor Float64Vec_new_i16$descriptor() { + return Float64Vec_new_i16.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) + * Float64Vec *Float64Vec_new_i16(DiplomatI16View v) * } */ - public static MethodHandle OpaqueMutexedString_borrow_self_or_other$handle() { - return OpaqueMutexedString_borrow_self_or_other.HANDLE; + public static MethodHandle Float64Vec_new_i16$handle() { + return Float64Vec_new_i16.HANDLE; } /** * Address for: * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) + * Float64Vec *Float64Vec_new_i16(DiplomatI16View v) * } */ - public static MemorySegment OpaqueMutexedString_borrow_self_or_other$address() { - return OpaqueMutexedString_borrow_self_or_other.ADDR; + public static MemorySegment Float64Vec_new_i16$address() { + return Float64Vec_new_i16.ADDR; } /** * {@snippet lang=c : - * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) + * Float64Vec *Float64Vec_new_i16(DiplomatI16View v) * } */ - public static MemorySegment OpaqueMutexedString_borrow_self_or_other(MemorySegment self, MemorySegment other) { - var mh$ = OpaqueMutexedString_borrow_self_or_other.HANDLE; + public static MemorySegment Float64Vec_new_i16(MemorySegment v) { + var mh$ = Float64Vec_new_i16.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_borrow_self_or_other", self, other); + traceDowncall("Float64Vec_new_i16", v); } - return (MemorySegment)mh$.invokeExact(self, other); + return (MemorySegment)mh$.invokeExact(v); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OpaqueMutexedString_get_len_and_add { + private static class Float64Vec_new_u16 { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_LONG, somelib_h.C_POINTER, - somelib_h.C_LONG + DiplomatU16View.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_get_len_and_add"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_u16"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11745,57 +11874,57 @@ private static class OpaqueMutexedString_get_len_and_add { /** * Function descriptor for: * {@snippet lang=c : - * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) + * Float64Vec *Float64Vec_new_u16(DiplomatU16View v) * } */ - public static FunctionDescriptor OpaqueMutexedString_get_len_and_add$descriptor() { - return OpaqueMutexedString_get_len_and_add.DESC; + public static FunctionDescriptor Float64Vec_new_u16$descriptor() { + return Float64Vec_new_u16.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) + * Float64Vec *Float64Vec_new_u16(DiplomatU16View v) * } */ - public static MethodHandle OpaqueMutexedString_get_len_and_add$handle() { - return OpaqueMutexedString_get_len_and_add.HANDLE; + public static MethodHandle Float64Vec_new_u16$handle() { + return Float64Vec_new_u16.HANDLE; } /** * Address for: * {@snippet lang=c : - * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) + * Float64Vec *Float64Vec_new_u16(DiplomatU16View v) * } */ - public static MemorySegment OpaqueMutexedString_get_len_and_add$address() { - return OpaqueMutexedString_get_len_and_add.ADDR; + public static MemorySegment Float64Vec_new_u16$address() { + return Float64Vec_new_u16.ADDR; } /** * {@snippet lang=c : - * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) + * Float64Vec *Float64Vec_new_u16(DiplomatU16View v) * } */ - public static long OpaqueMutexedString_get_len_and_add(MemorySegment self, long other) { - var mh$ = OpaqueMutexedString_get_len_and_add.HANDLE; + public static MemorySegment Float64Vec_new_u16(MemorySegment v) { + var mh$ = Float64Vec_new_u16.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_get_len_and_add", self, other); + traceDowncall("Float64Vec_new_u16", v); } - return (long)mh$.invokeExact(self, other); + return (MemorySegment)mh$.invokeExact(v); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OpaqueMutexedString_dummy_str { + private static class Float64Vec_new_isize { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - DiplomatStringView.layout(), - somelib_h.C_POINTER + somelib_h.C_POINTER, + DiplomatIsizeView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_dummy_str"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_isize"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11803,57 +11932,57 @@ private static class OpaqueMutexedString_dummy_str { /** * Function descriptor for: * {@snippet lang=c : - * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) + * Float64Vec *Float64Vec_new_isize(DiplomatIsizeView v) * } */ - public static FunctionDescriptor OpaqueMutexedString_dummy_str$descriptor() { - return OpaqueMutexedString_dummy_str.DESC; + public static FunctionDescriptor Float64Vec_new_isize$descriptor() { + return Float64Vec_new_isize.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) + * Float64Vec *Float64Vec_new_isize(DiplomatIsizeView v) * } */ - public static MethodHandle OpaqueMutexedString_dummy_str$handle() { - return OpaqueMutexedString_dummy_str.HANDLE; + public static MethodHandle Float64Vec_new_isize$handle() { + return Float64Vec_new_isize.HANDLE; } /** * Address for: * {@snippet lang=c : - * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) + * Float64Vec *Float64Vec_new_isize(DiplomatIsizeView v) * } */ - public static MemorySegment OpaqueMutexedString_dummy_str$address() { - return OpaqueMutexedString_dummy_str.ADDR; + public static MemorySegment Float64Vec_new_isize$address() { + return Float64Vec_new_isize.ADDR; } /** * {@snippet lang=c : - * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) + * Float64Vec *Float64Vec_new_isize(DiplomatIsizeView v) * } */ - public static MemorySegment OpaqueMutexedString_dummy_str(SegmentAllocator allocator, MemorySegment self) { - var mh$ = OpaqueMutexedString_dummy_str.HANDLE; + public static MemorySegment Float64Vec_new_isize(MemorySegment v) { + var mh$ = Float64Vec_new_isize.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_dummy_str", allocator, self); + traceDowncall("Float64Vec_new_isize", v); } - return (MemorySegment)mh$.invokeExact(allocator, self); + return (MemorySegment)mh$.invokeExact(v); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OpaqueMutexedString_wrapper { + private static class Float64Vec_new_usize { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - somelib_h.C_POINTER + DiplomatUsizeView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_wrapper"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_usize"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11861,56 +11990,57 @@ private static class OpaqueMutexedString_wrapper { /** * Function descriptor for: * {@snippet lang=c : - * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) + * Float64Vec *Float64Vec_new_usize(DiplomatUsizeView v) * } */ - public static FunctionDescriptor OpaqueMutexedString_wrapper$descriptor() { - return OpaqueMutexedString_wrapper.DESC; + public static FunctionDescriptor Float64Vec_new_usize$descriptor() { + return Float64Vec_new_usize.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) + * Float64Vec *Float64Vec_new_usize(DiplomatUsizeView v) * } */ - public static MethodHandle OpaqueMutexedString_wrapper$handle() { - return OpaqueMutexedString_wrapper.HANDLE; + public static MethodHandle Float64Vec_new_usize$handle() { + return Float64Vec_new_usize.HANDLE; } /** * Address for: * {@snippet lang=c : - * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) + * Float64Vec *Float64Vec_new_usize(DiplomatUsizeView v) * } */ - public static MemorySegment OpaqueMutexedString_wrapper$address() { - return OpaqueMutexedString_wrapper.ADDR; + public static MemorySegment Float64Vec_new_usize$address() { + return Float64Vec_new_usize.ADDR; } /** * {@snippet lang=c : - * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) + * Float64Vec *Float64Vec_new_usize(DiplomatUsizeView v) * } */ - public static MemorySegment OpaqueMutexedString_wrapper(MemorySegment self) { - var mh$ = OpaqueMutexedString_wrapper.HANDLE; + public static MemorySegment Float64Vec_new_usize(MemorySegment v) { + var mh$ = Float64Vec_new_usize.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_wrapper", self); + traceDowncall("Float64Vec_new_usize", v); } - return (MemorySegment)mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(v); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class OpaqueMutexedString_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER + private static class Float64Vec_new_f64_be_bytes { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + DiplomatU8View.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_f64_be_bytes"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11918,57 +12048,57 @@ private static class OpaqueMutexedString_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) + * Float64Vec *Float64Vec_new_f64_be_bytes(DiplomatU8View v) * } */ - public static FunctionDescriptor OpaqueMutexedString_destroy$descriptor() { - return OpaqueMutexedString_destroy.DESC; + public static FunctionDescriptor Float64Vec_new_f64_be_bytes$descriptor() { + return Float64Vec_new_f64_be_bytes.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) + * Float64Vec *Float64Vec_new_f64_be_bytes(DiplomatU8View v) * } */ - public static MethodHandle OpaqueMutexedString_destroy$handle() { - return OpaqueMutexedString_destroy.HANDLE; + public static MethodHandle Float64Vec_new_f64_be_bytes$handle() { + return Float64Vec_new_f64_be_bytes.HANDLE; } /** * Address for: * {@snippet lang=c : - * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) + * Float64Vec *Float64Vec_new_f64_be_bytes(DiplomatU8View v) * } */ - public static MemorySegment OpaqueMutexedString_destroy$address() { - return OpaqueMutexedString_destroy.ADDR; + public static MemorySegment Float64Vec_new_f64_be_bytes$address() { + return Float64Vec_new_f64_be_bytes.ADDR; } /** * {@snippet lang=c : - * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) + * Float64Vec *Float64Vec_new_f64_be_bytes(DiplomatU8View v) * } */ - public static void OpaqueMutexedString_destroy(MemorySegment self) { - var mh$ = OpaqueMutexedString_destroy.HANDLE; + public static MemorySegment Float64Vec_new_f64_be_bytes(MemorySegment v) { + var mh$ = Float64Vec_new_f64_be_bytes.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("OpaqueMutexedString_destroy", self); + traceDowncall("Float64Vec_new_f64_be_bytes", v); } - mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(v); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Bar_foo { + private static class Float64Vec_new_from_owned { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - somelib_h.C_POINTER + DiplomatF64ViewMut.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Bar_foo"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_from_owned"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -11976,56 +12106,57 @@ private static class Bar_foo { /** * Function descriptor for: * {@snippet lang=c : - * const Foo *Bar_foo(const Bar *self) + * Float64Vec *Float64Vec_new_from_owned(DiplomatF64ViewMut v) * } */ - public static FunctionDescriptor Bar_foo$descriptor() { - return Bar_foo.DESC; + public static FunctionDescriptor Float64Vec_new_from_owned$descriptor() { + return Float64Vec_new_from_owned.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * const Foo *Bar_foo(const Bar *self) + * Float64Vec *Float64Vec_new_from_owned(DiplomatF64ViewMut v) * } */ - public static MethodHandle Bar_foo$handle() { - return Bar_foo.HANDLE; + public static MethodHandle Float64Vec_new_from_owned$handle() { + return Float64Vec_new_from_owned.HANDLE; } /** * Address for: * {@snippet lang=c : - * const Foo *Bar_foo(const Bar *self) + * Float64Vec *Float64Vec_new_from_owned(DiplomatF64ViewMut v) * } */ - public static MemorySegment Bar_foo$address() { - return Bar_foo.ADDR; + public static MemorySegment Float64Vec_new_from_owned$address() { + return Float64Vec_new_from_owned.ADDR; } /** * {@snippet lang=c : - * const Foo *Bar_foo(const Bar *self) + * Float64Vec *Float64Vec_new_from_owned(DiplomatF64ViewMut v) * } */ - public static MemorySegment Bar_foo(MemorySegment self) { - var mh$ = Bar_foo.HANDLE; + public static MemorySegment Float64Vec_new_from_owned(MemorySegment v) { + var mh$ = Float64Vec_new_from_owned.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Bar_foo", self); + traceDowncall("Float64Vec_new_from_owned", v); } - return (MemorySegment)mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(v); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Bar_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class Float64Vec_as_slice { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + DiplomatF64View.layout(), somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Bar_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_as_slice"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12033,55 +12164,57 @@ private static class Bar_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void Bar_destroy(Bar *self) + * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) * } */ - public static FunctionDescriptor Bar_destroy$descriptor() { - return Bar_destroy.DESC; + public static FunctionDescriptor Float64Vec_as_slice$descriptor() { + return Float64Vec_as_slice.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Bar_destroy(Bar *self) + * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) * } */ - public static MethodHandle Bar_destroy$handle() { - return Bar_destroy.HANDLE; + public static MethodHandle Float64Vec_as_slice$handle() { + return Float64Vec_as_slice.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Bar_destroy(Bar *self) + * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) * } */ - public static MemorySegment Bar_destroy$address() { - return Bar_destroy.ADDR; + public static MemorySegment Float64Vec_as_slice$address() { + return Float64Vec_as_slice.ADDR; } /** * {@snippet lang=c : - * void Bar_destroy(Bar *self) + * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) * } */ - public static void Bar_destroy(MemorySegment self) { - var mh$ = Bar_destroy.HANDLE; + public static MemorySegment Float64Vec_as_slice(SegmentAllocator allocator, MemorySegment self) { + var mh$ = Float64Vec_as_slice.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Bar_destroy", self); + traceDowncall("Float64Vec_as_slice", allocator, self); } - mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(allocator, self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class CyclicStructA_get_b { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - CyclicStructB.layout() ); + private static class Float64Vec_fill_slice { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER, + DiplomatF64ViewMut.layout() + ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("CyclicStructA_get_b"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_fill_slice"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12089,56 +12222,57 @@ private static class CyclicStructA_get_b { /** * Function descriptor for: * {@snippet lang=c : - * CyclicStructB CyclicStructA_get_b() + * void Float64Vec_fill_slice(const Float64Vec *self, DiplomatF64ViewMut v) * } */ - public static FunctionDescriptor CyclicStructA_get_b$descriptor() { - return CyclicStructA_get_b.DESC; + public static FunctionDescriptor Float64Vec_fill_slice$descriptor() { + return Float64Vec_fill_slice.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * CyclicStructB CyclicStructA_get_b() + * void Float64Vec_fill_slice(const Float64Vec *self, DiplomatF64ViewMut v) * } */ - public static MethodHandle CyclicStructA_get_b$handle() { - return CyclicStructA_get_b.HANDLE; + public static MethodHandle Float64Vec_fill_slice$handle() { + return Float64Vec_fill_slice.HANDLE; } /** * Address for: * {@snippet lang=c : - * CyclicStructB CyclicStructA_get_b() + * void Float64Vec_fill_slice(const Float64Vec *self, DiplomatF64ViewMut v) * } */ - public static MemorySegment CyclicStructA_get_b$address() { - return CyclicStructA_get_b.ADDR; + public static MemorySegment Float64Vec_fill_slice$address() { + return Float64Vec_fill_slice.ADDR; } /** * {@snippet lang=c : - * CyclicStructB CyclicStructA_get_b() + * void Float64Vec_fill_slice(const Float64Vec *self, DiplomatF64ViewMut v) * } */ - public static MemorySegment CyclicStructA_get_b(SegmentAllocator allocator) { - var mh$ = CyclicStructA_get_b.HANDLE; + public static void Float64Vec_fill_slice(MemorySegment self, MemorySegment v) { + var mh$ = Float64Vec_fill_slice.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("CyclicStructA_get_b", allocator); + traceDowncall("Float64Vec_fill_slice", self, v); } - return (MemorySegment)mh$.invokeExact(allocator); + mh$.invokeExact(self, v); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Two_destroy { + private static class Float64Vec_set_value { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER + somelib_h.C_POINTER, + DiplomatF64View.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Two_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_set_value"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12146,58 +12280,57 @@ private static class Two_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void Two_destroy(Two *self) + * void Float64Vec_set_value(Float64Vec *self, DiplomatF64View new_slice) * } */ - public static FunctionDescriptor Two_destroy$descriptor() { - return Two_destroy.DESC; + public static FunctionDescriptor Float64Vec_set_value$descriptor() { + return Float64Vec_set_value.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Two_destroy(Two *self) + * void Float64Vec_set_value(Float64Vec *self, DiplomatF64View new_slice) * } */ - public static MethodHandle Two_destroy$handle() { - return Two_destroy.HANDLE; + public static MethodHandle Float64Vec_set_value$handle() { + return Float64Vec_set_value.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Two_destroy(Two *self) + * void Float64Vec_set_value(Float64Vec *self, DiplomatF64View new_slice) * } */ - public static MemorySegment Two_destroy$address() { - return Two_destroy.ADDR; + public static MemorySegment Float64Vec_set_value$address() { + return Float64Vec_set_value.ADDR; } /** * {@snippet lang=c : - * void Two_destroy(Two *self) + * void Float64Vec_set_value(Float64Vec *self, DiplomatF64View new_slice) * } */ - public static void Two_destroy(MemorySegment self) { - var mh$ = Two_destroy.HANDLE; + public static void Float64Vec_set_value(MemorySegment self, MemorySegment new_slice) { + var mh$ = Float64Vec_set_value.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Two_destroy", self); + traceDowncall("Float64Vec_set_value", self, new_slice); } - mh$.invokeExact(self); + mh$.invokeExact(self, new_slice); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_transitivity { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, + private static class Float64Vec_to_string { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_transitivity"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_to_string"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12205,58 +12338,57 @@ private static class One_transitivity { /** * Function descriptor for: * {@snippet lang=c : - * One *One_transitivity(const One *hold, const One *nohold) + * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) * } */ - public static FunctionDescriptor One_transitivity$descriptor() { - return One_transitivity.DESC; + public static FunctionDescriptor Float64Vec_to_string$descriptor() { + return Float64Vec_to_string.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_transitivity(const One *hold, const One *nohold) + * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) * } */ - public static MethodHandle One_transitivity$handle() { - return One_transitivity.HANDLE; + public static MethodHandle Float64Vec_to_string$handle() { + return Float64Vec_to_string.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_transitivity(const One *hold, const One *nohold) + * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) * } */ - public static MemorySegment One_transitivity$address() { - return One_transitivity.ADDR; + public static MemorySegment Float64Vec_to_string$address() { + return Float64Vec_to_string.ADDR; } /** * {@snippet lang=c : - * One *One_transitivity(const One *hold, const One *nohold) + * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) * } */ - public static MemorySegment One_transitivity(MemorySegment hold, MemorySegment nohold) { - var mh$ = One_transitivity.HANDLE; + public static void Float64Vec_to_string(MemorySegment self, MemorySegment write) { + var mh$ = Float64Vec_to_string.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_transitivity", hold, nohold); + traceDowncall("Float64Vec_to_string", self, write); } - return (MemorySegment)mh$.invokeExact(hold, nohold); + mh$.invokeExact(self, write); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_cycle { + private static class Float64Vec_borrow { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, + DiplomatF64View.layout(), somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_cycle"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_borrow"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12264,61 +12396,56 @@ private static class One_cycle { /** * Function descriptor for: * {@snippet lang=c : - * One *One_cycle(const Two *hold, const One *nohold) + * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) * } */ - public static FunctionDescriptor One_cycle$descriptor() { - return One_cycle.DESC; + public static FunctionDescriptor Float64Vec_borrow$descriptor() { + return Float64Vec_borrow.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_cycle(const Two *hold, const One *nohold) + * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) * } */ - public static MethodHandle One_cycle$handle() { - return One_cycle.HANDLE; + public static MethodHandle Float64Vec_borrow$handle() { + return Float64Vec_borrow.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_cycle(const Two *hold, const One *nohold) + * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) * } */ - public static MemorySegment One_cycle$address() { - return One_cycle.ADDR; + public static MemorySegment Float64Vec_borrow$address() { + return Float64Vec_borrow.ADDR; } /** * {@snippet lang=c : - * One *One_cycle(const Two *hold, const One *nohold) + * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) * } */ - public static MemorySegment One_cycle(MemorySegment hold, MemorySegment nohold) { - var mh$ = One_cycle.HANDLE; + public static MemorySegment Float64Vec_borrow(SegmentAllocator allocator, MemorySegment self) { + var mh$ = Float64Vec_borrow.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_cycle", hold, nohold); + traceDowncall("Float64Vec_borrow", allocator, self); } - return (MemorySegment)mh$.invokeExact(hold, nohold); + return (MemorySegment)mh$.invokeExact(allocator, self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_many_dependents { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, + private static class Float64Vec_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_many_dependents"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12326,58 +12453,57 @@ private static class One_many_dependents { /** * Function descriptor for: * {@snippet lang=c : - * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) + * void Float64Vec_destroy(Float64Vec *self) * } */ - public static FunctionDescriptor One_many_dependents$descriptor() { - return One_many_dependents.DESC; + public static FunctionDescriptor Float64Vec_destroy$descriptor() { + return Float64Vec_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) + * void Float64Vec_destroy(Float64Vec *self) * } */ - public static MethodHandle One_many_dependents$handle() { - return One_many_dependents.HANDLE; + public static MethodHandle Float64Vec_destroy$handle() { + return Float64Vec_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) + * void Float64Vec_destroy(Float64Vec *self) * } */ - public static MemorySegment One_many_dependents$address() { - return One_many_dependents.ADDR; + public static MemorySegment Float64Vec_destroy$address() { + return Float64Vec_destroy.ADDR; } /** * {@snippet lang=c : - * One *One_many_dependents(const One *a, const One *b, const Two *c, const Two *d, const Two *nohold) + * void Float64Vec_destroy(Float64Vec *self) * } */ - public static MemorySegment One_many_dependents(MemorySegment a, MemorySegment b, MemorySegment c, MemorySegment d, MemorySegment nohold) { - var mh$ = One_many_dependents.HANDLE; + public static void Float64Vec_destroy(MemorySegment self) { + var mh$ = Float64Vec_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_many_dependents", a, b, c, d, nohold); + traceDowncall("Float64Vec_destroy", self); } - return (MemorySegment)mh$.invokeExact(a, b, c, d, nohold); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_return_outlives_param { + private static class MyString_new { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER + DiplomatStringView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_return_outlives_param"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12385,60 +12511,57 @@ private static class One_return_outlives_param { /** * Function descriptor for: * {@snippet lang=c : - * One *One_return_outlives_param(const Two *hold, const One *nohold) + * MyString *MyString_new(DiplomatStringView v) * } */ - public static FunctionDescriptor One_return_outlives_param$descriptor() { - return One_return_outlives_param.DESC; + public static FunctionDescriptor MyString_new$descriptor() { + return MyString_new.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_return_outlives_param(const Two *hold, const One *nohold) + * MyString *MyString_new(DiplomatStringView v) * } */ - public static MethodHandle One_return_outlives_param$handle() { - return One_return_outlives_param.HANDLE; + public static MethodHandle MyString_new$handle() { + return MyString_new.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_return_outlives_param(const Two *hold, const One *nohold) + * MyString *MyString_new(DiplomatStringView v) * } */ - public static MemorySegment One_return_outlives_param$address() { - return One_return_outlives_param.ADDR; + public static MemorySegment MyString_new$address() { + return MyString_new.ADDR; } /** * {@snippet lang=c : - * One *One_return_outlives_param(const Two *hold, const One *nohold) + * MyString *MyString_new(DiplomatStringView v) * } */ - public static MemorySegment One_return_outlives_param(MemorySegment hold, MemorySegment nohold) { - var mh$ = One_return_outlives_param.HANDLE; + public static MemorySegment MyString_new(MemorySegment v) { + var mh$ = MyString_new.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_return_outlives_param", hold, nohold); + traceDowncall("MyString_new", v); } - return (MemorySegment)mh$.invokeExact(hold, nohold); + return (MemorySegment)mh$.invokeExact(v); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_diamond_top { + private static class MyString_new_unsafe { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER + DiplomatStringView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_top"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new_unsafe"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12446,60 +12569,57 @@ private static class One_diamond_top { /** * Function descriptor for: * {@snippet lang=c : - * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) + * MyString *MyString_new_unsafe(DiplomatStringView v) * } */ - public static FunctionDescriptor One_diamond_top$descriptor() { - return One_diamond_top.DESC; + public static FunctionDescriptor MyString_new_unsafe$descriptor() { + return MyString_new_unsafe.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) + * MyString *MyString_new_unsafe(DiplomatStringView v) * } */ - public static MethodHandle One_diamond_top$handle() { - return One_diamond_top.HANDLE; + public static MethodHandle MyString_new_unsafe$handle() { + return MyString_new_unsafe.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) + * MyString *MyString_new_unsafe(DiplomatStringView v) * } */ - public static MemorySegment One_diamond_top$address() { - return One_diamond_top.ADDR; + public static MemorySegment MyString_new_unsafe$address() { + return MyString_new_unsafe.ADDR; } /** * {@snippet lang=c : - * One *One_diamond_top(const One *top, const One *left, const One *right, const One *bottom) + * MyString *MyString_new_unsafe(DiplomatStringView v) * } */ - public static MemorySegment One_diamond_top(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { - var mh$ = One_diamond_top.HANDLE; + public static MemorySegment MyString_new_unsafe(MemorySegment v) { + var mh$ = MyString_new_unsafe.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_diamond_top", top, left, right, bottom); + traceDowncall("MyString_new_unsafe", v); } - return (MemorySegment)mh$.invokeExact(top, left, right, bottom); + return (MemorySegment)mh$.invokeExact(v); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_diamond_left { + private static class MyString_new_owned { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER + DiplomatStringView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_left"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new_owned"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12507,60 +12627,57 @@ private static class One_diamond_left { /** * Function descriptor for: * {@snippet lang=c : - * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) + * MyString *MyString_new_owned(DiplomatStringView v) * } */ - public static FunctionDescriptor One_diamond_left$descriptor() { - return One_diamond_left.DESC; + public static FunctionDescriptor MyString_new_owned$descriptor() { + return MyString_new_owned.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) + * MyString *MyString_new_owned(DiplomatStringView v) * } */ - public static MethodHandle One_diamond_left$handle() { - return One_diamond_left.HANDLE; + public static MethodHandle MyString_new_owned$handle() { + return MyString_new_owned.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) + * MyString *MyString_new_owned(DiplomatStringView v) * } */ - public static MemorySegment One_diamond_left$address() { - return One_diamond_left.ADDR; + public static MemorySegment MyString_new_owned$address() { + return MyString_new_owned.ADDR; } /** * {@snippet lang=c : - * One *One_diamond_left(const One *top, const One *left, const One *right, const One *bottom) + * MyString *MyString_new_owned(DiplomatStringView v) * } */ - public static MemorySegment One_diamond_left(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { - var mh$ = One_diamond_left.HANDLE; + public static MemorySegment MyString_new_owned(MemorySegment v) { + var mh$ = MyString_new_owned.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_diamond_left", top, left, right, bottom); + traceDowncall("MyString_new_owned", v); } - return (MemorySegment)mh$.invokeExact(top, left, right, bottom); + return (MemorySegment)mh$.invokeExact(v); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_diamond_right { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, + private static class MyString_new_from_first { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - somelib_h.C_POINTER + DiplomatStringsView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_right"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new_from_first"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12568,60 +12685,57 @@ private static class One_diamond_right { /** * Function descriptor for: * {@snippet lang=c : - * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) + * MyString *MyString_new_from_first(DiplomatStringsView v) * } */ - public static FunctionDescriptor One_diamond_right$descriptor() { - return One_diamond_right.DESC; + public static FunctionDescriptor MyString_new_from_first$descriptor() { + return MyString_new_from_first.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) + * MyString *MyString_new_from_first(DiplomatStringsView v) * } */ - public static MethodHandle One_diamond_right$handle() { - return One_diamond_right.HANDLE; + public static MethodHandle MyString_new_from_first$handle() { + return MyString_new_from_first.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) + * MyString *MyString_new_from_first(DiplomatStringsView v) * } */ - public static MemorySegment One_diamond_right$address() { - return One_diamond_right.ADDR; + public static MemorySegment MyString_new_from_first$address() { + return MyString_new_from_first.ADDR; } /** * {@snippet lang=c : - * One *One_diamond_right(const One *top, const One *left, const One *right, const One *bottom) + * MyString *MyString_new_from_first(DiplomatStringsView v) * } */ - public static MemorySegment One_diamond_right(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { - var mh$ = One_diamond_right.HANDLE; + public static MemorySegment MyString_new_from_first(MemorySegment v) { + var mh$ = MyString_new_from_first.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_diamond_right", top, left, right, bottom); + traceDowncall("MyString_new_from_first", v); } - return (MemorySegment)mh$.invokeExact(top, left, right, bottom); + return (MemorySegment)mh$.invokeExact(v); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_diamond_bottom { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, + private static class MyString_set_str { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER, - somelib_h.C_POINTER + DiplomatStringView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_bottom"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_set_str"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12629,61 +12743,57 @@ private static class One_diamond_bottom { /** * Function descriptor for: * {@snippet lang=c : - * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) + * void MyString_set_str(MyString *self, DiplomatStringView new_str) * } */ - public static FunctionDescriptor One_diamond_bottom$descriptor() { - return One_diamond_bottom.DESC; + public static FunctionDescriptor MyString_set_str$descriptor() { + return MyString_set_str.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) + * void MyString_set_str(MyString *self, DiplomatStringView new_str) * } */ - public static MethodHandle One_diamond_bottom$handle() { - return One_diamond_bottom.HANDLE; + public static MethodHandle MyString_set_str$handle() { + return MyString_set_str.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) + * void MyString_set_str(MyString *self, DiplomatStringView new_str) * } */ - public static MemorySegment One_diamond_bottom$address() { - return One_diamond_bottom.ADDR; + public static MemorySegment MyString_set_str$address() { + return MyString_set_str.ADDR; } /** * {@snippet lang=c : - * One *One_diamond_bottom(const One *top, const One *left, const One *right, const One *bottom) + * void MyString_set_str(MyString *self, DiplomatStringView new_str) * } */ - public static MemorySegment One_diamond_bottom(MemorySegment top, MemorySegment left, MemorySegment right, MemorySegment bottom) { - var mh$ = One_diamond_bottom.HANDLE; + public static void MyString_set_str(MemorySegment self, MemorySegment new_str) { + var mh$ = MyString_set_str.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_diamond_bottom", top, left, right, bottom); + traceDowncall("MyString_set_str", self, new_str); } - return (MemorySegment)mh$.invokeExact(top, left, right, bottom); + mh$.invokeExact(self, new_str); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_diamond_and_nested_types { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, + private static class MyString_get_str { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_diamond_and_nested_types"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_get_str"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12691,59 +12801,57 @@ private static class One_diamond_and_nested_types { /** * Function descriptor for: * {@snippet lang=c : - * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) + * void MyString_get_str(const MyString *self, DiplomatWrite *write) * } */ - public static FunctionDescriptor One_diamond_and_nested_types$descriptor() { - return One_diamond_and_nested_types.DESC; + public static FunctionDescriptor MyString_get_str$descriptor() { + return MyString_get_str.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) + * void MyString_get_str(const MyString *self, DiplomatWrite *write) * } */ - public static MethodHandle One_diamond_and_nested_types$handle() { - return One_diamond_and_nested_types.HANDLE; + public static MethodHandle MyString_get_str$handle() { + return MyString_get_str.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) + * void MyString_get_str(const MyString *self, DiplomatWrite *write) * } */ - public static MemorySegment One_diamond_and_nested_types$address() { - return One_diamond_and_nested_types.ADDR; + public static MemorySegment MyString_get_str$address() { + return MyString_get_str.ADDR; } /** * {@snippet lang=c : - * One *One_diamond_and_nested_types(const One *a, const One *b, const One *c, const One *d, const One *nohold) + * void MyString_get_str(const MyString *self, DiplomatWrite *write) * } */ - public static MemorySegment One_diamond_and_nested_types(MemorySegment a, MemorySegment b, MemorySegment c, MemorySegment d, MemorySegment nohold) { - var mh$ = One_diamond_and_nested_types.HANDLE; + public static void MyString_get_str(MemorySegment self, MemorySegment write) { + var mh$ = MyString_get_str.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_diamond_and_nested_types", a, b, c, d, nohold); + traceDowncall("MyString_get_str", self, write); } - return (MemorySegment)mh$.invokeExact(a, b, c, d, nohold); + mh$.invokeExact(self, write); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_implicit_bounds { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, + private static class MyString_string_transform { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + DiplomatStringView.layout(), somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_implicit_bounds"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_string_transform"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12751,60 +12859,56 @@ private static class One_implicit_bounds { /** * Function descriptor for: * {@snippet lang=c : - * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) + * void MyString_string_transform(DiplomatStringView foo, DiplomatWrite *write) * } */ - public static FunctionDescriptor One_implicit_bounds$descriptor() { - return One_implicit_bounds.DESC; + public static FunctionDescriptor MyString_string_transform$descriptor() { + return MyString_string_transform.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) + * void MyString_string_transform(DiplomatStringView foo, DiplomatWrite *write) * } */ - public static MethodHandle One_implicit_bounds$handle() { - return One_implicit_bounds.HANDLE; + public static MethodHandle MyString_string_transform$handle() { + return MyString_string_transform.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) + * void MyString_string_transform(DiplomatStringView foo, DiplomatWrite *write) * } */ - public static MemorySegment One_implicit_bounds$address() { - return One_implicit_bounds.ADDR; + public static MemorySegment MyString_string_transform$address() { + return MyString_string_transform.ADDR; } /** * {@snippet lang=c : - * One *One_implicit_bounds(const One *explicit_hold, const One *implicit_hold, const One *nohold) + * void MyString_string_transform(DiplomatStringView foo, DiplomatWrite *write) * } */ - public static MemorySegment One_implicit_bounds(MemorySegment explicit_hold, MemorySegment implicit_hold, MemorySegment nohold) { - var mh$ = One_implicit_bounds.HANDLE; + public static void MyString_string_transform(MemorySegment foo, MemorySegment write) { + var mh$ = MyString_string_transform.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_implicit_bounds", explicit_hold, implicit_hold, nohold); + traceDowncall("MyString_string_transform", foo, write); } - return (MemorySegment)mh$.invokeExact(explicit_hold, implicit_hold, nohold); + mh$.invokeExact(foo, write); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_implicit_bounds_deep { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, - somelib_h.C_POINTER, + private static class MyString_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_implicit_bounds_deep"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12812,56 +12916,55 @@ private static class One_implicit_bounds_deep { /** * Function descriptor for: * {@snippet lang=c : - * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) + * void MyString_destroy(MyString *self) * } */ - public static FunctionDescriptor One_implicit_bounds_deep$descriptor() { - return One_implicit_bounds_deep.DESC; + public static FunctionDescriptor MyString_destroy$descriptor() { + return MyString_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) + * void MyString_destroy(MyString *self) * } */ - public static MethodHandle One_implicit_bounds_deep$handle() { - return One_implicit_bounds_deep.HANDLE; + public static MethodHandle MyString_destroy$handle() { + return MyString_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) + * void MyString_destroy(MyString *self) * } */ - public static MemorySegment One_implicit_bounds_deep$address() { - return One_implicit_bounds_deep.ADDR; + public static MemorySegment MyString_destroy$address() { + return MyString_destroy.ADDR; } /** * {@snippet lang=c : - * One *One_implicit_bounds_deep(const One *explicit_, const One *implicit_1, const One *implicit_2, const One *nohold) + * void MyString_destroy(MyString *self) * } */ - public static MemorySegment One_implicit_bounds_deep(MemorySegment explicit_, MemorySegment implicit_1, MemorySegment implicit_2, MemorySegment nohold) { - var mh$ = One_implicit_bounds_deep.HANDLE; + public static void MyString_destroy(MemorySegment self) { + var mh$ = MyString_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_implicit_bounds_deep", explicit_, implicit_1, implicit_2, nohold); + traceDowncall("MyString_destroy", self); } - return (MemorySegment)mh$.invokeExact(explicit_, implicit_1, implicit_2, nohold); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class One_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER - ); + private static class Opaque_new { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("One_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_new"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12869,57 +12972,57 @@ private static class One_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void One_destroy(One *self) + * Opaque *Opaque_new() * } */ - public static FunctionDescriptor One_destroy$descriptor() { - return One_destroy.DESC; + public static FunctionDescriptor Opaque_new$descriptor() { + return Opaque_new.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void One_destroy(One *self) + * Opaque *Opaque_new() * } */ - public static MethodHandle One_destroy$handle() { - return One_destroy.HANDLE; + public static MethodHandle Opaque_new$handle() { + return Opaque_new.HANDLE; } /** * Address for: * {@snippet lang=c : - * void One_destroy(One *self) + * Opaque *Opaque_new() * } */ - public static MemorySegment One_destroy$address() { - return One_destroy.ADDR; + public static MemorySegment Opaque_new$address() { + return Opaque_new.ADDR; } /** * {@snippet lang=c : - * void One_destroy(One *self) + * Opaque *Opaque_new() * } */ - public static void One_destroy(MemorySegment self) { - var mh$ = One_destroy.HANDLE; + public static MemorySegment Opaque_new() { + var mh$ = Opaque_new.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("One_destroy", self); + traceDowncall("Opaque_new"); } - mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_new_bool { + private static class Opaque_from_str { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - DiplomatBoolView.layout() + DiplomatStringView.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_bool"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_from_str"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12927,57 +13030,57 @@ private static class Float64Vec_new_bool { /** * Function descriptor for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_bool(DiplomatBoolView v) + * Opaque *Opaque_from_str(DiplomatStringView input) * } */ - public static FunctionDescriptor Float64Vec_new_bool$descriptor() { - return Float64Vec_new_bool.DESC; + public static FunctionDescriptor Opaque_from_str$descriptor() { + return Opaque_from_str.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_bool(DiplomatBoolView v) + * Opaque *Opaque_from_str(DiplomatStringView input) * } */ - public static MethodHandle Float64Vec_new_bool$handle() { - return Float64Vec_new_bool.HANDLE; + public static MethodHandle Opaque_from_str$handle() { + return Opaque_from_str.HANDLE; } /** * Address for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_bool(DiplomatBoolView v) + * Opaque *Opaque_from_str(DiplomatStringView input) * } */ - public static MemorySegment Float64Vec_new_bool$address() { - return Float64Vec_new_bool.ADDR; + public static MemorySegment Opaque_from_str$address() { + return Opaque_from_str.ADDR; } /** * {@snippet lang=c : - * Float64Vec *Float64Vec_new_bool(DiplomatBoolView v) + * Opaque *Opaque_from_str(DiplomatStringView input) * } */ - public static MemorySegment Float64Vec_new_bool(MemorySegment v) { - var mh$ = Float64Vec_new_bool.HANDLE; + public static MemorySegment Opaque_from_str(MemorySegment input) { + var mh$ = Opaque_from_str.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_new_bool", v); + traceDowncall("Opaque_from_str", input); } - return (MemorySegment)mh$.invokeExact(v); + return (MemorySegment)mh$.invokeExact(input); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_new_i16 { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( + private static class Opaque_get_debug_str { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER, - DiplomatI16View.layout() + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_i16"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_get_debug_str"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -12985,57 +13088,57 @@ private static class Float64Vec_new_i16 { /** * Function descriptor for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_i16(DiplomatI16View v) + * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) * } */ - public static FunctionDescriptor Float64Vec_new_i16$descriptor() { - return Float64Vec_new_i16.DESC; + public static FunctionDescriptor Opaque_get_debug_str$descriptor() { + return Opaque_get_debug_str.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_i16(DiplomatI16View v) + * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) * } */ - public static MethodHandle Float64Vec_new_i16$handle() { - return Float64Vec_new_i16.HANDLE; + public static MethodHandle Opaque_get_debug_str$handle() { + return Opaque_get_debug_str.HANDLE; } /** * Address for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_i16(DiplomatI16View v) + * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) * } */ - public static MemorySegment Float64Vec_new_i16$address() { - return Float64Vec_new_i16.ADDR; + public static MemorySegment Opaque_get_debug_str$address() { + return Opaque_get_debug_str.ADDR; } /** * {@snippet lang=c : - * Float64Vec *Float64Vec_new_i16(DiplomatI16View v) + * void Opaque_get_debug_str(const Opaque *self, DiplomatWrite *write) * } */ - public static MemorySegment Float64Vec_new_i16(MemorySegment v) { - var mh$ = Float64Vec_new_i16.HANDLE; + public static void Opaque_get_debug_str(MemorySegment self, MemorySegment write) { + var mh$ = Opaque_get_debug_str.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_new_i16", v); + traceDowncall("Opaque_get_debug_str", self, write); } - return (MemorySegment)mh$.invokeExact(v); + mh$.invokeExact(self, write); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_new_u16 { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( + private static class Opaque_assert_struct { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER, - DiplomatU16View.layout() + MyStruct.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_u16"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_assert_struct"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13043,57 +13146,55 @@ private static class Float64Vec_new_u16 { /** * Function descriptor for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_u16(DiplomatU16View v) + * void Opaque_assert_struct(const Opaque *self, MyStruct s) * } */ - public static FunctionDescriptor Float64Vec_new_u16$descriptor() { - return Float64Vec_new_u16.DESC; + public static FunctionDescriptor Opaque_assert_struct$descriptor() { + return Opaque_assert_struct.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_u16(DiplomatU16View v) + * void Opaque_assert_struct(const Opaque *self, MyStruct s) * } */ - public static MethodHandle Float64Vec_new_u16$handle() { - return Float64Vec_new_u16.HANDLE; + public static MethodHandle Opaque_assert_struct$handle() { + return Opaque_assert_struct.HANDLE; } /** * Address for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_u16(DiplomatU16View v) + * void Opaque_assert_struct(const Opaque *self, MyStruct s) * } */ - public static MemorySegment Float64Vec_new_u16$address() { - return Float64Vec_new_u16.ADDR; + public static MemorySegment Opaque_assert_struct$address() { + return Opaque_assert_struct.ADDR; } /** * {@snippet lang=c : - * Float64Vec *Float64Vec_new_u16(DiplomatU16View v) + * void Opaque_assert_struct(const Opaque *self, MyStruct s) * } */ - public static MemorySegment Float64Vec_new_u16(MemorySegment v) { - var mh$ = Float64Vec_new_u16.HANDLE; + public static void Opaque_assert_struct(MemorySegment self, MemorySegment s) { + var mh$ = Opaque_assert_struct.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_new_u16", v); + traceDowncall("Opaque_assert_struct", self, s); } - return (MemorySegment)mh$.invokeExact(v); + mh$.invokeExact(self, s); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_new_isize { + private static class Opaque_returns_usize { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - DiplomatIsizeView.layout() - ); + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_isize"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_returns_usize"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13101,57 +13202,57 @@ private static class Float64Vec_new_isize { /** * Function descriptor for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_isize(DiplomatIsizeView v) + * size_t Opaque_returns_usize() * } */ - public static FunctionDescriptor Float64Vec_new_isize$descriptor() { - return Float64Vec_new_isize.DESC; + public static FunctionDescriptor Opaque_returns_usize$descriptor() { + return Opaque_returns_usize.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_isize(DiplomatIsizeView v) + * size_t Opaque_returns_usize() * } */ - public static MethodHandle Float64Vec_new_isize$handle() { - return Float64Vec_new_isize.HANDLE; + public static MethodHandle Opaque_returns_usize$handle() { + return Opaque_returns_usize.HANDLE; } /** * Address for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_isize(DiplomatIsizeView v) + * size_t Opaque_returns_usize() * } */ - public static MemorySegment Float64Vec_new_isize$address() { - return Float64Vec_new_isize.ADDR; + public static MemorySegment Opaque_returns_usize$address() { + return Opaque_returns_usize.ADDR; } /** * {@snippet lang=c : - * Float64Vec *Float64Vec_new_isize(DiplomatIsizeView v) + * size_t Opaque_returns_usize() * } */ - public static MemorySegment Float64Vec_new_isize(MemorySegment v) { - var mh$ = Float64Vec_new_isize.HANDLE; + public static long Opaque_returns_usize() { + var mh$ = Opaque_returns_usize.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_new_isize", v); + traceDowncall("Opaque_returns_usize"); } - return (MemorySegment)mh$.invokeExact(v); + return (long)mh$.invokeExact(); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_new_usize { + private static class Opaque_internal_len { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - DiplomatUsizeView.layout() + somelib_h.C_LONG, + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_usize"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_internal_len"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13159,57 +13260,55 @@ private static class Float64Vec_new_usize { /** * Function descriptor for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_usize(DiplomatUsizeView v) + * size_t Opaque_internal_len(const Opaque *self) * } */ - public static FunctionDescriptor Float64Vec_new_usize$descriptor() { - return Float64Vec_new_usize.DESC; + public static FunctionDescriptor Opaque_internal_len$descriptor() { + return Opaque_internal_len.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_usize(DiplomatUsizeView v) + * size_t Opaque_internal_len(const Opaque *self) * } */ - public static MethodHandle Float64Vec_new_usize$handle() { - return Float64Vec_new_usize.HANDLE; + public static MethodHandle Opaque_internal_len$handle() { + return Opaque_internal_len.HANDLE; } /** * Address for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_usize(DiplomatUsizeView v) + * size_t Opaque_internal_len(const Opaque *self) * } */ - public static MemorySegment Float64Vec_new_usize$address() { - return Float64Vec_new_usize.ADDR; + public static MemorySegment Opaque_internal_len$address() { + return Opaque_internal_len.ADDR; } /** * {@snippet lang=c : - * Float64Vec *Float64Vec_new_usize(DiplomatUsizeView v) + * size_t Opaque_internal_len(const Opaque *self) * } */ - public static MemorySegment Float64Vec_new_usize(MemorySegment v) { - var mh$ = Float64Vec_new_usize.HANDLE; + public static long Opaque_internal_len(MemorySegment self) { + var mh$ = Opaque_internal_len.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_new_usize", v); + traceDowncall("Opaque_internal_len", self); } - return (MemorySegment)mh$.invokeExact(v); + return (long)mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_new_f64_be_bytes { + private static class Opaque_returns_imported { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - DiplomatU8View.layout() - ); + ImportedStruct.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_f64_be_bytes"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_returns_imported"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13217,57 +13316,55 @@ private static class Float64Vec_new_f64_be_bytes { /** * Function descriptor for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_f64_be_bytes(DiplomatU8View v) + * ImportedStruct Opaque_returns_imported() * } */ - public static FunctionDescriptor Float64Vec_new_f64_be_bytes$descriptor() { - return Float64Vec_new_f64_be_bytes.DESC; + public static FunctionDescriptor Opaque_returns_imported$descriptor() { + return Opaque_returns_imported.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_f64_be_bytes(DiplomatU8View v) + * ImportedStruct Opaque_returns_imported() * } */ - public static MethodHandle Float64Vec_new_f64_be_bytes$handle() { - return Float64Vec_new_f64_be_bytes.HANDLE; + public static MethodHandle Opaque_returns_imported$handle() { + return Opaque_returns_imported.HANDLE; } /** * Address for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_f64_be_bytes(DiplomatU8View v) + * ImportedStruct Opaque_returns_imported() * } */ - public static MemorySegment Float64Vec_new_f64_be_bytes$address() { - return Float64Vec_new_f64_be_bytes.ADDR; + public static MemorySegment Opaque_returns_imported$address() { + return Opaque_returns_imported.ADDR; } /** * {@snippet lang=c : - * Float64Vec *Float64Vec_new_f64_be_bytes(DiplomatU8View v) + * ImportedStruct Opaque_returns_imported() * } */ - public static MemorySegment Float64Vec_new_f64_be_bytes(MemorySegment v) { - var mh$ = Float64Vec_new_f64_be_bytes.HANDLE; + public static MemorySegment Opaque_returns_imported(SegmentAllocator allocator) { + var mh$ = Opaque_returns_imported.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_new_f64_be_bytes", v); + traceDowncall("Opaque_returns_imported", allocator); } - return (MemorySegment)mh$.invokeExact(v); + return (MemorySegment)mh$.invokeExact(allocator); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_new_from_owned { + private static class Opaque_cmp { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - DiplomatF64ViewMut.layout() - ); + somelib_h.C_CHAR ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_from_owned"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_cmp"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13275,57 +13372,56 @@ private static class Float64Vec_new_from_owned { /** * Function descriptor for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_from_owned(DiplomatF64ViewMut v) + * int8_t Opaque_cmp() * } */ - public static FunctionDescriptor Float64Vec_new_from_owned$descriptor() { - return Float64Vec_new_from_owned.DESC; + public static FunctionDescriptor Opaque_cmp$descriptor() { + return Opaque_cmp.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_from_owned(DiplomatF64ViewMut v) + * int8_t Opaque_cmp() * } */ - public static MethodHandle Float64Vec_new_from_owned$handle() { - return Float64Vec_new_from_owned.HANDLE; + public static MethodHandle Opaque_cmp$handle() { + return Opaque_cmp.HANDLE; } /** * Address for: * {@snippet lang=c : - * Float64Vec *Float64Vec_new_from_owned(DiplomatF64ViewMut v) + * int8_t Opaque_cmp() * } */ - public static MemorySegment Float64Vec_new_from_owned$address() { - return Float64Vec_new_from_owned.ADDR; + public static MemorySegment Opaque_cmp$address() { + return Opaque_cmp.ADDR; } /** * {@snippet lang=c : - * Float64Vec *Float64Vec_new_from_owned(DiplomatF64ViewMut v) + * int8_t Opaque_cmp() * } */ - public static MemorySegment Float64Vec_new_from_owned(MemorySegment v) { - var mh$ = Float64Vec_new_from_owned.HANDLE; + public static byte Opaque_cmp() { + var mh$ = Opaque_cmp.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_new_from_owned", v); + traceDowncall("Opaque_cmp"); } - return (MemorySegment)mh$.invokeExact(v); + return (byte)mh$.invokeExact(); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_as_slice { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - DiplomatF64View.layout(), + private static class Opaque_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_as_slice"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Opaque_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13333,57 +13429,57 @@ private static class Float64Vec_as_slice { /** * Function descriptor for: * {@snippet lang=c : - * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) + * void Opaque_destroy(Opaque *self) * } */ - public static FunctionDescriptor Float64Vec_as_slice$descriptor() { - return Float64Vec_as_slice.DESC; + public static FunctionDescriptor Opaque_destroy$descriptor() { + return Opaque_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) + * void Opaque_destroy(Opaque *self) * } */ - public static MethodHandle Float64Vec_as_slice$handle() { - return Float64Vec_as_slice.HANDLE; + public static MethodHandle Opaque_destroy$handle() { + return Opaque_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) + * void Opaque_destroy(Opaque *self) * } */ - public static MemorySegment Float64Vec_as_slice$address() { - return Float64Vec_as_slice.ADDR; + public static MemorySegment Opaque_destroy$address() { + return Opaque_destroy.ADDR; } /** * {@snippet lang=c : - * DiplomatF64View Float64Vec_as_slice(const Float64Vec *self) + * void Opaque_destroy(Opaque *self) * } */ - public static MemorySegment Float64Vec_as_slice(SegmentAllocator allocator, MemorySegment self) { - var mh$ = Float64Vec_as_slice.HANDLE; + public static void Opaque_destroy(MemorySegment self) { + var mh$ = Opaque_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_as_slice", allocator, self); + traceDowncall("Opaque_destroy", self); } - return (MemorySegment)mh$.invokeExact(allocator, self); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_fill_slice { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class OpaqueMutexedString_from_usize { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - DiplomatF64ViewMut.layout() + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_fill_slice"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_from_usize"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13391,57 +13487,57 @@ private static class Float64Vec_fill_slice { /** * Function descriptor for: * {@snippet lang=c : - * void Float64Vec_fill_slice(const Float64Vec *self, DiplomatF64ViewMut v) + * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) * } */ - public static FunctionDescriptor Float64Vec_fill_slice$descriptor() { - return Float64Vec_fill_slice.DESC; + public static FunctionDescriptor OpaqueMutexedString_from_usize$descriptor() { + return OpaqueMutexedString_from_usize.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Float64Vec_fill_slice(const Float64Vec *self, DiplomatF64ViewMut v) + * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) * } */ - public static MethodHandle Float64Vec_fill_slice$handle() { - return Float64Vec_fill_slice.HANDLE; + public static MethodHandle OpaqueMutexedString_from_usize$handle() { + return OpaqueMutexedString_from_usize.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Float64Vec_fill_slice(const Float64Vec *self, DiplomatF64ViewMut v) + * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) * } */ - public static MemorySegment Float64Vec_fill_slice$address() { - return Float64Vec_fill_slice.ADDR; + public static MemorySegment OpaqueMutexedString_from_usize$address() { + return OpaqueMutexedString_from_usize.ADDR; } /** * {@snippet lang=c : - * void Float64Vec_fill_slice(const Float64Vec *self, DiplomatF64ViewMut v) + * OpaqueMutexedString *OpaqueMutexedString_from_usize(size_t number) * } */ - public static void Float64Vec_fill_slice(MemorySegment self, MemorySegment v) { - var mh$ = Float64Vec_fill_slice.HANDLE; + public static MemorySegment OpaqueMutexedString_from_usize(long number) { + var mh$ = OpaqueMutexedString_from_usize.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_fill_slice", self, v); + traceDowncall("OpaqueMutexedString_from_usize", number); } - mh$.invokeExact(self, v); + return (MemorySegment)mh$.invokeExact(number); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_set_value { + private static class OpaqueMutexedString_change { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER, - DiplomatF64View.layout() + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_set_value"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_change"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13449,57 +13545,57 @@ private static class Float64Vec_set_value { /** * Function descriptor for: * {@snippet lang=c : - * void Float64Vec_set_value(Float64Vec *self, DiplomatF64View new_slice) + * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) * } */ - public static FunctionDescriptor Float64Vec_set_value$descriptor() { - return Float64Vec_set_value.DESC; + public static FunctionDescriptor OpaqueMutexedString_change$descriptor() { + return OpaqueMutexedString_change.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Float64Vec_set_value(Float64Vec *self, DiplomatF64View new_slice) + * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) * } */ - public static MethodHandle Float64Vec_set_value$handle() { - return Float64Vec_set_value.HANDLE; + public static MethodHandle OpaqueMutexedString_change$handle() { + return OpaqueMutexedString_change.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Float64Vec_set_value(Float64Vec *self, DiplomatF64View new_slice) + * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) * } */ - public static MemorySegment Float64Vec_set_value$address() { - return Float64Vec_set_value.ADDR; + public static MemorySegment OpaqueMutexedString_change$address() { + return OpaqueMutexedString_change.ADDR; } /** * {@snippet lang=c : - * void Float64Vec_set_value(Float64Vec *self, DiplomatF64View new_slice) + * void OpaqueMutexedString_change(const OpaqueMutexedString *self, size_t number) * } */ - public static void Float64Vec_set_value(MemorySegment self, MemorySegment new_slice) { - var mh$ = Float64Vec_set_value.HANDLE; + public static void OpaqueMutexedString_change(MemorySegment self, long number) { + var mh$ = OpaqueMutexedString_change.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_set_value", self, new_slice); + traceDowncall("OpaqueMutexedString_change", self, number); } - mh$.invokeExact(self, new_slice); + mh$.invokeExact(self, number); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_to_string { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class OpaqueMutexedString_borrow { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_to_string"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_borrow"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13507,57 +13603,57 @@ private static class Float64Vec_to_string { /** * Function descriptor for: * {@snippet lang=c : - * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) + * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) * } */ - public static FunctionDescriptor Float64Vec_to_string$descriptor() { - return Float64Vec_to_string.DESC; + public static FunctionDescriptor OpaqueMutexedString_borrow$descriptor() { + return OpaqueMutexedString_borrow.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) + * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) * } */ - public static MethodHandle Float64Vec_to_string$handle() { - return Float64Vec_to_string.HANDLE; + public static MethodHandle OpaqueMutexedString_borrow$handle() { + return OpaqueMutexedString_borrow.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) + * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) * } */ - public static MemorySegment Float64Vec_to_string$address() { - return Float64Vec_to_string.ADDR; + public static MemorySegment OpaqueMutexedString_borrow$address() { + return OpaqueMutexedString_borrow.ADDR; } /** * {@snippet lang=c : - * void Float64Vec_to_string(const Float64Vec *self, DiplomatWrite *write) + * const OpaqueMutexedString *OpaqueMutexedString_borrow(const OpaqueMutexedString *self) * } */ - public static void Float64Vec_to_string(MemorySegment self, MemorySegment write) { - var mh$ = Float64Vec_to_string.HANDLE; + public static MemorySegment OpaqueMutexedString_borrow(MemorySegment self) { + var mh$ = OpaqueMutexedString_borrow.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_to_string", self, write); + traceDowncall("OpaqueMutexedString_borrow", self); } - mh$.invokeExact(self, write); + return (MemorySegment)mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_borrow { + private static class OpaqueMutexedString_borrow_other { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - DiplomatF64View.layout(), + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_borrow"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_borrow_other"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13565,56 +13661,58 @@ private static class Float64Vec_borrow { /** * Function descriptor for: * {@snippet lang=c : - * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) + * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) * } */ - public static FunctionDescriptor Float64Vec_borrow$descriptor() { - return Float64Vec_borrow.DESC; + public static FunctionDescriptor OpaqueMutexedString_borrow_other$descriptor() { + return OpaqueMutexedString_borrow_other.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) + * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) * } */ - public static MethodHandle Float64Vec_borrow$handle() { - return Float64Vec_borrow.HANDLE; + public static MethodHandle OpaqueMutexedString_borrow_other$handle() { + return OpaqueMutexedString_borrow_other.HANDLE; } /** * Address for: * {@snippet lang=c : - * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) + * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) * } */ - public static MemorySegment Float64Vec_borrow$address() { - return Float64Vec_borrow.ADDR; + public static MemorySegment OpaqueMutexedString_borrow_other$address() { + return OpaqueMutexedString_borrow_other.ADDR; } /** * {@snippet lang=c : - * DiplomatF64View Float64Vec_borrow(const Float64Vec *self) + * const OpaqueMutexedString *OpaqueMutexedString_borrow_other(const OpaqueMutexedString *other) * } */ - public static MemorySegment Float64Vec_borrow(SegmentAllocator allocator, MemorySegment self) { - var mh$ = Float64Vec_borrow.HANDLE; + public static MemorySegment OpaqueMutexedString_borrow_other(MemorySegment other) { + var mh$ = OpaqueMutexedString_borrow_other.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_borrow", allocator, self); + traceDowncall("OpaqueMutexedString_borrow_other", other); } - return (MemorySegment)mh$.invokeExact(allocator, self); + return (MemorySegment)mh$.invokeExact(other); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Float64Vec_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + private static class OpaqueMutexedString_borrow_self_or_other { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_borrow_self_or_other"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13622,93 +13720,58 @@ private static class Float64Vec_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void Float64Vec_destroy(Float64Vec *self) + * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) * } */ - public static FunctionDescriptor Float64Vec_destroy$descriptor() { - return Float64Vec_destroy.DESC; + public static FunctionDescriptor OpaqueMutexedString_borrow_self_or_other$descriptor() { + return OpaqueMutexedString_borrow_self_or_other.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Float64Vec_destroy(Float64Vec *self) + * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) * } */ - public static MethodHandle Float64Vec_destroy$handle() { - return Float64Vec_destroy.HANDLE; + public static MethodHandle OpaqueMutexedString_borrow_self_or_other$handle() { + return OpaqueMutexedString_borrow_self_or_other.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Float64Vec_destroy(Float64Vec *self) + * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) * } */ - public static MemorySegment Float64Vec_destroy$address() { - return Float64Vec_destroy.ADDR; + public static MemorySegment OpaqueMutexedString_borrow_self_or_other$address() { + return OpaqueMutexedString_borrow_self_or_other.ADDR; } /** * {@snippet lang=c : - * void Float64Vec_destroy(Float64Vec *self) + * const OpaqueMutexedString *OpaqueMutexedString_borrow_self_or_other(const OpaqueMutexedString *self, const OpaqueMutexedString *other) * } */ - public static void Float64Vec_destroy(MemorySegment self) { - var mh$ = Float64Vec_destroy.HANDLE; + public static MemorySegment OpaqueMutexedString_borrow_self_or_other(MemorySegment self, MemorySegment other) { + var mh$ = OpaqueMutexedString_borrow_self_or_other.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_destroy", self); + traceDowncall("OpaqueMutexedString_borrow_self_or_other", self, other); } - mh$.invokeExact(self); + return (MemorySegment)mh$.invokeExact(self, other); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static final int ContiguousEnum_C = (int)0L; - /** - * {@snippet lang=c : - * enum ContiguousEnum.ContiguousEnum_C = 0 - * } - */ - public static int ContiguousEnum_C() { - return ContiguousEnum_C; - } - private static final int ContiguousEnum_D = (int)1L; - /** - * {@snippet lang=c : - * enum ContiguousEnum.ContiguousEnum_D = 1 - * } - */ - public static int ContiguousEnum_D() { - return ContiguousEnum_D; - } - private static final int ContiguousEnum_E = (int)2L; - /** - * {@snippet lang=c : - * enum ContiguousEnum.ContiguousEnum_E = 2 - * } - */ - public static int ContiguousEnum_E() { - return ContiguousEnum_E; - } - private static final int ContiguousEnum_F = (int)3L; - /** - * {@snippet lang=c : - * enum ContiguousEnum.ContiguousEnum_F = 3 - * } - */ - public static int ContiguousEnum_F() { - return ContiguousEnum_F; - } - private static class Utf16Wrap_from_utf16 { + private static class OpaqueMutexedString_get_len_and_add { public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_LONG, somelib_h.C_POINTER, - DiplomatString16View.layout() + somelib_h.C_LONG ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_from_utf16"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_get_len_and_add"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13716,57 +13779,57 @@ private static class Utf16Wrap_from_utf16 { /** * Function descriptor for: * {@snippet lang=c : - * Utf16Wrap *Utf16Wrap_from_utf16(DiplomatString16View input) + * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) * } */ - public static FunctionDescriptor Utf16Wrap_from_utf16$descriptor() { - return Utf16Wrap_from_utf16.DESC; + public static FunctionDescriptor OpaqueMutexedString_get_len_and_add$descriptor() { + return OpaqueMutexedString_get_len_and_add.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Utf16Wrap *Utf16Wrap_from_utf16(DiplomatString16View input) + * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) * } */ - public static MethodHandle Utf16Wrap_from_utf16$handle() { - return Utf16Wrap_from_utf16.HANDLE; + public static MethodHandle OpaqueMutexedString_get_len_and_add$handle() { + return OpaqueMutexedString_get_len_and_add.HANDLE; } /** * Address for: * {@snippet lang=c : - * Utf16Wrap *Utf16Wrap_from_utf16(DiplomatString16View input) + * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) * } */ - public static MemorySegment Utf16Wrap_from_utf16$address() { - return Utf16Wrap_from_utf16.ADDR; + public static MemorySegment OpaqueMutexedString_get_len_and_add$address() { + return OpaqueMutexedString_get_len_and_add.ADDR; } /** * {@snippet lang=c : - * Utf16Wrap *Utf16Wrap_from_utf16(DiplomatString16View input) + * size_t OpaqueMutexedString_get_len_and_add(const OpaqueMutexedString *self, size_t other) * } */ - public static MemorySegment Utf16Wrap_from_utf16(MemorySegment input) { - var mh$ = Utf16Wrap_from_utf16.HANDLE; + public static long OpaqueMutexedString_get_len_and_add(MemorySegment self, long other) { + var mh$ = OpaqueMutexedString_get_len_and_add.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Utf16Wrap_from_utf16", input); + traceDowncall("OpaqueMutexedString_get_len_and_add", self, other); } - return (MemorySegment)mh$.invokeExact(input); + return (long)mh$.invokeExact(self, other); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Utf16Wrap_get_debug_str { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER, + private static class OpaqueMutexedString_dummy_str { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + DiplomatStringView.layout(), somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_get_debug_str"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_dummy_str"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13774,57 +13837,57 @@ private static class Utf16Wrap_get_debug_str { /** * Function descriptor for: * {@snippet lang=c : - * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) + * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) * } */ - public static FunctionDescriptor Utf16Wrap_get_debug_str$descriptor() { - return Utf16Wrap_get_debug_str.DESC; + public static FunctionDescriptor OpaqueMutexedString_dummy_str$descriptor() { + return OpaqueMutexedString_dummy_str.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) + * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) * } */ - public static MethodHandle Utf16Wrap_get_debug_str$handle() { - return Utf16Wrap_get_debug_str.HANDLE; + public static MethodHandle OpaqueMutexedString_dummy_str$handle() { + return OpaqueMutexedString_dummy_str.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) + * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) * } */ - public static MemorySegment Utf16Wrap_get_debug_str$address() { - return Utf16Wrap_get_debug_str.ADDR; + public static MemorySegment OpaqueMutexedString_dummy_str$address() { + return OpaqueMutexedString_dummy_str.ADDR; } /** * {@snippet lang=c : - * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) + * DiplomatStringView OpaqueMutexedString_dummy_str(const OpaqueMutexedString *self) * } */ - public static void Utf16Wrap_get_debug_str(MemorySegment self, MemorySegment write) { - var mh$ = Utf16Wrap_get_debug_str.HANDLE; + public static MemorySegment OpaqueMutexedString_dummy_str(SegmentAllocator allocator, MemorySegment self) { + var mh$ = OpaqueMutexedString_dummy_str.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Utf16Wrap_get_debug_str", self, write); + traceDowncall("OpaqueMutexedString_dummy_str", allocator, self); } - mh$.invokeExact(self, write); + return (MemorySegment)mh$.invokeExact(allocator, self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Utf16Wrap_borrow_cont { + private static class OpaqueMutexedString_wrapper { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - DiplomatString16View.layout(), + somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_borrow_cont"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_wrapper"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13832,56 +13895,56 @@ private static class Utf16Wrap_borrow_cont { /** * Function descriptor for: * {@snippet lang=c : - * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) + * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) * } */ - public static FunctionDescriptor Utf16Wrap_borrow_cont$descriptor() { - return Utf16Wrap_borrow_cont.DESC; + public static FunctionDescriptor OpaqueMutexedString_wrapper$descriptor() { + return OpaqueMutexedString_wrapper.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) + * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) * } */ - public static MethodHandle Utf16Wrap_borrow_cont$handle() { - return Utf16Wrap_borrow_cont.HANDLE; + public static MethodHandle OpaqueMutexedString_wrapper$handle() { + return OpaqueMutexedString_wrapper.HANDLE; } /** * Address for: * {@snippet lang=c : - * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) + * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) * } */ - public static MemorySegment Utf16Wrap_borrow_cont$address() { - return Utf16Wrap_borrow_cont.ADDR; + public static MemorySegment OpaqueMutexedString_wrapper$address() { + return OpaqueMutexedString_wrapper.ADDR; } /** * {@snippet lang=c : - * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) + * Utf16Wrap *OpaqueMutexedString_wrapper(const OpaqueMutexedString *self) * } */ - public static MemorySegment Utf16Wrap_borrow_cont(SegmentAllocator allocator, MemorySegment self) { - var mh$ = Utf16Wrap_borrow_cont.HANDLE; + public static MemorySegment OpaqueMutexedString_wrapper(MemorySegment self) { + var mh$ = OpaqueMutexedString_wrapper.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Utf16Wrap_borrow_cont", allocator, self); + traceDowncall("OpaqueMutexedString_wrapper", self); } - return (MemorySegment)mh$.invokeExact(allocator, self); + return (MemorySegment)mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Utf16Wrap_destroy { + private static class OpaqueMutexedString_destroy { public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_destroy"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("OpaqueMutexedString_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13889,43 +13952,43 @@ private static class Utf16Wrap_destroy { /** * Function descriptor for: * {@snippet lang=c : - * void Utf16Wrap_destroy(Utf16Wrap *self) + * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) * } */ - public static FunctionDescriptor Utf16Wrap_destroy$descriptor() { - return Utf16Wrap_destroy.DESC; + public static FunctionDescriptor OpaqueMutexedString_destroy$descriptor() { + return OpaqueMutexedString_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * void Utf16Wrap_destroy(Utf16Wrap *self) + * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) * } */ - public static MethodHandle Utf16Wrap_destroy$handle() { - return Utf16Wrap_destroy.HANDLE; + public static MethodHandle OpaqueMutexedString_destroy$handle() { + return OpaqueMutexedString_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * void Utf16Wrap_destroy(Utf16Wrap *self) + * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) * } */ - public static MemorySegment Utf16Wrap_destroy$address() { - return Utf16Wrap_destroy.ADDR; + public static MemorySegment OpaqueMutexedString_destroy$address() { + return OpaqueMutexedString_destroy.ADDR; } /** * {@snippet lang=c : - * void Utf16Wrap_destroy(Utf16Wrap *self) + * void OpaqueMutexedString_destroy(OpaqueMutexedString *self) * } */ - public static void Utf16Wrap_destroy(MemorySegment self) { - var mh$ = Utf16Wrap_destroy.HANDLE; + public static void OpaqueMutexedString_destroy(MemorySegment self) { + var mh$ = OpaqueMutexedString_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Utf16Wrap_destroy", self); + traceDowncall("OpaqueMutexedString_destroy", self); } mh$.invokeExact(self); } catch (Throwable ex$) { @@ -13933,13 +13996,13 @@ public static void Utf16Wrap_destroy(MemorySegment self) { } } - private static class Foo_new { + private static class Utf16Wrap_from_utf16 { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, - DiplomatStringView.layout() + DiplomatString16View.layout() ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_new"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_from_utf16"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -13947,57 +14010,57 @@ private static class Foo_new { /** * Function descriptor for: * {@snippet lang=c : - * Foo *Foo_new(DiplomatStringView x) + * Utf16Wrap *Utf16Wrap_from_utf16(DiplomatString16View input) * } */ - public static FunctionDescriptor Foo_new$descriptor() { - return Foo_new.DESC; + public static FunctionDescriptor Utf16Wrap_from_utf16$descriptor() { + return Utf16Wrap_from_utf16.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Foo *Foo_new(DiplomatStringView x) + * Utf16Wrap *Utf16Wrap_from_utf16(DiplomatString16View input) * } */ - public static MethodHandle Foo_new$handle() { - return Foo_new.HANDLE; + public static MethodHandle Utf16Wrap_from_utf16$handle() { + return Utf16Wrap_from_utf16.HANDLE; } /** * Address for: * {@snippet lang=c : - * Foo *Foo_new(DiplomatStringView x) + * Utf16Wrap *Utf16Wrap_from_utf16(DiplomatString16View input) * } */ - public static MemorySegment Foo_new$address() { - return Foo_new.ADDR; + public static MemorySegment Utf16Wrap_from_utf16$address() { + return Utf16Wrap_from_utf16.ADDR; } /** * {@snippet lang=c : - * Foo *Foo_new(DiplomatStringView x) + * Utf16Wrap *Utf16Wrap_from_utf16(DiplomatString16View input) * } */ - public static MemorySegment Foo_new(MemorySegment x) { - var mh$ = Foo_new.HANDLE; + public static MemorySegment Utf16Wrap_from_utf16(MemorySegment input) { + var mh$ = Utf16Wrap_from_utf16.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Foo_new", x); + traceDowncall("Utf16Wrap_from_utf16", input); } - return (MemorySegment)mh$.invokeExact(x); + return (MemorySegment)mh$.invokeExact(input); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Foo_get_bar { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( + private static class Utf16Wrap_get_debug_str { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( somelib_h.C_POINTER, somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_get_bar"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_get_debug_str"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14005,57 +14068,57 @@ private static class Foo_get_bar { /** * Function descriptor for: * {@snippet lang=c : - * Bar *Foo_get_bar(const Foo *self) + * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) * } */ - public static FunctionDescriptor Foo_get_bar$descriptor() { - return Foo_get_bar.DESC; + public static FunctionDescriptor Utf16Wrap_get_debug_str$descriptor() { + return Utf16Wrap_get_debug_str.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Bar *Foo_get_bar(const Foo *self) + * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) * } */ - public static MethodHandle Foo_get_bar$handle() { - return Foo_get_bar.HANDLE; + public static MethodHandle Utf16Wrap_get_debug_str$handle() { + return Utf16Wrap_get_debug_str.HANDLE; } /** * Address for: * {@snippet lang=c : - * Bar *Foo_get_bar(const Foo *self) + * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) * } */ - public static MemorySegment Foo_get_bar$address() { - return Foo_get_bar.ADDR; + public static MemorySegment Utf16Wrap_get_debug_str$address() { + return Utf16Wrap_get_debug_str.ADDR; } /** * {@snippet lang=c : - * Bar *Foo_get_bar(const Foo *self) + * void Utf16Wrap_get_debug_str(const Utf16Wrap *self, DiplomatWrite *write) * } */ - public static MemorySegment Foo_get_bar(MemorySegment self) { - var mh$ = Foo_get_bar.HANDLE; + public static void Utf16Wrap_get_debug_str(MemorySegment self, MemorySegment write) { + var mh$ = Utf16Wrap_get_debug_str.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Foo_get_bar", self); + traceDowncall("Utf16Wrap_get_debug_str", self, write); } - return (MemorySegment)mh$.invokeExact(self); + mh$.invokeExact(self, write); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - private static class Foo_as_returning { + private static class Utf16Wrap_borrow_cont { public static final FunctionDescriptor DESC = FunctionDescriptor.of( - BorrowedFieldsReturning.layout(), + DiplomatString16View.layout(), somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_as_returning"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_borrow_cont"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14063,43 +14126,43 @@ private static class Foo_as_returning { /** * Function descriptor for: * {@snippet lang=c : - * BorrowedFieldsReturning Foo_as_returning(const Foo *self) + * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) * } */ - public static FunctionDescriptor Foo_as_returning$descriptor() { - return Foo_as_returning.DESC; + public static FunctionDescriptor Utf16Wrap_borrow_cont$descriptor() { + return Utf16Wrap_borrow_cont.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * BorrowedFieldsReturning Foo_as_returning(const Foo *self) + * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) * } */ - public static MethodHandle Foo_as_returning$handle() { - return Foo_as_returning.HANDLE; + public static MethodHandle Utf16Wrap_borrow_cont$handle() { + return Utf16Wrap_borrow_cont.HANDLE; } /** * Address for: * {@snippet lang=c : - * BorrowedFieldsReturning Foo_as_returning(const Foo *self) + * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) * } */ - public static MemorySegment Foo_as_returning$address() { - return Foo_as_returning.ADDR; + public static MemorySegment Utf16Wrap_borrow_cont$address() { + return Utf16Wrap_borrow_cont.ADDR; } /** * {@snippet lang=c : - * BorrowedFieldsReturning Foo_as_returning(const Foo *self) + * DiplomatString16View Utf16Wrap_borrow_cont(const Utf16Wrap *self) * } */ - public static MemorySegment Foo_as_returning(SegmentAllocator allocator, MemorySegment self) { - var mh$ = Foo_as_returning.HANDLE; + public static MemorySegment Utf16Wrap_borrow_cont(SegmentAllocator allocator, MemorySegment self) { + var mh$ = Utf16Wrap_borrow_cont.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Foo_as_returning", allocator, self); + traceDowncall("Utf16Wrap_borrow_cont", allocator, self); } return (MemorySegment)mh$.invokeExact(allocator, self); } catch (Throwable ex$) { @@ -14107,13 +14170,12 @@ public static MemorySegment Foo_as_returning(SegmentAllocator allocator, MemoryS } } - private static class Foo_extract_from_fields { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - BorrowedFields.layout() + private static class Utf16Wrap_destroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + somelib_h.C_POINTER ); - public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_extract_from_fields"); + public static final MemorySegment ADDR = somelib_h.findOrThrow("Utf16Wrap_destroy"); public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); } @@ -14121,164 +14183,102 @@ private static class Foo_extract_from_fields { /** * Function descriptor for: * {@snippet lang=c : - * Foo *Foo_extract_from_fields(BorrowedFields fields) + * void Utf16Wrap_destroy(Utf16Wrap *self) * } */ - public static FunctionDescriptor Foo_extract_from_fields$descriptor() { - return Foo_extract_from_fields.DESC; + public static FunctionDescriptor Utf16Wrap_destroy$descriptor() { + return Utf16Wrap_destroy.DESC; } /** * Downcall method handle for: * {@snippet lang=c : - * Foo *Foo_extract_from_fields(BorrowedFields fields) + * void Utf16Wrap_destroy(Utf16Wrap *self) * } */ - public static MethodHandle Foo_extract_from_fields$handle() { - return Foo_extract_from_fields.HANDLE; + public static MethodHandle Utf16Wrap_destroy$handle() { + return Utf16Wrap_destroy.HANDLE; } /** * Address for: * {@snippet lang=c : - * Foo *Foo_extract_from_fields(BorrowedFields fields) + * void Utf16Wrap_destroy(Utf16Wrap *self) * } */ - public static MemorySegment Foo_extract_from_fields$address() { - return Foo_extract_from_fields.ADDR; + public static MemorySegment Utf16Wrap_destroy$address() { + return Utf16Wrap_destroy.ADDR; } /** * {@snippet lang=c : - * Foo *Foo_extract_from_fields(BorrowedFields fields) + * void Utf16Wrap_destroy(Utf16Wrap *self) * } */ - public static MemorySegment Foo_extract_from_fields(MemorySegment fields) { - var mh$ = Foo_extract_from_fields.HANDLE; + public static void Utf16Wrap_destroy(MemorySegment self) { + var mh$ = Utf16Wrap_destroy.HANDLE; try { if (TRACE_DOWNCALLS) { - traceDowncall("Foo_extract_from_fields", fields); + traceDowncall("Utf16Wrap_destroy", self); } - return (MemorySegment)mh$.invokeExact(fields); + mh$.invokeExact(self); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } } - - private static class Foo_extract_from_bounds { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - BorrowedFieldsWithBounds.layout(), - DiplomatStringView.layout() - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_extract_from_bounds"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, DiplomatStringView another_string) - * } - */ - public static FunctionDescriptor Foo_extract_from_bounds$descriptor() { - return Foo_extract_from_bounds.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, DiplomatStringView another_string) - * } - */ - public static MethodHandle Foo_extract_from_bounds$handle() { - return Foo_extract_from_bounds.HANDLE; - } - + private static final int ErrorEnum_Foo = (int)0L; /** - * Address for: * {@snippet lang=c : - * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, DiplomatStringView another_string) + * enum ErrorEnum.ErrorEnum_Foo = 0 * } */ - public static MemorySegment Foo_extract_from_bounds$address() { - return Foo_extract_from_bounds.ADDR; + public static int ErrorEnum_Foo() { + return ErrorEnum_Foo; } - + private static final int ErrorEnum_Bar = (int)1L; /** * {@snippet lang=c : - * Foo *Foo_extract_from_bounds(BorrowedFieldsWithBounds bounds, DiplomatStringView another_string) + * enum ErrorEnum.ErrorEnum_Bar = 1 * } */ - public static MemorySegment Foo_extract_from_bounds(MemorySegment bounds, MemorySegment another_string) { - var mh$ = Foo_extract_from_bounds.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("Foo_extract_from_bounds", bounds, another_string); - } - return (MemorySegment)mh$.invokeExact(bounds, another_string); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class Foo_destroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - somelib_h.C_POINTER - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("Foo_destroy"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + public static int ErrorEnum_Bar() { + return ErrorEnum_Bar; } - + private static final int ContiguousEnum_C = (int)0L; /** - * Function descriptor for: * {@snippet lang=c : - * void Foo_destroy(Foo *self) + * enum ContiguousEnum.ContiguousEnum_C = 0 * } */ - public static FunctionDescriptor Foo_destroy$descriptor() { - return Foo_destroy.DESC; + public static int ContiguousEnum_C() { + return ContiguousEnum_C; } - + private static final int ContiguousEnum_D = (int)1L; /** - * Downcall method handle for: * {@snippet lang=c : - * void Foo_destroy(Foo *self) + * enum ContiguousEnum.ContiguousEnum_D = 1 * } */ - public static MethodHandle Foo_destroy$handle() { - return Foo_destroy.HANDLE; + public static int ContiguousEnum_D() { + return ContiguousEnum_D; } - + private static final int ContiguousEnum_E = (int)2L; /** - * Address for: * {@snippet lang=c : - * void Foo_destroy(Foo *self) + * enum ContiguousEnum.ContiguousEnum_E = 2 * } */ - public static MemorySegment Foo_destroy$address() { - return Foo_destroy.ADDR; + public static int ContiguousEnum_E() { + return ContiguousEnum_E; } - + private static final int ContiguousEnum_F = (int)3L; /** * {@snippet lang=c : - * void Foo_destroy(Foo *self) + * enum ContiguousEnum.ContiguousEnum_F = 3 * } */ - public static void Foo_destroy(MemorySegment self) { - var mh$ = Foo_destroy.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("Foo_destroy", self); - } - mh$.invokeExact(self); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } + public static int ContiguousEnum_F() { + return ContiguousEnum_F; } private static class MyEnum_into_value { @@ -14433,1073 +14433,1073 @@ public static long __DARWIN_C_FULL() { public static long __DARWIN_C_LEVEL() { return __DARWIN_C_LEVEL; } - private static final int MAC_OS_X_VERSION_10_0 = (int)1000L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_0 1000 + * #define __ASSERT_FILE_NAME "jextract$7847839858914727962.h" * } */ - public static int MAC_OS_X_VERSION_10_0() { - return MAC_OS_X_VERSION_10_0; + public static MemorySegment __ASSERT_FILE_NAME() { + class Holder { + static final MemorySegment __ASSERT_FILE_NAME + = somelib_h.LIBRARY_ARENA.allocateFrom("jextract$7847839858914727962.h"); + } + return Holder.__ASSERT_FILE_NAME; } - private static final int MAC_OS_X_VERSION_10_1 = (int)1010L; + private static final MemorySegment NULL = MemorySegment.ofAddress(0L); /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_1 1010 + * #define NULL (void*) 0 * } */ - public static int MAC_OS_X_VERSION_10_1() { - return MAC_OS_X_VERSION_10_1; + public static MemorySegment NULL() { + return NULL; } - private static final int MAC_OS_X_VERSION_10_2 = (int)1020L; + private static final MemorySegment __DARWIN_NULL = MemorySegment.ofAddress(0L); /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_2 1020 + * #define __DARWIN_NULL (void*) 0 * } */ - public static int MAC_OS_X_VERSION_10_2() { - return MAC_OS_X_VERSION_10_2; + public static MemorySegment __DARWIN_NULL() { + return __DARWIN_NULL; } - private static final int MAC_OS_X_VERSION_10_3 = (int)1030L; + private static final long USER_ADDR_NULL = 0L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_3 1030 + * #define USER_ADDR_NULL 0 * } */ - public static int MAC_OS_X_VERSION_10_3() { - return MAC_OS_X_VERSION_10_3; + public static long USER_ADDR_NULL() { + return USER_ADDR_NULL; } - private static final int MAC_OS_X_VERSION_10_4 = (int)1040L; + private static final long INT64_MAX = 9223372036854775807L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_4 1040 + * #define INT64_MAX 9223372036854775807 * } */ - public static int MAC_OS_X_VERSION_10_4() { - return MAC_OS_X_VERSION_10_4; + public static long INT64_MAX() { + return INT64_MAX; } - private static final int MAC_OS_X_VERSION_10_5 = (int)1050L; + private static final int INT8_MIN = (int)-128L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_5 1050 + * #define INT8_MIN -128 * } */ - public static int MAC_OS_X_VERSION_10_5() { - return MAC_OS_X_VERSION_10_5; + public static int INT8_MIN() { + return INT8_MIN; } - private static final int MAC_OS_X_VERSION_10_6 = (int)1060L; + private static final int INT16_MIN = (int)-32768L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_6 1060 + * #define INT16_MIN -32768 * } */ - public static int MAC_OS_X_VERSION_10_6() { - return MAC_OS_X_VERSION_10_6; + public static int INT16_MIN() { + return INT16_MIN; } - private static final int MAC_OS_X_VERSION_10_7 = (int)1070L; + private static final int INT32_MIN = (int)-2147483648L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_7 1070 + * #define INT32_MIN -2147483648 * } */ - public static int MAC_OS_X_VERSION_10_7() { - return MAC_OS_X_VERSION_10_7; + public static int INT32_MIN() { + return INT32_MIN; } - private static final int MAC_OS_X_VERSION_10_8 = (int)1080L; + private static final long INT64_MIN = -9223372036854775808L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_8 1080 + * #define INT64_MIN -9223372036854775808 * } */ - public static int MAC_OS_X_VERSION_10_8() { - return MAC_OS_X_VERSION_10_8; + public static long INT64_MIN() { + return INT64_MIN; } - private static final int MAC_OS_X_VERSION_10_9 = (int)1090L; + private static final int UINT32_MAX = (int)4294967295L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_9 1090 + * #define UINT32_MAX 4294967295 * } */ - public static int MAC_OS_X_VERSION_10_9() { - return MAC_OS_X_VERSION_10_9; + public static int UINT32_MAX() { + return UINT32_MAX; } - private static final int MAC_OS_X_VERSION_10_10 = (int)101000L; + private static final long UINT64_MAX = -1L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_10 101000 + * #define UINT64_MAX -1 * } */ - public static int MAC_OS_X_VERSION_10_10() { - return MAC_OS_X_VERSION_10_10; + public static long UINT64_MAX() { + return UINT64_MAX; } - private static final int MAC_OS_X_VERSION_10_10_2 = (int)101002L; + private static final int INT_LEAST8_MIN = (int)-128L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_10_2 101002 + * #define INT_LEAST8_MIN -128 * } */ - public static int MAC_OS_X_VERSION_10_10_2() { - return MAC_OS_X_VERSION_10_10_2; + public static int INT_LEAST8_MIN() { + return INT_LEAST8_MIN; } - private static final int MAC_OS_X_VERSION_10_10_3 = (int)101003L; + private static final int INT_LEAST16_MIN = (int)-32768L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_10_3 101003 + * #define INT_LEAST16_MIN -32768 * } */ - public static int MAC_OS_X_VERSION_10_10_3() { - return MAC_OS_X_VERSION_10_10_3; + public static int INT_LEAST16_MIN() { + return INT_LEAST16_MIN; } - private static final int MAC_OS_X_VERSION_10_11 = (int)101100L; + private static final int INT_LEAST32_MIN = (int)-2147483648L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_11 101100 + * #define INT_LEAST32_MIN -2147483648 * } */ - public static int MAC_OS_X_VERSION_10_11() { - return MAC_OS_X_VERSION_10_11; + public static int INT_LEAST32_MIN() { + return INT_LEAST32_MIN; } - private static final int MAC_OS_X_VERSION_10_11_2 = (int)101102L; + private static final long INT_LEAST64_MIN = -9223372036854775808L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_11_2 101102 + * #define INT_LEAST64_MIN -9223372036854775808 * } */ - public static int MAC_OS_X_VERSION_10_11_2() { - return MAC_OS_X_VERSION_10_11_2; + public static long INT_LEAST64_MIN() { + return INT_LEAST64_MIN; } - private static final int MAC_OS_X_VERSION_10_11_3 = (int)101103L; + private static final int INT_LEAST8_MAX = (int)127L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_11_3 101103 + * #define INT_LEAST8_MAX 127 * } */ - public static int MAC_OS_X_VERSION_10_11_3() { - return MAC_OS_X_VERSION_10_11_3; + public static int INT_LEAST8_MAX() { + return INT_LEAST8_MAX; } - private static final int MAC_OS_X_VERSION_10_11_4 = (int)101104L; + private static final int INT_LEAST16_MAX = (int)32767L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_11_4 101104 + * #define INT_LEAST16_MAX 32767 * } */ - public static int MAC_OS_X_VERSION_10_11_4() { - return MAC_OS_X_VERSION_10_11_4; + public static int INT_LEAST16_MAX() { + return INT_LEAST16_MAX; } - private static final int MAC_OS_X_VERSION_10_12 = (int)101200L; + private static final int INT_LEAST32_MAX = (int)2147483647L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_12 101200 + * #define INT_LEAST32_MAX 2147483647 * } */ - public static int MAC_OS_X_VERSION_10_12() { - return MAC_OS_X_VERSION_10_12; + public static int INT_LEAST32_MAX() { + return INT_LEAST32_MAX; } - private static final int MAC_OS_X_VERSION_10_12_1 = (int)101201L; + private static final long INT_LEAST64_MAX = 9223372036854775807L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_12_1 101201 + * #define INT_LEAST64_MAX 9223372036854775807 * } */ - public static int MAC_OS_X_VERSION_10_12_1() { - return MAC_OS_X_VERSION_10_12_1; + public static long INT_LEAST64_MAX() { + return INT_LEAST64_MAX; } - private static final int MAC_OS_X_VERSION_10_12_2 = (int)101202L; + private static final int UINT_LEAST8_MAX = (int)255L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_12_2 101202 + * #define UINT_LEAST8_MAX 255 * } */ - public static int MAC_OS_X_VERSION_10_12_2() { - return MAC_OS_X_VERSION_10_12_2; + public static int UINT_LEAST8_MAX() { + return UINT_LEAST8_MAX; } - private static final int MAC_OS_X_VERSION_10_12_4 = (int)101204L; + private static final int UINT_LEAST16_MAX = (int)65535L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_12_4 101204 + * #define UINT_LEAST16_MAX 65535 * } */ - public static int MAC_OS_X_VERSION_10_12_4() { - return MAC_OS_X_VERSION_10_12_4; + public static int UINT_LEAST16_MAX() { + return UINT_LEAST16_MAX; } - private static final int MAC_OS_X_VERSION_10_13 = (int)101300L; + private static final int UINT_LEAST32_MAX = (int)4294967295L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_13 101300 + * #define UINT_LEAST32_MAX 4294967295 * } */ - public static int MAC_OS_X_VERSION_10_13() { - return MAC_OS_X_VERSION_10_13; + public static int UINT_LEAST32_MAX() { + return UINT_LEAST32_MAX; } - private static final int MAC_OS_X_VERSION_10_13_1 = (int)101301L; + private static final long UINT_LEAST64_MAX = -1L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_13_1 101301 + * #define UINT_LEAST64_MAX -1 * } */ - public static int MAC_OS_X_VERSION_10_13_1() { - return MAC_OS_X_VERSION_10_13_1; + public static long UINT_LEAST64_MAX() { + return UINT_LEAST64_MAX; } - private static final int MAC_OS_X_VERSION_10_13_2 = (int)101302L; + private static final int INT_FAST8_MIN = (int)-128L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_13_2 101302 + * #define INT_FAST8_MIN -128 * } */ - public static int MAC_OS_X_VERSION_10_13_2() { - return MAC_OS_X_VERSION_10_13_2; + public static int INT_FAST8_MIN() { + return INT_FAST8_MIN; } - private static final int MAC_OS_X_VERSION_10_13_4 = (int)101304L; + private static final int INT_FAST16_MIN = (int)-32768L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_13_4 101304 + * #define INT_FAST16_MIN -32768 * } */ - public static int MAC_OS_X_VERSION_10_13_4() { - return MAC_OS_X_VERSION_10_13_4; + public static int INT_FAST16_MIN() { + return INT_FAST16_MIN; } - private static final int MAC_OS_X_VERSION_10_14 = (int)101400L; + private static final int INT_FAST32_MIN = (int)-2147483648L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_14 101400 + * #define INT_FAST32_MIN -2147483648 * } */ - public static int MAC_OS_X_VERSION_10_14() { - return MAC_OS_X_VERSION_10_14; + public static int INT_FAST32_MIN() { + return INT_FAST32_MIN; } - private static final int MAC_OS_X_VERSION_10_14_1 = (int)101401L; + private static final long INT_FAST64_MIN = -9223372036854775808L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_14_1 101401 + * #define INT_FAST64_MIN -9223372036854775808 * } */ - public static int MAC_OS_X_VERSION_10_14_1() { - return MAC_OS_X_VERSION_10_14_1; + public static long INT_FAST64_MIN() { + return INT_FAST64_MIN; } - private static final int MAC_OS_X_VERSION_10_14_4 = (int)101404L; + private static final int INT_FAST8_MAX = (int)127L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_14_4 101404 + * #define INT_FAST8_MAX 127 * } */ - public static int MAC_OS_X_VERSION_10_14_4() { - return MAC_OS_X_VERSION_10_14_4; + public static int INT_FAST8_MAX() { + return INT_FAST8_MAX; } - private static final int MAC_OS_X_VERSION_10_14_5 = (int)101405L; + private static final int INT_FAST16_MAX = (int)32767L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_14_5 101405 + * #define INT_FAST16_MAX 32767 * } */ - public static int MAC_OS_X_VERSION_10_14_5() { - return MAC_OS_X_VERSION_10_14_5; + public static int INT_FAST16_MAX() { + return INT_FAST16_MAX; } - private static final int MAC_OS_X_VERSION_10_14_6 = (int)101406L; + private static final int INT_FAST32_MAX = (int)2147483647L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_14_6 101406 + * #define INT_FAST32_MAX 2147483647 * } */ - public static int MAC_OS_X_VERSION_10_14_6() { - return MAC_OS_X_VERSION_10_14_6; + public static int INT_FAST32_MAX() { + return INT_FAST32_MAX; } - private static final int MAC_OS_X_VERSION_10_15 = (int)101500L; + private static final long INT_FAST64_MAX = 9223372036854775807L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_15 101500 + * #define INT_FAST64_MAX 9223372036854775807 * } */ - public static int MAC_OS_X_VERSION_10_15() { - return MAC_OS_X_VERSION_10_15; + public static long INT_FAST64_MAX() { + return INT_FAST64_MAX; } - private static final int MAC_OS_X_VERSION_10_15_1 = (int)101501L; + private static final int UINT_FAST8_MAX = (int)255L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_15_1 101501 + * #define UINT_FAST8_MAX 255 * } */ - public static int MAC_OS_X_VERSION_10_15_1() { - return MAC_OS_X_VERSION_10_15_1; + public static int UINT_FAST8_MAX() { + return UINT_FAST8_MAX; } - private static final int MAC_OS_X_VERSION_10_15_4 = (int)101504L; + private static final int UINT_FAST16_MAX = (int)65535L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_15_4 101504 + * #define UINT_FAST16_MAX 65535 * } */ - public static int MAC_OS_X_VERSION_10_15_4() { - return MAC_OS_X_VERSION_10_15_4; + public static int UINT_FAST16_MAX() { + return UINT_FAST16_MAX; } - private static final int MAC_OS_X_VERSION_10_16 = (int)101600L; + private static final int UINT_FAST32_MAX = (int)4294967295L; /** * {@snippet lang=c : - * #define MAC_OS_X_VERSION_10_16 101600 + * #define UINT_FAST32_MAX 4294967295 * } */ - public static int MAC_OS_X_VERSION_10_16() { - return MAC_OS_X_VERSION_10_16; + public static int UINT_FAST32_MAX() { + return UINT_FAST32_MAX; } - private static final int MAC_OS_VERSION_11_0 = (int)110000L; + private static final long UINT_FAST64_MAX = -1L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_11_0 110000 + * #define UINT_FAST64_MAX -1 * } */ - public static int MAC_OS_VERSION_11_0() { - return MAC_OS_VERSION_11_0; + public static long UINT_FAST64_MAX() { + return UINT_FAST64_MAX; } - private static final int MAC_OS_VERSION_11_1 = (int)110100L; + private static final long INTPTR_MAX = 9223372036854775807L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_11_1 110100 + * #define INTPTR_MAX 9223372036854775807 * } */ - public static int MAC_OS_VERSION_11_1() { - return MAC_OS_VERSION_11_1; + public static long INTPTR_MAX() { + return INTPTR_MAX; } - private static final int MAC_OS_VERSION_11_3 = (int)110300L; + private static final long INTPTR_MIN = -9223372036854775808L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_11_3 110300 + * #define INTPTR_MIN -9223372036854775808 * } */ - public static int MAC_OS_VERSION_11_3() { - return MAC_OS_VERSION_11_3; + public static long INTPTR_MIN() { + return INTPTR_MIN; } - private static final int MAC_OS_VERSION_11_4 = (int)110400L; + private static final long UINTPTR_MAX = -1L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_11_4 110400 + * #define UINTPTR_MAX -1 * } */ - public static int MAC_OS_VERSION_11_4() { - return MAC_OS_VERSION_11_4; + public static long UINTPTR_MAX() { + return UINTPTR_MAX; } - private static final int MAC_OS_VERSION_11_5 = (int)110500L; + private static final long INTMAX_MAX = 9223372036854775807L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_11_5 110500 + * #define INTMAX_MAX 9223372036854775807 * } */ - public static int MAC_OS_VERSION_11_5() { - return MAC_OS_VERSION_11_5; + public static long INTMAX_MAX() { + return INTMAX_MAX; } - private static final int MAC_OS_VERSION_11_6 = (int)110600L; + private static final long UINTMAX_MAX = -1L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_11_6 110600 + * #define UINTMAX_MAX -1 * } */ - public static int MAC_OS_VERSION_11_6() { - return MAC_OS_VERSION_11_6; + public static long UINTMAX_MAX() { + return UINTMAX_MAX; } - private static final int MAC_OS_VERSION_12_0 = (int)120000L; + private static final long INTMAX_MIN = -9223372036854775808L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_12_0 120000 + * #define INTMAX_MIN -9223372036854775808 * } */ - public static int MAC_OS_VERSION_12_0() { - return MAC_OS_VERSION_12_0; + public static long INTMAX_MIN() { + return INTMAX_MIN; } - private static final int MAC_OS_VERSION_12_1 = (int)120100L; + private static final long PTRDIFF_MIN = -9223372036854775808L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_12_1 120100 + * #define PTRDIFF_MIN -9223372036854775808 * } */ - public static int MAC_OS_VERSION_12_1() { - return MAC_OS_VERSION_12_1; + public static long PTRDIFF_MIN() { + return PTRDIFF_MIN; } - private static final int MAC_OS_VERSION_12_2 = (int)120200L; + private static final long PTRDIFF_MAX = 9223372036854775807L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_12_2 120200 + * #define PTRDIFF_MAX 9223372036854775807 * } */ - public static int MAC_OS_VERSION_12_2() { - return MAC_OS_VERSION_12_2; + public static long PTRDIFF_MAX() { + return PTRDIFF_MAX; } - private static final int MAC_OS_VERSION_12_3 = (int)120300L; + private static final long SIZE_MAX = -1L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_12_3 120300 + * #define SIZE_MAX -1 * } */ - public static int MAC_OS_VERSION_12_3() { - return MAC_OS_VERSION_12_3; + public static long SIZE_MAX() { + return SIZE_MAX; } - private static final int MAC_OS_VERSION_12_4 = (int)120400L; + private static final long RSIZE_MAX = 9223372036854775807L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_12_4 120400 + * #define RSIZE_MAX 9223372036854775807 * } */ - public static int MAC_OS_VERSION_12_4() { - return MAC_OS_VERSION_12_4; + public static long RSIZE_MAX() { + return RSIZE_MAX; } - private static final int MAC_OS_VERSION_12_5 = (int)120500L; + private static final int WCHAR_MAX = (int)2147483647L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_12_5 120500 + * #define WCHAR_MAX 2147483647 * } */ - public static int MAC_OS_VERSION_12_5() { - return MAC_OS_VERSION_12_5; + public static int WCHAR_MAX() { + return WCHAR_MAX; } - private static final int MAC_OS_VERSION_12_6 = (int)120600L; + private static final int WCHAR_MIN = (int)-2147483648L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_12_6 120600 + * #define WCHAR_MIN -2147483648 * } */ - public static int MAC_OS_VERSION_12_6() { - return MAC_OS_VERSION_12_6; + public static int WCHAR_MIN() { + return WCHAR_MIN; } - private static final int MAC_OS_VERSION_12_7 = (int)120700L; + private static final int WINT_MIN = (int)-2147483648L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_12_7 120700 + * #define WINT_MIN -2147483648 * } */ - public static int MAC_OS_VERSION_12_7() { - return MAC_OS_VERSION_12_7; + public static int WINT_MIN() { + return WINT_MIN; } - private static final int MAC_OS_VERSION_13_0 = (int)130000L; + private static final int WINT_MAX = (int)2147483647L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_13_0 130000 + * #define WINT_MAX 2147483647 * } */ - public static int MAC_OS_VERSION_13_0() { - return MAC_OS_VERSION_13_0; + public static int WINT_MAX() { + return WINT_MAX; } - private static final int MAC_OS_VERSION_13_1 = (int)130100L; + private static final int SIG_ATOMIC_MIN = (int)-2147483648L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_13_1 130100 + * #define SIG_ATOMIC_MIN -2147483648 * } */ - public static int MAC_OS_VERSION_13_1() { - return MAC_OS_VERSION_13_1; + public static int SIG_ATOMIC_MIN() { + return SIG_ATOMIC_MIN; } - private static final int MAC_OS_VERSION_13_2 = (int)130200L; + private static final int SIG_ATOMIC_MAX = (int)2147483647L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_13_2 130200 + * #define SIG_ATOMIC_MAX 2147483647 * } */ - public static int MAC_OS_VERSION_13_2() { - return MAC_OS_VERSION_13_2; + public static int SIG_ATOMIC_MAX() { + return SIG_ATOMIC_MAX; } - private static final int MAC_OS_VERSION_13_3 = (int)130300L; + private static final int MAC_OS_X_VERSION_10_0 = (int)1000L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_13_3 130300 + * #define MAC_OS_X_VERSION_10_0 1000 * } */ - public static int MAC_OS_VERSION_13_3() { - return MAC_OS_VERSION_13_3; + public static int MAC_OS_X_VERSION_10_0() { + return MAC_OS_X_VERSION_10_0; } - private static final int MAC_OS_VERSION_13_4 = (int)130400L; + private static final int MAC_OS_X_VERSION_10_1 = (int)1010L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_13_4 130400 + * #define MAC_OS_X_VERSION_10_1 1010 * } */ - public static int MAC_OS_VERSION_13_4() { - return MAC_OS_VERSION_13_4; + public static int MAC_OS_X_VERSION_10_1() { + return MAC_OS_X_VERSION_10_1; } - private static final int MAC_OS_VERSION_13_5 = (int)130500L; + private static final int MAC_OS_X_VERSION_10_2 = (int)1020L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_13_5 130500 + * #define MAC_OS_X_VERSION_10_2 1020 * } */ - public static int MAC_OS_VERSION_13_5() { - return MAC_OS_VERSION_13_5; + public static int MAC_OS_X_VERSION_10_2() { + return MAC_OS_X_VERSION_10_2; } - private static final int MAC_OS_VERSION_13_6 = (int)130600L; + private static final int MAC_OS_X_VERSION_10_3 = (int)1030L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_13_6 130600 + * #define MAC_OS_X_VERSION_10_3 1030 * } */ - public static int MAC_OS_VERSION_13_6() { - return MAC_OS_VERSION_13_6; + public static int MAC_OS_X_VERSION_10_3() { + return MAC_OS_X_VERSION_10_3; } - private static final int MAC_OS_VERSION_14_0 = (int)140000L; + private static final int MAC_OS_X_VERSION_10_4 = (int)1040L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_14_0 140000 + * #define MAC_OS_X_VERSION_10_4 1040 * } */ - public static int MAC_OS_VERSION_14_0() { - return MAC_OS_VERSION_14_0; + public static int MAC_OS_X_VERSION_10_4() { + return MAC_OS_X_VERSION_10_4; } - private static final int MAC_OS_VERSION_14_1 = (int)140100L; + private static final int MAC_OS_X_VERSION_10_5 = (int)1050L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_14_1 140100 + * #define MAC_OS_X_VERSION_10_5 1050 * } */ - public static int MAC_OS_VERSION_14_1() { - return MAC_OS_VERSION_14_1; + public static int MAC_OS_X_VERSION_10_5() { + return MAC_OS_X_VERSION_10_5; } - private static final int MAC_OS_VERSION_14_2 = (int)140200L; + private static final int MAC_OS_X_VERSION_10_6 = (int)1060L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_14_2 140200 + * #define MAC_OS_X_VERSION_10_6 1060 * } */ - public static int MAC_OS_VERSION_14_2() { - return MAC_OS_VERSION_14_2; + public static int MAC_OS_X_VERSION_10_6() { + return MAC_OS_X_VERSION_10_6; } - private static final int MAC_OS_VERSION_14_3 = (int)140300L; + private static final int MAC_OS_X_VERSION_10_7 = (int)1070L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_14_3 140300 + * #define MAC_OS_X_VERSION_10_7 1070 * } */ - public static int MAC_OS_VERSION_14_3() { - return MAC_OS_VERSION_14_3; + public static int MAC_OS_X_VERSION_10_7() { + return MAC_OS_X_VERSION_10_7; } - private static final int MAC_OS_VERSION_14_4 = (int)140400L; + private static final int MAC_OS_X_VERSION_10_8 = (int)1080L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_14_4 140400 + * #define MAC_OS_X_VERSION_10_8 1080 * } */ - public static int MAC_OS_VERSION_14_4() { - return MAC_OS_VERSION_14_4; + public static int MAC_OS_X_VERSION_10_8() { + return MAC_OS_X_VERSION_10_8; } - private static final int MAC_OS_VERSION_14_5 = (int)140500L; + private static final int MAC_OS_X_VERSION_10_9 = (int)1090L; /** * {@snippet lang=c : - * #define MAC_OS_VERSION_14_5 140500 + * #define MAC_OS_X_VERSION_10_9 1090 * } */ - public static int MAC_OS_VERSION_14_5() { - return MAC_OS_VERSION_14_5; + public static int MAC_OS_X_VERSION_10_9() { + return MAC_OS_X_VERSION_10_9; } - private static final int __MAC_OS_X_VERSION_MAX_ALLOWED = (int)140500L; + private static final int MAC_OS_X_VERSION_10_10 = (int)101000L; /** * {@snippet lang=c : - * #define __MAC_OS_X_VERSION_MAX_ALLOWED 140500 + * #define MAC_OS_X_VERSION_10_10 101000 * } */ - public static int __MAC_OS_X_VERSION_MAX_ALLOWED() { - return __MAC_OS_X_VERSION_MAX_ALLOWED; + public static int MAC_OS_X_VERSION_10_10() { + return MAC_OS_X_VERSION_10_10; } - private static final MemorySegment __DARWIN_NULL = MemorySegment.ofAddress(0L); + private static final int MAC_OS_X_VERSION_10_10_2 = (int)101002L; /** * {@snippet lang=c : - * #define __DARWIN_NULL (void*) 0 + * #define MAC_OS_X_VERSION_10_10_2 101002 * } */ - public static MemorySegment __DARWIN_NULL() { - return __DARWIN_NULL; + public static int MAC_OS_X_VERSION_10_10_2() { + return MAC_OS_X_VERSION_10_10_2; } - private static final int __DARWIN_WCHAR_MAX = (int)2147483647L; + private static final int MAC_OS_X_VERSION_10_10_3 = (int)101003L; /** * {@snippet lang=c : - * #define __DARWIN_WCHAR_MAX 2147483647 + * #define MAC_OS_X_VERSION_10_10_3 101003 * } */ - public static int __DARWIN_WCHAR_MAX() { - return __DARWIN_WCHAR_MAX; + public static int MAC_OS_X_VERSION_10_10_3() { + return MAC_OS_X_VERSION_10_10_3; } - private static final int __DARWIN_WCHAR_MIN = (int)-2147483648L; + private static final int MAC_OS_X_VERSION_10_11 = (int)101100L; /** * {@snippet lang=c : - * #define __DARWIN_WCHAR_MIN -2147483648 + * #define MAC_OS_X_VERSION_10_11 101100 * } */ - public static int __DARWIN_WCHAR_MIN() { - return __DARWIN_WCHAR_MIN; + public static int MAC_OS_X_VERSION_10_11() { + return MAC_OS_X_VERSION_10_11; } - private static final int __DARWIN_WEOF = (int)-1L; + private static final int MAC_OS_X_VERSION_10_11_2 = (int)101102L; /** * {@snippet lang=c : - * #define __DARWIN_WEOF -1 + * #define MAC_OS_X_VERSION_10_11_2 101102 * } */ - public static int __DARWIN_WEOF() { - return __DARWIN_WEOF; + public static int MAC_OS_X_VERSION_10_11_2() { + return MAC_OS_X_VERSION_10_11_2; } - private static final long USER_ADDR_NULL = 0L; + private static final int MAC_OS_X_VERSION_10_11_3 = (int)101103L; /** * {@snippet lang=c : - * #define USER_ADDR_NULL 0 + * #define MAC_OS_X_VERSION_10_11_3 101103 * } */ - public static long USER_ADDR_NULL() { - return USER_ADDR_NULL; + public static int MAC_OS_X_VERSION_10_11_3() { + return MAC_OS_X_VERSION_10_11_3; } - private static final MemorySegment NULL = MemorySegment.ofAddress(0L); + private static final int MAC_OS_X_VERSION_10_11_4 = (int)101104L; /** * {@snippet lang=c : - * #define NULL (void*) 0 + * #define MAC_OS_X_VERSION_10_11_4 101104 * } */ - public static MemorySegment NULL() { - return NULL; + public static int MAC_OS_X_VERSION_10_11_4() { + return MAC_OS_X_VERSION_10_11_4; } - private static final int EOF = (int)-1L; + private static final int MAC_OS_X_VERSION_10_12 = (int)101200L; /** * {@snippet lang=c : - * #define EOF -1 + * #define MAC_OS_X_VERSION_10_12 101200 * } */ - public static int EOF() { - return EOF; + public static int MAC_OS_X_VERSION_10_12() { + return MAC_OS_X_VERSION_10_12; } + private static final int MAC_OS_X_VERSION_10_12_1 = (int)101201L; /** * {@snippet lang=c : - * #define P_tmpdir "/var/tmp/" + * #define MAC_OS_X_VERSION_10_12_1 101201 * } */ - public static MemorySegment P_tmpdir() { - class Holder { - static final MemorySegment P_tmpdir - = somelib_h.LIBRARY_ARENA.allocateFrom("/var/tmp/"); - } - return Holder.P_tmpdir; + public static int MAC_OS_X_VERSION_10_12_1() { + return MAC_OS_X_VERSION_10_12_1; } - private static final long INT64_MAX = 9223372036854775807L; + private static final int MAC_OS_X_VERSION_10_12_2 = (int)101202L; /** * {@snippet lang=c : - * #define INT64_MAX 9223372036854775807 + * #define MAC_OS_X_VERSION_10_12_2 101202 * } */ - public static long INT64_MAX() { - return INT64_MAX; + public static int MAC_OS_X_VERSION_10_12_2() { + return MAC_OS_X_VERSION_10_12_2; } - private static final int INT8_MIN = (int)-128L; + private static final int MAC_OS_X_VERSION_10_12_4 = (int)101204L; /** * {@snippet lang=c : - * #define INT8_MIN -128 + * #define MAC_OS_X_VERSION_10_12_4 101204 * } */ - public static int INT8_MIN() { - return INT8_MIN; + public static int MAC_OS_X_VERSION_10_12_4() { + return MAC_OS_X_VERSION_10_12_4; } - private static final int INT16_MIN = (int)-32768L; + private static final int MAC_OS_X_VERSION_10_13 = (int)101300L; /** * {@snippet lang=c : - * #define INT16_MIN -32768 + * #define MAC_OS_X_VERSION_10_13 101300 * } */ - public static int INT16_MIN() { - return INT16_MIN; + public static int MAC_OS_X_VERSION_10_13() { + return MAC_OS_X_VERSION_10_13; } - private static final int INT32_MIN = (int)-2147483648L; + private static final int MAC_OS_X_VERSION_10_13_1 = (int)101301L; /** * {@snippet lang=c : - * #define INT32_MIN -2147483648 + * #define MAC_OS_X_VERSION_10_13_1 101301 * } */ - public static int INT32_MIN() { - return INT32_MIN; + public static int MAC_OS_X_VERSION_10_13_1() { + return MAC_OS_X_VERSION_10_13_1; } - private static final long INT64_MIN = -9223372036854775808L; + private static final int MAC_OS_X_VERSION_10_13_2 = (int)101302L; /** * {@snippet lang=c : - * #define INT64_MIN -9223372036854775808 + * #define MAC_OS_X_VERSION_10_13_2 101302 * } */ - public static long INT64_MIN() { - return INT64_MIN; + public static int MAC_OS_X_VERSION_10_13_2() { + return MAC_OS_X_VERSION_10_13_2; } - private static final int UINT32_MAX = (int)4294967295L; + private static final int MAC_OS_X_VERSION_10_13_4 = (int)101304L; /** * {@snippet lang=c : - * #define UINT32_MAX 4294967295 + * #define MAC_OS_X_VERSION_10_13_4 101304 * } */ - public static int UINT32_MAX() { - return UINT32_MAX; + public static int MAC_OS_X_VERSION_10_13_4() { + return MAC_OS_X_VERSION_10_13_4; } - private static final long UINT64_MAX = -1L; + private static final int MAC_OS_X_VERSION_10_14 = (int)101400L; /** * {@snippet lang=c : - * #define UINT64_MAX -1 + * #define MAC_OS_X_VERSION_10_14 101400 * } */ - public static long UINT64_MAX() { - return UINT64_MAX; + public static int MAC_OS_X_VERSION_10_14() { + return MAC_OS_X_VERSION_10_14; } - private static final int INT_LEAST8_MIN = (int)-128L; + private static final int MAC_OS_X_VERSION_10_14_1 = (int)101401L; /** * {@snippet lang=c : - * #define INT_LEAST8_MIN -128 + * #define MAC_OS_X_VERSION_10_14_1 101401 * } */ - public static int INT_LEAST8_MIN() { - return INT_LEAST8_MIN; + public static int MAC_OS_X_VERSION_10_14_1() { + return MAC_OS_X_VERSION_10_14_1; } - private static final int INT_LEAST16_MIN = (int)-32768L; + private static final int MAC_OS_X_VERSION_10_14_4 = (int)101404L; /** * {@snippet lang=c : - * #define INT_LEAST16_MIN -32768 + * #define MAC_OS_X_VERSION_10_14_4 101404 * } */ - public static int INT_LEAST16_MIN() { - return INT_LEAST16_MIN; + public static int MAC_OS_X_VERSION_10_14_4() { + return MAC_OS_X_VERSION_10_14_4; } - private static final int INT_LEAST32_MIN = (int)-2147483648L; + private static final int MAC_OS_X_VERSION_10_14_5 = (int)101405L; /** * {@snippet lang=c : - * #define INT_LEAST32_MIN -2147483648 + * #define MAC_OS_X_VERSION_10_14_5 101405 * } */ - public static int INT_LEAST32_MIN() { - return INT_LEAST32_MIN; + public static int MAC_OS_X_VERSION_10_14_5() { + return MAC_OS_X_VERSION_10_14_5; } - private static final long INT_LEAST64_MIN = -9223372036854775808L; + private static final int MAC_OS_X_VERSION_10_14_6 = (int)101406L; /** * {@snippet lang=c : - * #define INT_LEAST64_MIN -9223372036854775808 + * #define MAC_OS_X_VERSION_10_14_6 101406 * } */ - public static long INT_LEAST64_MIN() { - return INT_LEAST64_MIN; + public static int MAC_OS_X_VERSION_10_14_6() { + return MAC_OS_X_VERSION_10_14_6; } - private static final int INT_LEAST8_MAX = (int)127L; + private static final int MAC_OS_X_VERSION_10_15 = (int)101500L; /** * {@snippet lang=c : - * #define INT_LEAST8_MAX 127 + * #define MAC_OS_X_VERSION_10_15 101500 * } */ - public static int INT_LEAST8_MAX() { - return INT_LEAST8_MAX; + public static int MAC_OS_X_VERSION_10_15() { + return MAC_OS_X_VERSION_10_15; } - private static final int INT_LEAST16_MAX = (int)32767L; + private static final int MAC_OS_X_VERSION_10_15_1 = (int)101501L; /** * {@snippet lang=c : - * #define INT_LEAST16_MAX 32767 + * #define MAC_OS_X_VERSION_10_15_1 101501 * } */ - public static int INT_LEAST16_MAX() { - return INT_LEAST16_MAX; + public static int MAC_OS_X_VERSION_10_15_1() { + return MAC_OS_X_VERSION_10_15_1; } - private static final int INT_LEAST32_MAX = (int)2147483647L; + private static final int MAC_OS_X_VERSION_10_15_4 = (int)101504L; /** * {@snippet lang=c : - * #define INT_LEAST32_MAX 2147483647 + * #define MAC_OS_X_VERSION_10_15_4 101504 * } */ - public static int INT_LEAST32_MAX() { - return INT_LEAST32_MAX; + public static int MAC_OS_X_VERSION_10_15_4() { + return MAC_OS_X_VERSION_10_15_4; } - private static final long INT_LEAST64_MAX = 9223372036854775807L; + private static final int MAC_OS_X_VERSION_10_16 = (int)101600L; /** * {@snippet lang=c : - * #define INT_LEAST64_MAX 9223372036854775807 + * #define MAC_OS_X_VERSION_10_16 101600 * } */ - public static long INT_LEAST64_MAX() { - return INT_LEAST64_MAX; + public static int MAC_OS_X_VERSION_10_16() { + return MAC_OS_X_VERSION_10_16; } - private static final int UINT_LEAST8_MAX = (int)255L; + private static final int MAC_OS_VERSION_11_0 = (int)110000L; /** * {@snippet lang=c : - * #define UINT_LEAST8_MAX 255 + * #define MAC_OS_VERSION_11_0 110000 * } */ - public static int UINT_LEAST8_MAX() { - return UINT_LEAST8_MAX; + public static int MAC_OS_VERSION_11_0() { + return MAC_OS_VERSION_11_0; } - private static final int UINT_LEAST16_MAX = (int)65535L; + private static final int MAC_OS_VERSION_11_1 = (int)110100L; /** * {@snippet lang=c : - * #define UINT_LEAST16_MAX 65535 + * #define MAC_OS_VERSION_11_1 110100 * } */ - public static int UINT_LEAST16_MAX() { - return UINT_LEAST16_MAX; + public static int MAC_OS_VERSION_11_1() { + return MAC_OS_VERSION_11_1; } - private static final int UINT_LEAST32_MAX = (int)4294967295L; + private static final int MAC_OS_VERSION_11_3 = (int)110300L; /** * {@snippet lang=c : - * #define UINT_LEAST32_MAX 4294967295 + * #define MAC_OS_VERSION_11_3 110300 * } */ - public static int UINT_LEAST32_MAX() { - return UINT_LEAST32_MAX; + public static int MAC_OS_VERSION_11_3() { + return MAC_OS_VERSION_11_3; } - private static final long UINT_LEAST64_MAX = -1L; + private static final int MAC_OS_VERSION_11_4 = (int)110400L; /** * {@snippet lang=c : - * #define UINT_LEAST64_MAX -1 + * #define MAC_OS_VERSION_11_4 110400 * } */ - public static long UINT_LEAST64_MAX() { - return UINT_LEAST64_MAX; + public static int MAC_OS_VERSION_11_4() { + return MAC_OS_VERSION_11_4; } - private static final int INT_FAST8_MIN = (int)-128L; + private static final int MAC_OS_VERSION_11_5 = (int)110500L; /** * {@snippet lang=c : - * #define INT_FAST8_MIN -128 + * #define MAC_OS_VERSION_11_5 110500 * } */ - public static int INT_FAST8_MIN() { - return INT_FAST8_MIN; + public static int MAC_OS_VERSION_11_5() { + return MAC_OS_VERSION_11_5; } - private static final int INT_FAST16_MIN = (int)-32768L; + private static final int MAC_OS_VERSION_11_6 = (int)110600L; /** * {@snippet lang=c : - * #define INT_FAST16_MIN -32768 + * #define MAC_OS_VERSION_11_6 110600 * } */ - public static int INT_FAST16_MIN() { - return INT_FAST16_MIN; + public static int MAC_OS_VERSION_11_6() { + return MAC_OS_VERSION_11_6; } - private static final int INT_FAST32_MIN = (int)-2147483648L; + private static final int MAC_OS_VERSION_12_0 = (int)120000L; /** * {@snippet lang=c : - * #define INT_FAST32_MIN -2147483648 + * #define MAC_OS_VERSION_12_0 120000 * } */ - public static int INT_FAST32_MIN() { - return INT_FAST32_MIN; + public static int MAC_OS_VERSION_12_0() { + return MAC_OS_VERSION_12_0; } - private static final long INT_FAST64_MIN = -9223372036854775808L; + private static final int MAC_OS_VERSION_12_1 = (int)120100L; /** * {@snippet lang=c : - * #define INT_FAST64_MIN -9223372036854775808 + * #define MAC_OS_VERSION_12_1 120100 * } */ - public static long INT_FAST64_MIN() { - return INT_FAST64_MIN; + public static int MAC_OS_VERSION_12_1() { + return MAC_OS_VERSION_12_1; } - private static final int INT_FAST8_MAX = (int)127L; + private static final int MAC_OS_VERSION_12_2 = (int)120200L; /** * {@snippet lang=c : - * #define INT_FAST8_MAX 127 + * #define MAC_OS_VERSION_12_2 120200 * } */ - public static int INT_FAST8_MAX() { - return INT_FAST8_MAX; + public static int MAC_OS_VERSION_12_2() { + return MAC_OS_VERSION_12_2; } - private static final int INT_FAST16_MAX = (int)32767L; + private static final int MAC_OS_VERSION_12_3 = (int)120300L; /** * {@snippet lang=c : - * #define INT_FAST16_MAX 32767 + * #define MAC_OS_VERSION_12_3 120300 * } */ - public static int INT_FAST16_MAX() { - return INT_FAST16_MAX; + public static int MAC_OS_VERSION_12_3() { + return MAC_OS_VERSION_12_3; } - private static final int INT_FAST32_MAX = (int)2147483647L; + private static final int MAC_OS_VERSION_12_4 = (int)120400L; /** * {@snippet lang=c : - * #define INT_FAST32_MAX 2147483647 + * #define MAC_OS_VERSION_12_4 120400 * } */ - public static int INT_FAST32_MAX() { - return INT_FAST32_MAX; + public static int MAC_OS_VERSION_12_4() { + return MAC_OS_VERSION_12_4; } - private static final long INT_FAST64_MAX = 9223372036854775807L; + private static final int MAC_OS_VERSION_12_5 = (int)120500L; /** * {@snippet lang=c : - * #define INT_FAST64_MAX 9223372036854775807 + * #define MAC_OS_VERSION_12_5 120500 * } */ - public static long INT_FAST64_MAX() { - return INT_FAST64_MAX; + public static int MAC_OS_VERSION_12_5() { + return MAC_OS_VERSION_12_5; } - private static final int UINT_FAST8_MAX = (int)255L; + private static final int MAC_OS_VERSION_12_6 = (int)120600L; /** * {@snippet lang=c : - * #define UINT_FAST8_MAX 255 + * #define MAC_OS_VERSION_12_6 120600 * } */ - public static int UINT_FAST8_MAX() { - return UINT_FAST8_MAX; + public static int MAC_OS_VERSION_12_6() { + return MAC_OS_VERSION_12_6; } - private static final int UINT_FAST16_MAX = (int)65535L; + private static final int MAC_OS_VERSION_12_7 = (int)120700L; /** * {@snippet lang=c : - * #define UINT_FAST16_MAX 65535 + * #define MAC_OS_VERSION_12_7 120700 * } */ - public static int UINT_FAST16_MAX() { - return UINT_FAST16_MAX; + public static int MAC_OS_VERSION_12_7() { + return MAC_OS_VERSION_12_7; } - private static final int UINT_FAST32_MAX = (int)4294967295L; + private static final int MAC_OS_VERSION_13_0 = (int)130000L; /** * {@snippet lang=c : - * #define UINT_FAST32_MAX 4294967295 + * #define MAC_OS_VERSION_13_0 130000 * } */ - public static int UINT_FAST32_MAX() { - return UINT_FAST32_MAX; + public static int MAC_OS_VERSION_13_0() { + return MAC_OS_VERSION_13_0; } - private static final long UINT_FAST64_MAX = -1L; + private static final int MAC_OS_VERSION_13_1 = (int)130100L; /** * {@snippet lang=c : - * #define UINT_FAST64_MAX -1 + * #define MAC_OS_VERSION_13_1 130100 * } */ - public static long UINT_FAST64_MAX() { - return UINT_FAST64_MAX; + public static int MAC_OS_VERSION_13_1() { + return MAC_OS_VERSION_13_1; } - private static final long INTPTR_MAX = 9223372036854775807L; + private static final int MAC_OS_VERSION_13_2 = (int)130200L; /** * {@snippet lang=c : - * #define INTPTR_MAX 9223372036854775807 + * #define MAC_OS_VERSION_13_2 130200 * } */ - public static long INTPTR_MAX() { - return INTPTR_MAX; + public static int MAC_OS_VERSION_13_2() { + return MAC_OS_VERSION_13_2; } - private static final long INTPTR_MIN = -9223372036854775808L; + private static final int MAC_OS_VERSION_13_3 = (int)130300L; /** * {@snippet lang=c : - * #define INTPTR_MIN -9223372036854775808 + * #define MAC_OS_VERSION_13_3 130300 * } */ - public static long INTPTR_MIN() { - return INTPTR_MIN; + public static int MAC_OS_VERSION_13_3() { + return MAC_OS_VERSION_13_3; } - private static final long UINTPTR_MAX = -1L; + private static final int MAC_OS_VERSION_13_4 = (int)130400L; /** * {@snippet lang=c : - * #define UINTPTR_MAX -1 + * #define MAC_OS_VERSION_13_4 130400 * } */ - public static long UINTPTR_MAX() { - return UINTPTR_MAX; + public static int MAC_OS_VERSION_13_4() { + return MAC_OS_VERSION_13_4; } - private static final long INTMAX_MAX = 9223372036854775807L; + private static final int MAC_OS_VERSION_13_5 = (int)130500L; /** * {@snippet lang=c : - * #define INTMAX_MAX 9223372036854775807 + * #define MAC_OS_VERSION_13_5 130500 * } */ - public static long INTMAX_MAX() { - return INTMAX_MAX; + public static int MAC_OS_VERSION_13_5() { + return MAC_OS_VERSION_13_5; } - private static final long UINTMAX_MAX = -1L; + private static final int MAC_OS_VERSION_13_6 = (int)130600L; /** * {@snippet lang=c : - * #define UINTMAX_MAX -1 + * #define MAC_OS_VERSION_13_6 130600 * } */ - public static long UINTMAX_MAX() { - return UINTMAX_MAX; + public static int MAC_OS_VERSION_13_6() { + return MAC_OS_VERSION_13_6; } - private static final long INTMAX_MIN = -9223372036854775808L; + private static final int MAC_OS_VERSION_14_0 = (int)140000L; /** * {@snippet lang=c : - * #define INTMAX_MIN -9223372036854775808 + * #define MAC_OS_VERSION_14_0 140000 * } */ - public static long INTMAX_MIN() { - return INTMAX_MIN; + public static int MAC_OS_VERSION_14_0() { + return MAC_OS_VERSION_14_0; } - private static final long PTRDIFF_MIN = -9223372036854775808L; + private static final int MAC_OS_VERSION_14_1 = (int)140100L; /** * {@snippet lang=c : - * #define PTRDIFF_MIN -9223372036854775808 + * #define MAC_OS_VERSION_14_1 140100 * } */ - public static long PTRDIFF_MIN() { - return PTRDIFF_MIN; + public static int MAC_OS_VERSION_14_1() { + return MAC_OS_VERSION_14_1; } - private static final long PTRDIFF_MAX = 9223372036854775807L; + private static final int MAC_OS_VERSION_14_2 = (int)140200L; /** * {@snippet lang=c : - * #define PTRDIFF_MAX 9223372036854775807 + * #define MAC_OS_VERSION_14_2 140200 * } */ - public static long PTRDIFF_MAX() { - return PTRDIFF_MAX; + public static int MAC_OS_VERSION_14_2() { + return MAC_OS_VERSION_14_2; } - private static final long SIZE_MAX = -1L; + private static final int MAC_OS_VERSION_14_3 = (int)140300L; /** * {@snippet lang=c : - * #define SIZE_MAX -1 + * #define MAC_OS_VERSION_14_3 140300 * } */ - public static long SIZE_MAX() { - return SIZE_MAX; + public static int MAC_OS_VERSION_14_3() { + return MAC_OS_VERSION_14_3; } - private static final long RSIZE_MAX = 9223372036854775807L; + private static final int MAC_OS_VERSION_14_4 = (int)140400L; /** * {@snippet lang=c : - * #define RSIZE_MAX 9223372036854775807 + * #define MAC_OS_VERSION_14_4 140400 * } */ - public static long RSIZE_MAX() { - return RSIZE_MAX; + public static int MAC_OS_VERSION_14_4() { + return MAC_OS_VERSION_14_4; } - private static final int WCHAR_MAX = (int)2147483647L; + private static final int MAC_OS_VERSION_14_5 = (int)140500L; /** * {@snippet lang=c : - * #define WCHAR_MAX 2147483647 + * #define MAC_OS_VERSION_14_5 140500 * } */ - public static int WCHAR_MAX() { - return WCHAR_MAX; + public static int MAC_OS_VERSION_14_5() { + return MAC_OS_VERSION_14_5; } - private static final int WCHAR_MIN = (int)-2147483648L; + private static final int __MAC_OS_X_VERSION_MAX_ALLOWED = (int)140500L; /** * {@snippet lang=c : - * #define WCHAR_MIN -2147483648 + * #define __MAC_OS_X_VERSION_MAX_ALLOWED 140500 * } */ - public static int WCHAR_MIN() { - return WCHAR_MIN; + public static int __MAC_OS_X_VERSION_MAX_ALLOWED() { + return __MAC_OS_X_VERSION_MAX_ALLOWED; } - private static final int WINT_MIN = (int)-2147483648L; + private static final int __DARWIN_WCHAR_MAX = (int)2147483647L; /** * {@snippet lang=c : - * #define WINT_MIN -2147483648 + * #define __DARWIN_WCHAR_MAX 2147483647 * } */ - public static int WINT_MIN() { - return WINT_MIN; + public static int __DARWIN_WCHAR_MAX() { + return __DARWIN_WCHAR_MAX; } - private static final int WINT_MAX = (int)2147483647L; + private static final int __DARWIN_WCHAR_MIN = (int)-2147483648L; /** * {@snippet lang=c : - * #define WINT_MAX 2147483647 + * #define __DARWIN_WCHAR_MIN -2147483648 * } */ - public static int WINT_MAX() { - return WINT_MAX; + public static int __DARWIN_WCHAR_MIN() { + return __DARWIN_WCHAR_MIN; } - private static final int SIG_ATOMIC_MIN = (int)-2147483648L; + private static final int __DARWIN_WEOF = (int)-1L; /** * {@snippet lang=c : - * #define SIG_ATOMIC_MIN -2147483648 + * #define __DARWIN_WEOF -1 * } */ - public static int SIG_ATOMIC_MIN() { - return SIG_ATOMIC_MIN; + public static int __DARWIN_WEOF() { + return __DARWIN_WEOF; } - private static final int SIG_ATOMIC_MAX = (int)2147483647L; + private static final int EOF = (int)-1L; /** * {@snippet lang=c : - * #define SIG_ATOMIC_MAX 2147483647 + * #define EOF -1 * } */ - public static int SIG_ATOMIC_MAX() { - return SIG_ATOMIC_MAX; + public static int EOF() { + return EOF; } /** * {@snippet lang=c : - * #define __ASSERT_FILE_NAME "jextract$14714335586850159878.h" + * #define P_tmpdir "/var/tmp/" * } */ - public static MemorySegment __ASSERT_FILE_NAME() { + public static MemorySegment P_tmpdir() { class Holder { - static final MemorySegment __ASSERT_FILE_NAME - = somelib_h.LIBRARY_ARENA.allocateFrom("jextract$14714335586850159878.h"); + static final MemorySegment P_tmpdir + = somelib_h.LIBRARY_ARENA.allocateFrom("/var/tmp/"); } - return Holder.__ASSERT_FILE_NAME; + return Holder.P_tmpdir; } } diff --git a/tool/src/c/mod.rs b/tool/src/c/mod.rs index 46d8d8ffd..d3b082bbb 100644 --- a/tool/src/c/mod.rs +++ b/tool/src/c/mod.rs @@ -37,14 +37,16 @@ pub(crate) fn attr_support() -> BackendAttrSupport { a } + +#[derive(askama::Template)] +#[template(path = "c/runtime.h.jinja", escape = "none")] +pub(crate) struct Runtime; + pub(crate) fn run(tcx: &hir::TypeContext) -> (FileMap, ErrorStore) { let files = FileMap::default(); let formatter = CFormatter::new(tcx, false); let errors = ErrorStore::default(); - #[derive(askama::Template)] - #[template(path = "c/runtime.h.jinja", escape = "none")] - struct Runtime; files.add_file("diplomat_runtime.h".into(), Runtime.to_string()); diff --git a/tool/src/java/mod.rs b/tool/src/java/mod.rs index 8d8ba4ad5..64e108255 100644 --- a/tool/src/java/mod.rs +++ b/tool/src/java/mod.rs @@ -5,6 +5,9 @@ use std::path::Path; use std::{borrow::Cow, iter::once}; use askama::Template; +use diplomat_core::hir::borrowing_param::{ + BorrowingParamVisitor, ParamBorrowInfo, StructBorrowInfo, +}; use diplomat_core::hir::{ self, BackendAttrSupport, EnumDef, EnumVariant, FloatType, IntSizeType, IntType, MaybeOwn, MaybeStatic, Method, OpaqueDef, OpaqueOwner, OpaquePath, ReturnType, Slice, SpecialMethod, @@ -57,26 +60,97 @@ pub(crate) fn run<'a>( .unwrap_or_else(|err| panic!("Failed to open config file {conf_path:?}: {err}")); let tcx_config = toml::from_str::(&conf_str) .expect("Failed to parse config. Required fields are `domain` and `lib_name`"); - let (files, errors) = c::run(tcx); - let errors = errors.take_all(); - if !errors.is_empty() { + let java_formatter = JavaFormatter::new(tcx); + let formatter = &java_formatter; + let error_store = ErrorStore::default(); + let errors = &error_store; + let ty_gen_cx = TyGenContext { + tcx, + tcx_config, + formatter, + errors, + }; + + let Config { + ref domain, + ref lib_name, + } = ty_gen_cx.tcx_config; + let domain_path = domain.replace(".", "/"); + + let errors = ErrorStore::default(); + let c_errors = ErrorStore::default(); + let files = FileMap::default(); + let c_files = FileMap::default(); + + let mut heard_files: Vec = Vec::new(); + let c_formatter = crate::c::CFormatter::new(&tcx, false); + + c_files.add_file("diplomat_runtime.h".into(), crate::c::Runtime.to_string()); + heard_files.push("diplomat_runtime.h".into()); + for (id, ty) in tcx.all_types() { + if ty.attrs().disable { + continue; + } + let decl_header_path = c_formatter.fmt_decl_header_path(id); + let impl_header_path = c_formatter.fmt_impl_header_path(id); + let c_context = crate::c::TyGenContext { + tcx, + formatter: &c_formatter, + errors: &c_errors, + is_for_cpp: false, + id, + decl_header_path: &decl_header_path, + impl_header_path: &impl_header_path, + }; + + let decl_header = match ty { + hir::TypeDef::Enum(e) => c_context.gen_enum_def(e), + hir::TypeDef::Opaque(o) => c_context.gen_opaque_def(o), + hir::TypeDef::Struct(s) => c_context.gen_struct_def(s), + hir::TypeDef::OutStruct(s) => c_context.gen_struct_def(s), + _ => unreachable!("unknown AST/HIR variant"), + }; + + let impl_header = c_context.gen_impl(ty); + + heard_files.push(impl_header_path.clone()); + + c_files.add_file(decl_header_path, decl_header.to_string()); + + c_files.add_file(impl_header_path, impl_header.to_string()); + + let _guard = ty_gen_cx.errors.set_context_ty(ty.name().as_str().into()); + + let (file, body) = match ty { + TypeDef::Opaque(opaque) => ty_gen_cx.gen_opaque_def(opaque), + TypeDef::Enum(enum_def) => ty_gen_cx.gen_enum_def(enum_def), + TypeDef::Struct(struct_def) => ty_gen_cx.gen_struct_def(struct_def), + TypeDef::OutStruct(struct_def) => ty_gen_cx.gen_struct_def(struct_def), + unknown => { + unreachable!("Encountered unknown variant: {unknown:?} while parsing all types") + } + }; + files.add_file( + format!("src/main/java/{domain_path}/{lib_name}/{file}",), + body, + ); + } + + let c_errors = c_errors.take_all(); + if !c_errors.is_empty() { eprintln!("Found errors when generating c code"); - for error in errors { + for error in c_errors { eprintln!("\t{}: {}", error.0, error.1); } } - let out_files = files.take_files(); + let out_files = c_files.take_files(); let tmp_path = out_folder.join(TMP_C_DIR); std::fs::create_dir(&tmp_path).expect("failed to create directory "); - let mut include_files = HashSet::new(); for (subpath, text) in out_files { let out_path = tmp_path.join(&subpath); - if !subpath.ends_with(".d.h") && subpath.ends_with(".h") { - include_files.insert(subpath); - } let parent = out_path .parent() .expect("Cannot create files at top level dir /"); @@ -91,7 +165,7 @@ pub(crate) fn run<'a>( { let mut lib_file = File::create(&lib_path).expect("failed to create lib file"); - for include in include_files { + for include in heard_files { writeln!(lib_file, "#include \"{include}\"").expect("failed to write line in lib file"); } } @@ -148,46 +222,6 @@ pub(crate) fn run<'a>( cleanup().expect("Failed to clean up temporary files"); - let java_formatter = JavaFormatter::new(tcx); - let formatter = &java_formatter; - let error_store = ErrorStore::default(); - let errors = &error_store; - let ty_gen_cx = TyGenContext { - tcx, - tcx_config, - formatter, - errors, - }; - - let Config { - ref domain, - ref lib_name, - } = ty_gen_cx.tcx_config; - let domain_path = domain.replace(".", "/"); - - let errors = ErrorStore::default(); - let files = FileMap::default(); - for (_id, ty) in tcx.all_types() { - let _guard = ty_gen_cx.errors.set_context_ty(ty.name().as_str().into()); - if ty.attrs().disable { - continue; - } - - let (file, body) = match ty { - TypeDef::Opaque(opaque) => ty_gen_cx.gen_opaque_def(opaque), - TypeDef::Enum(enum_def) => ty_gen_cx.gen_enum_def(enum_def), - TypeDef::Struct(struct_def) => ty_gen_cx.gen_struct_def(struct_def), - TypeDef::OutStruct(struct_def) => ty_gen_cx.gen_struct_def(struct_def), - unknown => { - unreachable!("Encountered unknown variant: {unknown:?} while parsing all types") - } - }; - files.add_file( - format!("src/main/java/{domain_path}/{lib_name}/{file}",), - body, - ); - } - let lib_file = LibFile { domain: domain.clone(), lib_name: lib_name.clone(), @@ -243,12 +277,15 @@ pub(crate) struct StructTypeTpl<'a> { edges: Vec>, fields: Vec>, methods: Vec>, + is_zst: bool, } #[derive(Clone, Debug)] struct FieldTpl<'a> { name: Cow<'a, str>, field_val: Cow<'a, str>, + native_name: Cow<'a, str>, + to_native: Cow<'a, str>, ty: Cow<'a, str>, } @@ -324,11 +361,13 @@ impl<'a, 'cx> TyGenContext<'a, 'cx> { fn gen_param_conversion<'b>( &self, param: &'b diplomat_core::hir::Param, - ) -> ParamConversion<'b> { + lt_info: &ParamBorrowInfo<'cx>, + allocations: &mut bool, + ) -> ParamConversion<'cx> { let diplomat_core::hir::Param { name, ty, .. } = param; // let java_ty = self.formatter.fmt_java_type(ty); let name = self.formatter.fmt_param_name(name.as_str()); - let converted_value: Cow<'b, str> = format!("{name}Native").into(); + let converted_value: Cow<'cx, str> = format!("{name}Native").into(); let (conversion, converted_value) = match ty { hir::Type::Primitive(_) => ( format!("var {name}Native = {name};").into(), @@ -338,10 +377,26 @@ impl<'a, 'cx> TyGenContext<'a, 'cx> { format!("var {name}Native = {name}.internal;").into(), converted_value, ), - hir::Type::Struct(_) => ( - format!(r#"var {name}Native = {name}.internal;"#).into(), - converted_value, - ), + hir::Type::Struct(_) => { + let arena: Cow<'cx, str> = match lt_info { + ParamBorrowInfo::Struct(_) => { + // todo: a comment + format!("{name}.arena").into() + } + ParamBorrowInfo::NotBorrowed => { + *allocations = true; + "arena".into() + } + param_borrow => panic!( + "Received unsupport ParamBorrowInfo variant while processing a struct param {param_borrow:?} when generating param conversion fo {}", + param.name + ), + }; + ( + format!(r#"var {name}Native = {name}.toNative({arena});"#).into(), + converted_value, + ) + } hir::Type::Enum(_) => ( format!("var {name}Native = {name}.toInt();").into(), format!("{name}Native").into(), @@ -498,7 +553,7 @@ return SliceUtils.{java_primitive_ty}SliceToArray(nativeVal);"# } _ => todo!(), }; - return_conversion.wrap_ok() + Ok(return_conversion) } fn gen_return_conversion( @@ -530,10 +585,10 @@ return string;"#, lib_name ) .into(); - return write_return.wrap_ok(); + return Ok(write_return); } SuccessType::OutType(ref o) => o, - SuccessType::Unit => return Cow::<'cx, str>::default().wrap_ok(), + SuccessType::Unit => return Ok(Cow::<'cx, str>::default()), _ => todo!(), }; let return_statment: Cow<'cx, str> = match o { @@ -582,7 +637,7 @@ return string;"#, fn gen_methods( &self, ty_name: &str, - methods: &[Method], + methods: &'cx [Method], ) -> (Vec>, Vec>) { let Config { lib_name, .. } = &self.tcx_config; let mut static_methods = Vec::new(); @@ -590,8 +645,9 @@ return string;"#, methods .iter() .filter(|method| !method.attrs.disable) - .filter_map(|method| -> Option<(bool, Cow<'cx, str>)> { - let mut visitor = method.borrowing_param_visitor(self.tcx); + .filter_map(|method: &'cx Method| -> Option<(bool, Cow<'cx, str>)> { + let mut visitor: BorrowingParamVisitor<'cx> = + method.borrowing_param_visitor(self.tcx); let (method_name, is_valid_constructor) = match method.attrs.special_method { // We need to reserve the default constructor for internal methods so a constructor @@ -612,18 +668,24 @@ return string;"#, if let Some(param) = &method.param_self { visitor.visit_param(¶m.ty.clone().into(), "this"); } - let params = method + let mut allocations = false; + let (params, param_conversions) = method .params .iter() - .map(|diplomat_core::hir::Param { name, ty, .. }| { + .map(|ref param @ diplomat_core::hir::Param { name, ty, .. }| { let name: Cow = self.formatter.fmt_param_name(name.as_str()).into(); - visitor.visit_param(ty, name.as_ref()); - Param { - name, - ty: self.formatter.fmt_java_type(ty), - } + let param_lt_info = visitor.visit_param(ty, name.as_ref()); + let conversion = + self.gen_param_conversion(param, ¶m_lt_info, &mut allocations); + ( + Param { + name, + ty: self.formatter.fmt_java_type(ty), + }, + conversion, + ) }) - .collect(); + .unzip::<_, _, Vec<_>, Vec<_>>(); let lt_lookup = visitor.borrow_map(); let (lifetime_edges, return_self_edges, boxed_return) = match &method.output { ReturnType::Fallible(SuccessType::OutType(o), _) @@ -710,7 +772,7 @@ return string;"#, method.name, ty_name ) }) - .cown() + .into() } else { match self.gen_return_conversion( &method.output, @@ -727,8 +789,8 @@ return string;"#, } } }; - let allocations = - method + let allocations = allocations + || method .params .iter() .any(|diplomat_core::hir::Param { ty, .. }| { @@ -758,12 +820,7 @@ return string;"#, converted_value: "internal".into(), conversion_def: "".into(), })) - .chain( - method - .params - .iter() - .map(|param| self.gen_param_conversion(param)), - ) + .chain(param_conversions.into_iter()) .collect(); let write_return = matches!( method.output, @@ -806,7 +863,7 @@ return string;"#, ) }); - (method.param_self.is_some(), method_rendered.cown()).wrap_some() + Some((method.param_self.is_some(), method_rendered.into())) }) .for_each(|(self_param, method_rendered)| match self_param { true => class_methods.push(method_rendered), @@ -816,7 +873,7 @@ return string;"#, (static_methods, class_methods) } - fn gen_enum_def(&self, e: &EnumDef) -> (Cow, String) { + fn gen_enum_def(&self, e: &'cx EnumDef) -> (Cow, String) { let Config { domain, lib_name } = &self.tcx_config; let type_name = e.name.as_str(); let variants = e @@ -846,9 +903,10 @@ return string;"#, .expect("failed to render struct type"), ) } - fn gen_struct_def(&self, s: &StructDef) -> (Cow, String) { + fn gen_struct_def(&self, s: &'cx StructDef) -> (Cow, String) { let Config { domain, lib_name } = &self.tcx_config; let type_name = s.name.as_str(); + let is_zst = s.fields.is_empty(); let fields = s .fields .iter() @@ -857,12 +915,15 @@ return string;"#, let native_name = field.name.as_str(); let native_val = format!("{domain}.{lib_name}.ntv.{type_name}.{native_name}(structSegment)"); - let field_val = match &field.ty { - hir::Type::Enum(ref enum_def) => format!( - "{}.fromInt({native_val})", - self.tcx.resolve_enum(enum_def.tcx_id).name - ) - .into(), + let (field_val, to_native): (_, Cow<'cx, str>) = match &field.ty { + hir::Type::Enum(ref enum_def) => ( + format!( + "{}.fromInt({native_val})", + self.tcx.resolve_enum(enum_def.tcx_id).name + ) + .into(), + format!("this.{name}.toInt()").into(), + ), hir::Type::Struct(struct_path) => { let ty_name = self.tcx.resolve_type(struct_path.id()).name().as_str(); let lt_env = &s.lifetimes; @@ -881,7 +942,7 @@ return string;"#, .collect::>(); match lt_edges.len() { 0 => "List.of()".into(), - 1 => lt_edges.join(", ").cown(), + 1 => lt_edges.join(", ").into(), _ => format!( "Stream.concat({}).toList()", lt_edges @@ -889,24 +950,33 @@ return string;"#, .map(|edge| format!("{edge}.stream()")) .mk_str_iter(", ") ) - .cown(), + .into(), } }); - let args = once("arena".into()) - .chain(once(native_val.to_string().cown())) + let args = once::>("arena".into()) + .chain(once(native_val.to_string().into())) .chain(lt_edges) .mk_str_iter(", "); - format!("new {ty_name}({args})").cown() + ( + format!("new {ty_name}({args})").into(), + format!("this.{name}.toNative(arena)").into(), + ) + } + hir::Type::Primitive(_) => { + (native_val.clone().into(), format!("this.{name}").into()) } - hir::Type::Primitive(_) => native_val.clone().into(), hir::Type::Slice(Slice::Str( _, StringEncoding::Utf8 | StringEncoding::UnvalidatedUtf8, - )) => format!("SliceUtils.readUtf8({native_val})").into(), - hir::Type::Slice(Slice::Str(_, StringEncoding::UnvalidatedUtf16)) => { - format!("SliceUtils.readUtf16({native_val})").into() - } + )) => ( + format!("SliceUtils.readUtf8({native_val})").into(), + format!("SliceUtils.strToUtf8Slice(arena, this.{name})").into(), + ), + hir::Type::Slice(Slice::Str(_, StringEncoding::UnvalidatedUtf16)) => ( + format!("SliceUtils.readUtf16({native_val})").into(), + format!("SliceUtils.strToUtf16Slice(arena, this.{name})").into(), + ), hir::Type::Slice(_) => { todo!("Failed to generate field: {name} for struct {}", s.name) } @@ -946,16 +1016,21 @@ return string;"#, format!("Stream.concat({lt_edges}).toList()") }) .mk_str_iter(", "); - format!("new {ty_name}(arena, {native_val}, {self_edges}, {lt_edges})") - .cown() + ( + format!("new {ty_name}(arena, {native_val}, {self_edges}, {lt_edges})") + .into(), + format!("this.{name}.inner").into(), + ) } _ => todo!(), }; let ty = self.formatter.fmt_java_type(&field.ty); FieldTpl { name, + native_name: native_name.into(), ty, field_val, + to_native, } }) .collect(); @@ -976,6 +1051,7 @@ return string;"#, type_name: type_name.into(), lib_name: lib_name.clone(), domain: domain.clone(), + is_zst, edges, fields, methods, @@ -985,7 +1061,7 @@ return string;"#, ) } - fn gen_opaque_def(&self, o: &OpaqueDef) -> (Cow, String) { + fn gen_opaque_def(&self, o: &'cx OpaqueDef) -> (Cow, String) { let Config { domain, lib_name } = &self.tcx_config; let (static_methods, class_methods) = self.gen_methods(o.name.as_str(), &o.methods); @@ -1016,27 +1092,6 @@ return string;"#, } } -trait PostFix: Sized { - fn wrap_ok(self) -> Result { - Ok(self) - } - fn wrap_some(self) -> Option { - Some(self) - } -} - -impl PostFix for T {} - -trait PostFixCown { - fn cown<'a>(self) -> Cow<'a, str>; -} - -impl PostFixCown for String { - fn cown<'a>(self) -> Cow<'a, str> { - Cow::Owned(self) - } -} - trait JoinStrIterator: Sized { fn mk_str_iter(self, sep: S) -> String; } diff --git a/tool/templates/java/Lib.java.jinja b/tool/templates/java/Lib.java.jinja index bcaa02151..a62658f8a 100644 --- a/tool/templates/java/Lib.java.jinja +++ b/tool/templates/java/Lib.java.jinja @@ -133,6 +133,23 @@ class SliceUtils { return string; } // for parameter conversion + static MemorySegment strToUtf8Slice(SegmentAllocator arena, String str) { + var vData = arena.allocateFrom(str, StandardCharsets.UTF_8); + var vLen = vData.byteSize() - 1; + var vView = DiplomatStringView.allocate(arena); + DiplomatStringView.len(vView, vLen); + DiplomatStringView.data(vView, vData); + return vData; + } + + static MemorySegment strToUtf16Slice(SegmentAllocator arena, String str) { + var vData = arena.allocateFrom(str, StandardCharsets.UTF_16); + var vLen = vData.byteSize() - 1; + var vView = DiplomatStringView.allocate(arena); + DiplomatStringView.len(vView, vLen); + DiplomatStringView.data(vView, vData); + return vData; + } static MemorySegment strs16(SegmentAllocator arena, String [] strings) { var diplomatStrsData = DiplomatStringView.allocateArray(strings.length, arena); var layout = DiplomatStringView.layout(); diff --git a/tool/templates/java/Struct.java.jinja b/tool/templates/java/Struct.java.jinja index aee0b7642..4c84c51e9 100644 --- a/tool/templates/java/Struct.java.jinja +++ b/tool/templates/java/Struct.java.jinja @@ -16,7 +16,6 @@ public class {{type_name}} { {{field.ty}} {{field.name}}; {% endfor %} - MemorySegment internal; SegmentAllocator arena; List selfEdges = List.of(); {% for edge in edges -%} @@ -43,6 +42,21 @@ public class {{type_name}} { {% endfor %} } + + {% if is_zst -%} + {% else -%} + MemorySegment toNative(SegmentAllocator arena) { + var returnVal = {{domain}}.{{lib_name}}.ntv.{{type_name}}.allocate(arena); + + {% for field in fields -%} + {{domain}}.{{lib_name}}.ntv.{{type_name}}.{{field.native_name}}(returnVal, {{field.to_native}}); + {% endfor %} + + return returnVal; + + } + {% endif -%} + {% for method in methods %} {{method|indent(4)}} {% endfor %} From 5b6fbd82641a3f7425d8b66bacf6f474a198c342 Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Sat, 7 Sep 2024 13:51:28 +0200 Subject: [PATCH 56/69] panama-backend - clippy --- core/src/ast/types.rs | 1 + runtime/src/lib.rs | 1 + tool/src/c/mod.rs | 2 -- tool/src/java/mod.rs | 13 +++++-------- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/core/src/ast/types.rs b/core/src/ast/types.rs index 7a5f2d243..d4fa9736e 100644 --- a/core/src/ast/types.rs +++ b/core/src/ast/types.rs @@ -330,6 +330,7 @@ pub enum StdlibOrDiplomat { } /// A local type reference, such as the type of a field, parameter, or return value. +/// /// Unlike [`CustomType`], which represents a type declaration, [`TypeName`]s can compose /// types through references and boxing, and can also capture unresolved paths. #[derive(Clone, PartialEq, Eq, Hash, Serialize, Deserialize, Debug)] diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index cc15ef535..8f77c4392 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -33,6 +33,7 @@ pub type DiplomatStr = [u8]; pub type DiplomatStr16 = [u16]; /// Like [`u8`], but interpreted explicitly as a raw byte as opposed to a numerical value. +/// /// This matters for languages like JavaScript or Dart, where there's only a single numeric /// type, but special types for byte buffers. pub type DiplomatByte = u8; diff --git a/tool/src/c/mod.rs b/tool/src/c/mod.rs index d3b082bbb..33ac01fd3 100644 --- a/tool/src/c/mod.rs +++ b/tool/src/c/mod.rs @@ -37,7 +37,6 @@ pub(crate) fn attr_support() -> BackendAttrSupport { a } - #[derive(askama::Template)] #[template(path = "c/runtime.h.jinja", escape = "none")] pub(crate) struct Runtime; @@ -47,7 +46,6 @@ pub(crate) fn run(tcx: &hir::TypeContext) -> (FileMap, ErrorStore) { let formatter = CFormatter::new(tcx, false); let errors = ErrorStore::default(); - files.add_file("diplomat_runtime.h".into(), Runtime.to_string()); for (id, ty) in tcx.all_types() { diff --git a/tool/src/java/mod.rs b/tool/src/java/mod.rs index 64e108255..d9b16aba5 100644 --- a/tool/src/java/mod.rs +++ b/tool/src/java/mod.rs @@ -1,13 +1,10 @@ -use std::collections::HashSet; use std::fs::File; use std::io::Write; use std::path::Path; use std::{borrow::Cow, iter::once}; use askama::Template; -use diplomat_core::hir::borrowing_param::{ - BorrowingParamVisitor, ParamBorrowInfo, StructBorrowInfo, -}; +use diplomat_core::hir::borrowing_param::{BorrowingParamVisitor, ParamBorrowInfo}; use diplomat_core::hir::{ self, BackendAttrSupport, EnumDef, EnumVariant, FloatType, IntSizeType, IntType, MaybeOwn, MaybeStatic, Method, OpaqueDef, OpaqueOwner, OpaquePath, ReturnType, Slice, SpecialMethod, @@ -17,7 +14,7 @@ use formatter::JavaFormatter; use heck::ToUpperCamelCase; use serde::Deserialize; -use crate::{c, ErrorStore, FileMap}; +use crate::{ErrorStore, FileMap}; const TMP_C_DIR: &str = "tmp"; const LIBRARY: &str = "somelib"; // todo: build from conf. Ensure that name is not the same as any @@ -84,7 +81,7 @@ pub(crate) fn run<'a>( let c_files = FileMap::default(); let mut heard_files: Vec = Vec::new(); - let c_formatter = crate::c::CFormatter::new(&tcx, false); + let c_formatter = crate::c::CFormatter::new(tcx, false); c_files.add_file("diplomat_runtime.h".into(), crate::c::Runtime.to_string()); heard_files.push("diplomat_runtime.h".into()); @@ -672,7 +669,7 @@ return string;"#, let (params, param_conversions) = method .params .iter() - .map(|ref param @ diplomat_core::hir::Param { name, ty, .. }| { + .map(|param @ diplomat_core::hir::Param { name, ty, .. }| { let name: Cow = self.formatter.fmt_param_name(name.as_str()).into(); let param_lt_info = visitor.visit_param(ty, name.as_ref()); let conversion = @@ -820,7 +817,7 @@ return string;"#, converted_value: "internal".into(), conversion_def: "".into(), })) - .chain(param_conversions.into_iter()) + .chain(param_conversions) .collect(); let write_return = matches!( method.output, From fc3786556ebf8014e8bfff4e45e2855668d57106 Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Sat, 7 Sep 2024 13:52:23 +0200 Subject: [PATCH 57/69] panama-backend fix tests --- ...mat_tool__java__test__enum_and_struct.snap | 17 +++++++- .../diplomat_tool__java__test__lifetimes.snap | 41 ++++++++++++++++--- 2 files changed, 52 insertions(+), 6 deletions(-) diff --git a/tool/src/java/snapshots/diplomat_tool__java__test__enum_and_struct.snap b/tool/src/java/snapshots/diplomat_tool__java__test__enum_and_struct.snap index d0af5942e..09f17d84a 100644 --- a/tool/src/java/snapshots/diplomat_tool__java__test__enum_and_struct.snap +++ b/tool/src/java/snapshots/diplomat_tool__java__test__enum_and_struct.snap @@ -25,7 +25,6 @@ public class MyStruct { MyEnum g; - MemorySegment internal; SegmentAllocator arena; List selfEdges = List.of(); @@ -48,6 +47,22 @@ public class MyStruct { this.g = MyEnum.fromInt(dev.diplomattest.somelib.ntv.MyStruct.g(structSegment)); + } + + MemorySegment toNative(SegmentAllocator arena) { + var returnVal = dev.diplomattest.somelib.ntv.MyStruct.allocate(arena); + + dev.diplomattest.somelib.ntv.MyStruct.a(returnVal, this.a); + dev.diplomattest.somelib.ntv.MyStruct.b(returnVal, this.b); + dev.diplomattest.somelib.ntv.MyStruct.c(returnVal, this.c); + dev.diplomattest.somelib.ntv.MyStruct.d(returnVal, this.d); + dev.diplomattest.somelib.ntv.MyStruct.e(returnVal, this.e); + dev.diplomattest.somelib.ntv.MyStruct.f(returnVal, this.f); + dev.diplomattest.somelib.ntv.MyStruct.g(returnVal, this.g.toInt()); + + + return returnVal; + } public static MyStruct new_() { diff --git a/tool/src/java/snapshots/diplomat_tool__java__test__lifetimes.snap b/tool/src/java/snapshots/diplomat_tool__java__test__lifetimes.snap index 805ad2a2e..d06d5983b 100644 --- a/tool/src/java/snapshots/diplomat_tool__java__test__lifetimes.snap +++ b/tool/src/java/snapshots/diplomat_tool__java__test__lifetimes.snap @@ -21,7 +21,6 @@ public class BorrowedFields { String c; - MemorySegment internal; SegmentAllocator arena; List selfEdges = List.of(); List aEdges = List.of(); @@ -43,6 +42,18 @@ public class BorrowedFields { } + + MemorySegment toNative(SegmentAllocator arena) { + var returnVal = dev.diplomattest.somelib.ntv.BorrowedFields.allocate(arena); + + dev.diplomattest.somelib.ntv.BorrowedFields.a(returnVal, SliceUtils.strToUtf16Slice(arena, this.a)); + dev.diplomattest.somelib.ntv.BorrowedFields.b(returnVal, SliceUtils.strToUtf8Slice(arena, this.b)); + dev.diplomattest.somelib.ntv.BorrowedFields.c(returnVal, SliceUtils.strToUtf8Slice(arena, this.c)); + + + return returnVal; + + } } @@ -65,7 +76,6 @@ public class BorrowedFieldsReturning { String bytes; - MemorySegment internal; SegmentAllocator arena; List selfEdges = List.of(); List aEdges = List.of(); @@ -85,6 +95,16 @@ public class BorrowedFieldsReturning { } + + MemorySegment toNative(SegmentAllocator arena) { + var returnVal = dev.diplomattest.somelib.ntv.BorrowedFieldsReturning.allocate(arena); + + dev.diplomattest.somelib.ntv.BorrowedFieldsReturning.bytes(returnVal, SliceUtils.strToUtf8Slice(arena, this.bytes)); + + + return returnVal; + + } } @@ -109,7 +129,6 @@ public class BorrowedFieldsWithBounds { String fieldC; - MemorySegment internal; SegmentAllocator arena; List selfEdges = List.of(); List aEdges = List.of(); @@ -135,6 +154,18 @@ public class BorrowedFieldsWithBounds { } + + MemorySegment toNative(SegmentAllocator arena) { + var returnVal = dev.diplomattest.somelib.ntv.BorrowedFieldsWithBounds.allocate(arena); + + dev.diplomattest.somelib.ntv.BorrowedFieldsWithBounds.field_a(returnVal, SliceUtils.strToUtf16Slice(arena, this.fieldA)); + dev.diplomattest.somelib.ntv.BorrowedFieldsWithBounds.field_b(returnVal, SliceUtils.strToUtf8Slice(arena, this.fieldB)); + dev.diplomattest.somelib.ntv.BorrowedFieldsWithBounds.field_c(returnVal, SliceUtils.strToUtf8Slice(arena, this.fieldC)); + + + return returnVal; + + } } @@ -256,7 +287,7 @@ public class Foo { public static Foo extractFromFields(BorrowedFields fields) { - var fieldsNative = fields.internal; + var fieldsNative = fields.toNative(fields.arena); var nativeVal = somelib_h.Foo_extract_from_fields(fieldsNative); List selfEdges = List.of(); @@ -272,7 +303,7 @@ public class Foo { public static Foo extractFromBounds(BorrowedFieldsWithBounds bounds,String anotherString) { try (var arena = Arena.ofConfined()) { - var boundsNative = bounds.internal; + var boundsNative = bounds.toNative(bounds.arena); var anotherStringData= arena.allocateFrom(anotherString, StandardCharsets.UTF_8); var anotherStringLen = anotherStringData.byteSize() - 1; var anotherStringView = DiplomatStringView.allocate(arena); From 35a587c3132779a2d9a912af9ef7539b8c8d1ab5 Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Mon, 9 Sep 2024 18:28:54 +0200 Subject: [PATCH 58/69] panama-backend - refactor to use simpler conversion code for types --- .../dev/diplomattest/somelib/MyStruct.java | 1 + tool/src/java/mod.rs | 599 +++++++++++++----- ...java.jinja => OpaqueConversion.java.jinja} | 9 +- tool/templates/java/Struct.java.jinja | 7 +- ...java.jinja => StructConversion.java.jinja} | 3 +- 5 files changed, 438 insertions(+), 181 deletions(-) rename tool/templates/java/{OpaqueReturn.java.jinja => OpaqueConversion.java.jinja} (60%) rename tool/templates/java/{StructReturn.java.jinja => StructConversion.java.jinja} (78%) diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyStruct.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyStruct.java index 013b19eb1..3620bbfe7 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyStruct.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyStruct.java @@ -46,6 +46,7 @@ private MyStruct(SegmentAllocator arena) { } MemorySegment toNative(SegmentAllocator arena) { + var x = arena; var returnVal = dev.diplomattest.somelib.ntv.MyStruct.allocate(arena); dev.diplomattest.somelib.ntv.MyStruct.a(returnVal, this.a); diff --git a/tool/src/java/mod.rs b/tool/src/java/mod.rs index d9b16aba5..5dfc6f2af 100644 --- a/tool/src/java/mod.rs +++ b/tool/src/java/mod.rs @@ -1,10 +1,13 @@ use std::fs::File; use std::io::Write; +use std::marker::PhantomData; use std::path::Path; use std::{borrow::Cow, iter::once}; use askama::Template; -use diplomat_core::hir::borrowing_param::{BorrowingParamVisitor, ParamBorrowInfo}; +use diplomat_core::hir::borrowing_param::{ + BorrowingParamVisitor, ParamBorrowInfo, StructBorrowInfo, +}; use diplomat_core::hir::{ self, BackendAttrSupport, EnumDef, EnumVariant, FloatType, IntSizeType, IntType, MaybeOwn, MaybeStatic, Method, OpaqueDef, OpaqueOwner, OpaquePath, ReturnType, Slice, SpecialMethod, @@ -282,7 +285,8 @@ struct FieldTpl<'a> { name: Cow<'a, str>, field_val: Cow<'a, str>, native_name: Cow<'a, str>, - to_native: Cow<'a, str>, + to_native: Conversion<'a>, + to_java: Conversion<'a>, ty: Cow<'a, str>, } @@ -320,19 +324,23 @@ struct LifetimeTpl<'a> { } #[derive(Template, Clone, Debug)] -#[template(path = "java/StructReturn.java.jinja", escape = "none")] -pub(crate) struct StructReturnTpl<'a> { +#[template(path = "java/StructConversion.java.jinja", escape = "none")] +pub(crate) struct StructConversionTpl<'a> { lifetimes: Vec>, - return_ty: Cow<'a, str>, + ty: Cow<'a, str>, + name: Cow<'a, str>, + native_val: Cow<'a, str>, } #[derive(Template, Clone, Debug)] -#[template(path = "java/OpaqueReturn.java.jinja", escape = "none")] -pub(crate) struct OpaqueReturnTpl<'a> { +#[template(path = "java/OpaqueConversion.java.jinja", escape = "none")] +pub(crate) struct OpaqueConversionTpl<'a> { + name: Cow<'a, str>, lifetimes: Vec>, owned_return: bool, - return_self_edges: Option>, - return_ty: Cow<'a, str>, + self_edges: Option>, + ty: Cow<'a, str>, + native_val: Cow<'a, str>, } #[derive(Template, Clone, Debug)] @@ -354,83 +362,151 @@ struct TyGenContext<'a, 'cx> { errors: &'a ErrorStore<'cx, String>, } +#[derive(Debug, Clone)] +struct Conversion<'cx> { + conversion: Cow<'cx, str>, + converted_value: Cow<'cx, str>, +} + +mod arena { + use std::{borrow::Cow, fmt::Display}; + pub type Render<'cx> = Box) -> Conversion<'cx> + 'cx>; + + const UNIT: &() = &(); + use super::Conversion; + + #[must_use] + pub(crate) struct AllocationConversion<'cx, F: Fn(Arena<'cx>) -> Conversion<'cx>> { + clos: F, + _marker: &'cx (), + } + impl<'cx, F: Fn(Arena<'cx>) -> Conversion<'cx> + 'cx> AllocationConversion<'cx, F> { + pub fn new(clos: F) -> Self { + Self { + clos, + _marker: UNIT, + } + } + + pub fn dynamic(clos: F) -> AllocationConversion<'cx, Render<'cx>> { + AllocationConversion { + clos: Box::new(clos) as Render<'cx>, + _marker: UNIT, + } + } + + pub fn render(self, arena: Arena<'cx>) -> Conversion<'cx> { + (self.clos)(arena) + } + } + + pub enum Arena<'cx> { + Closed, + Struct { name: Cow<'cx, str> }, + Auto, + } + + impl<'cx> Display for Arena<'cx> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Arena::Closed => write!(f, "arena"), + Arena::Struct { name } => write!(f, "{name}.arena"), + Arena::Auto => write!(f, "Arena.ofAuto()"), + } + } + } + impl<'cx> From<&diplomat_core::hir::StructDef> for Arena<'cx> { + fn from(value: &diplomat_core::hir::StructDef) -> Self { + Arena::Struct { + name: value.name.as_str().to_string().into(), + } + } + } +} + +enum AllocateConversion<'cx, F: Fn(arena::Arena<'cx>) -> Conversion<'cx>> { + NotAllocating(Conversion<'cx>), + Allocating(arena::AllocationConversion<'cx, F>), +} + impl<'a, 'cx> TyGenContext<'a, 'cx> { - fn gen_param_conversion<'b>( + #[allow(unused)] + fn java_to_native( &self, - param: &'b diplomat_core::hir::Param, - lt_info: &ParamBorrowInfo<'cx>, - allocations: &mut bool, - ) -> ParamConversion<'cx> { - let diplomat_core::hir::Param { name, ty, .. } = param; - // let java_ty = self.formatter.fmt_java_type(ty); - let name = self.formatter.fmt_param_name(name.as_str()); - let converted_value: Cow<'cx, str> = format!("{name}Native").into(); - let (conversion, converted_value) = match ty { - hir::Type::Primitive(_) => ( - format!("var {name}Native = {name};").into(), - converted_value, - ), - hir::Type::Opaque(_) => ( - format!("var {name}Native = {name}.internal;").into(), - converted_value, - ), + name: Cow<'cx, str>, + ty: &diplomat_core::hir::Type, + ) -> AllocateConversion<'cx, arena::Render<'cx>> { + match ty { + hir::Type::Primitive(_) => { + let converted_value: Cow<'cx, str> = format!("{name}Native").into(); + AllocateConversion::NotAllocating(Conversion { + conversion: format!("var {converted_value} = {name}").into(), + converted_value, + }) + } + hir::Type::Opaque(_) => { + let converted_value: Cow<'cx, str> = format!("{name}Native").into(); + AllocateConversion::NotAllocating(Conversion { + conversion: format!("var {converted_value} = {name}.inner").into(), + converted_value, + }) + } hir::Type::Struct(_) => { - let arena: Cow<'cx, str> = match lt_info { - ParamBorrowInfo::Struct(_) => { - // todo: a comment - format!("{name}.arena").into() - } - ParamBorrowInfo::NotBorrowed => { - *allocations = true; - "arena".into() + let clos = move |arena| -> Conversion<'cx> { + let converted_value: Cow<'cx, str> = format!("{name}Native").into(); + Conversion { + conversion: format!("var {converted_value} = {name}.toNative({arena})") + .into(), + converted_value: format!("{name}Native").into(), } - param_borrow => panic!( - "Received unsupport ParamBorrowInfo variant while processing a struct param {param_borrow:?} when generating param conversion fo {}", - param.name - ), }; - ( - format!(r#"var {name}Native = {name}.toNative({arena});"#).into(), + AllocateConversion::Allocating(arena::AllocationConversion::dynamic(clos)) + } + hir::Type::Enum(_) => { + let converted_value: Cow<'cx, str> = format!("{name}Native").into(); + AllocateConversion::NotAllocating(Conversion { + conversion: format!("var {converted_value} = {name}.toInt()").into(), converted_value, - ) + }) } - hir::Type::Enum(_) => ( - format!("var {name}Native = {name}.toInt();").into(), - format!("{name}Native").into(), - ), - hir::Type::Slice(Slice::Str(borrow, StringEncoding::UnvalidatedUtf16)) => { - let arena_name = borrow.map(|_| "arena").unwrap_or("Arena.global()"); - ( - format!( - r#"var {name}Data= {arena_name}.allocateFrom({name}, StandardCharsets.UTF_16); + let clos = move |arena| -> Conversion<'cx> { + let converted_value: Cow<'cx, str> = format!("{name}View").into(); + let conversion: Cow<'cx, str> = format!( + r#"var {name}Data= {arena}.allocateFrom({name}, StandardCharsets.UTF_16); var {name}Len = {name}Data.byteSize() - 1; // allocated strings are null terminated -var {name}View = DiplomatString16View.allocate({arena_name}); +var {name}View = DiplomatString16View.allocate({arena}); DiplomatString16View.len({name}View, {name}Len); -DiplomatString16View.data({name}View, {name}Data);"# - +DiplomatString16View.data({name}View, {name}Data);"# ) - .into(), - format!("{name}View").into(), - ) + .into(); + Conversion { + conversion, + converted_value, + } + }; + AllocateConversion::Allocating(arena::AllocationConversion::dynamic(clos)) } hir::Type::Slice(Slice::Str( borrow, StringEncoding::Utf8 | StringEncoding::UnvalidatedUtf8, )) => { - let arena_name = borrow.map(|_| "arena").unwrap_or("Arena.global()"); - ( - format!( - r#"var {name}Data= {arena_name}.allocateFrom({name}, StandardCharsets.UTF_8); -var {name}Len = {name}Data.byteSize() - 1; -var {name}View = DiplomatStringView.allocate({arena_name}); -DiplomatStringView.len({name}View, {name}Len); -DiplomatStringView.data({name}View, {name}Data);"# + let clos = move |arena| -> Conversion<'cx> { + let converted_value: Cow<'cx, str> = format!("{name}View").into(); + let conversion: Cow<'cx, str> = format!( + r#"var {name}Data= {arena}.allocateFrom({name}, StandardCharsets.UTF_8); +var {name}Len = {name}Data.byteSize() - 1; // allocated strings are null terminated +var {name}View = DiplomatString8View.allocate({arena}); +DiplomatString8View.len({name}View, {name}Len); +DiplomatString8View.data({name}View, {name}Data);"# ) - .into(), - format!("{name}View").into(), - // by default java native creates null terminated strings - ) + .into(); + Conversion { + conversion, + converted_value, + } + }; + AllocateConversion::Allocating(arena::AllocationConversion::dynamic(clos)) } hir::Type::Slice(Slice::Primitive(borrow, p)) => { let rust_primitive_type = match p { @@ -452,54 +528,192 @@ DiplomatStringView.data({name}View, {name}Data);"# hir::PrimitiveType::Float(hir::FloatType::F32) => "JAVA_FLOAT", hir::PrimitiveType::Float(hir::FloatType::F64) => "JAVA_DOUBLE", }; - let arena_name = borrow.map(|_| "arena").unwrap_or("Arena.global()"); - let conversion = match p { - hir::PrimitiveType::Bool => format!( - r#"var {name}Len = {name}.length; + + let p = *p; + let clos = move |arena| -> Conversion<'cx> { + let converted_value: Cow<'cx, str> = format!("{name}View").into(); + + let conversion: Cow<'cx, str> = match p { + hir::PrimitiveType::Bool => format!( + r#"var {name}Len = {name}.length; byte[] {name}ByteArray = new byte[{name}Len]; for (int i = 0; i < {name}Len; i++) {{ {name}ByteArray[i] = (byte) ({name}[i] ? 1 : 0); }} -var {name}Data = {arena_name}.allocateFrom({primitive_ty}, {name}ByteArray); -var {name}View = Diplomat{rust_primitive_type}View.allocate({arena_name}); +var {name}Data = {arena}.allocateFrom({primitive_ty}, {name}ByteArray); +var {name}View = Diplomat{rust_primitive_type}View.allocate({arena}); Diplomat{rust_primitive_type}View.len({name}View, {name}Len); Diplomat{rust_primitive_type}View.data({name}View, {name}Data); "# - ) - .into(), - _ => format!( - r#"var {name}Len = {name}.length; -var {name}Data= {arena_name}.allocateFrom({primitive_ty}, {name}); -var {name}View = Diplomat{rust_primitive_type}View.allocate({arena_name}); + ) + .into(), + _ => format!( + r#"var {name}Len = {name}.length; +var {name}Data= {arena}.allocateFrom({primitive_ty}, {name}); +var {name}View = Diplomat{rust_primitive_type}View.allocate({arena}); Diplomat{rust_primitive_type}View.len({name}View, {name}Len); Diplomat{rust_primitive_type}View.data({name}View, {name}Data); "# + ) + .into(), + }; + Conversion { + conversion, + converted_value, + } + }; + + match borrow { + Some(_) => { + AllocateConversion::Allocating(arena::AllocationConversion::dynamic(clos)) + } + None => AllocateConversion::NotAllocating(clos(arena::Arena::Closed)), + } + } + hir::Type::Callback(_) => { + // todo + todo!("We don't support callbacks yet") + } + hir::Type::DiplomatOption(_) => { + // todo + todo!("We don't support options yet") + } + _ => todo!(), + } + } + + fn native_to_java( + &self, + name: Cow<'cx, str>, + native_val: Cow<'cx, str>, + ty: &diplomat_core::hir::Type, + lifetimes: Vec, + return_self_edges: Option>, + ) -> Conversion<'cx> { + match ty { + hir::Type::Primitive(_) => { + let converted_value = format!("{name}Val").into(); + let conversion = format!("var {name}Val = {native_val};").into(); + Conversion { + conversion, + converted_value, + } + } + hir::Type::Opaque(o) => { + let converted_value = format!("{name}Val").into(); + let owned_return: bool = o.owner.is_owned(); + let ty_name = &self.tcx.resolve_opaque(o.tcx_id).name; + let conversion = OpaqueConversionTpl { + name: "return".into(), + lifetimes, + ty: ty_name.as_str().into(), + owned_return, + self_edges: return_self_edges, + native_val, + } + .render() + .unwrap_or_else(|err| { + panic!( + "Failed to render return val for type {}. Cause: {err}", + ty_name ) - .into(), + }) + .into(); + + Conversion { + conversion, + converted_value, + } + } + hir::Type::Struct(s) => { + let ty_name = &self.tcx.resolve_type(s.id()).name(); + let converted_value = format!("{name}Val").into(); + let conversion = StructConversionTpl { + lifetimes, + ty: ty_name.as_str().into(), + name, + native_val, + } + .render() + .unwrap_or_else(|err| { + panic!("Failed to render return val for type {ty_name}. Cause: {err}") + }) + .into(); + Conversion { + conversion, + converted_value, + } + } + hir::Type::Enum(e) => { + let converted_value = format!("{name}Val").into(); + let enum_ty = self.tcx.resolve_enum(e.tcx_id).name.as_str(); + let conversion = + format!(r#"var {name}Val = {enum_ty}.fromInt({native_val});"#).into(); + Conversion { + conversion, + converted_value, + } + } + + hir::Type::Slice(Slice::Str(_, encoding)) => { + let conversion = match encoding { + StringEncoding::Utf8 | StringEncoding::UnvalidatedUtf8 => { + format!("{name}Val = SliceUtils.readUtf8({native_val});") + } + StringEncoding::UnvalidatedUtf16 => { + format!("{name}Val = SliceUtils.readUtf16({native_val});") + } + _ => unreachable!("Not a valid string encoding for diplomat"), + } + .into(); + let converted_value = format!("{name}Val").into(); + Conversion { + conversion, + converted_value, + } + } + hir::Type::Slice(Slice::Primitive(_, p)) => { + let lib_name = self.tcx_config.lib_name.as_ref(); + let domain = self.tcx_config.domain.as_ref(); + let primitive_ty = match p { + hir::PrimitiveType::Bool => "Bool", + hir::PrimitiveType::Char => "Char", + hir::PrimitiveType::Byte => "U8", + hir::PrimitiveType::Int(IntType::U8) => "U8", + hir::PrimitiveType::Int(IntType::I8) => "I8", + hir::PrimitiveType::Int(IntType::U16) => "U16", + hir::PrimitiveType::Int(IntType::I16) => "I16", + hir::PrimitiveType::Int(IntType::U32) => "U32", + hir::PrimitiveType::Int(IntType::I32) => "I32", + hir::PrimitiveType::Int(IntType::U64) => "U64", + hir::PrimitiveType::Int(IntType::I64) => "I64", + hir::PrimitiveType::IntSize(IntSizeType::Usize) => "Usize", + hir::PrimitiveType::IntSize(IntSizeType::Isize) => "Isize", + hir::PrimitiveType::Int128(_) => { + panic!("Java backend doesn't support Int128 types") + } + hir::PrimitiveType::Float(FloatType::F32) => "F32", + hir::PrimitiveType::Float(FloatType::F64) => "F64", }; - (conversion, format!("{name}View").into()) + + let java_primitive_ty = self.formatter.fmt_native_primitive(p); + let conversion = format!( + r#"var data = {domain}.{lib_name}.ntv.Diplomat{primitive_ty}View.data({native_val}); +var len = {domain}.{lib_name}.ntv.Diplomat{primitive_ty}View.len({native_val}); +return SliceUtils.{java_primitive_ty}SliceToArray({native_val});"# + ).into(); + let converted_value = format!("{name}Val").into(); + Conversion { + conversion, + converted_value, + } } - hir::Type::Slice(Slice::Strs(StringEncoding::UnvalidatedUtf16)) => ( - format!( - r#"var {name}View = SliceUtils.strs16(arena, {name}); -var {name}Len = {name}.length;"# - ) - .into(), - format!(r#"{name}View"#).into(), - ), - hir::Type::Slice(Slice::Strs(_)) => ( - format!( - r#"var {name}View = SliceUtils.strs8(arena, {name}); -var {name}Len = {name}.length;"# - ) - .into(), - format!(r#"{name}View"#).into(), - ), - x => panic!("Unexpected slice type {x:?}"), - }; - ParamConversion { - converted_value, - conversion_def: conversion, + hir::Type::Slice(Slice::Strs(_)) => { + panic!("[&str] not allowed in return position") + } + hir::Type::Callback(_) => todo!("Callback's aren't supported in java"), + hir::Type::DiplomatOption(_) => todo!("Options aren't support in java"), + _ => todo!(), } } @@ -553,51 +767,24 @@ return SliceUtils.{java_primitive_ty}SliceToArray(nativeVal);"# Ok(return_conversion) } - fn gen_return_conversion( + fn gen_native_to_java_conversion( &self, - ty: &ReturnType, + o: &hir::Type, lifetimes: Vec, return_self_edges: Option>, ) -> Result, String> { - let Config { lib_name, .. } = &self.tcx_config; - let ret = match ty { - ReturnType::Infallible(ref ret) => ret, - ReturnType::Fallible(ref ret, _) => ret, - ReturnType::Nullable(ref ret) => ret, - }; - let o = match ret { - /* - var writeable = somelib_h.diplomat_buffer_write_create(0); - somelib_h.Opaque_get_debug_str(internal, writeable); - var buffer = DiplomatWrite.buf(writeable); - var string = buffer.getString(0, StandardCharsets.UTF_8); - somelib_h.diplomat_buffer_write_destroy(writeable); - return string; - */ - SuccessType::Write => { - let write_return: Cow<'cx, str> = format!( - r#"var string = SliceUtils. readUtf8FromWriteable(writeable); -{}_h.diplomat_buffer_write_destroy(writeable); -return string;"#, - lib_name - ) - .into(); - return Ok(write_return); - } - SuccessType::OutType(ref o) => o, - SuccessType::Unit => return Ok(Cow::<'cx, str>::default()), - _ => todo!(), - }; - let return_statment: Cow<'cx, str> = match o { + let conversion = match o { hir::Type::Primitive(_) => "return nativeVal;".into(), hir::Type::Opaque(o) => { let owned_return: bool = o.owner.is_owned(); let ty_name = &self.tcx.resolve_opaque(o.tcx_id).name; - OpaqueReturnTpl { + let conversion = OpaqueConversionTpl { + name: "return".into(), lifetimes, - return_ty: ty_name.as_str().into(), + ty: ty_name.as_str().into(), owned_return, - return_self_edges, + self_edges: return_self_edges, + native_val: "nativeVal".into(), } .render() .unwrap_or_else(|err| { @@ -605,19 +792,30 @@ return string;"#, "Failed to render return val for type {}. Cause: {err}", ty_name ) - }) + }); + + format!( + r#"{conversion} +return returnVal;"# + ) .into() } hir::Type::Struct(s) => { let ty_name = &self.tcx.resolve_type(s.id()).name(); - StructReturnTpl { + let conversion = StructConversionTpl { lifetimes, - return_ty: ty_name.as_str().into(), + ty: ty_name.as_str().into(), + name: "return".into(), + native_val: "nativeVal".into(), } .render() .unwrap_or_else(|err| { panic!("Failed to render return val for type {ty_name}. Cause: {err}") - }) + }); + format!( + r#"{conversion} +return returnVal;"# + ) .into() } hir::Type::Enum(e) => { @@ -627,8 +825,61 @@ return string;"#, hir::Type::Slice(ref slice) => self.gen_slice_return_conversion(slice)?, unknown => panic!("Got to unknown return type: {unknown:?}"), }; + Ok(conversion) + } - Ok(return_statment) + fn gen_return_conversion( + &self, + ty: &ReturnType, + lifetimes: Vec, + return_self_edges: Option>, + ) -> Cow<'cx, str> { + let Config { lib_name, .. } = &self.tcx_config; + let ret = match ty { + ReturnType::Infallible(ref ret) => ret, + ReturnType::Fallible(ref ret, _) => ret, + ReturnType::Nullable(ref ret) => ret, + }; + let o = match ret { + /* + var writeable = somelib_h.diplomat_buffer_write_create(0); + somelib_h.Opaque_get_debug_str(internal, writeable); + var buffer = DiplomatWrite.buf(writeable); + var string = buffer.getString(0, StandardCharsets.UTF_8); + somelib_h.diplomat_buffer_write_destroy(writeable); + return string; + */ + SuccessType::Write => { + let write_return: Cow<'cx, str> = format!( + r#"var string = SliceUtils. readUtf8FromWriteable(writeable); +{}_h.diplomat_buffer_write_destroy(writeable); +return string;"#, + lib_name + ) + .into(); + return write_return; + } + SuccessType::OutType(ref o) => o, + SuccessType::Unit => return Cow::<'cx, str>::default(), + _ => todo!(), + }; + // (o, lifetimes, return_self_edges) + let Conversion { + conversion, + converted_value, + } = self.native_to_java( + "return".into(), + "nativeVal".into(), + o, + lifetimes, + return_self_edges, + ); + format!( + r#"{conversion} +return {converted_value}; + "# + ) + .into() } fn gen_methods( @@ -642,7 +893,7 @@ return string;"#, methods .iter() .filter(|method| !method.attrs.disable) - .filter_map(|method: &'cx Method| -> Option<(bool, Cow<'cx, str>)> { + .map(|method: &'cx Method| -> (bool, Cow<'cx, str>) { let mut visitor: BorrowingParamVisitor<'cx> = method.borrowing_param_visitor(self.tcx); @@ -669,11 +920,24 @@ return string;"#, let (params, param_conversions) = method .params .iter() - .map(|param @ diplomat_core::hir::Param { name, ty, .. }| { - let name: Cow = self.formatter.fmt_param_name(name.as_str()).into(); + .map(|diplomat_core::hir::Param { name, ty, .. }| { + let name: Cow<'cx, str> = + self.formatter.fmt_param_name(name.as_str()).into(); let param_lt_info = visitor.visit_param(ty, name.as_ref()); - let conversion = - self.gen_param_conversion(param, ¶m_lt_info, &mut allocations); + let Conversion { + conversion, + converted_value, + } = match self.java_to_native(name.clone(), ty) { + AllocateConversion::NotAllocating(conversion) => conversion, + AllocateConversion::Allocating(conversion_clos) => { + allocations = true; + conversion_clos.render(arena::Arena::Closed) + } + }; + let conversion = ParamConversion { + converted_value, + conversion_def: conversion, + }; ( Param { name, @@ -697,15 +961,11 @@ return string;"#, } hir::Type::Slice( Slice::Str(Some(_), _) | Slice::Primitive(Some(_), _), - ) => Some(ParamConversion { + ) + | hir::Type::Struct(_) => Some(ParamConversion { converted_value: "arena".into(), conversion_def: "".into(), }), - hir::Type::Struct(_) => Some(ParamConversion { - converted_value: "returnArena".into(), - conversion_def: - "var returnArena = (SegmentAllocator) Arena.ofAuto();".into(), - }), _ => None, }; @@ -771,20 +1031,7 @@ return string;"#, }) .into() } else { - match self.gen_return_conversion( - &method.output, - lifetime_edges, - return_self_edges, - ) { - Ok(ok) => ok, - Err(err) => { - self.errors.push_error(format!( - "can't construct method {} because {err}", - method.name - )); - return None; - } - } + self.gen_return_conversion(&method.output, lifetime_edges, return_self_edges) }; let allocations = allocations || method @@ -860,7 +1107,7 @@ return string;"#, ) }); - Some((method.param_self.is_some(), method_rendered.into())) + (method.param_self.is_some(), method_rendered.into()) }) .for_each(|(self_param, method_rendered)| match self_param { true => class_methods.push(method_rendered), @@ -1022,11 +1269,23 @@ return string;"#, _ => todo!(), }; let ty = self.formatter.fmt_java_type(&field.ty); + let to_native = match self.java_to_native(name.clone(), &field.ty) { + AllocateConversion::NotAllocating(conv) => conv, + AllocateConversion::Allocating(clos) => clos.render(arena::Arena::Closed), + }; + let to_java = self.native_to_java( + name.clone(), + format!("{name}Native").into(), + &field.ty, + vec![], + None, + ); FieldTpl { name, native_name: native_name.into(), ty, field_val, + to_java, to_native, } }) diff --git a/tool/templates/java/OpaqueReturn.java.jinja b/tool/templates/java/OpaqueConversion.java.jinja similarity index 60% rename from tool/templates/java/OpaqueReturn.java.jinja rename to tool/templates/java/OpaqueConversion.java.jinja index 37587305f..e9fe2bf31 100644 --- a/tool/templates/java/OpaqueReturn.java.jinja +++ b/tool/templates/java/OpaqueConversion.java.jinja @@ -1,5 +1,5 @@ List selfEdges = -{%- match return_self_edges %} +{%- match self_edges %} {%- when Some with (self_edges) %} List.of({{self_edges}}); {%- when None %} List.of(); {%- endmatch %} @@ -13,13 +13,8 @@ List {{lifetime.name}}Edges = List.of( ); {%- endfor %} -var returnVal = new {{return_ty}}(nativeVal, selfEdges +var {{name}}Val = new {{ty}}({{native_val}}, selfEdges {%- for lifetime in lifetimes -%} , {{lifetime.name}}Edges {%- endfor -%} ); -{% if owned_return -%} -var cleaner = new {{return_ty}}.{{return_ty}}Cleaner(nativeVal); -returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); -{%- endif %} -return returnVal; diff --git a/tool/templates/java/Struct.java.jinja b/tool/templates/java/Struct.java.jinja index 4c84c51e9..40bb0165a 100644 --- a/tool/templates/java/Struct.java.jinja +++ b/tool/templates/java/Struct.java.jinja @@ -38,7 +38,9 @@ public class {{type_name}} { {% endfor %} {% for field in fields -%} - this.{{field.name}} = {{field.field_val}}; + var {{field.name}}Native = {{domain}}.{{lib_name}}.ntv.{{type_name}}.{{field.native_name}}(structSegment); + {{field.to_java.conversion}} + this.{{field.name}} = {{field.to_java.converted_value}}; {% endfor %} } @@ -49,7 +51,8 @@ public class {{type_name}} { var returnVal = {{domain}}.{{lib_name}}.ntv.{{type_name}}.allocate(arena); {% for field in fields -%} - {{domain}}.{{lib_name}}.ntv.{{type_name}}.{{field.native_name}}(returnVal, {{field.to_native}}); + {{field.to_native.conversion}} + {{domain}}.{{lib_name}}.ntv.{{type_name}}.{{field.native_name}}(returnVal, {{field.to_native.converted_value}}); {% endfor %} return returnVal; diff --git a/tool/templates/java/StructReturn.java.jinja b/tool/templates/java/StructConversion.java.jinja similarity index 78% rename from tool/templates/java/StructReturn.java.jinja rename to tool/templates/java/StructConversion.java.jinja index cd6a929d5..bfff69418 100644 --- a/tool/templates/java/StructReturn.java.jinja +++ b/tool/templates/java/StructConversion.java.jinja @@ -6,9 +6,8 @@ List {{lifetime.name}}Edges = List.of( ); {%- endfor %} -var returnVal = new {{return_ty}}(returnArena, nativeVal +var {{name}}Val = new {{ty}}(returnArena, {{native_val}} {%- for lifetime in lifetimes -%} , {{lifetime.name}}Edges {%- endfor -%} ); -return returnVal; From 596b0c200f0cd3a0c9d073fdc64d9e836ad5c01c Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Fri, 13 Sep 2024 11:24:35 +0200 Subject: [PATCH 59/69] panama-backend - remove support for owned slices --- .../java/dev/diplomattest/somelib/Bar.java | 4 +- .../diplomattest/somelib/BorrowedFields.java | 59 ++- .../somelib/BorrowedFieldsReturning.java | 18 +- .../somelib/BorrowedFieldsWithBounds.java | 61 ++- .../diplomattest/somelib/CyclicStructA.java | 28 +- .../diplomattest/somelib/CyclicStructB.java | 28 +- .../dev/diplomattest/somelib/ErrorStruct.java | 21 +- .../dev/diplomattest/somelib/Float64Vec.java | 107 +++-- .../java/dev/diplomattest/somelib/Foo.java | 68 +-- .../diplomattest/somelib/ImportedStruct.java | 21 +- .../java/dev/diplomattest/somelib/MyEnum.java | 5 +- .../dev/diplomattest/somelib/MyString.java | 59 +-- .../dev/diplomattest/somelib/MyStruct.java | 71 ++- .../java/dev/diplomattest/somelib/MyZst.java | 7 +- .../somelib/NestedBorrowedFields.java | 59 +-- .../java/dev/diplomattest/somelib/One.java | 45 +- .../java/dev/diplomattest/somelib/Opaque.java | 54 ++- .../somelib/OpaqueMutexedString.java | 28 +- .../dev/diplomattest/somelib/RefList.java | 5 +- .../somelib/RefListParameter.java | 1 + .../java/dev/diplomattest/somelib/Two.java | 1 + .../dev/diplomattest/somelib/Utf16Wrap.java | 14 +- .../diplomattest/somelib/ntv/somelib_h.java | 178 +++---- .../diplomattest/somelib/Float64VecTest.java | 2 +- .../diplomattest/somelib/MyStringTest.java | 3 - feature_tests/src/slices.rs | 1 + tool/src/java/mod.rs | 454 ++++++++---------- ...mat_tool__java__test__enum_and_struct.snap | 75 ++- .../diplomat_tool__java__test__lifetimes.snap | 167 ++++--- .../diplomat_tool__java__test__opaque.snap | 25 +- ...lomat_tool__java__test__opaque_render.snap | 1 + .../diplomat_tool__java__test__slice.snap | 72 ++- tool/templates/java/Opaque.java.jinja | 1 + tool/templates/java/Struct.java.jinja | 11 +- .../java/StructConversion.java.jinja | 20 +- 35 files changed, 898 insertions(+), 876 deletions(-) diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Bar.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Bar.java index a3d06d74a..e63774e64 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Bar.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Bar.java @@ -16,6 +16,7 @@ public class Bar { MemorySegment internal; Cleaner.Cleanable cleanable; + SegmentAllocator arena; List selfEdges = List.of(); List bEdges = List.of(); @@ -49,14 +50,15 @@ public Foo foo() { var nativeVal = somelib_h.Bar_foo(internal); + List selfEdges = List.of(this); List aEdges = List.of(this); var returnVal = new Foo(nativeVal, selfEdges, aEdges); - return returnVal; + } } \ No newline at end of file diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/BorrowedFields.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/BorrowedFields.java index f7a9a605d..066f5f410 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/BorrowedFields.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/BorrowedFields.java @@ -17,24 +17,27 @@ public class BorrowedFields { String c; - SegmentAllocator arena; List selfEdges = List.of(); List aEdges = List.of(); - private BorrowedFields(SegmentAllocator arena) { - this.arena = arena; + private BorrowedFields() { } - BorrowedFields(SegmentAllocator arena, MemorySegment structSegment, List aEdges) { - this.arena = arena; + BorrowedFields(MemorySegment structSegment, List aEdges) { this.selfEdges = selfEdges; this.aEdges = aEdges; - this.a = SliceUtils.readUtf16(dev.diplomattest.somelib.ntv.BorrowedFields.a(structSegment)); - this.b = SliceUtils.readUtf8(dev.diplomattest.somelib.ntv.BorrowedFields.b(structSegment)); - this.c = SliceUtils.readUtf8(dev.diplomattest.somelib.ntv.BorrowedFields.c(structSegment)); + var aNative = dev.diplomattest.somelib.ntv.BorrowedFields.a(structSegment); + var aVal = SliceUtils.readUtf16(aNative); + this.a = aVal; + var bNative = dev.diplomattest.somelib.ntv.BorrowedFields.b(structSegment); + var bVal = SliceUtils.readUtf8(bNative); + this.b = bVal; + var cNative = dev.diplomattest.somelib.ntv.BorrowedFields.c(structSegment); + var cVal = SliceUtils.readUtf8(cNative); + this.c = cVal; } @@ -42,9 +45,24 @@ private BorrowedFields(SegmentAllocator arena) { MemorySegment toNative(SegmentAllocator arena) { var returnVal = dev.diplomattest.somelib.ntv.BorrowedFields.allocate(arena); - dev.diplomattest.somelib.ntv.BorrowedFields.a(returnVal, SliceUtils.strToUtf16Slice(arena, this.a)); - dev.diplomattest.somelib.ntv.BorrowedFields.b(returnVal, SliceUtils.strToUtf8Slice(arena, this.b)); - dev.diplomattest.somelib.ntv.BorrowedFields.c(returnVal, SliceUtils.strToUtf8Slice(arena, this.c)); + var aData = arena.allocateFrom(a, StandardCharsets.UTF_16); + var aLen = aData.byteSize() - 1; // allocated strings are null terminated + var aView = DiplomatString16View.allocate(arena); + DiplomatString16View.len(aView, aLen); + DiplomatString16View.data(aView, aData); + dev.diplomattest.somelib.ntv.BorrowedFields.a(returnVal, aView); + var bData= arena.allocateFrom(b, StandardCharsets.UTF_8); + var bLen = bData.byteSize() - 1; // allocated strings are null terminated + var bView = DiplomatStringView.allocate(arena); + DiplomatStringView.len(bView, bLen); + DiplomatStringView.data(bView, bData); + dev.diplomattest.somelib.ntv.BorrowedFields.b(returnVal, bView); + var cData= arena.allocateFrom(c, StandardCharsets.UTF_8); + var cLen = cData.byteSize() - 1; // allocated strings are null terminated + var cView = DiplomatStringView.allocate(arena); + DiplomatStringView.len(cView, cLen); + DiplomatStringView.data(cView, cData); + dev.diplomattest.somelib.ntv.BorrowedFields.c(returnVal, cView); return returnVal; @@ -54,24 +72,23 @@ MemorySegment toNative(SegmentAllocator arena) { public static BorrowedFields fromBarAndStrings(Bar bar,String dstr16,String utf8Str) { try (var arena = Arena.ofConfined()) { - var returnArena = (SegmentAllocator) Arena.ofAuto(); + var barNative = bar.internal; - var dstr16Data= arena.allocateFrom(dstr16, StandardCharsets.UTF_16); + var dstr16Data = Arena.ofAuto().allocateFrom(dstr16, StandardCharsets.UTF_16); var dstr16Len = dstr16Data.byteSize() - 1; // allocated strings are null terminated - var dstr16View = DiplomatString16View.allocate(arena); + var dstr16View = DiplomatString16View.allocate(Arena.ofAuto()); DiplomatString16View.len(dstr16View, dstr16Len); DiplomatString16View.data(dstr16View, dstr16Data); - var utf8StrData= arena.allocateFrom(utf8Str, StandardCharsets.UTF_8); - var utf8StrLen = utf8StrData.byteSize() - 1; - var utf8StrView = DiplomatStringView.allocate(arena); + var utf8StrData= Arena.ofAuto().allocateFrom(utf8Str, StandardCharsets.UTF_8); + var utf8StrLen = utf8StrData.byteSize() - 1; // allocated strings are null terminated + var utf8StrView = DiplomatStringView.allocate(Arena.ofAuto()); DiplomatStringView.len(utf8StrView, utf8StrLen); DiplomatStringView.data(utf8StrView, utf8StrData); - var nativeVal = somelib_h.BorrowedFields_from_bar_and_strings(returnArena, barNative, dstr16View, utf8StrView); - - List xEdges = List.of(bar, dstr16, utf8Str); + var nativeVal = somelib_h.BorrowedFields_from_bar_and_strings(arena, barNative, dstr16View, utf8StrView); - var returnVal = new BorrowedFields(returnArena, nativeVal, xEdges); + var returnVal = new BorrowedFields(nativeVal, List.of(bar, dstr16, utf8Str)); return returnVal; + } } diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/BorrowedFieldsReturning.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/BorrowedFieldsReturning.java index e3f1a1a8a..eefce6a93 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/BorrowedFieldsReturning.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/BorrowedFieldsReturning.java @@ -15,22 +15,21 @@ public class BorrowedFieldsReturning { String bytes; - SegmentAllocator arena; List selfEdges = List.of(); List aEdges = List.of(); - private BorrowedFieldsReturning(SegmentAllocator arena) { - this.arena = arena; + private BorrowedFieldsReturning() { } - BorrowedFieldsReturning(SegmentAllocator arena, MemorySegment structSegment, List aEdges) { - this.arena = arena; + BorrowedFieldsReturning(MemorySegment structSegment, List aEdges) { this.selfEdges = selfEdges; this.aEdges = aEdges; - this.bytes = SliceUtils.readUtf8(dev.diplomattest.somelib.ntv.BorrowedFieldsReturning.bytes(structSegment)); + var bytesNative = dev.diplomattest.somelib.ntv.BorrowedFieldsReturning.bytes(structSegment); + var bytesVal = SliceUtils.readUtf8(bytesNative); + this.bytes = bytesVal; } @@ -38,7 +37,12 @@ private BorrowedFieldsReturning(SegmentAllocator arena) { MemorySegment toNative(SegmentAllocator arena) { var returnVal = dev.diplomattest.somelib.ntv.BorrowedFieldsReturning.allocate(arena); - dev.diplomattest.somelib.ntv.BorrowedFieldsReturning.bytes(returnVal, SliceUtils.strToUtf8Slice(arena, this.bytes)); + var bytesData= arena.allocateFrom(bytes, StandardCharsets.UTF_8); + var bytesLen = bytesData.byteSize() - 1; // allocated strings are null terminated + var bytesView = DiplomatStringView.allocate(arena); + DiplomatStringView.len(bytesView, bytesLen); + DiplomatStringView.data(bytesView, bytesData); + dev.diplomattest.somelib.ntv.BorrowedFieldsReturning.bytes(returnVal, bytesView); return returnVal; diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/BorrowedFieldsWithBounds.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/BorrowedFieldsWithBounds.java index 7965fe669..f595e1da2 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/BorrowedFieldsWithBounds.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/BorrowedFieldsWithBounds.java @@ -17,28 +17,31 @@ public class BorrowedFieldsWithBounds { String fieldC; - SegmentAllocator arena; List selfEdges = List.of(); List aEdges = List.of(); List bEdges = List.of(); List cEdges = List.of(); - private BorrowedFieldsWithBounds(SegmentAllocator arena) { - this.arena = arena; + private BorrowedFieldsWithBounds() { } - BorrowedFieldsWithBounds(SegmentAllocator arena, MemorySegment structSegment, List aEdges, List bEdges, List cEdges) { - this.arena = arena; + BorrowedFieldsWithBounds(MemorySegment structSegment, List aEdges, List bEdges, List cEdges) { this.selfEdges = selfEdges; this.aEdges = aEdges; this.bEdges = bEdges; this.cEdges = cEdges; - this.fieldA = SliceUtils.readUtf16(dev.diplomattest.somelib.ntv.BorrowedFieldsWithBounds.field_a(structSegment)); - this.fieldB = SliceUtils.readUtf8(dev.diplomattest.somelib.ntv.BorrowedFieldsWithBounds.field_b(structSegment)); - this.fieldC = SliceUtils.readUtf8(dev.diplomattest.somelib.ntv.BorrowedFieldsWithBounds.field_c(structSegment)); + var fieldANative = dev.diplomattest.somelib.ntv.BorrowedFieldsWithBounds.field_a(structSegment); + var fieldAVal = SliceUtils.readUtf16(fieldANative); + this.fieldA = fieldAVal; + var fieldBNative = dev.diplomattest.somelib.ntv.BorrowedFieldsWithBounds.field_b(structSegment); + var fieldBVal = SliceUtils.readUtf8(fieldBNative); + this.fieldB = fieldBVal; + var fieldCNative = dev.diplomattest.somelib.ntv.BorrowedFieldsWithBounds.field_c(structSegment); + var fieldCVal = SliceUtils.readUtf8(fieldCNative); + this.fieldC = fieldCVal; } @@ -46,9 +49,24 @@ private BorrowedFieldsWithBounds(SegmentAllocator arena) { MemorySegment toNative(SegmentAllocator arena) { var returnVal = dev.diplomattest.somelib.ntv.BorrowedFieldsWithBounds.allocate(arena); - dev.diplomattest.somelib.ntv.BorrowedFieldsWithBounds.field_a(returnVal, SliceUtils.strToUtf16Slice(arena, this.fieldA)); - dev.diplomattest.somelib.ntv.BorrowedFieldsWithBounds.field_b(returnVal, SliceUtils.strToUtf8Slice(arena, this.fieldB)); - dev.diplomattest.somelib.ntv.BorrowedFieldsWithBounds.field_c(returnVal, SliceUtils.strToUtf8Slice(arena, this.fieldC)); + var fieldAData = arena.allocateFrom(fieldA, StandardCharsets.UTF_16); + var fieldALen = fieldAData.byteSize() - 1; // allocated strings are null terminated + var fieldAView = DiplomatString16View.allocate(arena); + DiplomatString16View.len(fieldAView, fieldALen); + DiplomatString16View.data(fieldAView, fieldAData); + dev.diplomattest.somelib.ntv.BorrowedFieldsWithBounds.field_a(returnVal, fieldAView); + var fieldBData= arena.allocateFrom(fieldB, StandardCharsets.UTF_8); + var fieldBLen = fieldBData.byteSize() - 1; // allocated strings are null terminated + var fieldBView = DiplomatStringView.allocate(arena); + DiplomatStringView.len(fieldBView, fieldBLen); + DiplomatStringView.data(fieldBView, fieldBData); + dev.diplomattest.somelib.ntv.BorrowedFieldsWithBounds.field_b(returnVal, fieldBView); + var fieldCData= arena.allocateFrom(fieldC, StandardCharsets.UTF_8); + var fieldCLen = fieldCData.byteSize() - 1; // allocated strings are null terminated + var fieldCView = DiplomatStringView.allocate(arena); + DiplomatStringView.len(fieldCView, fieldCLen); + DiplomatStringView.data(fieldCView, fieldCData); + dev.diplomattest.somelib.ntv.BorrowedFieldsWithBounds.field_c(returnVal, fieldCView); return returnVal; @@ -58,26 +76,23 @@ MemorySegment toNative(SegmentAllocator arena) { public static BorrowedFieldsWithBounds fromFooAndStrings(Foo foo,String dstr16X,String utf8StrZ) { try (var arena = Arena.ofConfined()) { - var returnArena = (SegmentAllocator) Arena.ofAuto(); + var fooNative = foo.internal; - var dstr16XData= arena.allocateFrom(dstr16X, StandardCharsets.UTF_16); + var dstr16XData = Arena.ofAuto().allocateFrom(dstr16X, StandardCharsets.UTF_16); var dstr16XLen = dstr16XData.byteSize() - 1; // allocated strings are null terminated - var dstr16XView = DiplomatString16View.allocate(arena); + var dstr16XView = DiplomatString16View.allocate(Arena.ofAuto()); DiplomatString16View.len(dstr16XView, dstr16XLen); DiplomatString16View.data(dstr16XView, dstr16XData); - var utf8StrZData= arena.allocateFrom(utf8StrZ, StandardCharsets.UTF_8); - var utf8StrZLen = utf8StrZData.byteSize() - 1; - var utf8StrZView = DiplomatStringView.allocate(arena); + var utf8StrZData= Arena.ofAuto().allocateFrom(utf8StrZ, StandardCharsets.UTF_8); + var utf8StrZLen = utf8StrZData.byteSize() - 1; // allocated strings are null terminated + var utf8StrZView = DiplomatStringView.allocate(Arena.ofAuto()); DiplomatStringView.len(utf8StrZView, utf8StrZLen); DiplomatStringView.data(utf8StrZView, utf8StrZData); - var nativeVal = somelib_h.BorrowedFieldsWithBounds_from_foo_and_strings(returnArena, fooNative, dstr16XView, utf8StrZView); - - List xEdges = List.of(foo, dstr16X, utf8StrZ); - List yEdges = List.of(foo, utf8StrZ); - List zEdges = List.of(utf8StrZ); + var nativeVal = somelib_h.BorrowedFieldsWithBounds_from_foo_and_strings(arena, fooNative, dstr16XView, utf8StrZView); - var returnVal = new BorrowedFieldsWithBounds(returnArena, nativeVal, xEdges, yEdges, zEdges); + var returnVal = new BorrowedFieldsWithBounds(nativeVal, List.of(foo, dstr16X, utf8StrZ), List.of(foo, utf8StrZ), List.of()); return returnVal; + } } diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/CyclicStructA.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/CyclicStructA.java index 8e945e449..2eb0b767a 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/CyclicStructA.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/CyclicStructA.java @@ -15,20 +15,19 @@ public class CyclicStructA { CyclicStructB a; - SegmentAllocator arena; List selfEdges = List.of(); - private CyclicStructA(SegmentAllocator arena) { - this.arena = arena; + private CyclicStructA() { } - CyclicStructA(SegmentAllocator arena, MemorySegment structSegment) { - this.arena = arena; + CyclicStructA(MemorySegment structSegment) { this.selfEdges = selfEdges; - this.a = new CyclicStructB(arena, dev.diplomattest.somelib.ntv.CyclicStructA.a(structSegment)); + var aNative = dev.diplomattest.somelib.ntv.CyclicStructA.a(structSegment); + var aVal = new CyclicStructB(aNative); + this.a = aVal; } @@ -36,7 +35,8 @@ private CyclicStructA(SegmentAllocator arena) { MemorySegment toNative(SegmentAllocator arena) { var returnVal = dev.diplomattest.somelib.ntv.CyclicStructA.allocate(arena); - dev.diplomattest.somelib.ntv.CyclicStructA.a(returnVal, this.a.toNative(arena)); + var aNative = a.toNative(arena); + dev.diplomattest.somelib.ntv.CyclicStructA.a(returnVal, aNative); return returnVal; @@ -45,12 +45,14 @@ MemorySegment toNative(SegmentAllocator arena) { public static CyclicStructB getB() { - var returnArena = (SegmentAllocator) Arena.ofAuto(); - var nativeVal = somelib_h.CyclicStructA_get_b(returnArena); - - - var returnVal = new CyclicStructB(returnArena, nativeVal); - return returnVal; + try (var arena = Arena.ofConfined()) { + + var nativeVal = somelib_h.CyclicStructA_get_b(arena); + + var returnVal = new CyclicStructB(nativeVal); + return returnVal; + + } } } diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/CyclicStructB.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/CyclicStructB.java index 6aeb1456a..f7d41fc45 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/CyclicStructB.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/CyclicStructB.java @@ -15,20 +15,19 @@ public class CyclicStructB { byte field; - SegmentAllocator arena; List selfEdges = List.of(); - private CyclicStructB(SegmentAllocator arena) { - this.arena = arena; + private CyclicStructB() { } - CyclicStructB(SegmentAllocator arena, MemorySegment structSegment) { - this.arena = arena; + CyclicStructB(MemorySegment structSegment) { this.selfEdges = selfEdges; - this.field = dev.diplomattest.somelib.ntv.CyclicStructB.field(structSegment); + var fieldNative = dev.diplomattest.somelib.ntv.CyclicStructB.field(structSegment); + var fieldVal = fieldNative; + this.field = fieldVal; } @@ -36,7 +35,8 @@ private CyclicStructB(SegmentAllocator arena) { MemorySegment toNative(SegmentAllocator arena) { var returnVal = dev.diplomattest.somelib.ntv.CyclicStructB.allocate(arena); - dev.diplomattest.somelib.ntv.CyclicStructB.field(returnVal, this.field); + var fieldNative = field; + dev.diplomattest.somelib.ntv.CyclicStructB.field(returnVal, fieldNative); return returnVal; @@ -45,12 +45,14 @@ MemorySegment toNative(SegmentAllocator arena) { public static CyclicStructA getA() { - var returnArena = (SegmentAllocator) Arena.ofAuto(); - var nativeVal = somelib_h.CyclicStructB_get_a(returnArena); - - - var returnVal = new CyclicStructA(returnArena, nativeVal); - return returnVal; + try (var arena = Arena.ofConfined()) { + + var nativeVal = somelib_h.CyclicStructB_get_a(arena); + + var returnVal = new CyclicStructA(nativeVal); + return returnVal; + + } } } diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ErrorStruct.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ErrorStruct.java index 5cda7bb6e..8414d5783 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ErrorStruct.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ErrorStruct.java @@ -16,21 +16,22 @@ public class ErrorStruct { int j; - SegmentAllocator arena; List selfEdges = List.of(); - private ErrorStruct(SegmentAllocator arena) { - this.arena = arena; + private ErrorStruct() { } - ErrorStruct(SegmentAllocator arena, MemorySegment structSegment) { - this.arena = arena; + ErrorStruct(MemorySegment structSegment) { this.selfEdges = selfEdges; - this.i = dev.diplomattest.somelib.ntv.ErrorStruct.i(structSegment); - this.j = dev.diplomattest.somelib.ntv.ErrorStruct.j(structSegment); + var iNative = dev.diplomattest.somelib.ntv.ErrorStruct.i(structSegment); + var iVal = iNative; + this.i = iVal; + var jNative = dev.diplomattest.somelib.ntv.ErrorStruct.j(structSegment); + var jVal = jNative; + this.j = jVal; } @@ -38,8 +39,10 @@ private ErrorStruct(SegmentAllocator arena) { MemorySegment toNative(SegmentAllocator arena) { var returnVal = dev.diplomattest.somelib.ntv.ErrorStruct.allocate(arena); - dev.diplomattest.somelib.ntv.ErrorStruct.i(returnVal, this.i); - dev.diplomattest.somelib.ntv.ErrorStruct.j(returnVal, this.j); + var iNative = i; + dev.diplomattest.somelib.ntv.ErrorStruct.i(returnVal, iNative); + var jNative = j; + dev.diplomattest.somelib.ntv.ErrorStruct.j(returnVal, jNative); return returnVal; diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Float64Vec.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Float64Vec.java index 407d1cbc9..97f3fdf48 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Float64Vec.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Float64Vec.java @@ -16,6 +16,7 @@ public class Float64Vec { MemorySegment internal; Cleaner.Cleanable cleanable; + SegmentAllocator arena; List selfEdges = List.of(); @@ -40,6 +41,27 @@ public void run() { } + public static Float64Vec new_(double[] v) { + + try (var arena = Arena.ofConfined()) { + var vLen = v.length; + var vData= Arena.ofAuto().allocateFrom(JAVA_DOUBLE, v); + var vView = DiplomatF64View.allocate(Arena.ofAuto()); + DiplomatF64View.len(vView, vLen); + DiplomatF64View.data(vView, vData); + + var nativeVal = somelib_h.Float64Vec_new(vView); + + List selfEdges = List.of(); + + + + var returnVal = new Float64Vec(nativeVal, selfEdges); + return returnVal; + + } + } + public static Float64Vec newBool(boolean[] v) { try (var arena = Arena.ofConfined()) { @@ -48,20 +70,20 @@ public static Float64Vec newBool(boolean[] v) { for (int i = 0; i < vLen; i++) { vByteArray[i] = (byte) (v[i] ? 1 : 0); } - var vData = arena.allocateFrom(JAVA_BYTE, vByteArray); - var vView = DiplomatBoolView.allocate(arena); + var vData = Arena.ofAuto().allocateFrom(JAVA_BYTE, vByteArray); + var vView = DiplomatBoolView.allocate(Arena.ofAuto()); DiplomatBoolView.len(vView, vLen); DiplomatBoolView.data(vView, vData); var nativeVal = somelib_h.Float64Vec_new_bool(vView); + List selfEdges = List.of(); var returnVal = new Float64Vec(nativeVal, selfEdges); - var cleaner = new Float64Vec.Float64VecCleaner(nativeVal); - returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; + } } @@ -69,20 +91,20 @@ public static Float64Vec newI16(short[] v) { try (var arena = Arena.ofConfined()) { var vLen = v.length; - var vData= arena.allocateFrom(JAVA_SHORT, v); - var vView = DiplomatI16View.allocate(arena); + var vData= Arena.ofAuto().allocateFrom(JAVA_SHORT, v); + var vView = DiplomatI16View.allocate(Arena.ofAuto()); DiplomatI16View.len(vView, vLen); DiplomatI16View.data(vView, vData); var nativeVal = somelib_h.Float64Vec_new_i16(vView); + List selfEdges = List.of(); var returnVal = new Float64Vec(nativeVal, selfEdges); - var cleaner = new Float64Vec.Float64VecCleaner(nativeVal); - returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; + } } @@ -90,20 +112,20 @@ public static Float64Vec newU16(short[] v) { try (var arena = Arena.ofConfined()) { var vLen = v.length; - var vData= arena.allocateFrom(JAVA_SHORT, v); - var vView = DiplomatU16View.allocate(arena); + var vData= Arena.ofAuto().allocateFrom(JAVA_SHORT, v); + var vView = DiplomatU16View.allocate(Arena.ofAuto()); DiplomatU16View.len(vView, vLen); DiplomatU16View.data(vView, vData); var nativeVal = somelib_h.Float64Vec_new_u16(vView); + List selfEdges = List.of(); var returnVal = new Float64Vec(nativeVal, selfEdges); - var cleaner = new Float64Vec.Float64VecCleaner(nativeVal); - returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; + } } @@ -111,20 +133,20 @@ public static Float64Vec newIsize(long[] v) { try (var arena = Arena.ofConfined()) { var vLen = v.length; - var vData= arena.allocateFrom(JAVA_LONG, v); - var vView = DiplomatIsizeView.allocate(arena); + var vData= Arena.ofAuto().allocateFrom(JAVA_LONG, v); + var vView = DiplomatIsizeView.allocate(Arena.ofAuto()); DiplomatIsizeView.len(vView, vLen); DiplomatIsizeView.data(vView, vData); var nativeVal = somelib_h.Float64Vec_new_isize(vView); + List selfEdges = List.of(); var returnVal = new Float64Vec(nativeVal, selfEdges); - var cleaner = new Float64Vec.Float64VecCleaner(nativeVal); - returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; + } } @@ -132,20 +154,20 @@ public static Float64Vec newUsize(long[] v) { try (var arena = Arena.ofConfined()) { var vLen = v.length; - var vData= arena.allocateFrom(JAVA_LONG, v); - var vView = DiplomatUsizeView.allocate(arena); + var vData= Arena.ofAuto().allocateFrom(JAVA_LONG, v); + var vView = DiplomatUsizeView.allocate(Arena.ofAuto()); DiplomatUsizeView.len(vView, vLen); DiplomatUsizeView.data(vView, vData); var nativeVal = somelib_h.Float64Vec_new_usize(vView); + List selfEdges = List.of(); var returnVal = new Float64Vec(nativeVal, selfEdges); - var cleaner = new Float64Vec.Float64VecCleaner(nativeVal); - returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; + } } @@ -153,42 +175,23 @@ public static Float64Vec newF64BeBytes(byte[] v) { try (var arena = Arena.ofConfined()) { var vLen = v.length; - var vData= arena.allocateFrom(JAVA_BYTE, v); - var vView = DiplomatU8View.allocate(arena); + var vData= Arena.ofAuto().allocateFrom(JAVA_BYTE, v); + var vView = DiplomatU8View.allocate(Arena.ofAuto()); DiplomatU8View.len(vView, vLen); DiplomatU8View.data(vView, vData); var nativeVal = somelib_h.Float64Vec_new_f64_be_bytes(vView); + List selfEdges = List.of(); var returnVal = new Float64Vec(nativeVal, selfEdges); - var cleaner = new Float64Vec.Float64VecCleaner(nativeVal); - returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; + } } - public static Float64Vec newFromOwned(double[] v) { - - var vLen = v.length; - var vData= Arena.global().allocateFrom(JAVA_DOUBLE, v); - var vView = DiplomatF64View.allocate(Arena.global()); - DiplomatF64View.len(vView, vLen); - DiplomatF64View.data(vView, vData); - - var nativeVal = somelib_h.Float64Vec_new_from_owned(vView); - List selfEdges = List.of(); - - - - var returnVal = new Float64Vec(nativeVal, selfEdges); - var cleaner = new Float64Vec.Float64VecCleaner(nativeVal); - returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); - return returnVal; - } - public double[] asSlice() { @@ -196,9 +199,12 @@ public double[] asSlice() { var nativeVal = somelib_h.Float64Vec_as_slice(arena, internal); + var data = dev.diplomattest.somelib.ntv.DiplomatF64View.data(nativeVal); var len = dev.diplomattest.somelib.ntv.DiplomatF64View.len(nativeVal); - return SliceUtils.doubleSliceToArray(nativeVal); + var returnVal = SliceUtils.doubleSliceToArray(nativeVal); + return returnVal; + } } @@ -207,8 +213,8 @@ public void fillSlice(double[] v) { try (var arena = Arena.ofConfined()) { var vLen = v.length; - var vData= arena.allocateFrom(JAVA_DOUBLE, v); - var vView = DiplomatF64View.allocate(arena); + var vData= Arena.ofAuto().allocateFrom(JAVA_DOUBLE, v); + var vView = DiplomatF64View.allocate(Arena.ofAuto()); DiplomatF64View.len(vView, vLen); DiplomatF64View.data(vView, vData); @@ -222,8 +228,8 @@ public void setValue(double[] newSlice) { try (var arena = Arena.ofConfined()) { var newSliceLen = newSlice.length; - var newSliceData= arena.allocateFrom(JAVA_DOUBLE, newSlice); - var newSliceView = DiplomatF64View.allocate(arena); + var newSliceData= Arena.ofAuto().allocateFrom(JAVA_DOUBLE, newSlice); + var newSliceView = DiplomatF64View.allocate(Arena.ofAuto()); DiplomatF64View.len(newSliceView, newSliceLen); DiplomatF64View.data(newSliceView, newSliceData); @@ -248,9 +254,12 @@ public double[] borrow() { var nativeVal = somelib_h.Float64Vec_borrow(arena, internal); + var data = dev.diplomattest.somelib.ntv.DiplomatF64View.data(nativeVal); var len = dev.diplomattest.somelib.ntv.DiplomatF64View.len(nativeVal); - return SliceUtils.doubleSliceToArray(nativeVal); + var returnVal = SliceUtils.doubleSliceToArray(nativeVal); + return returnVal; + } } diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Foo.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Foo.java index 69b46bc64..9981364ed 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Foo.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Foo.java @@ -16,6 +16,7 @@ public class Foo { MemorySegment internal; Cleaner.Cleanable cleanable; + SegmentAllocator arena; List selfEdges = List.of(); List aEdges = List.of(); @@ -45,58 +46,60 @@ public void run() { public static Foo new_(String x) { try (var arena = Arena.ofConfined()) { - var xData= arena.allocateFrom(x, StandardCharsets.UTF_8); - var xLen = xData.byteSize() - 1; - var xView = DiplomatStringView.allocate(arena); + var xData= Arena.ofAuto().allocateFrom(x, StandardCharsets.UTF_8); + var xLen = xData.byteSize() - 1; // allocated strings are null terminated + var xView = DiplomatStringView.allocate(Arena.ofAuto()); DiplomatStringView.len(xView, xLen); DiplomatStringView.data(xView, xData); var nativeVal = somelib_h.Foo_new(xView); + List selfEdges = List.of(); List aEdges = List.of(x); var returnVal = new Foo(nativeVal, selfEdges, aEdges); - var cleaner = new Foo.FooCleaner(nativeVal); - returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; + } } public static Foo extractFromFields(BorrowedFields fields) { - var fieldsNative = fields.toNative(fields.arena); - var nativeVal = somelib_h.Foo_extract_from_fields(fieldsNative); - List selfEdges = List.of(); - - - - List aEdges = List.of(fields); - var returnVal = new Foo(nativeVal, selfEdges, aEdges); - var cleaner = new Foo.FooCleaner(nativeVal); - returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); - return returnVal; + try (var arena = Arena.ofConfined()) { + var fieldsNative = fields.toNative(arena); + var nativeVal = somelib_h.Foo_extract_from_fields(fieldsNative); + + List selfEdges = List.of(); + + + + List aEdges = List.of(fields); + var returnVal = new Foo(nativeVal, selfEdges, aEdges); + return returnVal; + + } } public static Foo extractFromBounds(BorrowedFieldsWithBounds bounds,String anotherString) { try (var arena = Arena.ofConfined()) { - var boundsNative = bounds.toNative(bounds.arena); - var anotherStringData= arena.allocateFrom(anotherString, StandardCharsets.UTF_8); - var anotherStringLen = anotherStringData.byteSize() - 1; - var anotherStringView = DiplomatStringView.allocate(arena); + var boundsNative = bounds.toNative(arena); + var anotherStringData= Arena.ofAuto().allocateFrom(anotherString, StandardCharsets.UTF_8); + var anotherStringLen = anotherStringData.byteSize() - 1; // allocated strings are null terminated + var anotherStringView = DiplomatStringView.allocate(Arena.ofAuto()); DiplomatStringView.len(anotherStringView, anotherStringLen); DiplomatStringView.data(anotherStringView, anotherStringData); var nativeVal = somelib_h.Foo_extract_from_bounds(boundsNative, anotherStringView); + List selfEdges = List.of(); List aEdges = List.of(bounds, bounds, anotherString); var returnVal = new Foo(nativeVal, selfEdges, aEdges); - var cleaner = new Foo.FooCleaner(nativeVal); - returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; + } } @@ -105,6 +108,7 @@ public Bar getBar() { var nativeVal = somelib_h.Foo_get_bar(internal); + List selfEdges = List.of(); @@ -112,21 +116,21 @@ public Bar getBar() { List bEdges = List.of(this); List aEdges = List.of(this); var returnVal = new Bar(nativeVal, selfEdges, bEdges, aEdges); - var cleaner = new Bar.BarCleaner(nativeVal); - returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; + } public BorrowedFieldsReturning asReturning() { - var returnArena = (SegmentAllocator) Arena.ofAuto(); - - var nativeVal = somelib_h.Foo_as_returning(returnArena, internal); - - List aEdges = List.of(this); - - var returnVal = new BorrowedFieldsReturning(returnArena, nativeVal, aEdges); - return returnVal; + try (var arena = Arena.ofConfined()) { + + + var nativeVal = somelib_h.Foo_as_returning(arena, internal); + + var returnVal = new BorrowedFieldsReturning(nativeVal, List.of()); + return returnVal; + + } } } \ No newline at end of file diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ImportedStruct.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ImportedStruct.java index ca15b2fd6..c17cc32ec 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ImportedStruct.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ImportedStruct.java @@ -16,21 +16,22 @@ public class ImportedStruct { byte count; - SegmentAllocator arena; List selfEdges = List.of(); - private ImportedStruct(SegmentAllocator arena) { - this.arena = arena; + private ImportedStruct() { } - ImportedStruct(SegmentAllocator arena, MemorySegment structSegment) { - this.arena = arena; + ImportedStruct(MemorySegment structSegment) { this.selfEdges = selfEdges; - this.foo = UnimportedEnum.fromInt(dev.diplomattest.somelib.ntv.ImportedStruct.foo(structSegment)); - this.count = dev.diplomattest.somelib.ntv.ImportedStruct.count(structSegment); + var fooNative = dev.diplomattest.somelib.ntv.ImportedStruct.foo(structSegment); + var fooVal = UnimportedEnum.fromInt(fooNative); + this.foo = fooVal; + var countNative = dev.diplomattest.somelib.ntv.ImportedStruct.count(structSegment); + var countVal = countNative; + this.count = countVal; } @@ -38,8 +39,10 @@ private ImportedStruct(SegmentAllocator arena) { MemorySegment toNative(SegmentAllocator arena) { var returnVal = dev.diplomattest.somelib.ntv.ImportedStruct.allocate(arena); - dev.diplomattest.somelib.ntv.ImportedStruct.foo(returnVal, this.foo.toInt()); - dev.diplomattest.somelib.ntv.ImportedStruct.count(returnVal, this.count); + var fooNative = foo.toInt(); + dev.diplomattest.somelib.ntv.ImportedStruct.foo(returnVal, fooNative); + var countNative = count; + dev.diplomattest.somelib.ntv.ImportedStruct.count(returnVal, countNative); return returnVal; diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyEnum.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyEnum.java index 49518c024..11c4296d6 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyEnum.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyEnum.java @@ -73,7 +73,10 @@ int toInt() { public static MyEnum getA() { var nativeVal = somelib_h.MyEnum_get_a(); - return MyEnum.fromInt(nativeVal); + + var returnVal = MyEnum.fromInt(nativeVal); + return returnVal; + } } diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyString.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyString.java index 2bf39cd3d..48a73a602 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyString.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyString.java @@ -16,6 +16,7 @@ public class MyString { MemorySegment internal; Cleaner.Cleanable cleanable; + SegmentAllocator arena; List selfEdges = List.of(); @@ -43,84 +44,66 @@ public void run() { public static MyString new_(String v) { try (var arena = Arena.ofConfined()) { - var vData= arena.allocateFrom(v, StandardCharsets.UTF_8); - var vLen = vData.byteSize() - 1; - var vView = DiplomatStringView.allocate(arena); + var vData= Arena.ofAuto().allocateFrom(v, StandardCharsets.UTF_8); + var vLen = vData.byteSize() - 1; // allocated strings are null terminated + var vView = DiplomatStringView.allocate(Arena.ofAuto()); DiplomatStringView.len(vView, vLen); DiplomatStringView.data(vView, vData); var nativeVal = somelib_h.MyString_new(vView); + List selfEdges = List.of(); var returnVal = new MyString(nativeVal, selfEdges); - var cleaner = new MyString.MyStringCleaner(nativeVal); - returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; + } } public static MyString newUnsafe(String v) { try (var arena = Arena.ofConfined()) { - var vData= arena.allocateFrom(v, StandardCharsets.UTF_8); - var vLen = vData.byteSize() - 1; - var vView = DiplomatStringView.allocate(arena); + var vData= Arena.ofAuto().allocateFrom(v, StandardCharsets.UTF_8); + var vLen = vData.byteSize() - 1; // allocated strings are null terminated + var vView = DiplomatStringView.allocate(Arena.ofAuto()); DiplomatStringView.len(vView, vLen); DiplomatStringView.data(vView, vData); var nativeVal = somelib_h.MyString_new_unsafe(vView); + List selfEdges = List.of(); var returnVal = new MyString(nativeVal, selfEdges); - var cleaner = new MyString.MyStringCleaner(nativeVal); - returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; + } } - public static MyString newOwned(String v) { - - var vData= Arena.global().allocateFrom(v, StandardCharsets.UTF_8); - var vLen = vData.byteSize() - 1; - var vView = DiplomatStringView.allocate(Arena.global()); - DiplomatStringView.len(vView, vLen); - DiplomatStringView.data(vView, vData); - var nativeVal = somelib_h.MyString_new_owned(vView); - List selfEdges = List.of(); - - - - var returnVal = new MyString(nativeVal, selfEdges); - var cleaner = new MyString.MyStringCleaner(nativeVal); - returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); - return returnVal; - } - public static MyString newFromFirst(String [] v) { try (var arena = Arena.ofConfined()) { - var vView = SliceUtils.strs8(arena, v); - var vLen = v.length; + var vView = SliceUtils.strs8(Arena.ofAuto(), v); + var vLen = v.length; var nativeVal = somelib_h.MyString_new_from_first(vView); + List selfEdges = List.of(); var returnVal = new MyString(nativeVal, selfEdges); - var cleaner = new MyString.MyStringCleaner(nativeVal); - returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; + } } public static String stringTransform(String foo) { try (var arena = Arena.ofConfined()) { - var fooData= arena.allocateFrom(foo, StandardCharsets.UTF_8); - var fooLen = fooData.byteSize() - 1; - var fooView = DiplomatStringView.allocate(arena); + var fooData= Arena.ofAuto().allocateFrom(foo, StandardCharsets.UTF_8); + var fooLen = fooData.byteSize() - 1; // allocated strings are null terminated + var fooView = DiplomatStringView.allocate(Arena.ofAuto()); DiplomatStringView.len(fooView, fooLen); DiplomatStringView.data(fooView, fooData); var writeable = somelib_h.diplomat_buffer_write_create(0); @@ -136,9 +119,9 @@ public void setStr(String newStr) { try (var arena = Arena.ofConfined()) { - var newStrData= arena.allocateFrom(newStr, StandardCharsets.UTF_8); - var newStrLen = newStrData.byteSize() - 1; - var newStrView = DiplomatStringView.allocate(arena); + var newStrData= Arena.ofAuto().allocateFrom(newStr, StandardCharsets.UTF_8); + var newStrLen = newStrData.byteSize() - 1; // allocated strings are null terminated + var newStrView = DiplomatStringView.allocate(Arena.ofAuto()); DiplomatStringView.len(newStrView, newStrLen); DiplomatStringView.data(newStrView, newStrData); somelib_h.MyString_set_str(internal, newStrView); diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyStruct.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyStruct.java index 3620bbfe7..756d05d86 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyStruct.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyStruct.java @@ -21,41 +21,58 @@ public class MyStruct { MyEnum g; - SegmentAllocator arena; List selfEdges = List.of(); - private MyStruct(SegmentAllocator arena) { - this.arena = arena; + private MyStruct() { } - MyStruct(SegmentAllocator arena, MemorySegment structSegment) { - this.arena = arena; + MyStruct(MemorySegment structSegment) { this.selfEdges = selfEdges; - this.a = dev.diplomattest.somelib.ntv.MyStruct.a(structSegment); - this.b = dev.diplomattest.somelib.ntv.MyStruct.b(structSegment); - this.c = dev.diplomattest.somelib.ntv.MyStruct.c(structSegment); - this.d = dev.diplomattest.somelib.ntv.MyStruct.d(structSegment); - this.e = dev.diplomattest.somelib.ntv.MyStruct.e(structSegment); - this.f = dev.diplomattest.somelib.ntv.MyStruct.f(structSegment); - this.g = MyEnum.fromInt(dev.diplomattest.somelib.ntv.MyStruct.g(structSegment)); + var aNative = dev.diplomattest.somelib.ntv.MyStruct.a(structSegment); + var aVal = aNative; + this.a = aVal; + var bNative = dev.diplomattest.somelib.ntv.MyStruct.b(structSegment); + var bVal = bNative; + this.b = bVal; + var cNative = dev.diplomattest.somelib.ntv.MyStruct.c(structSegment); + var cVal = cNative; + this.c = cVal; + var dNative = dev.diplomattest.somelib.ntv.MyStruct.d(structSegment); + var dVal = dNative; + this.d = dVal; + var eNative = dev.diplomattest.somelib.ntv.MyStruct.e(structSegment); + var eVal = eNative; + this.e = eVal; + var fNative = dev.diplomattest.somelib.ntv.MyStruct.f(structSegment); + var fVal = fNative; + this.f = fVal; + var gNative = dev.diplomattest.somelib.ntv.MyStruct.g(structSegment); + var gVal = MyEnum.fromInt(gNative); + this.g = gVal; } MemorySegment toNative(SegmentAllocator arena) { - var x = arena; var returnVal = dev.diplomattest.somelib.ntv.MyStruct.allocate(arena); - dev.diplomattest.somelib.ntv.MyStruct.a(returnVal, this.a); - dev.diplomattest.somelib.ntv.MyStruct.b(returnVal, this.b); - dev.diplomattest.somelib.ntv.MyStruct.c(returnVal, this.c); - dev.diplomattest.somelib.ntv.MyStruct.d(returnVal, this.d); - dev.diplomattest.somelib.ntv.MyStruct.e(returnVal, this.e); - dev.diplomattest.somelib.ntv.MyStruct.f(returnVal, this.f); - dev.diplomattest.somelib.ntv.MyStruct.g(returnVal, this.g.toInt()); + var aNative = a; + dev.diplomattest.somelib.ntv.MyStruct.a(returnVal, aNative); + var bNative = b; + dev.diplomattest.somelib.ntv.MyStruct.b(returnVal, bNative); + var cNative = c; + dev.diplomattest.somelib.ntv.MyStruct.c(returnVal, cNative); + var dNative = d; + dev.diplomattest.somelib.ntv.MyStruct.d(returnVal, dNative); + var eNative = e; + dev.diplomattest.somelib.ntv.MyStruct.e(returnVal, eNative); + var fNative = f; + dev.diplomattest.somelib.ntv.MyStruct.f(returnVal, fNative); + var gNative = g.toInt(); + dev.diplomattest.somelib.ntv.MyStruct.g(returnVal, gNative); return returnVal; @@ -64,12 +81,14 @@ MemorySegment toNative(SegmentAllocator arena) { public static MyStruct new_() { - var returnArena = (SegmentAllocator) Arena.ofAuto(); - var nativeVal = somelib_h.MyStruct_new(returnArena); - - - var returnVal = new MyStruct(returnArena, nativeVal); - return returnVal; + try (var arena = Arena.ofConfined()) { + + var nativeVal = somelib_h.MyStruct_new(arena); + + var returnVal = new MyStruct(nativeVal); + return returnVal; + + } } } diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyZst.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyZst.java index 7e66016e4..e68eb57b1 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyZst.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/MyZst.java @@ -14,16 +14,13 @@ public class MyZst { - SegmentAllocator arena; List selfEdges = List.of(); - private MyZst(SegmentAllocator arena) { - this.arena = arena; + private MyZst() { } - MyZst(SegmentAllocator arena, MemorySegment structSegment) { - this.arena = arena; + MyZst(MemorySegment structSegment) { this.selfEdges = selfEdges; diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/NestedBorrowedFields.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/NestedBorrowedFields.java index 438eeba50..f6a9cb390 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/NestedBorrowedFields.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/NestedBorrowedFields.java @@ -17,28 +17,31 @@ public class NestedBorrowedFields { BorrowedFieldsWithBounds bounds2; - SegmentAllocator arena; List selfEdges = List.of(); List xEdges = List.of(); List yEdges = List.of(); List zEdges = List.of(); - private NestedBorrowedFields(SegmentAllocator arena) { - this.arena = arena; + private NestedBorrowedFields() { } - NestedBorrowedFields(SegmentAllocator arena, MemorySegment structSegment, List xEdges, List yEdges, List zEdges) { - this.arena = arena; + NestedBorrowedFields(MemorySegment structSegment, List xEdges, List yEdges, List zEdges) { this.selfEdges = selfEdges; this.xEdges = xEdges; this.yEdges = yEdges; this.zEdges = zEdges; - this.fields = new BorrowedFields(arena, dev.diplomattest.somelib.ntv.NestedBorrowedFields.fields(structSegment), Stream.concat(xEdges.stream(), yEdges.stream()).toList()); - this.bounds = new BorrowedFieldsWithBounds(arena, dev.diplomattest.somelib.ntv.NestedBorrowedFields.bounds(structSegment), Stream.concat(xEdges.stream(), yEdges.stream()).toList(), yEdges, yEdges); - this.bounds2 = new BorrowedFieldsWithBounds(arena, dev.diplomattest.somelib.ntv.NestedBorrowedFields.bounds2(structSegment), zEdges, zEdges, zEdges); + var fieldsNative = dev.diplomattest.somelib.ntv.NestedBorrowedFields.fields(structSegment); + var fieldsVal = new BorrowedFields(fieldsNative, List.of(xEdges, yEdges)); + this.fields = fieldsVal; + var boundsNative = dev.diplomattest.somelib.ntv.NestedBorrowedFields.bounds(structSegment); + var boundsVal = new BorrowedFieldsWithBounds(boundsNative, List.of(xEdges, yEdges), List.of(), List.of()); + this.bounds = boundsVal; + var bounds2Native = dev.diplomattest.somelib.ntv.NestedBorrowedFields.bounds2(structSegment); + var bounds2Val = new BorrowedFieldsWithBounds(bounds2Native, List.of(), List.of(), List.of()); + this.bounds2 = bounds2Val; } @@ -46,9 +49,12 @@ private NestedBorrowedFields(SegmentAllocator arena) { MemorySegment toNative(SegmentAllocator arena) { var returnVal = dev.diplomattest.somelib.ntv.NestedBorrowedFields.allocate(arena); - dev.diplomattest.somelib.ntv.NestedBorrowedFields.fields(returnVal, this.fields.toNative(arena)); - dev.diplomattest.somelib.ntv.NestedBorrowedFields.bounds(returnVal, this.bounds.toNative(arena)); - dev.diplomattest.somelib.ntv.NestedBorrowedFields.bounds2(returnVal, this.bounds2.toNative(arena)); + var fieldsNative = fields.toNative(arena); + dev.diplomattest.somelib.ntv.NestedBorrowedFields.fields(returnVal, fieldsNative); + var boundsNative = bounds.toNative(arena); + dev.diplomattest.somelib.ntv.NestedBorrowedFields.bounds(returnVal, boundsNative); + var bounds2Native = bounds2.toNative(arena); + dev.diplomattest.somelib.ntv.NestedBorrowedFields.bounds2(returnVal, bounds2Native); return returnVal; @@ -58,37 +64,34 @@ MemorySegment toNative(SegmentAllocator arena) { public static NestedBorrowedFields fromBarAndFooAndStrings(Bar bar,Foo foo,String dstr16X,String dstr16Z,String utf8StrY,String utf8StrZ) { try (var arena = Arena.ofConfined()) { - var returnArena = (SegmentAllocator) Arena.ofAuto(); + var barNative = bar.internal; var fooNative = foo.internal; - var dstr16XData= arena.allocateFrom(dstr16X, StandardCharsets.UTF_16); + var dstr16XData = Arena.ofAuto().allocateFrom(dstr16X, StandardCharsets.UTF_16); var dstr16XLen = dstr16XData.byteSize() - 1; // allocated strings are null terminated - var dstr16XView = DiplomatString16View.allocate(arena); + var dstr16XView = DiplomatString16View.allocate(Arena.ofAuto()); DiplomatString16View.len(dstr16XView, dstr16XLen); DiplomatString16View.data(dstr16XView, dstr16XData); - var dstr16ZData= arena.allocateFrom(dstr16Z, StandardCharsets.UTF_16); + var dstr16ZData = Arena.ofAuto().allocateFrom(dstr16Z, StandardCharsets.UTF_16); var dstr16ZLen = dstr16ZData.byteSize() - 1; // allocated strings are null terminated - var dstr16ZView = DiplomatString16View.allocate(arena); + var dstr16ZView = DiplomatString16View.allocate(Arena.ofAuto()); DiplomatString16View.len(dstr16ZView, dstr16ZLen); DiplomatString16View.data(dstr16ZView, dstr16ZData); - var utf8StrYData= arena.allocateFrom(utf8StrY, StandardCharsets.UTF_8); - var utf8StrYLen = utf8StrYData.byteSize() - 1; - var utf8StrYView = DiplomatStringView.allocate(arena); + var utf8StrYData= Arena.ofAuto().allocateFrom(utf8StrY, StandardCharsets.UTF_8); + var utf8StrYLen = utf8StrYData.byteSize() - 1; // allocated strings are null terminated + var utf8StrYView = DiplomatStringView.allocate(Arena.ofAuto()); DiplomatStringView.len(utf8StrYView, utf8StrYLen); DiplomatStringView.data(utf8StrYView, utf8StrYData); - var utf8StrZData= arena.allocateFrom(utf8StrZ, StandardCharsets.UTF_8); - var utf8StrZLen = utf8StrZData.byteSize() - 1; - var utf8StrZView = DiplomatStringView.allocate(arena); + var utf8StrZData= Arena.ofAuto().allocateFrom(utf8StrZ, StandardCharsets.UTF_8); + var utf8StrZLen = utf8StrZData.byteSize() - 1; // allocated strings are null terminated + var utf8StrZView = DiplomatStringView.allocate(Arena.ofAuto()); DiplomatStringView.len(utf8StrZView, utf8StrZLen); DiplomatStringView.data(utf8StrZView, utf8StrZData); - var nativeVal = somelib_h.NestedBorrowedFields_from_bar_and_foo_and_strings(returnArena, barNative, fooNative, dstr16XView, dstr16ZView, utf8StrYView, utf8StrZView); - - List xEdges = List.of(bar, dstr16X, utf8StrY); - List yEdges = List.of(bar, utf8StrY); - List zEdges = List.of(foo, dstr16Z, utf8StrZ); + var nativeVal = somelib_h.NestedBorrowedFields_from_bar_and_foo_and_strings(arena, barNative, fooNative, dstr16XView, dstr16ZView, utf8StrYView, utf8StrZView); - var returnVal = new NestedBorrowedFields(returnArena, nativeVal, xEdges, yEdges, zEdges); + var returnVal = new NestedBorrowedFields(nativeVal, List.of(bar, dstr16X, utf8StrY), List.of(bar, utf8StrY), List.of(foo, dstr16Z, utf8StrZ)); return returnVal; + } } diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/One.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/One.java index 7b1b243d2..0e84f6675 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/One.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/One.java @@ -16,6 +16,7 @@ public class One { MemorySegment internal; Cleaner.Cleanable cleanable; + SegmentAllocator arena; List selfEdges = List.of(); List aEdges = List.of(); @@ -47,15 +48,15 @@ public static One transitivity(One hold,One nohold) { var holdNative = hold.internal; var noholdNative = nohold.internal; var nativeVal = somelib_h.One_transitivity(holdNative, noholdNative); + List selfEdges = List.of(); List aEdges = List.of(hold); var returnVal = new One(nativeVal, selfEdges, aEdges); - var cleaner = new One.OneCleaner(nativeVal); - returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; + } public static One cycle(Two hold,One nohold) { @@ -63,15 +64,15 @@ public static One cycle(Two hold,One nohold) { var holdNative = hold.internal; var noholdNative = nohold.internal; var nativeVal = somelib_h.One_cycle(holdNative, noholdNative); + List selfEdges = List.of(); List aEdges = List.of(hold); var returnVal = new One(nativeVal, selfEdges, aEdges); - var cleaner = new One.OneCleaner(nativeVal); - returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; + } public static One manyDependents(One a,One b,Two c,Two d,Two nohold) { @@ -82,15 +83,15 @@ public static One manyDependents(One a,One b,Two c,Two d,Two nohold) { var dNative = d.internal; var noholdNative = nohold.internal; var nativeVal = somelib_h.One_many_dependents(aNative, bNative, cNative, dNative, noholdNative); + List selfEdges = List.of(); List aEdges = List.of(a, b, c, d); var returnVal = new One(nativeVal, selfEdges, aEdges); - var cleaner = new One.OneCleaner(nativeVal); - returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; + } public static One returnOutlivesParam(Two hold,One nohold) { @@ -98,15 +99,15 @@ public static One returnOutlivesParam(Two hold,One nohold) { var holdNative = hold.internal; var noholdNative = nohold.internal; var nativeVal = somelib_h.One_return_outlives_param(holdNative, noholdNative); + List selfEdges = List.of(); List longEdges = List.of(hold); var returnVal = new One(nativeVal, selfEdges, longEdges); - var cleaner = new One.OneCleaner(nativeVal); - returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; + } public static One diamondTop(One top,One left,One right,One bottom) { @@ -116,15 +117,15 @@ public static One diamondTop(One top,One left,One right,One bottom) { var rightNative = right.internal; var bottomNative = bottom.internal; var nativeVal = somelib_h.One_diamond_top(topNative, leftNative, rightNative, bottomNative); + List selfEdges = List.of(); List topEdges = List.of(top, left, right, bottom); var returnVal = new One(nativeVal, selfEdges, topEdges); - var cleaner = new One.OneCleaner(nativeVal); - returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; + } public static One diamondLeft(One top,One left,One right,One bottom) { @@ -134,15 +135,15 @@ public static One diamondLeft(One top,One left,One right,One bottom) { var rightNative = right.internal; var bottomNative = bottom.internal; var nativeVal = somelib_h.One_diamond_left(topNative, leftNative, rightNative, bottomNative); + List selfEdges = List.of(); List leftEdges = List.of(left, bottom); var returnVal = new One(nativeVal, selfEdges, leftEdges); - var cleaner = new One.OneCleaner(nativeVal); - returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; + } public static One diamondRight(One top,One left,One right,One bottom) { @@ -152,15 +153,15 @@ public static One diamondRight(One top,One left,One right,One bottom) { var rightNative = right.internal; var bottomNative = bottom.internal; var nativeVal = somelib_h.One_diamond_right(topNative, leftNative, rightNative, bottomNative); + List selfEdges = List.of(); List rightEdges = List.of(right, bottom); var returnVal = new One(nativeVal, selfEdges, rightEdges); - var cleaner = new One.OneCleaner(nativeVal); - returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; + } public static One diamondBottom(One top,One left,One right,One bottom) { @@ -170,15 +171,15 @@ public static One diamondBottom(One top,One left,One right,One bottom) { var rightNative = right.internal; var bottomNative = bottom.internal; var nativeVal = somelib_h.One_diamond_bottom(topNative, leftNative, rightNative, bottomNative); + List selfEdges = List.of(); List bottomEdges = List.of(bottom); var returnVal = new One(nativeVal, selfEdges, bottomEdges); - var cleaner = new One.OneCleaner(nativeVal); - returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; + } public static One diamondAndNestedTypes(One a,One b,One c,One d,One nohold) { @@ -189,15 +190,15 @@ public static One diamondAndNestedTypes(One a,One b,One c,One d,One nohold) { var dNative = d.internal; var noholdNative = nohold.internal; var nativeVal = somelib_h.One_diamond_and_nested_types(aNative, bNative, cNative, dNative, noholdNative); + List selfEdges = List.of(); List aEdges = List.of(a, b, c, d); var returnVal = new One(nativeVal, selfEdges, aEdges); - var cleaner = new One.OneCleaner(nativeVal); - returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; + } public static One implicitBounds(One explicitHold,One implicitHold,One nohold) { @@ -206,15 +207,15 @@ public static One implicitBounds(One explicitHold,One implicitHold,One nohold) { var implicitHoldNative = implicitHold.internal; var noholdNative = nohold.internal; var nativeVal = somelib_h.One_implicit_bounds(explicitHoldNative, implicitHoldNative, noholdNative); + List selfEdges = List.of(); List aEdges = List.of(explicitHold, implicitHold); var returnVal = new One(nativeVal, selfEdges, aEdges); - var cleaner = new One.OneCleaner(nativeVal); - returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; + } public static One implicitBoundsDeep(One explicit,One implicit1,One implicit2,One nohold) { @@ -224,15 +225,15 @@ public static One implicitBoundsDeep(One explicit,One implicit1,One implicit2,On var implicit2Native = implicit2.internal; var noholdNative = nohold.internal; var nativeVal = somelib_h.One_implicit_bounds_deep(explicitNative, implicit1Native, implicit2Native, noholdNative); + List selfEdges = List.of(); List aEdges = List.of(explicit, implicit1, implicit2); var returnVal = new One(nativeVal, selfEdges, aEdges); - var cleaner = new One.OneCleaner(nativeVal); - returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; + } diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Opaque.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Opaque.java index e2024deaa..f5f4b0ad9 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Opaque.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Opaque.java @@ -16,6 +16,7 @@ public class Opaque { MemorySegment internal; Cleaner.Cleanable cleanable; + SegmentAllocator arena; List selfEdges = List.of(); @@ -43,56 +44,64 @@ public void run() { public static Opaque new_() { var nativeVal = somelib_h.Opaque_new(); + List selfEdges = List.of(); var returnVal = new Opaque(nativeVal, selfEdges); - var cleaner = new Opaque.OpaqueCleaner(nativeVal); - returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; + } public static Opaque fromStr(String input) { try (var arena = Arena.ofConfined()) { - var inputData= arena.allocateFrom(input, StandardCharsets.UTF_8); - var inputLen = inputData.byteSize() - 1; - var inputView = DiplomatStringView.allocate(arena); + var inputData= Arena.ofAuto().allocateFrom(input, StandardCharsets.UTF_8); + var inputLen = inputData.byteSize() - 1; // allocated strings are null terminated + var inputView = DiplomatStringView.allocate(Arena.ofAuto()); DiplomatStringView.len(inputView, inputLen); DiplomatStringView.data(inputView, inputData); var nativeVal = somelib_h.Opaque_from_str(inputView); + List selfEdges = List.of(); var returnVal = new Opaque(nativeVal, selfEdges); - var cleaner = new Opaque.OpaqueCleaner(nativeVal); - returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; + } } public static long returnsUsize() { var nativeVal = somelib_h.Opaque_returns_usize(); - return nativeVal; + + var returnVal = nativeVal; + return returnVal; + } public static ImportedStruct returnsImported() { - var returnArena = (SegmentAllocator) Arena.ofAuto(); - var nativeVal = somelib_h.Opaque_returns_imported(returnArena); - - - var returnVal = new ImportedStruct(returnArena, nativeVal); - return returnVal; + try (var arena = Arena.ofConfined()) { + + var nativeVal = somelib_h.Opaque_returns_imported(arena); + + var returnVal = new ImportedStruct(nativeVal); + return returnVal; + + } } public static byte cmp() { var nativeVal = somelib_h.Opaque_cmp(); - return nativeVal; + + var returnVal = nativeVal; + return returnVal; + } @@ -108,19 +117,20 @@ public String getDebugStr() { public void assertStruct(MyStruct s) { - try (var arena = Arena.ofConfined()) { - - var sNative = s.toNative(arena); - somelib_h.Opaque_assert_struct(internal, sNative); - - } + + var sNative = s.toNative(Arena.ofAuto()); + somelib_h.Opaque_assert_struct(internal, sNative); + } public long internalLen() { var nativeVal = somelib_h.Opaque_internal_len(internal); - return nativeVal; + + var returnVal = nativeVal; + return returnVal; + } } \ No newline at end of file diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/OpaqueMutexedString.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/OpaqueMutexedString.java index c07f2dcf7..3c13bbc95 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/OpaqueMutexedString.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/OpaqueMutexedString.java @@ -16,6 +16,7 @@ public class OpaqueMutexedString { MemorySegment internal; Cleaner.Cleanable cleanable; + SegmentAllocator arena; List selfEdges = List.of(); @@ -44,27 +45,28 @@ public static OpaqueMutexedString fromUsize(long number) { var numberNative = number; var nativeVal = somelib_h.OpaqueMutexedString_from_usize(numberNative); + List selfEdges = List.of(); var returnVal = new OpaqueMutexedString(nativeVal, selfEdges); - var cleaner = new OpaqueMutexedString.OpaqueMutexedStringCleaner(nativeVal); - returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; + } public static OpaqueMutexedString borrowOther(OpaqueMutexedString other) { var otherNative = other.internal; var nativeVal = somelib_h.OpaqueMutexedString_borrow_other(otherNative); + List selfEdges = List.of(other); var returnVal = new OpaqueMutexedString(nativeVal, selfEdges); - return returnVal; + } @@ -80,13 +82,14 @@ public OpaqueMutexedString borrow() { var nativeVal = somelib_h.OpaqueMutexedString_borrow(internal); + List selfEdges = List.of(this); var returnVal = new OpaqueMutexedString(nativeVal, selfEdges); - return returnVal; + } public OpaqueMutexedString borrowSelfOrOther(OpaqueMutexedString other) { @@ -94,13 +97,14 @@ public OpaqueMutexedString borrowSelfOrOther(OpaqueMutexedString other) { var otherNative = other.internal; var nativeVal = somelib_h.OpaqueMutexedString_borrow_self_or_other(internal, otherNative); + List selfEdges = List.of(this, other); var returnVal = new OpaqueMutexedString(nativeVal, selfEdges); - return returnVal; + } public long getLenAndAdd(long other) { @@ -108,7 +112,10 @@ public long getLenAndAdd(long other) { var otherNative = other; var nativeVal = somelib_h.OpaqueMutexedString_get_len_and_add(internal, otherNative); - return nativeVal; + + var returnVal = nativeVal; + return returnVal; + } public String dummyStr() { @@ -117,7 +124,10 @@ public String dummyStr() { var nativeVal = somelib_h.OpaqueMutexedString_dummy_str(arena, internal); - return SliceUtils.readUtf8(nativeVal); + + var returnVal = SliceUtils.readUtf8(nativeVal); + return returnVal; + } } @@ -125,14 +135,14 @@ public Utf16Wrap wrapper() { var nativeVal = somelib_h.OpaqueMutexedString_wrapper(internal); + List selfEdges = List.of(); var returnVal = new Utf16Wrap(nativeVal, selfEdges); - var cleaner = new Utf16Wrap.Utf16WrapCleaner(nativeVal); - returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; + } } \ No newline at end of file diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/RefList.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/RefList.java index be628362a..9a1864f83 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/RefList.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/RefList.java @@ -16,6 +16,7 @@ public class RefList { MemorySegment internal; Cleaner.Cleanable cleanable; + SegmentAllocator arena; List selfEdges = List.of(); List aEdges = List.of(); @@ -46,15 +47,15 @@ public static RefList node(RefListParameter data) { var dataNative = data.internal; var nativeVal = somelib_h.RefList_node(dataNative); + List selfEdges = List.of(); List bEdges = List.of(data); var returnVal = new RefList(nativeVal, selfEdges, bEdges); - var cleaner = new RefList.RefListCleaner(nativeVal); - returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; + } diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/RefListParameter.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/RefListParameter.java index 536ffa054..ab41826d9 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/RefListParameter.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/RefListParameter.java @@ -16,6 +16,7 @@ public class RefListParameter { MemorySegment internal; Cleaner.Cleanable cleanable; + SegmentAllocator arena; List selfEdges = List.of(); diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Two.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Two.java index c47af91c3..287eec493 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Two.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Two.java @@ -16,6 +16,7 @@ public class Two { MemorySegment internal; Cleaner.Cleanable cleanable; + SegmentAllocator arena; List selfEdges = List.of(); List aEdges = List.of(); diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Utf16Wrap.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Utf16Wrap.java index 04ae8cdeb..b498c809a 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Utf16Wrap.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/Utf16Wrap.java @@ -16,6 +16,7 @@ public class Utf16Wrap { MemorySegment internal; Cleaner.Cleanable cleanable; + SegmentAllocator arena; List selfEdges = List.of(); @@ -43,20 +44,20 @@ public void run() { public static Utf16Wrap fromUtf16(String input) { try (var arena = Arena.ofConfined()) { - var inputData= arena.allocateFrom(input, StandardCharsets.UTF_16); + var inputData = Arena.ofAuto().allocateFrom(input, StandardCharsets.UTF_16); var inputLen = inputData.byteSize() - 1; // allocated strings are null terminated - var inputView = DiplomatString16View.allocate(arena); + var inputView = DiplomatString16View.allocate(Arena.ofAuto()); DiplomatString16View.len(inputView, inputLen); DiplomatString16View.data(inputView, inputData); var nativeVal = somelib_h.Utf16Wrap_from_utf16(inputView); + List selfEdges = List.of(); var returnVal = new Utf16Wrap(nativeVal, selfEdges); - var cleaner = new Utf16Wrap.Utf16WrapCleaner(nativeVal); - returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; + } } @@ -77,7 +78,10 @@ public String borrowCont() { var nativeVal = somelib_h.Utf16Wrap_borrow_cont(arena, internal); - return SliceUtils.readUtf16(nativeVal); + + var returnVal = SliceUtils.readUtf16(nativeVal); + return returnVal; + } } diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java index 73c2bd620..baeacaee4 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java @@ -11744,6 +11744,64 @@ public static void RefListParameter_destroy(MemorySegment self) { } } + private static class Float64Vec_new { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + somelib_h.C_POINTER, + DiplomatF64View.layout() + ); + + public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * Float64Vec *Float64Vec_new(DiplomatF64View v) + * } + */ + public static FunctionDescriptor Float64Vec_new$descriptor() { + return Float64Vec_new.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * Float64Vec *Float64Vec_new(DiplomatF64View v) + * } + */ + public static MethodHandle Float64Vec_new$handle() { + return Float64Vec_new.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * Float64Vec *Float64Vec_new(DiplomatF64View v) + * } + */ + public static MemorySegment Float64Vec_new$address() { + return Float64Vec_new.ADDR; + } + + /** + * {@snippet lang=c : + * Float64Vec *Float64Vec_new(DiplomatF64View v) + * } + */ + public static MemorySegment Float64Vec_new(MemorySegment v) { + var mh$ = Float64Vec_new.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("Float64Vec_new", v); + } + return (MemorySegment)mh$.invokeExact(v); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + private static class Float64Vec_new_bool { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, @@ -12092,64 +12150,6 @@ public static MemorySegment Float64Vec_new_f64_be_bytes(MemorySegment v) { } } - private static class Float64Vec_new_from_owned { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - DiplomatF64ViewMut.layout() - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("Float64Vec_new_from_owned"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * Float64Vec *Float64Vec_new_from_owned(DiplomatF64ViewMut v) - * } - */ - public static FunctionDescriptor Float64Vec_new_from_owned$descriptor() { - return Float64Vec_new_from_owned.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * Float64Vec *Float64Vec_new_from_owned(DiplomatF64ViewMut v) - * } - */ - public static MethodHandle Float64Vec_new_from_owned$handle() { - return Float64Vec_new_from_owned.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * Float64Vec *Float64Vec_new_from_owned(DiplomatF64ViewMut v) - * } - */ - public static MemorySegment Float64Vec_new_from_owned$address() { - return Float64Vec_new_from_owned.ADDR; - } - - /** - * {@snippet lang=c : - * Float64Vec *Float64Vec_new_from_owned(DiplomatF64ViewMut v) - * } - */ - public static MemorySegment Float64Vec_new_from_owned(MemorySegment v) { - var mh$ = Float64Vec_new_from_owned.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("Float64Vec_new_from_owned", v); - } - return (MemorySegment)mh$.invokeExact(v); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - private static class Float64Vec_as_slice { public static final FunctionDescriptor DESC = FunctionDescriptor.of( DiplomatF64View.layout(), @@ -12613,64 +12613,6 @@ public static MemorySegment MyString_new_unsafe(MemorySegment v) { } } - private static class MyString_new_owned { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - somelib_h.C_POINTER, - DiplomatStringView.layout() - ); - - public static final MemorySegment ADDR = somelib_h.findOrThrow("MyString_new_owned"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * MyString *MyString_new_owned(DiplomatStringView v) - * } - */ - public static FunctionDescriptor MyString_new_owned$descriptor() { - return MyString_new_owned.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * MyString *MyString_new_owned(DiplomatStringView v) - * } - */ - public static MethodHandle MyString_new_owned$handle() { - return MyString_new_owned.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * MyString *MyString_new_owned(DiplomatStringView v) - * } - */ - public static MemorySegment MyString_new_owned$address() { - return MyString_new_owned.ADDR; - } - - /** - * {@snippet lang=c : - * MyString *MyString_new_owned(DiplomatStringView v) - * } - */ - public static MemorySegment MyString_new_owned(MemorySegment v) { - var mh$ = MyString_new_owned.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("MyString_new_owned", v); - } - return (MemorySegment)mh$.invokeExact(v); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - private static class MyString_new_from_first { public static final FunctionDescriptor DESC = FunctionDescriptor.of( somelib_h.C_POINTER, @@ -14435,13 +14377,13 @@ public static long __DARWIN_C_LEVEL() { } /** * {@snippet lang=c : - * #define __ASSERT_FILE_NAME "jextract$7847839858914727962.h" + * #define __ASSERT_FILE_NAME "jextract$8785474449644430005.h" * } */ public static MemorySegment __ASSERT_FILE_NAME() { class Holder { static final MemorySegment __ASSERT_FILE_NAME - = somelib_h.LIBRARY_ARENA.allocateFrom("jextract$7847839858914727962.h"); + = somelib_h.LIBRARY_ARENA.allocateFrom("jextract$8785474449644430005.h"); } return Holder.__ASSERT_FILE_NAME; } diff --git a/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/Float64VecTest.java b/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/Float64VecTest.java index 4e1363153..a0962a1d7 100644 --- a/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/Float64VecTest.java +++ b/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/Float64VecTest.java @@ -19,7 +19,7 @@ void testFloat64Vec() { assertEquals(dArray[i], outArray[i]); } - var newVec = Float64Vec.newFromOwned(dArray); + var newVec = Float64Vec.new_(dArray); var newArray = newVec.asSlice(); assertEquals(dArray.length, newArray.length); for (var i = 0; i < dArray.length; i++) { diff --git a/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/MyStringTest.java b/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/MyStringTest.java index 0672ea774..1e0d50166 100644 --- a/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/MyStringTest.java +++ b/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/MyStringTest.java @@ -14,12 +14,9 @@ void newFromFirst() { var str = "Hi There"; var str1 = "Hi There 1"; var str2 = "Hi There 2"; - // var myStr0 = new MyString(str); - // assertEquals(myStr0.getStr(), str); var strs = new String[]{str, str1, str2}; var myStr = MyString.newFromFirst(strs); assertEquals(myStr.getStr(), str); - // assertEquals(myStr.getBoxedStr(), str); } } \ No newline at end of file diff --git a/feature_tests/src/slices.rs b/feature_tests/src/slices.rs index 9f69ab29b..6a6536b2d 100644 --- a/feature_tests/src/slices.rs +++ b/feature_tests/src/slices.rs @@ -17,6 +17,7 @@ mod ffi { Box::new(Self(v.to_string())) } + #[diplomat::attr(supports = memory_sharing, disable)] pub fn new_owned(v: Box) -> Box { Box::new(Self(String::from_utf8(v.into()).unwrap())) } diff --git a/tool/src/java/mod.rs b/tool/src/java/mod.rs index 5dfc6f2af..51bf1a553 100644 --- a/tool/src/java/mod.rs +++ b/tool/src/java/mod.rs @@ -1,17 +1,15 @@ use std::fs::File; use std::io::Write; -use std::marker::PhantomData; use std::path::Path; use std::{borrow::Cow, iter::once}; use askama::Template; -use diplomat_core::hir::borrowing_param::{ - BorrowingParamVisitor, ParamBorrowInfo, StructBorrowInfo, -}; +use diplomat_core::hir::borrowing_param::BorrowingParamVisitor; use diplomat_core::hir::{ - self, BackendAttrSupport, EnumDef, EnumVariant, FloatType, IntSizeType, IntType, MaybeOwn, - MaybeStatic, Method, OpaqueDef, OpaqueOwner, OpaquePath, ReturnType, Slice, SpecialMethod, - StringEncoding, StructDef, StructPathLike, SuccessType, TyPosition, TypeContext, TypeDef, + self, BackendAttrSupport, EnumDef, EnumVariant, FloatType, IntSizeType, IntType, LifetimeEnv, + MaybeOwn, MaybeStatic, Method, OpaqueDef, OpaqueOwner, OpaquePath, ReturnType, Slice, + SpecialMethod, StringEncoding, StructDef, StructPathLike, SuccessType, TyPosition, TypeContext, + TypeDef, }; use formatter::JavaFormatter; use heck::ToUpperCamelCase; @@ -31,7 +29,7 @@ mod formatter; pub(crate) fn attr_support() -> BackendAttrSupport { let mut a = BackendAttrSupport::default(); a.namespacing = false; // TODO - a.memory_sharing = false; + a.memory_sharing = true; a.non_exhaustive_structs = true; a.method_overloading = false; a.utf8_strings = false; @@ -46,7 +44,6 @@ pub(crate) fn attr_support() -> BackendAttrSupport { a.iterators = false; // TODO a.iterables = false; // TODO a.indexing = false; - a } @@ -283,7 +280,6 @@ pub(crate) struct StructTypeTpl<'a> { #[derive(Clone, Debug)] struct FieldTpl<'a> { name: Cow<'a, str>, - field_val: Cow<'a, str>, native_name: Cow<'a, str>, to_native: Conversion<'a>, to_java: Conversion<'a>, @@ -337,7 +333,6 @@ pub(crate) struct StructConversionTpl<'a> { pub(crate) struct OpaqueConversionTpl<'a> { name: Cow<'a, str>, lifetimes: Vec>, - owned_return: bool, self_edges: Option>, ty: Cow<'a, str>, native_val: Cow<'a, str>, @@ -369,7 +364,7 @@ struct Conversion<'cx> { } mod arena { - use std::{borrow::Cow, fmt::Display}; + use std::{fmt::Display, marker::PhantomData}; pub type Render<'cx> = Box) -> Conversion<'cx> + 'cx>; const UNIT: &() = &(); @@ -402,23 +397,18 @@ mod arena { pub enum Arena<'cx> { Closed, - Struct { name: Cow<'cx, str> }, + Owned, Auto, + Phantom(&'cx ()), } impl<'cx> Display for Arena<'cx> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { Arena::Closed => write!(f, "arena"), - Arena::Struct { name } => write!(f, "{name}.arena"), + Arena::Owned => write!(f, "ownedArena"), Arena::Auto => write!(f, "Arena.ofAuto()"), - } - } - } - impl<'cx> From<&diplomat_core::hir::StructDef> for Arena<'cx> { - fn from(value: &diplomat_core::hir::StructDef) -> Self { - Arena::Struct { - name: value.name.as_str().to_string().into(), + Arena::Phantom(_) => write!(f, "phantom"), } } } @@ -440,14 +430,14 @@ impl<'a, 'cx> TyGenContext<'a, 'cx> { hir::Type::Primitive(_) => { let converted_value: Cow<'cx, str> = format!("{name}Native").into(); AllocateConversion::NotAllocating(Conversion { - conversion: format!("var {converted_value} = {name}").into(), + conversion: format!("var {converted_value} = {name};").into(), converted_value, }) } hir::Type::Opaque(_) => { let converted_value: Cow<'cx, str> = format!("{name}Native").into(); AllocateConversion::NotAllocating(Conversion { - conversion: format!("var {converted_value} = {name}.inner").into(), + conversion: format!("var {converted_value} = {name}.internal;").into(), converted_value, }) } @@ -455,7 +445,7 @@ impl<'a, 'cx> TyGenContext<'a, 'cx> { let clos = move |arena| -> Conversion<'cx> { let converted_value: Cow<'cx, str> = format!("{name}Native").into(); Conversion { - conversion: format!("var {converted_value} = {name}.toNative({arena})") + conversion: format!("var {converted_value} = {name}.toNative({arena});") .into(), converted_value: format!("{name}Native").into(), } @@ -465,15 +455,18 @@ impl<'a, 'cx> TyGenContext<'a, 'cx> { hir::Type::Enum(_) => { let converted_value: Cow<'cx, str> = format!("{name}Native").into(); AllocateConversion::NotAllocating(Conversion { - conversion: format!("var {converted_value} = {name}.toInt()").into(), + conversion: format!("var {converted_value} = {name}.toInt();").into(), converted_value, }) } hir::Type::Slice(Slice::Str(borrow, StringEncoding::UnvalidatedUtf16)) => { + if borrow.is_none() { + panic!("Don't support owned slices. Parameter name: {name}") + }; let clos = move |arena| -> Conversion<'cx> { let converted_value: Cow<'cx, str> = format!("{name}View").into(); let conversion: Cow<'cx, str> = format!( - r#"var {name}Data= {arena}.allocateFrom({name}, StandardCharsets.UTF_16); + r#"var {name}Data = {arena}.allocateFrom({name}, StandardCharsets.UTF_16); var {name}Len = {name}Data.byteSize() - 1; // allocated strings are null terminated var {name}View = DiplomatString16View.allocate({arena}); DiplomatString16View.len({name}View, {name}Len); @@ -491,24 +484,63 @@ DiplomatString16View.data({name}View, {name}Data);"# borrow, StringEncoding::Utf8 | StringEncoding::UnvalidatedUtf8, )) => { + if borrow.is_none() { + panic!("Don't support owned slices. Parameter name: {name}") + }; let clos = move |arena| -> Conversion<'cx> { let converted_value: Cow<'cx, str> = format!("{name}View").into(); let conversion: Cow<'cx, str> = format!( r#"var {name}Data= {arena}.allocateFrom({name}, StandardCharsets.UTF_8); var {name}Len = {name}Data.byteSize() - 1; // allocated strings are null terminated -var {name}View = DiplomatString8View.allocate({arena}); -DiplomatString8View.len({name}View, {name}Len); -DiplomatString8View.data({name}View, {name}Data);"# +var {name}View = DiplomatStringView.allocate({arena}); +DiplomatStringView.len({name}View, {name}Len); +DiplomatStringView.data({name}View, {name}Data);"# + ) + .into(); + Conversion { + conversion, + converted_value, + } + }; + AllocateConversion::Allocating(arena::AllocationConversion::dynamic(clos)) + } + + hir::Type::Slice(Slice::Strs(StringEncoding::UnvalidatedUtf16)) => { + let clos = move |arena| { + let conversion = format!( + r#"var {name}View = SliceUtils.strs16({arena}, {name}); + var {name}Len = {name}.length;"# + ) + .into(); + let converted_value = format!("{name}View").into(); + Conversion { + conversion, + converted_value, + } + }; + + AllocateConversion::Allocating(arena::AllocationConversion::dynamic(clos)) + } + hir::Type::Slice(Slice::Strs(_)) => { + let clos = move |arena| { + let conversion = format!( + r#"var {name}View = SliceUtils.strs8({arena}, {name}); + var {name}Len = {name}.length;"# ) .into(); + let converted_value = format!("{name}View").into(); Conversion { conversion, converted_value, } }; + AllocateConversion::Allocating(arena::AllocationConversion::dynamic(clos)) } hir::Type::Slice(Slice::Primitive(borrow, p)) => { + if borrow.is_none() { + panic!("Don't support owned slices. Parameter name: {name}") + }; let rust_primitive_type = match p { hir::PrimitiveType::Byte => "U8".to_string(), _ => p.as_str().to_upper_camel_case(), @@ -562,23 +594,15 @@ Diplomat{rust_primitive_type}View.data({name}View, {name}Data); converted_value, } }; - - match borrow { - Some(_) => { - AllocateConversion::Allocating(arena::AllocationConversion::dynamic(clos)) - } - None => AllocateConversion::NotAllocating(clos(arena::Arena::Closed)), - } + AllocateConversion::Allocating(arena::AllocationConversion::dynamic(clos)) } hir::Type::Callback(_) => { - // todo todo!("We don't support callbacks yet") } hir::Type::DiplomatOption(_) => { - // todo todo!("We don't support options yet") } - _ => todo!(), + param => todo!("Don't support {param:?} yet"), } } @@ -587,17 +611,17 @@ Diplomat{rust_primitive_type}View.data({name}View, {name}Data); name: Cow<'cx, str>, native_val: Cow<'cx, str>, ty: &diplomat_core::hir::Type, - lifetimes: Vec, + lifetimes: Vec>, return_self_edges: Option>, - ) -> Conversion<'cx> { + ) -> AllocateConversion<'cx, arena::Render<'cx>> { match ty { hir::Type::Primitive(_) => { let converted_value = format!("{name}Val").into(); let conversion = format!("var {name}Val = {native_val};").into(); - Conversion { + AllocateConversion::NotAllocating(Conversion { conversion, converted_value, - } + }) } hir::Type::Opaque(o) => { let converted_value = format!("{name}Val").into(); @@ -607,7 +631,6 @@ Diplomat{rust_primitive_type}View.data({name}View, {name}Data); name: "return".into(), lifetimes, ty: ty_name.as_str().into(), - owned_return, self_edges: return_self_edges, native_val, } @@ -620,57 +643,64 @@ Diplomat{rust_primitive_type}View.data({name}View, {name}Data); }) .into(); - Conversion { + AllocateConversion::NotAllocating(Conversion { conversion, converted_value, - } + }) } hir::Type::Struct(s) => { - let ty_name = &self.tcx.resolve_type(s.id()).name(); - let converted_value = format!("{name}Val").into(); - let conversion = StructConversionTpl { - lifetimes, - ty: ty_name.as_str().into(), - name, - native_val, - } - .render() - .unwrap_or_else(|err| { - panic!("Failed to render return val for type {ty_name}. Cause: {err}") - }) - .into(); - Conversion { - conversion, - converted_value, - } + let id = s.id(); + let ty_name = self.tcx.resolve_type(id).name(); + let clos = move |arena| { + let lifetimes = lifetimes.clone(); + let name = name.clone(); + let native_val = native_val.clone(); + let converted_value = format!("{name}Val").into(); + let conversion = StructConversionTpl { + lifetimes, + ty: ty_name.as_str().into(), + name, + native_val, + } + .render() + .unwrap_or_else(|err| { + panic!("Failed to render return val for type {ty_name}. Cause: {err}") + }) + .into(); + Conversion { + conversion, + converted_value, + } + }; + AllocateConversion::Allocating(arena::AllocationConversion::dynamic(clos)) } hir::Type::Enum(e) => { let converted_value = format!("{name}Val").into(); let enum_ty = self.tcx.resolve_enum(e.tcx_id).name.as_str(); let conversion = format!(r#"var {name}Val = {enum_ty}.fromInt({native_val});"#).into(); - Conversion { + AllocateConversion::NotAllocating(Conversion { conversion, converted_value, - } + }) } hir::Type::Slice(Slice::Str(_, encoding)) => { let conversion = match encoding { StringEncoding::Utf8 | StringEncoding::UnvalidatedUtf8 => { - format!("{name}Val = SliceUtils.readUtf8({native_val});") + format!("var {name}Val = SliceUtils.readUtf8({native_val});") } StringEncoding::UnvalidatedUtf16 => { - format!("{name}Val = SliceUtils.readUtf16({native_val});") + format!("var {name}Val = SliceUtils.readUtf16({native_val});") } _ => unreachable!("Not a valid string encoding for diplomat"), } .into(); let converted_value = format!("{name}Val").into(); - Conversion { + AllocateConversion::NotAllocating(Conversion { conversion, converted_value, - } + }) } hir::Type::Slice(Slice::Primitive(_, p)) => { let lib_name = self.tcx_config.lib_name.as_ref(); @@ -700,13 +730,13 @@ Diplomat{rust_primitive_type}View.data({name}View, {name}Data); let conversion = format!( r#"var data = {domain}.{lib_name}.ntv.Diplomat{primitive_ty}View.data({native_val}); var len = {domain}.{lib_name}.ntv.Diplomat{primitive_ty}View.len({native_val}); -return SliceUtils.{java_primitive_ty}SliceToArray({native_val});"# +var returnVal = SliceUtils.{java_primitive_ty}SliceToArray({native_val});"# ).into(); let converted_value = format!("{name}Val").into(); - Conversion { + AllocateConversion::NotAllocating(Conversion { conversion, converted_value, - } + }) } hir::Type::Slice(Slice::Strs(_)) => { panic!("[&str] not allowed in return position") @@ -717,122 +747,12 @@ return SliceUtils.{java_primitive_ty}SliceToArray({native_val});"# } } - fn gen_slice_return_conversion(&self, ty: &Slice) -> Result, String> { - let return_conversion: Cow<'cx, str> = match ty { - Slice::Str(_, encoding) => match encoding { - StringEncoding::Utf8 | StringEncoding::UnvalidatedUtf8 => { - "return SliceUtils.readUtf8(nativeVal);" - } - StringEncoding::UnvalidatedUtf16 => "return SliceUtils.readUtf16(nativeVal);", - _ => unreachable!("Not a valid string encoding for diplomat"), - } - .into(), - Slice::Primitive(_, p) => { - let lib_name = self.tcx_config.lib_name.as_ref(); - let domain = self.tcx_config.domain.as_ref(); - let primitive_ty = match p { - hir::PrimitiveType::Bool => "Bool", - hir::PrimitiveType::Char => "Char", - hir::PrimitiveType::Byte => "U8", - hir::PrimitiveType::Int(IntType::U8) => "U8", - hir::PrimitiveType::Int(IntType::I8) => "I8", - hir::PrimitiveType::Int(IntType::U16) => "U16", - hir::PrimitiveType::Int(IntType::I16) => "I16", - hir::PrimitiveType::Int(IntType::U32) => "U32", - hir::PrimitiveType::Int(IntType::I32) => "I32", - hir::PrimitiveType::Int(IntType::U64) => "U64", - hir::PrimitiveType::Int(IntType::I64) => "I64", - hir::PrimitiveType::IntSize(IntSizeType::Usize) => "Usize", - hir::PrimitiveType::IntSize(IntSizeType::Isize) => "Isize", - hir::PrimitiveType::Int128(_) => { - panic!("Java backend doesn't support Int128 types") - } - hir::PrimitiveType::Float(FloatType::F32) => "F32", - hir::PrimitiveType::Float(FloatType::F64) => "F64", - }; - - let java_primitive_ty = self.formatter.fmt_native_primitive(p); - format!( - r#"var data = {domain}.{lib_name}.ntv.Diplomat{primitive_ty}View.data(nativeVal); -var len = {domain}.{lib_name}.ntv.Diplomat{primitive_ty}View.len(nativeVal); -return SliceUtils.{java_primitive_ty}SliceToArray(nativeVal);"# - ) - .into() - } - Slice::Strs(_) => { - panic!("[&str] not allowed in return position") - } - _ => todo!(), - }; - Ok(return_conversion) - } - - fn gen_native_to_java_conversion( - &self, - o: &hir::Type, - lifetimes: Vec, - return_self_edges: Option>, - ) -> Result, String> { - let conversion = match o { - hir::Type::Primitive(_) => "return nativeVal;".into(), - hir::Type::Opaque(o) => { - let owned_return: bool = o.owner.is_owned(); - let ty_name = &self.tcx.resolve_opaque(o.tcx_id).name; - let conversion = OpaqueConversionTpl { - name: "return".into(), - lifetimes, - ty: ty_name.as_str().into(), - owned_return, - self_edges: return_self_edges, - native_val: "nativeVal".into(), - } - .render() - .unwrap_or_else(|err| { - panic!( - "Failed to render return val for type {}. Cause: {err}", - ty_name - ) - }); - - format!( - r#"{conversion} -return returnVal;"# - ) - .into() - } - hir::Type::Struct(s) => { - let ty_name = &self.tcx.resolve_type(s.id()).name(); - let conversion = StructConversionTpl { - lifetimes, - ty: ty_name.as_str().into(), - name: "return".into(), - native_val: "nativeVal".into(), - } - .render() - .unwrap_or_else(|err| { - panic!("Failed to render return val for type {ty_name}. Cause: {err}") - }); - format!( - r#"{conversion} -return returnVal;"# - ) - .into() - } - hir::Type::Enum(e) => { - let enum_ty = self.tcx.resolve_enum(e.tcx_id).name.as_str(); - format!(r#"return {enum_ty}.fromInt(nativeVal);"#).into() - } - hir::Type::Slice(ref slice) => self.gen_slice_return_conversion(slice)?, - unknown => panic!("Got to unknown return type: {unknown:?}"), - }; - Ok(conversion) - } - fn gen_return_conversion( &self, ty: &ReturnType, - lifetimes: Vec, + lifetimes: Vec>, return_self_edges: Option>, + allocations: &mut bool, ) -> Cow<'cx, str> { let Config { lib_name, .. } = &self.tcx_config; let ret = match ty { @@ -867,15 +787,22 @@ return string;"#, let Conversion { conversion, converted_value, - } = self.native_to_java( + } = match self.native_to_java( "return".into(), "nativeVal".into(), o, lifetimes, return_self_edges, - ); + ) { + AllocateConversion::NotAllocating(conv) => conv, + AllocateConversion::Allocating(needs_arena) => { + *allocations = true; + needs_arena.render(arena::Arena::Closed) + } + }; format!( - r#"{conversion} + r#" +{conversion} return {converted_value}; "# ) @@ -930,8 +857,26 @@ return {converted_value}; } = match self.java_to_native(name.clone(), ty) { AllocateConversion::NotAllocating(conversion) => conversion, AllocateConversion::Allocating(conversion_clos) => { - allocations = true; - conversion_clos.render(arena::Arena::Closed) + match param_lt_info { + hir::borrowing_param::ParamBorrowInfo::NotBorrowed => { + conversion_clos.render(arena::Arena::Auto) + } + hir::borrowing_param::ParamBorrowInfo::TemporarySlice => { + conversion_clos.render(arena::Arena::Auto) + } + hir::borrowing_param::ParamBorrowInfo::BorrowedSlice => { + conversion_clos.render(arena::Arena::Auto) + } + hir::borrowing_param::ParamBorrowInfo::Struct(_) => { + allocations = true; + conversion_clos.render(arena::Arena::Closed) + } + hir::borrowing_param::ParamBorrowInfo::BorrowedOpaque => { + allocations = true; + conversion_clos.render(arena::Arena::Closed) + } + _ => todo!(), + } } }; let conversion = ParamConversion { @@ -1031,7 +976,12 @@ return {converted_value}; }) .into() } else { - self.gen_return_conversion(&method.output, lifetime_edges, return_self_edges) + self.gen_return_conversion( + &method.output, + lifetime_edges, + return_self_edges, + &mut allocations, + ) }; let allocations = allocations || method @@ -1159,19 +1109,12 @@ return {converted_value}; let native_name = field.name.as_str(); let native_val = format!("{domain}.{lib_name}.ntv.{type_name}.{native_name}(structSegment)"); - let (field_val, to_native): (_, Cow<'cx, str>) = match &field.ty { - hir::Type::Enum(ref enum_def) => ( - format!( - "{}.fromInt({native_val})", - self.tcx.resolve_enum(enum_def.tcx_id).name - ) - .into(), - format!("this.{name}.toInt()").into(), - ), + let lifetimes = match &field.ty { + hir::Type::Enum(ref enum_def) => vec![], hir::Type::Struct(struct_path) => { let ty_name = self.tcx.resolve_type(struct_path.id()).name().as_str(); let lt_env = &s.lifetimes; - let lt_edges = struct_path + struct_path .lifetimes() .lifetimes() .filter_map(|lt| match lt { @@ -1179,48 +1122,27 @@ return {converted_value}; MaybeStatic::NonStatic(lt) => Some(lt), }) .map(|lt| { - let lt_edges = lt_env + let edges = lt_env .all_longer_lifetimes(<) .map(|lt| lt_env.fmt_lifetime(lt)) - .map(|lt| format!("{lt}Edges")) - .collect::>(); - match lt_edges.len() { - 0 => "List.of()".into(), - 1 => lt_edges.join(", ").into(), - _ => format!( - "Stream.concat({}).toList()", - lt_edges - .iter() - .map(|edge| format!("{edge}.stream()")) - .mk_str_iter(", ") - ) - .into(), - } - }); - let args = once::>("arena".into()) - .chain(once(native_val.to_string().into())) - .chain(lt_edges) - .mk_str_iter(", "); + .map(|lt| format!("{lt}Edges").into()) + .collect(); - ( - format!("new {ty_name}({args})").into(), - format!("this.{name}.toNative(arena)").into(), - ) - } - hir::Type::Primitive(_) => { - (native_val.clone().into(), format!("this.{name}").into()) + LifetimeTpl { + name: lt_env.fmt_lifetime(lt), + edges, + } + }) + .collect() } + hir::Type::Primitive(_) => vec![], hir::Type::Slice(Slice::Str( _, StringEncoding::Utf8 | StringEncoding::UnvalidatedUtf8, - )) => ( - format!("SliceUtils.readUtf8({native_val})").into(), - format!("SliceUtils.strToUtf8Slice(arena, this.{name})").into(), - ), - hir::Type::Slice(Slice::Str(_, StringEncoding::UnvalidatedUtf16)) => ( - format!("SliceUtils.readUtf16({native_val})").into(), - format!("SliceUtils.strToUtf16Slice(arena, this.{name})").into(), - ), + )) => vec![], + hir::Type::Slice(Slice::Str(_, StringEncoding::UnvalidatedUtf16)) => { + vec![] + } hir::Type::Slice(_) => { todo!("Failed to generate field: {name} for struct {}", s.name) } @@ -1232,39 +1154,37 @@ return {converted_value}; }) => { let ty_name = self.tcx.resolve_opaque(*tcx_id).name.as_str(); let lt_env = &s.lifetimes; - let self_edges: Cow = match owner.lifetime() { - Some(MaybeStatic::Static) => "List.of()".into(), - Some(MaybeStatic::NonStatic(lt)) => { - let stream_edges = lt_env - .all_longer_lifetimes(lt) - .map(|lt| lt_env.fmt_lifetime(lt)) - .map(|lt| format!("{lt}Edges.stream()")) - .mk_str_iter(", "); - format!("Stream.concat({stream_edges}).toList()").into() - } - None => unreachable!("Struct cannot have owned opaque as field."), - }; - let lt_edges = lifetimes + // todo: fix + // let self_edges: Cow = match owner.lifetime() { + // Some(MaybeStatic::Static) => "List.of()".into(), + // Some(MaybeStatic::NonStatic(lt)) => { + // let stream_edges = lt_env + // .all_longer_lifetimes(lt) + // .map(|lt| lt_env.fmt_lifetime(lt)) + // .map(|lt| format!("{lt}Edges.stream()")) + // .mk_str_iter(", "); + // format!("Stream.concat({stream_edges}).toList()").into() + // } + // None => unreachable!("Struct cannot have owned opaque as field."), + // }; + lifetimes .lifetimes() .filter_map(|lt| match lt { MaybeStatic::Static => None, MaybeStatic::NonStatic(lt) => Some(lt), }) .map(|lt| { - let lt_edges = lt_env + let edges = lt_env .all_longer_lifetimes(<) .map(|lt| lt_env.fmt_lifetime(lt)) - .map(|lt| format!("{lt}Edges.stream()")) - .mk_str_iter(", "); - - format!("Stream.concat({lt_edges}).toList()") + .map(|lt| format!("{lt}Edges.stream()").into()) + .collect::>(); + LifetimeTpl { + name: lt_env.fmt_lifetime(lt), + edges, + } }) - .mk_str_iter(", "); - ( - format!("new {ty_name}(arena, {native_val}, {self_edges}, {lt_edges})") - .into(), - format!("this.{name}.inner").into(), - ) + .collect() } _ => todo!(), }; @@ -1273,18 +1193,22 @@ return {converted_value}; AllocateConversion::NotAllocating(conv) => conv, AllocateConversion::Allocating(clos) => clos.render(arena::Arena::Closed), }; - let to_java = self.native_to_java( + let to_java = match self.native_to_java( name.clone(), format!("{name}Native").into(), &field.ty, - vec![], + lifetimes, None, - ); + ) { + AllocateConversion::NotAllocating(conv) => conv, + AllocateConversion::Allocating(needs_arena) => { + needs_arena.render(arena::Arena::Closed) + } + }; FieldTpl { name, native_name: native_name.into(), ty, - field_val, to_java, to_native, } @@ -1410,10 +1334,6 @@ mod test { Box::new(Self(v.to_string())) } - pub fn new_owned(v: Box) -> Box { - Box::new(Self(String::from_utf8(v.into()).unwrap())) - } - #[diplomat::skip_if_ast] pub fn new_from_first<'a>(v: &[DiplomatStrSlice]) -> Box { Box::new(Self(core::str::from_utf8(v[0]).unwrap().into())) diff --git a/tool/src/java/snapshots/diplomat_tool__java__test__enum_and_struct.snap b/tool/src/java/snapshots/diplomat_tool__java__test__enum_and_struct.snap index 09f17d84a..3bb5075e5 100644 --- a/tool/src/java/snapshots/diplomat_tool__java__test__enum_and_struct.snap +++ b/tool/src/java/snapshots/diplomat_tool__java__test__enum_and_struct.snap @@ -25,26 +25,37 @@ public class MyStruct { MyEnum g; - SegmentAllocator arena; List selfEdges = List.of(); - private MyStruct(SegmentAllocator arena) { - this.arena = arena; + private MyStruct() { } - MyStruct(SegmentAllocator arena, MemorySegment structSegment) { - this.arena = arena; + MyStruct(MemorySegment structSegment) { this.selfEdges = selfEdges; - this.a = dev.diplomattest.somelib.ntv.MyStruct.a(structSegment); - this.b = dev.diplomattest.somelib.ntv.MyStruct.b(structSegment); - this.c = dev.diplomattest.somelib.ntv.MyStruct.c(structSegment); - this.d = dev.diplomattest.somelib.ntv.MyStruct.d(structSegment); - this.e = dev.diplomattest.somelib.ntv.MyStruct.e(structSegment); - this.f = dev.diplomattest.somelib.ntv.MyStruct.f(structSegment); - this.g = MyEnum.fromInt(dev.diplomattest.somelib.ntv.MyStruct.g(structSegment)); + var aNative = dev.diplomattest.somelib.ntv.MyStruct.a(structSegment); + var aVal = aNative; + this.a = aVal; + var bNative = dev.diplomattest.somelib.ntv.MyStruct.b(structSegment); + var bVal = bNative; + this.b = bVal; + var cNative = dev.diplomattest.somelib.ntv.MyStruct.c(structSegment); + var cVal = cNative; + this.c = cVal; + var dNative = dev.diplomattest.somelib.ntv.MyStruct.d(structSegment); + var dVal = dNative; + this.d = dVal; + var eNative = dev.diplomattest.somelib.ntv.MyStruct.e(structSegment); + var eVal = eNative; + this.e = eVal; + var fNative = dev.diplomattest.somelib.ntv.MyStruct.f(structSegment); + var fVal = fNative; + this.f = fVal; + var gNative = dev.diplomattest.somelib.ntv.MyStruct.g(structSegment); + var gVal = MyEnum.fromInt(gNative); + this.g = gVal; } @@ -52,13 +63,20 @@ public class MyStruct { MemorySegment toNative(SegmentAllocator arena) { var returnVal = dev.diplomattest.somelib.ntv.MyStruct.allocate(arena); - dev.diplomattest.somelib.ntv.MyStruct.a(returnVal, this.a); - dev.diplomattest.somelib.ntv.MyStruct.b(returnVal, this.b); - dev.diplomattest.somelib.ntv.MyStruct.c(returnVal, this.c); - dev.diplomattest.somelib.ntv.MyStruct.d(returnVal, this.d); - dev.diplomattest.somelib.ntv.MyStruct.e(returnVal, this.e); - dev.diplomattest.somelib.ntv.MyStruct.f(returnVal, this.f); - dev.diplomattest.somelib.ntv.MyStruct.g(returnVal, this.g.toInt()); + var aNative = a; + dev.diplomattest.somelib.ntv.MyStruct.a(returnVal, aNative); + var bNative = b; + dev.diplomattest.somelib.ntv.MyStruct.b(returnVal, bNative); + var cNative = c; + dev.diplomattest.somelib.ntv.MyStruct.c(returnVal, cNative); + var dNative = d; + dev.diplomattest.somelib.ntv.MyStruct.d(returnVal, dNative); + var eNative = e; + dev.diplomattest.somelib.ntv.MyStruct.e(returnVal, eNative); + var fNative = f; + dev.diplomattest.somelib.ntv.MyStruct.f(returnVal, fNative); + var gNative = g.toInt(); + dev.diplomattest.somelib.ntv.MyStruct.g(returnVal, gNative); return returnVal; @@ -67,12 +85,14 @@ public class MyStruct { public static MyStruct new_() { - var returnArena = (SegmentAllocator) Arena.ofAuto(); - var nativeVal = somelib_h.MyStruct_new(returnArena); - - - var returnVal = new MyStruct(returnArena, nativeVal); - return returnVal; + try (var arena = Arena.ofConfined()) { + + var nativeVal = somelib_h.MyStruct_new(arena); + + var returnVal = new MyStruct(nativeVal); + return returnVal; + + } } } @@ -154,7 +174,10 @@ public enum MyEnum { public static MyEnum getA() { var nativeVal = somelib_h.MyEnum_get_a(); - return MyEnum.fromInt(nativeVal); + + var returnVal = MyEnum.fromInt(nativeVal); + return returnVal; + } } diff --git a/tool/src/java/snapshots/diplomat_tool__java__test__lifetimes.snap b/tool/src/java/snapshots/diplomat_tool__java__test__lifetimes.snap index d06d5983b..c81353d58 100644 --- a/tool/src/java/snapshots/diplomat_tool__java__test__lifetimes.snap +++ b/tool/src/java/snapshots/diplomat_tool__java__test__lifetimes.snap @@ -21,24 +21,27 @@ public class BorrowedFields { String c; - SegmentAllocator arena; List selfEdges = List.of(); List aEdges = List.of(); - private BorrowedFields(SegmentAllocator arena) { - this.arena = arena; + private BorrowedFields() { } - BorrowedFields(SegmentAllocator arena, MemorySegment structSegment, List aEdges) { - this.arena = arena; + BorrowedFields(MemorySegment structSegment, List aEdges) { this.selfEdges = selfEdges; this.aEdges = aEdges; - this.a = SliceUtils.readUtf16(dev.diplomattest.somelib.ntv.BorrowedFields.a(structSegment)); - this.b = SliceUtils.readUtf8(dev.diplomattest.somelib.ntv.BorrowedFields.b(structSegment)); - this.c = SliceUtils.readUtf8(dev.diplomattest.somelib.ntv.BorrowedFields.c(structSegment)); + var aNative = dev.diplomattest.somelib.ntv.BorrowedFields.a(structSegment); + var aVal = SliceUtils.readUtf16(aNative); + this.a = aVal; + var bNative = dev.diplomattest.somelib.ntv.BorrowedFields.b(structSegment); + var bVal = SliceUtils.readUtf8(bNative); + this.b = bVal; + var cNative = dev.diplomattest.somelib.ntv.BorrowedFields.c(structSegment); + var cVal = SliceUtils.readUtf8(cNative); + this.c = cVal; } @@ -46,9 +49,24 @@ public class BorrowedFields { MemorySegment toNative(SegmentAllocator arena) { var returnVal = dev.diplomattest.somelib.ntv.BorrowedFields.allocate(arena); - dev.diplomattest.somelib.ntv.BorrowedFields.a(returnVal, SliceUtils.strToUtf16Slice(arena, this.a)); - dev.diplomattest.somelib.ntv.BorrowedFields.b(returnVal, SliceUtils.strToUtf8Slice(arena, this.b)); - dev.diplomattest.somelib.ntv.BorrowedFields.c(returnVal, SliceUtils.strToUtf8Slice(arena, this.c)); + var aData = arena.allocateFrom(a, StandardCharsets.UTF_16); + var aLen = aData.byteSize() - 1; // allocated strings are null terminated + var aView = DiplomatString16View.allocate(arena); + DiplomatString16View.len(aView, aLen); + DiplomatString16View.data(aView, aData); + dev.diplomattest.somelib.ntv.BorrowedFields.a(returnVal, aView); + var bData= arena.allocateFrom(b, StandardCharsets.UTF_8); + var bLen = bData.byteSize() - 1; // allocated strings are null terminated + var bView = DiplomatStringView.allocate(arena); + DiplomatStringView.len(bView, bLen); + DiplomatStringView.data(bView, bData); + dev.diplomattest.somelib.ntv.BorrowedFields.b(returnVal, bView); + var cData= arena.allocateFrom(c, StandardCharsets.UTF_8); + var cLen = cData.byteSize() - 1; // allocated strings are null terminated + var cView = DiplomatStringView.allocate(arena); + DiplomatStringView.len(cView, cLen); + DiplomatStringView.data(cView, cData); + dev.diplomattest.somelib.ntv.BorrowedFields.c(returnVal, cView); return returnVal; @@ -76,22 +94,21 @@ public class BorrowedFieldsReturning { String bytes; - SegmentAllocator arena; List selfEdges = List.of(); List aEdges = List.of(); - private BorrowedFieldsReturning(SegmentAllocator arena) { - this.arena = arena; + private BorrowedFieldsReturning() { } - BorrowedFieldsReturning(SegmentAllocator arena, MemorySegment structSegment, List aEdges) { - this.arena = arena; + BorrowedFieldsReturning(MemorySegment structSegment, List aEdges) { this.selfEdges = selfEdges; this.aEdges = aEdges; - this.bytes = SliceUtils.readUtf8(dev.diplomattest.somelib.ntv.BorrowedFieldsReturning.bytes(structSegment)); + var bytesNative = dev.diplomattest.somelib.ntv.BorrowedFieldsReturning.bytes(structSegment); + var bytesVal = SliceUtils.readUtf8(bytesNative); + this.bytes = bytesVal; } @@ -99,7 +116,12 @@ public class BorrowedFieldsReturning { MemorySegment toNative(SegmentAllocator arena) { var returnVal = dev.diplomattest.somelib.ntv.BorrowedFieldsReturning.allocate(arena); - dev.diplomattest.somelib.ntv.BorrowedFieldsReturning.bytes(returnVal, SliceUtils.strToUtf8Slice(arena, this.bytes)); + var bytesData= arena.allocateFrom(bytes, StandardCharsets.UTF_8); + var bytesLen = bytesData.byteSize() - 1; // allocated strings are null terminated + var bytesView = DiplomatStringView.allocate(arena); + DiplomatStringView.len(bytesView, bytesLen); + DiplomatStringView.data(bytesView, bytesData); + dev.diplomattest.somelib.ntv.BorrowedFieldsReturning.bytes(returnVal, bytesView); return returnVal; @@ -129,28 +151,31 @@ public class BorrowedFieldsWithBounds { String fieldC; - SegmentAllocator arena; List selfEdges = List.of(); List aEdges = List.of(); List bEdges = List.of(); List cEdges = List.of(); - private BorrowedFieldsWithBounds(SegmentAllocator arena) { - this.arena = arena; + private BorrowedFieldsWithBounds() { } - BorrowedFieldsWithBounds(SegmentAllocator arena, MemorySegment structSegment, List aEdges, List bEdges, List cEdges) { - this.arena = arena; + BorrowedFieldsWithBounds(MemorySegment structSegment, List aEdges, List bEdges, List cEdges) { this.selfEdges = selfEdges; this.aEdges = aEdges; this.bEdges = bEdges; this.cEdges = cEdges; - this.fieldA = SliceUtils.readUtf16(dev.diplomattest.somelib.ntv.BorrowedFieldsWithBounds.field_a(structSegment)); - this.fieldB = SliceUtils.readUtf8(dev.diplomattest.somelib.ntv.BorrowedFieldsWithBounds.field_b(structSegment)); - this.fieldC = SliceUtils.readUtf8(dev.diplomattest.somelib.ntv.BorrowedFieldsWithBounds.field_c(structSegment)); + var fieldANative = dev.diplomattest.somelib.ntv.BorrowedFieldsWithBounds.field_a(structSegment); + var fieldAVal = SliceUtils.readUtf16(fieldANative); + this.fieldA = fieldAVal; + var fieldBNative = dev.diplomattest.somelib.ntv.BorrowedFieldsWithBounds.field_b(structSegment); + var fieldBVal = SliceUtils.readUtf8(fieldBNative); + this.fieldB = fieldBVal; + var fieldCNative = dev.diplomattest.somelib.ntv.BorrowedFieldsWithBounds.field_c(structSegment); + var fieldCVal = SliceUtils.readUtf8(fieldCNative); + this.fieldC = fieldCVal; } @@ -158,9 +183,24 @@ public class BorrowedFieldsWithBounds { MemorySegment toNative(SegmentAllocator arena) { var returnVal = dev.diplomattest.somelib.ntv.BorrowedFieldsWithBounds.allocate(arena); - dev.diplomattest.somelib.ntv.BorrowedFieldsWithBounds.field_a(returnVal, SliceUtils.strToUtf16Slice(arena, this.fieldA)); - dev.diplomattest.somelib.ntv.BorrowedFieldsWithBounds.field_b(returnVal, SliceUtils.strToUtf8Slice(arena, this.fieldB)); - dev.diplomattest.somelib.ntv.BorrowedFieldsWithBounds.field_c(returnVal, SliceUtils.strToUtf8Slice(arena, this.fieldC)); + var fieldAData = arena.allocateFrom(fieldA, StandardCharsets.UTF_16); + var fieldALen = fieldAData.byteSize() - 1; // allocated strings are null terminated + var fieldAView = DiplomatString16View.allocate(arena); + DiplomatString16View.len(fieldAView, fieldALen); + DiplomatString16View.data(fieldAView, fieldAData); + dev.diplomattest.somelib.ntv.BorrowedFieldsWithBounds.field_a(returnVal, fieldAView); + var fieldBData= arena.allocateFrom(fieldB, StandardCharsets.UTF_8); + var fieldBLen = fieldBData.byteSize() - 1; // allocated strings are null terminated + var fieldBView = DiplomatStringView.allocate(arena); + DiplomatStringView.len(fieldBView, fieldBLen); + DiplomatStringView.data(fieldBView, fieldBData); + dev.diplomattest.somelib.ntv.BorrowedFieldsWithBounds.field_b(returnVal, fieldBView); + var fieldCData= arena.allocateFrom(fieldC, StandardCharsets.UTF_8); + var fieldCLen = fieldCData.byteSize() - 1; // allocated strings are null terminated + var fieldCView = DiplomatStringView.allocate(arena); + DiplomatStringView.len(fieldCView, fieldCLen); + DiplomatStringView.data(fieldCView, fieldCData); + dev.diplomattest.somelib.ntv.BorrowedFieldsWithBounds.field_c(returnVal, fieldCView); return returnVal; @@ -189,6 +229,7 @@ public class Bar { MemorySegment internal; Cleaner.Cleanable cleanable; + SegmentAllocator arena; List selfEdges = List.of(); List bEdges = List.of(); @@ -238,6 +279,7 @@ public class Foo { MemorySegment internal; Cleaner.Cleanable cleanable; + SegmentAllocator arena; List selfEdges = List.of(); List aEdges = List.of(); @@ -267,58 +309,60 @@ public class Foo { public static Foo new_(String x) { try (var arena = Arena.ofConfined()) { - var xData= arena.allocateFrom(x, StandardCharsets.UTF_8); - var xLen = xData.byteSize() - 1; - var xView = DiplomatStringView.allocate(arena); + var xData= Arena.ofAuto().allocateFrom(x, StandardCharsets.UTF_8); + var xLen = xData.byteSize() - 1; // allocated strings are null terminated + var xView = DiplomatStringView.allocate(Arena.ofAuto()); DiplomatStringView.len(xView, xLen); DiplomatStringView.data(xView, xData); var nativeVal = somelib_h.Foo_new(xView); + List selfEdges = List.of(); List aEdges = List.of(x); var returnVal = new Foo(nativeVal, selfEdges, aEdges); - var cleaner = new Foo.FooCleaner(nativeVal); - returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; + } } public static Foo extractFromFields(BorrowedFields fields) { - var fieldsNative = fields.toNative(fields.arena); - var nativeVal = somelib_h.Foo_extract_from_fields(fieldsNative); - List selfEdges = List.of(); - - - - List aEdges = List.of(fields); - var returnVal = new Foo(nativeVal, selfEdges, aEdges); - var cleaner = new Foo.FooCleaner(nativeVal); - returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); - return returnVal; + try (var arena = Arena.ofConfined()) { + var fieldsNative = fields.toNative(arena); + var nativeVal = somelib_h.Foo_extract_from_fields(fieldsNative); + + List selfEdges = List.of(); + + + + List aEdges = List.of(fields); + var returnVal = new Foo(nativeVal, selfEdges, aEdges); + return returnVal; + + } } public static Foo extractFromBounds(BorrowedFieldsWithBounds bounds,String anotherString) { try (var arena = Arena.ofConfined()) { - var boundsNative = bounds.toNative(bounds.arena); - var anotherStringData= arena.allocateFrom(anotherString, StandardCharsets.UTF_8); - var anotherStringLen = anotherStringData.byteSize() - 1; - var anotherStringView = DiplomatStringView.allocate(arena); + var boundsNative = bounds.toNative(arena); + var anotherStringData= Arena.ofAuto().allocateFrom(anotherString, StandardCharsets.UTF_8); + var anotherStringLen = anotherStringData.byteSize() - 1; // allocated strings are null terminated + var anotherStringView = DiplomatStringView.allocate(Arena.ofAuto()); DiplomatStringView.len(anotherStringView, anotherStringLen); DiplomatStringView.data(anotherStringView, anotherStringData); var nativeVal = somelib_h.Foo_extract_from_bounds(boundsNative, anotherStringView); + List selfEdges = List.of(); List aEdges = List.of(bounds, bounds, anotherString); var returnVal = new Foo(nativeVal, selfEdges, aEdges); - var cleaner = new Foo.FooCleaner(nativeVal); - returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; + } } @@ -327,6 +371,7 @@ public class Foo { var nativeVal = somelib_h.Foo_get_bar(internal); + List selfEdges = List.of(); @@ -334,21 +379,21 @@ public class Foo { List bEdges = List.of(this); List aEdges = List.of(this); var returnVal = new Bar(nativeVal, selfEdges, bEdges, aEdges); - var cleaner = new Bar.BarCleaner(nativeVal); - returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; + } public BorrowedFieldsReturning asReturning() { - var returnArena = (SegmentAllocator) Arena.ofAuto(); - - var nativeVal = somelib_h.Foo_as_returning(returnArena, internal); - - List aEdges = List.of(this); - - var returnVal = new BorrowedFieldsReturning(returnArena, nativeVal, aEdges); - return returnVal; + try (var arena = Arena.ofConfined()) { + + + var nativeVal = somelib_h.Foo_as_returning(arena, internal); + + var returnVal = new BorrowedFieldsReturning(nativeVal, List.of()); + return returnVal; + + } } } diff --git a/tool/src/java/snapshots/diplomat_tool__java__test__opaque.snap b/tool/src/java/snapshots/diplomat_tool__java__test__opaque.snap index 66a79c92f..c36e1ddc7 100644 --- a/tool/src/java/snapshots/diplomat_tool__java__test__opaque.snap +++ b/tool/src/java/snapshots/diplomat_tool__java__test__opaque.snap @@ -20,6 +20,7 @@ public class Opaque { MemorySegment internal; Cleaner.Cleanable cleanable; + SegmentAllocator arena; List selfEdges = List.of(); @@ -47,40 +48,43 @@ public class Opaque { public static Opaque new_() { var nativeVal = somelib_h.Opaque_new(); + List selfEdges = List.of(); var returnVal = new Opaque(nativeVal, selfEdges); - var cleaner = new Opaque.OpaqueCleaner(nativeVal); - returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; + } public static Opaque fromStr(String input) { try (var arena = Arena.ofConfined()) { - var inputData= arena.allocateFrom(input, StandardCharsets.UTF_8); - var inputLen = inputData.byteSize() - 1; - var inputView = DiplomatStringView.allocate(arena); + var inputData= Arena.ofAuto().allocateFrom(input, StandardCharsets.UTF_8); + var inputLen = inputData.byteSize() - 1; // allocated strings are null terminated + var inputView = DiplomatStringView.allocate(Arena.ofAuto()); DiplomatStringView.len(inputView, inputLen); DiplomatStringView.data(inputView, inputData); var nativeVal = somelib_h.Opaque_from_str(inputView); + List selfEdges = List.of(); var returnVal = new Opaque(nativeVal, selfEdges); - var cleaner = new Opaque.OpaqueCleaner(nativeVal); - returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; + } } public static long returnsUsize() { var nativeVal = somelib_h.Opaque_returns_usize(); - return nativeVal; + + var returnVal = nativeVal; + return returnVal; + } @@ -88,7 +92,10 @@ public class Opaque { var nativeVal = somelib_h.Opaque_internal_len(internal); - return nativeVal; + + var returnVal = nativeVal; + return returnVal; + } public String getDebugStr() { diff --git a/tool/src/java/snapshots/diplomat_tool__java__test__opaque_render.snap b/tool/src/java/snapshots/diplomat_tool__java__test__opaque_render.snap index 3fa537c3a..0b33c3167 100644 --- a/tool/src/java/snapshots/diplomat_tool__java__test__opaque_render.snap +++ b/tool/src/java/snapshots/diplomat_tool__java__test__opaque_render.snap @@ -20,6 +20,7 @@ public class Opaque2 { MemorySegment internal; Cleaner.Cleanable cleanable; + SegmentAllocator arena; List selfEdges = List.of(); diff --git a/tool/src/java/snapshots/diplomat_tool__java__test__slice.snap b/tool/src/java/snapshots/diplomat_tool__java__test__slice.snap index 5d6fd4713..4788594a8 100644 --- a/tool/src/java/snapshots/diplomat_tool__java__test__slice.snap +++ b/tool/src/java/snapshots/diplomat_tool__java__test__slice.snap @@ -20,6 +20,7 @@ public class Float64Vec { MemorySegment internal; Cleaner.Cleanable cleanable; + SegmentAllocator arena; List selfEdges = List.of(); @@ -48,20 +49,20 @@ public class Float64Vec { try (var arena = Arena.ofConfined()) { var vLen = v.length; - var vData= arena.allocateFrom(JAVA_DOUBLE, v); - var vView = DiplomatF64View.allocate(arena); + var vData= Arena.ofAuto().allocateFrom(JAVA_DOUBLE, v); + var vView = DiplomatF64View.allocate(Arena.ofAuto()); DiplomatF64View.len(vView, vLen); DiplomatF64View.data(vView, vData); var nativeVal = somelib_h.Float64Vec_new(vView); + List selfEdges = List.of(); var returnVal = new Float64Vec(nativeVal, selfEdges); - var cleaner = new Float64Vec.Float64VecCleaner(nativeVal); - returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; + } } @@ -72,9 +73,12 @@ public class Float64Vec { var nativeVal = somelib_h.Float64Vec_as_slice(arena, internal); + var data = dev.diplomattest.somelib.ntv.DiplomatF64View.data(nativeVal); var len = dev.diplomattest.somelib.ntv.DiplomatF64View.len(nativeVal); - return SliceUtils.doubleSliceToArray(nativeVal); + var returnVal = SliceUtils.doubleSliceToArray(nativeVal); + return returnVal; + } } @@ -98,6 +102,7 @@ public class MyString { MemorySegment internal; Cleaner.Cleanable cleanable; + SegmentAllocator arena; List selfEdges = List.of(); @@ -125,75 +130,57 @@ public class MyString { public static MyString new_(String v) { try (var arena = Arena.ofConfined()) { - var vData= arena.allocateFrom(v, StandardCharsets.UTF_8); - var vLen = vData.byteSize() - 1; - var vView = DiplomatStringView.allocate(arena); + var vData= Arena.ofAuto().allocateFrom(v, StandardCharsets.UTF_8); + var vLen = vData.byteSize() - 1; // allocated strings are null terminated + var vView = DiplomatStringView.allocate(Arena.ofAuto()); DiplomatStringView.len(vView, vLen); DiplomatStringView.data(vView, vData); var nativeVal = somelib_h.MyString_new(vView); + List selfEdges = List.of(); var returnVal = new MyString(nativeVal, selfEdges); - var cleaner = new MyString.MyStringCleaner(nativeVal); - returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; + } } public static MyString newUnsafe(String v) { try (var arena = Arena.ofConfined()) { - var vData= arena.allocateFrom(v, StandardCharsets.UTF_8); - var vLen = vData.byteSize() - 1; - var vView = DiplomatStringView.allocate(arena); + var vData= Arena.ofAuto().allocateFrom(v, StandardCharsets.UTF_8); + var vLen = vData.byteSize() - 1; // allocated strings are null terminated + var vView = DiplomatStringView.allocate(Arena.ofAuto()); DiplomatStringView.len(vView, vLen); DiplomatStringView.data(vView, vData); var nativeVal = somelib_h.MyString_new_unsafe(vView); + List selfEdges = List.of(); var returnVal = new MyString(nativeVal, selfEdges); - var cleaner = new MyString.MyStringCleaner(nativeVal); - returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; + } } - public static MyString newOwned(String v) { - - var vData= Arena.global().allocateFrom(v, StandardCharsets.UTF_8); - var vLen = vData.byteSize() - 1; - var vView = DiplomatStringView.allocate(Arena.global()); - DiplomatStringView.len(vView, vLen); - DiplomatStringView.data(vView, vData); - var nativeVal = somelib_h.MyString_new_owned(vView); - List selfEdges = List.of(); - - - - var returnVal = new MyString(nativeVal, selfEdges); - var cleaner = new MyString.MyStringCleaner(nativeVal); - returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); - return returnVal; - } - public static MyString newFromFirst(String [] v) { try (var arena = Arena.ofConfined()) { - var vView = SliceUtils.strs8(arena, v); - var vLen = v.length; + var vView = SliceUtils.strs8(Arena.ofAuto(), v); + var vLen = v.length; var nativeVal = somelib_h.MyString_new_from_first(vView); + List selfEdges = List.of(); var returnVal = new MyString(nativeVal, selfEdges); - var cleaner = new MyString.MyStringCleaner(nativeVal); - returnVal.cleanable = Lib.cleaner.register(returnVal, cleaner); return returnVal; + } } @@ -202,9 +189,9 @@ public class MyString { try (var arena = Arena.ofConfined()) { - var newStrData= arena.allocateFrom(newStr, StandardCharsets.UTF_8); - var newStrLen = newStrData.byteSize() - 1; - var newStrView = DiplomatStringView.allocate(arena); + var newStrData= Arena.ofAuto().allocateFrom(newStr, StandardCharsets.UTF_8); + var newStrLen = newStrData.byteSize() - 1; // allocated strings are null terminated + var newStrView = DiplomatStringView.allocate(Arena.ofAuto()); DiplomatStringView.len(newStrView, newStrLen); DiplomatStringView.data(newStrView, newStrData); somelib_h.MyString_set_str(internal, newStrView); @@ -228,7 +215,10 @@ public class MyString { var nativeVal = somelib_h.MyString_get_boxed_str(arena, internal); - return SliceUtils.readUtf8(nativeVal); + + var returnVal = SliceUtils.readUtf8(nativeVal); + return returnVal; + } } diff --git a/tool/templates/java/Opaque.java.jinja b/tool/templates/java/Opaque.java.jinja index ca150c30e..d828a2bde 100644 --- a/tool/templates/java/Opaque.java.jinja +++ b/tool/templates/java/Opaque.java.jinja @@ -16,6 +16,7 @@ public class {{type_name}} { MemorySegment internal; Cleaner.Cleanable cleanable; + SegmentAllocator arena; List selfEdges = List.of(); {% for edge in edges -%} diff --git a/tool/templates/java/Struct.java.jinja b/tool/templates/java/Struct.java.jinja index 40bb0165a..e1e47994c 100644 --- a/tool/templates/java/Struct.java.jinja +++ b/tool/templates/java/Struct.java.jinja @@ -16,22 +16,19 @@ public class {{type_name}} { {{field.ty}} {{field.name}}; {% endfor %} - SegmentAllocator arena; List selfEdges = List.of(); {% for edge in edges -%} List {{edge}}Edges = List.of(); {% endfor %} - private {{type_name}}(SegmentAllocator arena) { - this.arena = arena; + private {{type_name}}() { } - {{type_name}}(SegmentAllocator arena, MemorySegment structSegment + {{type_name}}(MemorySegment structSegment {%- for edge in edges -%} , List {{edge}}Edges {%- endfor -%} ) { - this.arena = arena; this.selfEdges = selfEdges; {% for edge in edges -%} this.{{edge}}Edges = {{edge}}Edges; @@ -39,7 +36,7 @@ public class {{type_name}} { {% for field in fields -%} var {{field.name}}Native = {{domain}}.{{lib_name}}.ntv.{{type_name}}.{{field.native_name}}(structSegment); - {{field.to_java.conversion}} + {{field.to_java.conversion|indent(8)}} this.{{field.name}} = {{field.to_java.converted_value}}; {% endfor %} @@ -51,7 +48,7 @@ public class {{type_name}} { var returnVal = {{domain}}.{{lib_name}}.ntv.{{type_name}}.allocate(arena); {% for field in fields -%} - {{field.to_native.conversion}} + {{field.to_native.conversion|indent(8)}} {{domain}}.{{lib_name}}.ntv.{{type_name}}.{{field.native_name}}(returnVal, {{field.to_native.converted_value}}); {% endfor %} diff --git a/tool/templates/java/StructConversion.java.jinja b/tool/templates/java/StructConversion.java.jinja index bfff69418..50b5ff6ac 100644 --- a/tool/templates/java/StructConversion.java.jinja +++ b/tool/templates/java/StructConversion.java.jinja @@ -1,13 +1,17 @@ -{% for lifetime in lifetimes %} -List {{lifetime.name}}Edges = List.of( +var {{name}}Val = new {{ty}}({{native_val}} +{%- for lifetime in lifetimes -%} +, {% if lifetime.edges.len() > 1 -%} +List.of( {%- for edge in lifetime.edges -%} {% if loop.first %}{% else %}, {% endif %}{{edge}} {%- endfor -%} -); -{%- endfor %} - -var {{name}}Val = new {{ty}}(returnArena, {{native_val}} -{%- for lifetime in lifetimes -%} -, {{lifetime.name}}Edges +) +{%- else if lifetime.edges.len() == 0 -%} +{%- for edge in lifetime.edges -%} +List.of({{edge}}) +{%- endfor -%} +{%- else -%} +List.of() +{%- endif -%} {%- endfor -%} ); From bc7c3fedda45e54f8d0a5ee606c13027038406c0 Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Fri, 13 Sep 2024 11:39:17 +0200 Subject: [PATCH 60/69] panama-backend - clippy --- .../diplomattest/somelib/ntv/somelib_h.java | 4 +- tool/src/java/mod.rs | 46 +++++-------------- 2 files changed, 14 insertions(+), 36 deletions(-) diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java index baeacaee4..49b1732a2 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java @@ -14377,13 +14377,13 @@ public static long __DARWIN_C_LEVEL() { } /** * {@snippet lang=c : - * #define __ASSERT_FILE_NAME "jextract$8785474449644430005.h" + * #define __ASSERT_FILE_NAME "jextract$6981691421161577881.h" * } */ public static MemorySegment __ASSERT_FILE_NAME() { class Holder { static final MemorySegment __ASSERT_FILE_NAME - = somelib_h.LIBRARY_ARENA.allocateFrom("jextract$8785474449644430005.h"); + = somelib_h.LIBRARY_ARENA.allocateFrom("jextract$6981691421161577881.h"); } return Holder.__ASSERT_FILE_NAME; } diff --git a/tool/src/java/mod.rs b/tool/src/java/mod.rs index 51bf1a553..523645b4c 100644 --- a/tool/src/java/mod.rs +++ b/tool/src/java/mod.rs @@ -1,15 +1,14 @@ +use std::borrow::Cow; use std::fs::File; use std::io::Write; use std::path::Path; -use std::{borrow::Cow, iter::once}; use askama::Template; use diplomat_core::hir::borrowing_param::BorrowingParamVisitor; use diplomat_core::hir::{ - self, BackendAttrSupport, EnumDef, EnumVariant, FloatType, IntSizeType, IntType, LifetimeEnv, - MaybeOwn, MaybeStatic, Method, OpaqueDef, OpaqueOwner, OpaquePath, ReturnType, Slice, - SpecialMethod, StringEncoding, StructDef, StructPathLike, SuccessType, TyPosition, TypeContext, - TypeDef, + self, BackendAttrSupport, EnumDef, EnumVariant, FloatType, IntSizeType, IntType, MaybeOwn, + MaybeStatic, Method, OpaqueDef, OpaquePath, ReturnType, Slice, SpecialMethod, StringEncoding, + StructDef, StructPathLike, SuccessType, TyPosition, TypeContext, TypeDef, }; use formatter::JavaFormatter; use heck::ToUpperCamelCase; @@ -18,9 +17,6 @@ use serde::Deserialize; use crate::{ErrorStore, FileMap}; const TMP_C_DIR: &str = "tmp"; -const LIBRARY: &str = "somelib"; // todo: build from conf. Ensure that name is not the same as any - // type -const GROUP: &str = "dev.diplomattest"; // todo: config const _TMP_LIB_NAME: &str = "dev/diplomattest/somelib"; // todo: build from conf const _JAVA_DIR: &str = "src/main/java/"; @@ -158,7 +154,7 @@ pub(crate) fn run<'a>( .expect("failed to write files"); } - let lib_path = tmp_path.join(format!("{LIBRARY}.h")); + let lib_path = tmp_path.join(format!("{lib_name}.h")); { let mut lib_file = File::create(&lib_path).expect("failed to create lib file"); @@ -175,7 +171,7 @@ pub(crate) fn run<'a>( // --library mylib \ // /path/to/mylib/include/mylib.h - let package = format!("{GROUP}.{LIBRARY}.ntv"); + let package = format!("{domain}.{lib_name}.ntv"); let mut command = std::process::Command::new("jextract"); command .arg("--include-dir") @@ -185,7 +181,7 @@ pub(crate) fn run<'a>( .arg("--target-package") .arg(package) .arg("--library") - .arg(LIBRARY) + .arg(AsRef::::as_ref(lib_name)) .arg(lib_path); // cleanup tmp c files @@ -364,7 +360,7 @@ struct Conversion<'cx> { } mod arena { - use std::{fmt::Display, marker::PhantomData}; + use std::fmt::Display; pub type Render<'cx> = Box) -> Conversion<'cx> + 'cx>; const UNIT: &() = &(); @@ -376,13 +372,6 @@ mod arena { _marker: &'cx (), } impl<'cx, F: Fn(Arena<'cx>) -> Conversion<'cx> + 'cx> AllocationConversion<'cx, F> { - pub fn new(clos: F) -> Self { - Self { - clos, - _marker: UNIT, - } - } - pub fn dynamic(clos: F) -> AllocationConversion<'cx, Render<'cx>> { AllocationConversion { clos: Box::new(clos) as Render<'cx>, @@ -397,8 +386,8 @@ mod arena { pub enum Arena<'cx> { Closed, - Owned, Auto, + #[allow(unused)] Phantom(&'cx ()), } @@ -406,7 +395,6 @@ mod arena { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { Arena::Closed => write!(f, "arena"), - Arena::Owned => write!(f, "ownedArena"), Arena::Auto => write!(f, "Arena.ofAuto()"), Arena::Phantom(_) => write!(f, "phantom"), } @@ -625,7 +613,6 @@ Diplomat{rust_primitive_type}View.data({name}View, {name}Data); } hir::Type::Opaque(o) => { let converted_value = format!("{name}Val").into(); - let owned_return: bool = o.owner.is_owned(); let ty_name = &self.tcx.resolve_opaque(o.tcx_id).name; let conversion = OpaqueConversionTpl { name: "return".into(), @@ -651,7 +638,7 @@ Diplomat{rust_primitive_type}View.data({name}View, {name}Data); hir::Type::Struct(s) => { let id = s.id(); let ty_name = self.tcx.resolve_type(id).name(); - let clos = move |arena| { + let clos = move |_| { let lifetimes = lifetimes.clone(); let name = name.clone(); let native_val = native_val.clone(); @@ -1107,12 +1094,9 @@ return {converted_value}; .map(|field| { let name = self.formatter.fmt_field_name(field); let native_name = field.name.as_str(); - let native_val = - format!("{domain}.{lib_name}.ntv.{type_name}.{native_name}(structSegment)"); let lifetimes = match &field.ty { - hir::Type::Enum(ref enum_def) => vec![], + hir::Type::Enum(_) => vec![], hir::Type::Struct(struct_path) => { - let ty_name = self.tcx.resolve_type(struct_path.id()).name().as_str(); let lt_env = &s.lifetimes; struct_path .lifetimes() @@ -1146,13 +1130,7 @@ return {converted_value}; hir::Type::Slice(_) => { todo!("Failed to generate field: {name} for struct {}", s.name) } - hir::Type::Opaque(OpaquePath { - ref lifetimes, - ref owner, - tcx_id, - .. - }) => { - let ty_name = self.tcx.resolve_opaque(*tcx_id).name.as_str(); + hir::Type::Opaque(OpaquePath { ref lifetimes, .. }) => { let lt_env = &s.lifetimes; // todo: fix // let self_edges: Cow = match owner.lifetime() { From dfe88e363cbf01f57adbd9d53a3ac66b89b9d893 Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Fri, 13 Sep 2024 11:50:16 +0200 Subject: [PATCH 61/69] panama-backend - fix merge issues --- .../src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java | 4 ++-- feature_tests/src/option.rs | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java index 49b1732a2..f9dd280d5 100644 --- a/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java +++ b/feature_tests/java/somelib/src/main/java/dev/diplomattest/somelib/ntv/somelib_h.java @@ -14377,13 +14377,13 @@ public static long __DARWIN_C_LEVEL() { } /** * {@snippet lang=c : - * #define __ASSERT_FILE_NAME "jextract$6981691421161577881.h" + * #define __ASSERT_FILE_NAME "jextract$14462318489172502015.h" * } */ public static MemorySegment __ASSERT_FILE_NAME() { class Holder { static final MemorySegment __ASSERT_FILE_NAME - = somelib_h.LIBRARY_ARENA.allocateFrom("jextract$6981691421161577881.h"); + = somelib_h.LIBRARY_ARENA.allocateFrom("jextract$14462318489172502015.h"); } return Holder.__ASSERT_FILE_NAME; } diff --git a/feature_tests/src/option.rs b/feature_tests/src/option.rs index 496786908..4ee0d3f2e 100644 --- a/feature_tests/src/option.rs +++ b/feature_tests/src/option.rs @@ -43,7 +43,6 @@ pub mod ffi { } #[diplomat::attr(not(supports = option), disable)] - #[derive(Debug)] pub struct OptionInputStruct { a: DiplomatOption, b: DiplomatOption, @@ -65,7 +64,6 @@ pub mod ffi { } #[diplomat::attr(not(supports = option), disable)] - #[derive(Debug)] pub enum OptionEnum { Foo, Bar, From 42d941bb88c2781ff01398718e84fcf9a52a32fe Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Fri, 13 Sep 2024 11:50:54 +0200 Subject: [PATCH 62/69] panama-backend - fix kotlin test from merge --- ...plomat_tool__kotlin__test__opaque_gen.snap | 263 ------------------ ...lin__test__opaque_gen_with_finalizers.snap | 3 +- 2 files changed, 1 insertion(+), 265 deletions(-) diff --git a/tool/src/kotlin/snapshots/diplomat_tool__kotlin__test__opaque_gen.snap b/tool/src/kotlin/snapshots/diplomat_tool__kotlin__test__opaque_gen.snap index ec55887f0..b48ab04cc 100644 --- a/tool/src/kotlin/snapshots/diplomat_tool__kotlin__test__opaque_gen.snap +++ b/tool/src/kotlin/snapshots/diplomat_tool__kotlin__test__opaque_gen.snap @@ -1,6 +1,5 @@ --- source: tool/src/kotlin/mod.rs -assertion_line: 1995 expression: result --- package dev.diplomattest.somelib @@ -38,265 +37,3 @@ class OwndingStruct internal constructor ( } } - -======================= -package dev.diplomattest.somelib - -import com.sun.jna.Callback -import com.sun.jna.Library -import com.sun.jna.Native -import com.sun.jna.Pointer -import com.sun.jna.Structure - -internal interface OwnedStructLib: Library { -} - -internal class OwnedStructNative: Structure(), Structure.ByValue { - @JvmField - internal var int: Int = 0; - - // Define the fields of the struct - override fun getFieldOrder(): List { - return listOf("int") - } -} - -class OwnedStruct internal constructor ( - internal val nativeStruct: OwnedStructNative) { - val int: Int = nativeStruct.int - - companion object { - internal val libClass: Class = OwnedStructLib::class.java - internal val lib: OwnedStructLib = Native.load("somelib", libClass) - val NATIVESIZE: Long = Native.getNativeSize(OwnedStructNative::class.java).toLong() - } - -} - -======================= -package dev.diplomattest.somelib; -import com.sun.jna.Callback -import com.sun.jna.Library -import com.sun.jna.Native -import com.sun.jna.Pointer -import com.sun.jna.Structure - - -internal interface BorrowWrapperLib: Library { - fun BorrowWrapper_destroy(handle: Pointer) -} - -class BorrowWrapper internal constructor ( - internal val handle: Pointer, - // These ensure that anything that is borrowed is kept alive and not cleaned - // up by the garbage collector. - internal val selfEdges: List, - internal val aEdges: List, - internal val bEdges: List, -) { - - internal class BorrowWrapperCleaner(val handle: Pointer, val lib: BorrowWrapperLib) : Runnable { - override fun run() { - lib.BorrowWrapper_destroy(handle) - } - } - - companion object { - internal val libClass: Class = BorrowWrapperLib::class.java - internal val lib: BorrowWrapperLib = Native.load("somelib", libClass) - } - -} - -======================= -package dev.diplomattest.somelib; -import com.sun.jna.Callback -import com.sun.jna.Library -import com.sun.jna.Native -import com.sun.jna.Pointer -import com.sun.jna.Structure - - -internal interface InputStructLib: Library { - fun InputStruct_destroy(handle: Pointer) -} - -class InputStruct internal constructor ( - internal val handle: Pointer, - // These ensure that anything that is borrowed is kept alive and not cleaned - // up by the garbage collector. - internal val selfEdges: List -) { - - internal class InputStructCleaner(val handle: Pointer, val lib: InputStructLib) : Runnable { - override fun run() { - lib.InputStruct_destroy(handle) - } - } - - companion object { - internal val libClass: Class = InputStructLib::class.java - internal val lib: InputStructLib = Native.load("somelib", libClass) - } - -} - -======================= -package dev.diplomattest.somelib; -import com.sun.jna.Callback -import com.sun.jna.Library -import com.sun.jna.Native -import com.sun.jna.Pointer -import com.sun.jna.Structure - - -internal interface MyOpaqueStructLib: Library { - fun MyOpaqueStruct_destroy(handle: Pointer) - fun MyOpaqueStruct_get_byte(): Byte - fun MyOpaqueStruct_get_string_wrapper(in1: Int): Int - fun MyOpaqueStruct_copy(handle: Pointer, borrow: Pointer): Int - fun MyOpaqueStruct_borrow_other(inp1: Pointer, inp2: Pointer, borrow: Pointer): Pointer - fun MyOpaqueStruct_create(in1: Int): Pointer - fun MyOpaqueStruct_do_stuff(handle: Pointer, in1: Int): Double - fun MyOpaqueStruct_borrow(handle: Pointer): Pointer - fun MyOpaqueStruct_borrow2(handle: Pointer): Pointer - fun MyOpaqueStruct_borrow3(handle: Pointer, write: Pointer): Unit - fun MyOpaqueStruct_borrow(other: Pointer): Pointer - fun MyOpaqueStruct_string_stuff(handle: Pointer, someStr: Slice): Pointer - fun MyOpaqueStruct_string_stuff_2(handle: Pointer, someStr: Slice): Pointer -} - -class MyOpaqueStruct internal constructor ( - internal val handle: Pointer, - // These ensure that anything that is borrowed is kept alive and not cleaned - // up by the garbage collector. - internal val selfEdges: List, - internal val bEdges: List, -) { - - internal class MyOpaqueStructCleaner(val handle: Pointer, val lib: MyOpaqueStructLib) : Runnable { - override fun run() { - lib.MyOpaqueStruct_destroy(handle) - } - } - - companion object { - internal val libClass: Class = MyOpaqueStructLib::class.java - internal val lib: MyOpaqueStructLib = Native.load("somelib", libClass) - - fun getByte(): UByte { - - val returnVal = lib.MyOpaqueStruct_get_byte(); - return returnVal.toUByte() - } - - fun getStringWrapper(in1: Int): Int { - - val returnVal = lib.MyOpaqueStruct_get_string_wrapper(in1); - return returnVal - } - - fun borrowOther(inp1: InputStruct, inp2: InputStruct, borrow: MyOpaqueStruct): MyOpaqueStruct { - - val returnVal = lib.MyOpaqueStruct_borrow_other(inp1.handle, inp2.handle, borrow.handle); - val selfEdges: List = listOf(inp1) + listOf(inp2) + listOf(borrow) - val bEdges: List = listOf(borrow) - val handle = returnVal - val returnOpaque = MyOpaqueStruct(handle, selfEdges, bEdges) - return returnOpaque - } - - fun create(in1: Int): MyOpaqueStruct { - - val returnVal = lib.MyOpaqueStruct_create(in1); - val selfEdges: List = listOf() - val bEdges: List = listOf() - val handle = returnVal - val returnOpaque = MyOpaqueStruct(handle, selfEdges, bEdges) - CLEANER.register(returnOpaque, MyOpaqueStruct.MyOpaqueStructCleaner(handle, MyOpaqueStruct.lib)); - - return returnOpaque - } - - fun borrow(other: MyOpaqueStruct): BorrowWrapper { - - val returnVal = lib.MyOpaqueStruct_borrow(other.handle); - val selfEdges: List = listOf() - val bEdges: List = listOf(other) - val aEdges: List = listOf(other) - val handle = returnVal - val returnOpaque = BorrowWrapper(handle, selfEdges, bEdges, aEdges) - CLEANER.register(returnOpaque, BorrowWrapper.BorrowWrapperCleaner(handle, BorrowWrapper.lib)); - - return returnOpaque - } - } - - fun copy(borrow: MyOpaqueStruct): Int { - - val returnVal = lib.MyOpaqueStruct_copy(handle, borrow.handle); - return returnVal - } - - fun doStuff(in1: Int): Double { - - val returnVal = lib.MyOpaqueStruct_do_stuff(handle, in1); - return returnVal - } - - fun borrow(): BorrowWrapper { - - val returnVal = lib.MyOpaqueStruct_borrow(handle); - val selfEdges: List = listOf() - val bEdges: List = listOf(this) - val aEdges: List = listOf(this) - val handle = returnVal - val returnOpaque = BorrowWrapper(handle, selfEdges, bEdges, aEdges) - CLEANER.register(returnOpaque, BorrowWrapper.BorrowWrapperCleaner(handle, BorrowWrapper.lib)); - - return returnOpaque - } - - fun borrow2(): MyOpaqueStruct { - - val returnVal = lib.MyOpaqueStruct_borrow2(handle); - val selfEdges: List = listOf(this) - val bEdges: List = listOf(this) - val handle = returnVal - val returnOpaque = MyOpaqueStruct(handle, selfEdges, bEdges) - return returnOpaque - } - - fun borrow3(): String { - val write = DW.lib.diplomat_buffer_write_create(0) - val returnVal = lib.MyOpaqueStruct_borrow3(handle, write); - - val returnString = DW.writeToString(write) - return returnString - } - - fun stringStuff(someStr: String): MyOpaqueStruct { - val (someStrMem, someStrSlice) = PrimitiveArrayTools.readUtf8(someStr) - - val returnVal = lib.MyOpaqueStruct_string_stuff(handle, someStrSlice); - val selfEdges: List = listOf(this) + listOf(someStrMem) - val bEdges: List = listOf(this) - val handle = returnVal - val returnOpaque = MyOpaqueStruct(handle, selfEdges, bEdges) - return returnOpaque - } - - fun stringStuff2(someStr: String): MyOpaqueStruct { - val (someStrMem, someStrSlice) = PrimitiveArrayTools.readUtf8(someStr) - - val returnVal = lib.MyOpaqueStruct_string_stuff_2(handle, someStrSlice); - val selfEdges: List = listOf(this) - val bEdges: List = listOf(this) - val handle = returnVal - val returnOpaque = MyOpaqueStruct(handle, selfEdges, bEdges)someStrMem.close() - return returnOpaque - } - -} - -======================= diff --git a/tool/src/kotlin/snapshots/diplomat_tool__kotlin__test__opaque_gen_with_finalizers.snap b/tool/src/kotlin/snapshots/diplomat_tool__kotlin__test__opaque_gen_with_finalizers.snap index d08be43ce..173dd7be6 100644 --- a/tool/src/kotlin/snapshots/diplomat_tool__kotlin__test__opaque_gen_with_finalizers.snap +++ b/tool/src/kotlin/snapshots/diplomat_tool__kotlin__test__opaque_gen_with_finalizers.snap @@ -1,9 +1,8 @@ --- source: tool/src/kotlin/mod.rs -assertion_line: 2042 expression: result --- -package dev.gigapixel.somelib; +package dev.diplomattest.somelib; import com.sun.jna.Callback import com.sun.jna.Library import com.sun.jna.Native From 4aa75d67f9e5f8680403956610cb48834c0a0730 Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Fri, 13 Sep 2024 11:56:30 +0200 Subject: [PATCH 63/69] panama-backend - more test fixes --- ...omat_tool__kotlin__test__opaque_gen-2.snap | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 tool/src/kotlin/snapshots/diplomat_tool__kotlin__test__opaque_gen-2.snap diff --git a/tool/src/kotlin/snapshots/diplomat_tool__kotlin__test__opaque_gen-2.snap b/tool/src/kotlin/snapshots/diplomat_tool__kotlin__test__opaque_gen-2.snap new file mode 100644 index 000000000..ccfa6c6cf --- /dev/null +++ b/tool/src/kotlin/snapshots/diplomat_tool__kotlin__test__opaque_gen-2.snap @@ -0,0 +1,36 @@ +--- +source: tool/src/kotlin/mod.rs +expression: result +--- +package dev.diplomattest.somelib + +import com.sun.jna.Callback +import com.sun.jna.Library +import com.sun.jna.Native +import com.sun.jna.Pointer +import com.sun.jna.Structure + +internal interface OwnedStructLib: Library { +} + +internal class OwnedStructNative: Structure(), Structure.ByValue { + @JvmField + internal var int: Int = 0; + + // Define the fields of the struct + override fun getFieldOrder(): List { + return listOf("int") + } +} + +class OwnedStruct internal constructor ( + internal val nativeStruct: OwnedStructNative) { + val int: Int = nativeStruct.int + + companion object { + internal val libClass: Class = OwnedStructLib::class.java + internal val lib: OwnedStructLib = Native.load("somelib", libClass) + val NATIVESIZE: Long = Native.getNativeSize(OwnedStructNative::class.java).toLong() + } + +} From d633c3bfe5d016c4356b0c526c095c0f2a544c1c Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Fri, 13 Sep 2024 11:57:55 +0200 Subject: [PATCH 64/69] panama-backend - fix demo changes and some cpp stuff --- example/demo_gen/demo/js/DataProvider.d.ts | 17 - example/demo_gen/demo/js/DataProvider.mjs | 53 --- example/demo_gen/demo/js/FixedDecimal.d.ts | 17 - example/demo_gen/demo/js/FixedDecimal.mjs | 63 --- .../demo/js/FixedDecimalFormatter.d.ts | 21 - .../demo/js/FixedDecimalFormatter.mjs | 74 ---- .../demo/js/FixedDecimalFormatterOptions.d.ts | 15 - .../demo/js/FixedDecimalFormatterOptions.mjs | 61 --- .../demo/js/FixedDecimalGroupingStrategy.d.ts | 16 - .../demo/js/FixedDecimalGroupingStrategy.mjs | 42 -- example/demo_gen/demo/js/Locale.d.ts | 15 - example/demo_gen/demo/js/Locale.mjs | 47 --- .../demo_gen/demo/js/diplomat-runtime.d.ts | 15 - example/demo_gen/demo/js/diplomat-runtime.mjs | 358 ------------------ example/demo_gen/demo/js/diplomat-wasm.mjs | 52 --- example/demo_gen/demo/js/index.d.ts | 15 - example/demo_gen/demo/js/index.mjs | 13 - feature_tests/c/include/MyString.h | 2 - feature_tests/cpp/include/MyString.d.hpp | 2 - feature_tests/cpp/include/MyString.hpp | 7 - 20 files changed, 905 deletions(-) delete mode 100644 example/demo_gen/demo/js/DataProvider.d.ts delete mode 100644 example/demo_gen/demo/js/DataProvider.mjs delete mode 100644 example/demo_gen/demo/js/FixedDecimal.d.ts delete mode 100644 example/demo_gen/demo/js/FixedDecimal.mjs delete mode 100644 example/demo_gen/demo/js/FixedDecimalFormatter.d.ts delete mode 100644 example/demo_gen/demo/js/FixedDecimalFormatter.mjs delete mode 100644 example/demo_gen/demo/js/FixedDecimalFormatterOptions.d.ts delete mode 100644 example/demo_gen/demo/js/FixedDecimalFormatterOptions.mjs delete mode 100644 example/demo_gen/demo/js/FixedDecimalGroupingStrategy.d.ts delete mode 100644 example/demo_gen/demo/js/FixedDecimalGroupingStrategy.mjs delete mode 100644 example/demo_gen/demo/js/Locale.d.ts delete mode 100644 example/demo_gen/demo/js/Locale.mjs delete mode 100644 example/demo_gen/demo/js/diplomat-runtime.d.ts delete mode 100644 example/demo_gen/demo/js/diplomat-runtime.mjs delete mode 100644 example/demo_gen/demo/js/diplomat-wasm.mjs delete mode 100644 example/demo_gen/demo/js/index.d.ts delete mode 100644 example/demo_gen/demo/js/index.mjs diff --git a/example/demo_gen/demo/js/DataProvider.d.ts b/example/demo_gen/demo/js/DataProvider.d.ts deleted file mode 100644 index c05589e1b..000000000 --- a/example/demo_gen/demo/js/DataProvider.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -// generated by diplomat-tool -import type { pointer, codepoint } from "./diplomat-runtime.d.ts"; - - -/** An data provider, capable of loading data keys from some source. -* -*See the [Rust documentation for `icu_provider`](https://docs.rs/icu_provider/latest/icu_provider/index.html) for more information. -*/ -export class DataProvider { - - - get ffiValue(): pointer; - - static newStatic(): DataProvider; - - static returnsResult(): boolean; -} \ No newline at end of file diff --git a/example/demo_gen/demo/js/DataProvider.mjs b/example/demo_gen/demo/js/DataProvider.mjs deleted file mode 100644 index 4f6af6179..000000000 --- a/example/demo_gen/demo/js/DataProvider.mjs +++ /dev/null @@ -1,53 +0,0 @@ -// generated by diplomat-tool -import wasm from "./diplomat-wasm.mjs"; -import * as diplomatRuntime from "./diplomat-runtime.mjs"; - - -/** An data provider, capable of loading data keys from some source. -* -*See the [Rust documentation for `icu_provider`](https://docs.rs/icu_provider/latest/icu_provider/index.html) for more information. -*/ -const DataProvider_box_destroy_registry = new FinalizationRegistry((ptr) => { - wasm.icu4x_DataProvider_destroy_mv1(ptr); -}); - -export class DataProvider { - // Internal ptr reference: - #ptr = null; - - // Lifetimes are only to keep dependencies alive. - // Since JS won't garbage collect until there are no incoming edges. - #selfEdge = []; - - constructor(ptr, selfEdge) { - - this.#ptr = ptr; - this.#selfEdge = selfEdge; - // Unconditionally register to destroy when this object is ready to garbage collect. - DataProvider_box_destroy_registry.register(this, this.#ptr); - } - - get ffiValue() { - return this.#ptr; - } - - static newStatic() { - const result = wasm.icu4x_DataProvider_new_static_mv1(); - - try { - return new DataProvider(result, []); - } - - finally {} - } - - static returnsResult() { - const result = wasm.icu4x_DataProvider_returns_result_mv1(); - - try { - return result === 1; - } - - finally {} - } -} \ No newline at end of file diff --git a/example/demo_gen/demo/js/FixedDecimal.d.ts b/example/demo_gen/demo/js/FixedDecimal.d.ts deleted file mode 100644 index 4866c24d2..000000000 --- a/example/demo_gen/demo/js/FixedDecimal.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -// generated by diplomat-tool -import type { pointer, codepoint } from "./diplomat-runtime.d.ts"; - - -/** See the [Rust documentation for `FixedDecimal`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html) for more information. -*/ -export class FixedDecimal { - - - get ffiValue(): pointer; - - static new_(v: number): FixedDecimal; - - multiplyPow10(power: number): void; - - toString(): string | null; -} \ No newline at end of file diff --git a/example/demo_gen/demo/js/FixedDecimal.mjs b/example/demo_gen/demo/js/FixedDecimal.mjs deleted file mode 100644 index 7d4b2f35e..000000000 --- a/example/demo_gen/demo/js/FixedDecimal.mjs +++ /dev/null @@ -1,63 +0,0 @@ -// generated by diplomat-tool -import wasm from "./diplomat-wasm.mjs"; -import * as diplomatRuntime from "./diplomat-runtime.mjs"; - - -/** See the [Rust documentation for `FixedDecimal`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html) for more information. -*/ -const FixedDecimal_box_destroy_registry = new FinalizationRegistry((ptr) => { - wasm.icu4x_FixedDecimal_destroy_mv1(ptr); -}); - -export class FixedDecimal { - // Internal ptr reference: - #ptr = null; - - // Lifetimes are only to keep dependencies alive. - // Since JS won't garbage collect until there are no incoming edges. - #selfEdge = []; - - constructor(ptr, selfEdge) { - - this.#ptr = ptr; - this.#selfEdge = selfEdge; - // Unconditionally register to destroy when this object is ready to garbage collect. - FixedDecimal_box_destroy_registry.register(this, this.#ptr); - } - - get ffiValue() { - return this.#ptr; - } - - static new_(v) { - const result = wasm.icu4x_FixedDecimal_new_mv1(v); - - try { - return new FixedDecimal(result, []); - } - - finally {} - } - - multiplyPow10(power) { - wasm.icu4x_FixedDecimal_multiply_pow10_mv1(this.ffiValue, power); - - try {} - - finally {} - } - - toString() { - - const write = new diplomatRuntime.DiplomatWriteBuf(wasm); - const result = wasm.icu4x_FixedDecimal_to_string_mv1(this.ffiValue, write.buffer); - - try { - return result === 0 ? null : write.readString8(); - } - - finally { - write.free(); - } - } -} \ No newline at end of file diff --git a/example/demo_gen/demo/js/FixedDecimalFormatter.d.ts b/example/demo_gen/demo/js/FixedDecimalFormatter.d.ts deleted file mode 100644 index fe4366f1a..000000000 --- a/example/demo_gen/demo/js/FixedDecimalFormatter.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -// generated by diplomat-tool -import type { DataProvider } from "./DataProvider" -import type { FixedDecimal } from "./FixedDecimal" -import type { FixedDecimalFormatterOptions } from "./FixedDecimalFormatterOptions" -import type { Locale } from "./Locale" -import type { pointer, codepoint } from "./diplomat-runtime.d.ts"; - - -/** An Fixed Decimal Format object, capable of formatting a [`FixedDecimal`] as a string. -* -*See the [Rust documentation for `FixedDecimalFormatter`](https://docs.rs/icu/latest/icu/decimal/struct.FixedDecimalFormatter.html) for more information. -*/ -export class FixedDecimalFormatter { - - - get ffiValue(): pointer; - - static tryNew(locale: Locale, provider: DataProvider, options: FixedDecimalFormatterOptions): FixedDecimalFormatter | null; - - formatWrite(value: FixedDecimal): string; -} \ No newline at end of file diff --git a/example/demo_gen/demo/js/FixedDecimalFormatter.mjs b/example/demo_gen/demo/js/FixedDecimalFormatter.mjs deleted file mode 100644 index 1d89d120f..000000000 --- a/example/demo_gen/demo/js/FixedDecimalFormatter.mjs +++ /dev/null @@ -1,74 +0,0 @@ -// generated by diplomat-tool -import { DataProvider } from "./DataProvider.mjs" -import { FixedDecimal } from "./FixedDecimal.mjs" -import { FixedDecimalFormatterOptions } from "./FixedDecimalFormatterOptions.mjs" -import { Locale } from "./Locale.mjs" -import wasm from "./diplomat-wasm.mjs"; -import * as diplomatRuntime from "./diplomat-runtime.mjs"; - - -/** An Fixed Decimal Format object, capable of formatting a [`FixedDecimal`] as a string. -* -*See the [Rust documentation for `FixedDecimalFormatter`](https://docs.rs/icu/latest/icu/decimal/struct.FixedDecimalFormatter.html) for more information. -*/ -const FixedDecimalFormatter_box_destroy_registry = new FinalizationRegistry((ptr) => { - wasm.icu4x_FixedDecimalFormatter_destroy_mv1(ptr); -}); - -export class FixedDecimalFormatter { - // Internal ptr reference: - #ptr = null; - - // Lifetimes are only to keep dependencies alive. - // Since JS won't garbage collect until there are no incoming edges. - #selfEdge = []; - - constructor(ptr, selfEdge) { - - this.#ptr = ptr; - this.#selfEdge = selfEdge; - // Unconditionally register to destroy when this object is ready to garbage collect. - FixedDecimalFormatter_box_destroy_registry.register(this, this.#ptr); - } - - get ffiValue() { - return this.#ptr; - } - - static tryNew(locale, provider, options) { - - let slice_cleanup_callbacks = []; - - const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true); - const result = wasm.icu4x_FixedDecimalFormatter_try_new_mv1(diplomatReceive.buffer, locale.ffiValue, provider.ffiValue, ...options._intoFFI(slice_cleanup_callbacks, {})); - - try { - if (!diplomatReceive.resultFlag) { - return null; - } - return new FixedDecimalFormatter(diplomatRuntime.ptrRead(wasm, diplomatReceive.buffer), []); - } - - finally { - for (let cleanup of slice_cleanup_callbacks) { - cleanup(); - } - - diplomatReceive.free(); - } - } - - formatWrite(value) { - - const write = new diplomatRuntime.DiplomatWriteBuf(wasm); - wasm.icu4x_FixedDecimalFormatter_format_write_mv1(this.ffiValue, value.ffiValue, write.buffer); - - try { - return write.readString8(); - } - - finally { - write.free(); - } - } -} \ No newline at end of file diff --git a/example/demo_gen/demo/js/FixedDecimalFormatterOptions.d.ts b/example/demo_gen/demo/js/FixedDecimalFormatterOptions.d.ts deleted file mode 100644 index 13f6a92b9..000000000 --- a/example/demo_gen/demo/js/FixedDecimalFormatterOptions.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -// generated by diplomat-tool -import type { FixedDecimalGroupingStrategy } from "./FixedDecimalGroupingStrategy" -import type { pointer, codepoint } from "./diplomat-runtime.d.ts"; - -export class FixedDecimalFormatterOptions { - - get groupingStrategy() : FixedDecimalGroupingStrategy; - set groupingStrategy(value: FixedDecimalGroupingStrategy); - - get someOtherConfig() : boolean; - set someOtherConfig(value: boolean); - - - static default_(): FixedDecimalFormatterOptions; -} \ No newline at end of file diff --git a/example/demo_gen/demo/js/FixedDecimalFormatterOptions.mjs b/example/demo_gen/demo/js/FixedDecimalFormatterOptions.mjs deleted file mode 100644 index 306c26b39..000000000 --- a/example/demo_gen/demo/js/FixedDecimalFormatterOptions.mjs +++ /dev/null @@ -1,61 +0,0 @@ -// generated by diplomat-tool -import { FixedDecimalGroupingStrategy } from "./FixedDecimalGroupingStrategy.mjs" -import wasm from "./diplomat-wasm.mjs"; -import * as diplomatRuntime from "./diplomat-runtime.mjs"; - -export class FixedDecimalFormatterOptions { - - #groupingStrategy; - get groupingStrategy() { - return this.#groupingStrategy; - } - set groupingStrategy(value) { - this.#groupingStrategy = value; - } - - #someOtherConfig; - get someOtherConfig() { - return this.#someOtherConfig; - } - set someOtherConfig(value) { - this.#someOtherConfig = value; - } - - // Return this struct in FFI function friendly format. - // Returns an array that can be expanded with spread syntax (...) - - _intoFFI( - slice_cleanup_callbacks, - appendArrayMap - ) { - return [this.#groupingStrategy.ffiValue, this.#someOtherConfig] - } - - // This struct contains borrowed fields, so this takes in a list of - // "edges" corresponding to where each lifetime's data may have been borrowed from - // and passes it down to individual fields containing the borrow. - // This method does not attempt to handle any dependencies between lifetimes, the caller - // should handle this when constructing edge arrays. - _fromFFI(ptr) { - const groupingStrategyDeref = diplomatRuntime.enumDiscriminant(wasm, ptr); - this.#groupingStrategy = FixedDecimalGroupingStrategy[Array.from(FixedDecimalGroupingStrategy.values.keys())[groupingStrategyDeref]]; - const someOtherConfigDeref = (new Uint8Array(wasm.memory.buffer, ptr + 4, 1))[0] === 1; - this.#someOtherConfig = someOtherConfigDeref; - - return this; - } - - static default_() { - - const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, false); - const result = wasm.icu4x_FixedDecimalFormatterOptions_default_mv1(diplomatReceive.buffer); - - try { - return new FixedDecimalFormatterOptions()._fromFFI(diplomatReceive.buffer); - } - - finally { - diplomatReceive.free(); - } - } -} \ No newline at end of file diff --git a/example/demo_gen/demo/js/FixedDecimalGroupingStrategy.d.ts b/example/demo_gen/demo/js/FixedDecimalGroupingStrategy.d.ts deleted file mode 100644 index c692e9429..000000000 --- a/example/demo_gen/demo/js/FixedDecimalGroupingStrategy.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -// generated by diplomat-tool -import type { pointer, codepoint } from "./diplomat-runtime.d.ts"; - -// Base enumerator definition -export class FixedDecimalGroupingStrategy { - constructor(value : FixedDecimalGroupingStrategy | string); - - get value() : string; - - get ffiValue() : number; - - static Auto : FixedDecimalGroupingStrategy; - static Never : FixedDecimalGroupingStrategy; - static Always : FixedDecimalGroupingStrategy; - static Min2 : FixedDecimalGroupingStrategy; -} \ No newline at end of file diff --git a/example/demo_gen/demo/js/FixedDecimalGroupingStrategy.mjs b/example/demo_gen/demo/js/FixedDecimalGroupingStrategy.mjs deleted file mode 100644 index ee6aae7c6..000000000 --- a/example/demo_gen/demo/js/FixedDecimalGroupingStrategy.mjs +++ /dev/null @@ -1,42 +0,0 @@ -// generated by diplomat-tool -import wasm from "./diplomat-wasm.mjs"; -import * as diplomatRuntime from "./diplomat-runtime.mjs"; - -// Base enumerator definition -export class FixedDecimalGroupingStrategy { - #value = undefined; - - static values = new Map([ - ["Auto", 0], - ["Never", 1], - ["Always", 2], - ["Min2", 3] - ]); - - constructor(value) { - if (value instanceof FixedDecimalGroupingStrategy) { - this.#value = value.value; - return; - } - - if (FixedDecimalGroupingStrategy.values.has(value)) { - this.#value = value; - return; - } - - throw TypeError(value + " is not a FixedDecimalGroupingStrategy and does not correspond to any of its enumerator values."); - } - - get value() { - return this.#value; - } - - get ffiValue() { - return FixedDecimalGroupingStrategy.values.get(this.#value); - } - - static Auto = new FixedDecimalGroupingStrategy("Auto"); - static Never = new FixedDecimalGroupingStrategy("Never"); - static Always = new FixedDecimalGroupingStrategy("Always"); - static Min2 = new FixedDecimalGroupingStrategy("Min2"); -} \ No newline at end of file diff --git a/example/demo_gen/demo/js/Locale.d.ts b/example/demo_gen/demo/js/Locale.d.ts deleted file mode 100644 index df9c2944b..000000000 --- a/example/demo_gen/demo/js/Locale.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -// generated by diplomat-tool -import type { pointer, codepoint } from "./diplomat-runtime.d.ts"; - - -/** An Locale, capable of representing strings like `"en-US"`. -* -*See the [Rust documentation for `Locale`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html) for more information. -*/ -export class Locale { - - - get ffiValue(): pointer; - - static new_(name: string): Locale; -} \ No newline at end of file diff --git a/example/demo_gen/demo/js/Locale.mjs b/example/demo_gen/demo/js/Locale.mjs deleted file mode 100644 index 459b28c80..000000000 --- a/example/demo_gen/demo/js/Locale.mjs +++ /dev/null @@ -1,47 +0,0 @@ -// generated by diplomat-tool -import wasm from "./diplomat-wasm.mjs"; -import * as diplomatRuntime from "./diplomat-runtime.mjs"; - - -/** An Locale, capable of representing strings like `"en-US"`. -* -*See the [Rust documentation for `Locale`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html) for more information. -*/ -const Locale_box_destroy_registry = new FinalizationRegistry((ptr) => { - wasm.icu4x_Locale_destroy_mv1(ptr); -}); - -export class Locale { - // Internal ptr reference: - #ptr = null; - - // Lifetimes are only to keep dependencies alive. - // Since JS won't garbage collect until there are no incoming edges. - #selfEdge = []; - - constructor(ptr, selfEdge) { - - this.#ptr = ptr; - this.#selfEdge = selfEdge; - // Unconditionally register to destroy when this object is ready to garbage collect. - Locale_box_destroy_registry.register(this, this.#ptr); - } - - get ffiValue() { - return this.#ptr; - } - - static new_(name) { - - const nameSlice = diplomatRuntime.DiplomatBuf.str8(wasm, name); - const result = wasm.icu4x_Locale_new_mv1(nameSlice.ptr, nameSlice.size); - - try { - return new Locale(result, []); - } - - finally { - nameSlice.free(); - } - } -} \ No newline at end of file diff --git a/example/demo_gen/demo/js/diplomat-runtime.d.ts b/example/demo_gen/demo/js/diplomat-runtime.d.ts deleted file mode 100644 index 655d81b2a..000000000 --- a/example/demo_gen/demo/js/diplomat-runtime.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -/// A [codepoint] is a Unicode code point, such as `a`, or `💡`. -/// -/// The recommended way to obtain a `codepoint` is to create it from a -/// `String`, which is conceptually a list of `codepoint`s. For example, -/// `'a'.codePointAt(0)` is equal to the `char` `a`. -/// -/// JS does not have a character/codepoint literal, so integer literals -/// need to be used. For example the Unicode code point U+1F4A1, `💡`, -/// can be represented by `0x1F4A1`. Note that only values in the ranges -/// `0x0..0xD7FF` and `0xE000..0x10FFFF` (both inclusive) are Unicode -/// code points, and hence valid `codepoint`s. -/// -/// A `String` can be constructed from a `codepoint` using `String.fromCodePoint()`. -export type codepoint = number; -export type pointer = number; \ No newline at end of file diff --git a/example/demo_gen/demo/js/diplomat-runtime.mjs b/example/demo_gen/demo/js/diplomat-runtime.mjs deleted file mode 100644 index ff00de2ff..000000000 --- a/example/demo_gen/demo/js/diplomat-runtime.mjs +++ /dev/null @@ -1,358 +0,0 @@ -export function readString8(wasm, ptr, len) { - const buf = new Uint8Array(wasm.memory.buffer, ptr, len); - return (new TextDecoder("utf-8")).decode(buf) -} - -export function readString16(wasm, ptr, len) { - const buf = new Uint16Array(wasm.memory.buffer, ptr, len); - return String.fromCharCode.apply(null, buf) -} - -export function withDiplomatWrite(wasm, callback) { - const write = wasm.diplomat_buffer_write_create(0); - try { - callback(write); - const outStringPtr = wasm.diplomat_buffer_write_get_bytes(write); - if (outStringPtr === null) { - throw Error("Out of memory"); - } - const outStringLen = wasm.diplomat_buffer_write_len(write); - return readString8(wasm, outStringPtr, outStringLen); - } finally { - wasm.diplomat_buffer_write_destroy(write); - } -} - -/** - * Get the pointer returned by an FFI function. - * - * It's tempting to call `(new Uint32Array(wasm.memory.buffer, FFI_func(), 1))[0]`. - * However, there's a chance that `wasm.memory.buffer` will be resized between - * the time it's accessed and the time it's used, invalidating the view. - * This function ensures that the view into wasm memory is fresh. - * - * This is used for methods that return multiple types into a wasm buffer, where - * one of those types is another ptr. Call this method to get access to the returned - * ptr, so the return buffer can be freed. - * @param {WebAssembly.Exports} wasm Provided by diplomat generated files. - * @param {number} ptr Pointer of a pointer, to be read. - * @returns {number} The underlying pointer. - */ -export function ptrRead(wasm, ptr) { - return (new Uint32Array(wasm.memory.buffer, ptr, 1))[0]; -} - -/** - * Get the flag of a result type. - */ -export function resultFlag(wasm, ptr, offset) { - return (new Uint8Array(wasm.memory.buffer, ptr + offset, 1))[0]; -} - -/** - * Get the discriminant of a Rust enum. -*/ -export function enumDiscriminant(wasm, ptr) { - return (new Int32Array(wasm.memory.buffer, ptr, 1))[0] -} - -/** - * A wrapper around a slice of WASM memory that can be freed manually or - * automatically by the garbage collector. - * - * This type is necessary for Rust functions that take a `&str` or `&[T]`, since - * they can create an edge to this object if they borrow from the str/slice, - * or we can manually free the WASM memory if they don't. - */ -export class DiplomatBuf { - static str8 = (wasm, string) => { - var utf8Length = 0; - for (const codepointString of string) { - let codepoint = codepointString.codePointAt(0); - if (codepoint < 0x80) { - utf8Length += 1 - } else if (codepoint < 0x800) { - utf8Length += 2 - } else if (codepoint < 0x10000) { - utf8Length += 3 - } else { - utf8Length += 4 - } - } - - const ptr = wasm.diplomat_alloc(utf8Length, 1); - - const result = (new TextEncoder()).encodeInto(string, new Uint8Array(wasm.memory.buffer, ptr, utf8Length)); - console.assert(string.length === result.read && utf8Length === result.written, "UTF-8 write error"); - - return new DiplomatBuf(ptr, utf8Length, () => wasm.diplomat_free(ptr, utf8Length, 1)); - } - - static str16 = (wasm, string) => { - const byteLength = string.length * 2; - const ptr = wasm.diplomat_alloc(byteLength, 2); - - const destination = new Uint16Array(wasm.memory.buffer, ptr, string.length); - for (let i = 0; i < string.length; i++) { - destination[i] = string.charCodeAt(i); - } - - return new DiplomatBuf(ptr, string.length, () => wasm.diplomat_free(ptr, byteLength, 2)); - } - - static slice = (wasm, list, rustType) => { - const elementSize = rustType === "u8" || rustType === "i8" || rustType === "boolean" ? 1 : - rustType === "u16" || rustType === "i16" ? 2 : - rustType === "u64" || rustType === "i64" || rustType === "f64" ? 8 : - 4; - - const byteLength = list.length * elementSize; - const ptr = wasm.diplomat_alloc(byteLength, elementSize); - - /** - * Create an array view of the buffer. This gives us the `set` method which correctly handles untyped values - */ - const destination = - rustType === "u8" || rustType === "boolean" ? new Uint8Array(wasm.memory.buffer, ptr, byteLength) : - rustType === "i8" ? new Int8Array(wasm.memory.buffer, ptr, byteLength) : - rustType === "u16" ? new Uint16Array(wasm.memory.buffer, ptr, byteLength) : - rustType === "i16" ? new Int16Array(wasm.memory.buffer, ptr, byteLength) : - rustType === "i32" ? new Int32Array(wasm.memory.buffer, ptr, byteLength) : - rustType === "u64" ? new BigUint64Array(wasm.memory.buffer, ptr, byteLength) : - rustType === "i64" ? new BigInt64Array(wasm.memory.buffer, ptr, byteLength) : - rustType === "f32" ? new Float32Array(wasm.memory.buffer, ptr, byteLength) : - rustType === "f64" ? new Float64Array(wasm.memory.buffer, ptr, byteLength) : - new Uint32Array(wasm.memory.buffer, ptr, byteLength); - destination.set(list); - - return new DiplomatBuf(ptr, list.length, () => wasm.diplomat_free(ptr, byteLength, elementSize)); - } - - - static strs = (wasm, strings, encoding) => { - let encodeStr = (encoding === "string16") ? DiplomatBuf.str16 : DiplomatBuf.str8; - - const byteLength = strings.length * 4 * 2; - - const ptr = wasm.diplomat_alloc(byteLength, 4); - - const destination = new Uint32Array(wasm.memory.buffer, ptr, byteLength); - - const stringsAlloc = []; - - for (let i = 0; i < strings.length; i++) { - stringsAlloc.push(encodeStr(wasm, strings[i])); - - destination[2 * i] = stringsAlloc[i].ptr; - destination[(2 * i) + 1] = stringsAlloc[i].size; - } - - return new DiplomatBuf(ptr, strings.length, () => { - wasm.diplomat_free(ptr, byteLength, 4); - for (let i = 0; i < stringsAlloc.length; i++) { - stringsAlloc[i].free(); - } - }); - } - - /** - * Generated code calls one of methods these for each allocation, to either - * free directly after the FFI call, to leak (to create a &'static), or to - * register the buffer with the garbage collector (to create a &'a). - */ - free; - - constructor(ptr, size, free) { - this.ptr = ptr; - this.size = size; - this.free = free; - this.leak = () => { }; - this.garbageCollect = () => DiplomatBufferFinalizer.register(this, this.free); - } -} - -/** - * Helper class for creating and managing `diplomat_buffer_write`. - * Meant to minimize direct calls to `wasm`. - */ -export class DiplomatWriteBuf { - leak; - - #wasm; - #buffer; - - constructor(wasm) { - this.#wasm = wasm; - this.#buffer = this.#wasm.diplomat_buffer_write_create(0); - - this.leak = () => { }; - } - - free() { - this.#wasm.diplomat_buffer_write_destroy(this.#buffer); - } - - garbageCollect() { - DiplomatBufferFinalizer.register(this, this.free); - } - - readString8() { - return readString8(this.#wasm, this.ptr, this.size); - } - - get buffer() { - return this.#buffer; - } - - get ptr() { - return this.#wasm.diplomat_buffer_write_get_bytes(this.#buffer); - } - - get size() { - return this.#wasm.diplomat_buffer_write_len(this.#buffer); - } -} - -/** - * A number of Rust functions in WebAssembly require a buffer to populate struct, slice, Option<> or Result<> types with information. - * {@link DiplomatReceiveBuf} allocates a buffer in WebAssembly, which can then be passed into functions with the {@link DiplomatReceiveBuf.buffer} - * property. - */ -export class DiplomatReceiveBuf { - #wasm; - - #size; - #align; - - #hasResult; - - #buffer; - - constructor(wasm, size, align, hasResult) { - this.#wasm = wasm; - - this.#size = size; - this.#align = align; - - this.#hasResult = hasResult; - - this.#buffer = this.#wasm.diplomat_alloc(this.#size, this.#align); - - this.leak = () => { }; - } - - /** - * Only used if the receive buffer points to a slice. - * @param {string} sliceType The slice type we expect to be used. - * @returns A slice of the `sliceType` provided. - */ - getSlice(sliceType) { - const [ptr, size] = new Uint32Array(this.#wasm.memory.buffer, this.#buffer, 2); - - var arrayType; - switch (sliceType) { - case "u8": - case "boolean": - arrayType = Uint8Array; - break; - case "i8": - arrayType = Int8Array; - break; - case "u16": - arrayType = Uint16Array; - break; - case "i16": - arrayType = Int16Array; - break; - case "i32": - arrayType = Int32Array; - break; - case "u32": - arrayType = Uint32Array; - break; - case "i64": - arrayType = BigInt64Array; - break; - case "u64": - arrayType = BigUint64Array; - break; - case "f32": - arrayType = Float32Array; - break; - case "f64": - arrayType = Float64Array; - break; - default: - console.error("Unrecognized bufferType ", bufferType); - } - return arrayType.from(new arrayType(this.#wasm.memory.buffer, ptr, size)); - } - - /** - * Returns a string, if the receive buffer points to a string. - * @param {string} stringEncoding `string8` or `string16`. - * @param {number} buffer Buffer to use. Only used by `getStrings`, other wise {@link DiplomatReceiveBuf.buffer} is used. - * @returns {string} String with encoding of the provided `stringEncoding`. - */ - getString(stringEncoding) { - const [ptr, size] = new Uint32Array(this.#wasm.memory.buffer, this.#buffer, 2); - switch (stringEncoding) { - case "string8": - return readString8(wasm, ptr, size); - case "string16": - return readString16(wasm, ptr, size); - default: - console.error("Unrecognized stringEncoding ", stringEncoding); - break; - } - } - - /** - * Returns an array of strings, assuming the receive buffer points to an array of strings. - * @param {string} stringEncoding `string8` or `string16`. - * @returns {Array[string]} An array of strings with the encoding of the provided `stringEncoding`. - */ - getStrings(stringEncoding) { - const [ptr, size] = new Uint32Array(this.#wasm.memory.buffer, this.#buffer, 2); - - let strPtrs = new Uint32Array(this.#wasm.memory.buffer, ptr, size); - let strings = []; - - for (let arrayPtr = 0; arrayPtr < strPtrs.length; arrayPtr += 2) { - const [strPtr, strSize] = [strPtrs[arrayPtr], strPtrs[arrayPtr + 1]]; - switch (stringEncoding) { - case "string8": - strings.push(readString8(this.#wasm, strPtr, strSize)); - case "string16": - strings.push(readString16(this.#wasm, strPtr, strSize)); - default: - console.error("Unrecognized stringEncoding ", stringEncoding); - break; - } - } - return strings; - } - - free() { - this.#wasm.diplomat_free(this.#buffer, this.#size, this.#align); - } - - get buffer() { - return this.#buffer; - } - - /** - * Only for when a DiplomatReceiveBuf is allocating a buffer for an `Option<>` or a `Result<>` type. - * - * This just checks the last byte for a successful result (assuming that Rust's compiler does not change). - */ - get resultFlag() { - if (this.#hasResult) { - return resultFlag(this.#wasm, this.#buffer, this.#size - 1); - } else { - return true; - } - } -} - -const DiplomatBufferFinalizer = new FinalizationRegistry(free => free()); \ No newline at end of file diff --git a/example/demo_gen/demo/js/diplomat-wasm.mjs b/example/demo_gen/demo/js/diplomat-wasm.mjs deleted file mode 100644 index 010ab359d..000000000 --- a/example/demo_gen/demo/js/diplomat-wasm.mjs +++ /dev/null @@ -1,52 +0,0 @@ -import cfg from '../diplomat.config.mjs'; -import {readString8} from './diplomat-runtime.mjs' - -let wasm; - -const imports = { -env: { - diplomat_console_debug_js(ptr, len) { - console.debug(readString8(wasm, ptr, len)); - }, - diplomat_console_error_js(ptr, len) { - console.error(readString8(wasm, ptr, len)); - }, - diplomat_console_info_js(ptr, len) { - console.info(readString8(wasm, ptr, len)); - }, - diplomat_console_log_js(ptr, len) { - console.log(readString8(wasm, ptr, len)); - }, - diplomat_console_warn_js(ptr, len) { - console.warn(readString8(wasm, ptr, len)); - }, - diplomat_throw_error_js(ptr, len) { - throw new Error(readString8(wasm, ptr, len)); - } -} -} - -if (globalThis.process?.getBuiltinModule) { - // Node (>=22) - const fs = globalThis.process.getBuiltinModule('fs'); - const wasmFile = new Uint8Array(fs.readFileSync(cfg['wasm_path'])); - const loadedWasm = await WebAssembly.instantiate(wasmFile, imports); - wasm = loadedWasm.instance.exports; -} else if (globalThis.process) { - // Node (<22) - const fs = await import('fs'); - const wasmFile = new Uint8Array(fs.readFileSync(cfg['wasm_path'])); - const loadedWasm = await WebAssembly.instantiate(wasmFile, imports); - wasm = loadedWasm.instance.exports; -} else { - // Browser - const loadedWasm = await WebAssembly.instantiateStreaming(fetch(cfg['wasm_path']), imports); - wasm = loadedWasm.instance.exports; -} - -wasm.diplomat_init(); -if (cfg['init'] !== undefined) { - cfg['init'](wasm); -} - -export default wasm; diff --git a/example/demo_gen/demo/js/index.d.ts b/example/demo_gen/demo/js/index.d.ts deleted file mode 100644 index 23146fffd..000000000 --- a/example/demo_gen/demo/js/index.d.ts +++ /dev/null @@ -1,15 +0,0 @@ - -export { codepoint } from './diplomat-runtime'; - - -export { FixedDecimalFormatterOptions } from "./FixedDecimalFormatterOptions" - -export { DataProvider } from "./DataProvider" - -export { FixedDecimalFormatter } from "./FixedDecimalFormatter" - -export { FixedDecimal } from "./FixedDecimal" - -export { Locale } from "./Locale" - -export { FixedDecimalGroupingStrategy } from "./FixedDecimalGroupingStrategy" diff --git a/example/demo_gen/demo/js/index.mjs b/example/demo_gen/demo/js/index.mjs deleted file mode 100644 index 50f63cf3d..000000000 --- a/example/demo_gen/demo/js/index.mjs +++ /dev/null @@ -1,13 +0,0 @@ - - -export { FixedDecimalFormatterOptions } from "./FixedDecimalFormatterOptions.mjs" - -export { DataProvider } from "./DataProvider.mjs" - -export { FixedDecimalFormatter } from "./FixedDecimalFormatter.mjs" - -export { FixedDecimal } from "./FixedDecimal.mjs" - -export { Locale } from "./Locale.mjs" - -export { FixedDecimalGroupingStrategy } from "./FixedDecimalGroupingStrategy.mjs" diff --git a/feature_tests/c/include/MyString.h b/feature_tests/c/include/MyString.h index dc4b64d37..df2b5e774 100644 --- a/feature_tests/c/include/MyString.h +++ b/feature_tests/c/include/MyString.h @@ -19,8 +19,6 @@ MyString* MyString_new(DiplomatStringView v); MyString* MyString_new_unsafe(DiplomatStringView v); -MyString* MyString_new_owned(DiplomatStringView v); - MyString* MyString_new_from_first(DiplomatStringsView v); void MyString_set_str(MyString* self, DiplomatStringView new_str); diff --git a/feature_tests/cpp/include/MyString.d.hpp b/feature_tests/cpp/include/MyString.d.hpp index d25985566..e8424afbe 100644 --- a/feature_tests/cpp/include/MyString.d.hpp +++ b/feature_tests/cpp/include/MyString.d.hpp @@ -23,8 +23,6 @@ class MyString { inline static diplomat::result, diplomat::Utf8Error> new_unsafe(std::string_view v); - inline static std::unique_ptr new_owned(std::string_view v); - inline void set_str(std::string_view new_str); inline std::string get_str() const; diff --git a/feature_tests/cpp/include/MyString.hpp b/feature_tests/cpp/include/MyString.hpp index 1a804d60d..5e512377e 100644 --- a/feature_tests/cpp/include/MyString.hpp +++ b/feature_tests/cpp/include/MyString.hpp @@ -20,8 +20,6 @@ namespace capi { diplomat::capi::MyString* MyString_new_unsafe(diplomat::capi::DiplomatStringView v); - diplomat::capi::MyString* MyString_new_owned(diplomat::capi::DiplomatStringView v); - void MyString_set_str(diplomat::capi::MyString* self, diplomat::capi::DiplomatStringView new_str); void MyString_get_str(const diplomat::capi::MyString* self, diplomat::capi::DiplomatWrite* write); @@ -48,11 +46,6 @@ inline diplomat::result, diplomat::Utf8Error> MyString return diplomat::Ok>(std::unique_ptr(MyString::FromFFI(result))); } -inline std::unique_ptr MyString::new_owned(std::string_view v) { - auto result = diplomat::capi::MyString_new_owned({v.data(), v.size()}); - return std::unique_ptr(MyString::FromFFI(result)); -} - inline void MyString::set_str(std::string_view new_str) { diplomat::capi::MyString_set_str(this->AsFFI(), {new_str.data(), new_str.size()}); From 7f37a9917a2719f1230c5b17a3fa236b3d446268 Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Fri, 13 Sep 2024 11:59:10 +0200 Subject: [PATCH 65/69] panama-backend - mac os S**t --- .DS_Store | Bin 6148 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 30fda22b9faaa8ea2e3fe95838e9d1f357ee3908..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKONs(P3{6HC!XUVGSy%7|h3E-9fC}nt!~q>$_sVm5G+#c5(kO1+3@?zps&rlz z{T7{$i0JsZ8i@=>}-kwa*g3VhLbPYyy#iX;6Vd)f_Q2=*X9>tBFlu&_#3j(7ai5LQ%gR=NB&*t$~bG zfC@Y+(24E9`u`OEWd467aYqHHz`s&JyOY^uj91Fu+Il(bwFSO_Tg?S-hP6`=yd49* i9b;qdc<4n@S8R>vHL(eFI`U2j@@K$wp;3WPD{uvA^A`62 From bfc71eace2d574ceaaff86b2752c26721d309d84 Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Fri, 13 Sep 2024 13:32:36 +0200 Subject: [PATCH 66/69] panama-backend - more test fixing --- ...omat_tool__kotlin__test__opaque_gen-3.snap | 37 ++++ ...omat_tool__kotlin__test__opaque_gen-4.snap | 35 ++++ ...omat_tool__kotlin__test__opaque_gen-5.snap | 160 ++++++++++++++++++ 3 files changed, 232 insertions(+) create mode 100644 tool/src/kotlin/snapshots/diplomat_tool__kotlin__test__opaque_gen-3.snap create mode 100644 tool/src/kotlin/snapshots/diplomat_tool__kotlin__test__opaque_gen-4.snap create mode 100644 tool/src/kotlin/snapshots/diplomat_tool__kotlin__test__opaque_gen-5.snap diff --git a/tool/src/kotlin/snapshots/diplomat_tool__kotlin__test__opaque_gen-3.snap b/tool/src/kotlin/snapshots/diplomat_tool__kotlin__test__opaque_gen-3.snap new file mode 100644 index 000000000..3a4308c54 --- /dev/null +++ b/tool/src/kotlin/snapshots/diplomat_tool__kotlin__test__opaque_gen-3.snap @@ -0,0 +1,37 @@ +--- +source: tool/src/kotlin/mod.rs +expression: result +--- +package dev.diplomattest.somelib; +import com.sun.jna.Callback +import com.sun.jna.Library +import com.sun.jna.Native +import com.sun.jna.Pointer +import com.sun.jna.Structure + + +internal interface BorrowWrapperLib: Library { + fun BorrowWrapper_destroy(handle: Pointer) +} + +class BorrowWrapper internal constructor ( + internal val handle: Pointer, + // These ensure that anything that is borrowed is kept alive and not cleaned + // up by the garbage collector. + internal val selfEdges: List, + internal val aEdges: List, + internal val bEdges: List, +) { + + internal class BorrowWrapperCleaner(val handle: Pointer, val lib: BorrowWrapperLib) : Runnable { + override fun run() { + lib.BorrowWrapper_destroy(handle) + } + } + + companion object { + internal val libClass: Class = BorrowWrapperLib::class.java + internal val lib: BorrowWrapperLib = Native.load("somelib", libClass) + } + +} diff --git a/tool/src/kotlin/snapshots/diplomat_tool__kotlin__test__opaque_gen-4.snap b/tool/src/kotlin/snapshots/diplomat_tool__kotlin__test__opaque_gen-4.snap new file mode 100644 index 000000000..31bfb7228 --- /dev/null +++ b/tool/src/kotlin/snapshots/diplomat_tool__kotlin__test__opaque_gen-4.snap @@ -0,0 +1,35 @@ +--- +source: tool/src/kotlin/mod.rs +expression: result +--- +package dev.diplomattest.somelib; +import com.sun.jna.Callback +import com.sun.jna.Library +import com.sun.jna.Native +import com.sun.jna.Pointer +import com.sun.jna.Structure + + +internal interface InputStructLib: Library { + fun InputStruct_destroy(handle: Pointer) +} + +class InputStruct internal constructor ( + internal val handle: Pointer, + // These ensure that anything that is borrowed is kept alive and not cleaned + // up by the garbage collector. + internal val selfEdges: List +) { + + internal class InputStructCleaner(val handle: Pointer, val lib: InputStructLib) : Runnable { + override fun run() { + lib.InputStruct_destroy(handle) + } + } + + companion object { + internal val libClass: Class = InputStructLib::class.java + internal val lib: InputStructLib = Native.load("somelib", libClass) + } + +} diff --git a/tool/src/kotlin/snapshots/diplomat_tool__kotlin__test__opaque_gen-5.snap b/tool/src/kotlin/snapshots/diplomat_tool__kotlin__test__opaque_gen-5.snap new file mode 100644 index 000000000..ade8ff1f1 --- /dev/null +++ b/tool/src/kotlin/snapshots/diplomat_tool__kotlin__test__opaque_gen-5.snap @@ -0,0 +1,160 @@ +--- +source: tool/src/kotlin/mod.rs +expression: result +--- +package dev.diplomattest.somelib; +import com.sun.jna.Callback +import com.sun.jna.Library +import com.sun.jna.Native +import com.sun.jna.Pointer +import com.sun.jna.Structure + + +internal interface MyOpaqueStructLib: Library { + fun MyOpaqueStruct_destroy(handle: Pointer) + fun MyOpaqueStruct_get_byte(): Byte + fun MyOpaqueStruct_get_string_wrapper(in1: Int): Int + fun MyOpaqueStruct_copy(handle: Pointer, borrow: Pointer): Int + fun MyOpaqueStruct_borrow_other(inp1: Pointer, inp2: Pointer, borrow: Pointer): Pointer + fun MyOpaqueStruct_create(in1: Int): Pointer + fun MyOpaqueStruct_do_stuff(handle: Pointer, in1: Int): Double + fun MyOpaqueStruct_borrow(handle: Pointer): Pointer + fun MyOpaqueStruct_borrow2(handle: Pointer): Pointer + fun MyOpaqueStruct_borrow3(handle: Pointer, write: Pointer): Unit + fun MyOpaqueStruct_borrow(other: Pointer): Pointer + fun MyOpaqueStruct_string_stuff(handle: Pointer, someStr: Slice): Pointer + fun MyOpaqueStruct_string_stuff_2(handle: Pointer, someStr: Slice): Pointer +} + +class MyOpaqueStruct internal constructor ( + internal val handle: Pointer, + // These ensure that anything that is borrowed is kept alive and not cleaned + // up by the garbage collector. + internal val selfEdges: List, + internal val bEdges: List, +) { + + internal class MyOpaqueStructCleaner(val handle: Pointer, val lib: MyOpaqueStructLib) : Runnable { + override fun run() { + lib.MyOpaqueStruct_destroy(handle) + } + } + + companion object { + internal val libClass: Class = MyOpaqueStructLib::class.java + internal val lib: MyOpaqueStructLib = Native.load("somelib", libClass) + + fun getByte(): UByte { + + val returnVal = lib.MyOpaqueStruct_get_byte(); + return returnVal.toUByte() + } + + fun getStringWrapper(in1: Int): Int { + + val returnVal = lib.MyOpaqueStruct_get_string_wrapper(in1); + return returnVal + } + + fun borrowOther(inp1: InputStruct, inp2: InputStruct, borrow: MyOpaqueStruct): MyOpaqueStruct { + + val returnVal = lib.MyOpaqueStruct_borrow_other(inp1.handle, inp2.handle, borrow.handle); + val selfEdges: List = listOf(inp1) + listOf(inp2) + listOf(borrow) + val bEdges: List = listOf(borrow) + val handle = returnVal + val returnOpaque = MyOpaqueStruct(handle, selfEdges, bEdges) + return returnOpaque + } + + fun create(in1: Int): MyOpaqueStruct { + + val returnVal = lib.MyOpaqueStruct_create(in1); + val selfEdges: List = listOf() + val bEdges: List = listOf() + val handle = returnVal + val returnOpaque = MyOpaqueStruct(handle, selfEdges, bEdges) + CLEANER.register(returnOpaque, MyOpaqueStruct.MyOpaqueStructCleaner(handle, MyOpaqueStruct.lib)); + + return returnOpaque + } + + fun borrow(other: MyOpaqueStruct): BorrowWrapper { + + val returnVal = lib.MyOpaqueStruct_borrow(other.handle); + val selfEdges: List = listOf() + val bEdges: List = listOf(other) + val aEdges: List = listOf(other) + val handle = returnVal + val returnOpaque = BorrowWrapper(handle, selfEdges, bEdges, aEdges) + CLEANER.register(returnOpaque, BorrowWrapper.BorrowWrapperCleaner(handle, BorrowWrapper.lib)); + + return returnOpaque + } + } + + fun copy(borrow: MyOpaqueStruct): Int { + + val returnVal = lib.MyOpaqueStruct_copy(handle, borrow.handle); + return returnVal + } + + fun doStuff(in1: Int): Double { + + val returnVal = lib.MyOpaqueStruct_do_stuff(handle, in1); + return returnVal + } + + fun borrow(): BorrowWrapper { + + val returnVal = lib.MyOpaqueStruct_borrow(handle); + val selfEdges: List = listOf() + val bEdges: List = listOf(this) + val aEdges: List = listOf(this) + val handle = returnVal + val returnOpaque = BorrowWrapper(handle, selfEdges, bEdges, aEdges) + CLEANER.register(returnOpaque, BorrowWrapper.BorrowWrapperCleaner(handle, BorrowWrapper.lib)); + + return returnOpaque + } + + fun borrow2(): MyOpaqueStruct { + + val returnVal = lib.MyOpaqueStruct_borrow2(handle); + val selfEdges: List = listOf(this) + val bEdges: List = listOf(this) + val handle = returnVal + val returnOpaque = MyOpaqueStruct(handle, selfEdges, bEdges) + return returnOpaque + } + + fun borrow3(): String { + val write = DW.lib.diplomat_buffer_write_create(0) + val returnVal = lib.MyOpaqueStruct_borrow3(handle, write); + + val returnString = DW.writeToString(write) + return returnString + } + + fun stringStuff(someStr: String): MyOpaqueStruct { + val (someStrMem, someStrSlice) = PrimitiveArrayTools.readUtf8(someStr) + + val returnVal = lib.MyOpaqueStruct_string_stuff(handle, someStrSlice); + val selfEdges: List = listOf(this) + listOf(someStrMem) + val bEdges: List = listOf(this) + val handle = returnVal + val returnOpaque = MyOpaqueStruct(handle, selfEdges, bEdges) + return returnOpaque + } + + fun stringStuff2(someStr: String): MyOpaqueStruct { + val (someStrMem, someStrSlice) = PrimitiveArrayTools.readUtf8(someStr) + + val returnVal = lib.MyOpaqueStruct_string_stuff_2(handle, someStrSlice); + val selfEdges: List = listOf(this) + val bEdges: List = listOf(this) + val handle = returnVal + val returnOpaque = MyOpaqueStruct(handle, selfEdges, bEdges)someStrMem.close() + return returnOpaque + } + +} From 14ae4a5b966d8acbfc0eb6756c78ad89294635cf Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Fri, 13 Sep 2024 13:37:44 +0200 Subject: [PATCH 67/69] panama-backend - remove IntelliJ cruft --- feature_tests/java/somelib/.gitignore | 2 +- feature_tests/java/somelib/.idea/.gitignore | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) delete mode 100644 feature_tests/java/somelib/.idea/.gitignore diff --git a/feature_tests/java/somelib/.gitignore b/feature_tests/java/somelib/.gitignore index 98eb56d8d..f355166dd 100644 --- a/feature_tests/java/somelib/.gitignore +++ b/feature_tests/java/somelib/.gitignore @@ -12,7 +12,7 @@ target/ .idea/misc.xml .idea/vcs.xml .idea/codeStyles -.idea/* +.idea/** *.iws *.iml *.ipr diff --git a/feature_tests/java/somelib/.idea/.gitignore b/feature_tests/java/somelib/.idea/.gitignore deleted file mode 100644 index 26d33521a..000000000 --- a/feature_tests/java/somelib/.idea/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml From b00adf698dbe6402acd303ff60ffbb3d92462b27 Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Fri, 13 Sep 2024 15:31:18 +0200 Subject: [PATCH 68/69] panama-backend - troubleshoot mvn test --- feature_tests/java/somelib/pom.xml | 25 +++++++++++++++++-- .../{MyEnumSpec.java => MyEnumTest.java} | 2 +- 2 files changed, 24 insertions(+), 3 deletions(-) rename feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/{MyEnumSpec.java => MyEnumTest.java} (89%) diff --git a/feature_tests/java/somelib/pom.xml b/feature_tests/java/somelib/pom.xml index f4a38ed41..fcedbd6aa 100644 --- a/feature_tests/java/somelib/pom.xml +++ b/feature_tests/java/somelib/pom.xml @@ -28,14 +28,35 @@ org.openjdk.jmh jmh-core - RELEASE + 1.37 org.openjdk.jmh jmh-generator-annprocess - RELEASE + 1.37 provided + + org.apache.maven.surefire + surefire-junit47 + 3.5.0 + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.5.0 + + + + + + + + + + \ No newline at end of file diff --git a/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/MyEnumSpec.java b/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/MyEnumTest.java similarity index 89% rename from feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/MyEnumSpec.java rename to feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/MyEnumTest.java index b9b4daa2c..a94e2bae3 100644 --- a/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/MyEnumSpec.java +++ b/feature_tests/java/somelib/src/test/java/dev/diplomattest/somelib/MyEnumTest.java @@ -4,7 +4,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; -public class MyEnumSpec { +public class MyEnumTest { @Test public void testGetA() { assertEquals(MyEnum.getA(), MyEnum.A); From 8675eb3d225e446833c4362c6c199fa3dee6693d Mon Sep 17 00:00:00 2001 From: Jan Cristina Date: Fri, 13 Sep 2024 15:33:10 +0200 Subject: [PATCH 69/69] panama-backend - remove pom comments --- feature_tests/java/somelib/pom.xml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/feature_tests/java/somelib/pom.xml b/feature_tests/java/somelib/pom.xml index fcedbd6aa..6b891859c 100644 --- a/feature_tests/java/somelib/pom.xml +++ b/feature_tests/java/somelib/pom.xml @@ -48,13 +48,6 @@ org.apache.maven.plugins maven-surefire-plugin 3.5.0 - - - - - - -