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.StructValidation
Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer
Pointer.Default
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
The struct alignment in bytes.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct size in bytes.static final int
The struct member offsets.static final int
The 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 aRPMallocConfig
instance at the current position of the specifiedByteBuffer
container. -
Method Summary
Modifier and TypeMethodDescriptionstatic RPMallocConfig
calloc()
Returns a newRPMallocConfig
instance allocated withmemCalloc
.static RPMallocConfig
calloc
(MemoryStack stack) Returns a newRPMallocConfig
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static RPMallocConfig
Deprecated.static RPMallocConfig
callocStack
(MemoryStack stack) Deprecated.static RPMallocConfig
create()
Returns a newRPMallocConfig
instance allocated withBufferUtils
.static RPMallocConfig
create
(long address) Returns a newRPMallocConfig
instance for the specified memory address.static @Nullable RPMallocConfig
createSafe
(long address) boolean
enable_huge_pages
(boolean value) Sets the specified value to theenable_huge_pages
field.@Nullable RPErrorCallback
error_callback
(@Nullable RPErrorCallbackI value) Sets the specified value to theerror_callback
field.@Nullable ByteBuffer
huge_page_name
(@Nullable ByteBuffer value) Sets the address of the specified encoded string to thehuge_page_name
field.@Nullable String
static RPMallocConfig
malloc()
Returns a newRPMallocConfig
instance allocated withmemAlloc
.static RPMallocConfig
malloc
(MemoryStack stack) Returns a newRPMallocConfig
instance allocated on the specifiedMemoryStack
.static RPMallocConfig
Deprecated.static RPMallocConfig
mallocStack
(MemoryStack stack) Deprecated.@Nullable RPMapFailCallback
map_fail_callback
(@Nullable RPMapFailCallbackI value) Sets the specified value to themap_fail_callback
field.@Nullable RPMemoryMapCallback
memory_map
(@Nullable RPMemoryMapCallbackI value) Sets the specified value to thememory_map
field.@Nullable RPMemoryUnmapCallback
memory_unmap
(@Nullable RPMemoryUnmapCallbackI value) Sets the specified value to thememory_unmap
field.static int
nenable_huge_pages
(long struct) Unsafe version ofenable_huge_pages()
.static void
nenable_huge_pages
(long struct, int value) Unsafe version ofenable_huge_pages
.static @Nullable RPErrorCallback
nerror_callback
(long struct) Unsafe version oferror_callback()
.static void
nerror_callback
(long struct, @Nullable RPErrorCallbackI value) Unsafe version oferror_callback
.static @Nullable ByteBuffer
nhuge_page_name
(long struct) Unsafe version ofhuge_page_name()
.static void
nhuge_page_name
(long struct, @Nullable ByteBuffer value) Unsafe version ofhuge_page_name
.static @Nullable String
nhuge_page_nameString
(long struct) Unsafe version ofhuge_page_nameString()
.static @Nullable RPMapFailCallback
nmap_fail_callback
(long struct) Unsafe version ofmap_fail_callback()
.static void
nmap_fail_callback
(long struct, @Nullable RPMapFailCallbackI value) Unsafe version ofmap_fail_callback
.static @Nullable RPMemoryMapCallback
nmemory_map
(long struct) Unsafe version ofmemory_map()
.static void
nmemory_map
(long struct, @Nullable RPMemoryMapCallbackI value) Unsafe version ofmemory_map
.static @Nullable RPMemoryUnmapCallback
nmemory_unmap
(long struct) Unsafe version ofmemory_unmap()
.static void
nmemory_unmap
(long struct, @Nullable RPMemoryUnmapCallbackI value) Unsafe version ofmemory_unmap
.static @Nullable ByteBuffer
npage_name
(long struct) Unsafe version ofpage_name()
.static void
npage_name
(long struct, @Nullable ByteBuffer value) Unsafe version ofpage_name
.static @Nullable String
npage_nameString
(long struct) Unsafe version ofpage_nameString()
.static long
npage_size
(long struct) Unsafe version ofpage_size()
.static void
npage_size
(long struct, long value) Unsafe version ofpage_size
.static long
nspan_map_count
(long struct) Unsafe version ofspan_map_count()
.static void
nspan_map_count
(long struct, long value) Unsafe version ofspan_map_count
.static long
nspan_size
(long struct) Unsafe version ofspan_size()
.static void
nspan_size
(long struct, long value) Unsafe version ofspan_size
.@Nullable ByteBuffer
page_name
(@Nullable ByteBuffer value) Sets the address of the specified encoded string to thepage_name
field.@Nullable String
long
page_size
(long value) Sets the specified value to thepage_size
field.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.int
sizeof()
Returnssizeof(struct)
.long
span_map_count
(long value) Sets the specified value to thespan_map_count
field.long
span_size
(long value) Sets the specified value to thespan_size
field.Methods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toString
Methods 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 aRPMallocConfig
instance at the current position of the specifiedByteBuffer
container. 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:Struct
Returnssizeof(struct)
.- Specified by:
sizeof
in classStruct<RPMallocConfig>
-
memory_map
- Returns:
- the value of the
memory_map
field.
-
memory_unmap
- Returns:
- the value of the
memory_unmap
field.
-
error_callback
- Returns:
- the value of the
error_callback
field.
-
map_fail_callback
- Returns:
- the value of the
map_fail_callback
field.
-
page_size
public long page_size()- Returns:
- the value of the
page_size
field.
-
span_size
public long span_size()- Returns:
- the value of the
span_size
field.
-
span_map_count
public long span_map_count()- Returns:
- the value of the
span_map_count
field.
-
enable_huge_pages
public boolean enable_huge_pages()- Returns:
- the value of the
enable_huge_pages
field.
-
page_name
- Returns:
- a
ByteBuffer
view of the null-terminated string pointed to by thepage_name
field.
-
page_nameString
- Returns:
- the null-terminated string pointed to by the
page_name
field.
-
huge_page_name
- Returns:
- a
ByteBuffer
view of the null-terminated string pointed to by thehuge_page_name
field.
-
huge_page_nameString
- Returns:
- the null-terminated string pointed to by the
huge_page_name
field.
-
memory_map
Sets the specified value to thememory_map
field. -
memory_unmap
Sets the specified value to thememory_unmap
field. -
error_callback
Sets the specified value to theerror_callback
field. -
map_fail_callback
Sets the specified value to themap_fail_callback
field. -
page_size
Sets the specified value to thepage_size
field. -
span_size
Sets the specified value to thespan_size
field. -
span_map_count
Sets the specified value to thespan_map_count
field. -
enable_huge_pages
Sets the specified value to theenable_huge_pages
field. -
page_name
Sets the address of the specified encoded string to thepage_name
field. -
huge_page_name
Sets the address of the specified encoded string to thehuge_page_name
field. -
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 newRPMallocConfig
instance allocated withmemAlloc
. The instance must be explicitly freed. -
calloc
Returns a newRPMallocConfig
instance allocated withmemCalloc
. The instance must be explicitly freed. -
create
Returns a newRPMallocConfig
instance allocated withBufferUtils
. -
create
Returns a newRPMallocConfig
instance for the specified memory address. -
createSafe
-
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)
instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)
instead. -
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)
instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)
instead. -
malloc
Returns a newRPMallocConfig
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
calloc
Returns a newRPMallocConfig
instance allocated on the specifiedMemoryStack
and 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
.
-