Interface UpcallBinder<T>
public non-sealed interface UpcallBinder<T>
The binder class for upcall interfaces.
Upcall binder implementations can be created using ffmUpcall.
-
Method Summary
Modifier and TypeMethodDescriptiondefault MemorySegmentAllocates an FFM upcall stub for the specified upcall instance.default MemorySegmentallocate(Arena arena, T upcall, Linker.Option... options) Allocates an FFM upcall stub for the specified upcall instance.The upcall function descriptor.handle()The upcall method handle.@Nullable MemoryLayoutstack()The memory layout to use when allocating storage for a struct or union returned by value.
-
Method Details
-
descriptor
-
handle
-
stack
@Nullable MemoryLayout stack()The memory layout to use when allocating storage for a struct or union returned by value.This method is used for integration with LWJGL 3 callbacks. It should not be used for custom bindings.
- Returns:
- the memory layout, or
nullif not applicable
-
allocate
Allocates an FFM upcall stub for the specified upcall instance.- Parameters:
arena- the arena to use for the allocationupcall- the upcall instance- Returns:
- the upcall stub
-
allocate
Allocates an FFM upcall stub for the specified upcall instance.- Parameters:
arena- the arena to use for the allocationupcall- the upcall instanceoptions- the linker options to apply- Returns:
- the upcall stub
-