- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
DestroyFunc the type of function which is called when a data element is
destroyed. It is passed the pointer to the data element and should free any
memory and resources allocated for it.
- Since:
- 1.0
-
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy(MemorySegment data) The function to implement as callback in a destroy operation.default MemorySegmenttoCallback(Arena arena) Generates an upcall stub, a C function pointer that will callupcall(java.lang.foreign.MemorySegment).default voidupcall(MemorySegment data) The callback that is executed by native code.
-
Method Details
-
destroy
The function to implement as callback in a destroy operation.- Parameters:
data- the data element being destroyed.- Since:
- 1.0
-
upcall
The callback that is executed by native code. This method marshals the parameters and callsdestroy(java.lang.foreign.MemorySegment).- Parameters:
data- the data element being destroyed.- Since:
- 1.0
-
toCallback
Generates an upcall stub, a C function pointer that will callupcall(java.lang.foreign.MemorySegment).- Parameters:
arena- the arena in which the upcall stub will be allocated- Returns:
- the function pointer of the upcall stub
- Since:
- 1.0
-