Interface MemoryMapFunction
- All Superinterfaces:
FunctionPointer
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
@Generated("org.javagi.JavaGI")
public interface MemoryMapFunction
extends FunctionPointer
Functional interface declaration of the MemoryMapFunction callback.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionGet the memory ofmemthat can be accessed according to the mode specified inflags.The function should return a pointer that contains at leastmaxsizebytes.default MemorySegmenttoCallback(Arena arena) Creates a native function pointer to theupcall(MemorySegment, long, int)method.default MemorySegmentupcall(MemorySegment mem, long maxsize, int flags) Theupcallmethod is called from native code.
-
Method Details
-
run
Get the memory ofmemthat can be accessed according to the mode specified inflags.The function should return a pointer that contains at leastmaxsizebytes.- Parameters:
mem- aGstMemorymaxsize- size to mapflags- access mode for the memory- Returns:
- a pointer to memory of which at least
maxsizebytes can be accessed according to the access pattern inflags.
-
upcall
Theupcallmethod is called from native code. The parameters are marshaled andrun(Memory, long, int)is executed. -
toCallback
Creates a native function pointer to theupcall(MemorySegment, long, int)method.- Specified by:
toCallbackin interfaceFunctionPointer- Parameters:
arena- the arena in which the function pointer is allocated- Returns:
- the native function pointer
-