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.NativeResource
Layout
struct ZSTD_customMem {
ZSTD_allocFunction
customAlloc;ZSTD_freeFunction
customFree; void * opaque; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ZSTDCustomMem.Buffer
An array ofZSTDCustomMem
structs.
-
Field Summary
Fields Modifier and Type Field Description static int
ALIGNOF
The struct alignment in bytes.static int
CUSTOMALLOC
CUSTOMFREE
OPAQUEThe struct member offsets.static int
SIZEOF
The struct size in bytes.
-
Constructor Summary
Constructors Constructor Description ZSTDCustomMem(java.nio.ByteBuffer container)
Creates aZSTDCustomMem
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ZSTDCustomMem
calloc()
Returns a newZSTDCustomMem
instance allocated withmemCalloc
.static ZSTDCustomMem.Buffer
calloc(int capacity)
Returns a newZSTDCustomMem.Buffer
instance allocated withmemCalloc
.static ZSTDCustomMem
callocStack()
Returns a newZSTDCustomMem
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static ZSTDCustomMem.Buffer
callocStack(int capacity)
Returns a newZSTDCustomMem.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static ZSTDCustomMem.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newZSTDCustomMem.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static ZSTDCustomMem
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newZSTDCustomMem
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static ZSTDCustomMem
create()
Returns a newZSTDCustomMem
instance allocated withBufferUtils
.static ZSTDCustomMem.Buffer
create(int capacity)
Returns a newZSTDCustomMem.Buffer
instance allocated withBufferUtils
.static ZSTDCustomMem
create(long address)
Returns a newZSTDCustomMem
instance for the specified memory address.static ZSTDCustomMem.Buffer
create(long address, int capacity)
Create aZSTDCustomMem.Buffer
instance at the specified memory.static ZSTDCustomMem
createSafe(long address)
static ZSTDCustomMem.Buffer
createSafe(long address, int capacity)
ZSTDAllocFunction
customAlloc()
Returns the value of thecustomAlloc
field.ZSTDCustomMem
customAlloc(ZSTDAllocFunctionI value)
Sets the specified value to thecustomAlloc
field.ZSTDFreeFunction
customFree()
Returns the value of thecustomFree
field.ZSTDCustomMem
customFree(ZSTDFreeFunctionI value)
Sets the specified value to thecustomFree
field.static ZSTDCustomMem
malloc()
Returns a newZSTDCustomMem
instance allocated withmemAlloc
.static ZSTDCustomMem.Buffer
malloc(int capacity)
Returns a newZSTDCustomMem.Buffer
instance allocated withmemAlloc
.static ZSTDCustomMem
mallocStack()
Returns a newZSTDCustomMem
instance allocated on the thread-localMemoryStack
.static ZSTDCustomMem.Buffer
mallocStack(int capacity)
Returns a newZSTDCustomMem.Buffer
instance allocated on the thread-localMemoryStack
.static ZSTDCustomMem.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newZSTDCustomMem.Buffer
instance allocated on the specifiedMemoryStack
.static ZSTDCustomMem
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newZSTDCustomMem
instance allocated on the specifiedMemoryStack
.static ZSTDAllocFunction
ncustomAlloc(long struct)
Unsafe version ofcustomAlloc()
.static void
ncustomAlloc(long struct, ZSTDAllocFunctionI value)
Unsafe version ofcustomAlloc
.static ZSTDFreeFunction
ncustomFree(long struct)
Unsafe version ofcustomFree()
.static void
ncustomFree(long struct, ZSTDFreeFunctionI value)
Unsafe version ofcustomFree
.static long
nopaque(long struct)
Unsafe version ofopaque()
.static void
nopaque(long struct, long value)
Unsafe version ofopaque
.long
opaque()
Returns the value of theopaque
field.ZSTDCustomMem
opaque(long value)
Sets the specified value to theopaque
field.ZSTDCustomMem
set(ZSTDAllocFunctionI customAlloc, ZSTDFreeFunctionI customFree, long opaque)
Initializes this struct with the specified values.ZSTDCustomMem
set(ZSTDCustomMem src)
Copies the specified struct data to this struct.int
sizeof()
static void
validate(long struct)
Validates pointer members that should not beNULL
.static void
validate(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 aZSTDCustomMem
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 Detail
-
sizeof
public int sizeof()
- Specified by:
sizeof
in classorg.lwjgl.system.Struct
-
customAlloc
public ZSTDAllocFunction customAlloc()
Returns the value of thecustomAlloc
field.
-
customFree
public ZSTDFreeFunction customFree()
Returns the value of thecustomFree
field.
-
opaque
public long opaque()
Returns the value of theopaque
field.
-
customAlloc
public ZSTDCustomMem customAlloc(ZSTDAllocFunctionI value)
Sets the specified value to thecustomAlloc
field.
-
customFree
public ZSTDCustomMem customFree(ZSTDFreeFunctionI value)
Sets the specified value to thecustomFree
field.
-
opaque
public ZSTDCustomMem opaque(long value)
Sets the specified value to theopaque
field.
-
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 newZSTDCustomMem
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static ZSTDCustomMem calloc()
Returns a newZSTDCustomMem
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static ZSTDCustomMem create()
Returns a newZSTDCustomMem
instance allocated withBufferUtils
.
-
create
public static ZSTDCustomMem create(long address)
Returns a newZSTDCustomMem
instance for the specified memory address.
-
createSafe
@Nullable public static ZSTDCustomMem createSafe(long address)
-
malloc
public static ZSTDCustomMem.Buffer malloc(int capacity)
Returns a newZSTDCustomMem.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static ZSTDCustomMem.Buffer calloc(int capacity)
Returns a newZSTDCustomMem.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static ZSTDCustomMem.Buffer create(int capacity)
Returns a newZSTDCustomMem.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static ZSTDCustomMem.Buffer create(long address, int capacity)
Create aZSTDCustomMem.Buffer
instance 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 newZSTDCustomMem
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static ZSTDCustomMem callocStack()
Returns a newZSTDCustomMem
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static ZSTDCustomMem mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newZSTDCustomMem
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static ZSTDCustomMem callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newZSTDCustomMem
instance allocated on the specifiedMemoryStack
and 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.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static ZSTDCustomMem.Buffer callocStack(int capacity)
Returns a newZSTDCustomMem.Buffer
instance allocated on the thread-localMemoryStack
and 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.Buffer
instance 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.Buffer
instance allocated on the specifiedMemoryStack
and 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
-
-