Package org.lwjgl.util.lz4
Class LZ4FCustomMem
- All Implemented Interfaces:
AutoCloseable
,NativeResource
,Pointer
struct LZ4F_CustomMem {
{@link LZ4FAllocFunctionI LZ4F_AllocFunction} customAlloc;
{@link LZ4FCallocFunctionI LZ4F_CallocFunction} customCalloc;
{@link LZ4FFreeFunctionI LZ4F_FreeFunction} customFree;
void * opaqueState;
}
-
Nested Class Summary
Nested ClassesNested 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 size in bytes.Fields inherited from interface org.lwjgl.system.Pointer
BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE
-
Constructor Summary
ConstructorsConstructorDescriptionLZ4FCustomMem
(ByteBuffer container) Creates aLZ4FCustomMem
instance at the current position of the specifiedByteBuffer
container. -
Method Summary
Modifier and TypeMethodDescriptionstatic LZ4FCustomMem
calloc()
Returns a newLZ4FCustomMem
instance allocated withmemCalloc
.static LZ4FCustomMem.Buffer
calloc
(int capacity) Returns a newLZ4FCustomMem.Buffer
instance allocated withmemCalloc
.static LZ4FCustomMem.Buffer
calloc
(int capacity, MemoryStack stack) Returns a newLZ4FCustomMem.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static LZ4FCustomMem
calloc
(MemoryStack stack) Returns a newLZ4FCustomMem
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static LZ4FCustomMem
create()
Returns a newLZ4FCustomMem
instance allocated withBufferUtils
.static LZ4FCustomMem.Buffer
create
(int capacity) Returns a newLZ4FCustomMem.Buffer
instance allocated withBufferUtils
.static LZ4FCustomMem
create
(long address) Returns a newLZ4FCustomMem
instance for the specified memory address.static LZ4FCustomMem.Buffer
create
(long address, int capacity) Create aLZ4FCustomMem.Buffer
instance at the specified memory.static @Nullable LZ4FCustomMem
createSafe
(long address) static @Nullable LZ4FCustomMem.Buffer
createSafe
(long address, int capacity) customAlloc
(LZ4FAllocFunctionI value) Sets the specified value to thecustomAlloc
field.@Nullable LZ4FCallocFunction
customCalloc
(@Nullable LZ4FCallocFunctionI value) Sets the specified value to thecustomCalloc
field.customFree
(LZ4FFreeFunctionI value) Sets the specified value to thecustomFree
field.static LZ4FCustomMem
malloc()
Returns a newLZ4FCustomMem
instance allocated withmemAlloc
.static LZ4FCustomMem.Buffer
malloc
(int capacity) Returns a newLZ4FCustomMem.Buffer
instance allocated withmemAlloc
.static LZ4FCustomMem.Buffer
malloc
(int capacity, MemoryStack stack) Returns a newLZ4FCustomMem.Buffer
instance allocated on the specifiedMemoryStack
.static LZ4FCustomMem
malloc
(MemoryStack stack) Returns a newLZ4FCustomMem
instance allocated on the specifiedMemoryStack
.static LZ4FAllocFunction
ncustomAlloc
(long struct) Unsafe version ofcustomAlloc()
.static void
ncustomAlloc
(long struct, LZ4FAllocFunctionI value) Unsafe version ofcustomAlloc
.static @Nullable LZ4FCallocFunction
ncustomCalloc
(long struct) Unsafe version ofcustomCalloc()
.static void
ncustomCalloc
(long struct, @Nullable LZ4FCallocFunctionI value) Unsafe version ofcustomCalloc
.static LZ4FFreeFunction
ncustomFree
(long struct) Unsafe version ofcustomFree()
.static void
ncustomFree
(long struct, LZ4FFreeFunctionI value) Unsafe version ofcustomFree
.static long
nopaqueState
(long struct) Unsafe version ofopaqueState()
.static void
nopaqueState
(long struct, long value) Unsafe version ofopaqueState
.long
opaqueState
(long value) Sets the specified value to theopaqueState
field.set
(LZ4FAllocFunctionI customAlloc, LZ4FCallocFunctionI customCalloc, LZ4FFreeFunctionI customFree, long opaqueState) Initializes this struct with the specified values.set
(LZ4FCustomMem src) Copies the specified struct data to this struct.int
sizeof()
Returnssizeof(struct)
.static void
validate
(long struct) Validates pointer members that should not beNULL
.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. -
CUSTOMALLOC
public static final int CUSTOMALLOCThe struct member offsets. -
CUSTOMCALLOC
public static final int CUSTOMCALLOCThe struct member offsets. -
CUSTOMFREE
public static final int CUSTOMFREEThe struct member offsets. -
OPAQUESTATE
public static final int OPAQUESTATEThe struct member offsets.
-
-
Constructor Details
-
LZ4FCustomMem
Creates aLZ4FCustomMem
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<LZ4FCustomMem>
-
customAlloc
- Returns:
- the value of the
customAlloc
field.
-
customCalloc
- Returns:
- the value of the
customCalloc
field.
-
customFree
- Returns:
- the value of the
customFree
field.
-
opaqueState
public long opaqueState()- Returns:
- the value of the
opaqueState
field.
-
customAlloc
Sets the specified value to thecustomAlloc
field. -
customCalloc
Sets the specified value to thecustomCalloc
field. -
customFree
Sets the specified value to thecustomFree
field. -
opaqueState
Sets the specified value to theopaqueState
field. -
set
public LZ4FCustomMem set(LZ4FAllocFunctionI customAlloc, LZ4FCallocFunctionI customCalloc, LZ4FFreeFunctionI customFree, long opaqueState) 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 newLZ4FCustomMem
instance allocated withmemAlloc
. The instance must be explicitly freed. -
calloc
Returns a newLZ4FCustomMem
instance allocated withmemCalloc
. The instance must be explicitly freed. -
create
Returns a newLZ4FCustomMem
instance allocated withBufferUtils
. -
create
Returns a newLZ4FCustomMem
instance for the specified memory address. -
createSafe
-
malloc
Returns a newLZ4FCustomMem.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
Returns a newLZ4FCustomMem.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
Returns a newLZ4FCustomMem.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
Create aLZ4FCustomMem.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
-
malloc
Returns a newLZ4FCustomMem
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
calloc
Returns a newLZ4FCustomMem
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
malloc
Returns a newLZ4FCustomMem.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
capacity
- the buffer capacitystack
- the stack from which to allocate
-
calloc
Returns a newLZ4FCustomMem.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacitystack
- the stack from which to allocate
-
ncustomAlloc
Unsafe version ofcustomAlloc()
. -
ncustomCalloc
Unsafe version ofcustomCalloc()
. -
ncustomFree
Unsafe version ofcustomFree()
. -
nopaqueState
public static long nopaqueState(long struct) Unsafe version ofopaqueState()
. -
ncustomAlloc
Unsafe version ofcustomAlloc
. -
ncustomCalloc
Unsafe version ofcustomCalloc
. -
ncustomFree
Unsafe version ofcustomFree
. -
nopaqueState
public static void nopaqueState(long struct, long value) Unsafe version ofopaqueState
. -
validate
public static void validate(long struct) Validates pointer members that should not beNULL
.- Parameters:
struct
- the struct to validate
-