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 the RPMallocConfig 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
      • Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer

        org.lwjgl.system.Pointer.Default
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String SIGNATURE  
      • Fields inherited from interface org.lwjgl.system.Pointer

        BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE
    • Method Detail

      • getSignature

        default java.lang.String getSignature()
        Specified by:
        getSignature in interface org.lwjgl.system.CallbackI
      • callback

        default long callback​(long args)
        Specified by:
        callback in interface org.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 a memory_unmap function or else the default implementation will be used for both.

        Parameters:
        size - the number of bytes to map
        offset - the alignment offset