Package org.lwjgl.system.rpmalloc
Class RPMallocConfig
- All Implemented Interfaces:
AutoCloseable,NativeResource,Pointer
struct rpmalloc_config_t {
void * (* memory_map) (size_t size, size_t * offset);
void (* memory_unmap) (void * address, size_t size, size_t offset, int release);
void (* error_callback) (char const * message);
int (* map_fail_callback) (size_t size);
size_t page_size;
size_t span_size;
size_t span_map_count;
int enable_huge_pages;
char const * page_name;
char const * huge_page_name;
}-
Nested Class Summary
Nested classes/interfaces inherited from class org.lwjgl.system.Struct
Struct.StructValidationNested classes/interfaces inherited from interface org.lwjgl.system.Pointer
Pointer.Default -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe struct alignment in bytes.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct size in bytes.static final intThe struct member offsets.static final intThe struct member offsets.Fields inherited from interface org.lwjgl.system.Pointer
BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionRPMallocConfig(ByteBuffer container) Creates aRPMallocConfiginstance at the current position of the specifiedByteBuffercontainer. -
Method Summary
Modifier and TypeMethodDescriptionstatic RPMallocConfigcalloc()Returns a newRPMallocConfiginstance allocated withmemCalloc.static RPMallocConfigcalloc(MemoryStack stack) Returns a newRPMallocConfiginstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static RPMallocConfigcreate()Returns a newRPMallocConfiginstance allocated withBufferUtils.static RPMallocConfigcreate(long address) Returns a newRPMallocConfiginstance for the specified memory address.static @Nullable RPMallocConfigcreateSafe(long address) booleanenable_huge_pages(boolean value) Sets the specified value to theenable_huge_pagesfield.@Nullable RPErrorCallbackerror_callback(@Nullable RPErrorCallbackI value) Sets the specified value to theerror_callbackfield.@Nullable ByteBufferhuge_page_name(@Nullable ByteBuffer value) Sets the address of the specified encoded string to thehuge_page_namefield.@Nullable Stringstatic RPMallocConfigmalloc()Returns a newRPMallocConfiginstance allocated withmemAlloc.static RPMallocConfigmalloc(MemoryStack stack) Returns a newRPMallocConfiginstance allocated on the specifiedMemoryStack.@Nullable RPMapFailCallbackmap_fail_callback(@Nullable RPMapFailCallbackI value) Sets the specified value to themap_fail_callbackfield.@Nullable RPMemoryMapCallbackmemory_map(@Nullable RPMemoryMapCallbackI value) Sets the specified value to thememory_mapfield.@Nullable RPMemoryUnmapCallbackmemory_unmap(@Nullable RPMemoryUnmapCallbackI value) Sets the specified value to thememory_unmapfield.static intnenable_huge_pages(long struct) Unsafe version ofenable_huge_pages().static voidnenable_huge_pages(long struct, int value) Unsafe version ofenable_huge_pages.static @Nullable RPErrorCallbacknerror_callback(long struct) Unsafe version oferror_callback().static voidnerror_callback(long struct, @Nullable RPErrorCallbackI value) Unsafe version oferror_callback.static @Nullable ByteBuffernhuge_page_name(long struct) Unsafe version ofhuge_page_name().static voidnhuge_page_name(long struct, @Nullable ByteBuffer value) Unsafe version ofhuge_page_name.static @Nullable Stringnhuge_page_nameString(long struct) Unsafe version ofhuge_page_nameString().static @Nullable RPMapFailCallbacknmap_fail_callback(long struct) Unsafe version ofmap_fail_callback().static voidnmap_fail_callback(long struct, @Nullable RPMapFailCallbackI value) Unsafe version ofmap_fail_callback.static @Nullable RPMemoryMapCallbacknmemory_map(long struct) Unsafe version ofmemory_map().static voidnmemory_map(long struct, @Nullable RPMemoryMapCallbackI value) Unsafe version ofmemory_map.static @Nullable RPMemoryUnmapCallbacknmemory_unmap(long struct) Unsafe version ofmemory_unmap().static voidnmemory_unmap(long struct, @Nullable RPMemoryUnmapCallbackI value) Unsafe version ofmemory_unmap.static @Nullable ByteBuffernpage_name(long struct) Unsafe version ofpage_name().static voidnpage_name(long struct, @Nullable ByteBuffer value) Unsafe version ofpage_name.static @Nullable Stringnpage_nameString(long struct) Unsafe version ofpage_nameString().static longnpage_size(long struct) Unsafe version ofpage_size().static voidnpage_size(long struct, long value) Unsafe version ofpage_size.static longnspan_map_count(long struct) Unsafe version ofspan_map_count().static voidnspan_map_count(long struct, long value) Unsafe version ofspan_map_count.static longnspan_size(long struct) Unsafe version ofspan_size().static voidnspan_size(long struct, long value) Unsafe version ofspan_size.@Nullable ByteBufferpage_name(@Nullable ByteBuffer value) Sets the address of the specified encoded string to thepage_namefield.@Nullable Stringlongpage_size(long value) Sets the specified value to thepage_sizefield.set(@Nullable RPMemoryMapCallbackI memory_map, @Nullable RPMemoryUnmapCallbackI memory_unmap, @Nullable RPErrorCallbackI error_callback, @Nullable RPMapFailCallbackI map_fail_callback, long page_size, long span_size, long span_map_count, boolean enable_huge_pages, @Nullable ByteBuffer page_name, @Nullable ByteBuffer huge_page_name) Initializes this struct with the specified values.set(RPMallocConfig src) Copies the specified struct data to this struct.intsizeof()Returnssizeof(struct).longspan_map_count(long value) Sets the specified value to thespan_map_countfield.longspan_size(long value) Sets the specified value to thespan_sizefield.Methods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toStringMethods inherited from interface org.lwjgl.system.NativeResource
close, free
-
Field Details
-
SIZEOF
public static final int SIZEOFThe struct size in bytes. -
ALIGNOF
public static final int ALIGNOFThe struct alignment in bytes. -
MEMORY_MAP
public static final int MEMORY_MAPThe struct member offsets. -
MEMORY_UNMAP
public static final int MEMORY_UNMAPThe struct member offsets. -
ERROR_CALLBACK
public static final int ERROR_CALLBACKThe struct member offsets. -
MAP_FAIL_CALLBACK
public static final int MAP_FAIL_CALLBACKThe struct member offsets. -
PAGE_SIZE
public static final int PAGE_SIZEThe struct member offsets. -
SPAN_SIZE
public static final int SPAN_SIZEThe struct member offsets. -
SPAN_MAP_COUNT
public static final int SPAN_MAP_COUNTThe struct member offsets. -
ENABLE_HUGE_PAGES
public static final int ENABLE_HUGE_PAGESThe struct member offsets. -
PAGE_NAME
public static final int PAGE_NAMEThe struct member offsets. -
HUGE_PAGE_NAME
public static final int HUGE_PAGE_NAMEThe struct member offsets.
-
-
Constructor Details
-
RPMallocConfig
Creates aRPMallocConfiginstance at the current position of the specifiedByteBuffercontainer. Changes to the buffer's content will be visible to the struct instance and vice versa.The created instance holds a strong reference to the container object.
-
-
Method Details
-
sizeof
public int sizeof()Description copied from class:StructReturnssizeof(struct).- Specified by:
sizeofin classStruct<RPMallocConfig>
-
memory_map
- Returns:
- the value of the
memory_mapfield.
-
memory_unmap
- Returns:
- the value of the
memory_unmapfield.
-
error_callback
- Returns:
- the value of the
error_callbackfield.
-
map_fail_callback
- Returns:
- the value of the
map_fail_callbackfield.
-
page_size
public long page_size()- Returns:
- the value of the
page_sizefield.
-
span_size
public long span_size()- Returns:
- the value of the
span_sizefield.
-
span_map_count
public long span_map_count()- Returns:
- the value of the
span_map_countfield.
-
enable_huge_pages
public boolean enable_huge_pages()- Returns:
- the value of the
enable_huge_pagesfield.
-
page_name
- Returns:
- a
ByteBufferview of the null-terminated string pointed to by thepage_namefield.
-
page_nameString
- Returns:
- the null-terminated string pointed to by the
page_namefield.
-
huge_page_name
- Returns:
- a
ByteBufferview of the null-terminated string pointed to by thehuge_page_namefield.
-
huge_page_nameString
- Returns:
- the null-terminated string pointed to by the
huge_page_namefield.
-
memory_map
Sets the specified value to thememory_mapfield. -
memory_unmap
Sets the specified value to thememory_unmapfield. -
error_callback
Sets the specified value to theerror_callbackfield. -
map_fail_callback
Sets the specified value to themap_fail_callbackfield. -
page_size
Sets the specified value to thepage_sizefield. -
span_size
Sets the specified value to thespan_sizefield. -
span_map_count
Sets the specified value to thespan_map_countfield. -
enable_huge_pages
Sets the specified value to theenable_huge_pagesfield. -
page_name
Sets the address of the specified encoded string to thepage_namefield. -
huge_page_name
Sets the address of the specified encoded string to thehuge_page_namefield. -
set
public RPMallocConfig set(@Nullable RPMemoryMapCallbackI memory_map, @Nullable RPMemoryUnmapCallbackI memory_unmap, @Nullable RPErrorCallbackI error_callback, @Nullable RPMapFailCallbackI map_fail_callback, long page_size, long span_size, long span_map_count, boolean enable_huge_pages, @Nullable ByteBuffer page_name, @Nullable ByteBuffer huge_page_name) Initializes this struct with the specified values. -
set
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
Returns a newRPMallocConfiginstance allocated withmemAlloc. The instance must be explicitly freed. -
calloc
Returns a newRPMallocConfiginstance allocated withmemCalloc. The instance must be explicitly freed. -
create
Returns a newRPMallocConfiginstance allocated withBufferUtils. -
create
Returns a newRPMallocConfiginstance for the specified memory address. -
createSafe
-
malloc
Returns a newRPMallocConfiginstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
Returns a newRPMallocConfiginstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
nmemory_map
Unsafe version ofmemory_map(). -
nmemory_unmap
Unsafe version ofmemory_unmap(). -
nerror_callback
Unsafe version oferror_callback(). -
nmap_fail_callback
Unsafe version ofmap_fail_callback(). -
npage_size
public static long npage_size(long struct) Unsafe version ofpage_size(). -
nspan_size
public static long nspan_size(long struct) Unsafe version ofspan_size(). -
nspan_map_count
public static long nspan_map_count(long struct) Unsafe version ofspan_map_count(). -
nenable_huge_pages
public static int nenable_huge_pages(long struct) Unsafe version ofenable_huge_pages(). -
npage_name
Unsafe version ofpage_name(). -
npage_nameString
Unsafe version ofpage_nameString(). -
nhuge_page_name
Unsafe version ofhuge_page_name(). -
nhuge_page_nameString
Unsafe version ofhuge_page_nameString(). -
nmemory_map
Unsafe version ofmemory_map. -
nmemory_unmap
Unsafe version ofmemory_unmap. -
nerror_callback
Unsafe version oferror_callback. -
nmap_fail_callback
Unsafe version ofmap_fail_callback. -
npage_size
public static void npage_size(long struct, long value) Unsafe version ofpage_size. -
nspan_size
public static void nspan_size(long struct, long value) Unsafe version ofspan_size. -
nspan_map_count
public static void nspan_map_count(long struct, long value) Unsafe version ofspan_map_count. -
nenable_huge_pages
public static void nenable_huge_pages(long struct, int value) Unsafe version ofenable_huge_pages. -
npage_name
Unsafe version ofpage_name. -
nhuge_page_name
Unsafe version ofhuge_page_name.
-