Package org.lwjgl.util.lz4
Class LZ4FCustomMem
- All Implemented Interfaces:
AutoCloseable,NativeResource,Pointer
struct LZ4F_CustomMem {
LZ4F_AllocFunction customAlloc;
LZ4F_CallocFunction customCalloc;
LZ4F_FreeFunction customFree;
void * opaqueState;
}-
Nested Class Summary
Nested ClassesNested 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 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 aLZ4FCustomMeminstance at the current position of the specifiedByteBuffercontainer. -
Method Summary
Modifier and TypeMethodDescriptionstatic LZ4FCustomMemcalloc()Returns a newLZ4FCustomMeminstance allocated withmemCalloc.static LZ4FCustomMem.Buffercalloc(int capacity) Returns a newLZ4FCustomMem.Bufferinstance allocated withmemCalloc.static LZ4FCustomMem.Buffercalloc(int capacity, MemoryStack stack) Returns a newLZ4FCustomMem.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static LZ4FCustomMemcalloc(MemoryStack stack) Returns a newLZ4FCustomMeminstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static LZ4FCustomMemcreate()Returns a newLZ4FCustomMeminstance allocated withBufferUtils.static LZ4FCustomMem.Buffercreate(int capacity) Returns a newLZ4FCustomMem.Bufferinstance allocated withBufferUtils.static LZ4FCustomMemcreate(long address) Returns a newLZ4FCustomMeminstance for the specified memory address.static LZ4FCustomMem.Buffercreate(long address, int capacity) Create aLZ4FCustomMem.Bufferinstance at the specified memory.static @Nullable LZ4FCustomMemcreateSafe(long address) static @Nullable LZ4FCustomMem.BuffercreateSafe(long address, int capacity) customAlloc(LZ4FAllocFunctionI value) Sets the specified value to thecustomAllocfield.@Nullable LZ4FCallocFunctioncustomCalloc(@Nullable LZ4FCallocFunctionI value) Sets the specified value to thecustomCallocfield.customFree(LZ4FFreeFunctionI value) Sets the specified value to thecustomFreefield.static LZ4FCustomMemmalloc()Returns a newLZ4FCustomMeminstance allocated withmemAlloc.static LZ4FCustomMem.Buffermalloc(int capacity) Returns a newLZ4FCustomMem.Bufferinstance allocated withmemAlloc.static LZ4FCustomMem.Buffermalloc(int capacity, MemoryStack stack) Returns a newLZ4FCustomMem.Bufferinstance allocated on the specifiedMemoryStack.static LZ4FCustomMemmalloc(MemoryStack stack) Returns a newLZ4FCustomMeminstance allocated on the specifiedMemoryStack.static LZ4FAllocFunctionncustomAlloc(long struct) Unsafe version ofcustomAlloc().static voidncustomAlloc(long struct, LZ4FAllocFunctionI value) Unsafe version ofcustomAlloc.static @Nullable LZ4FCallocFunctionncustomCalloc(long struct) Unsafe version ofcustomCalloc().static voidncustomCalloc(long struct, @Nullable LZ4FCallocFunctionI value) Unsafe version ofcustomCalloc.static LZ4FFreeFunctionncustomFree(long struct) Unsafe version ofcustomFree().static voidncustomFree(long struct, LZ4FFreeFunctionI value) Unsafe version ofcustomFree.static longnopaqueState(long struct) Unsafe version ofopaqueState().static voidnopaqueState(long struct, long value) Unsafe version ofopaqueState.longopaqueState(long value) Sets the specified value to theopaqueStatefield.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.intsizeof()Returnssizeof(struct).static voidvalidate(long struct) Validates pointer members that should not beNULL.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. -
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 aLZ4FCustomMeminstance 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<LZ4FCustomMem>
-
customAlloc
- Returns:
- the value of the
customAllocfield.
-
customCalloc
- Returns:
- the value of the
customCallocfield.
-
customFree
- Returns:
- the value of the
customFreefield.
-
opaqueState
public long opaqueState()- Returns:
- the value of the
opaqueStatefield.
-
customAlloc
Sets the specified value to thecustomAllocfield. -
customCalloc
Sets the specified value to thecustomCallocfield. -
customFree
Sets the specified value to thecustomFreefield. -
opaqueState
Sets the specified value to theopaqueStatefield. -
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 newLZ4FCustomMeminstance allocated withmemAlloc. The instance must be explicitly freed. -
calloc
Returns a newLZ4FCustomMeminstance allocated withmemCalloc. The instance must be explicitly freed. -
create
Returns a newLZ4FCustomMeminstance allocated withBufferUtils. -
create
Returns a newLZ4FCustomMeminstance for the specified memory address. -
createSafe
-
malloc
Returns a newLZ4FCustomMem.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
Returns a newLZ4FCustomMem.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
Returns a newLZ4FCustomMem.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
Create aLZ4FCustomMem.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
-
malloc
Returns a newLZ4FCustomMeminstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
Returns a newLZ4FCustomMeminstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
Returns a newLZ4FCustomMem.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
calloc
Returns a newLZ4FCustomMem.Bufferinstance allocated on the specifiedMemoryStackand 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
-