Package org.lwjgl.util.zstd
Class ZSTDCustomMem
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.util.zstd.ZSTDCustomMem
-
- All Implemented Interfaces:
java.lang.AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class ZSTDCustomMem extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResourceLayout
struct ZSTD_customMem {ZSTD_allocFunctioncustomAlloc;ZSTD_freeFunctioncustomFree; void * opaque; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classZSTDCustomMem.BufferAn array ofZSTDCustomMemstructs.
-
Field Summary
Fields Modifier and Type Field Description static intALIGNOFThe struct alignment in bytes.static intCUSTOMALLOC
CUSTOMFREE
OPAQUEThe struct member offsets.static intSIZEOFThe struct size in bytes.
-
Constructor Summary
Constructors Constructor Description ZSTDCustomMem(java.nio.ByteBuffer container)Creates aZSTDCustomMeminstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ZSTDCustomMemcalloc()Returns a newZSTDCustomMeminstance allocated withmemCalloc.static ZSTDCustomMem.Buffercalloc(int capacity)Returns a newZSTDCustomMem.Bufferinstance allocated withmemCalloc.static ZSTDCustomMemcallocStack()Returns a newZSTDCustomMeminstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static ZSTDCustomMem.BuffercallocStack(int capacity)Returns a newZSTDCustomMem.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static ZSTDCustomMem.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newZSTDCustomMem.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static ZSTDCustomMemcallocStack(org.lwjgl.system.MemoryStack stack)Returns a newZSTDCustomMeminstance allocated on the specifiedMemoryStackand initializes all its bits to zero.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 ZSTDCustomMemcreateSafe(long address)static ZSTDCustomMem.BuffercreateSafe(long address, int capacity)ZSTDAllocFunctioncustomAlloc()Returns the value of thecustomAllocfield.ZSTDCustomMemcustomAlloc(ZSTDAllocFunctionI value)Sets the specified value to thecustomAllocfield.ZSTDFreeFunctioncustomFree()Returns the value of thecustomFreefield.ZSTDCustomMemcustomFree(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 ZSTDCustomMemmallocStack()Returns a newZSTDCustomMeminstance allocated on the thread-localMemoryStack.static ZSTDCustomMem.BuffermallocStack(int capacity)Returns a newZSTDCustomMem.Bufferinstance allocated on the thread-localMemoryStack.static ZSTDCustomMem.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newZSTDCustomMem.Bufferinstance allocated on the specifiedMemoryStack.static ZSTDCustomMemmallocStack(org.lwjgl.system.MemoryStack stack)Returns a newZSTDCustomMeminstance allocated on the specifiedMemoryStack.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()Returns the value of theopaquefield.ZSTDCustomMemopaque(long value)Sets the specified value to theopaquefield.ZSTDCustomMemset(ZSTDAllocFunctionI customAlloc, ZSTDFreeFunctionI customFree, long opaque)Initializes this struct with the specified values.ZSTDCustomMemset(ZSTDCustomMem src)Copies the specified struct data to this struct.intsizeof()static voidvalidate(long struct)Validates pointer members that should not beNULL.static voidvalidate(long array, int count)Callsvalidate(long)for each struct contained in the specified struct array.
-
-
-
Constructor Detail
-
ZSTDCustomMem
public ZSTDCustomMem(java.nio.ByteBuffer container)
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 Detail
-
sizeof
public int sizeof()
- Specified by:
sizeofin classorg.lwjgl.system.Struct
-
customAlloc
public ZSTDAllocFunction customAlloc()
Returns the value of thecustomAllocfield.
-
customFree
public ZSTDFreeFunction customFree()
Returns the value of thecustomFreefield.
-
opaque
public long opaque()
Returns the value of theopaquefield.
-
customAlloc
public ZSTDCustomMem customAlloc(ZSTDAllocFunctionI value)
Sets the specified value to thecustomAllocfield.
-
customFree
public ZSTDCustomMem customFree(ZSTDFreeFunctionI value)
Sets the specified value to thecustomFreefield.
-
opaque
public ZSTDCustomMem opaque(long value)
Sets the specified value to theopaquefield.
-
set
public ZSTDCustomMem set(ZSTDAllocFunctionI customAlloc, ZSTDFreeFunctionI customFree, long opaque)
Initializes this struct with the specified values.
-
set
public ZSTDCustomMem set(ZSTDCustomMem src)
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
public static ZSTDCustomMem malloc()
Returns a newZSTDCustomMeminstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static ZSTDCustomMem calloc()
Returns a newZSTDCustomMeminstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static ZSTDCustomMem create()
Returns a newZSTDCustomMeminstance allocated withBufferUtils.
-
create
public static ZSTDCustomMem create(long address)
Returns a newZSTDCustomMeminstance for the specified memory address.
-
createSafe
@Nullable public static ZSTDCustomMem createSafe(long address)
-
malloc
public static ZSTDCustomMem.Buffer malloc(int capacity)
Returns a newZSTDCustomMem.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static ZSTDCustomMem.Buffer calloc(int capacity)
Returns a newZSTDCustomMem.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static ZSTDCustomMem.Buffer create(int capacity)
Returns a newZSTDCustomMem.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static ZSTDCustomMem.Buffer create(long address, int capacity)
Create aZSTDCustomMem.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static ZSTDCustomMem.Buffer createSafe(long address, int capacity)
-
mallocStack
public static ZSTDCustomMem mallocStack()
Returns a newZSTDCustomMeminstance allocated on the thread-localMemoryStack.
-
callocStack
public static ZSTDCustomMem callocStack()
Returns a newZSTDCustomMeminstance allocated on the thread-localMemoryStackand initializes all its bits to zero.
-
mallocStack
public static ZSTDCustomMem mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newZSTDCustomMeminstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
callocStack
public static ZSTDCustomMem callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newZSTDCustomMeminstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
mallocStack
public static ZSTDCustomMem.Buffer mallocStack(int capacity)
Returns a newZSTDCustomMem.Bufferinstance allocated on the thread-localMemoryStack.- Parameters:
capacity- the buffer capacity
-
callocStack
public static ZSTDCustomMem.Buffer callocStack(int capacity)
Returns a newZSTDCustomMem.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacity
-
mallocStack
public static ZSTDCustomMem.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newZSTDCustomMem.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
callocStack
public static ZSTDCustomMem.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newZSTDCustomMem.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
ncustomAlloc
public static ZSTDAllocFunction ncustomAlloc(long struct)
Unsafe version ofcustomAlloc().
-
ncustomFree
public static ZSTDFreeFunction ncustomFree(long struct)
Unsafe version ofcustomFree().
-
nopaque
public static long nopaque(long struct)
Unsafe version ofopaque().
-
ncustomAlloc
public static void ncustomAlloc(long struct, ZSTDAllocFunctionI value)Unsafe version ofcustomAlloc.
-
ncustomFree
public static void ncustomFree(long struct, ZSTDFreeFunctionI value)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
-
validate
public static void validate(long array, int count)Callsvalidate(long)for each struct contained in the specified struct array.- Parameters:
array- the struct array to validatecount- the number of structs inarray
-
-