Package org.lwjgl.util.zstd
Class ZSTDCustomMem
- All Implemented Interfaces:
AutoCloseable,NativeResource,Pointer
struct ZSTD_customMem {
{@link ZSTDAllocFunctionI ZSTD_allocFunction} customAlloc;
{@link ZSTDFreeFunctionI ZSTD_freeFunction} customFree;
void * opaque;
}-
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 size in bytes.Fields inherited from interface org.lwjgl.system.Pointer
BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionZSTDCustomMem(ByteBuffer container) Creates aZSTDCustomMeminstance at the current position of the specifiedByteBuffercontainer. -
Method Summary
Modifier and TypeMethodDescriptionstatic ZSTDCustomMemcalloc()Returns a newZSTDCustomMeminstance allocated withmemCalloc.static ZSTDCustomMem.Buffercalloc(int capacity) Returns a newZSTDCustomMem.Bufferinstance allocated withmemCalloc.static ZSTDCustomMem.Buffercalloc(int capacity, MemoryStack stack) Returns a newZSTDCustomMem.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static ZSTDCustomMemcalloc(MemoryStack stack) Returns a newZSTDCustomMeminstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static ZSTDCustomMemDeprecated.static ZSTDCustomMem.BuffercallocStack(int capacity) Deprecated.static ZSTDCustomMem.BuffercallocStack(int capacity, MemoryStack stack) Deprecated.static ZSTDCustomMemcallocStack(MemoryStack stack) Deprecated.static ZSTDCustomMemcreate()Returns a newZSTDCustomMeminstance allocated withBufferUtils.static ZSTDCustomMem.Buffercreate(int capacity) Returns a newZSTDCustomMem.Bufferinstance allocated withBufferUtils.static ZSTDCustomMemcreate(long address) Returns a newZSTDCustomMeminstance for the specified memory address.static ZSTDCustomMem.Buffercreate(long address, int capacity) Create aZSTDCustomMem.Bufferinstance at the specified memory.static @Nullable ZSTDCustomMemcreateSafe(long address) static @Nullable ZSTDCustomMem.BuffercreateSafe(long address, int capacity) customAlloc(ZSTDAllocFunctionI value) Sets the specified value to thecustomAllocfield.customFree(ZSTDFreeFunctionI value) Sets the specified value to thecustomFreefield.static ZSTDCustomMemmalloc()Returns a newZSTDCustomMeminstance allocated withmemAlloc.static ZSTDCustomMem.Buffermalloc(int capacity) Returns a newZSTDCustomMem.Bufferinstance allocated withmemAlloc.static ZSTDCustomMem.Buffermalloc(int capacity, MemoryStack stack) Returns a newZSTDCustomMem.Bufferinstance allocated on the specifiedMemoryStack.static ZSTDCustomMemmalloc(MemoryStack stack) Returns a newZSTDCustomMeminstance allocated on the specifiedMemoryStack.static ZSTDCustomMemDeprecated.static ZSTDCustomMem.BuffermallocStack(int capacity) Deprecated.static ZSTDCustomMem.BuffermallocStack(int capacity, MemoryStack stack) Deprecated.static ZSTDCustomMemmallocStack(MemoryStack stack) Deprecated.static ZSTDAllocFunctionncustomAlloc(long struct) Unsafe version ofcustomAlloc().static voidncustomAlloc(long struct, ZSTDAllocFunctionI value) Unsafe version ofcustomAlloc.static ZSTDFreeFunctionncustomFree(long struct) Unsafe version ofcustomFree().static voidncustomFree(long struct, ZSTDFreeFunctionI value) Unsafe version ofcustomFree.static longnopaque(long struct) Unsafe version ofopaque().static voidnopaque(long struct, long value) Unsafe version ofopaque.longopaque()opaque(long value) Sets the specified value to theopaquefield.set(ZSTDAllocFunctionI customAlloc, ZSTDFreeFunctionI customFree, long opaque) Initializes this struct with the specified values.set(ZSTDCustomMem 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. -
CUSTOMFREE
public static final int CUSTOMFREEThe struct member offsets. -
OPAQUE
public static final int OPAQUEThe struct member offsets.
-
-
Constructor Details
-
ZSTDCustomMem
Creates aZSTDCustomMeminstance 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<ZSTDCustomMem>
-
customAlloc
- Returns:
- the value of the
customAllocfield.
-
customFree
- Returns:
- the value of the
customFreefield.
-
opaque
public long opaque()- Returns:
- the value of the
opaquefield.
-
customAlloc
Sets the specified value to thecustomAllocfield. -
customFree
Sets the specified value to thecustomFreefield. -
opaque
Sets the specified value to theopaquefield. -
set
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 newZSTDCustomMeminstance allocated withmemAlloc. The instance must be explicitly freed. -
calloc
Returns a newZSTDCustomMeminstance allocated withmemCalloc. The instance must be explicitly freed. -
create
Returns a newZSTDCustomMeminstance allocated withBufferUtils. -
create
Returns a newZSTDCustomMeminstance for the specified memory address. -
createSafe
-
malloc
Returns a newZSTDCustomMem.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
Returns a newZSTDCustomMem.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
Returns a newZSTDCustomMem.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
Create aZSTDCustomMem.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
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. -
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead. -
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead. -
malloc
Returns a newZSTDCustomMeminstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
Returns a newZSTDCustomMeminstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
Returns a newZSTDCustomMem.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
calloc
Returns a newZSTDCustomMem.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(). -
ncustomFree
Unsafe version ofcustomFree(). -
nopaque
public static long nopaque(long struct) Unsafe version ofopaque(). -
ncustomAlloc
Unsafe version ofcustomAlloc. -
ncustomFree
Unsafe version ofcustomFree. -
nopaque
public static void nopaque(long struct, long value) Unsafe version ofopaque. -
validate
public static void validate(long struct) Validates pointer members that should not beNULL.- Parameters:
struct- the struct to validate
-