@@ -183,79 +183,6 @@ public static void log_id(MemorySegment struct, MemorySegment fieldValue) {
183183 struct .set (log_id$LAYOUT , log_id$OFFSET , fieldValue );
184184 }
185185
186- /**
187- * {@snippet lang=c :
188- * OrtLoggingFunction custom_logging_function
189- * }
190- */
191- public static final class custom_logging_function {
192-
193- private custom_logging_function () {
194- // Should not be called directly
195- }
196-
197- /**
198- * The function pointer signature, expressed as a functional interface
199- */
200- public interface Function {
201- void apply (
202- MemorySegment _x0 ,
203- int _x1 ,
204- MemorySegment _x2 ,
205- MemorySegment _x3 ,
206- MemorySegment _x4 ,
207- MemorySegment _x5 );
208- }
209-
210- private static final FunctionDescriptor $DESC = FunctionDescriptor .ofVoid (
211- onnxruntime_all_h .C_POINTER ,
212- onnxruntime_all_h .C_INT ,
213- onnxruntime_all_h .C_POINTER ,
214- onnxruntime_all_h .C_POINTER ,
215- onnxruntime_all_h .C_POINTER ,
216- onnxruntime_all_h .C_POINTER );
217-
218- /**
219- * The descriptor of this function pointer
220- */
221- public static FunctionDescriptor descriptor () {
222- return $DESC ;
223- }
224-
225- private static final MethodHandle UP$MH =
226- onnxruntime_all_h .upcallHandle (custom_logging_function .Function .class , "apply" , $DESC );
227-
228- /**
229- * Allocates a new upcall stub, whose implementation is defined by {@code fi}.
230- * The lifetime of the returned segment is managed by {@code arena}
231- */
232- public static MemorySegment allocate (custom_logging_function .Function fi , Arena arena ) {
233- return Linker .nativeLinker ().upcallStub (UP$MH .bindTo (fi ), $DESC , arena );
234- }
235-
236- private static final MethodHandle DOWN$MH = Linker .nativeLinker ().downcallHandle ($DESC );
237-
238- /**
239- * Invoke the upcall stub {@code funcPtr}, with given parameters
240- */
241- public static void invoke (
242- MemorySegment funcPtr ,
243- MemorySegment _x0 ,
244- int _x1 ,
245- MemorySegment _x2 ,
246- MemorySegment _x3 ,
247- MemorySegment _x4 ,
248- MemorySegment _x5 ) {
249- try {
250- DOWN$MH .invokeExact (funcPtr , _x0 , _x1 , _x2 , _x3 , _x4 , _x5 );
251- } catch (Error | RuntimeException ex ) {
252- throw ex ;
253- } catch (Throwable ex$ ) {
254- throw new AssertionError ("should not reach here" , ex$ );
255- }
256- }
257- }
258-
259186 private static final AddressLayout custom_logging_function$LAYOUT =
260187 (AddressLayout ) $LAYOUT .select (groupElement ("custom_logging_function" ));
261188
0 commit comments