Package org.lwjgl.system.rpmalloc
Interface RPMemoryMapCallbackI
-
- All Superinterfaces:
org.lwjgl.system.CallbackI
,org.lwjgl.system.CallbackI.P
,org.lwjgl.system.Pointer
- All Known Implementing Classes:
RPMemoryMapCallback
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface RPMemoryMapCallbackI extends org.lwjgl.system.CallbackI.P
Instances of this interface may be set to theRPMallocConfig
struct.Type
void * (*) ( size_t size, size_t *offset )
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.lwjgl.system.CallbackI
org.lwjgl.system.CallbackI.B, org.lwjgl.system.CallbackI.D, org.lwjgl.system.CallbackI.F, org.lwjgl.system.CallbackI.I, org.lwjgl.system.CallbackI.J, org.lwjgl.system.CallbackI.N, org.lwjgl.system.CallbackI.P, org.lwjgl.system.CallbackI.S, org.lwjgl.system.CallbackI.V, org.lwjgl.system.CallbackI.Z
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
SIGNATURE
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default long
callback(long args)
default java.lang.String
getSignature()
long
invoke(long size, long offset)
Map memory pages for the given number of bytes.
-
-
-
Field Detail
-
SIGNATURE
static final java.lang.String SIGNATURE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getSignature
default java.lang.String getSignature()
- Specified by:
getSignature
in interfaceorg.lwjgl.system.CallbackI
-
callback
default long callback(long args)
- Specified by:
callback
in interfaceorg.lwjgl.system.CallbackI.P
-
invoke
long invoke(long size, long offset)
Map memory pages for the given number of bytes.The returned address MUST be aligned to the rpmalloc span size, which will always be a power of two. Optionally the function can store an alignment offset in the offset variable in case it performs alignment and the returned pointer is offset from the actual start of the memory region due to this alignment. The alignment offset will be passed to the memory unmap function. The alignment offset MUST NOT be larger than 65535 (storable in an
uint16_t
), if it is you must use natural alignment to shift it into 16 bits.If you set a
memory_map
function, you must also set amemory_unmap
function or else the default implementation will be used for both.- Parameters:
size
- the number of bytes to mapoffset
- the alignment offset
-
-