Top Description Inners Constructors Methods
org.lwjgl.system.rpmalloc

public abstract Class RPMemoryMapCallback

extends Callback
implements RPMemoryMapCallbackI
Class Inheritance
All Implemented Interfaces
org.lwjgl.system.rpmalloc.RPMemoryMapCallbackI, org.lwjgl.system.CallbackI, org.lwjgl.system.Pointer
Known Direct Subclasses
org.lwjgl.system.rpmalloc.RPMemoryMapCallback.Container
Imports
javax.annotation.*, org.lwjgl.system.*

Instances of this class may be set to the RPMallocConfig struct.

Type


void * (*invoke) (
    size_t size,
    size_t *offset
)

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Constructor Summary

AccessConstructor and Description
protected
pack-priv
RPMemoryMapCallback(long functionPointer)

Method Summary

Modifier and TypeMethod and Description
public static RPMemoryMapCallback

Returns:

the new RPMemoryMapCallback
create
(long functionPointer)

Creates a RPMemoryMapCallback instance from the specified function pointer.

public static RPMemoryMapCallback
create(RPMemoryMapCallbackI instance)

Creates a RPMemoryMapCallback instance that delegates to the specified RPMemoryMapCallbackI instance.

public static RPMemoryMapCallback
createSafe(long functionPointer)

Like create, but returns null if functionPointer is NULL.

Inherited from org.lwjgl.system.Callback:
addressequalsfreefreegetgetSafehashCodetoString

Constructor Detail

RPMemoryMapCallbackback to summary
protected RPMemoryMapCallback()
RPMemoryMapCallbackback to summary
pack-priv RPMemoryMapCallback(long functionPointer)

Method Detail

createback to summary
public static RPMemoryMapCallback create(long functionPointer)

Creates a RPMemoryMapCallback instance from the specified function pointer.

Returns:RPMemoryMapCallback

the new RPMemoryMapCallback

createback to summary
public static RPMemoryMapCallback create(RPMemoryMapCallbackI instance)

Creates a RPMemoryMapCallback instance that delegates to the specified RPMemoryMapCallbackI instance.

createSafeback to summary
public static RPMemoryMapCallback createSafe(long functionPointer)

Like create, but returns null if functionPointer is NULL.

Annotations
@Nullable
org.lwjgl.system.rpmalloc back to summary

private final Class RPMemoryMapCallback.Container

extends RPMemoryMapCallback
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final RPMemoryMapCallbackI

Constructor Summary

AccessConstructor and Description
pack-priv
Container(long functionPointer, RPMemoryMapCallbackI delegate)

Method Summary

Modifier and TypeMethod and Description
public long
invoke(long
the number of bytes to map
size
,
long
the alignment offset
offset
)

Implements org.lwjgl.system.rpmalloc.RPMemoryMapCallbackI.invoke.

Map memory pages for the given number of bytes.
Inherited from org.lwjgl.system.rpmalloc.RPMemoryMapCallback:
createcreatecreateSafe

Field Detail

delegateback to summary
private final RPMemoryMapCallbackI delegate

Constructor Detail

Containerback to summary
pack-priv Container(long functionPointer, RPMemoryMapCallbackI delegate)

Method Detail

invokeback to summary
public long invoke(long size, long offset)

Implements org.lwjgl.system.rpmalloc.RPMemoryMapCallbackI.invoke.

Doc from org.lwjgl.system.rpmalloc.RPMemoryMapCallbackI.invoke.

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:long

the number of bytes to map

offset:long

the alignment offset

Annotations
@Override